Skip to content

Commit

Permalink
feat: pass attributes to input components
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Feb 21, 2022
1 parent fcda89b commit dc0417d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions addon/components/validated-input.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
(and this.showValidity this.errors)
(component this.errorComponent errors=this.errors)
}}
...attributes
/>
{{/let}}
{{/if}}
6 changes: 6 additions & 0 deletions addon/components/validated-input/-themes/uikit/render.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (or (eq @type "radioGroup") (eq @type "radio-group"))}}
Expand All @@ -36,6 +37,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (or (eq @type "checkboxGroup") (eq @type "checkbox-group"))}}
Expand All @@ -50,6 +52,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (eq @type "checkbox")}}
Expand All @@ -65,6 +68,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (eq @type "textarea")}}
Expand All @@ -83,6 +87,7 @@
@isValid={{@isValid}}
@setDirty={{@setDirty}}
@update={{@update}}
...attributes
/>
{{/let}}
{{else}}
Expand All @@ -100,6 +105,7 @@
@isValid={{@isValid}}
@setDirty={{@setDirty}}
@update={{@update}}
...attributes
/>
{{/let}}
{{/if}}
Expand Down
6 changes: 6 additions & 0 deletions addon/components/validated-input/render.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (or (eq @type "radioGroup") (eq @type "radio-group"))}}
Expand All @@ -35,6 +36,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (or (eq @type "checkboxGroup") (eq @type "checkbox-group"))}}
Expand All @@ -49,6 +51,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (eq @type "checkbox")}}
Expand All @@ -64,6 +67,7 @@
@setDirty={{@setDirty}}
@update={{@update}}
@value={{@value}}
...attributes
/>
{{/let}}
{{else if (eq @type "textarea")}}
Expand All @@ -82,6 +86,7 @@
@isValid={{@isValid}}
@setDirty={{@setDirty}}
@update={{@update}}
...attributes
/>
{{/let}}
{{else}}
Expand All @@ -99,6 +104,7 @@
@isValid={{@isValid}}
@setDirty={{@setDirty}}
@update={{@update}}
...attributes
/>
{{/let}}
{{/if}}
Expand Down
1 change: 1 addition & 0 deletions addon/components/validated-input/types/checkbox-group.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
id="{{@inputId}}-{{i}}"
disabled={{@disabled}}
{{on "input" (fn this.onUpdate option.key)}}
...attributes
/>
{{option.label}}
</label>
Expand Down
1 change: 1 addition & 0 deletions addon/components/validated-input/types/checkbox.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
disabled={{@disabled}}
checked={{@value}}
{{on "input" this.onUpdate}}
...attributes
/>
<@labelComponent />
2 changes: 1 addition & 1 deletion addon/components/validated-input/types/input.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<input
class={{this.class}}
...attributes
{{on "input" this.onUpdate}}
{{on "blur" @setDirty}}
...attributes
/>
1 change: 1 addition & 0 deletions addon/components/validated-input/types/radio-group.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
id="{{@inputId}}-{{i}}"
disabled={{@disabled}}
{{on "input" (fn this.onUpdate option.key)}}
...attributes
/>
{{option.label}}
</label>
Expand Down
2 changes: 1 addition & 1 deletion addon/components/validated-input/types/select.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<select
class={{this.class}}
...attributes
name={{@name}}
id={{@inpudId}}
disabled={{@disabled}}
multiple={{@multiple}}
{{on "change" this.onUpdate}}
{{on "blur" this.onBlur}}
...attributes
>
{{#if (or @prompt @includeBlank)}}
<option
Expand Down
2 changes: 1 addition & 1 deletion addon/components/validated-input/types/textarea.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<textarea
class={{this.class}}
...attributes
{{on "input" this.onUpdate}}
{{on "blur" @setDirty}}
...attributes
>
</textarea>

0 comments on commit dc0417d

Please sign in to comment.