https://github.com/nullvoxpopuli/ember-spicy-forms
Form library that lets you handle the presentation
https://github.com/nullvoxpopuli/ember-spicy-forms
Last synced: over 1 year ago
JSON representation
Form library that lets you handle the presentation
- Host: GitHub
- URL: https://github.com/nullvoxpopuli/ember-spicy-forms
- Owner: NullVoxPopuli
- License: mit
- Created: 2019-09-11T19:08:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-31T01:17:38.000Z (over 1 year ago)
- Last Synced: 2025-03-30T00:31:41.937Z (over 1 year ago)
- Language: JavaScript
- Size: 415 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
ember-spicy-forms
==============================================================================
Helpers for universal form control.
Notes:
- https://www.npmjs.com/package/validated-proxy
- https://github.com/ololabs/principled-forms
- https://github.com/gossi/spomoda/blob/master/web/app/utils/changeset.ts
- https://github.com/gossi/spomoda/blob/master/web/app/ui/components/skill-form/template.hbs
Goals:
- integration with validation libraries
- able to be given some object that knows how to persistent state (to maybe local storage in case of browser refresh, or computer crash)
- can be given a pojo
- provide helpers for decoupling UI from the from.
- let the user decide when and how to validate?
Maybe Goals:
- store history of change sets (would allow for undo)
- multi stage forms?
API Ideas
```hbs
{{#form.helpersFor 'firstName' as |firstName|}}
{{#if firstName.hasError}}
{{firstName.error}}
{{/if}}
First name
{{/form.helpersFor}}
{{#form.helpersFor 'hasNotifications' as |hasNotifications|}}
Enable Notifications?
{{/form.helpersFor}}
```
Maybe if/when we get hash-splatting, "splashes"?:
```hbs
{{#form.helpersFor 'firstName' as |firstName|}}
{{#if firstName.hasError}}
{{firstName.error}}
{{/if}}
First name
{{/form.helpersFor}}
{{#form.helpersFor 'hasNotifications' as |hasNotifications|}}
Enable Notifications?
{{/form.helpersFor}}
```
Compatibility
------------------------------------------------------------------------------
* Ember.js v3.12 or above
* Ember CLI v3.12 or above
* Node.js v8 or above
Installation
------------------------------------------------------------------------------
```
ember install ember-spicy-forms
```
Usage
------------------------------------------------------------------------------
[Longer description of how to use the addon in apps.]
Contributing
------------------------------------------------------------------------------
See the [Contributing](CONTRIBUTING.md) guide for details.
License
------------------------------------------------------------------------------
This project is licensed under the [MIT License](LICENSE.md).