open-nomad/ui/app/templates/components/stepper-input.hbs

37 lines
1019 B
Handlebars

<label
data-test-stepper-label
for="stepper-input-{{this.elementId}}"
class="stepper-input-label">{{yield}}</label>
<input
data-test-stepper-input
type="number"
min={{this.min}}
max={{this.max}}
value={{this.internalValue}}
disabled={{this.disabled}}
id="stepper-input-{{this.elementId}}"
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>