bootstrap-vue-next 0.46.2 → 0.46.4

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.
@@ -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-DZ_3ZH1o.js";
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(modelValue),
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-BwvdFGDu.js.map
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,SAAQ,YAAY;EAE9C,MAAM,CAAC,YAAY,kBAAkB,SAGpC,SAAA,cAAC,EAEA,MAAM,MAAM,eAAe,GAAG,cAAc,EAC9C,CAAC;EAED,MAAM,QAAQ,eAAe,QAAQ;EAErC,MAAM,eAAe,OAAO,eAAe,KAAK;EAEhD,MAAM,EACJ,YACA,qBACA,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AA,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-BwvdFGDu.js";
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-I1t8dqPS.js.map
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,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,EA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A,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;CAC5B,MAAM,kBAAkB,SAAS;CACjC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,mBAAmB,oBAAoB,cAAc,mBAAmB,oBAAoB,gBAAgB,gBAAgB,OAAO;CAC5K,MAAM,qBAAqB,gBAAgB,MAAM,KAAK,cAAc,iBAAiB,aAAa,CAAC,IAAI;CACvG,IAAI,CAAC,mBAAmB,QAAQ,OAAO;CACvC,IAAI,eAAe,EAAE,eAAe;CACpC,IAAI,OAA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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,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-DZ_3ZH1o.js";
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(modelValue) ?? void 0,
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-DlDe26DL.js.map
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,GAC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,MAAM,MAAA,KAAA,CAAK,CAAC,QAAQ,KAAA;IACpB,MAAM,MAAA,KAAA,CAAK,CAAC,QAAQ,KAAA;IACpB,OAAO,MAAA,aAAA;IACP,UAAU,MAAA,UAAA;IACV,aAAa,MAAA,KAAA,CAAK,CAAC;IACnB,UAAU,MAAA,KAAA,CAAK,CAAC,YAAY,KAAA;IAC5B,cAAc,MAAA,KAAA,CAAK,CAAC,gBAAgB,KAAA;IACpC,UAAU,MAAA,KAAA,CAAK,CAAC,YAAY,MAAA,KAAA,CAAK,CAAC;IAClC,iBAAe,MAAA,KAAA,CAAK,CAAC,YAAY,KAAA;IACjC,gBAAc,MAAA,mBAAA;IACd,MAAM,MAAA,YAAA,KAAY;IAClB,OAAK,eAAE,eAAA,KAAc;IACrB,MAAM,MAAA,KAAA,CAAK,CAAC,QAAQ,KAAA;IACpB,SAAK,OAAA,OAAA,OAAA,MAAU,MAAC;KAAe,MAAA,OAAA,CAAO,CAAC,CAAC;KAAU,MAAA,kBAAA,CAAkB,CAAA;;IAMpE,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"}
@@ -13,16 +13,16 @@ import { n as BProgressBar_default, t as BProgress_default } from "./BProgress-B
13
13
  import { t as BSpinner_default } from "./BSpinner-H1DZOmiM.js";
14
14
  import { t as BButton_default } from "./BButton-KZu5jczf.js";
15
15
  import { t as BAlert_default } from "./BAlert-C9Mi4RDx.js";
16
- import { n as BOrchestrator_default, t as BApp_default } from "./BApp-GXR1wS6K.js";
16
+ import { n as BOrchestrator_default, t as BApp_default } from "./BApp-Bg5xEz8H.js";
17
17
  import { useProvideDefaults } from "./src/composables/useProvideDefaults/index.mjs";
18
18
  import { useRegistry } from "./src/composables/useRegistry/index.mjs";
19
- import { t as BAutocomplete_default } from "./BAutocomplete-DGvKY7-D.js";
20
- import { t as BFormOtp_default } from "./BFormOtp-I1t8dqPS.js";
19
+ import { t as BAutocomplete_default } from "./BAutocomplete-BFbbKtpz.js";
20
+ import { t as BFormOtp_default } from "./BFormOtp-C3vmDnzs.js";
21
21
  import { n as BDatePicker_default, t as BDateRangePicker_default } from "./BDatePicker-AVTYcVLy.js";
22
22
  import { t as BTimeField_default } from "./BTimeField-CbRGjaI6.js";
23
23
  import { n as BDateRangeField_default, r as BDateField_default, t as BTimeRangeField_default } from "./BDateField-Bj-Jz7u4.js";
24
24
  import { t as BInputGroup_default } from "./BInputGroup-DdoeSICR.js";
25
- import { t as BFormInput_default } from "./BFormInput-BwvdFGDu.js";
25
+ import { t as BFormInput_default } from "./BFormInput-_AkAy6Wk.js";
26
26
  import { t as BFormTag_default } from "./BFormTag-DGSUfz7A.js";
27
27
  import { t as BBadge_default } from "./BBadge-BaZ13wE_.js";
28
28
  import { n as BAvatar_default, t as BAvatarGroup_default } from "./BAvatar-BsStQrBF.js";
