bootstrap-vue-next
Version:
Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development
1 lines • 40.6 kB
Source Map (JSON)
{"version":3,"file":"BFormSpinbutton-BLO0Yf36.mjs","names":[],"sources":["../src/components/BFormSpinbutton/BFormSpinbutton.vue","../src/components/BFormSpinbutton/BFormSpinbutton.vue"],"sourcesContent":["<template>\n <div\n ref=\"_element\"\n class=\"b-form-spinbutton form-control\"\n :class=\"computedClasses\"\n role=\"group\"\n :lang=\"computedLocale\"\n :tabindex=\"props.disabled ? undefined : '-1'\"\n :title=\"props.ariaLabel\"\n @click=\"focused = true\"\n >\n <!-- eslint-disable-next-line prettier/prettier -->\n <!-- prettier-ignore -->\n <slot :name=\"(buttons.top.slot.name as 'increment' | 'decrement')\" :has-focus=\"focused\">\n <button\n v-bind=\"buttons.top.button\"\n @mousedown=\"buttons.top.handler\"\n @touchstart=\"buttons.top.handler\"\n >\n <svg v-bind=\"buttons.top.svg\">\n <path v-bind=\"buttons.top.path\" />\n </svg>\n </button>\n </slot>\n <input\n v-if=\"props.name && !props.disabled\"\n key=\"hidden\"\n type=\"hidden\"\n :name=\"props.name\"\n :form=\"props.form\"\n :value=\"valueAsFixed\"\n />\n <output\n :id=\"computedId\"\n key=\"output\"\n class=\"flex-grow-1\"\n :class=\"computedSpinClasses\"\n :dir=\"(isRtl ?? false) ? 'rtl' : 'ltr'\"\n :tabindex=\"props.disabled ? undefined : '0'\"\n role=\"spinbutton\"\n aria-live=\"off\"\n :aria-label=\"props.ariaLabel || undefined\"\n :aria-invalid=\"\n props.state === false || (!modelValue !== null && props.required) ? true : undefined\n \"\n :aria-required=\"props.required ? true : undefined\"\n :aria-valuemin=\"computedMin\"\n :aria-valuemax=\"computedMax\"\n :aria-valuenow=\"modelValue !== null ? modelValue : undefined\"\n :aria-valuetext=\"modelValue !== null ? computedFormatter(modelValue) : undefined\"\n >\n <bdi>\n {{ (modelValue !== null ? computedFormatter(modelValue) : props.placeholder) || '' }}\n </bdi>\n </output>\n <!-- eslint-disable-next-line prettier/prettier -->\n <!-- prettier-ignore -->\n <slot :name=\"(buttons.bottom.slot.name as 'increment' | 'decrement')\" :has-focus=\"focused\">\n <button\n v-bind=\"buttons.bottom.button\"\n @mousedown=\"buttons.bottom.handler\"\n @touchstart=\"buttons.bottom.handler\"\n >\n <svg v-bind=\"buttons.bottom.svg\">\n <path v-bind=\"buttons.bottom.path\" />\n </svg>\n </button>\n </slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, onUnmounted, useTemplateRef} from 'vue'\nimport {\n CODE_DOWN,\n CODE_END,\n CODE_HOME,\n CODE_PAGEDOWN,\n CODE_PAGEUP,\n CODE_UP,\n} from '../../utils/constants'\nimport {onKeyStroke, useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useRtl} from '../../composables/useRtl'\nimport type {\n BFormSpinbuttonEmits,\n BFormSpinbuttonSlots,\n BFormSpinbuttonProps,\n ButtonType,\n} from '../../types'\nimport {getSafeDocument} from '../../utils/dom'\n\nconst KEY_CODES = [CODE_UP, CODE_DOWN, CODE_HOME, CODE_END, CODE_PAGEUP, CODE_PAGEDOWN]\n\nconst _props = withDefaults(defineProps<Omit<BFormSpinbuttonProps, 'modelValue'>>(), {\n ariaControls: undefined,\n ariaLabel: undefined,\n disabled: false,\n form: undefined,\n formatterFn: undefined,\n id: undefined,\n inline: false,\n labelDecrement: 'Decrement',\n labelIncrement: 'Increment',\n locale: undefined,\n max: defaultValues.max,\n min: defaultValues.min,\n name: undefined,\n placeholder: undefined,\n readonly: false,\n repeatDelay: defaultValues.repeatDelay,\n repeatInterval: defaultValues.repeatInterval,\n repeatStepMultiplier: defaultValues.repeatMultiplier,\n repeatThreshold: defaultValues.repeatThreshold,\n required: false,\n size: undefined,\n state: null,\n step: defaultValues.step,\n vertical: false,\n wrap: false,\n})\nconst props = useDefaults(_props, 'BFormSpinbutton')\nconst emit = defineEmits<BFormSpinbuttonEmits>()\ndefineSlots<BFormSpinbuttonSlots>()\n\nconst modelValue = defineModel<Exclude<BFormSpinbuttonProps['modelValue'], undefined>>({\n default: null,\n})\n\nconst element = useTemplateRef('_element')\n\nconst {focused} = useFocus(element)\n\nconst computedId = useId(() => props.id, 'spinbutton')\n\nconst computedClasses = computed(() => ({\n 'disabled': props.disabled,\n 'readonly': props.readonly,\n 'focus': focused.value,\n 'd-inline-flex': props.inline || props.vertical,\n 'd-flex': !props.inline && !props.vertical,\n 'align-items-stretch': !props.vertical,\n 'flex-column': props.vertical,\n [`form-control-${props.size}`]: props.size !== undefined,\n}))\n\nconst computedSpinClasses = computed(() => ({\n 'd-flex': props.vertical,\n 'align-self-center': !props.vertical,\n 'align-items-center': props.vertical,\n 'border-top': props.vertical,\n 'border-bottom': props.vertical,\n 'border-start': !props.vertical,\n 'border-end': !props.vertical,\n}))\n\n//non reactive properties\nlet $_autoDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet $_autoRepeatTimer: ReturnType<typeof setTimeout> | undefined\nlet $_keyIsDown = false\n\n// const computedInline = computed(() => props.inline && !props.vertical)\n\n// const computedReadonly = computed(() => props.readonly && !props.disabled)\n\nconst stepNumber = useToNumber(() => props.step)\nconst computedStep = computed(() =>\n Number.isNaN(stepNumber.value) ? defaultValues.step : stepNumber.value\n)\n\nconst minNumber = useToNumber(() => props.min)\nconst computedMin = computed(() =>\n Number.isNaN(minNumber.value) ? defaultValues.min : minNumber.value\n)\n\nconst maxNumber = useToNumber(() => props.max)\nconst computedMax = computed(() => {\n const step = computedStep.value\n const min = computedMin.value\n return Math.floor((maxNumber.value - min) / step) * step + min\n})\n\nconst repeatDelayNumber = useToNumber(() => props.repeatDelay, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedDelay = computed(() =>\n repeatDelayNumber.value > 0 ? repeatDelayNumber.value : defaultValues.repeatDelay\n)\n\nconst repeatIntervalNumber = useToNumber(() => props.repeatInterval, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedInterval = computed(() =>\n repeatIntervalNumber.value > 0 ? repeatIntervalNumber.value : defaultValues.repeatInterval\n)\n\nconst repeatThresholdNumber = useToNumber(() => props.repeatThreshold, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedThreshold = computed(() =>\n Math.max(\n Number.isNaN(repeatThresholdNumber.value)\n ? defaultValues.repeatThreshold\n : repeatThresholdNumber.value,\n 1\n )\n)\n\nconst repeatStepMultiplierNumber = useToNumber(() => props.repeatStepMultiplier, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedStepMultiplier = computed(() =>\n Math.max(\n Number.isNaN(repeatStepMultiplierNumber.value)\n ? defaultValues.repeatMultiplier\n : repeatStepMultiplierNumber.value,\n 1\n )\n)\n\nconst computedPrecision = computed(() => {\n const step = computedStep.value\n return Math.floor(step) === step ? 0 : (step.toString().split('.')[1] || '').length\n})\n\nconst computedMultiplier = computed(() => Math.pow(10, computedPrecision.value || 0))\n\nconst valueAsFixed = computed(() =>\n modelValue.value === null ? '' : modelValue.value.toFixed(computedPrecision.value)\n)\n\nconst {isRtl, locale: globalLocale} = useRtl()\n\nconst computedLocale = computed(() => {\n const loc = (props.locale ?? globalLocale?.value) || 'locale'\n const locales = [loc]\n const nf = new Intl.NumberFormat(locales)\n return nf.resolvedOptions().locale\n})\n\nconst defaultFormatter = () =>\n new Intl.NumberFormat(computedLocale.value, {\n style: 'decimal',\n useGrouping: false,\n minimumIntegerDigits: 1,\n minimumFractionDigits: computedPrecision.value,\n maximumFractionDigits: computedPrecision.value,\n notation: 'standard',\n }).format\n\nconst computedFormatter = computed(() => props.formatterFn ?? defaultFormatter())\n\nconst stepValue = (direction: number) => {\n // Sets a new incremented or decremented value, supporting optional wrapping\n // Direction is either +1 or -1 (or a multiple thereof)\n let {value} = modelValue\n if (!props.disabled && value !== null) {\n const step = computedStep.value * direction\n const min = computedMin.value\n const max = computedMax.value\n const multiplier = computedMultiplier.value\n const {wrap} = props\n // We ensure that the value steps like a native input\n value = Math.round((value - min) / step) * step + min + step\n // We ensure that precision is maintained (decimals)\n value = Math.round(value * multiplier) / multiplier\n // Handle if wrapping is enabled\n modelValue.value = value > max ? (wrap ? min : max) : value < min ? (wrap ? max : min) : value\n }\n}\n\nconst stepUp = (multiplier = 1) => {\n if (modelValue.value === null) {\n modelValue.value = computedMin.value\n return\n }\n stepValue(+1 * multiplier)\n}\n\nconst stepDown = (multiplier = 1) => {\n if (modelValue.value === null) {\n modelValue.value = props.wrap ? computedMax.value : computedMin.value\n return\n }\n stepValue(-1 * multiplier)\n}\n\nconst stopEvent = (event: Readonly<Event>) => {\n event.preventDefault()\n event.stopImmediatePropagation()\n}\n\nonKeyStroke(\n KEY_CODES,\n (event) => {\n const {code, altKey, ctrlKey, metaKey} = event\n\n if (props.disabled || props.readonly || altKey || ctrlKey || metaKey) return\n\n // https://w3c.github.io/aria-practices/#spinbutton\n stopEvent(event)\n if ($_keyIsDown) {\n // Keypress is already in progress\n return\n }\n\n resetTimers()\n if ([CODE_UP, CODE_DOWN].includes(code)) {\n // The following use the custom auto-repeat handling\n\n $_keyIsDown = true\n if (code === CODE_UP) {\n handleStepRepeat(event, stepUp)\n return\n }\n if (code === CODE_DOWN) {\n handleStepRepeat(event, stepDown)\n }\n return\n }\n // These use native OS key repeating\n if (code === CODE_PAGEUP) {\n stepUp(computedStepMultiplier.value)\n return\n }\n if (code === CODE_PAGEDOWN) {\n stepDown(computedStepMultiplier.value)\n return\n }\n if (code === CODE_HOME) {\n modelValue.value = computedMin.value\n return\n }\n if (code === CODE_END) {\n modelValue.value = computedMax.value\n }\n },\n {target: element, eventName: 'keydown'}\n)\n\nonKeyStroke(\n KEY_CODES,\n (event: Readonly<KeyboardEvent>) => {\n // Emit a change event when the keyup happens\n\n const {altKey, ctrlKey, metaKey} = event\n\n if (props.disabled || props.readonly || altKey || ctrlKey || metaKey) return\n\n stopEvent(event)\n resetTimers()\n $_keyIsDown = false\n emit('change', modelValue.value)\n },\n {target: element, eventName: 'keyup'}\n)\n\n// takes in a mount or Keyboard Event\nconst handleStepRepeat = (event: Readonly<Event>, stepper: (step: number) => void) => {\n const {type} = event || {}\n\n if (!props.disabled && !props.readonly) {\n if (isMouseEvent(event)) {\n // We only respond to left (main === 0) button clicks\n if (type === 'mousedown' && event.button) return\n }\n resetTimers()\n // Step the counter initially\n stepper(1)\n const threshold = computedThreshold.value\n const multiplier = computedStepMultiplier.value\n const delay = computedDelay.value\n const interval = computedInterval.value\n\n // Initiate the delay/repeat interval\n $_autoDelayTimer = setTimeout(() => {\n let count = 0\n $_autoRepeatTimer = setInterval(() => {\n // After N initial repeats, we increase the incrementing step amount\n // We do this to minimize screen reader announcements of the value\n // (values are announced every change, which can be chatty for SR users)\n // And to make it easer to select a value when the range is large\n stepper(count < threshold ? 1 : multiplier)\n count++\n }, interval)\n }, delay)\n }\n}\n\nconst isMouseEvent = (evt: Readonly<Event>): evt is MouseEvent =>\n evt.type === 'mouseup' || evt.type === 'mousedown'\n\nconst onMouseup: EventListener = (event: Readonly<Event>) => {\n // `<body>` listener, only enabled when mousedown starts\n\n if (isMouseEvent(event)) {\n if (event.type === 'mouseup' && event.button) {\n // Ignore non left button (main === 0) mouse button click\n return\n }\n }\n\n stopEvent(event)\n resetTimers()\n setMouseup('removeEventListener')\n // Trigger the change event\n emit('change', modelValue.value)\n}\n\nconst setMouseup = (operation: 'addEventListener' | 'removeEventListener') => {\n const doc = getSafeDocument()\n if (doc === null) return\n\n if (operation === 'addEventListener') {\n doc.body.addEventListener('mouseup', onMouseup)\n doc.body.addEventListener('touchend', onMouseup, {passive: false})\n } else {\n doc.body.removeEventListener('mouseup', onMouseup)\n doc.body.removeEventListener('touchend', onMouseup)\n }\n}\nconst resetTimers = () => {\n clearTimeout($_autoDelayTimer)\n clearInterval($_autoRepeatTimer)\n $_autoDelayTimer = undefined\n $_autoRepeatTimer = undefined\n}\n\nconst buttons = computed(() => {\n const incrementSvgAttrs = {\n svg: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n fill: 'currentColor',\n class: 'bi bi-plus',\n viewBox: '0 0 16 16',\n },\n path: {\n d: 'M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z',\n },\n } as const\n\n const decrementSvgAttrs = {\n svg: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n fill: 'currentColor',\n class: 'bi bi-dash',\n viewBox: '0 0 16 16',\n },\n path: {d: 'M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z'},\n } as const\n\n const sharedButtonAttrs = {\n 'class': [{'py-0': !props.vertical}, 'btn', 'btn-sm', 'border-0', 'rounded-0'],\n 'tabindex': '-1',\n 'type': 'button' as ButtonType,\n 'disabled': props.disabled || props.readonly,\n 'aria-disabled': props.disabled || props.readonly ? true : undefined,\n 'aria-controls': computedId.value,\n }\n\n const sharedSvgAttrs = {\n 'aria-hidden': true,\n 'scale': focused.value ? 1.5 : 1.25,\n }\n\n const handler = (event: Readonly<Event>, stepper: (multiplier?: number) => void) => {\n if (!props.disabled && !props.readonly) {\n stopEvent(event)\n setMouseup('addEventListener')\n // Since we `preventDefault()`, we must manually focus the button\n // Though it's likely captured from the element click focus\n focused.value = true\n handleStepRepeat(event, stepper)\n }\n }\n\n const incrementAttrs = {\n button: {\n ...sharedButtonAttrs,\n 'aria-label': props.labelIncrement || undefined,\n 'aria-keyshortcuts': 'ArrowUp',\n },\n svg: {\n ...sharedSvgAttrs,\n ...incrementSvgAttrs.svg,\n },\n path: {\n ...incrementSvgAttrs.path,\n },\n slot: {\n name: 'increment',\n },\n handler: (e: Event) => handler(e, stepUp),\n }\n\n const decrementAttrs = {\n button: {\n ...sharedButtonAttrs,\n 'aria-label': props.labelDecrement || undefined,\n 'aria-keyshortcuts': 'ArrowDown',\n },\n svg: {\n ...sharedSvgAttrs,\n ...decrementSvgAttrs.svg,\n },\n path: {\n ...decrementSvgAttrs.path,\n },\n slot: {\n name: 'decrement',\n },\n handler: (e: Readonly<Event>) => handler(e, stepDown),\n }\n\n return {\n top: {\n ...(props.vertical ? incrementAttrs : decrementAttrs),\n },\n bottom: {\n ...(!props.vertical ? incrementAttrs : decrementAttrs),\n },\n }\n})\n\nonUnmounted(() => {\n // Cleanup event listeners\n setMouseup('removeEventListener')\n})\n</script>\n\n<script lang=\"ts\">\nconst defaultValues = {\n min: 1,\n max: 100,\n step: 1,\n repeatDelay: 500,\n repeatInterval: 100,\n repeatThreshold: 10,\n repeatMultiplier: 4,\n} as const\n</script>\n","<template>\n <div\n ref=\"_element\"\n class=\"b-form-spinbutton form-control\"\n :class=\"computedClasses\"\n role=\"group\"\n :lang=\"computedLocale\"\n :tabindex=\"props.disabled ? undefined : '-1'\"\n :title=\"props.ariaLabel\"\n @click=\"focused = true\"\n >\n <!-- eslint-disable-next-line prettier/prettier -->\n <!-- prettier-ignore -->\n <slot :name=\"(buttons.top.slot.name as 'increment' | 'decrement')\" :has-focus=\"focused\">\n <button\n v-bind=\"buttons.top.button\"\n @mousedown=\"buttons.top.handler\"\n @touchstart=\"buttons.top.handler\"\n >\n <svg v-bind=\"buttons.top.svg\">\n <path v-bind=\"buttons.top.path\" />\n </svg>\n </button>\n </slot>\n <input\n v-if=\"props.name && !props.disabled\"\n key=\"hidden\"\n type=\"hidden\"\n :name=\"props.name\"\n :form=\"props.form\"\n :value=\"valueAsFixed\"\n />\n <output\n :id=\"computedId\"\n key=\"output\"\n class=\"flex-grow-1\"\n :class=\"computedSpinClasses\"\n :dir=\"(isRtl ?? false) ? 'rtl' : 'ltr'\"\n :tabindex=\"props.disabled ? undefined : '0'\"\n role=\"spinbutton\"\n aria-live=\"off\"\n :aria-label=\"props.ariaLabel || undefined\"\n :aria-invalid=\"\n props.state === false || (!modelValue !== null && props.required) ? true : undefined\n \"\n :aria-required=\"props.required ? true : undefined\"\n :aria-valuemin=\"computedMin\"\n :aria-valuemax=\"computedMax\"\n :aria-valuenow=\"modelValue !== null ? modelValue : undefined\"\n :aria-valuetext=\"modelValue !== null ? computedFormatter(modelValue) : undefined\"\n >\n <bdi>\n {{ (modelValue !== null ? computedFormatter(modelValue) : props.placeholder) || '' }}\n </bdi>\n </output>\n <!-- eslint-disable-next-line prettier/prettier -->\n <!-- prettier-ignore -->\n <slot :name=\"(buttons.bottom.slot.name as 'increment' | 'decrement')\" :has-focus=\"focused\">\n <button\n v-bind=\"buttons.bottom.button\"\n @mousedown=\"buttons.bottom.handler\"\n @touchstart=\"buttons.bottom.handler\"\n >\n <svg v-bind=\"buttons.bottom.svg\">\n <path v-bind=\"buttons.bottom.path\" />\n </svg>\n </button>\n </slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, onUnmounted, useTemplateRef} from 'vue'\nimport {\n CODE_DOWN,\n CODE_END,\n CODE_HOME,\n CODE_PAGEDOWN,\n CODE_PAGEUP,\n CODE_UP,\n} from '../../utils/constants'\nimport {onKeyStroke, useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useRtl} from '../../composables/useRtl'\nimport type {\n BFormSpinbuttonEmits,\n BFormSpinbuttonSlots,\n BFormSpinbuttonProps,\n ButtonType,\n} from '../../types'\nimport {getSafeDocument} from '../../utils/dom'\n\nconst KEY_CODES = [CODE_UP, CODE_DOWN, CODE_HOME, CODE_END, CODE_PAGEUP, CODE_PAGEDOWN]\n\nconst _props = withDefaults(defineProps<Omit<BFormSpinbuttonProps, 'modelValue'>>(), {\n ariaControls: undefined,\n ariaLabel: undefined,\n disabled: false,\n form: undefined,\n formatterFn: undefined,\n id: undefined,\n inline: false,\n labelDecrement: 'Decrement',\n labelIncrement: 'Increment',\n locale: undefined,\n max: defaultValues.max,\n min: defaultValues.min,\n name: undefined,\n placeholder: undefined,\n readonly: false,\n repeatDelay: defaultValues.repeatDelay,\n repeatInterval: defaultValues.repeatInterval,\n repeatStepMultiplier: defaultValues.repeatMultiplier,\n repeatThreshold: defaultValues.repeatThreshold,\n required: false,\n size: undefined,\n state: null,\n step: defaultValues.step,\n vertical: false,\n wrap: false,\n})\nconst props = useDefaults(_props, 'BFormSpinbutton')\nconst emit = defineEmits<BFormSpinbuttonEmits>()\ndefineSlots<BFormSpinbuttonSlots>()\n\nconst modelValue = defineModel<Exclude<BFormSpinbuttonProps['modelValue'], undefined>>({\n default: null,\n})\n\nconst element = useTemplateRef('_element')\n\nconst {focused} = useFocus(element)\n\nconst computedId = useId(() => props.id, 'spinbutton')\n\nconst computedClasses = computed(() => ({\n 'disabled': props.disabled,\n 'readonly': props.readonly,\n 'focus': focused.value,\n 'd-inline-flex': props.inline || props.vertical,\n 'd-flex': !props.inline && !props.vertical,\n 'align-items-stretch': !props.vertical,\n 'flex-column': props.vertical,\n [`form-control-${props.size}`]: props.size !== undefined,\n}))\n\nconst computedSpinClasses = computed(() => ({\n 'd-flex': props.vertical,\n 'align-self-center': !props.vertical,\n 'align-items-center': props.vertical,\n 'border-top': props.vertical,\n 'border-bottom': props.vertical,\n 'border-start': !props.vertical,\n 'border-end': !props.vertical,\n}))\n\n//non reactive properties\nlet $_autoDelayTimer: ReturnType<typeof setTimeout> | undefined\nlet $_autoRepeatTimer: ReturnType<typeof setTimeout> | undefined\nlet $_keyIsDown = false\n\n// const computedInline = computed(() => props.inline && !props.vertical)\n\n// const computedReadonly = computed(() => props.readonly && !props.disabled)\n\nconst stepNumber = useToNumber(() => props.step)\nconst computedStep = computed(() =>\n Number.isNaN(stepNumber.value) ? defaultValues.step : stepNumber.value\n)\n\nconst minNumber = useToNumber(() => props.min)\nconst computedMin = computed(() =>\n Number.isNaN(minNumber.value) ? defaultValues.min : minNumber.value\n)\n\nconst maxNumber = useToNumber(() => props.max)\nconst computedMax = computed(() => {\n const step = computedStep.value\n const min = computedMin.value\n return Math.floor((maxNumber.value - min) / step) * step + min\n})\n\nconst repeatDelayNumber = useToNumber(() => props.repeatDelay, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedDelay = computed(() =>\n repeatDelayNumber.value > 0 ? repeatDelayNumber.value : defaultValues.repeatDelay\n)\n\nconst repeatIntervalNumber = useToNumber(() => props.repeatInterval, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedInterval = computed(() =>\n repeatIntervalNumber.value > 0 ? repeatIntervalNumber.value : defaultValues.repeatInterval\n)\n\nconst repeatThresholdNumber = useToNumber(() => props.repeatThreshold, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedThreshold = computed(() =>\n Math.max(\n Number.isNaN(repeatThresholdNumber.value)\n ? defaultValues.repeatThreshold\n : repeatThresholdNumber.value,\n 1\n )\n)\n\nconst repeatStepMultiplierNumber = useToNumber(() => props.repeatStepMultiplier, {\n nanToZero: true,\n method: 'parseInt',\n})\nconst computedStepMultiplier = computed(() =>\n Math.max(\n Number.isNaN(repeatStepMultiplierNumber.value)\n ? defaultValues.repeatMultiplier\n : repeatStepMultiplierNumber.value,\n 1\n )\n)\n\nconst computedPrecision = computed(() => {\n const step = computedStep.value\n return Math.floor(step) === step ? 0 : (step.toString().split('.')[1] || '').length\n})\n\nconst computedMultiplier = computed(() => Math.pow(10, computedPrecision.value || 0))\n\nconst valueAsFixed = computed(() =>\n modelValue.value === null ? '' : modelValue.value.toFixed(computedPrecision.value)\n)\n\nconst {isRtl, locale: globalLocale} = useRtl()\n\nconst computedLocale = computed(() => {\n const loc = (props.locale ?? globalLocale?.value) || 'locale'\n const locales = [loc]\n const nf = new Intl.NumberFormat(locales)\n return nf.resolvedOptions().locale\n})\n\nconst defaultFormatter = () =>\n new Intl.NumberFormat(computedLocale.value, {\n style: 'decimal',\n useGrouping: false,\n minimumIntegerDigits: 1,\n minimumFractionDigits: computedPrecision.value,\n maximumFractionDigits: computedPrecision.value,\n notation: 'standard',\n }).format\n\nconst computedFormatter = computed(() => props.formatterFn ?? defaultFormatter())\n\nconst stepValue = (direction: number) => {\n // Sets a new incremented or decremented value, supporting optional wrapping\n // Direction is either +1 or -1 (or a multiple thereof)\n let {value} = modelValue\n if (!props.disabled && value !== null) {\n const step = computedStep.value * direction\n const min = computedMin.value\n const max = computedMax.value\n const multiplier = computedMultiplier.value\n const {wrap} = props\n // We ensure that the value steps like a native input\n value = Math.round((value - min) / step) * step + min + step\n // We ensure that precision is maintained (decimals)\n value = Math.round(value * multiplier) / multiplier\n // Handle if wrapping is enabled\n modelValue.value = value > max ? (wrap ? min : max) : value < min ? (wrap ? max : min) : value\n }\n}\n\nconst stepUp = (multiplier = 1) => {\n if (modelValue.value === null) {\n modelValue.value = computedMin.value\n return\n }\n stepValue(+1 * multiplier)\n}\n\nconst stepDown = (multiplier = 1) => {\n if (modelValue.value === null) {\n modelValue.value = props.wrap ? computedMax.value : computedMin.value\n return\n }\n stepValue(-1 * multiplier)\n}\n\nconst stopEvent = (event: Readonly<Event>) => {\n event.preventDefault()\n event.stopImmediatePropagation()\n}\n\nonKeyStroke(\n KEY_CODES,\n (event) => {\n const {code, altKey, ctrlKey, metaKey} = event\n\n if (props.disabled || props.readonly || altKey || ctrlKey || metaKey) return\n\n // https://w3c.github.io/aria-practices/#spinbutton\n stopEvent(event)\n if ($_keyIsDown) {\n // Keypress is already in progress\n return\n }\n\n resetTimers()\n if ([CODE_UP, CODE_DOWN].includes(code)) {\n // The following use the custom auto-repeat handling\n\n $_keyIsDown = true\n if (code === CODE_UP) {\n handleStepRepeat(event, stepUp)\n return\n }\n if (code === CODE_DOWN) {\n handleStepRepeat(event, stepDown)\n }\n return\n }\n // These use native OS key repeating\n if (code === CODE_PAGEUP) {\n stepUp(computedStepMultiplier.value)\n return\n }\n if (code === CODE_PAGEDOWN) {\n stepDown(computedStepMultiplier.value)\n return\n }\n if (code === CODE_HOME) {\n modelValue.value = computedMin.value\n return\n }\n if (code === CODE_END) {\n modelValue.value = computedMax.value\n }\n },\n {target: element, eventName: 'keydown'}\n)\n\nonKeyStroke(\n KEY_CODES,\n (event: Readonly<KeyboardEvent>) => {\n // Emit a change event when the keyup happens\n\n const {altKey, ctrlKey, metaKey} = event\n\n if (props.disabled || props.readonly || altKey || ctrlKey || metaKey) return\n\n stopEvent(event)\n resetTimers()\n $_keyIsDown = false\n emit('change', modelValue.value)\n },\n {target: element, eventName: 'keyup'}\n)\n\n// takes in a mount or Keyboard Event\nconst handleStepRepeat = (event: Readonly<Event>, stepper: (step: number) => void) => {\n const {type} = event || {}\n\n if (!props.disabled && !props.readonly) {\n if (isMouseEvent(event)) {\n // We only respond to left (main === 0) button clicks\n if (type === 'mousedown' && event.button) return\n }\n resetTimers()\n // Step the counter initially\n stepper(1)\n const threshold = computedThreshold.value\n const multiplier = computedStepMultiplier.value\n const delay = computedDelay.value\n const interval = computedInterval.value\n\n // Initiate the delay/repeat interval\n $_autoDelayTimer = setTimeout(() => {\n let count = 0\n $_autoRepeatTimer = setInterval(() => {\n // After N initial repeats, we increase the incrementing step amount\n // We do this to minimize screen reader announcements of the value\n // (values are announced every change, which can be chatty for SR users)\n // And to make it easer to select a value when the range is large\n stepper(count < threshold ? 1 : multiplier)\n count++\n }, interval)\n }, delay)\n }\n}\n\nconst isMouseEvent = (evt: Readonly<Event>): evt is MouseEvent =>\n evt.type === 'mouseup' || evt.type === 'mousedown'\n\nconst onMouseup: EventListener = (event: Readonly<Event>) => {\n // `<body>` listener, only enabled when mousedown starts\n\n if (isMouseEvent(event)) {\n if (event.type === 'mouseup' && event.button) {\n // Ignore non left button (main === 0) mouse button click\n return\n }\n }\n\n stopEvent(event)\n resetTimers()\n setMouseup('removeEventListener')\n // Trigger the change event\n emit('change', modelValue.value)\n}\n\nconst setMouseup = (operation: 'addEventListener' | 'removeEventListener') => {\n const doc = getSafeDocument()\n if (doc === null) return\n\n if (operation === 'addEventListener') {\n doc.body.addEventListener('mouseup', onMouseup)\n doc.body.addEventListener('touchend', onMouseup, {passive: false})\n } else {\n doc.body.removeEventListener('mouseup', onMouseup)\n doc.body.removeEventListener('touchend', onMouseup)\n }\n}\nconst resetTimers = () => {\n clearTimeout($_autoDelayTimer)\n clearInterval($_autoRepeatTimer)\n $_autoDelayTimer = undefined\n $_autoRepeatTimer = undefined\n}\n\nconst buttons = computed(() => {\n const incrementSvgAttrs = {\n svg: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n fill: 'currentColor',\n class: 'bi bi-plus',\n viewBox: '0 0 16 16',\n },\n path: {\n d: 'M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z',\n },\n } as const\n\n const decrementSvgAttrs = {\n svg: {\n xmlns: 'http://www.w3.org/2000/svg',\n width: '16',\n height: '16',\n fill: 'currentColor',\n class: 'bi bi-dash',\n viewBox: '0 0 16 16',\n },\n path: {d: 'M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z'},\n } as const\n\n const sharedButtonAttrs = {\n 'class': [{'py-0': !props.vertical}, 'btn', 'btn-sm', 'border-0', 'rounded-0'],\n 'tabindex': '-1',\n 'type': 'button' as ButtonType,\n 'disabled': props.disabled || props.readonly,\n 'aria-disabled': props.disabled || props.readonly ? true : undefined,\n 'aria-controls': computedId.value,\n }\n\n const sharedSvgAttrs = {\n 'aria-hidden': true,\n 'scale': focused.value ? 1.5 : 1.25,\n }\n\n const handler = (event: Readonly<Event>, stepper: (multiplier?: number) => void) => {\n if (!props.disabled && !props.readonly) {\n stopEvent(event)\n setMouseup('addEventListener')\n // Since we `preventDefault()`, we must manually focus the button\n // Though it's likely captured from the element click focus\n focused.value = true\n handleStepRepeat(event, stepper)\n }\n }\n\n const incrementAttrs = {\n button: {\n ...sharedButtonAttrs,\n 'aria-label': props.labelIncrement || undefined,\n 'aria-keyshortcuts': 'ArrowUp',\n },\n svg: {\n ...sharedSvgAttrs,\n ...incrementSvgAttrs.svg,\n },\n path: {\n ...incrementSvgAttrs.path,\n },\n slot: {\n name: 'increment',\n },\n handler: (e: Event) => handler(e, stepUp),\n }\n\n const decrementAttrs = {\n button: {\n ...sharedButtonAttrs,\n 'aria-label': props.labelDecrement || undefined,\n 'aria-keyshortcuts': 'ArrowDown',\n },\n svg: {\n ...sharedSvgAttrs,\n ...decrementSvgAttrs.svg,\n },\n path: {\n ...decrementSvgAttrs.path,\n },\n slot: {\n name: 'decrement',\n },\n handler: (e: Readonly<Event>) => handler(e, stepDown),\n }\n\n return {\n top: {\n ...(props.vertical ? incrementAttrs : decrementAttrs),\n },\n bottom: {\n ...(!props.vertical ? incrementAttrs : decrementAttrs),\n },\n }\n})\n\nonUnmounted(() => {\n // Cleanup event listeners\n setMouseup('removeEventListener')\n})\n</script>\n\n<script lang=\"ts\">\nconst defaultValues = {\n min: 1,\n max: 100,\n step: 1,\n repeatDelay: 500,\n repeatInterval: 100,\n repeatThreshold: 10,\n repeatMultiplier: 4,\n} as const\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4hBA,IAAM,gBAAgB;CACpB,KAAK;CACL,KAAK;CACL,MAAM;CACN,aAAa;CACb,gBAAgB;CAChB,iBAAiB;CACjB,kBAAkB;CACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAvcD,MAAM,YAAY;GAAC;GAAS;GAAW;;GAAqB;GAAa;GAAa;EA6BtF,MAAM,QAAQ,YA3BC,SA2BmB,kBAAiB;EACnD,MAAM,OAAO;EAGb,MAAM,aAAa,SAAmE,SAAA,aAErF;EAED,MAAM,UAAU,eAAe,WAAU;EAEzC,MAAM,EAAC,YAAW,SAAS,QAAO;EAElC,MAAM,aAAa,cAAY,MAAM,IAAI,aAAY;EAErD,MAAM,kBAAkB,gBAAgB;GACtC,YAAY,MAAM;GAClB,YAAY,MAAM;GAClB,SAAS,QAAQ;GACjB,iBAAiB,MAAM,U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