bootstrap-vue-next 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BAccordion-ByAMZCS9.js → BAccordion-BfaVicrj.js} +2 -2
- package/dist/{BAccordion-ByAMZCS9.js.map → BAccordion-BfaVicrj.js.map} +1 -1
- package/dist/{BAlert-DdfFcjWF.js → BAlert-Czy83dU3.js} +5 -5
- package/dist/{BAlert-DdfFcjWF.js.map → BAlert-Czy83dU3.js.map} +1 -1
- package/dist/BAutocomplete-Bh4Bp5AI.js +437 -0
- package/dist/BAutocomplete-Bh4Bp5AI.js.map +1 -0
- package/dist/{BAvatar-BsStQrBF.js → BAvatar-BJNeQ1fe.js} +2 -2
- package/dist/{BAvatar-BsStQrBF.js.map → BAvatar-BJNeQ1fe.js.map} +1 -1
- package/dist/{BButton-KZu5jczf.js → BButton-DlOQ5sem.js} +2 -2
- package/dist/{BButton-KZu5jczf.js.map → BButton-DlOQ5sem.js.map} +1 -1
- package/dist/{BCard-DELccMG-.js → BCard-Bc1wed-3.js} +2 -2
- package/dist/{BCard-DELccMG-.js.map → BCard-Bc1wed-3.js.map} +1 -1
- package/dist/{BCarousel-qHGRSVFe.js → BCarousel-B-WZR469.js} +3 -4
- package/dist/{BCarousel-qHGRSVFe.js.map → BCarousel-B-WZR469.js.map} +1 -1
- package/dist/{BCollapse-DtuJwN7B.js → BCollapse-DCjKiTxo.js} +2 -2
- package/dist/{BCollapse-DtuJwN7B.js.map → BCollapse-DCjKiTxo.js.map} +1 -1
- package/dist/BDateField-Oh-cU-4i.js +456 -0
- package/dist/BDateField-Oh-cU-4i.js.map +1 -0
- package/dist/BDatePicker-HNI11eCe.js +632 -0
- package/dist/BDatePicker-HNI11eCe.js.map +1 -0
- package/dist/{BDropdown-BY-E0SHv.js → BDropdown-04nGcMhm.js} +6 -7
- package/dist/{BDropdown-BY-E0SHv.js.map → BDropdown-04nGcMhm.js.map} +1 -1
- package/dist/{BFormCheckbox-BYNGQgr2.js → BFormCheckbox-zjr8OsNd.js} +2 -2
- package/dist/{BFormCheckbox-BYNGQgr2.js.map → BFormCheckbox-zjr8OsNd.js.map} +1 -1
- package/dist/{BFormFile-C2DnrbK7.js → BFormFile-D_s8tf1m.js} +2 -2
- package/dist/{BFormFile-C2DnrbK7.js.map → BFormFile-D_s8tf1m.js.map} +1 -1
- package/dist/{BFormInput-_AkAy6Wk.js → BFormInput-DnIBPLCx.js} +2 -2
- package/dist/{BFormInput-_AkAy6Wk.js.map → BFormInput-DnIBPLCx.js.map} +1 -1
- package/dist/BFormOtp-Dx2RxPAW.js +150 -0
- package/dist/BFormOtp-Dx2RxPAW.js.map +1 -0
- package/dist/{BFormRadio-DAddcnfE.js → BFormRadio-DUz60sBI.js} +2 -2
- package/dist/{BFormRadio-DAddcnfE.js.map → BFormRadio-DUz60sBI.js.map} +1 -1
- package/dist/{BFormRating-iKFgSFet.js → BFormRating-CtMmDgrF.js} +2 -2
- package/dist/{BFormRating-iKFgSFet.js.map → BFormRating-CtMmDgrF.js.map} +1 -1
- package/dist/{BFormSelect-CSS-_kul.js → BFormSelect-CeslPN3i.js} +2 -3
- package/dist/{BFormSelect-CSS-_kul.js.map → BFormSelect-CeslPN3i.js.map} +1 -1
- package/dist/{BFormSpinbutton-fkVMbQC3.js → BFormSpinbutton-BR9YTfYy.js} +2 -3
- package/dist/{BFormSpinbutton-fkVMbQC3.js.map → BFormSpinbutton-BR9YTfYy.js.map} +1 -1
- package/dist/{BFormTags-CUcyRTCK.js → BFormTags-6qQn0Vlv.js} +2 -3
- package/dist/{BFormTags-CUcyRTCK.js.map → BFormTags-6qQn0Vlv.js.map} +1 -1
- package/dist/{BFormTextarea-CBBlEcrV.js → BFormTextarea-DvLrtG08.js} +3 -3
- package/dist/{BFormTextarea-CBBlEcrV.js.map → BFormTextarea-DvLrtG08.js.map} +1 -1
- package/dist/{BImg-knz2UZQE.js → BImg-Dd8Pc1Ln.js} +2 -2
- package/dist/{BImg-knz2UZQE.js.map → BImg-Dd8Pc1Ln.js.map} +1 -1
- package/dist/{BModal-DtQlIFNn.js → BModal-DOmTYI6F.js} +5 -6
- package/dist/{BModal-DtQlIFNn.js.map → BModal-DOmTYI6F.js.map} +1 -1
- package/dist/{BNav-BMWNXoNo.js → BNav-D3XbyI1R.js} +2 -2
- package/dist/{BNav-BMWNXoNo.js.map → BNav-D3XbyI1R.js.map} +1 -1
- package/dist/{BOffcanvas-BtvIDgH7.js → BOffcanvas-DyPG7s8I.js} +5 -5
- package/dist/{BOffcanvas-BtvIDgH7.js.map → BOffcanvas-DyPG7s8I.js.map} +1 -1
- package/dist/{BPagination-C85wHRgS.js → BPagination-DGvgWeYG.js} +2 -2
- package/dist/{BPagination-C85wHRgS.js.map → BPagination-DGvgWeYG.js.map} +1 -1
- package/dist/{BPlaceholder-DI12zz0a.js → BPlaceholder-BrBmbfIg.js} +3 -3
- package/dist/{BPlaceholder-DI12zz0a.js.map → BPlaceholder-BrBmbfIg.js.map} +1 -1
- package/dist/{BProgress-BNxYppi-.js → BProgress-CXhe6hsN.js} +2 -2
- package/dist/{BProgress-BNxYppi-.js.map → BProgress-CXhe6hsN.js.map} +1 -1
- package/dist/{BTable-BZxX17YU.js → BTable-8jp3wPAI.js} +2 -2
- package/dist/{BTable-BZxX17YU.js.map → BTable-8jp3wPAI.js.map} +1 -1
- package/dist/BTimeField-vdultTwg.js +138 -0
- package/dist/BTimeField-vdultTwg.js.map +1 -0
- package/dist/{BToast-Cm7TZlZq.js → BToast-vxfpFGe3.js} +5 -5
- package/dist/{BToast-Cm7TZlZq.js.map → BToast-vxfpFGe3.js.map} +1 -1
- package/dist/{BTooltip-CAgQ77tS.js → BTooltip-CV5Ogidy.js} +2 -2
- package/dist/{BTooltip-CAgQ77tS.js.map → BTooltip-CV5Ogidy.js.map} +1 -1
- package/dist/bootstrap-vue-next.mjs +33 -33
- package/dist/{floatingUi-CSJCHfOw.js → floatingUi-BhgR4GBJ.js} +10 -168
- package/dist/floatingUi-BhgR4GBJ.js.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/src/components/BAccordion/index.mjs +1 -1
- package/dist/src/components/BAlert/index.mjs +1 -1
- package/dist/src/components/BAutocomplete/index.mjs +1 -1
- package/dist/src/components/BAvatar/index.mjs +1 -1
- package/dist/src/components/BButton/index.mjs +1 -1
- package/dist/src/components/BCard/index.mjs +1 -1
- package/dist/src/components/BCarousel/index.mjs +1 -1
- package/dist/src/components/BCollapse/index.mjs +1 -1
- package/dist/src/components/BDateField/index.mjs +1 -1
- package/dist/src/components/BDatePicker/index.mjs +1 -1
- package/dist/src/components/BDropdown/index.mjs +1 -1
- package/dist/src/components/BFormCheckbox/index.mjs +1 -1
- package/dist/src/components/BFormFile/index.mjs +1 -1
- package/dist/src/components/BFormInput/index.mjs +1 -1
- package/dist/src/components/BFormOtp/index.mjs +1 -1
- package/dist/src/components/BFormRadio/index.mjs +1 -1
- package/dist/src/components/BFormRating/index.mjs +1 -1
- package/dist/src/components/BFormSelect/index.mjs +1 -1
- package/dist/src/components/BFormSpinbutton/index.mjs +1 -1
- package/dist/src/components/BFormTags/index.mjs +1 -1
- package/dist/src/components/BFormTextarea/index.mjs +1 -1
- package/dist/src/components/BImg/index.mjs +1 -1
- package/dist/src/components/BModal/index.mjs +1 -1
- package/dist/src/components/BNav/index.mjs +1 -1
- package/dist/src/components/BOffcanvas/index.mjs +1 -1
- package/dist/src/components/BPagination/index.mjs +1 -1
- package/dist/src/components/BPlaceholder/index.mjs +1 -1
- package/dist/src/components/BPopover/index.mjs +1 -1
- package/dist/src/components/BProgress/index.mjs +1 -1
- package/dist/src/components/BTable/index.mjs +1 -1
- package/dist/src/components/BTimeField/index.mjs +1 -1
- package/dist/src/components/BToast/index.mjs +1 -1
- package/dist/src/components/BTooltip/index.mjs +1 -1
- package/dist/src/components/index.mjs +34 -34
- package/dist/src/composables/index.mjs +1 -1
- package/dist/src/composables/useColorMode/index.mjs +1 -1
- package/dist/src/composables/useModal/index.mjs +1 -1
- package/dist/src/composables/usePopover/index.mjs +2 -2
- package/dist/src/composables/useScrollLock/index.mjs +1 -2
- package/dist/src/composables/useScrollLock/index.mjs.map +1 -1
- package/dist/src/composables/useScrollspy/index.mjs +1 -2
- package/dist/src/composables/useScrollspy/index.mjs.map +1 -1
- package/dist/src/composables/useToast/index.mjs +1 -1
- package/dist/src/directives/BPopover/index.mjs +2 -2
- package/dist/src/directives/BScrollspy/index.mjs +1 -1
- package/dist/src/directives/BToggle/index.mjs +1 -1
- package/dist/src/directives/BTooltip/index.mjs +2 -2
- package/dist/src/directives/index.mjs +1 -1
- package/dist/src/plugins/index.mjs +1 -1
- package/dist/src/resolvers/index.mjs +1 -1
- package/dist/src/types/index.mjs +1 -1
- package/dist/src/utils/index.mjs +1 -1
- package/dist/{useCountdownHover-BN8vJIQW.js → useCountdownHover-HZSJZkHq.js} +2 -2
- package/dist/{useCountdownHover-BN8vJIQW.js.map → useCountdownHover-HZSJZkHq.js.map} +1 -1
- package/dist/{useFormInput-C-iXRxog.js → useFormInput-CMtXFoM2.js} +2 -3
- package/dist/{useFormInput-C-iXRxog.js.map → useFormInput-CMtXFoM2.js.map} +1 -1
- package/dist/useSafeScrollLock-BT4KKhxB.js +89 -0
- package/dist/useSafeScrollLock-BT4KKhxB.js.map +1 -0
- package/dist/{useShowHide-Dpld86ys.js → useShowHide-BLIZLD9E.js} +2 -3
- package/dist/{useShowHide-Dpld86ys.js.map → useShowHide-BLIZLD9E.js.map} +1 -1
- package/dist/{utils-DYdkCKBf.js → utils-CvjliJBf.js} +2 -2
- package/dist/{utils-DYdkCKBf.js.map → utils-CvjliJBf.js.map} +1 -1
- package/package.json +3 -23
- package/dist/BAutocomplete-BFbbKtpz.js +0 -2490
- package/dist/BAutocomplete-BFbbKtpz.js.map +0 -1
- package/dist/BDateField-Bj-Jz7u4.js +0 -906
- package/dist/BDateField-Bj-Jz7u4.js.map +0 -1
- package/dist/BDatePicker-AVTYcVLy.js +0 -5210
- package/dist/BDatePicker-AVTYcVLy.js.map +0 -1
- package/dist/BFormOtp-ClDACqXM.js +0 -577
- package/dist/BFormOtp-ClDACqXM.js.map +0 -1
- package/dist/BTimeField-CbRGjaI6.js +0 -516
- package/dist/BTimeField-CbRGjaI6.js.map +0 -1
- package/dist/DateRangeFieldInput-Cbzjg8iF.js +0 -761
- package/dist/DateRangeFieldInput-Cbzjg8iF.js.map +0 -1
- package/dist/PopperContent-C9eeL6LH.js +0 -1726
- package/dist/PopperContent-C9eeL6LH.js.map +0 -1
- package/dist/VisuallyHidden-BYzyjJiY.js +0 -182
- package/dist/VisuallyHidden-BYzyjJiY.js.map +0 -1
- package/dist/VisuallyHiddenInput-CUrc8XXa.js +0 -180
- package/dist/VisuallyHiddenInput-CUrc8XXa.js.map +0 -1
- package/dist/dist-9-XTMhb-.js +0 -1302
- package/dist/dist-9-XTMhb-.js.map +0 -1
- package/dist/dist-B-regXAP.js +0 -123
- package/dist/dist-B-regXAP.js.map +0 -1
- package/dist/dist-DKc2ivHS.js +0 -411
- package/dist/dist-DKc2ivHS.js.map +0 -1
- package/dist/floating-ui.dom-C7UZexJK.js +0 -1484
- package/dist/floating-ui.dom-C7UZexJK.js.map +0 -1
- package/dist/floatingUi-CSJCHfOw.js.map +0 -1
- package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
- package/dist/useDateField-CQZb799C.js +0 -3679
- package/dist/useDateField-CQZb799C.js.map +0 -1
- package/dist/useForwardExpose-DDvk7mir.js +0 -60
- package/dist/useForwardExpose-DDvk7mir.js.map +0 -1
- package/dist/useKbd-DRsaFU_f.js +0 -76
- package/dist/useKbd-DRsaFU_f.js.map +0 -1
- package/dist/useSafeScrollLock-PVgSASYu.js +0 -1326
- package/dist/useSafeScrollLock-PVgSASYu.js.map +0 -1
|
@@ -1,577 +0,0 @@
|
|
|
1
|
-
import { S as useToNumber } from "./dist-DKc2ivHS.js";
|
|
2
|
-
import { S as useVModel } from "./dist-9-XTMhb-.js";
|
|
3
|
-
import { t as useDefaults } from "./useDefaults-BzP4qZBu.js";
|
|
4
|
-
import { t as useId$1 } from "./useId-Fh-Arhb7.js";
|
|
5
|
-
import { a as useDirection, c as getActiveElement, l as createContext, n as usePrimitiveElement, r as Primitive } from "./VisuallyHidden-BYzyjJiY.js";
|
|
6
|
-
import { n as useComposing, t as VisuallyHiddenInput_default } from "./VisuallyHiddenInput-CUrc8XXa.js";
|
|
7
|
-
import { t as useForwardExpose } from "./useForwardExpose-DDvk7mir.js";
|
|
8
|
-
import { t as BFormInput_default } from "./BFormInput-_AkAy6Wk.js";
|
|
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
|
-
//#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
|
-
var ignoredElement = ["INPUT", "TEXTAREA"];
|
|
12
|
-
/**
|
|
13
|
-
* Allow arrow navigation for every html element with data-reka-collection-item tag
|
|
14
|
-
*
|
|
15
|
-
* @param e Keyboard event
|
|
16
|
-
* @param currentElement Event initiator element or any element that wants to handle the navigation
|
|
17
|
-
* @param parentElement Parent element where contains all the collection items, this will collect every item to be used when nav
|
|
18
|
-
* @param options further options
|
|
19
|
-
* @returns the navigated html element or null if none
|
|
20
|
-
*/
|
|
21
|
-
function useArrowNavigation(e, currentElement, parentElement, options = {}) {
|
|
22
|
-
if (!currentElement || options.enableIgnoredElement && ignoredElement.includes(currentElement.nodeName)) return null;
|
|
23
|
-
const { arrowKeyOptions = "both", attributeName = "[data-reka-collection-item]", itemsArray = [], loop = true, dir = "ltr", preventScroll = true, focus = false } = options;
|
|
24
|
-
const [right, left, up, down, home, end] = [
|
|
25
|
-
e.key === "ArrowRight",
|
|
26
|
-
e.key === "ArrowLeft",
|
|
27
|
-
e.key === "ArrowUp",
|
|
28
|
-
e.key === "ArrowDown",
|
|
29
|
-
e.key === "Home",
|
|
30
|
-
e.key === "End"
|
|
31
|
-
];
|
|
32
|
-
const goingVertical = up || down;
|
|
33
|
-
const goingHorizontal = right || left;
|
|
34
|
-
if (!home && !end && (!goingVertical && !goingHorizontal || arrowKeyOptions === "vertical" && goingHorizontal || arrowKeyOptions === "horizontal" && goingVertical)) return null;
|
|
35
|
-
const allCollectionItems = parentElement ? Array.from(parentElement.querySelectorAll(attributeName)) : itemsArray;
|
|
36
|
-
if (!allCollectionItems.length) return null;
|
|
37
|
-
if (preventScroll) e.preventDefault();
|
|
38
|
-
let item = null;
|
|
39
|
-
if (goingHorizontal || goingVertical) item = findNextFocusableElement(allCollectionItems, currentElement, {
|
|
40
|
-
goForward: goingVertical ? down : dir === "ltr" ? right : left,
|
|
41
|
-
loop
|
|
42
|
-
});
|
|
43
|
-
else if (home) item = allCollectionItems.at(0) || null;
|
|
44
|
-
else if (end) item = allCollectionItems.at(-1) || null;
|
|
45
|
-
if (focus) item?.focus();
|
|
46
|
-
return item;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Recursive function to find the next focusable element to avoid disabled elements
|
|
50
|
-
*
|
|
51
|
-
* @param elements Elements to navigate
|
|
52
|
-
* @param currentElement Current active element
|
|
53
|
-
* @param options
|
|
54
|
-
* @returns next focusable element
|
|
55
|
-
*/
|
|
56
|
-
function findNextFocusableElement(elements, currentElement, options, iterations = !elements.includes(currentElement) ? elements.length + 1 : elements.length) {
|
|
57
|
-
if (--iterations === 0) return null;
|
|
58
|
-
const index = elements.indexOf(currentElement);
|
|
59
|
-
let newIndex;
|
|
60
|
-
if (index === -1) newIndex = options.goForward ? 0 : elements.length - 1;
|
|
61
|
-
else newIndex = options.goForward ? index + 1 : index - 1;
|
|
62
|
-
if (!options.loop && (newIndex < 0 || newIndex >= elements.length)) return null;
|
|
63
|
-
const candidate = elements[(newIndex + elements.length) % elements.length];
|
|
64
|
-
if (!candidate) return null;
|
|
65
|
-
if (candidate.hasAttribute("disabled") && candidate.getAttribute("disabled") !== "false") return findNextFocusableElement(elements, candidate, options, iterations);
|
|
66
|
-
return candidate;
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/PinInput/PinInputRoot.js
|
|
70
|
-
var [injectPinInputRootContext, providePinInputRootContext] = /*#__PURE__*/ createContext("PinInputRoot");
|
|
71
|
-
var PinInputRoot_default = /* @__PURE__ */ defineComponent({
|
|
72
|
-
inheritAttrs: false,
|
|
73
|
-
__name: "PinInputRoot",
|
|
74
|
-
props: {
|
|
75
|
-
modelValue: {
|
|
76
|
-
type: null,
|
|
77
|
-
required: false
|
|
78
|
-
},
|
|
79
|
-
defaultValue: {
|
|
80
|
-
type: null,
|
|
81
|
-
required: false
|
|
82
|
-
},
|
|
83
|
-
placeholder: {
|
|
84
|
-
type: String,
|
|
85
|
-
required: false,
|
|
86
|
-
default: ""
|
|
87
|
-
},
|
|
88
|
-
mask: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
required: false
|
|
91
|
-
},
|
|
92
|
-
otp: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
required: false
|
|
95
|
-
},
|
|
96
|
-
type: {
|
|
97
|
-
type: null,
|
|
98
|
-
required: false,
|
|
99
|
-
default: "text"
|
|
100
|
-
},
|
|
101
|
-
dir: {
|
|
102
|
-
type: String,
|
|
103
|
-
required: false
|
|
104
|
-
},
|
|
105
|
-
disabled: {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
required: false
|
|
108
|
-
},
|
|
109
|
-
id: {
|
|
110
|
-
type: String,
|
|
111
|
-
required: false
|
|
112
|
-
},
|
|
113
|
-
asChild: {
|
|
114
|
-
type: Boolean,
|
|
115
|
-
required: false
|
|
116
|
-
},
|
|
117
|
-
as: {
|
|
118
|
-
type: null,
|
|
119
|
-
required: false
|
|
120
|
-
},
|
|
121
|
-
name: {
|
|
122
|
-
type: String,
|
|
123
|
-
required: false
|
|
124
|
-
},
|
|
125
|
-
required: {
|
|
126
|
-
type: Boolean,
|
|
127
|
-
required: false
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
emits: ["update:modelValue", "complete"],
|
|
131
|
-
setup(__props, { emit: __emit }) {
|
|
132
|
-
const props = __props;
|
|
133
|
-
const emits = __emit;
|
|
134
|
-
const { mask, otp, placeholder, type, disabled, dir: propDir } = toRefs(props);
|
|
135
|
-
const { forwardRef } = useForwardExpose();
|
|
136
|
-
const dir = useDirection(propDir);
|
|
137
|
-
const modelValue = useVModel(props, "modelValue", emits, {
|
|
138
|
-
defaultValue: props.defaultValue ?? [],
|
|
139
|
-
passive: true,
|
|
140
|
-
deep: true
|
|
141
|
-
});
|
|
142
|
-
const currentModelValue = computed(() => Array.isArray(modelValue.value) ? [...modelValue.value] : []);
|
|
143
|
-
const inputElements = ref(/* @__PURE__ */ new Set());
|
|
144
|
-
function onInputElementChange(el) {
|
|
145
|
-
inputElements.value.add(el);
|
|
146
|
-
}
|
|
147
|
-
const isNumericMode = computed(() => props.type === "number");
|
|
148
|
-
const isCompleted = computed(() => {
|
|
149
|
-
return currentModelValue.value.filter((i) => !!i || isNumericMode.value && i === 0).length === inputElements.value.size;
|
|
150
|
-
});
|
|
151
|
-
watch(modelValue, () => {
|
|
152
|
-
if (isCompleted.value) emits("complete", modelValue.value);
|
|
153
|
-
}, { deep: true });
|
|
154
|
-
providePinInputRootContext({
|
|
155
|
-
modelValue,
|
|
156
|
-
currentModelValue,
|
|
157
|
-
mask,
|
|
158
|
-
otp,
|
|
159
|
-
placeholder,
|
|
160
|
-
type,
|
|
161
|
-
dir,
|
|
162
|
-
disabled,
|
|
163
|
-
isCompleted,
|
|
164
|
-
inputElements,
|
|
165
|
-
onInputElementChange,
|
|
166
|
-
isNumericMode
|
|
167
|
-
});
|
|
168
|
-
return (_ctx, _cache) => {
|
|
169
|
-
return openBlock(), createBlock(unref(Primitive), mergeProps(_ctx.$attrs, {
|
|
170
|
-
ref: unref(forwardRef),
|
|
171
|
-
dir: unref(dir),
|
|
172
|
-
"data-complete": isCompleted.value ? "" : void 0,
|
|
173
|
-
"data-disabled": unref(disabled) ? "" : void 0
|
|
174
|
-
}), {
|
|
175
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default", { modelValue: unref(modelValue) }), createVNode(VisuallyHiddenInput_default, {
|
|
176
|
-
id: _ctx.id,
|
|
177
|
-
as: "input",
|
|
178
|
-
feature: "focusable",
|
|
179
|
-
tabindex: "-1",
|
|
180
|
-
value: currentModelValue.value.join(""),
|
|
181
|
-
name: _ctx.name ?? "",
|
|
182
|
-
disabled: unref(disabled),
|
|
183
|
-
required: _ctx.required,
|
|
184
|
-
onFocus: _cache[0] || (_cache[0] = ($event) => Array.from(inputElements.value)?.[0]?.focus())
|
|
185
|
-
}, null, 8, [
|
|
186
|
-
"id",
|
|
187
|
-
"value",
|
|
188
|
-
"name",
|
|
189
|
-
"disabled",
|
|
190
|
-
"required"
|
|
191
|
-
])]),
|
|
192
|
-
_: 3
|
|
193
|
-
}, 16, [
|
|
194
|
-
"dir",
|
|
195
|
-
"data-complete",
|
|
196
|
-
"data-disabled"
|
|
197
|
-
]);
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/PinInput/PinInputInput.js
|
|
203
|
-
var PinInputInput_default = /* @__PURE__ */ defineComponent({
|
|
204
|
-
__name: "PinInputInput",
|
|
205
|
-
props: {
|
|
206
|
-
index: {
|
|
207
|
-
type: Number,
|
|
208
|
-
required: true
|
|
209
|
-
},
|
|
210
|
-
disabled: {
|
|
211
|
-
type: Boolean,
|
|
212
|
-
required: false
|
|
213
|
-
},
|
|
214
|
-
asChild: {
|
|
215
|
-
type: Boolean,
|
|
216
|
-
required: false
|
|
217
|
-
},
|
|
218
|
-
as: {
|
|
219
|
-
type: null,
|
|
220
|
-
required: false,
|
|
221
|
-
default: "input"
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
setup(__props) {
|
|
225
|
-
const props = __props;
|
|
226
|
-
const context = injectPinInputRootContext();
|
|
227
|
-
const inputElements = computed(() => [...context.inputElements.value]);
|
|
228
|
-
const currentValue = computed(() => context.currentModelValue.value[props.index]);
|
|
229
|
-
const disabled = computed(() => props.disabled || context.disabled.value);
|
|
230
|
-
const isOtpMode = computed(() => context.otp.value);
|
|
231
|
-
const isPasswordMode = computed(() => context.mask.value);
|
|
232
|
-
const NUMBER_REG = /^\d*$/;
|
|
233
|
-
const NON_NUMBER_REG = /\D/g;
|
|
234
|
-
const { primitiveElement, currentElement } = usePrimitiveElement();
|
|
235
|
-
const { isComposing, handleCompositionStart, handleCompositionEnd } = useComposing((event) => {
|
|
236
|
-
const target = event.target;
|
|
237
|
-
const value = event.data || target.value;
|
|
238
|
-
if (context.isNumericMode.value) {
|
|
239
|
-
const filtered = value.replace(NON_NUMBER_REG, "");
|
|
240
|
-
if (!filtered) {
|
|
241
|
-
target.value = "";
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
if (filtered.length > 1) {
|
|
245
|
-
handleMultipleCharacter(filtered);
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
target.value = filtered;
|
|
249
|
-
updateModelValueAt(props.index, filtered);
|
|
250
|
-
const nextEl$1 = inputElements.value[props.index + 1];
|
|
251
|
-
if (nextEl$1) nextEl$1.focus();
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
if (value.length > 1) {
|
|
255
|
-
handleMultipleCharacter(value);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
target.value = value;
|
|
259
|
-
updateModelValueAt(props.index, value);
|
|
260
|
-
const nextEl = inputElements.value[props.index + 1];
|
|
261
|
-
if (nextEl) nextEl.focus();
|
|
262
|
-
});
|
|
263
|
-
function handleInput(event) {
|
|
264
|
-
if (isComposing.value || event.isComposing) return;
|
|
265
|
-
const target = event.target;
|
|
266
|
-
if ((event.data?.length ?? 0) > 1) {
|
|
267
|
-
handleMultipleCharacter(target.value);
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
if (context.isNumericMode.value && !NUMBER_REG.test(target.value)) {
|
|
271
|
-
target.value = target.value.replace(NON_NUMBER_REG, "");
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
target.value = event.data || target.value.slice(-1);
|
|
275
|
-
updateModelValueAt(props.index, target.value);
|
|
276
|
-
const nextEl = inputElements.value[props.index + 1];
|
|
277
|
-
if (nextEl) nextEl.focus();
|
|
278
|
-
}
|
|
279
|
-
function updatePlaceholder() {
|
|
280
|
-
nextTick(() => {
|
|
281
|
-
const target = currentElement.value;
|
|
282
|
-
if (!target) return;
|
|
283
|
-
if (!target.value && target === getActiveElement()) target.placeholder = "";
|
|
284
|
-
else target.placeholder = context.placeholder.value;
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
function handleKeydown(event) {
|
|
288
|
-
if (isComposing.value || event.isComposing) return;
|
|
289
|
-
useArrowNavigation(event, getActiveElement(), void 0, {
|
|
290
|
-
itemsArray: inputElements.value,
|
|
291
|
-
focus: true,
|
|
292
|
-
loop: false,
|
|
293
|
-
arrowKeyOptions: "horizontal",
|
|
294
|
-
dir: context.dir.value
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function handleBackspace(event) {
|
|
298
|
-
event.preventDefault();
|
|
299
|
-
if (event.target.value) updateModelValueAt(props.index, "");
|
|
300
|
-
else {
|
|
301
|
-
const prevEl = inputElements.value[props.index - 1];
|
|
302
|
-
if (prevEl) {
|
|
303
|
-
prevEl.focus();
|
|
304
|
-
updateModelValueAt(props.index - 1, "");
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
function handleDelete(event) {
|
|
309
|
-
if (event.key === "Delete") {
|
|
310
|
-
event.preventDefault();
|
|
311
|
-
updateModelValueAt(props.index, "");
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
function handleFocus(event) {
|
|
315
|
-
if (context.otp.value) {
|
|
316
|
-
const firstEmptyInputIdx = inputElements.value.findIndex((_, idx) => context.currentModelValue.value[idx] === "" || context.currentModelValue.value[idx] === void 0);
|
|
317
|
-
if (firstEmptyInputIdx !== -1 && firstEmptyInputIdx < props.index) {
|
|
318
|
-
inputElements.value[firstEmptyInputIdx].focus();
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
event.target.setSelectionRange(1, 1);
|
|
323
|
-
updatePlaceholder();
|
|
324
|
-
}
|
|
325
|
-
function handleBlur(event) {
|
|
326
|
-
updatePlaceholder();
|
|
327
|
-
}
|
|
328
|
-
function handlePaste(event) {
|
|
329
|
-
event.preventDefault();
|
|
330
|
-
const clipboardData = event.clipboardData;
|
|
331
|
-
if (!clipboardData) return;
|
|
332
|
-
const rawValues = clipboardData.getData("text");
|
|
333
|
-
handleMultipleCharacter(context.isNumericMode.value ? rawValues.replace(NON_NUMBER_REG, "") : rawValues);
|
|
334
|
-
}
|
|
335
|
-
function handleMultipleCharacter(values) {
|
|
336
|
-
const tempModelValue = [...context.currentModelValue.value];
|
|
337
|
-
const initialIndex = values.length >= inputElements.value.length ? 0 : props.index;
|
|
338
|
-
const lastIndex = Math.min(initialIndex + values.length, inputElements.value.length);
|
|
339
|
-
for (let i = initialIndex; i < lastIndex; i++) {
|
|
340
|
-
const input = inputElements.value[i];
|
|
341
|
-
const value = values[i - initialIndex];
|
|
342
|
-
if (context.isNumericMode.value) {
|
|
343
|
-
const num = Number.parseInt(value);
|
|
344
|
-
if (Number.isNaN(num)) continue;
|
|
345
|
-
tempModelValue[i] = num;
|
|
346
|
-
} else tempModelValue[i] = value;
|
|
347
|
-
input.focus();
|
|
348
|
-
}
|
|
349
|
-
context.modelValue.value = tempModelValue;
|
|
350
|
-
inputElements.value[lastIndex]?.focus();
|
|
351
|
-
}
|
|
352
|
-
function removeTrailingEmptyStrings(input) {
|
|
353
|
-
let i = input.length - 1;
|
|
354
|
-
while (i >= 0 && input[i] === "") {
|
|
355
|
-
input.pop();
|
|
356
|
-
i--;
|
|
357
|
-
}
|
|
358
|
-
return input;
|
|
359
|
-
}
|
|
360
|
-
function updateModelValueAt(index, value) {
|
|
361
|
-
const tempModelValue = [...context.currentModelValue.value];
|
|
362
|
-
if (context.isNumericMode.value) {
|
|
363
|
-
const num = +value;
|
|
364
|
-
if (value === "" || isNaN(num)) delete tempModelValue[index];
|
|
365
|
-
else tempModelValue[index] = num;
|
|
366
|
-
} else tempModelValue[index] = value;
|
|
367
|
-
context.modelValue.value = removeTrailingEmptyStrings(tempModelValue);
|
|
368
|
-
}
|
|
369
|
-
watch(currentValue, updatePlaceholder);
|
|
370
|
-
onMounted(() => {
|
|
371
|
-
context.onInputElementChange(currentElement.value);
|
|
372
|
-
});
|
|
373
|
-
onUnmounted(() => {
|
|
374
|
-
context.inputElements?.value.delete(currentElement.value);
|
|
375
|
-
});
|
|
376
|
-
return (_ctx, _cache) => {
|
|
377
|
-
return openBlock(), createBlock(unref(Primitive), {
|
|
378
|
-
ref_key: "primitiveElement",
|
|
379
|
-
ref: primitiveElement,
|
|
380
|
-
autocapitalize: "none",
|
|
381
|
-
as: _ctx.as,
|
|
382
|
-
"as-child": _ctx.asChild,
|
|
383
|
-
autocomplete: isOtpMode.value ? "one-time-code" : "false",
|
|
384
|
-
type: isPasswordMode.value ? "password" : "text",
|
|
385
|
-
inputmode: unref(context).isNumericMode.value ? "numeric" : "text",
|
|
386
|
-
pattern: unref(context).isNumericMode.value ? "[0-9]*" : void 0,
|
|
387
|
-
placeholder: unref(context).placeholder.value,
|
|
388
|
-
value: currentValue.value,
|
|
389
|
-
disabled: disabled.value,
|
|
390
|
-
"data-disabled": disabled.value ? "" : void 0,
|
|
391
|
-
"data-complete": unref(context).isCompleted.value ? "" : void 0,
|
|
392
|
-
"aria-label": `pin input ${_ctx.index + 1} of ${inputElements.value.length}`,
|
|
393
|
-
onInput: _cache[0] || (_cache[0] = ($event) => handleInput($event)),
|
|
394
|
-
onKeydown: [
|
|
395
|
-
withKeys(handleKeydown, [
|
|
396
|
-
"left",
|
|
397
|
-
"right",
|
|
398
|
-
"up",
|
|
399
|
-
"down",
|
|
400
|
-
"home",
|
|
401
|
-
"end"
|
|
402
|
-
]),
|
|
403
|
-
withKeys(handleBackspace, ["backspace"]),
|
|
404
|
-
withKeys(handleDelete, ["delete"])
|
|
405
|
-
],
|
|
406
|
-
onFocus: handleFocus,
|
|
407
|
-
onBlur: handleBlur,
|
|
408
|
-
onPaste: handlePaste,
|
|
409
|
-
onCompositionstart: unref(handleCompositionStart),
|
|
410
|
-
onCompositionend: unref(handleCompositionEnd)
|
|
411
|
-
}, {
|
|
412
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
413
|
-
_: 3
|
|
414
|
-
}, 8, [
|
|
415
|
-
"as",
|
|
416
|
-
"as-child",
|
|
417
|
-
"autocomplete",
|
|
418
|
-
"type",
|
|
419
|
-
"inputmode",
|
|
420
|
-
"pattern",
|
|
421
|
-
"placeholder",
|
|
422
|
-
"value",
|
|
423
|
-
"disabled",
|
|
424
|
-
"data-disabled",
|
|
425
|
-
"data-complete",
|
|
426
|
-
"aria-label",
|
|
427
|
-
"onCompositionstart",
|
|
428
|
-
"onCompositionend"
|
|
429
|
-
]);
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
//#endregion
|
|
434
|
-
//#region src/components/BFormOtp/BFormOtp.vue?vue&type=script&setup=true&lang.ts
|
|
435
|
-
var lengthDefault = 6;
|
|
436
|
-
//#endregion
|
|
437
|
-
//#region src/components/BFormOtp/BFormOtp.vue
|
|
438
|
-
var BFormOtp_default = /* @__PURE__ */ defineComponent({
|
|
439
|
-
__name: "BFormOtp",
|
|
440
|
-
props: /*@__PURE__*/ mergeModels({
|
|
441
|
-
ariaInvalid: {
|
|
442
|
-
type: [Boolean, String],
|
|
443
|
-
default: void 0
|
|
444
|
-
},
|
|
445
|
-
ariaLabel: { default: void 0 },
|
|
446
|
-
autofocus: {
|
|
447
|
-
type: Boolean,
|
|
448
|
-
default: false
|
|
449
|
-
},
|
|
450
|
-
dir: { default: void 0 },
|
|
451
|
-
disabled: {
|
|
452
|
-
type: Boolean,
|
|
453
|
-
default: false
|
|
454
|
-
},
|
|
455
|
-
form: { default: void 0 },
|
|
456
|
-
id: { default: void 0 },
|
|
457
|
-
length: { default: lengthDefault },
|
|
458
|
-
mask: {
|
|
459
|
-
type: Boolean,
|
|
460
|
-
default: false
|
|
461
|
-
},
|
|
462
|
-
name: { default: void 0 },
|
|
463
|
-
otp: {
|
|
464
|
-
type: Boolean,
|
|
465
|
-
default: false
|
|
466
|
-
},
|
|
467
|
-
placeholder: { default: "" },
|
|
468
|
-
plaintext: {
|
|
469
|
-
type: Boolean,
|
|
470
|
-
default: false
|
|
471
|
-
},
|
|
472
|
-
readonly: {
|
|
473
|
-
type: Boolean,
|
|
474
|
-
default: false
|
|
475
|
-
},
|
|
476
|
-
required: {
|
|
477
|
-
type: Boolean,
|
|
478
|
-
default: false
|
|
479
|
-
},
|
|
480
|
-
separator: {},
|
|
481
|
-
size: { default: void 0 },
|
|
482
|
-
state: {
|
|
483
|
-
type: [Boolean, null],
|
|
484
|
-
default: null
|
|
485
|
-
},
|
|
486
|
-
type: { default: "text" }
|
|
487
|
-
}, {
|
|
488
|
-
"modelValue": { default: () => [] },
|
|
489
|
-
"modelModifiers": {}
|
|
490
|
-
}),
|
|
491
|
-
emits: /*@__PURE__*/ mergeModels(["complete"], ["update:modelValue"]),
|
|
492
|
-
setup(__props, { emit: __emit }) {
|
|
493
|
-
const props = useDefaults(__props, "BFormOtp");
|
|
494
|
-
const emit = __emit;
|
|
495
|
-
const modelValue = useModel(__props, "modelValue");
|
|
496
|
-
const computedId = useId$1(() => props.id, "form-otp");
|
|
497
|
-
const lengthNumber = useToNumber(() => props.length, {
|
|
498
|
-
nanToZero: true,
|
|
499
|
-
method: "parseInt"
|
|
500
|
-
});
|
|
501
|
-
const computedLength = computed(() => lengthNumber.value > 0 ? lengthNumber.value : lengthDefault);
|
|
502
|
-
const rootClasses = computed(() => [
|
|
503
|
-
"b-form-otp",
|
|
504
|
-
"d-flex",
|
|
505
|
-
"gap-2",
|
|
506
|
-
"align-items-center",
|
|
507
|
-
{ [`b-form-otp-${props.size}`]: !!props.size }
|
|
508
|
-
]);
|
|
509
|
-
return (_ctx, _cache) => {
|
|
510
|
-
return openBlock(), createBlock(unref(PinInputRoot_default), {
|
|
511
|
-
id: unref(computedId),
|
|
512
|
-
modelValue: modelValue.value,
|
|
513
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
514
|
-
class: normalizeClass(rootClasses.value),
|
|
515
|
-
disabled: unref(props).disabled,
|
|
516
|
-
dir: unref(props).dir,
|
|
517
|
-
mask: unref(props).mask,
|
|
518
|
-
name: unref(props).name,
|
|
519
|
-
otp: unref(props).otp,
|
|
520
|
-
placeholder: unref(props).placeholder,
|
|
521
|
-
required: unref(props).required,
|
|
522
|
-
type: unref(props).type,
|
|
523
|
-
onComplete: _cache[1] || (_cache[1] = ($event) => emit("complete", $event))
|
|
524
|
-
}, {
|
|
525
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(computedLength.value, (_, i) => {
|
|
526
|
-
return openBlock(), createBlock(unref(PinInputInput_default), {
|
|
527
|
-
key: i,
|
|
528
|
-
index: i,
|
|
529
|
-
disabled: unref(props).disabled,
|
|
530
|
-
"as-child": ""
|
|
531
|
-
}, {
|
|
532
|
-
default: withCtx(() => [createVNode(BFormInput_default, {
|
|
533
|
-
class: "b-form-otp-field",
|
|
534
|
-
"aria-label": `${unref(props).ariaLabel || "Pin"} ${i + 1} of ${computedLength.value}`,
|
|
535
|
-
"aria-invalid": unref(props).ariaInvalid,
|
|
536
|
-
autofocus: unref(props).autofocus && i === 0,
|
|
537
|
-
disabled: unref(props).disabled,
|
|
538
|
-
form: unref(props).form,
|
|
539
|
-
plaintext: unref(props).plaintext,
|
|
540
|
-
readonly: unref(props).readonly,
|
|
541
|
-
size: unref(props).size,
|
|
542
|
-
state: unref(props).state
|
|
543
|
-
}, null, 8, [
|
|
544
|
-
"aria-label",
|
|
545
|
-
"aria-invalid",
|
|
546
|
-
"autofocus",
|
|
547
|
-
"disabled",
|
|
548
|
-
"form",
|
|
549
|
-
"plaintext",
|
|
550
|
-
"readonly",
|
|
551
|
-
"size",
|
|
552
|
-
"state"
|
|
553
|
-
])]),
|
|
554
|
-
_: 2
|
|
555
|
-
}, 1032, ["index", "disabled"]);
|
|
556
|
-
}), 128))]),
|
|
557
|
-
_: 1
|
|
558
|
-
}, 8, [
|
|
559
|
-
"id",
|
|
560
|
-
"modelValue",
|
|
561
|
-
"class",
|
|
562
|
-
"disabled",
|
|
563
|
-
"dir",
|
|
564
|
-
"mask",
|
|
565
|
-
"name",
|
|
566
|
-
"otp",
|
|
567
|
-
"placeholder",
|
|
568
|
-
"required",
|
|
569
|
-
"type"
|
|
570
|
-
]);
|
|
571
|
-
};
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
|
-
//#endregion
|
|
575
|
-
export { BFormOtp_default as t };
|
|
576
|
-
|
|
577
|
-
//# sourceMappingURL=BFormOtp-ClDACqXM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BFormOtp-ClDACqXM.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, 'form-otp')\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, 'form-otp')\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,kBAAk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