@@ -50,7 +50,7 @@ import { t as BFormRating_default } from "./BFormRating-AEiF8K8T.js";
50
50
  import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "./BFormSelect-DdjH8482.js";
51
51
  import { t as BFormSpinbutton_default } from "./BFormSpinbutton-fkVMbQC3.js";
52
52
  import { t as BFormTags_default } from "./BFormTags-CUcyRTCK.js";
53
- import { t as BFormTextarea_default } from "./BFormTextarea-DlDe26DL.js";
53
+ import { t as BFormTextarea_default } from "./BFormTextarea-CBBlEcrV.js";
54
54
  import { t as BInputGroupText_default } from "./BInputGroup-Bjh7zXyI.js";
55
55
  import { n as BListGroup_default, t as BListGroupItem_default } from "./BListGroup-CQedMbI8.js";
56
56
  import { useScrollLock } from "./src/composables/useScrollLock/index.mjs";
@@ -5,6 +5,7 @@ export declare const useFormInput: (props: Readonly<CommonInputProps>, input: Re
5
5
  input: Readonly<ShallowRef<HTMLInputElement | null>> | Readonly<ShallowRef<HTMLTextAreaElement | null>>;
6
6
  computedId: import('vue').ComputedRef<string>;
7
7
  computedAriaInvalid: import('vue').ComputedRef<import('../types/AriaInvalid').StringAriaInvalid | undefined>;
8
+ computedValue: import('vue').ComputedRef<Numberish | undefined>;
8
9
  onInput: (evt: Readonly<Event>) => void;
9
10
  onChange: (evt: Readonly<Event>) => void;
10
11
  onBlur: (evt: Readonly<FocusEvent>) => void;
@@ -5,6 +5,7 @@ export declare const useFormInput: (props: Readonly<CommonInputProps>, input: Re
5
5
  input: Readonly<ShallowRef<HTMLInputElement | null>> | Readonly<ShallowRef<HTMLTextAreaElement | null>>;
6
6
  computedId: import('vue').ComputedRef<string>;
7
7
  computedAriaInvalid: import('vue').ComputedRef<import('../types/AriaInvalid').StringAriaInvalid | undefined>;
8
+ computedValue: import('vue').ComputedRef<Numberish | undefined>;
8
9
  onInput: (evt: Readonly<Event>) => void;
9
10
  onChange: (evt: Readonly<Event>) => void;
10
11
  onBlur: (evt: Readonly<FocusEvent>) => void;
@@ -1,2 +1,2 @@
1
- import { n as BOrchestrator_default, t as BApp_default } from "../../../BApp-GXR1wS6K.js";
1
+ import { n as BOrchestrator_default, t as BApp_default } from "../../../BApp-Bg5xEz8H.js";
2
2
  export { BApp_default as BApp, BOrchestrator_default as BOrchestrator };
@@ -1,2 +1,2 @@
1
- import { t as BAutocomplete_default } from "../../../BAutocomplete-DGvKY7-D.js";
1
+ import { t as BAutocomplete_default } from "../../../BAutocomplete-BFbbKtpz.js";
2
2
  export { BAutocomplete_default as BAutocomplete };
@@ -1,2 +1,2 @@
1
- import { t as BFormInput_default } from "../../../BFormInput-BwvdFGDu.js";
1
+ import { t as BFormInput_default } from "../../../BFormInput-_AkAy6Wk.js";
2
2
  export { BFormInput_default as BFormInput, BFormInput_default as BInput };
@@ -1,2 +1,2 @@
1
- import { t as BFormOtp_default } from "../../../BFormOtp-I1t8dqPS.js";
1
+ import { t as BFormOtp_default } from "../../../BFormOtp-C3vmDnzs.js";
2
2
  export { BFormOtp_default as BFormOtp };
@@ -1,2 +1,2 @@
1
- import { t as BFormTextarea_default } from "../../../BFormTextarea-DlDe26DL.js";
1
+ import { t as BFormTextarea_default } from "../../../BFormTextarea-CBBlEcrV.js";
2
2
  export { BFormTextarea_default as BFormTextarea };
@@ -9,14 +9,14 @@ import { n as BProgressBar_default, t as BProgress_default } from "../../BProgre
9
9
  import { t as BSpinner_default } from "../../BSpinner-H1DZOmiM.js";
10
10
  import { t as BButton_default } from "../../BButton-KZu5jczf.js";
11
11
  import { t as BAlert_default } from "../../BAlert-C9Mi4RDx.js";
12
- import { n as BOrchestrator_default, t as BApp_default } from "../../BApp-GXR1wS6K.js";
13
- import { t as BAutocomplete_default } from "../../BAutocomplete-DGvKY7-D.js";
14
- import { t as BFormOtp_default } from "../../BFormOtp-I1t8dqPS.js";
12
+ import { n as BOrchestrator_default, t as BApp_default } from "../../BApp-Bg5xEz8H.js";
13
+ import { t as BAutocomplete_default } from "../../BAutocomplete-BFbbKtpz.js";
14
+ import { t as BFormOtp_default } from "../../BFormOtp-C3vmDnzs.js";
15
15
  import { n as BDatePicker_default, t as BDateRangePicker_default } from "../../BDatePicker-AVTYcVLy.js";
16
16
  import { t as BTimeField_default } from "../../BTimeField-CbRGjaI6.js";
17
17
  import { n as BDateRangeField_default, r as BDateField_default, t as BTimeRangeField_default } from "../../BDateField-Bj-Jz7u4.js";
18
18
  import { t as BInputGroup_default } from "../../BInputGroup-DdoeSICR.js";
19
- import { t as BFormInput_default } from "../../BFormInput-BwvdFGDu.js";
19
+ import { t as BFormInput_default } from "../../BFormInput-_AkAy6Wk.js";
20
20
  import { t as BFormTag_default } from "../../BFormTag-DGSUfz7A.js";
21
21
  import { t as BBadge_default } from "../../BBadge-BaZ13wE_.js";
22
22
  import { n as BAvatar_default, t as BAvatarGroup_default } from "../../BAvatar-BsStQrBF.js";
@@ -44,7 +44,7 @@ import { t as BFormRating_default } from "../../BFormRating-AEiF8K8T.js";
44
44
  import { n as BFormSelectOptionGroup_default, t as BFormSelect_default } from "../../BFormSelect-DdjH8482.js";
45
45
  import { t as BFormSpinbutton_default } from "../../BFormSpinbutton-fkVMbQC3.js";
46
46
  import { t as BFormTags_default } from "../../BFormTags-CUcyRTCK.js";
47
- import { t as BFormTextarea_default } from "../../BFormTextarea-DlDe26DL.js";
47
+ import { t as BFormTextarea_default } from "../../BFormTextarea-CBBlEcrV.js";
48
48
  import { t as BInputGroupText_default } from "../../BInputGroup-Bjh7zXyI.js";
49
49
  import { n as BListGroup_default, t as BListGroupItem_default } from "../../BListGroup-CQedMbI8.js";
50
50
  import { a as BNav_default, i as BNavForm_default, n as BNavItemDropdown_default, r as BNavItem_default, t as BNavText_default } from "../../BNav-CjXS9tQ5.js";
@@ -5,7 +5,7 @@ import { t as useId$1 } from "./useId-Fh-Arhb7.js";
5
5
  import { t as useAriaInvalid } from "./useAriaInvalid-CRUhkD2V.js";
6
6
  import { t as useDebounceFn } from "./debounce-Xj7wsAmR.js";
7
7
  import { t as useStateClass } from "./useStateClass-BF7kf2zK.js";
8
- import { computed, inject, nextTick, onActivated, onMounted } from "vue";
8
+ import { computed, inject, nextTick, onActivated, onMounted, ref, watch } from "vue";
9
9
  //#region src/utils/normalizeInput.ts
10
10
  var normalizeInput = (v, modelModifiers) => {
11
11
  if (v === null) return;
@@ -28,14 +28,26 @@ var useFormInput = (props, input, modelValue, modelModifiers) => {
28
28
  const isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false));
29
29
  const computedAriaInvalid = useAriaInvalid(() => props.ariaInvalid, computedState);
30
30
  const stateClass = useStateClass(computedState);
31
+ const pendingValue = ref(null);
31
32
  const internalUpdateModelValue = useDebounceFn((value) => {
32
33
  modelValue.value = value;
34
+ pendingValue.value = null;
33
35
  }, () => modelModifiers.lazy === true ? 0 : debounceNumber.value, { maxWait: () => modelModifiers.lazy === true ? NaN : debounceMaxWaitNumber.value });
34
36
  const updateModelValue = (value, force = false, immediate = false) => {
35
37
  if (modelModifiers.lazy === true && force === false) return;
36
- if (immediate) modelValue.value = value;
37
- else internalUpdateModelValue(value);
38
+ if (immediate) {
39
+ pendingValue.value = null;
40
+ modelValue.value = value;
41
+ } else {
42
+ pendingValue.value = value;
43
+ internalUpdateModelValue(value);
44
+ }
38
45
  };
46
+ watch(modelValue, () => {
47
+ internalUpdateModelValue.cancel();
48
+ pendingValue.value = null;
49
+ });
50
+ const computedValue = computed(() => pendingValue.value ?? modelValue.value ?? void 0);
39
51
  const { focused } = useFocus(input, { initialValue: props.autofocus });
40
52
  const _formatValue = (value, evt, force = false) => {
41
53
  if (props.formatter !== void 0 && (!props.lazyFormatter || force)) return props.formatter(value, evt);
@@ -78,6 +90,7 @@ var useFormInput = (props, input, modelValue, modelModifiers) => {
78
90
  const formattedValue = _formatValue(value, evt, true);
79
91
  const nextModel = modelModifiers.trim ? formattedValue.trim() : formattedValue;
80
92
  internalUpdateModelValue.cancel();
93
+ pendingValue.value = null;
81
94
  if (modelValue.value !== nextModel) updateModelValue(nextModel, true, true);
82
95
  if (nextModel !== value) syncDisplayedValue(nextModel);
83
96
  };
@@ -91,6 +104,7 @@ var useFormInput = (props, input, modelValue, modelModifiers) => {
91
104
  input,
92
105
  computedId,
93
106
  computedAriaInvalid,
107
+ computedValue,
94
108
  onInput,
95
109
  onChange,
96
110
  onBlur,
@@ -103,4 +117,4 @@ var useFormInput = (props, input, modelValue, modelModifiers) => {
103
117
  //#endregion
104
118
  export { normalizeInput as n, useFormInput as t };
105
119
 
106
- //# sourceMappingURL=useFormInput-DZ_3ZH1o.js.map
120
+ //# sourceMappingURL=useFormInput-C-iXRxog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormInput-C-iXRxog.js","names":[],"sources":["../src/utils/normalizeInput.ts","../src/composables/useFormInput.ts"],"sourcesContent":["import type {Numberish} from '../types/CommonTypes'\n\nexport const normalizeInput = (\n v: Numberish | null,\n modelModifiers: Record<'number' | 'lazy' | 'trim', true | undefined>\n) => {\n if (v === null) return\n let update = v\n if (modelModifiers.number && typeof update === 'string' && update !== '') {\n const parsed = Number.parseFloat(update)\n update = Number.isNaN(parsed) ? update : parsed\n }\n return update\n}\n","import type {Numberish} from '../types/CommonTypes'\nimport {\n computed,\n inject,\n nextTick,\n onActivated,\n onMounted,\n ref,\n watch,\n type Ref,\n type ShallowRef,\n} from 'vue'\nimport {useAriaInvalid} from './useAriaInvalid'\nimport {useId} from './useId'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport type {CommonInputProps} from '../types/FormCommonInputProps'\nimport {formGroupKey} from '../utils/keys'\nimport {useDebounceFn} from '../utils/debounce'\nimport {useStateClass} from './useStateClass'\n\nexport const useFormInput = (\n props: Readonly<CommonInputProps>,\n input:\n | Readonly<ShallowRef<HTMLInputElement | null>>\n | Readonly<ShallowRef<HTMLTextAreaElement | null>>,\n modelValue: Ref<Numberish | null>,\n modelModifiers: Record<'number' | 'lazy' | 'trim', true | undefined>\n) => {\n const computedId = useId(() => props.id, 'input')\n const debounceNumber = useToNumber(() => props.debounce ?? 0, {nanToZero: true})\n const debounceMaxWaitNumber = useToNumber(() => props.debounceMaxWait ?? Number.NaN)\n\n // This automatically adds the appropriate \"for\" attribute to a BFormGroup label\n const formGroupData = inject(formGroupKey, null)?.()\n formGroupData?.track(computedId)\n const computedState = computed(() =>\n props.state !== undefined ? props.state : (formGroupData?.state.value ?? null)\n )\n const isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n const computedAriaInvalid = useAriaInvalid(() => props.ariaInvalid, computedState)\n const stateClass = useStateClass(computedState)\n\n // Holds what the user has typed while a debounced model update is still in\n // flight, during which the model itself still has the previous value. Vue\n // re-patches the `value` DOM prop on every re-render, so an unrelated\n // re-render inside that window resets the field to the stale model and\n // swallows the keystroke. BFormTextarea's auto-resize does exactly that: it\n // writes an inline height on each input, so `debounce` + `max-rows` together\n // dropped characters as you typed.\n const pendingValue = ref<Numberish | null>(null)\n\n const internalUpdateModelValue = useDebounceFn(\n (value: Numberish) => {\n modelValue.value = value\n pendingValue.value = null\n },\n () => (modelModifiers.lazy === true ? 0 : debounceNumber.value),\n {maxWait: () => (modelModifiers.lazy === true ? Number.NaN : debounceMaxWaitNumber.value)}\n )\n\n const updateModelValue = (value: Numberish, force = false, immediate = false) => {\n if (modelModifiers.lazy === true && force === false) return\n if (immediate) {\n pendingValue.value = null\n modelValue.value = value\n } else {\n pendingValue.value = value\n internalUpdateModelValue(value)\n }\n }\n\n // A model change from anywhere else (most often the parent assigning a new\n // value) takes precedence over an in-flight edit. Dropping the pending value\n // is not enough on its own: the debounced write is still scheduled, and left\n // alone it would fire later and push the superseded edit back onto the model.\n watch(modelValue, () => {\n internalUpdateModelValue.cancel()\n pendingValue.value = null\n })\n\n // What the control should actually display: the in-flight value when there is\n // one, otherwise the model.\n const computedValue = computed(() => pendingValue.value ?? modelValue.value ?? undefined)\n\n const {focused} = useFocus(input, {\n initialValue: props.autofocus,\n })\n\n const _formatValue = (value: string, evt: Readonly<Event>, force = false) => {\n if (props.formatter !== undefined && (!props.lazyFormatter || force)) {\n return props.formatter(value, evt)\n }\n return value\n }\n onMounted(() => {\n if (input.value) {\n input.value.value = modelValue.value?.toString() ?? ''\n }\n })\n\n onActivated(() => {\n nextTick(() => {\n if (props.autofocus) {\n focused.value = true\n }\n })\n })\n\n const syncDisplayedValue = (nextValue: string) => {\n if (input.value && input.value.value !== nextValue) {\n input.value.value = nextValue\n }\n }\n\n const onInput = (evt: Readonly<Event>) => {\n const {value} = evt.target as HTMLInputElement\n const formattedValue = _formatValue(value, evt)\n if (evt.defaultPrevented) {\n evt.preventDefault()\n return\n }\n\n const nextModel = formattedValue\n\n updateModelValue(nextModel)\n // If the formatter changed the value, directly update the input's visual value\n // to keep the displayed text in sync with the model. Without this, if the\n // formatted value equals the previous model value, Vue's reactivity won't\n // re-render the input and the raw (unformatted) text remains visible.\n if (formattedValue !== value) {\n syncDisplayedValue(formattedValue)\n }\n }\n\n const onChange = (evt: Readonly<Event>) => {\n const {value} = evt.target as HTMLInputElement\n const formattedValue = _formatValue(value, evt)\n if (evt.defaultPrevented) {\n evt.preventDefault()\n return\n }\n\n const nextModel = formattedValue\n if (modelValue.value !== nextModel) {\n updateModelValue(formattedValue, true)\n }\n }\n\n const onBlur = (evt: Readonly<FocusEvent>) => {\n if (\n !modelModifiers.lazy &&\n !props.lazyFormatter &&\n !modelModifiers.trim &&\n debounceNumber.value <= 0\n )\n return\n\n const {value} = evt.target as HTMLInputElement\n const formattedValue = _formatValue(value, evt, true)\n\n const nextModel = modelModifiers.trim ? formattedValue.trim() : formattedValue\n\n // Cancel before modelValue.value comparison and update. The cancelled\n // update will never land, so the in-flight value must be dropped too --\n // otherwise it would keep shadowing the model after blur.\n internalUpdateModelValue.cancel()\n pendingValue.value = null\n if (modelValue.value !== nextModel) {\n updateModelValue(nextModel, true, true)\n }\n\n // If the formatter or trim changed the displayed text, directly sync the DOM.\n // This handles the case where lazyFormatter defers formatting to blur and the\n // formatted value equals the current model (so Vue's reactivity won't re-render).\n if (nextModel !== value) {\n syncDisplayedValue(nextModel)\n }\n }\n\n const focus = () => {\n if (!isDisabled.value) {\n focused.value = true\n }\n }\n\n const blur = () => {\n if (!isDisabled.value) {\n focused.value = false\n }\n }\n\n return {\n input,\n computedId,\n computedAriaInvalid,\n computedValue,\n onInput,\n onChange,\n onBlur,\n focus,\n blur,\n stateClass,\n isDisabled,\n }\n}\n"],"mappings":";;;;;;;;;AAEA,IAAa,kBACX,GACA,mBACG;CACH,IAAI,MAAM,MAAM;CAChB,IAAI,SAAS;CACb,IAAI,eAAe,UAAU,OAAO,WAAW,YAAY,WAAW,IAAI;EACxE,MAAM,SAAS,OAAO,WAAW,MAAM;EACvC,SAAS,OAAO,MAAM,MAAM,IAAI,SAAS;CAC3C;CACA,OAAO;AACT;;;ACOA,IAAa,gBACX,OACA,OAGA,YACA,mBACG;CACH,MAAM,aAAa,cAAY,MAAM,IAAI,OAAO;CAChD,MAAM,iBAAiB,kBAAkB,MAA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;EACA;EACA;EACA;CACF;AACF"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "bootstrap-vue-next",
3
3
  "displayName": "BootstrapVueNext",
4
4
  "description": "Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development",
5
- "version": "0.46.2",
5
+ "version": "0.46.4",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "./dist/bootstrap-vue-next.mjs",
@@ -1 +0,0 @@
1
- {"version":3,"file":"BApp-GXR1wS6K.js","names":["$attrs","$attrs"],"sources":["../src/components/BApp/BOrchestrator.vue","../src/components/BApp/BOrchestrator.vue","../src/components/BApp/BApp.vue","../src/components/BApp/BApp.vue"],"sourcesContent":["<template>\n <ConditionalTeleport :to=\"teleportTo\" :disabled=\"!teleportTo\">\n <div class=\"orchestrator-container\" v-bind=\"$attrs\">\n <div\n v-for=\"(value, key) in positionedItems\"\n :key=\"key\"\n :class=\"value.class\"\n :style=\"value.style\"\n >\n <TransitionGroup :name=\"value.transitionGroupName\">\n <span\n v-for=\"{\n component,\n fns: {setRef, resolve: resolvePromise},\n props: componentProps,\n id,\n slots,\n options,\n } in value.items\"\n :key=\"id\"\n >\n <component\n :is=\"component\"\n v-bind=\"componentProps\"\n :ref=\"setRef\"\n initial-animation\n :teleport-disabled=\"true\"\n @hide=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHide?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n @hidden=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHidden?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (!options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n >\n <template v-for=\"(comp, slot) in slots\" #[slot]=\"scope\" :key=\"slot\">\n <component :is=\"comp\" v-bind=\"scope\" />\n </template>\n </component>\n </span>\n </TransitionGroup>\n </div>\n </div>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, watch} from 'vue'\nimport {warn} from '../../utils/console'\nimport {orchestratorRegistryKey, type OrchestratorStoreObject} from '../../utils/keys'\nimport type {BvTriggerableEvent} from '../../utils'\nimport type {BOrchestratorProps, ContainerPosition} from '../../types'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport type {ValueInMapRecord} from '../../composables/orchestratorShared'\n\nconst setEventOk = (event: BvTriggerableEvent): void => {\n event.ok = event.trigger === 'ok' ? true : event.trigger === 'cancel' ? false : null\n}\n\nconst props = withDefaults(defineProps<BOrchestratorProps>(), {\n noPopovers: false,\n noToasts: false,\n noModals: false,\n appendToast: false,\n filter: undefined,\n})\n\nconst orchestratorRegistry = inject(orchestratorRegistryKey, null)\n\nif (orchestratorRegistry) {\n if (!orchestratorRegistry._isOrchestratorInstalled.value) {\n orchestratorRegistry._setOrchestratorInstalled(true)\n }\n} else {\n warn(\n 'BOrchestrator',\n 'The orchestrator registry not found. Please use BApp, useRegistry or provide the plugin.'\n )\n}\n\nwatch(\n () => props.appendToast,\n (value) => {\n orchestratorRegistry?._setToastAppend(value)\n },\n {immediate: true}\n)\n\nconst items = computed(() => {\n const store = orchestratorRegistry?.store.value\n let filteredStore = {\n tooltip:\n !props.noPopovers && store?.tooltip ? [...store.tooltip.values()].map((e) => e.value) : [],\n modal: !props.noModals && store?.modal ? [...store.modal.values()].map((e) => e.value) : [],\n popover:\n !props.noPopovers && store?.popover ? [...store.popover.values()].map((e) => e.value) : [],\n toast: !props.noToasts && store?.toast ? [...store.toast.values()].map((e) => e.value) : [],\n } satisfies Record<keyof OrchestratorStoreObject, unknown>\n\n if (props.filter) {\n filteredStore = {\n tooltip: filteredStore.tooltip.filter(props.filter),\n modal: filteredStore.modal.filter(props.filter),\n popover: filteredStore.popover.filter(props.filter),\n toast: filteredStore.toast.filter(props.filter),\n }\n }\n\n return filteredStore\n})\n\ntype ItemObject = {\n class?: string\n style?: string\n transitionGroupName?: string\n items: ValueInMapRecord<OrchestratorStoreObject[keyof OrchestratorStoreObject]>['value'][]\n}\nconst positionedItems = computed<\n Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n>(() => {\n const toastDefaultPosition: ContainerPosition = 'bottom-start'\n const toastDefaults = (cls: ContainerPosition) =>\n ({\n class: `${cls} toast-container position-fixed p-3`,\n style: 'width: calc(var(--bs-toast-max-width, 350px) + var(--bs-toast-padding-x, 1rem) * 2)',\n transitionGroupName: 'b-list',\n }) satisfies Partial<ItemObject>\n const groupedToastItems = items.value.toast.reduce(\n (acc, item) => {\n const pos = item.props.position ?? toastDefaultPosition\n ;(acc[pos] ??= {\n ...toastDefaults(pos),\n items: [],\n }).items.push(item)\n\n return acc\n },\n {} as Record<ContainerPosition, ItemObject>\n )\n\n const allGroups = {\n ...groupedToastItems,\n modal: {items: items.value.modal},\n popover: {items: items.value.popover},\n tooltip: {items: items.value.tooltip},\n }\n\n // Skip rendering empty containers (e.g. popover/tooltip/modal groups with no active items)\n return Object.fromEntries(\n Object.entries(allGroups).filter(([, value]) => value.items.length > 0)\n ) as Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n})\n</script>\n","<template>\n <ConditionalTeleport :to=\"teleportTo\" :disabled=\"!teleportTo\">\n <div class=\"orchestrator-container\" v-bind=\"$attrs\">\n <div\n v-for=\"(value, key) in positionedItems\"\n :key=\"key\"\n :class=\"value.class\"\n :style=\"value.style\"\n >\n <TransitionGroup :name=\"value.transitionGroupName\">\n <span\n v-for=\"{\n component,\n fns: {setRef, resolve: resolvePromise},\n props: componentProps,\n id,\n slots,\n options,\n } in value.items\"\n :key=\"id\"\n >\n <component\n :is=\"component\"\n v-bind=\"componentProps\"\n :ref=\"setRef\"\n initial-animation\n :teleport-disabled=\"true\"\n @hide=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHide?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n @hidden=\"\n (e: BvTriggerableEvent) => {\n setEventOk(e)\n componentProps.onHidden?.(e)\n if (e.defaultPrevented) {\n return\n }\n if (!options?.resolveOnHide) {\n resolvePromise(e)\n }\n }\n \"\n >\n <template v-for=\"(comp, slot) in slots\" #[slot]=\"scope\" :key=\"slot\">\n <component :is=\"comp\" v-bind=\"scope\" />\n </template>\n </component>\n </span>\n </TransitionGroup>\n </div>\n </div>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, inject, watch} from 'vue'\nimport {warn} from '../../utils/console'\nimport {orchestratorRegistryKey, type OrchestratorStoreObject} from '../../utils/keys'\nimport type {BvTriggerableEvent} from '../../utils'\nimport type {BOrchestratorProps, ContainerPosition} from '../../types'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport type {ValueInMapRecord} from '../../composables/orchestratorShared'\n\nconst setEventOk = (event: BvTriggerableEvent): void => {\n event.ok = event.trigger === 'ok' ? true : event.trigger === 'cancel' ? false : null\n}\n\nconst props = withDefaults(defineProps<BOrchestratorProps>(), {\n noPopovers: false,\n noToasts: false,\n noModals: false,\n appendToast: false,\n filter: undefined,\n})\n\nconst orchestratorRegistry = inject(orchestratorRegistryKey, null)\n\nif (orchestratorRegistry) {\n if (!orchestratorRegistry._isOrchestratorInstalled.value) {\n orchestratorRegistry._setOrchestratorInstalled(true)\n }\n} else {\n warn(\n 'BOrchestrator',\n 'The orchestrator registry not found. Please use BApp, useRegistry or provide the plugin.'\n )\n}\n\nwatch(\n () => props.appendToast,\n (value) => {\n orchestratorRegistry?._setToastAppend(value)\n },\n {immediate: true}\n)\n\nconst items = computed(() => {\n const store = orchestratorRegistry?.store.value\n let filteredStore = {\n tooltip:\n !props.noPopovers && store?.tooltip ? [...store.tooltip.values()].map((e) => e.value) : [],\n modal: !props.noModals && store?.modal ? [...store.modal.values()].map((e) => e.value) : [],\n popover:\n !props.noPopovers && store?.popover ? [...store.popover.values()].map((e) => e.value) : [],\n toast: !props.noToasts && store?.toast ? [...store.toast.values()].map((e) => e.value) : [],\n } satisfies Record<keyof OrchestratorStoreObject, unknown>\n\n if (props.filter) {\n filteredStore = {\n tooltip: filteredStore.tooltip.filter(props.filter),\n modal: filteredStore.modal.filter(props.filter),\n popover: filteredStore.popover.filter(props.filter),\n toast: filteredStore.toast.filter(props.filter),\n }\n }\n\n return filteredStore\n})\n\ntype ItemObject = {\n class?: string\n style?: string\n transitionGroupName?: string\n items: ValueInMapRecord<OrchestratorStoreObject[keyof OrchestratorStoreObject]>['value'][]\n}\nconst positionedItems = computed<\n Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n>(() => {\n const toastDefaultPosition: ContainerPosition = 'bottom-start'\n const toastDefaults = (cls: ContainerPosition) =>\n ({\n class: `${cls} toast-container position-fixed p-3`,\n style: 'width: calc(var(--bs-toast-max-width, 350px) + var(--bs-toast-padding-x, 1rem) * 2)',\n transitionGroupName: 'b-list',\n }) satisfies Partial<ItemObject>\n const groupedToastItems = items.value.toast.reduce(\n (acc, item) => {\n const pos = item.props.position ?? toastDefaultPosition\n ;(acc[pos] ??= {\n ...toastDefaults(pos),\n items: [],\n }).items.push(item)\n\n return acc\n },\n {} as Record<ContainerPosition, ItemObject>\n )\n\n const allGroups = {\n ...groupedToastItems,\n modal: {items: items.value.modal},\n popover: {items: items.value.popover},\n tooltip: {items: items.value.tooltip},\n }\n\n // Skip rendering empty containers (e.g. popover/tooltip/modal groups with no active items)\n return Object.fromEntries(\n Object.entries(allGroups).filter(([, value]) => value.items.length > 0)\n ) as Record<ContainerPosition | keyof Omit<OrchestratorStoreObject, 'toast'>, ItemObject>\n})\n</script>\n","<template>\n <BOrchestrator v-if=\"!noOrchestrator\" :append-toast=\"appendToast\" :teleport-to=\"teleportTo\" />\n <slot v-bind=\"$attrs\" />\n</template>\n\n<script setup lang=\"ts\">\nimport type {BAppProps} from '../../types'\nimport BOrchestrator from './BOrchestrator.vue'\nimport {useProvideDefaults} from '../../composables/useProvideDefaults'\nimport {useRegistry} from '../../composables/useRegistry'\nimport {useOrchestratorRegistry} from '../../composables/orchestratorShared'\nimport {toRef} from 'vue'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<BAppProps>(), {\n appendToast: false,\n teleportTo: undefined,\n defaults: undefined,\n mergeDefaults: false,\n noOrchestrator: false,\n rtl: false,\n})\n\nuseProvideDefaults(\n toRef(() => props.defaults),\n props.mergeDefaults\n)\nuseRegistry(props.rtl)\nif (!props.noOrchestrator) {\n useOrchestratorRegistry()\n}\n</script>\n","<template>\n <BOrchestrator v-if=\"!noOrchestrator\" :append-toast=\"appendToast\" :teleport-to=\"teleportTo\" />\n <slot v-bind=\"$attrs\" />\n</template>\n\n<script setup lang=\"ts\">\nimport type {BAppProps} from '../../types'\nimport BOrchestrator from './BOrchestrator.vue'\nimport {useProvideDefaults} from '../../composables/useProvideDefaults'\nimport {useRegistry} from '../../composables/useRegistry'\nimport {useOrchestratorRegistry} from '../../composables/orchestratorShared'\nimport {toRef} from 'vue'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<BAppProps>(), {\n appendToast: false,\n teleportTo: undefined,\n defaults: undefined,\n mergeDefaults: false,\n noOrchestrator: false,\n rtl: false,\n})\n\nuseProvideDefaults(\n toRef(() => props.defaults),\n props.mergeDefaults\n)\nuseRegistry(props.rtl)\nif (!props.noOrchestrator) {\n useOrchestratorRegistry()\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwEA,MAAM,cAAc,UAAoC;GACtD,MAAM,KAAK,MAAM,YAAY,OAAO,OAAO,MAAM,YAAY,WAAW,QAAQ;EAClF;EAEA,MAAM,QAAQ;EAQd,MAAM,uBAAuB,OAAO,yBAAyB,IAAI;EAEjE,IAAI,sBACE;OAAA,CAAC,qBAAqB,yBAAyB,OACjD,qBAAqB,0BAA0B,IAAI;EAAA,OAGrD,KACE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YhT,WAA0B,MAAqB;SAAyB,WAAW,CAAC;SAAoB,eAAe,WAAW,CAAC;SAAwB,IAAA,EAAE,kBAAA;SAA0F,IAAA,CAAA,SAAS,eAAqC,eAAe,CAAC;;OAarR,CAAA,GAAA,YAAA,EAAA,GAAA,EAAA,GAAA,CAAA,WAAA,QAAf,MAAM,SAAI;;SAAa,MAAA;SACvC,IAAA,SAD+C,UAAK,EACpD,UAAA,GAAA,YAAuC,wBAAvB,IAAI,GAApB,WAAuC,EAAA,SAAA,KAAA,GAAT,KAAK,GAAA,MAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EEpCnD,MAAM,QAAQ;EASd,mBACE,YAAY,MAAM,QAAQ,GAC1B,MAAM,aACR;EACA,YAAY,MAAM,GAAG;EACrB,IAAI,CAAC,MAAM,gBACT,wBAAwB;;GA/BF,OAAA,UAAA,GAAA,mBAAA,UAAA,MAAA,CAAA,CAAA,QAAA,kBAAtB,UAAA,GAAA,YAA8F,uBAAA;;IAAvD,gBAAc,QAAA;IAAc,eAAa,QAAA;GAChF,GAAA,MAAA,GAAA,CAAA,gBAAA,aAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAAA,WAAwB,KAAA,QAAA,WAAA,eAAA,mBAAVC,KAAAA,MAAM,CAAA,CAAA,CAAA,GAAA,EAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BFormInput-BwvdFGDu.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=\"modelValue\"\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 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=\"modelValue\"\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 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,SAAQ,YAAY;EAE9C,MAAM,CAAC,YAAY,kBAAkB,SAGpC,SAAA,cAAC,EAEA,MAAM,MAAM,eAAe,GAAG,cAAc,EAC9C,CAAC;EAED,MAAM,QAAQ,eAAe,QAAQ;EAErC,MAAM,eAAe,OAAO,eAAe,KAAK;EAEhD,MAAM,EACJ,YACA,qBACA,SACA,UACA,QACA,YACA,OACA,MACA,eACE,aAAa,OAAO,OAAO,YAAY,cAAc;EAEzD,MAAM,kBAAkB,eAAe;GACrC,MAAM,UAAU,MAAM,SAAS;GAC/B,MAAM,UAAU,MAAM,SAAS;GAC/B,OAAO,CACL,WAAW,OACX;IACE,cAAc;IACd,gBAAgB,WAAY,CAAC,MAAM,aAAa,CAAC,WAAa,WAAW;IACzE,sBAAsB;IACtB,0BAA0B,MAAM,aAAa,CAAC,WAAW,CAAC;KACzD,gBAAgB,MAAM,SAAS,CAAC,CAAC,MAAM;GAC1C,CACF;EACF,CAAC;EAED,SAAa;GACX;GACA,SAAS;GACT,eAAe;GACf;EACF,CAAC;;GA1GC,OAAA,UAAA,GAAA,mBAsBE,SAAA;IArBC,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