bootstrap-vue-next 0.46.1 → 0.46.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BAutocomplete-DGvKY7-D.js → BAutocomplete-BFbbKtpz.js} +2 -2
- package/dist/{BAutocomplete-DGvKY7-D.js.map → BAutocomplete-BFbbKtpz.js.map} +1 -1
- package/dist/{BFormInput-BwvdFGDu.js → BFormInput-_AkAy6Wk.js} +4 -4
- package/dist/BFormInput-_AkAy6Wk.js.map +1 -0
- package/dist/{BFormOtp-I1t8dqPS.js → BFormOtp-C3vmDnzs.js} +2 -2
- package/dist/{BFormOtp-I1t8dqPS.js.map → BFormOtp-C3vmDnzs.js.map} +1 -1
- package/dist/{BFormSpinbutton-Bt590uT6.js → BFormSpinbutton-fkVMbQC3.js} +4 -2
- package/dist/BFormSpinbutton-fkVMbQC3.js.map +1 -0
- package/dist/{BFormTextarea-DlDe26DL.js → BFormTextarea-CBBlEcrV.js} +4 -4
- package/dist/BFormTextarea-CBBlEcrV.js.map +1 -0
- package/dist/{BTabs-BVcu9DPg.js → BTabs-BKmkVWrZ.js} +4 -4
- package/dist/BTabs-BKmkVWrZ.js.map +1 -0
- package/dist/bootstrap-vue-next.mjs +6 -6
- package/dist/composables/useFormInput.d.mts +1 -0
- package/dist/composables/useFormInput.d.ts +1 -0
- package/dist/src/components/BAutocomplete/index.mjs +1 -1
- package/dist/src/components/BFormInput/index.mjs +1 -1
- package/dist/src/components/BFormOtp/index.mjs +1 -1
- package/dist/src/components/BFormSpinbutton/index.mjs +1 -1
- package/dist/src/components/BFormTextarea/index.mjs +1 -1
- package/dist/src/components/BTabs/index.mjs +1 -1
- package/dist/src/components/index.mjs +6 -6
- package/dist/{useFormInput-DZ_3ZH1o.js → useFormInput-C-iXRxog.js} +18 -4
- package/dist/useFormInput-C-iXRxog.js.map +1 -0
- package/package.json +1 -1
- package/dist/BFormInput-BwvdFGDu.js.map +0 -1
- package/dist/BFormSpinbutton-Bt590uT6.js.map +0 -1
- package/dist/BFormTextarea-DlDe26DL.js.map +0 -1
- package/dist/BTabs-BVcu9DPg.js.map +0 -1
- package/dist/useFormInput-DZ_3ZH1o.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as inputGroupKey } from "./keys-BgLwJbLV.js";
|
|
2
2
|
import { t as useDefaults } from "./useDefaults-BzP4qZBu.js";
|
|
3
|
-
import { n as normalizeInput, t as useFormInput } from "./useFormInput-
|
|
3
|
+
import { n as normalizeInput, t as useFormInput } from "./useFormInput-C-iXRxog.js";
|
|
4
4
|
import { computed, createElementBlock, defineComponent, inject, mergeModels, normalizeClass, openBlock, unref, useModel, useTemplateRef } from "vue";
|
|
5
5
|
//#region src/components/BFormInput/BFormInput.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = [
|
|
@@ -85,7 +85,7 @@ var BFormInput_default = /* @__PURE__ */ defineComponent({
|
|
|
85
85
|
const [modelValue, modelModifiers] = useModel(__props, "modelValue", { set: (v) => normalizeInput(v, modelModifiers) });
|
|
86
86
|
const input = useTemplateRef("_input");
|
|
87
87
|
const inInputGroup = inject(inputGroupKey, false);
|
|
88
|
-
const { computedId, computedAriaInvalid, onInput, onChange, onBlur, stateClass, focus, blur, isDisabled } = useFormInput(props, input, modelValue, modelModifiers);
|
|
88
|
+
const { computedId, computedAriaInvalid, computedValue, onInput, onChange, onBlur, stateClass, focus, blur, isDisabled } = useFormInput(props, input, modelValue, modelModifiers);
|
|
89
89
|
const computedClasses = computed(() => {
|
|
90
90
|
const isRange = props.type === "range";
|
|
91
91
|
const isColor = props.type === "color";
|
|
@@ -107,7 +107,7 @@ var BFormInput_default = /* @__PURE__ */ defineComponent({
|
|
|
107
107
|
return openBlock(), createElementBlock("input", {
|
|
108
108
|
id: unref(computedId),
|
|
109
109
|
ref: "_input",
|
|
110
|
-
value: unref(
|
|
110
|
+
value: unref(computedValue),
|
|
111
111
|
class: normalizeClass(computedClasses.value),
|
|
112
112
|
name: unref(props).name || void 0,
|
|
113
113
|
form: unref(props).form || void 0,
|
|
@@ -133,4 +133,4 @@ var BFormInput_default = /* @__PURE__ */ defineComponent({
|
|
|
133
133
|
//#endregion
|
|
134
134
|
export { BFormInput_default as t };
|
|
135
135
|
|
|
136
|
-
//# sourceMappingURL=BFormInput-
|
|
136
|
+
//# sourceMappingURL=BFormInput-_AkAy6Wk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BFormInput-_AkAy6Wk.js","names":[],"sources":["../src/components/BFormInput/BFormInput.vue","../src/components/BFormInput/BFormInput.vue"],"sourcesContent":["<template>\n <input\n :id=\"computedId\"\n ref=\"_input\"\n :value=\"computedValue\"\n :class=\"computedClasses\"\n :name=\"props.name || undefined\"\n :form=\"props.form || undefined\"\n :type=\"props.type\"\n :disabled=\"isDisabled\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required || undefined\"\n :autocomplete=\"props.autocomplete || undefined\"\n :readonly=\"props.readonly || props.plaintext\"\n :min=\"props.min\"\n :max=\"props.max\"\n :step=\"props.step\"\n :list=\"props.type !== 'password' ? props.list : undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n @input=\"onInput\"\n @change=\"onChange\"\n @blur=\"onBlur\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {normalizeInput} from '../../utils/normalizeInput'\nimport type {BFormInputProps} from '../../types'\nimport {useFormInput} from '../../composables/useFormInput'\nimport {inputGroupKey} from '../../utils/keys'\n\nconst _props = withDefaults(defineProps<Omit<BFormInputProps, 'modelValue'>>(), {\n max: undefined,\n min: undefined,\n step: undefined,\n type: 'text',\n // CommonInputProps\n ariaInvalid: undefined,\n autocomplete: undefined,\n autofocus: false,\n debounce: 0,\n debounceMaxWait: Number.NaN,\n disabled: false,\n form: undefined,\n formatter: undefined,\n id: undefined,\n lazyFormatter: false,\n list: undefined,\n modelValue: '',\n name: undefined,\n placeholder: undefined,\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: undefined,\n // End CommonInputProps\n})\nconst props = useDefaults(_props, 'BFormInput')\n\nconst [modelValue, modelModifiers] = defineModel<\n Exclude<BFormInputProps['modelValue'], undefined>,\n 'trim' | 'lazy' | 'number'\n>({\n default: '',\n set: (v) => normalizeInput(v, modelModifiers),\n})\n\nconst input = useTemplateRef('_input')\n\nconst inInputGroup = inject(inputGroupKey, false)\n\nconst {\n computedId,\n computedAriaInvalid,\n computedValue,\n onInput,\n onChange,\n onBlur,\n stateClass,\n focus,\n blur,\n isDisabled,\n} = useFormInput(props, input, modelValue, modelModifiers)\n\nconst computedClasses = computed(() => {\n const isRange = props.type === 'range'\n const isColor = props.type === 'color'\n return [\n stateClass.value,\n {\n 'form-range': isRange,\n 'form-control': isColor || (!props.plaintext && !isRange) || (isRange && inInputGroup),\n 'form-control-color': isColor,\n 'form-control-plaintext': props.plaintext && !isRange && !isColor,\n [`form-control-${props.size}`]: !!props.size,\n },\n ]\n})\n\ndefineExpose({\n blur,\n element: input,\n flushDebounce: onBlur,\n focus,\n})\n</script>\n","<template>\n <input\n :id=\"computedId\"\n ref=\"_input\"\n :value=\"computedValue\"\n :class=\"computedClasses\"\n :name=\"props.name || undefined\"\n :form=\"props.form || undefined\"\n :type=\"props.type\"\n :disabled=\"isDisabled\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required || undefined\"\n :autocomplete=\"props.autocomplete || undefined\"\n :readonly=\"props.readonly || props.plaintext\"\n :min=\"props.min\"\n :max=\"props.max\"\n :step=\"props.step\"\n :list=\"props.type !== 'password' ? props.list : undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n @input=\"onInput\"\n @change=\"onChange\"\n @blur=\"onBlur\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {normalizeInput} from '../../utils/normalizeInput'\nimport type {BFormInputProps} from '../../types'\nimport {useFormInput} from '../../composables/useFormInput'\nimport {inputGroupKey} from '../../utils/keys'\n\nconst _props = withDefaults(defineProps<Omit<BFormInputProps, 'modelValue'>>(), {\n max: undefined,\n min: undefined,\n step: undefined,\n type: 'text',\n // CommonInputProps\n ariaInvalid: undefined,\n autocomplete: undefined,\n autofocus: false,\n debounce: 0,\n debounceMaxWait: Number.NaN,\n disabled: false,\n form: undefined,\n formatter: undefined,\n id: undefined,\n lazyFormatter: false,\n list: undefined,\n modelValue: '',\n name: undefined,\n placeholder: undefined,\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: undefined,\n // End CommonInputProps\n})\nconst props = useDefaults(_props, 'BFormInput')\n\nconst [modelValue, modelModifiers] = defineModel<\n Exclude<BFormInputProps['modelValue'], undefined>,\n 'trim' | 'lazy' | 'number'\n>({\n default: '',\n set: (v) => normalizeInput(v, modelModifiers),\n})\n\nconst input = useTemplateRef('_input')\n\nconst inInputGroup = inject(inputGroupKey, false)\n\nconst {\n computedId,\n computedAriaInvalid,\n computedValue,\n onInput,\n onChange,\n onBlur,\n stateClass,\n focus,\n blur,\n isDisabled,\n} = useFormInput(props, input, modelValue, modelModifiers)\n\nconst computedClasses = computed(() => {\n const isRange = props.type === 'range'\n const isColor = props.type === 'color'\n return [\n stateClass.value,\n {\n 'form-range': isRange,\n 'form-control': isColor || (!props.plaintext && !isRange) || (isRange && inInputGroup),\n 'form-control-color': isColor,\n 'form-control-plaintext': props.plaintext && !isRange && !isColor,\n [`form-control-${props.size}`]: !!props.size,\n },\n ]\n})\n\ndefineExpose({\n blur,\n element: input,\n flushDebounce: onBlur,\n focus,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6DA,MAAM,QAAQ,YAAY,SA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AAC;IACZ,MAAM,MAAA,KAAA,CAAK,CAAC,SAAI,aAAkB,MAAA,KAAA,CAAK,CAAC,OAAO,KAAA;IAC/C,iBAAe,MAAA,KAAA,CAAK,CAAC,YAAY,KAAA;IACjC,gBAAc,MAAA,mBAAA;IACd,SAAK,OAAA,OAAA,OAAA,MAAE,GAAA,SAAA,MAAA,OAAA,KAAA,MAAA,OAAA,CAAA,CAAA,GAAA,IAAA;IACP,UAAM,OAAA,OAAA,OAAA,MAAE,GAAA,SAAA,MAAA,QAAA,KAAA,MAAA,QAAA,CAAA,CAAA,GAAA,IAAA;IACR,QAAI,OAAA,OAAA,OAAA,MAAE,GAAA,SAAA,MAAA,MAAA,KAAA,MAAA,MAAA,CAAA,CAAA,GAAA,IAAA"}
|
|
@@ -5,7 +5,7 @@ import { t as useId$1 } from "./useId-Fh-Arhb7.js";
|
|
|
5
5
|
import { a as useDirection, c as getActiveElement, l as createContext, n as usePrimitiveElement, r as Primitive } from "./VisuallyHidden-BYzyjJiY.js";
|
|
6
6
|
import { n as useComposing, t as VisuallyHiddenInput_default } from "./VisuallyHiddenInput-CUrc8XXa.js";
|
|
7
7
|
import { t as useForwardExpose } from "./useForwardExpose-DDvk7mir.js";
|
|
8
|
-
import { t as BFormInput_default } from "./BFormInput-
|
|
8
|
+
import { t as BFormInput_default } from "./BFormInput-_AkAy6Wk.js";
|
|
9
9
|
import { Fragment, computed, createBlock, createElementBlock, createVNode, defineComponent, mergeModels, mergeProps, nextTick, normalizeClass, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, toRefs, unref, useModel, watch, withCtx, withKeys } from "vue";
|
|
10
10
|
//#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useArrowNavigation.js
|
|
11
11
|
var ignoredElement = ["INPUT", "TEXTAREA"];
|
|
@@ -574,4 +574,4 @@ var BFormOtp_default = /* @__PURE__ */ defineComponent({
|
|
|
574
574
|
//#endregion
|
|
575
575
|
export { BFormOtp_default as t };
|
|
576
576
|
|
|
577
|
-
//# sourceMappingURL=BFormOtp-
|
|
577
|
+
//# sourceMappingURL=BFormOtp-C3vmDnzs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BFormOtp-I1t8dqPS.js","names":[],"sources":["../../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useArrowNavigation.js","../../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/PinInput/PinInputRoot.js","../../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/PinInput/PinInputInput.js","../src/components/BFormOtp/BFormOtp.vue","../src/components/BFormOtp/BFormOtp.vue"],"sourcesContent":["//#region src/shared/useArrowNavigation.ts\nconst ignoredElement = [\"INPUT\", \"TEXTAREA\"];\n/**\n* Allow arrow navigation for every html element with data-reka-collection-item tag\n*\n* @param e Keyboard event\n* @param currentElement Event initiator element or any element that wants to handle the navigation\n* @param parentElement Parent element where contains all the collection items, this will collect every item to be used when nav\n* @param options further options\n* @returns the navigated html element or null if none\n*/\nfunction useArrowNavigation(e, currentElement, parentElement, options = {}) {\n\tif (!currentElement || options.enableIgnoredElement && ignoredElement.includes(currentElement.nodeName)) return null;\n\tconst { arrowKeyOptions = \"both\", attributeName = \"[data-reka-collection-item]\", itemsArray = [], loop = true, dir = \"ltr\", preventScroll = true, focus = false } = options;\n\tconst [right, left, up, down, home, end] = [\n\t\te.key === \"ArrowRight\",\n\t\te.key === \"ArrowLeft\",\n\t\te.key === \"ArrowUp\",\n\t\te.key === \"ArrowDown\",\n\t\te.key === \"Home\",\n\t\te.key === \"End\"\n\t];\n\tconst goingVertical = up || down;\n\tconst goingHorizontal = right || left;\n\tif (!home && !end && (!goingVertical && !goingHorizontal || arrowKeyOptions === \"vertical\" && goingHorizontal || arrowKeyOptions === \"horizontal\" && goingVertical)) return null;\n\tconst allCollectionItems = parentElement ? Array.from(parentElement.querySelectorAll(attributeName)) : itemsArray;\n\tif (!allCollectionItems.length) return null;\n\tif (preventScroll) e.preventDefault();\n\tlet item = null;\n\tif (goingHorizontal || goingVertical) {\n\t\tconst goForward = goingVertical ? down : dir === \"ltr\" ? right : left;\n\t\titem = findNextFocusableElement(allCollectionItems, currentElement, {\n\t\t\tgoForward,\n\t\t\tloop\n\t\t});\n\t} else if (home) item = allCollectionItems.at(0) || null;\n\telse if (end) item = allCollectionItems.at(-1) || null;\n\tif (focus) item?.focus();\n\treturn item;\n}\n/**\n* Recursive function to find the next focusable element to avoid disabled elements\n*\n* @param elements Elements to navigate\n* @param currentElement Current active element\n* @param options\n* @returns next focusable element\n*/\nfunction findNextFocusableElement(elements, currentElement, options, iterations = !elements.includes(currentElement) ? elements.length + 1 : elements.length) {\n\tif (--iterations === 0) return null;\n\tconst index = elements.indexOf(currentElement);\n\tlet newIndex;\n\tif (index === -1) newIndex = options.goForward ? 0 : elements.length - 1;\n\telse newIndex = options.goForward ? index + 1 : index - 1;\n\tif (!options.loop && (newIndex < 0 || newIndex >= elements.length)) return null;\n\tconst adjustedNewIndex = (newIndex + elements.length) % elements.length;\n\tconst candidate = elements[adjustedNewIndex];\n\tif (!candidate) return null;\n\tconst isDisabled = candidate.hasAttribute(\"disabled\") && candidate.getAttribute(\"disabled\") !== \"false\";\n\tif (isDisabled) return findNextFocusableElement(elements, candidate, options, iterations);\n\treturn candidate;\n}\n\n//#endregion\nexport { useArrowNavigation };\n//# sourceMappingURL=useArrowNavigation.js.map","import { createContext } from \"../shared/createContext.js\";\nimport { useDirection } from \"../shared/useDirection.js\";\nimport { useForwardExpose } from \"../shared/useForwardExpose.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { VisuallyHiddenInput_default } from \"../VisuallyHidden/VisuallyHiddenInput.js\";\nimport { computed, createBlock, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, toRefs, unref, watch, withCtx } from \"vue\";\nimport { useVModel } from \"@vueuse/core\";\n\n//#region src/PinInput/PinInputRoot.vue?vue&type=script&setup=true&lang.ts\nconst [injectPinInputRootContext, providePinInputRootContext] = /*#__PURE__*/ createContext(\"PinInputRoot\");\nvar PinInputRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\tinheritAttrs: false,\n\t__name: \"PinInputRoot\",\n\tprops: {\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tdefaultValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: \"\"\n\t\t},\n\t\tmask: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\totp: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\ttype: {\n\t\t\ttype: null,\n\t\t\trequired: false,\n\t\t\tdefault: \"text\"\n\t\t},\n\t\tdir: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\trequired: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t}\n\t},\n\temits: [\"update:modelValue\", \"complete\"],\n\tsetup(__props, { emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst { mask, otp, placeholder, type, disabled, dir: propDir } = toRefs(props);\n\t\tconst { forwardRef } = useForwardExpose();\n\t\tconst dir = useDirection(propDir);\n\t\tconst modelValue = useVModel(props, \"modelValue\", emits, {\n\t\t\tdefaultValue: props.defaultValue ?? [],\n\t\t\tpassive: true,\n\t\t\tdeep: true\n\t\t});\n\t\tconst currentModelValue = computed(() => Array.isArray(modelValue.value) ? [...modelValue.value] : []);\n\t\tconst inputElements = ref(/* @__PURE__ */ new Set());\n\t\tfunction onInputElementChange(el) {\n\t\t\tinputElements.value.add(el);\n\t\t}\n\t\tconst isNumericMode = computed(() => props.type === \"number\");\n\t\tconst isCompleted = computed(() => {\n\t\t\tconst modelValues = currentModelValue.value.filter((i) => !!i || isNumericMode.value && i === 0);\n\t\t\treturn modelValues.length === inputElements.value.size;\n\t\t});\n\t\twatch(modelValue, () => {\n\t\t\tif (isCompleted.value) emits(\"complete\", modelValue.value);\n\t\t}, { deep: true });\n\t\tprovidePinInputRootContext({\n\t\t\tmodelValue,\n\t\t\tcurrentModelValue,\n\t\t\tmask,\n\t\t\totp,\n\t\t\tplaceholder,\n\t\t\ttype,\n\t\t\tdir,\n\t\t\tdisabled,\n\t\t\tisCompleted,\n\t\t\tinputElements,\n\t\t\tonInputElementChange,\n\t\t\tisNumericMode\n\t\t});\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(Primitive), mergeProps(_ctx.$attrs, {\n\t\t\t\tref: unref(forwardRef),\n\t\t\t\tdir: unref(dir),\n\t\t\t\t\"data-complete\": isCompleted.value ? \"\" : void 0,\n\t\t\t\t\"data-disabled\": unref(disabled) ? \"\" : void 0\n\t\t\t}), {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\", { modelValue: unref(modelValue) }), createVNode(VisuallyHiddenInput_default, {\n\t\t\t\t\tid: _ctx.id,\n\t\t\t\t\tas: \"input\",\n\t\t\t\t\tfeature: \"focusable\",\n\t\t\t\t\ttabindex: \"-1\",\n\t\t\t\t\tvalue: currentModelValue.value.join(\"\"),\n\t\t\t\t\tname: _ctx.name ?? \"\",\n\t\t\t\t\tdisabled: unref(disabled),\n\t\t\t\t\trequired: _ctx.required,\n\t\t\t\t\tonFocus: _cache[0] || (_cache[0] = ($event) => Array.from(inputElements.value)?.[0]?.focus())\n\t\t\t\t}, null, 8, [\n\t\t\t\t\t\"id\",\n\t\t\t\t\t\"value\",\n\t\t\t\t\t\"name\",\n\t\t\t\t\t\"disabled\",\n\t\t\t\t\t\"required\"\n\t\t\t\t])]),\n\t\t\t\t_: 3\n\t\t\t}, 16, [\n\t\t\t\t\"dir\",\n\t\t\t\t\"data-complete\",\n\t\t\t\t\"data-disabled\"\n\t\t\t]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/PinInput/PinInputRoot.vue\nvar PinInputRoot_default = PinInputRoot_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { PinInputRoot_default, injectPinInputRootContext };\n//# sourceMappingURL=PinInputRoot.js.map","import { getActiveElement } from \"../shared/getActiveElement.js\";\nimport { useArrowNavigation } from \"../shared/useArrowNavigation.js\";\nimport { useComposing } from \"../shared/useComposing.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { usePrimitiveElement } from \"../Primitive/usePrimitiveElement.js\";\nimport { injectPinInputRootContext } from \"./PinInputRoot.js\";\nimport { computed, createBlock, defineComponent, nextTick, onMounted, onUnmounted, openBlock, renderSlot, unref, watch, withCtx, withKeys } from \"vue\";\n\n//#region src/PinInput/PinInputInput.vue?vue&type=script&setup=true&lang.ts\nvar PinInputInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"PinInputInput\",\n\tprops: {\n\t\tindex: {\n\t\t\ttype: Number,\n\t\t\trequired: true\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false,\n\t\t\tdefault: \"input\"\n\t\t}\n\t},\n\tsetup(__props) {\n\t\tconst props = __props;\n\t\tconst context = injectPinInputRootContext();\n\t\tconst inputElements = computed(() => [...context.inputElements.value]);\n\t\tconst currentValue = computed(() => context.currentModelValue.value[props.index]);\n\t\tconst disabled = computed(() => props.disabled || context.disabled.value);\n\t\tconst isOtpMode = computed(() => context.otp.value);\n\t\tconst isPasswordMode = computed(() => context.mask.value);\n\t\tconst NUMBER_REG = /^\\d*$/;\n\t\tconst NON_NUMBER_REG = /\\D/g;\n\t\tconst { primitiveElement, currentElement } = usePrimitiveElement();\n\t\tconst { isComposing, handleCompositionStart, handleCompositionEnd } = useComposing((event) => {\n\t\t\tconst target = event.target;\n\t\t\tconst value = event.data || target.value;\n\t\t\tif (context.isNumericMode.value) {\n\t\t\t\tconst filtered = value.replace(NON_NUMBER_REG, \"\");\n\t\t\t\tif (!filtered) {\n\t\t\t\t\ttarget.value = \"\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (filtered.length > 1) {\n\t\t\t\t\thandleMultipleCharacter(filtered);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttarget.value = filtered;\n\t\t\t\tupdateModelValueAt(props.index, filtered);\n\t\t\t\tconst nextEl$1 = inputElements.value[props.index + 1];\n\t\t\t\tif (nextEl$1) nextEl$1.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (value.length > 1) {\n\t\t\t\thandleMultipleCharacter(value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.value = value;\n\t\t\tupdateModelValueAt(props.index, value);\n\t\t\tconst nextEl = inputElements.value[props.index + 1];\n\t\t\tif (nextEl) nextEl.focus();\n\t\t});\n\t\tfunction handleInput(event) {\n\t\t\tif (isComposing.value || event.isComposing) return;\n\t\t\tconst target = event.target;\n\t\t\tif ((event.data?.length ?? 0) > 1) {\n\t\t\t\thandleMultipleCharacter(target.value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (context.isNumericMode.value && !NUMBER_REG.test(target.value)) {\n\t\t\t\ttarget.value = target.value.replace(NON_NUMBER_REG, \"\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.value = event.data || target.value.slice(-1);\n\t\t\tupdateModelValueAt(props.index, target.value);\n\t\t\tconst nextEl = inputElements.value[props.index + 1];\n\t\t\tif (nextEl) nextEl.focus();\n\t\t}\n\t\tfunction updatePlaceholder() {\n\t\t\tnextTick(() => {\n\t\t\t\tconst target = currentElement.value;\n\t\t\t\tif (!target) return;\n\t\t\t\tif (!target.value && target === getActiveElement()) target.placeholder = \"\";\n\t\t\t\telse target.placeholder = context.placeholder.value;\n\t\t\t});\n\t\t}\n\t\tfunction handleKeydown(event) {\n\t\t\tif (isComposing.value || event.isComposing) return;\n\t\t\tuseArrowNavigation(event, getActiveElement(), void 0, {\n\t\t\t\titemsArray: inputElements.value,\n\t\t\t\tfocus: true,\n\t\t\t\tloop: false,\n\t\t\t\tarrowKeyOptions: \"horizontal\",\n\t\t\t\tdir: context.dir.value\n\t\t\t});\n\t\t}\n\t\tfunction handleBackspace(event) {\n\t\t\tevent.preventDefault();\n\t\t\tconst target = event.target;\n\t\t\tconst value = target.value;\n\t\t\tif (value) updateModelValueAt(props.index, \"\");\n\t\t\telse {\n\t\t\t\tconst prevEl = inputElements.value[props.index - 1];\n\t\t\t\tif (prevEl) {\n\t\t\t\t\tprevEl.focus();\n\t\t\t\t\tupdateModelValueAt(props.index - 1, \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunction handleDelete(event) {\n\t\t\tif (event.key === \"Delete\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tupdateModelValueAt(props.index, \"\");\n\t\t\t}\n\t\t}\n\t\tfunction handleFocus(event) {\n\t\t\tif (context.otp.value) {\n\t\t\t\tconst firstEmptyInputIdx = inputElements.value.findIndex((_, idx) => context.currentModelValue.value[idx] === \"\" || context.currentModelValue.value[idx] === void 0);\n\t\t\t\tif (firstEmptyInputIdx !== -1 && firstEmptyInputIdx < props.index) {\n\t\t\t\t\tinputElements.value[firstEmptyInputIdx].focus();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst target = event.target;\n\t\t\ttarget.setSelectionRange(1, 1);\n\t\t\tupdatePlaceholder();\n\t\t}\n\t\tfunction handleBlur(event) {\n\t\t\tupdatePlaceholder();\n\t\t}\n\t\tfunction handlePaste(event) {\n\t\t\tevent.preventDefault();\n\t\t\tconst clipboardData = event.clipboardData;\n\t\t\tif (!clipboardData) return;\n\t\t\tconst rawValues = clipboardData.getData(\"text\");\n\t\t\tconst values = context.isNumericMode.value ? rawValues.replace(NON_NUMBER_REG, \"\") : rawValues;\n\t\t\thandleMultipleCharacter(values);\n\t\t}\n\t\tfunction handleMultipleCharacter(values) {\n\t\t\tconst tempModelValue = [...context.currentModelValue.value];\n\t\t\tconst initialIndex = values.length >= inputElements.value.length ? 0 : props.index;\n\t\t\tconst lastIndex = Math.min(initialIndex + values.length, inputElements.value.length);\n\t\t\tfor (let i = initialIndex; i < lastIndex; i++) {\n\t\t\t\tconst input = inputElements.value[i];\n\t\t\t\tconst value = values[i - initialIndex];\n\t\t\t\tif (context.isNumericMode.value) {\n\t\t\t\t\tconst num = Number.parseInt(value);\n\t\t\t\t\tif (Number.isNaN(num)) continue;\n\t\t\t\t\ttempModelValue[i] = num;\n\t\t\t\t} else tempModelValue[i] = value;\n\t\t\t\tinput.focus();\n\t\t\t}\n\t\t\tcontext.modelValue.value = tempModelValue;\n\t\t\tinputElements.value[lastIndex]?.focus();\n\t\t}\n\t\tfunction removeTrailingEmptyStrings(input) {\n\t\t\tlet i = input.length - 1;\n\t\t\twhile (i >= 0 && input[i] === \"\") {\n\t\t\t\tinput.pop();\n\t\t\t\ti--;\n\t\t\t}\n\t\t\treturn input;\n\t\t}\n\t\tfunction updateModelValueAt(index, value) {\n\t\t\tconst tempModelValue = [...context.currentModelValue.value];\n\t\t\tif (context.isNumericMode.value) {\n\t\t\t\tconst num = +value;\n\t\t\t\tif (value === \"\" || isNaN(num)) delete tempModelValue[index];\n\t\t\t\telse tempModelValue[index] = num;\n\t\t\t} else tempModelValue[index] = value;\n\t\t\tcontext.modelValue.value = removeTrailingEmptyStrings(tempModelValue);\n\t\t}\n\t\twatch(currentValue, updatePlaceholder);\n\t\tonMounted(() => {\n\t\t\tcontext.onInputElementChange(currentElement.value);\n\t\t});\n\t\tonUnmounted(() => {\n\t\t\tcontext.inputElements?.value.delete(currentElement.value);\n\t\t});\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(Primitive), {\n\t\t\t\tref_key: \"primitiveElement\",\n\t\t\t\tref: primitiveElement,\n\t\t\t\tautocapitalize: \"none\",\n\t\t\t\tas: _ctx.as,\n\t\t\t\t\"as-child\": _ctx.asChild,\n\t\t\t\tautocomplete: isOtpMode.value ? \"one-time-code\" : \"false\",\n\t\t\t\ttype: isPasswordMode.value ? \"password\" : \"text\",\n\t\t\t\tinputmode: unref(context).isNumericMode.value ? \"numeric\" : \"text\",\n\t\t\t\tpattern: unref(context).isNumericMode.value ? \"[0-9]*\" : void 0,\n\t\t\t\tplaceholder: unref(context).placeholder.value,\n\t\t\t\tvalue: currentValue.value,\n\t\t\t\tdisabled: disabled.value,\n\t\t\t\t\"data-disabled\": disabled.value ? \"\" : void 0,\n\t\t\t\t\"data-complete\": unref(context).isCompleted.value ? \"\" : void 0,\n\t\t\t\t\"aria-label\": `pin input ${_ctx.index + 1} of ${inputElements.value.length}`,\n\t\t\t\tonInput: _cache[0] || (_cache[0] = ($event) => handleInput($event)),\n\t\t\t\tonKeydown: [\n\t\t\t\t\twithKeys(handleKeydown, [\n\t\t\t\t\t\t\"left\",\n\t\t\t\t\t\t\"right\",\n\t\t\t\t\t\t\"up\",\n\t\t\t\t\t\t\"down\",\n\t\t\t\t\t\t\"home\",\n\t\t\t\t\t\t\"end\"\n\t\t\t\t\t]),\n\t\t\t\t\twithKeys(handleBackspace, [\"backspace\"]),\n\t\t\t\t\twithKeys(handleDelete, [\"delete\"])\n\t\t\t\t],\n\t\t\t\tonFocus: handleFocus,\n\t\t\t\tonBlur: handleBlur,\n\t\t\t\tonPaste: handlePaste,\n\t\t\t\tonCompositionstart: unref(handleCompositionStart),\n\t\t\t\tonCompositionend: unref(handleCompositionEnd)\n\t\t\t}, {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\")]),\n\t\t\t\t_: 3\n\t\t\t}, 8, [\n\t\t\t\t\"as\",\n\t\t\t\t\"as-child\",\n\t\t\t\t\"autocomplete\",\n\t\t\t\t\"type\",\n\t\t\t\t\"inputmode\",\n\t\t\t\t\"pattern\",\n\t\t\t\t\"placeholder\",\n\t\t\t\t\"value\",\n\t\t\t\t\"disabled\",\n\t\t\t\t\"data-disabled\",\n\t\t\t\t\"data-complete\",\n\t\t\t\t\"aria-label\",\n\t\t\t\t\"onCompositionstart\",\n\t\t\t\t\"onCompositionend\"\n\t\t\t]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/PinInput/PinInputInput.vue\nvar PinInputInput_default = PinInputInput_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { PinInputInput_default };\n//# sourceMappingURL=PinInputInput.js.map","<template>\n <PinInputRoot\n :id=\"computedId\"\n v-model=\"modelValue\"\n :class=\"rootClasses\"\n :disabled=\"props.disabled\"\n :dir=\"props.dir\"\n :mask=\"props.mask\"\n :name=\"props.name\"\n :otp=\"props.otp\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required\"\n :type=\"props.type\"\n @complete=\"emit('complete', $event)\"\n >\n <PinInputInput\n v-for=\"(_, i) in computedLength\"\n :key=\"i\"\n :index=\"i\"\n :disabled=\"props.disabled\"\n as-child\n >\n <BFormInput\n class=\"b-form-otp-field\"\n :aria-label=\"`${props.ariaLabel || 'Pin'} ${i + 1} of ${computedLength}`\"\n :aria-invalid=\"props.ariaInvalid\"\n :autofocus=\"props.autofocus && i === 0\"\n :disabled=\"props.disabled\"\n :form=\"props.form\"\n :plaintext=\"props.plaintext\"\n :readonly=\"props.readonly\"\n :size=\"props.size\"\n :state=\"props.state\"\n />\n </PinInputInput>\n </PinInputRoot>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useToNumber} from '@vueuse/core'\nimport {PinInputInput, PinInputRoot} from 'reka-ui'\nimport type {BFormOtpProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport BFormInput from '../BFormInput/BFormInput.vue'\n\nconst lengthDefault = 6\nconst _props = withDefaults(defineProps<Omit<BFormOtpProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n ariaLabel: undefined,\n autofocus: false,\n dir: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n length: lengthDefault,\n mask: false,\n name: undefined,\n otp: false,\n placeholder: '',\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: null,\n type: 'text',\n})\nconst props = useDefaults(_props, 'BFormOtp')\nconst emit = defineEmits<{\n complete: [value: string[]]\n}>()\n\nconst modelValue = defineModel<BFormOtpProps['modelValue']>({default: () => []})\n\nconst computedId = useId(() => props.id)\nconst lengthNumber = useToNumber(() => props.length, {nanToZero: true, method: 'parseInt'})\nconst computedLength = computed(() => (lengthNumber.value > 0 ? lengthNumber.value : lengthDefault))\n\nconst rootClasses = computed(() => [\n 'b-form-otp',\n 'd-flex',\n 'gap-2',\n 'align-items-center',\n {\n [`b-form-otp-${props.size}`]: !!props.size,\n },\n])\n</script>\n","<template>\n <PinInputRoot\n :id=\"computedId\"\n v-model=\"modelValue\"\n :class=\"rootClasses\"\n :disabled=\"props.disabled\"\n :dir=\"props.dir\"\n :mask=\"props.mask\"\n :name=\"props.name\"\n :otp=\"props.otp\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required\"\n :type=\"props.type\"\n @complete=\"emit('complete', $event)\"\n >\n <PinInputInput\n v-for=\"(_, i) in computedLength\"\n :key=\"i\"\n :index=\"i\"\n :disabled=\"props.disabled\"\n as-child\n >\n <BFormInput\n class=\"b-form-otp-field\"\n :aria-label=\"`${props.ariaLabel || 'Pin'} ${i + 1} of ${computedLength}`\"\n :aria-invalid=\"props.ariaInvalid\"\n :autofocus=\"props.autofocus && i === 0\"\n :disabled=\"props.disabled\"\n :form=\"props.form\"\n :plaintext=\"props.plaintext\"\n :readonly=\"props.readonly\"\n :size=\"props.size\"\n :state=\"props.state\"\n />\n </PinInputInput>\n </PinInputRoot>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useToNumber} from '@vueuse/core'\nimport {PinInputInput, PinInputRoot} from 'reka-ui'\nimport type {BFormOtpProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport BFormInput from '../BFormInput/BFormInput.vue'\n\nconst lengthDefault = 6\nconst _props = withDefaults(defineProps<Omit<BFormOtpProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n ariaLabel: undefined,\n autofocus: false,\n dir: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n length: lengthDefault,\n mask: false,\n name: undefined,\n otp: false,\n placeholder: '',\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: null,\n type: 'text',\n})\nconst props = useDefaults(_props, 'BFormOtp')\nconst emit = defineEmits<{\n complete: [value: string[]]\n}>()\n\nconst modelValue = defineModel<BFormOtpProps['modelValue']>({default: () => []})\n\nconst computedId = useId(() => props.id)\nconst lengthNumber = useToNumber(() => props.length, {nanToZero: true, method: 'parseInt'})\nconst computedLength = computed(() => (lengthNumber.value > 0 ? lengthNumber.value : lengthDefault))\n\nconst rootClasses = computed(() => [\n 'b-form-otp',\n 'd-flex',\n 'gap-2',\n 'align-items-center',\n {\n [`b-form-otp-${props.size}`]: !!props.size,\n },\n])\n</script>\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;AACA,IAAM,iBAAiB,CAAC,SAAS,UAAU;;;;;;;;;;AAU3C,SAAS,mBAAmB,GAAG,gBAAgB,eAAe,UAAU,CAAC,GAAG;CAC3E,IAAI,CAAC,kB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MAAA,KAAA,CAAK,CAAC;IAChB,KAAK,MAAA,KAAA,CAAK,CAAC;IACX,MAAM,MAAA,KAAA,CAAK,CAAC;IACZ,MAAM,MAAA,KAAA,CAAK,CAAC;IACZ,KAAK,MAAA,KAAA,CAAK,CAAC;IACX,aAAa,MAAA,KAAA,CAAK,CAAC;IACnB,UAAU,MAAA,KAAA,CAAK,CAAC;IAChB,MAAM,MAAA,KAAA,CAAK,CAAC;IACZ,YAAQ,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAa,MAAM;;IAGhC,SAAA,cAAgC,EADlC,UAAA,IAAA,GAAA,mBAmBgB,UAAA,MAAA,WAlBG,eAAA,QAAT,GAAG,MAAC;KADd,OAAA,UAAA,GAAA,YAmBgB,MAAA,qBAAA,GAAA;MAjBb,KAAK;MACL,OAAO;MACP,UAAU,MAAA,KAAA,CAAK,CAAC;MACjB,YAAA;;MAEA,SAAA,cAWE,CAXF,YAWE,oBAAA;OAVA,OAAM;OACL,cAAU,GAAK,MAAA,KAAA,CAAK,CAAC,aAAS,MAAA,GAAa,IAAC,EAAA,MAAW,eAAA;OACvD,gBAAc,MAAA,KAAA,CAAK,CAAC;OACpB,WAAW,MAAA,KAAA,CAAK,CAAC,aAAa,MAAC;OAC/B,UAAU,MAAA,KAAA,CAAK,CAAC;OAChB,MAAM,MAAA,KAAA,CAAK,CAAC;OACZ,WAAW,MAAA,KAAA,CAAK,CAAC;OACjB,UAAU,MAAA,KAAA,CAAK,CAAC;OAChB,MAAM,MAAA,KAAA,CAAK,CAAC;OACZ,OAAO,MAAA,KAAA,CAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"BFormOtp-C3vmDnzs.js","names":[],"sources":["../../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useArrowNavigation.js","../../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/PinInput/PinInputRoot.js","../../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/PinInput/PinInputInput.js","../src/components/BFormOtp/BFormOtp.vue","../src/components/BFormOtp/BFormOtp.vue"],"sourcesContent":["//#region src/shared/useArrowNavigation.ts\nconst ignoredElement = [\"INPUT\", \"TEXTAREA\"];\n/**\n* Allow arrow navigation for every html element with data-reka-collection-item tag\n*\n* @param e Keyboard event\n* @param currentElement Event initiator element or any element that wants to handle the navigation\n* @param parentElement Parent element where contains all the collection items, this will collect every item to be used when nav\n* @param options further options\n* @returns the navigated html element or null if none\n*/\nfunction useArrowNavigation(e, currentElement, parentElement, options = {}) {\n\tif (!currentElement || options.enableIgnoredElement && ignoredElement.includes(currentElement.nodeName)) return null;\n\tconst { arrowKeyOptions = \"both\", attributeName = \"[data-reka-collection-item]\", itemsArray = [], loop = true, dir = \"ltr\", preventScroll = true, focus = false } = options;\n\tconst [right, left, up, down, home, end] = [\n\t\te.key === \"ArrowRight\",\n\t\te.key === \"ArrowLeft\",\n\t\te.key === \"ArrowUp\",\n\t\te.key === \"ArrowDown\",\n\t\te.key === \"Home\",\n\t\te.key === \"End\"\n\t];\n\tconst goingVertical = up || down;\n\tconst goingHorizontal = right || left;\n\tif (!home && !end && (!goingVertical && !goingHorizontal || arrowKeyOptions === \"vertical\" && goingHorizontal || arrowKeyOptions === \"horizontal\" && goingVertical)) return null;\n\tconst allCollectionItems = parentElement ? Array.from(parentElement.querySelectorAll(attributeName)) : itemsArray;\n\tif (!allCollectionItems.length) return null;\n\tif (preventScroll) e.preventDefault();\n\tlet item = null;\n\tif (goingHorizontal || goingVertical) {\n\t\tconst goForward = goingVertical ? down : dir === \"ltr\" ? right : left;\n\t\titem = findNextFocusableElement(allCollectionItems, currentElement, {\n\t\t\tgoForward,\n\t\t\tloop\n\t\t});\n\t} else if (home) item = allCollectionItems.at(0) || null;\n\telse if (end) item = allCollectionItems.at(-1) || null;\n\tif (focus) item?.focus();\n\treturn item;\n}\n/**\n* Recursive function to find the next focusable element to avoid disabled elements\n*\n* @param elements Elements to navigate\n* @param currentElement Current active element\n* @param options\n* @returns next focusable element\n*/\nfunction findNextFocusableElement(elements, currentElement, options, iterations = !elements.includes(currentElement) ? elements.length + 1 : elements.length) {\n\tif (--iterations === 0) return null;\n\tconst index = elements.indexOf(currentElement);\n\tlet newIndex;\n\tif (index === -1) newIndex = options.goForward ? 0 : elements.length - 1;\n\telse newIndex = options.goForward ? index + 1 : index - 1;\n\tif (!options.loop && (newIndex < 0 || newIndex >= elements.length)) return null;\n\tconst adjustedNewIndex = (newIndex + elements.length) % elements.length;\n\tconst candidate = elements[adjustedNewIndex];\n\tif (!candidate) return null;\n\tconst isDisabled = candidate.hasAttribute(\"disabled\") && candidate.getAttribute(\"disabled\") !== \"false\";\n\tif (isDisabled) return findNextFocusableElement(elements, candidate, options, iterations);\n\treturn candidate;\n}\n\n//#endregion\nexport { useArrowNavigation };\n//# sourceMappingURL=useArrowNavigation.js.map","import { createContext } from \"../shared/createContext.js\";\nimport { useDirection } from \"../shared/useDirection.js\";\nimport { useForwardExpose } from \"../shared/useForwardExpose.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { VisuallyHiddenInput_default } from \"../VisuallyHidden/VisuallyHiddenInput.js\";\nimport { computed, createBlock, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, toRefs, unref, watch, withCtx } from \"vue\";\nimport { useVModel } from \"@vueuse/core\";\n\n//#region src/PinInput/PinInputRoot.vue?vue&type=script&setup=true&lang.ts\nconst [injectPinInputRootContext, providePinInputRootContext] = /*#__PURE__*/ createContext(\"PinInputRoot\");\nvar PinInputRoot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\tinheritAttrs: false,\n\t__name: \"PinInputRoot\",\n\tprops: {\n\t\tmodelValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tdefaultValue: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: \"\"\n\t\t},\n\t\tmask: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\totp: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\ttype: {\n\t\t\ttype: null,\n\t\t\trequired: false,\n\t\t\tdefault: \"text\"\n\t\t},\n\t\tdir: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false\n\t\t},\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: false\n\t\t},\n\t\trequired: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t}\n\t},\n\temits: [\"update:modelValue\", \"complete\"],\n\tsetup(__props, { emit: __emit }) {\n\t\tconst props = __props;\n\t\tconst emits = __emit;\n\t\tconst { mask, otp, placeholder, type, disabled, dir: propDir } = toRefs(props);\n\t\tconst { forwardRef } = useForwardExpose();\n\t\tconst dir = useDirection(propDir);\n\t\tconst modelValue = useVModel(props, \"modelValue\", emits, {\n\t\t\tdefaultValue: props.defaultValue ?? [],\n\t\t\tpassive: true,\n\t\t\tdeep: true\n\t\t});\n\t\tconst currentModelValue = computed(() => Array.isArray(modelValue.value) ? [...modelValue.value] : []);\n\t\tconst inputElements = ref(/* @__PURE__ */ new Set());\n\t\tfunction onInputElementChange(el) {\n\t\t\tinputElements.value.add(el);\n\t\t}\n\t\tconst isNumericMode = computed(() => props.type === \"number\");\n\t\tconst isCompleted = computed(() => {\n\t\t\tconst modelValues = currentModelValue.value.filter((i) => !!i || isNumericMode.value && i === 0);\n\t\t\treturn modelValues.length === inputElements.value.size;\n\t\t});\n\t\twatch(modelValue, () => {\n\t\t\tif (isCompleted.value) emits(\"complete\", modelValue.value);\n\t\t}, { deep: true });\n\t\tprovidePinInputRootContext({\n\t\t\tmodelValue,\n\t\t\tcurrentModelValue,\n\t\t\tmask,\n\t\t\totp,\n\t\t\tplaceholder,\n\t\t\ttype,\n\t\t\tdir,\n\t\t\tdisabled,\n\t\t\tisCompleted,\n\t\t\tinputElements,\n\t\t\tonInputElementChange,\n\t\t\tisNumericMode\n\t\t});\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(Primitive), mergeProps(_ctx.$attrs, {\n\t\t\t\tref: unref(forwardRef),\n\t\t\t\tdir: unref(dir),\n\t\t\t\t\"data-complete\": isCompleted.value ? \"\" : void 0,\n\t\t\t\t\"data-disabled\": unref(disabled) ? \"\" : void 0\n\t\t\t}), {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\", { modelValue: unref(modelValue) }), createVNode(VisuallyHiddenInput_default, {\n\t\t\t\t\tid: _ctx.id,\n\t\t\t\t\tas: \"input\",\n\t\t\t\t\tfeature: \"focusable\",\n\t\t\t\t\ttabindex: \"-1\",\n\t\t\t\t\tvalue: currentModelValue.value.join(\"\"),\n\t\t\t\t\tname: _ctx.name ?? \"\",\n\t\t\t\t\tdisabled: unref(disabled),\n\t\t\t\t\trequired: _ctx.required,\n\t\t\t\t\tonFocus: _cache[0] || (_cache[0] = ($event) => Array.from(inputElements.value)?.[0]?.focus())\n\t\t\t\t}, null, 8, [\n\t\t\t\t\t\"id\",\n\t\t\t\t\t\"value\",\n\t\t\t\t\t\"name\",\n\t\t\t\t\t\"disabled\",\n\t\t\t\t\t\"required\"\n\t\t\t\t])]),\n\t\t\t\t_: 3\n\t\t\t}, 16, [\n\t\t\t\t\"dir\",\n\t\t\t\t\"data-complete\",\n\t\t\t\t\"data-disabled\"\n\t\t\t]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/PinInput/PinInputRoot.vue\nvar PinInputRoot_default = PinInputRoot_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { PinInputRoot_default, injectPinInputRootContext };\n//# sourceMappingURL=PinInputRoot.js.map","import { getActiveElement } from \"../shared/getActiveElement.js\";\nimport { useArrowNavigation } from \"../shared/useArrowNavigation.js\";\nimport { useComposing } from \"../shared/useComposing.js\";\nimport { Primitive } from \"../Primitive/Primitive.js\";\nimport { usePrimitiveElement } from \"../Primitive/usePrimitiveElement.js\";\nimport { injectPinInputRootContext } from \"./PinInputRoot.js\";\nimport { computed, createBlock, defineComponent, nextTick, onMounted, onUnmounted, openBlock, renderSlot, unref, watch, withCtx, withKeys } from \"vue\";\n\n//#region src/PinInput/PinInputInput.vue?vue&type=script&setup=true&lang.ts\nvar PinInputInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({\n\t__name: \"PinInputInput\",\n\tprops: {\n\t\tindex: {\n\t\t\ttype: Number,\n\t\t\trequired: true\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tasChild: {\n\t\t\ttype: Boolean,\n\t\t\trequired: false\n\t\t},\n\t\tas: {\n\t\t\ttype: null,\n\t\t\trequired: false,\n\t\t\tdefault: \"input\"\n\t\t}\n\t},\n\tsetup(__props) {\n\t\tconst props = __props;\n\t\tconst context = injectPinInputRootContext();\n\t\tconst inputElements = computed(() => [...context.inputElements.value]);\n\t\tconst currentValue = computed(() => context.currentModelValue.value[props.index]);\n\t\tconst disabled = computed(() => props.disabled || context.disabled.value);\n\t\tconst isOtpMode = computed(() => context.otp.value);\n\t\tconst isPasswordMode = computed(() => context.mask.value);\n\t\tconst NUMBER_REG = /^\\d*$/;\n\t\tconst NON_NUMBER_REG = /\\D/g;\n\t\tconst { primitiveElement, currentElement } = usePrimitiveElement();\n\t\tconst { isComposing, handleCompositionStart, handleCompositionEnd } = useComposing((event) => {\n\t\t\tconst target = event.target;\n\t\t\tconst value = event.data || target.value;\n\t\t\tif (context.isNumericMode.value) {\n\t\t\t\tconst filtered = value.replace(NON_NUMBER_REG, \"\");\n\t\t\t\tif (!filtered) {\n\t\t\t\t\ttarget.value = \"\";\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (filtered.length > 1) {\n\t\t\t\t\thandleMultipleCharacter(filtered);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttarget.value = filtered;\n\t\t\t\tupdateModelValueAt(props.index, filtered);\n\t\t\t\tconst nextEl$1 = inputElements.value[props.index + 1];\n\t\t\t\tif (nextEl$1) nextEl$1.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (value.length > 1) {\n\t\t\t\thandleMultipleCharacter(value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.value = value;\n\t\t\tupdateModelValueAt(props.index, value);\n\t\t\tconst nextEl = inputElements.value[props.index + 1];\n\t\t\tif (nextEl) nextEl.focus();\n\t\t});\n\t\tfunction handleInput(event) {\n\t\t\tif (isComposing.value || event.isComposing) return;\n\t\t\tconst target = event.target;\n\t\t\tif ((event.data?.length ?? 0) > 1) {\n\t\t\t\thandleMultipleCharacter(target.value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (context.isNumericMode.value && !NUMBER_REG.test(target.value)) {\n\t\t\t\ttarget.value = target.value.replace(NON_NUMBER_REG, \"\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.value = event.data || target.value.slice(-1);\n\t\t\tupdateModelValueAt(props.index, target.value);\n\t\t\tconst nextEl = inputElements.value[props.index + 1];\n\t\t\tif (nextEl) nextEl.focus();\n\t\t}\n\t\tfunction updatePlaceholder() {\n\t\t\tnextTick(() => {\n\t\t\t\tconst target = currentElement.value;\n\t\t\t\tif (!target) return;\n\t\t\t\tif (!target.value && target === getActiveElement()) target.placeholder = \"\";\n\t\t\t\telse target.placeholder = context.placeholder.value;\n\t\t\t});\n\t\t}\n\t\tfunction handleKeydown(event) {\n\t\t\tif (isComposing.value || event.isComposing) return;\n\t\t\tuseArrowNavigation(event, getActiveElement(), void 0, {\n\t\t\t\titemsArray: inputElements.value,\n\t\t\t\tfocus: true,\n\t\t\t\tloop: false,\n\t\t\t\tarrowKeyOptions: \"horizontal\",\n\t\t\t\tdir: context.dir.value\n\t\t\t});\n\t\t}\n\t\tfunction handleBackspace(event) {\n\t\t\tevent.preventDefault();\n\t\t\tconst target = event.target;\n\t\t\tconst value = target.value;\n\t\t\tif (value) updateModelValueAt(props.index, \"\");\n\t\t\telse {\n\t\t\t\tconst prevEl = inputElements.value[props.index - 1];\n\t\t\t\tif (prevEl) {\n\t\t\t\t\tprevEl.focus();\n\t\t\t\t\tupdateModelValueAt(props.index - 1, \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunction handleDelete(event) {\n\t\t\tif (event.key === \"Delete\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tupdateModelValueAt(props.index, \"\");\n\t\t\t}\n\t\t}\n\t\tfunction handleFocus(event) {\n\t\t\tif (context.otp.value) {\n\t\t\t\tconst firstEmptyInputIdx = inputElements.value.findIndex((_, idx) => context.currentModelValue.value[idx] === \"\" || context.currentModelValue.value[idx] === void 0);\n\t\t\t\tif (firstEmptyInputIdx !== -1 && firstEmptyInputIdx < props.index) {\n\t\t\t\t\tinputElements.value[firstEmptyInputIdx].focus();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst target = event.target;\n\t\t\ttarget.setSelectionRange(1, 1);\n\t\t\tupdatePlaceholder();\n\t\t}\n\t\tfunction handleBlur(event) {\n\t\t\tupdatePlaceholder();\n\t\t}\n\t\tfunction handlePaste(event) {\n\t\t\tevent.preventDefault();\n\t\t\tconst clipboardData = event.clipboardData;\n\t\t\tif (!clipboardData) return;\n\t\t\tconst rawValues = clipboardData.getData(\"text\");\n\t\t\tconst values = context.isNumericMode.value ? rawValues.replace(NON_NUMBER_REG, \"\") : rawValues;\n\t\t\thandleMultipleCharacter(values);\n\t\t}\n\t\tfunction handleMultipleCharacter(values) {\n\t\t\tconst tempModelValue = [...context.currentModelValue.value];\n\t\t\tconst initialIndex = values.length >= inputElements.value.length ? 0 : props.index;\n\t\t\tconst lastIndex = Math.min(initialIndex + values.length, inputElements.value.length);\n\t\t\tfor (let i = initialIndex; i < lastIndex; i++) {\n\t\t\t\tconst input = inputElements.value[i];\n\t\t\t\tconst value = values[i - initialIndex];\n\t\t\t\tif (context.isNumericMode.value) {\n\t\t\t\t\tconst num = Number.parseInt(value);\n\t\t\t\t\tif (Number.isNaN(num)) continue;\n\t\t\t\t\ttempModelValue[i] = num;\n\t\t\t\t} else tempModelValue[i] = value;\n\t\t\t\tinput.focus();\n\t\t\t}\n\t\t\tcontext.modelValue.value = tempModelValue;\n\t\t\tinputElements.value[lastIndex]?.focus();\n\t\t}\n\t\tfunction removeTrailingEmptyStrings(input) {\n\t\t\tlet i = input.length - 1;\n\t\t\twhile (i >= 0 && input[i] === \"\") {\n\t\t\t\tinput.pop();\n\t\t\t\ti--;\n\t\t\t}\n\t\t\treturn input;\n\t\t}\n\t\tfunction updateModelValueAt(index, value) {\n\t\t\tconst tempModelValue = [...context.currentModelValue.value];\n\t\t\tif (context.isNumericMode.value) {\n\t\t\t\tconst num = +value;\n\t\t\t\tif (value === \"\" || isNaN(num)) delete tempModelValue[index];\n\t\t\t\telse tempModelValue[index] = num;\n\t\t\t} else tempModelValue[index] = value;\n\t\t\tcontext.modelValue.value = removeTrailingEmptyStrings(tempModelValue);\n\t\t}\n\t\twatch(currentValue, updatePlaceholder);\n\t\tonMounted(() => {\n\t\t\tcontext.onInputElementChange(currentElement.value);\n\t\t});\n\t\tonUnmounted(() => {\n\t\t\tcontext.inputElements?.value.delete(currentElement.value);\n\t\t});\n\t\treturn (_ctx, _cache) => {\n\t\t\treturn openBlock(), createBlock(unref(Primitive), {\n\t\t\t\tref_key: \"primitiveElement\",\n\t\t\t\tref: primitiveElement,\n\t\t\t\tautocapitalize: \"none\",\n\t\t\t\tas: _ctx.as,\n\t\t\t\t\"as-child\": _ctx.asChild,\n\t\t\t\tautocomplete: isOtpMode.value ? \"one-time-code\" : \"false\",\n\t\t\t\ttype: isPasswordMode.value ? \"password\" : \"text\",\n\t\t\t\tinputmode: unref(context).isNumericMode.value ? \"numeric\" : \"text\",\n\t\t\t\tpattern: unref(context).isNumericMode.value ? \"[0-9]*\" : void 0,\n\t\t\t\tplaceholder: unref(context).placeholder.value,\n\t\t\t\tvalue: currentValue.value,\n\t\t\t\tdisabled: disabled.value,\n\t\t\t\t\"data-disabled\": disabled.value ? \"\" : void 0,\n\t\t\t\t\"data-complete\": unref(context).isCompleted.value ? \"\" : void 0,\n\t\t\t\t\"aria-label\": `pin input ${_ctx.index + 1} of ${inputElements.value.length}`,\n\t\t\t\tonInput: _cache[0] || (_cache[0] = ($event) => handleInput($event)),\n\t\t\t\tonKeydown: [\n\t\t\t\t\twithKeys(handleKeydown, [\n\t\t\t\t\t\t\"left\",\n\t\t\t\t\t\t\"right\",\n\t\t\t\t\t\t\"up\",\n\t\t\t\t\t\t\"down\",\n\t\t\t\t\t\t\"home\",\n\t\t\t\t\t\t\"end\"\n\t\t\t\t\t]),\n\t\t\t\t\twithKeys(handleBackspace, [\"backspace\"]),\n\t\t\t\t\twithKeys(handleDelete, [\"delete\"])\n\t\t\t\t],\n\t\t\t\tonFocus: handleFocus,\n\t\t\t\tonBlur: handleBlur,\n\t\t\t\tonPaste: handlePaste,\n\t\t\t\tonCompositionstart: unref(handleCompositionStart),\n\t\t\t\tonCompositionend: unref(handleCompositionEnd)\n\t\t\t}, {\n\t\t\t\tdefault: withCtx(() => [renderSlot(_ctx.$slots, \"default\")]),\n\t\t\t\t_: 3\n\t\t\t}, 8, [\n\t\t\t\t\"as\",\n\t\t\t\t\"as-child\",\n\t\t\t\t\"autocomplete\",\n\t\t\t\t\"type\",\n\t\t\t\t\"inputmode\",\n\t\t\t\t\"pattern\",\n\t\t\t\t\"placeholder\",\n\t\t\t\t\"value\",\n\t\t\t\t\"disabled\",\n\t\t\t\t\"data-disabled\",\n\t\t\t\t\"data-complete\",\n\t\t\t\t\"aria-label\",\n\t\t\t\t\"onCompositionstart\",\n\t\t\t\t\"onCompositionend\"\n\t\t\t]);\n\t\t};\n\t}\n});\n\n//#endregion\n//#region src/PinInput/PinInputInput.vue\nvar PinInputInput_default = PinInputInput_vue_vue_type_script_setup_true_lang_default;\n\n//#endregion\nexport { PinInputInput_default };\n//# sourceMappingURL=PinInputInput.js.map","<template>\n <PinInputRoot\n :id=\"computedId\"\n v-model=\"modelValue\"\n :class=\"rootClasses\"\n :disabled=\"props.disabled\"\n :dir=\"props.dir\"\n :mask=\"props.mask\"\n :name=\"props.name\"\n :otp=\"props.otp\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required\"\n :type=\"props.type\"\n @complete=\"emit('complete', $event)\"\n >\n <PinInputInput\n v-for=\"(_, i) in computedLength\"\n :key=\"i\"\n :index=\"i\"\n :disabled=\"props.disabled\"\n as-child\n >\n <BFormInput\n class=\"b-form-otp-field\"\n :aria-label=\"`${props.ariaLabel || 'Pin'} ${i + 1} of ${computedLength}`\"\n :aria-invalid=\"props.ariaInvalid\"\n :autofocus=\"props.autofocus && i === 0\"\n :disabled=\"props.disabled\"\n :form=\"props.form\"\n :plaintext=\"props.plaintext\"\n :readonly=\"props.readonly\"\n :size=\"props.size\"\n :state=\"props.state\"\n />\n </PinInputInput>\n </PinInputRoot>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useToNumber} from '@vueuse/core'\nimport {PinInputInput, PinInputRoot} from 'reka-ui'\nimport type {BFormOtpProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport BFormInput from '../BFormInput/BFormInput.vue'\n\nconst lengthDefault = 6\nconst _props = withDefaults(defineProps<Omit<BFormOtpProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n ariaLabel: undefined,\n autofocus: false,\n dir: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n length: lengthDefault,\n mask: false,\n name: undefined,\n otp: false,\n placeholder: '',\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: null,\n type: 'text',\n})\nconst props = useDefaults(_props, 'BFormOtp')\nconst emit = defineEmits<{\n complete: [value: string[]]\n}>()\n\nconst modelValue = defineModel<BFormOtpProps['modelValue']>({default: () => []})\n\nconst computedId = useId(() => props.id)\nconst lengthNumber = useToNumber(() => props.length, {nanToZero: true, method: 'parseInt'})\nconst computedLength = computed(() => (lengthNumber.value > 0 ? lengthNumber.value : lengthDefault))\n\nconst rootClasses = computed(() => [\n 'b-form-otp',\n 'd-flex',\n 'gap-2',\n 'align-items-center',\n {\n [`b-form-otp-${props.size}`]: !!props.size,\n },\n])\n</script>\n","<template>\n <PinInputRoot\n :id=\"computedId\"\n v-model=\"modelValue\"\n :class=\"rootClasses\"\n :disabled=\"props.disabled\"\n :dir=\"props.dir\"\n :mask=\"props.mask\"\n :name=\"props.name\"\n :otp=\"props.otp\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required\"\n :type=\"props.type\"\n @complete=\"emit('complete', $event)\"\n >\n <PinInputInput\n v-for=\"(_, i) in computedLength\"\n :key=\"i\"\n :index=\"i\"\n :disabled=\"props.disabled\"\n as-child\n >\n <BFormInput\n class=\"b-form-otp-field\"\n :aria-label=\"`${props.ariaLabel || 'Pin'} ${i + 1} of ${computedLength}`\"\n :aria-invalid=\"props.ariaInvalid\"\n :autofocus=\"props.autofocus && i === 0\"\n :disabled=\"props.disabled\"\n :form=\"props.form\"\n :plaintext=\"props.plaintext\"\n :readonly=\"props.readonly\"\n :size=\"props.size\"\n :state=\"props.state\"\n />\n </PinInputInput>\n </PinInputRoot>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed} from 'vue'\nimport {useToNumber} from '@vueuse/core'\nimport {PinInputInput, PinInputRoot} from 'reka-ui'\nimport type {BFormOtpProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport BFormInput from '../BFormInput/BFormInput.vue'\n\nconst lengthDefault = 6\nconst _props = withDefaults(defineProps<Omit<BFormOtpProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n ariaLabel: undefined,\n autofocus: false,\n dir: undefined,\n disabled: false,\n form: undefined,\n id: undefined,\n length: lengthDefault,\n mask: false,\n name: undefined,\n otp: false,\n placeholder: '',\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: null,\n type: 'text',\n})\nconst props = useDefaults(_props, 'BFormOtp')\nconst emit = defineEmits<{\n complete: [value: string[]]\n}>()\n\nconst modelValue = defineModel<BFormOtpProps['modelValue']>({default: () => []})\n\nconst computedId = useId(() => props.id)\nconst lengthNumber = useToNumber(() => props.length, {nanToZero: true, method: 'parseInt'})\nconst computedLength = computed(() => (lengthNumber.value > 0 ? lengthNumber.value : lengthDefault))\n\nconst rootClasses = computed(() => [\n 'b-form-otp',\n 'd-flex',\n 'gap-2',\n 'align-items-center',\n {\n [`b-form-otp-${props.size}`]: !!props.size,\n },\n])\n</script>\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;;;;;;;;AACA,IAAM,iBAAiB,CAAC,SAAS,UAAU;;;;;;;;;;AAU3C,SAAS,mBAAmB,GAAG,gBAAgB,eAAe,UAAU,CAAC,GAAG;CAC3E,IAAI,CAAC,kBAAkB,QAAQ,wBAAwB,eAAe,SAAS,eAAe,QAAQ,GAAG,OAAO;CAChH,MAAM,EAAE,kBAAkB,QAAQ,gBAAgB,+BAA+B,aAAa,CAAC,GAAG,OAAO,MAAM,MAAM,OAAO,gBAAgB,MAAM,QAAQ,UAAU;CACpK,MAAM,CAAC,OAAO,MAAM,IAAI,MAAM,MAAM,OAAO;EAC1C,EAAE,QAAQ;EACV,EAAE,QAAQ;EACV,EAAE,QAAQ;EACV,EAAE,QAAQ;EACV,EAAE,QAAQ;EACV,EAAE,QAAQ;CACX;CACA,MAAM,gBAAgB,MAAM;CAC5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A,mBAmBgB,UAAA,MAAA,WAlBG,eAAA,QAAT,GAAG,MAAC;KADd,OAAA,UAAA,GAAA,YAmBgB,MAAA,qBAAA,GAAA;MAjBb,KAAK;MACL,OAAO;MACP,UAAU,MAAA,KAAA,CAAK,CAAC;MACjB,YAAA;;MAEA,SAAA,cAWE,CAXF,YAWE,oBAAA;OAVA,OAAM;OACL,cAAU,GAAK,MAAA,KAAA,CAAK,CAAC,aAAS,MAAA,GAAa,IAAC,EAAA,MAAW,eAAA;OACvD,gBAAc,MAAA,KAAA,CAAK,CAAC;OACpB,WAAW,MAAA,KAAA,CAAK,CAAC,aAAa,MAAC;OAC/B,UAAU,MAAA,KAAA,CAAK,CAAC;OAChB,MAAM,MAAA,KAAA,CAAK,CAAC;OACZ,WAAW,MAAA,KAAA,CAAK,CAAC;OACjB,UAAU,MAAA,KAAA,CAAK,CAAC;OAChB,MAAM,MAAA,KAAA,CAAK,CAAC;OACZ,OAAO,MAAA,KAAA,CAAK,CAAC"}
|
|
@@ -22,6 +22,7 @@ var _hoisted_3 = [
|
|
|
22
22
|
"dir",
|
|
23
23
|
"tabindex",
|
|
24
24
|
"aria-label",
|
|
25
|
+
"aria-controls",
|
|
25
26
|
"aria-invalid",
|
|
26
27
|
"aria-required",
|
|
27
28
|
"aria-valuemin",
|
|
@@ -421,7 +422,8 @@ var BFormSpinbutton_default = /* @__PURE__ */ defineComponent({
|
|
|
421
422
|
role: "spinbutton",
|
|
422
423
|
"aria-live": "off",
|
|
423
424
|
"aria-label": unref(props).ariaLabel || void 0,
|
|
424
|
-
"aria-
|
|
425
|
+
"aria-controls": unref(props).ariaControls || void 0,
|
|
426
|
+
"aria-invalid": unref(props).state === false || modelValue.value === null && unref(props).required ? true : void 0,
|
|
425
427
|
"aria-required": unref(props).required ? true : void 0,
|
|
426
428
|
"aria-valuemin": computedMin.value,
|
|
427
429
|
"aria-valuemax": computedMax.value,
|
|
@@ -439,4 +441,4 @@ var BFormSpinbutton_default = /* @__PURE__ */ defineComponent({
|
|
|
439
441
|
//#endregion
|
|
440
442
|
export { BFormSpinbutton_default as t };
|
|
441
443
|
|
|
442
|
-
//# sourceMappingURL=BFormSpinbutton-
|
|
444
|
+
//# sourceMappingURL=BFormSpinbutton-fkVMbQC3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BFormSpinbutton-fkVMbQC3.js","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-controls=\"props.ariaControls || 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 BFormSpinbuttonProps,\n BFormSpinbuttonSlots,\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-controls=\"props.ariaControls || 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 BFormSpinbuttonProps,\n BFormSpinbuttonSlots,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6hBA,IAAM,gBAAgB;CACpB,KAAK;CACL,KAAK;CACL,MAAM;CACN,aAAa;CACb,gBAAgB;CAChB,iBAAiB;CACjB,kBAAkB;AACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAvcA,MAAM,YAAY;GAAC;GAAS;GAAW;;GAAqB;GAAa;EAAa;EA6BtF,MAAM,QAAQ,YAAY,SAAQ,iBAAiB;EACnD,MAAM,OAAO;EAGb,MAAM,aAAa,SAAmE,SAAA,YAErF;EAED,MAAM,UAAU,eAAe,UAAU;EAEzC,MAAM,EAAC,YAAW,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VO,QAAA,MAAQ,OAAO,KAAK,MAAI,EAAiC,UAAW,MAAA,OAAA,EAAO,SAUlF,CATL,mBAQS,UART,WACU,QAOD,MAPS,OAAO,QAAM;KAC5B,aAAS,OAAA,OAAA,OAAA,MAAE,GAAA,SAAA,QAAA,MAAQ,OAAO,WAAf,QAAA,MAAQ,OAAO,QAAO,GAAA,IAAA;KACjC,cAAU,OAAA,OAAA,OAAA,MAAE,GAAA,SAAA,QAAA,MAAQ,OAAO,WAAf,QAAA,MAAQ,OAAO,QAAO,GAAA,IAAA;IAEnC,CAAA,GAAA,EAAA,UAAA,GAAA,mBAEM,OAAA,eAAA,mBAFO,QAAA,MAAQ,OAAO,GAAG,CAAA,GAAA,CAC7B,mBAAqC,QAAA,eAAA,mBAAvB,QAAA,MAAQ,OAAO,IAAI,CAAA,GAAA,MAAA,EAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,CAAA,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as useToNumber } from "./dist-DKc2ivHS.js";
|
|
2
2
|
import { s as isVisible } from "./dom-BdUQrX99.js";
|
|
3
3
|
import { t as useDefaults } from "./useDefaults-BzP4qZBu.js";
|
|
4
|
-
import { n as normalizeInput, t as useFormInput } from "./useFormInput-
|
|
4
|
+
import { n as normalizeInput, t as useFormInput } from "./useFormInput-C-iXRxog.js";
|
|
5
5
|
import { computed, createElementBlock, defineComponent, mergeModels, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, toValue, unref, useModel, useTemplateRef } from "vue";
|
|
6
6
|
//#region src/composables/useTextareaResize.ts
|
|
7
7
|
var useTextareaResize = (input, { maxRows, noAutoShrink, rows }) => {
|
|
@@ -142,7 +142,7 @@ var BFormTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
142
142
|
const props = useDefaults(__props, "BFormTextarea");
|
|
143
143
|
const [modelValue, modelModifiers] = useModel(__props, "modelValue", { set: (v) => normalizeInput(v, modelModifiers) });
|
|
144
144
|
const input = useTemplateRef("_input");
|
|
145
|
-
const { computedId, computedAriaInvalid, onInput, stateClass, onChange, onBlur, focus, blur, isDisabled } = useFormInput(props, input, modelValue, modelModifiers);
|
|
145
|
+
const { computedId, computedAriaInvalid, computedValue, onInput, stateClass, onChange, onBlur, focus, blur, isDisabled } = useFormInput(props, input, modelValue, modelModifiers);
|
|
146
146
|
const computedClasses = computed(() => [
|
|
147
147
|
stateClass.value,
|
|
148
148
|
props.plaintext ? "form-control-plaintext" : "form-control",
|
|
@@ -170,7 +170,7 @@ var BFormTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
170
170
|
class: normalizeClass(computedClasses.value),
|
|
171
171
|
name: unref(props).name || void 0,
|
|
172
172
|
form: unref(props).form || void 0,
|
|
173
|
-
value: unref(
|
|
173
|
+
value: unref(computedValue),
|
|
174
174
|
disabled: unref(isDisabled),
|
|
175
175
|
placeholder: unref(props).placeholder,
|
|
176
176
|
required: unref(props).required || void 0,
|
|
@@ -194,4 +194,4 @@ var BFormTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
194
194
|
//#endregion
|
|
195
195
|
export { BFormTextarea_default as t };
|
|
196
196
|
|
|
197
|
-
//# sourceMappingURL=BFormTextarea-
|
|
197
|
+
//# sourceMappingURL=BFormTextarea-CBBlEcrV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BFormTextarea-CBBlEcrV.js","names":[],"sources":["../src/composables/useTextareaResize.ts","../src/components/BFormTextarea/BFormTextarea.vue","../src/components/BFormTextarea/BFormTextarea.vue"],"sourcesContent":["import {useToNumber} from '@vueuse/core'\nimport type {Numberish} from '../types/CommonTypes'\nimport {\n computed,\n type CSSProperties,\n type MaybeRefOrGetter,\n nextTick,\n onMounted,\n ref,\n type ShallowRef,\n toValue,\n} from 'vue'\nimport {isVisible} from '../utils/dom'\n\nexport const useTextareaResize = (\n input: Readonly<ShallowRef<HTMLTextAreaElement | null>>,\n {\n maxRows,\n noAutoShrink,\n rows,\n }: {\n rows: MaybeRefOrGetter<Numberish>\n maxRows: MaybeRefOrGetter<Numberish | undefined>\n noAutoShrink: MaybeRefOrGetter<boolean>\n }\n) => {\n const height = ref<number | null | string>(0)\n const maxRowsNumber = useToNumber(\n computed(() => toValue(maxRows) || Number.NaN),\n {\n method: 'parseInt',\n nanToZero: true,\n }\n )\n const rowsNumber = useToNumber(rows, {\n method: 'parseInt',\n nanToZero: true,\n })\n const computedMinRows = computed(() => Math.max(rowsNumber.value || 2, 2))\n const computedMaxRows = computed(() => Math.max(computedMinRows.value, maxRowsNumber.value || 0))\n const computedRows = computed(() =>\n computedMinRows.value === computedMaxRows.value ? computedMinRows.value : null\n )\n\n const handleHeightChange = async () => {\n // Element must be visible (not hidden) and in document\n // Must be checked after above checks\n if (!input.value || !isVisible(input.value)) {\n height.value = null\n return\n }\n\n // Get current computed styles\n const computedStyle = getComputedStyle(input.value)\n // Height of one line of text in px\n const lineHeight = Number.parseFloat(computedStyle.lineHeight) || 1\n // Calculate height of border and padding\n const border =\n (Number.parseFloat(computedStyle.borderTopWidth) || 0) +\n (Number.parseFloat(computedStyle.borderBottomWidth) || 0)\n const padding =\n (Number.parseFloat(computedStyle.paddingTop) || 0) +\n (Number.parseFloat(computedStyle.paddingBottom) || 0)\n // Calculate offset\n const offset = border + padding\n // Minimum height for min rows (which must be 2 rows or greater for cross-browser support)\n const minHeight = lineHeight * computedMinRows.value + offset\n\n // Get the current style height (with `px` units)\n const oldHeight = input.value.style.height || computedStyle.height\n // Probe scrollHeight by temporarily changing the height to `auto`\n height.value = 'auto'\n await nextTick() // We need to wait for the dom to update. These cannot be batched in the same tick\n // Re-check input.value after await since the element may have been unmounted\n // (e.g., during SSR hydration when BFormGroup re-renders its wrapper element)\n if (!input.value) return\n const {scrollHeight} = input.value\n // Place the original old height back on the element, just in case `computedProp`\n // returns the same value as before\n height.value = oldHeight\n await nextTick() // We need to wait for the dom to update. These cannot be batched in the same tick\n if (!input.value) return\n\n // Calculate content height in 'rows' (scrollHeight includes padding but not border)\n const contentRows = Math.max((scrollHeight - padding) / lineHeight, 2)\n // Calculate number of rows to display (limited within min/max rows)\n const rows = Math.min(Math.max(contentRows, computedMinRows.value), computedMaxRows.value)\n // Calculate the required height of the textarea including border and padding (in pixels)\n const newHeight = Math.max(Math.ceil(rows * lineHeight + offset), minHeight)\n\n // Computed height remains the larger of `oldHeight` and new `height`,\n // when height is in `sticky` mode (prop `no-auto-shrink` is true)\n if (toValue(noAutoShrink) && (Number.parseFloat(oldHeight.toString()) || 0) > newHeight) {\n height.value = oldHeight\n return\n }\n\n // Return the new computed CSS height in px units\n height.value = `${newHeight}px`\n }\n\n onMounted(handleHeightChange)\n\n const computedStyles = computed<CSSProperties>(() => ({\n resize: 'none',\n height:\n typeof height.value === 'string'\n ? height.value\n : height.value\n ? `${height.value}px`\n : undefined,\n }))\n\n return {\n onInput: handleHeightChange,\n computedStyles,\n computedRows,\n }\n}\n","<template>\n <textarea\n :id=\"computedId\"\n ref=\"_input\"\n :class=\"computedClasses\"\n :name=\"props.name || undefined\"\n :form=\"props.form || undefined\"\n :value=\"computedValue\"\n :disabled=\"isDisabled\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required || undefined\"\n :autocomplete=\"props.autocomplete || undefined\"\n :readonly=\"props.readonly || props.plaintext\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n :rows=\"computedRows || 2\"\n :style=\"computedStyles\"\n :wrap=\"props.wrap || undefined\"\n @input=\"\n (e) => {\n onInput(e)\n handleHeightChange()\n }\n \"\n @change=\"onChange\"\n @blur=\"onBlur\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormTextareaProps} from '../../types'\nimport {computed, type CSSProperties, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {normalizeInput} from '../../utils/normalizeInput'\nimport {useFormInput} from '../../composables/useFormInput'\nimport {useTextareaResize} from '../../composables/useTextareaResize'\n\nconst _props = withDefaults(defineProps<Omit<BFormTextareaProps, 'modelValue'>>(), {\n // CommonInputProps\n ariaInvalid: undefined,\n autocomplete: undefined,\n autofocus: false,\n debounce: 0,\n debounceMaxWait: Number.NaN,\n disabled: false,\n form: undefined,\n formatter: undefined,\n id: undefined,\n lazyFormatter: false,\n list: undefined,\n modelValue: '',\n name: undefined,\n placeholder: undefined,\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: undefined,\n // End CommonInputProps\n noResize: false,\n noAutoShrink: false,\n maxRows: undefined,\n rows: 2,\n wrap: 'soft',\n})\nconst props = useDefaults(_props, 'BFormTextarea')\n\nconst [modelValue, modelModifiers] = defineModel<\n Exclude<BFormTextareaProps['modelValue'], undefined>,\n 'trim' | 'lazy' | 'number'\n>({\n default: '',\n set: (v) => normalizeInput(v, modelModifiers),\n})\n\nconst input = useTemplateRef('_input')\n\nconst {\n computedId,\n computedAriaInvalid,\n computedValue,\n onInput,\n stateClass,\n onChange,\n onBlur,\n focus,\n blur,\n isDisabled,\n} = useFormInput(props, input, modelValue, modelModifiers)\n\nconst computedClasses = computed(() => [\n stateClass.value,\n props.plaintext ? 'form-control-plaintext' : 'form-control',\n {\n [`form-control-${props.size}`]: !!props.size,\n },\n])\n\nconst {\n computedStyles: resizeStyles,\n onInput: handleHeightChange,\n computedRows,\n} = useTextareaResize(input, {\n maxRows: () => props.maxRows,\n rows: () => props.rows,\n noAutoShrink: () => props.noAutoShrink,\n})\n\nconst computedStyles = computed<CSSProperties>(() => ({\n resize: props.noResize ? 'none' : undefined,\n ...(props.maxRows || props.noAutoShrink ? resizeStyles.value : undefined),\n}))\n\ndefineExpose({\n blur,\n element: input,\n flushDebounce: onBlur,\n focus,\n})\n</script>\n","<template>\n <textarea\n :id=\"computedId\"\n ref=\"_input\"\n :class=\"computedClasses\"\n :name=\"props.name || undefined\"\n :form=\"props.form || undefined\"\n :value=\"computedValue\"\n :disabled=\"isDisabled\"\n :placeholder=\"props.placeholder\"\n :required=\"props.required || undefined\"\n :autocomplete=\"props.autocomplete || undefined\"\n :readonly=\"props.readonly || props.plaintext\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n :rows=\"computedRows || 2\"\n :style=\"computedStyles\"\n :wrap=\"props.wrap || undefined\"\n @input=\"\n (e) => {\n onInput(e)\n handleHeightChange()\n }\n \"\n @change=\"onChange\"\n @blur=\"onBlur\"\n />\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormTextareaProps} from '../../types'\nimport {computed, type CSSProperties, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {normalizeInput} from '../../utils/normalizeInput'\nimport {useFormInput} from '../../composables/useFormInput'\nimport {useTextareaResize} from '../../composables/useTextareaResize'\n\nconst _props = withDefaults(defineProps<Omit<BFormTextareaProps, 'modelValue'>>(), {\n // CommonInputProps\n ariaInvalid: undefined,\n autocomplete: undefined,\n autofocus: false,\n debounce: 0,\n debounceMaxWait: Number.NaN,\n disabled: false,\n form: undefined,\n formatter: undefined,\n id: undefined,\n lazyFormatter: false,\n list: undefined,\n modelValue: '',\n name: undefined,\n placeholder: undefined,\n plaintext: false,\n readonly: false,\n required: false,\n size: undefined,\n state: undefined,\n // End CommonInputProps\n noResize: false,\n noAutoShrink: false,\n maxRows: undefined,\n rows: 2,\n wrap: 'soft',\n})\nconst props = useDefaults(_props, 'BFormTextarea')\n\nconst [modelValue, modelModifiers] = defineModel<\n Exclude<BFormTextareaProps['modelValue'], undefined>,\n 'trim' | 'lazy' | 'number'\n>({\n default: '',\n set: (v) => normalizeInput(v, modelModifiers),\n})\n\nconst input = useTemplateRef('_input')\n\nconst {\n computedId,\n computedAriaInvalid,\n computedValue,\n onInput,\n stateClass,\n onChange,\n onBlur,\n focus,\n blur,\n isDisabled,\n} = useFormInput(props, input, modelValue, modelModifiers)\n\nconst computedClasses = computed(() => [\n stateClass.value,\n props.plaintext ? 'form-control-plaintext' : 'form-control',\n {\n [`form-control-${props.size}`]: !!props.size,\n },\n])\n\nconst {\n computedStyles: resizeStyles,\n onInput: handleHeightChange,\n computedRows,\n} = useTextareaResize(input, {\n maxRows: () => props.maxRows,\n rows: () => props.rows,\n noAutoShrink: () => props.noAutoShrink,\n})\n\nconst computedStyles = computed<CSSProperties>(() => ({\n resize: props.noResize ? 'none' : undefined,\n ...(props.maxRows || props.noAutoShrink ? resizeStyles.value : undefined),\n}))\n\ndefineExpose({\n blur,\n element: input,\n flushDebounce: onBlur,\n focus,\n})\n</script>\n"],"mappings":";;;;;;AAcA,IAAa,qBACX,OACA,EACE,SACA,cACA,WAMC;CACH,MAAM,SAAS,IAA4B,CAAC;CAC5C,MAAM,gBAAgB,YACpB,eAAe,QAAQ,OAAO,KAAK,GAAU,GAC7C;EACE,QAAQ;EACR,WAAW;CACb,CACF;CACA,MAAM,aAAa,YAAY,MAAM;EACnC,QAAQ;EACR,WAAW;CACb,CAAC;CACD,MAAM,kBAAkB,eAAe,KAAK,IAAI,WAAW,SAAS,GAAG,CAAC,CAAC;CACzE,MAAM,kBAAkB,eAAe,KAAK,IAAI,gBAAgB,OAAO,cAAc,SAAS,CAAC,CAAC;CAChG,MAAM,eAAe,eACnB,gBAAgB,UAAU,gBAAgB,QAAQ,gBAAgB,QAAQ,IAC5E;CAEA,MAAM,qBAAqB,YAAY;EAGrC,IAAI,CAAC,MAAM,SAAS,CAAC,UAAU,MAAM,KAAK,GAAG;GAC3C,OAAO,QAAQ;GACf;EACF;EAGA,MAAM,gBAAgB,iBAAiB,MAAM,KAAK;EAElD,MAAM,aAAa,OAAO,WAAW,cAAc,UAAU,KAAK;EAElE,MAAM,UACH,OAAO,WAAW,cAAc,cAAc,KAAK,MACnD,OAAO,WAAW,cAAc,iBAAiB,KAAK;EACzD,MAAM,WACH,OAAO,WAAW,cAAc,UAAU,KAAK,MAC/C,OAAO,WAAW,cAAc,aAAa,KAAK;EAErD,MAAM,SAAS,SAAS;EAExB,MAAM,YAAY,aAAa,gBAAgB,QAAQ;EAGvD,MAAM,YAA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AA,SAAA,MAAA,MAAA,KAAA,MAAA,MAAA,CAAA,CAAA,GAAA,IAAA"}
|
|
@@ -266,13 +266,13 @@ var BTabs_default = /* @__PURE__ */ defineComponent({
|
|
|
266
266
|
const tabElementsArray = ref([]);
|
|
267
267
|
const isChildActive = ref(false);
|
|
268
268
|
const initialIds = ref([]);
|
|
269
|
-
const
|
|
269
|
+
const selectedTabHasExplicitId = ref(false);
|
|
270
270
|
const updateTabElementsArray = () => {
|
|
271
271
|
const tabElements = flattenFragments(slots.default?.({}) ?? []);
|
|
272
272
|
tabElementsArray.value = (Array.isArray(tabElements) ? tabElements : [tabElements]).filter((tab) => tab.type === BTab_default);
|
|
273
273
|
if (initialIds.value.length === 0) {
|
|
274
274
|
initialIds.value = tabElementsArray.value.map((tab) => unref(useId$1(() => tab.props?.id, "tabpane")));
|
|
275
|
-
|
|
275
|
+
selectedTabHasExplicitId.value = activeIndex.value > -1 && tabElementsArray.value[activeIndex.value]?.props?.id !== void 0;
|
|
276
276
|
}
|
|
277
277
|
isChildActive.value = tabElementsArray.value.some((tab) => tab.props?.active !== void 0 && tab.props?.active !== false);
|
|
278
278
|
};
|
|
@@ -332,7 +332,7 @@ var BTabs_default = /* @__PURE__ */ defineComponent({
|
|
|
332
332
|
let updateInitialActiveIndex = false;
|
|
333
333
|
let updateInitialActiveId = false;
|
|
334
334
|
let delayedTabSelection = false;
|
|
335
|
-
if (activeIndex.value > -1 && !activeId.value && !
|
|
335
|
+
if (activeIndex.value > -1 && !activeId.value && !selectedTabHasExplicitId.value && tabElementsArray.value.length > 0) {
|
|
336
336
|
delayedTabSelection = true;
|
|
337
337
|
updateInitialActiveId = true;
|
|
338
338
|
} else if (activeIndex.value === -1 && activeId.value) {
|
|
@@ -594,4 +594,4 @@ var BTabs_default = /* @__PURE__ */ defineComponent({
|
|
|
594
594
|
//#endregion
|
|
595
595
|
export { BTab_default as n, BTabs_default as t };
|
|
596
596
|
|
|
597
|
-
//# sourceMappingURL=BTabs-
|
|
597
|
+
//# sourceMappingURL=BTabs-BKmkVWrZ.js.map
|