open-nomad/ui/app/templates/components/stepper-input.hbs
Phil Renaud 99185e2d8f
[ui, compliance] Remove the newline after .hbs copyright headers (#16861)
* Remove the newline after .hbs copyright headers

* Trying with the whitespace control char
2023-04-14 13:08:13 -04:00

46 lines
1.1 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
~}}
<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"}}
onKeyUp={{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>