open-nomad/ui/app/templates/components/stepper-input.hbs
2020-06-18 22:08:29 -07:00

27 lines
705 B
Handlebars

<label data-test-stepper-label class="stepper-input-label">{{yield}}</label>
<input
data-test-stepper-input
type="number"
min={{min}}
max={{max}}
value={{internalValue}}
class="stepper-input-input"
onKeyDown={{action "resetTextInput"}}
onChange={{action "setValue"}}>
<button
data-test-stepper-decrement
role="button"
class="stepper-input-stepper button {{class}}"
disabled={{lte internalValue min}}
onclick={{action "decrement"}}>
{{x-icon "minus-plain"}}
</button>
<button
data-test-stepper-increment
role="button"
class="stepper-input-stepper button {{class}}"
disabled={{gte internalValue max}}
onclick={{action "increment"}}>
{{x-icon "plus-plain"}}
</button>