|
1 |
| -{{! template-lint-disable no-action no-curly-component-invocation no-down-event-binding no-implicit-this no-positive-tabindex }} |
2 |
| -{{#if label}} |
3 |
| - <label for={{inputElementId}} class={{if required "md-required"}}>{{label}}</label> |
| 1 | +{{! template-lint-disable no-action no-curly-component-invocation no-down-event-binding no-positive-tabindex }} |
| 2 | +{{#if @label}} |
| 3 | + <label for={{this.inputElementId}} class={{if @required "md-required"}}>{{@label}}</label> |
4 | 4 | {{/if}}
|
5 | 5 |
|
6 |
| -{{#if icon}} |
7 |
| - {{component iconComponent icon}} |
| 6 | +{{#if @icon}} |
| 7 | + {{component this.iconComponent @icon}} |
8 | 8 | {{/if}}
|
9 | 9 |
|
10 |
| -{{#if textarea}} |
| 10 | +{{#if @textarea}} |
11 | 11 | <textarea
|
12 |
| - class="md-input {{if isInvalid "ng-invalid"}} {{if isTouched "ng-dirty"}}" |
13 |
| - id={{inputElementId}} |
14 |
| - placeholder={{if shouldAddPlaceholder placeholder}} |
15 |
| - disabled={{disabled}} |
16 |
| - autofocus={{autofocus}} |
17 |
| - aria-describedby={{concat elementId "-char-count " elementId "-error-messages"}} |
18 |
| - onfocus={{onFocus}} |
| 12 | + class="md-input {{if this.isInvalid "ng-invalid"}} {{if this.isTouched "ng-dirty"}}" |
| 13 | + id={{this.inputElementId}} |
| 14 | + placeholder={{if this.shouldAddPlaceholder @placeholder}} |
| 15 | + disabled={{this.disabled}} |
| 16 | + autofocus={{this.autofocus}} |
| 17 | + aria-describedby={{concat this.elementId "-char-count " this.elementId "-error-messages"}} |
| 18 | + onfocus={{@onFocus}} |
19 | 19 | onblur={{action "handleBlur"}}
|
20 |
| - onkeydown={{onKeyDown}} |
21 |
| - onkeyup={{onKeyUp}} |
22 |
| - onclick={{onClick}} |
| 20 | + onkeydown={{@onKeyDown}} |
| 21 | + onkeyup={{@onKeyUp}} |
| 22 | + onclick={{@onClick}} |
23 | 23 | oninput={{action "handleInput"}}
|
24 | 24 |
|
25 |
| - name={{passThru.name}} |
26 |
| - rows={{passThru.rows}} |
27 |
| - cols={{passThru.cols}} |
28 |
| - maxlength={{passThru.maxlength}} |
29 |
| - tabindex={{passThru.tabindex}} |
30 |
| - title={{title}} |
31 |
| - required={{passThru.required}} |
32 |
| - selectionEnd={{passThru.selectionEnd}} |
33 |
| - selectionStart={{passThru.selectionStart}} |
34 |
| - selectionDirection={{passThru.selectionDirection}} |
35 |
| - wrap={{passThru.wrap}} |
36 |
| - readonly={{passThru.readonly}} |
37 |
| - form={{passThru.form}} |
38 |
| - spellcheck={{passThru.spellcheck}}></textarea> |
| 25 | + name={{@passThru.name}} |
| 26 | + rows={{@passThru.rows}} |
| 27 | + cols={{@passThru.cols}} |
| 28 | + maxlength={{@passThru.maxlength}} |
| 29 | + tabindex={{@passThru.tabindex}} |
| 30 | + title={{@title}} |
| 31 | + required={{@passThru.required}} |
| 32 | + selectionEnd={{@passThru.selectionEnd}} |
| 33 | + selectionStart={{@passThru.selectionStart}} |
| 34 | + selectionDirection={{@passThru.selectionDirection}} |
| 35 | + wrap={{@passThru.wrap}} |
| 36 | + readonly={{@passThru.readonly}} |
| 37 | + form={{@passThru.form}} |
| 38 | + spellcheck={{@passThru.spellcheck}}></textarea> |
39 | 39 | {{else}}
|
40 | 40 | <input
|
41 |
| - class="md-input {{if isInvalid "ng-invalid"}} {{if isTouched "ng-dirty"}}" |
42 |
| - id={{inputElementId}} |
43 |
| - placeholder={{if shouldAddPlaceholder placeholder}} |
44 |
| - type={{type}} |
45 |
| - disabled={{disabled}} |
46 |
| - autofocus={{autofocus}} |
47 |
| - aria-describedby={{concat elementId "-char-count " elementId "-error-messages"}} |
48 |
| - onfocus={{onFocus}} |
| 41 | + class="md-input {{if this.isInvalid "ng-invalid"}} {{if this.isTouched "ng-dirty"}}" |
| 42 | + id={{this.inputElementId}} |
| 43 | + placeholder={{if this.shouldAddPlaceholder @placeholder}} |
| 44 | + type={{this.type}} |
| 45 | + disabled={{this.disabled}} |
| 46 | + autofocus={{this.autofocus}} |
| 47 | + aria-describedby={{concat this.elementId "-char-count " this.elementId "-error-messages"}} |
| 48 | + onfocus={{@onFocus}} |
49 | 49 | onblur={{action "handleBlur"}}
|
50 |
| - onkeydown={{onKeyDown}} |
51 |
| - onkeyup={{onKeyUp}} |
52 |
| - onclick={{onClick}} |
| 50 | + onkeydown={{@onKeyDown}} |
| 51 | + onkeyup={{@onKeyUp}} |
| 52 | + onclick={{@onClick}} |
53 | 53 | oninput={{action "handleInput"}}
|
54 | 54 |
|
55 |
| - accept={{passThru.accept}} |
56 |
| - autocomplete={{passThru.autocomplete}} |
57 |
| - autocorrect={{passThru.autocorrect}} |
58 |
| - autocapitalize={{passThru.autocapitalize}} |
59 |
| - autosave={{passThru.autosave}} |
60 |
| - form={{passThru.form}} |
61 |
| - formaction={{passThru.formaction}} |
62 |
| - formenctype={{passThru.formenctype}} |
63 |
| - formmethod={{passThru.formmethod}} |
64 |
| - formnovalidate={{passThru.formnovalidate}} |
65 |
| - formtarget={{passThru.formtarget}} |
66 |
| - height={{passThru.height}} |
67 |
| - inputmode={{passThru.inputmode}} |
68 |
| - min={{passThru.min}} |
69 |
| - maxlength={{passThru.maxlength}} |
70 |
| - max={{passThru.max}} |
71 |
| - multiple={{passThru.multiple}} |
72 |
| - name={{passThru.name}} |
73 |
| - pattern={{passThru.pattern}} |
74 |
| - readonly={{passThru.readonly}} |
75 |
| - required={{passThru.required}} |
76 |
| - selectionDirection={{passThru.selectionDirection}} |
77 |
| - size={{passThru.size}} |
78 |
| - spellcheck={{passThru.spellcheck}} |
79 |
| - step={{passThru.step}} |
80 |
| - tabindex={{passThru.tabindex}} |
81 |
| - title={{title}} |
82 |
| - width={{passThru.width}}> |
| 55 | + accept={{@passThru.accept}} |
| 56 | + autocomplete={{@passThru.autocomplete}} |
| 57 | + autocorrect={{@passThru.autocorrect}} |
| 58 | + autocapitalize={{@passThru.autocapitalize}} |
| 59 | + autosave={{@passThru.autosave}} |
| 60 | + form={{@passThru.form}} |
| 61 | + formaction={{@passThru.formaction}} |
| 62 | + formenctype={{@passThru.formenctype}} |
| 63 | + formmethod={{@passThru.formmethod}} |
| 64 | + formnovalidate={{@passThru.formnovalidate}} |
| 65 | + formtarget={{@passThru.formtarget}} |
| 66 | + height={{@passThru.height}} |
| 67 | + inputmode={{@passThru.inputmode}} |
| 68 | + min={{@passThru.min}} |
| 69 | + maxlength={{@passThru.maxlength}} |
| 70 | + max={{@passThru.max}} |
| 71 | + multiple={{@passThru.multiple}} |
| 72 | + name={{@passThru.name}} |
| 73 | + pattern={{@passThru.pattern}} |
| 74 | + readonly={{@passThru.readonly}} |
| 75 | + required={{@passThru.required}} |
| 76 | + selectionDirection={{@passThru.selectionDirection}} |
| 77 | + size={{@passThru.size}} |
| 78 | + spellcheck={{@passThru.spellcheck}} |
| 79 | + step={{@passThru.step}} |
| 80 | + tabindex={{@passThru.tabindex}} |
| 81 | + title={{@title}} |
| 82 | + width={{@passThru.width}}> |
83 | 83 | {{/if}}
|
84 | 84 |
|
85 |
| -{{#unless hideAllMessages}} |
86 |
| - <div class="md-errors-spacer" id={{concat elementId "-char-count"}}> |
87 |
| - {{#if maxlength}} |
88 |
| - <div class="md-char-counter">{{renderCharCount}}</div> |
| 85 | +{{#unless this.hideAllMessages}} |
| 86 | + <div class="md-errors-spacer" id={{concat this.elementId "-char-count"}}> |
| 87 | + {{#if @maxlength}} |
| 88 | + <div class="md-char-counter">{{this.currentLength}}/{{@maxlength}}</div> |
89 | 89 | {{/if}}
|
90 | 90 | </div>
|
91 |
| - {{#if isInvalidAndTouched}} |
92 |
| - <div class="md-input-messages-animation md-auto-hide" id={{concat elementId "-error-messages"}}> |
93 |
| - {{#each validationErrorMessages as |error index|}} |
94 |
| - <div id="error-{{inputElementId}}-{{index}}" |
| 91 | + {{#if this.isInvalidAndTouched}} |
| 92 | + <div class="md-input-messages-animation md-auto-hide" id={{concat this.elementId "-error-messages"}}> |
| 93 | + {{#each this.validationErrorMessages as |error index|}} |
| 94 | + <div id="error-{{this.inputElementId}}-{{index}}" |
95 | 95 | class="paper-input-error ng-enter ng-enter-active md-input-message-animation"
|
96 | 96 | style="opacity: 1; margin-top: 0">
|
97 | 97 | {{error.message}}
|
|
102 | 102 | {{/unless}}
|
103 | 103 |
|
104 | 104 | {{yield (hash
|
105 |
| - charCount=currentLength |
106 |
| - isInvalid=isInvalid |
107 |
| - isTouched=isTouched |
108 |
| - isInvalidAndTouched=isInvalidAndTouched |
109 |
| - hasValue=hasValue |
110 |
| - validationErrorMessages=validationErrorMessages |
| 105 | + charCount=this.currentLength |
| 106 | + isInvalid=this.isInvalid |
| 107 | + isTouched=this.isTouched |
| 108 | + isInvalidAndTouched=this.isInvalidAndTouched |
| 109 | + hasValue=this.hasValue |
| 110 | + validationErrorMessages=this.validationErrorMessages |
111 | 111 | )}}
|
112 | 112 |
|
113 |
| -{{#if iconRight}} |
114 |
| - {{component iconComponent iconRight}} |
| 113 | +{{#if @iconRight}} |
| 114 | + {{component this.iconComponent @iconRight}} |
115 | 115 | {{/if}}
|
0 commit comments