open-nomad/ui/app/templates/components/stepper-input.hbs
Buck Doyle 244157786a
Add explicit this to templates (#8388)
This is the result of running the no-implicit-this-codemod, some manual fixes,
and the addition of a linting rule to prevent future ambiguity.
2020-07-09 15:19:07 -05:00

36 lines
972 B
Handlebars

<label
data-test-stepper-label
class="stepper-input-label"
onClick={{action "focusInput"}}>{{yield}}</label>
<input
data-test-stepper-input
type="number"
min={{this.min}}
max={{this.max}}
value={{this.internalValue}}
disabled={{this.disabled}}
class="stepper-input-input"
onFocus={{action "selectValue"}}
onKeyDown={{action "resetTextInput"}}
onChange={{action "setValue"}}>
<button
data-test-stepper-decrement
role="button"
aria-label="decrement"
class="stepper-input-stepper button {{this.class}}"
disabled={{or this.disabled (lte this.internalValue this.min)}}
onclick={{action "decrement"}}
type="button">
{{x-icon "minus-plain"}}
</button>
<button
data-test-stepper-increment
role="button"
aria-label="increment"
class="stepper-input-stepper button {{this.class}}"
disabled={{or this.disabled (gte this.internalValue this.max)}}
onclick={{action "increment"}}
type="button">
{{x-icon "plus-plain"}}
</button>