open-vault/ui/stories/form-field.md
Noelle Daley 30dd63b47e
ui/storybook/add form components (#6533)
* storybook: add .md suffix to stories blueprint

* storybook: add FormField

* storybook: update AuthConfigForm docs

* storybook: add FormFieldGroups

* storybook: add MaskedInput

* storybook: add example FormField attr

* storybook: remove actions addon
2019-04-05 14:58:55 -07:00

1.3 KiB

FormField

FormField components are field elements associated with a particular model.

Param Type Default Description
[onChange] Func Called whenever a value on the model changes via the component.
attr Object This is usually derived from ember model attributes lookup, and all members of attr.options are optional.
model DS.Model The Ember Data model that attr is defined on

Example Attr

{
   name: "foo",
   options: {
     label: "Foo",
     defaultValue: "",
     editType: "ttl",
     helpText: "This will be in a tooltip"
   },
   type: "boolean"
}

Example

{{#each @model.fields as |attr|}}
  <FormField data-test-field @attr={{attr}} @model={{this.model}} />
{{/each}}

See