bootstrap-vue-next 1.2.3 → 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.
Files changed (189) hide show
  1. package/dist/{BAccordion-nQptHiXD.js → BAccordion-BfaVicrj.js} +2 -2
  2. package/dist/{BAccordion-nQptHiXD.js.map → BAccordion-BfaVicrj.js.map} +1 -1
  3. package/dist/{BAlert-Bl3TOay3.js → BAlert-Czy83dU3.js} +5 -5
  4. package/dist/{BAlert-Bl3TOay3.js.map → BAlert-Czy83dU3.js.map} +1 -1
  5. package/dist/{BApp-Bg5xEz8H.js → BApp-DZ9AITOm.js} +22 -3
  6. package/dist/BApp-DZ9AITOm.js.map +1 -0
  7. package/dist/BAutocomplete-Bh4Bp5AI.js +437 -0
  8. package/dist/BAutocomplete-Bh4Bp5AI.js.map +1 -0
  9. package/dist/{BAvatar-BsStQrBF.js → BAvatar-BJNeQ1fe.js} +2 -2
  10. package/dist/{BAvatar-BsStQrBF.js.map → BAvatar-BJNeQ1fe.js.map} +1 -1
  11. package/dist/{BButton-KZu5jczf.js → BButton-DlOQ5sem.js} +2 -2
  12. package/dist/{BButton-KZu5jczf.js.map → BButton-DlOQ5sem.js.map} +1 -1
  13. package/dist/{BCard-DELccMG-.js → BCard-Bc1wed-3.js} +2 -2
  14. package/dist/{BCard-DELccMG-.js.map → BCard-Bc1wed-3.js.map} +1 -1
  15. package/dist/{BCarousel-BV2EiQRM.js → BCarousel-B-WZR469.js} +4 -5
  16. package/dist/{BCarousel-BV2EiQRM.js.map → BCarousel-B-WZR469.js.map} +1 -1
  17. package/dist/{BCollapse-B2q9Ya2S.js → BCollapse-DCjKiTxo.js} +2 -2
  18. package/dist/{BCollapse-B2q9Ya2S.js.map → BCollapse-DCjKiTxo.js.map} +1 -1
  19. package/dist/BDateField-Oh-cU-4i.js +456 -0
  20. package/dist/BDateField-Oh-cU-4i.js.map +1 -0
  21. package/dist/BDatePicker-HNI11eCe.js +632 -0
  22. package/dist/BDatePicker-HNI11eCe.js.map +1 -0
  23. package/dist/{BDropdown-D4gLdtmX.js → BDropdown-04nGcMhm.js} +6 -7
  24. package/dist/{BDropdown-D4gLdtmX.js.map → BDropdown-04nGcMhm.js.map} +1 -1
  25. package/dist/{BFormCheckbox-BYNGQgr2.js → BFormCheckbox-zjr8OsNd.js} +2 -2
  26. package/dist/{BFormCheckbox-BYNGQgr2.js.map → BFormCheckbox-zjr8OsNd.js.map} +1 -1
  27. package/dist/{BFormFile-C2DnrbK7.js → BFormFile-D_s8tf1m.js} +2 -2
  28. package/dist/{BFormFile-C2DnrbK7.js.map → BFormFile-D_s8tf1m.js.map} +1 -1
  29. package/dist/{BFormInput-_AkAy6Wk.js → BFormInput-DnIBPLCx.js} +2 -2
  30. package/dist/{BFormInput-_AkAy6Wk.js.map → BFormInput-DnIBPLCx.js.map} +1 -1
  31. package/dist/BFormOtp-Dx2RxPAW.js +150 -0
  32. package/dist/BFormOtp-Dx2RxPAW.js.map +1 -0
  33. package/dist/{BFormRadio-DAddcnfE.js → BFormRadio-DUz60sBI.js} +2 -2
  34. package/dist/{BFormRadio-DAddcnfE.js.map → BFormRadio-DUz60sBI.js.map} +1 -1
  35. package/dist/{BFormRating-iKFgSFet.js → BFormRating-CtMmDgrF.js} +2 -2
  36. package/dist/{BFormRating-iKFgSFet.js.map → BFormRating-CtMmDgrF.js.map} +1 -1
  37. package/dist/{BFormSelect-CSS-_kul.js → BFormSelect-CeslPN3i.js} +2 -3
  38. package/dist/{BFormSelect-CSS-_kul.js.map → BFormSelect-CeslPN3i.js.map} +1 -1
  39. package/dist/{BFormSpinbutton-fkVMbQC3.js → BFormSpinbutton-BR9YTfYy.js} +2 -3
  40. package/dist/{BFormSpinbutton-fkVMbQC3.js.map → BFormSpinbutton-BR9YTfYy.js.map} +1 -1
  41. package/dist/{BFormTags-CUcyRTCK.js → BFormTags-6qQn0Vlv.js} +2 -3
  42. package/dist/{BFormTags-CUcyRTCK.js.map → BFormTags-6qQn0Vlv.js.map} +1 -1
  43. package/dist/{BFormTextarea-CBBlEcrV.js → BFormTextarea-DvLrtG08.js} +3 -3
  44. package/dist/{BFormTextarea-CBBlEcrV.js.map → BFormTextarea-DvLrtG08.js.map} +1 -1
  45. package/dist/{BImg-knz2UZQE.js → BImg-Dd8Pc1Ln.js} +2 -2
  46. package/dist/{BImg-knz2UZQE.js.map → BImg-Dd8Pc1Ln.js.map} +1 -1
  47. package/dist/{BModal-BjmeVZen.js → BModal-DOmTYI6F.js} +5 -6
  48. package/dist/{BModal-BjmeVZen.js.map → BModal-DOmTYI6F.js.map} +1 -1
  49. package/dist/{BNav-B2PlMEMD.js → BNav-D3XbyI1R.js} +2 -2
  50. package/dist/{BNav-B2PlMEMD.js.map → BNav-D3XbyI1R.js.map} +1 -1
  51. package/dist/{BOffcanvas-DfR32-ZP.js → BOffcanvas-DyPG7s8I.js} +5 -5
  52. package/dist/{BOffcanvas-DfR32-ZP.js.map → BOffcanvas-DyPG7s8I.js.map} +1 -1
  53. package/dist/{BPagination-CfrsVgDp.js → BPagination-DGvgWeYG.js} +3 -3
  54. package/dist/{BPagination-CfrsVgDp.js.map → BPagination-DGvgWeYG.js.map} +1 -1
  55. package/dist/{BPlaceholder-DI12zz0a.js → BPlaceholder-BrBmbfIg.js} +3 -3
  56. package/dist/{BPlaceholder-DI12zz0a.js.map → BPlaceholder-BrBmbfIg.js.map} +1 -1
  57. package/dist/{BProgress-BNxYppi-.js → BProgress-CXhe6hsN.js} +2 -2
  58. package/dist/{BProgress-BNxYppi-.js.map → BProgress-CXhe6hsN.js.map} +1 -1
  59. package/dist/{BTable-BZxX17YU.js → BTable-8jp3wPAI.js} +2 -2
  60. package/dist/{BTable-BZxX17YU.js.map → BTable-8jp3wPAI.js.map} +1 -1
  61. package/dist/{BTabs-Zp8CvCL_.js → BTabs-Cfe8HOGE.js} +2 -2
  62. package/dist/{BTabs-Zp8CvCL_.js.map → BTabs-Cfe8HOGE.js.map} +1 -1
  63. package/dist/BTimeField-vdultTwg.js +138 -0
  64. package/dist/BTimeField-vdultTwg.js.map +1 -0
  65. package/dist/{BToast-CqE2VMW2.js → BToast-vxfpFGe3.js} +5 -5
  66. package/dist/{BToast-CqE2VMW2.js.map → BToast-vxfpFGe3.js.map} +1 -1
  67. package/dist/{BTooltip-BHFBLXnr.js → BTooltip-CV5Ogidy.js} +5 -11
  68. package/dist/BTooltip-CV5Ogidy.js.map +1 -0
  69. package/dist/bootstrap-vue-next.mjs +36 -36
  70. package/dist/{classes-BEWWGbj5.js → classes-DCjKFM2E.js} +12 -2
  71. package/dist/classes-DCjKFM2E.js.map +1 -0
  72. package/dist/components/BTooltip/BTooltip.vue.d.mts +3 -3
  73. package/dist/components/BTooltip/BTooltip.vue.d.ts +3 -3
  74. package/dist/composables/usePopover/index.d.mts +9 -9
  75. package/dist/composables/usePopover/index.d.ts +9 -9
  76. package/dist/{floatingUi-Stb1SUvw.js → floatingUi-BhgR4GBJ.js} +10 -168
  77. package/dist/floatingUi-BhgR4GBJ.js.map +1 -0
  78. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  79. package/dist/src/components/BAccordion/index.mjs +1 -1
  80. package/dist/src/components/BAlert/index.mjs +1 -1
  81. package/dist/src/components/BApp/index.mjs +1 -1
  82. package/dist/src/components/BAutocomplete/index.mjs +1 -1
  83. package/dist/src/components/BAvatar/index.mjs +1 -1
  84. package/dist/src/components/BButton/index.mjs +1 -1
  85. package/dist/src/components/BCard/index.mjs +1 -1
  86. package/dist/src/components/BCarousel/index.mjs +1 -1
  87. package/dist/src/components/BCollapse/index.mjs +1 -1
  88. package/dist/src/components/BDateField/index.mjs +1 -1
  89. package/dist/src/components/BDatePicker/index.mjs +1 -1
  90. package/dist/src/components/BDropdown/index.mjs +1 -1
  91. package/dist/src/components/BFormCheckbox/index.mjs +1 -1
  92. package/dist/src/components/BFormFile/index.mjs +1 -1
  93. package/dist/src/components/BFormInput/index.mjs +1 -1
  94. package/dist/src/components/BFormOtp/index.mjs +1 -1
  95. package/dist/src/components/BFormRadio/index.mjs +1 -1
  96. package/dist/src/components/BFormRating/index.mjs +1 -1
  97. package/dist/src/components/BFormSelect/index.mjs +1 -1
  98. package/dist/src/components/BFormSpinbutton/index.mjs +1 -1
  99. package/dist/src/components/BFormTags/index.mjs +1 -1
  100. package/dist/src/components/BFormTextarea/index.mjs +1 -1
  101. package/dist/src/components/BImg/index.mjs +1 -1
  102. package/dist/src/components/BModal/index.mjs +1 -1
  103. package/dist/src/components/BNav/index.mjs +1 -1
  104. package/dist/src/components/BOffcanvas/index.mjs +1 -1
  105. package/dist/src/components/BPagination/index.mjs +1 -1
  106. package/dist/src/components/BPlaceholder/index.mjs +1 -1
  107. package/dist/src/components/BPopover/index.mjs +1 -1
  108. package/dist/src/components/BProgress/index.mjs +1 -1
  109. package/dist/src/components/BTable/index.mjs +1 -1
  110. package/dist/src/components/BTabs/index.mjs +1 -1
  111. package/dist/src/components/BTimeField/index.mjs +1 -1
  112. package/dist/src/components/BToast/index.mjs +1 -1
  113. package/dist/src/components/BTooltip/index.mjs +1 -1
  114. package/dist/src/components/index.mjs +36 -36
  115. package/dist/src/composables/index.mjs +1 -1
  116. package/dist/src/composables/orchestratorShared/index.mjs +145 -27
  117. package/dist/src/composables/orchestratorShared/index.mjs.map +1 -1
  118. package/dist/src/composables/useColorMode/index.mjs +1 -1
  119. package/dist/src/composables/useModal/index.mjs +1 -1
  120. package/dist/src/composables/usePopover/index.mjs +2 -2
  121. package/dist/src/composables/useScrollLock/index.mjs +1 -2
  122. package/dist/src/composables/useScrollLock/index.mjs.map +1 -1
  123. package/dist/src/composables/useScrollspy/index.mjs +1 -2
  124. package/dist/src/composables/useScrollspy/index.mjs.map +1 -1
  125. package/dist/src/composables/useToast/index.mjs +1 -1
  126. package/dist/src/directives/BPopover/index.mjs +2 -2
  127. package/dist/src/directives/BScrollspy/index.mjs +1 -1
  128. package/dist/src/directives/BToggle/index.mjs +1 -1
  129. package/dist/src/directives/BTooltip/index.mjs +2 -2
  130. package/dist/src/directives/index.mjs +1 -1
  131. package/dist/src/plugins/index.mjs +1 -1
  132. package/dist/src/resolvers/index.mjs +1 -1
  133. package/dist/src/types/index.mjs +1 -1
  134. package/dist/src/utils/index.mjs +2 -2
  135. package/dist/types/ComponentOrchestratorTypes.d.mts +8 -1
  136. package/dist/types/ComponentOrchestratorTypes.d.ts +8 -1
  137. package/dist/{useCountdownHover-BN8vJIQW.js → useCountdownHover-HZSJZkHq.js} +2 -2
  138. package/dist/{useCountdownHover-BN8vJIQW.js.map → useCountdownHover-HZSJZkHq.js.map} +1 -1
  139. package/dist/{useFormInput-C-iXRxog.js → useFormInput-CMtXFoM2.js} +2 -3
  140. package/dist/{useFormInput-C-iXRxog.js.map → useFormInput-CMtXFoM2.js.map} +1 -1
  141. package/dist/useSafeScrollLock-BT4KKhxB.js +89 -0
  142. package/dist/useSafeScrollLock-BT4KKhxB.js.map +1 -0
  143. package/dist/{useShowHide-B6RQbFDt.js → useShowHide-BLIZLD9E.js} +125 -56
  144. package/dist/useShowHide-BLIZLD9E.js.map +1 -0
  145. package/dist/utils/classes.d.mts +10 -0
  146. package/dist/utils/classes.d.ts +10 -0
  147. package/dist/{utils-CK56zzsO.js → utils-CvjliJBf.js} +2 -2
  148. package/dist/{utils-CK56zzsO.js.map → utils-CvjliJBf.js.map} +1 -1
  149. package/package.json +3 -23
  150. package/dist/BApp-Bg5xEz8H.js.map +0 -1
  151. package/dist/BAutocomplete-BFbbKtpz.js +0 -2490
  152. package/dist/BAutocomplete-BFbbKtpz.js.map +0 -1
  153. package/dist/BDateField-Bj-Jz7u4.js +0 -906
  154. package/dist/BDateField-Bj-Jz7u4.js.map +0 -1
  155. package/dist/BDatePicker-AVTYcVLy.js +0 -5210
  156. package/dist/BDatePicker-AVTYcVLy.js.map +0 -1
  157. package/dist/BFormOtp-ClDACqXM.js +0 -577
  158. package/dist/BFormOtp-ClDACqXM.js.map +0 -1
  159. package/dist/BTimeField-CbRGjaI6.js +0 -516
  160. package/dist/BTimeField-CbRGjaI6.js.map +0 -1
  161. package/dist/BTooltip-BHFBLXnr.js.map +0 -1
  162. package/dist/DateRangeFieldInput-Cbzjg8iF.js +0 -761
  163. package/dist/DateRangeFieldInput-Cbzjg8iF.js.map +0 -1
  164. package/dist/PopperContent-C9eeL6LH.js +0 -1726
  165. package/dist/PopperContent-C9eeL6LH.js.map +0 -1
  166. package/dist/VisuallyHidden-BYzyjJiY.js +0 -182
  167. package/dist/VisuallyHidden-BYzyjJiY.js.map +0 -1
  168. package/dist/VisuallyHiddenInput-CUrc8XXa.js +0 -180
  169. package/dist/VisuallyHiddenInput-CUrc8XXa.js.map +0 -1
  170. package/dist/classes-BEWWGbj5.js.map +0 -1
  171. package/dist/dist-9-XTMhb-.js +0 -1302
  172. package/dist/dist-9-XTMhb-.js.map +0 -1
  173. package/dist/dist-B-regXAP.js +0 -123
  174. package/dist/dist-B-regXAP.js.map +0 -1
  175. package/dist/dist-DKc2ivHS.js +0 -411
  176. package/dist/dist-DKc2ivHS.js.map +0 -1
  177. package/dist/floating-ui.dom-C7UZexJK.js +0 -1484
  178. package/dist/floating-ui.dom-C7UZexJK.js.map +0 -1
  179. package/dist/floatingUi-Stb1SUvw.js.map +0 -1
  180. package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
  181. package/dist/useDateField-CQZb799C.js +0 -3679
  182. package/dist/useDateField-CQZb799C.js.map +0 -1
  183. package/dist/useForwardExpose-DDvk7mir.js +0 -60
  184. package/dist/useForwardExpose-DDvk7mir.js.map +0 -1
  185. package/dist/useKbd-DRsaFU_f.js +0 -76
  186. package/dist/useKbd-DRsaFU_f.js.map +0 -1
  187. package/dist/useSafeScrollLock-PVgSASYu.js +0 -1326
  188. package/dist/useSafeScrollLock-PVgSASYu.js.map +0 -1
  189. package/dist/useShowHide-B6RQbFDt.js.map +0 -1
@@ -1,2490 +0,0 @@
1
- import { t as createEventHook } from "./dist-DKc2ivHS.js";
2
- import { S as useVModel, o as unrefElement } 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 { t as BCloseButton_default } from "./BCloseButton-B3-IdpNp.js";
6
- import { t as BButton_default } from "./BButton-KZu5jczf.js";
7
- import { a as useDirection, c as getActiveElement, i as Slot, l as createContext, n as usePrimitiveElement, o as injectConfigProviderContext, r as Primitive } from "./VisuallyHidden-BYzyjJiY.js";
8
- import { a as FocusScope_default, c as useId$2, d as useForwardProps, f as useFocusGuards, i as Teleport_default, l as useHideOthers, m as handleAndDispatchCustomEvent, n as PopperAnchor_default, o as DismissableLayer_default, p as useBodyScrollLock, r as PopperRoot_default, s as Presence_default, t as PopperContent_default, u as useForwardPropsEmits } from "./PopperContent-C9eeL6LH.js";
9
- import { t as useKbd } from "./useKbd-DRsaFU_f.js";
10
- import { a as refAutoReset, t as isClient } from "./dist-B-regXAP.js";
11
- import { n as useComposing, t as VisuallyHiddenInput_default } from "./VisuallyHiddenInput-CUrc8XXa.js";
12
- import { t as useForwardExpose } from "./useForwardExpose-DDvk7mir.js";
13
- import { t as BInputGroup_default } from "./BInputGroup-DdoeSICR.js";
14
- import { t as useAriaInvalid } from "./useAriaInvalid-CRUhkD2V.js";
15
- import { t as BFormInput_default } from "./BFormInput-_AkAy6Wk.js";
16
- import { t as BFormTag_default } from "./BFormTag-DGSUfz7A.js";
17
- import { t as useFormSelect } from "./useFormSelect-CwS8YuiQ.js";
18
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isRef, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toRefs, toValue, unref, useModel, useTemplateRef, watch, watchEffect, watchSyncEffect, withCtx, withKeys, withMemo, withModifiers } from "vue";
19
- //#region ../../node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/shared/ohash.D__AXeF1.mjs
20
- function serialize(o) {
21
- return typeof o == "string" ? `'${o}'` : new c().serialize(o);
22
- }
23
- var c = /*@__PURE__*/ function() {
24
- class o {
25
- #t = /* @__PURE__ */ new Map();
26
- compare(t, r) {
27
- const e = typeof t, n = typeof r;
28
- return e === "string" && n === "string" ? t.localeCompare(r) : e === "number" && n === "number" ? t - r : String.prototype.localeCompare.call(this.serialize(t, true), this.serialize(r, true));
29
- }
30
- serialize(t, r) {
31
- if (t === null) return "null";
32
- switch (typeof t) {
33
- case "string": return r ? t : `'${t}'`;
34
- case "bigint": return `${t}n`;
35
- case "object": return this.$object(t);
36
- case "function": return this.$function(t);
37
- }
38
- return String(t);
39
- }
40
- serializeObject(t) {
41
- const r = Object.prototype.toString.call(t);
42
- if (r !== "[object Object]") return this.serializeBuiltInType(r.length < 10 ? `unknown:${r}` : r.slice(8, -1), t);
43
- const e = t.constructor, n = e === Object || e === void 0 ? "" : e.name;
44
- if (n !== "" && globalThis[n] === e) return this.serializeBuiltInType(n, t);
45
- if (typeof t.toJSON == "function") {
46
- const i = t.toJSON();
47
- return n + (i !== null && typeof i == "object" ? this.$object(i) : `(${this.serialize(i)})`);
48
- }
49
- return this.serializeObjectEntries(n, Object.entries(t));
50
- }
51
- serializeBuiltInType(t, r) {
52
- const e = this["$" + t];
53
- if (e) return e.call(this, r);
54
- if (typeof r?.entries == "function") return this.serializeObjectEntries(t, r.entries());
55
- throw new Error(`Cannot serialize ${t}`);
56
- }
57
- serializeObjectEntries(t, r) {
58
- const e = Array.from(r).sort((i, a) => this.compare(i[0], a[0]));
59
- let n = `${t}{`;
60
- for (let i = 0; i < e.length; i++) {
61
- const [a, l] = e[i];
62
- n += `${this.serialize(a, true)}:${this.serialize(l)}`, i < e.length - 1 && (n += ",");
63
- }
64
- return n + "}";
65
- }
66
- $object(t) {
67
- let r = this.#t.get(t);
68
- return r === void 0 && (this.#t.set(t, `#${this.#t.size}`), r = this.serializeObject(t), this.#t.set(t, r)), r;
69
- }
70
- $function(t) {
71
- const r = Function.prototype.toString.call(t);
72
- return r.slice(-15) === "[native code] }" ? `${t.name || ""}()[native]` : `${t.name}(${t.length})${r.replace(/\s*\n\s*/g, "")}`;
73
- }
74
- $Array(t) {
75
- let r = "[";
76
- for (let e = 0; e < t.length; e++) r += this.serialize(t[e]), e < t.length - 1 && (r += ",");
77
- return r + "]";
78
- }
79
- $Date(t) {
80
- try {
81
- return `Date(${t.toISOString()})`;
82
- } catch {
83
- return "Date(null)";
84
- }
85
- }
86
- $ArrayBuffer(t) {
87
- return `ArrayBuffer[${new Uint8Array(t).join(",")}]`;
88
- }
89
- $Set(t) {
90
- return `Set${this.$Array(Array.from(t).sort((r, e) => this.compare(r, e)))}`;
91
- }
92
- $Map(t) {
93
- return this.serializeObjectEntries("Map", t.entries());
94
- }
95
- }
96
- for (const s of [
97
- "Error",
98
- "RegExp",
99
- "URL"
100
- ]) o.prototype["$" + s] = function(t) {
101
- return `${s}(${t})`;
102
- };
103
- for (const s of [
104
- "Int8Array",
105
- "Uint8Array",
106
- "Uint8ClampedArray",
107
- "Int16Array",
108
- "Uint16Array",
109
- "Int32Array",
110
- "Uint32Array",
111
- "Float32Array",
112
- "Float64Array"
113
- ]) o.prototype["$" + s] = function(t) {
114
- return `${s}[${t.join(",")}]`;
115
- };
116
- for (const s of ["BigInt64Array", "BigUint64Array"]) o.prototype["$" + s] = function(t) {
117
- return `${s}[${t.join("n,")}${t.length > 0 ? "n" : ""}]`;
118
- };
119
- return o;
120
- }();
121
- function isEqual(object1, object2) {
122
- if (object1 === object2) return true;
123
- if (serialize(object1) === serialize(object2)) return true;
124
- return false;
125
- }
126
- //#endregion
127
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/arrays.js
128
- /**
129
- * The function `findValuesBetween` takes an array and two values, then returns a subarray containing
130
- * elements between the first occurrence of the start value and the first occurrence of the end value
131
- * in the array.
132
- * @param {T[]} array - The `array` parameter is an array of values of type `T`.
133
- * @param {T} start - The `start` parameter is the value that marks the beginning of the range you want
134
- * to find in the array.
135
- * @param {T} end - The `end` parameter in the `findValuesBetween` function represents the end value
136
- * that you want to find in the array. This function will return a subarray of values that are between
137
- * the `start` and `end` values in the original array.
138
- * @returns The `findValuesBetween` function returns an array of values from the input array that are
139
- * between the `start` and `end` values (inclusive). If either the `start` or `end` values are not
140
- * found in the input array, an empty array is returned.
141
- */
142
- function findValuesBetween(array, start, end) {
143
- const startIndex = array.findIndex((i) => isEqual(i, start));
144
- const endIndex = array.findIndex((i) => isEqual(i, end));
145
- if (startIndex === -1 || endIndex === -1) return [];
146
- const [minIndex, maxIndex] = [startIndex, endIndex].sort((a, b) => a - b);
147
- return array.slice(minIndex, maxIndex + 1);
148
- }
149
- //#endregion
150
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useFilter.js
151
- /**
152
- * Provides locale-aware string filtering functions.
153
- * Uses `Intl.Collator` for comparison to ensure proper Unicode handling.
154
- *
155
- * @param options - Optional collator options to customize comparison behavior.
156
- * See [Intl.CollatorOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options) for details.
157
- * @returns An object with methods to check if a string starts with, ends with, or contains a substring.
158
- *
159
- * @example
160
- * const { startsWith, endsWith, contains } = useFilter();
161
- *
162
- * startsWith('hello', 'he'); // true
163
- * endsWith('hello', 'lo'); // true
164
- * contains('hello', 'ell'); // true
165
- */
166
- function useFilter(options) {
167
- const computedOptions = computed(() => unref(options));
168
- const collator = computed(() => new Intl.Collator("en", {
169
- usage: "search",
170
- ...computedOptions.value
171
- }));
172
- const startsWith = (string, substring) => {
173
- if (substring.length === 0) return true;
174
- string = string.normalize("NFC");
175
- substring = substring.normalize("NFC");
176
- return collator.value.compare(string.slice(0, substring.length), substring) === 0;
177
- };
178
- const endsWith = (string, substring) => {
179
- if (substring.length === 0) return true;
180
- string = string.normalize("NFC");
181
- substring = substring.normalize("NFC");
182
- return collator.value.compare(string.slice(-substring.length), substring) === 0;
183
- };
184
- const contains = (string, substring) => {
185
- if (substring.length === 0) return true;
186
- string = string.normalize("NFC");
187
- substring = substring.normalize("NFC");
188
- let scan = 0;
189
- const sliceLen = substring.length;
190
- for (; scan + sliceLen <= string.length; scan++) {
191
- const slice = string.slice(scan, scan + sliceLen);
192
- if (collator.value.compare(substring, slice) === 0) return true;
193
- }
194
- return false;
195
- };
196
- return {
197
- startsWith,
198
- endsWith,
199
- contains
200
- };
201
- }
202
- //#endregion
203
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useFormControl.js
204
- function useFormControl(el) {
205
- return computed(() => toValue(el) ? Boolean(unrefElement(el)?.closest("form")) : true);
206
- }
207
- //#endregion
208
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useTypeahead.js
209
- function useTypeahead(callback) {
210
- const search = refAutoReset("", 1e3);
211
- const handleTypeaheadSearch = (key, items) => {
212
- search.value = search.value + key;
213
- if (callback) callback(key);
214
- else {
215
- const currentItem = getActiveElement();
216
- const itemsWithTextValue = items.map((item) => ({
217
- ...item,
218
- textValue: item.value?.textValue ?? item.ref.textContent?.trim() ?? ""
219
- }));
220
- const currentMatch = itemsWithTextValue.find((item) => item.ref === currentItem);
221
- const nextMatch = getNextMatch(itemsWithTextValue.map((item) => item.textValue), search.value, currentMatch?.textValue);
222
- const newItem = itemsWithTextValue.find((item) => item.textValue === nextMatch);
223
- if (newItem) newItem.ref.focus();
224
- return newItem?.ref;
225
- }
226
- };
227
- const resetTypeahead = () => {
228
- search.value = "";
229
- };
230
- return {
231
- search,
232
- handleTypeaheadSearch,
233
- resetTypeahead
234
- };
235
- }
236
- /**
237
- * Wraps an array around itself at a given start index
238
- * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`
239
- */
240
- function wrapArray(array, startIndex) {
241
- return array.map((_, index) => array[(startIndex + index) % array.length]);
242
- }
243
- /**
244
- * This is the "meat" of the typeahead matching logic. It takes in all the values,
245
- * the search and the current match, and returns the next match (or `undefined`).
246
- *
247
- * We normalize the search because if a user has repeatedly pressed a character,
248
- * we want the exact same behavior as if we only had that one character
249
- * (ie. cycle through options starting with that character)
250
- *
251
- * We also reorder the values by wrapping the array around the current match.
252
- * This is so we always look forward from the current match, and picking the first
253
- * match will always be the correct one.
254
- *
255
- * Finally, if the normalized search is exactly one character, we exclude the
256
- * current match from the values because otherwise it would be the first to match always
257
- * and focus would never move. This is as opposed to the regular case, where we
258
- * don't want focus to move if the current match still matches.
259
- */
260
- function getNextMatch(values, search, currentMatch) {
261
- const normalizedSearch = search.length > 1 && Array.from(search).every((char) => char === search[0]) ? search[0] : search;
262
- const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
263
- let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));
264
- if (normalizedSearch.length === 1) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);
265
- const nextMatch = wrappedValues.find((value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()));
266
- return nextMatch !== currentMatch ? nextMatch : void 0;
267
- }
268
- //#endregion
269
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Collection/Collection.js
270
- var ITEM_DATA_ATTR = "data-reka-collection-item";
271
- function useCollection(options = {}) {
272
- const { key = "", isProvider = false } = options;
273
- const injectionKey = `${key}CollectionProvider`;
274
- let context;
275
- if (isProvider) {
276
- const itemMap = ref(/* @__PURE__ */ new Map());
277
- context = {
278
- collectionRef: ref(),
279
- itemMap
280
- };
281
- provide(injectionKey, context);
282
- } else context = inject(injectionKey);
283
- const getItems = (includeDisabledItem = false) => {
284
- const collectionNode = context.collectionRef.value;
285
- if (!collectionNode) return [];
286
- const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
287
- const orderMap = new Map(orderedNodes.map((node, index) => [node, index]));
288
- const orderedItems = Array.from(context.itemMap.value.values()).sort((a, b) => (orderMap.get(a.ref) ?? -1) - (orderMap.get(b.ref) ?? -1));
289
- if (includeDisabledItem) return orderedItems;
290
- else return orderedItems.filter((i) => i.ref.dataset.disabled !== "");
291
- };
292
- const CollectionSlot = /*#__PURE__*/ defineComponent({
293
- name: "CollectionSlot",
294
- inheritAttrs: false,
295
- setup(_, { slots, attrs }) {
296
- const { primitiveElement, currentElement } = usePrimitiveElement();
297
- watch(currentElement, () => {
298
- context.collectionRef.value = currentElement.value;
299
- });
300
- return () => h(Slot, {
301
- ref: primitiveElement,
302
- ...attrs
303
- }, slots);
304
- }
305
- });
306
- const CollectionItem = /*#__PURE__*/ defineComponent({
307
- name: "CollectionItem",
308
- inheritAttrs: false,
309
- props: { value: { validator: () => true } },
310
- setup(props, { slots, attrs }) {
311
- const { primitiveElement, currentElement } = usePrimitiveElement();
312
- watchEffect((cleanupFn) => {
313
- if (currentElement.value) {
314
- const key$1 = markRaw(currentElement.value);
315
- context.itemMap.value.set(key$1, {
316
- ref: currentElement.value,
317
- value: props.value
318
- });
319
- cleanupFn(() => context.itemMap.value.delete(key$1));
320
- }
321
- });
322
- return () => h(Slot, {
323
- ...attrs,
324
- [ITEM_DATA_ATTR]: "",
325
- ref: primitiveElement
326
- }, slots);
327
- }
328
- });
329
- return {
330
- getItems,
331
- reactiveItems: computed(() => Array.from(context.itemMap.value.values())),
332
- itemMapSize: computed(() => context.itemMap.value.size),
333
- CollectionSlot,
334
- CollectionItem
335
- };
336
- }
337
- //#endregion
338
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/utils.js
339
- function valueComparator(value, currentValue, comparator) {
340
- if (value === void 0) return false;
341
- else if (Array.isArray(value)) return value.some((val) => compare(val, currentValue, comparator));
342
- else return compare(value, currentValue, comparator);
343
- }
344
- function compare(value, currentValue, comparator) {
345
- if (value === void 0 || currentValue === void 0) return false;
346
- if (typeof value === "string") return value === currentValue;
347
- if (typeof comparator === "function") return comparator(value, currentValue);
348
- if (typeof comparator === "string") return value?.[comparator] === currentValue?.[comparator];
349
- return isEqual(value, currentValue);
350
- }
351
- //#endregion
352
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/RovingFocus/utils.js
353
- var MAP_KEY_TO_FOCUS_INTENT = {
354
- ArrowLeft: "prev",
355
- ArrowUp: "prev",
356
- ArrowRight: "next",
357
- ArrowDown: "next",
358
- PageUp: "first",
359
- Home: "first",
360
- PageDown: "last",
361
- End: "last"
362
- };
363
- function getDirectionAwareKey(key, dir) {
364
- if (dir !== "rtl") return key;
365
- return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
366
- }
367
- function getFocusIntent(event, orientation, dir) {
368
- const key = getDirectionAwareKey(event.key, dir);
369
- if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
370
- if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
371
- return MAP_KEY_TO_FOCUS_INTENT[key];
372
- }
373
- //#endregion
374
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxRoot.js
375
- var [injectListboxRootContext, provideListboxRootContext] = /*#__PURE__*/ createContext("ListboxRoot");
376
- var ListboxRoot_default = /* @__PURE__ */ defineComponent({
377
- __name: "ListboxRoot",
378
- props: {
379
- modelValue: {
380
- type: null,
381
- required: false
382
- },
383
- defaultValue: {
384
- type: null,
385
- required: false
386
- },
387
- multiple: {
388
- type: Boolean,
389
- required: false
390
- },
391
- orientation: {
392
- type: String,
393
- required: false,
394
- default: "vertical"
395
- },
396
- dir: {
397
- type: String,
398
- required: false
399
- },
400
- disabled: {
401
- type: Boolean,
402
- required: false
403
- },
404
- selectionBehavior: {
405
- type: String,
406
- required: false,
407
- default: "toggle"
408
- },
409
- highlightOnHover: {
410
- type: Boolean,
411
- required: false
412
- },
413
- by: {
414
- type: [String, Function],
415
- required: false
416
- },
417
- asChild: {
418
- type: Boolean,
419
- required: false
420
- },
421
- as: {
422
- type: null,
423
- required: false
424
- },
425
- name: {
426
- type: String,
427
- required: false
428
- },
429
- required: {
430
- type: Boolean,
431
- required: false
432
- }
433
- },
434
- emits: [
435
- "update:modelValue",
436
- "highlight",
437
- "entryFocus",
438
- "leave"
439
- ],
440
- setup(__props, { expose: __expose, emit: __emit }) {
441
- const props = __props;
442
- const emits = __emit;
443
- const { multiple, highlightOnHover, orientation, disabled, selectionBehavior, dir: propDir } = toRefs(props);
444
- const { getItems } = useCollection({ isProvider: true });
445
- const { handleTypeaheadSearch } = useTypeahead();
446
- const { primitiveElement, currentElement } = usePrimitiveElement();
447
- const kbd = useKbd();
448
- const dir = useDirection(propDir);
449
- const isFormControl = useFormControl(currentElement);
450
- const firstValue = ref();
451
- const isUserAction = ref(false);
452
- const focusable = ref(true);
453
- const modelValue = useVModel(props, "modelValue", emits, {
454
- defaultValue: props.defaultValue ?? (multiple.value ? [] : void 0),
455
- passive: props.modelValue === void 0,
456
- deep: true
457
- });
458
- function onValueChange(val) {
459
- isUserAction.value = true;
460
- if (props.multiple) {
461
- const modelArray = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
462
- const index = modelArray.findIndex((i) => compare(i, val, props.by));
463
- if (props.selectionBehavior === "toggle") {
464
- index === -1 ? modelArray.push(val) : modelArray.splice(index, 1);
465
- modelValue.value = modelArray;
466
- } else {
467
- modelValue.value = [val];
468
- firstValue.value = val;
469
- }
470
- } else if (props.selectionBehavior === "toggle") if (compare(modelValue.value, val, props.by)) modelValue.value = void 0;
471
- else modelValue.value = val;
472
- else modelValue.value = val;
473
- setTimeout(() => {
474
- isUserAction.value = false;
475
- }, 1);
476
- }
477
- const highlightedElement = ref(null);
478
- const previousElement = ref(null);
479
- const isVirtual = ref(false);
480
- const isComposing = ref(false);
481
- const virtualFocusHook = createEventHook();
482
- const virtualKeydownHook = createEventHook();
483
- const virtualHighlightHook = createEventHook();
484
- function getCollectionItem() {
485
- return getItems().map((i) => i.ref).filter((i) => i.dataset.disabled !== "");
486
- }
487
- function changeHighlight(el, scrollIntoView = true, focus) {
488
- if (!el) return;
489
- highlightedElement.value = el;
490
- if (focus ?? focusable.value) highlightedElement.value.focus();
491
- if (scrollIntoView) highlightedElement.value.scrollIntoView({ block: "nearest" });
492
- const highlightedItem = getItems().find((i) => i.ref === el);
493
- emits("highlight", highlightedItem);
494
- }
495
- function highlightItem(value) {
496
- if (isVirtual.value) virtualHighlightHook.trigger(value);
497
- else {
498
- const item = getItems().find((i) => compare(i.value, value, props.by));
499
- if (item) {
500
- highlightedElement.value = item.ref;
501
- changeHighlight(item.ref);
502
- }
503
- }
504
- }
505
- function onKeydownEnter(event) {
506
- if (highlightedElement.value && highlightedElement.value.isConnected) {
507
- if (event.ctrlKey || event.metaKey || event.altKey) return;
508
- event.preventDefault();
509
- event.stopPropagation();
510
- if (!isComposing.value) highlightedElement.value.click();
511
- }
512
- }
513
- function onKeydownTypeAhead(event) {
514
- if (!focusable.value) return;
515
- isUserAction.value = true;
516
- if (isVirtual.value) virtualKeydownHook.trigger(event);
517
- else {
518
- const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
519
- if (isMetaKey && event.key === "a" && multiple.value) {
520
- const collection = getItems();
521
- const values = collection.map((i) => i.value);
522
- modelValue.value = [...values];
523
- event.preventDefault();
524
- const lastItem = collection.at(-1);
525
- if (lastItem) changeHighlight(lastItem.ref);
526
- } else if (!isMetaKey) {
527
- const el = handleTypeaheadSearch(event.key, getItems());
528
- if (el) changeHighlight(el);
529
- }
530
- }
531
- setTimeout(() => {
532
- isUserAction.value = false;
533
- }, 1);
534
- }
535
- function onCompositionStart() {
536
- isComposing.value = true;
537
- }
538
- function onCompositionEnd() {
539
- nextTick(() => {
540
- isComposing.value = false;
541
- });
542
- }
543
- function highlightFirstItem() {
544
- nextTick(() => {
545
- onKeydownNavigation(new KeyboardEvent("keydown", { key: "PageUp" }));
546
- });
547
- }
548
- function onLeave(event) {
549
- const el = highlightedElement.value;
550
- if (el?.isConnected) previousElement.value = el;
551
- highlightedElement.value = null;
552
- emits("leave", event);
553
- }
554
- function onEnter(event) {
555
- const entryFocusEvent = new CustomEvent("listbox.entryFocus", {
556
- bubbles: false,
557
- cancelable: true
558
- });
559
- event.currentTarget?.dispatchEvent(entryFocusEvent);
560
- emits("entryFocus", entryFocusEvent);
561
- if (entryFocusEvent.defaultPrevented) return;
562
- if (previousElement.value) changeHighlight(previousElement.value);
563
- else {
564
- const el = getCollectionItem()?.[0];
565
- changeHighlight(el);
566
- }
567
- }
568
- function onKeydownNavigation(event) {
569
- const intent = getFocusIntent(event, orientation.value, dir.value);
570
- if (!intent) return;
571
- let collection = getCollectionItem();
572
- if (highlightedElement.value) {
573
- if (intent === "last") collection.reverse();
574
- else if (intent === "prev" || intent === "next") {
575
- if (intent === "prev") collection.reverse();
576
- const currentIndex = collection.indexOf(highlightedElement.value);
577
- collection = collection.slice(currentIndex + 1);
578
- }
579
- handleMultipleReplace(event, collection[0]);
580
- }
581
- if (collection.length) {
582
- const index = !highlightedElement.value && intent === "prev" ? collection.length - 1 : 0;
583
- changeHighlight(collection[index]);
584
- }
585
- if (isVirtual.value) return virtualKeydownHook.trigger(event);
586
- }
587
- function handleMultipleReplace(event, targetEl) {
588
- if (isVirtual.value || props.selectionBehavior !== "replace" || !multiple.value || !Array.isArray(modelValue.value)) return;
589
- if ((event.altKey || event.ctrlKey || event.metaKey) && !event.shiftKey) return;
590
- if (event.shiftKey) {
591
- const collection = getItems().filter((i) => i.ref.dataset.disabled !== "");
592
- let lastValue = collection.find((i) => i.ref === targetEl)?.value;
593
- if (event.key === kbd.END) lastValue = collection.at(-1)?.value;
594
- else if (event.key === kbd.HOME) lastValue = collection[0]?.value;
595
- if (!lastValue || !firstValue.value) return;
596
- const values = findValuesBetween(collection.map((i) => i.value), firstValue.value, lastValue);
597
- modelValue.value = values;
598
- }
599
- }
600
- async function highlightSelected(event, scroll = true) {
601
- if (!isClient) return;
602
- await nextTick();
603
- if (isVirtual.value) virtualFocusHook.trigger({
604
- event,
605
- scroll
606
- });
607
- else {
608
- const collection = getCollectionItem();
609
- const item = collection.find((i) => i.dataset.state === "checked");
610
- const focus = scroll ? void 0 : false;
611
- if (item) changeHighlight(item, scroll, focus);
612
- else if (collection.length) changeHighlight(collection[0], scroll, focus);
613
- }
614
- }
615
- let hasHighlightedOnMount = false;
616
- watch(modelValue, () => {
617
- if (!isUserAction.value) {
618
- const scroll = hasHighlightedOnMount;
619
- hasHighlightedOnMount = true;
620
- nextTick(() => {
621
- highlightSelected(void 0, scroll);
622
- });
623
- }
624
- }, {
625
- immediate: true,
626
- deep: true
627
- });
628
- __expose({
629
- highlightedElement,
630
- highlightItem,
631
- highlightFirstItem,
632
- highlightSelected,
633
- getItems
634
- });
635
- provideListboxRootContext({
636
- modelValue,
637
- onValueChange,
638
- multiple,
639
- orientation,
640
- dir,
641
- disabled,
642
- highlightOnHover,
643
- highlightedElement,
644
- isVirtual,
645
- virtualFocusHook,
646
- virtualKeydownHook,
647
- virtualHighlightHook,
648
- by: props.by,
649
- firstValue,
650
- selectionBehavior,
651
- focusable,
652
- onLeave,
653
- onEnter,
654
- changeHighlight,
655
- onKeydownEnter,
656
- onKeydownNavigation,
657
- onKeydownTypeAhead,
658
- onCompositionStart,
659
- onCompositionEnd,
660
- highlightFirstItem
661
- });
662
- return (_ctx, _cache) => {
663
- return openBlock(), createBlock(unref(Primitive), {
664
- ref_key: "primitiveElement",
665
- ref: primitiveElement,
666
- as: _ctx.as,
667
- "as-child": _ctx.asChild,
668
- dir: unref(dir),
669
- "data-disabled": unref(disabled) ? "" : void 0,
670
- onPointerleave: onLeave,
671
- onFocusout: _cache[0] || (_cache[0] = async (event) => {
672
- const target = event.relatedTarget || event.target;
673
- await nextTick();
674
- if (highlightedElement.value && unref(currentElement) && !unref(currentElement).contains(target)) onLeave(event);
675
- })
676
- }, {
677
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", { modelValue: unref(modelValue) }), unref(isFormControl) && _ctx.name ? (openBlock(), createBlock(unref(VisuallyHiddenInput_default), {
678
- key: 0,
679
- name: _ctx.name,
680
- value: unref(modelValue),
681
- disabled: unref(disabled),
682
- required: _ctx.required
683
- }, null, 8, [
684
- "name",
685
- "value",
686
- "disabled",
687
- "required"
688
- ])) : createCommentVNode("v-if", true)]),
689
- _: 3
690
- }, 8, [
691
- "as",
692
- "as-child",
693
- "dir",
694
- "data-disabled"
695
- ]);
696
- };
697
- }
698
- });
699
- //#endregion
700
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxContent.js
701
- var ListboxContent_default = /* @__PURE__ */ defineComponent({
702
- __name: "ListboxContent",
703
- props: {
704
- asChild: {
705
- type: Boolean,
706
- required: false
707
- },
708
- as: {
709
- type: null,
710
- required: false
711
- }
712
- },
713
- setup(__props) {
714
- const { CollectionSlot } = useCollection();
715
- const rootContext = injectListboxRootContext();
716
- const isClickFocus = refAutoReset(false, 10);
717
- return (_ctx, _cache) => {
718
- return openBlock(), createBlock(unref(CollectionSlot), null, {
719
- default: withCtx(() => [createVNode(unref(Primitive), {
720
- role: "listbox",
721
- as: _ctx.as,
722
- "as-child": _ctx.asChild,
723
- tabindex: unref(rootContext).focusable.value ? unref(rootContext).highlightedElement.value ? "-1" : "0" : "-1",
724
- "aria-orientation": unref(rootContext).orientation.value,
725
- "aria-multiselectable": !!unref(rootContext).multiple.value,
726
- "data-orientation": unref(rootContext).orientation.value,
727
- onMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => isClickFocus.value = true, ["left"])),
728
- onFocus: _cache[1] || (_cache[1] = (ev) => {
729
- if (unref(isClickFocus)) return;
730
- unref(rootContext).onEnter(ev);
731
- }),
732
- onKeydown: [
733
- _cache[2] || (_cache[2] = withKeys((event) => {
734
- if (unref(rootContext).orientation.value === "vertical" && (event.key === "ArrowLeft" || event.key === "ArrowRight") || unref(rootContext).orientation.value === "horizontal" && (event.key === "ArrowUp" || event.key === "ArrowDown")) return;
735
- event.preventDefault();
736
- unref(rootContext).focusable.value && unref(rootContext).onKeydownNavigation(event);
737
- }, [
738
- "down",
739
- "up",
740
- "left",
741
- "right",
742
- "home",
743
- "end"
744
- ])),
745
- withKeys(unref(rootContext).onKeydownEnter, ["enter"]),
746
- unref(rootContext).onKeydownTypeAhead
747
- ]
748
- }, {
749
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
750
- _: 3
751
- }, 8, [
752
- "as",
753
- "as-child",
754
- "tabindex",
755
- "aria-orientation",
756
- "aria-multiselectable",
757
- "data-orientation",
758
- "onKeydown"
759
- ])]),
760
- _: 3
761
- });
762
- };
763
- }
764
- });
765
- //#endregion
766
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxFilter.js
767
- var ListboxFilter_default = /* @__PURE__ */ defineComponent({
768
- __name: "ListboxFilter",
769
- props: {
770
- modelValue: {
771
- type: String,
772
- required: false
773
- },
774
- autoFocus: {
775
- type: Boolean,
776
- required: false
777
- },
778
- disabled: {
779
- type: Boolean,
780
- required: false
781
- },
782
- asChild: {
783
- type: Boolean,
784
- required: false
785
- },
786
- as: {
787
- type: null,
788
- required: false,
789
- default: "input"
790
- }
791
- },
792
- emits: ["update:modelValue"],
793
- setup(__props, { emit: __emit }) {
794
- const props = __props;
795
- const modelValue = useVModel(props, "modelValue", __emit, {
796
- defaultValue: "",
797
- passive: props.modelValue === void 0
798
- });
799
- const rootContext = injectListboxRootContext();
800
- const { primitiveElement, currentElement } = usePrimitiveElement();
801
- const disabled = computed(() => props.disabled || rootContext.disabled.value || false);
802
- const activedescendant = ref();
803
- watchSyncEffect(() => activedescendant.value = rootContext.highlightedElement.value?.id);
804
- onMounted(() => {
805
- rootContext.focusable.value = false;
806
- setTimeout(() => {
807
- if (props.autoFocus) currentElement.value?.focus();
808
- }, 1);
809
- });
810
- onUnmounted(() => {
811
- rootContext.focusable.value = true;
812
- });
813
- const { isComposing, shouldDeferInput, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposing((event) => {
814
- modelValue.value = event.target.value;
815
- rootContext.onCompositionEnd();
816
- rootContext.highlightFirstItem();
817
- });
818
- function onCompositionStart() {
819
- rootContext.onCompositionStart();
820
- handleCompositionStart();
821
- }
822
- function handleInput(event) {
823
- if (shouldDeferInput.value) return;
824
- modelValue.value = event.target.value;
825
- rootContext.highlightFirstItem();
826
- }
827
- function handleKeydownNavigation(event) {
828
- if (isComposing.value) return;
829
- event.preventDefault();
830
- rootContext.onKeydownNavigation(event);
831
- }
832
- function handleKeydownEnter(event) {
833
- if (isComposing.value) return;
834
- rootContext.onKeydownEnter(event);
835
- }
836
- return (_ctx, _cache) => {
837
- return openBlock(), createBlock(unref(Primitive), {
838
- ref_key: "primitiveElement",
839
- ref: primitiveElement,
840
- as: _ctx.as,
841
- "as-child": _ctx.asChild,
842
- value: unref(modelValue),
843
- disabled: disabled.value ? "" : void 0,
844
- "data-disabled": disabled.value ? "" : void 0,
845
- "aria-disabled": disabled.value ?? void 0,
846
- "aria-activedescendant": activedescendant.value,
847
- type: "text",
848
- onKeydown: [withKeys(handleKeydownNavigation, [
849
- "down",
850
- "up",
851
- "home",
852
- "end"
853
- ]), withKeys(handleKeydownEnter, ["enter"])],
854
- onInput: handleInput,
855
- onCompositionstart: onCompositionStart,
856
- onCompositionupdate: unref(handleCompositionUpdate),
857
- onCompositionend: unref(handleCompositionEnd)
858
- }, {
859
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", { modelValue: unref(modelValue) })]),
860
- _: 3
861
- }, 8, [
862
- "as",
863
- "as-child",
864
- "value",
865
- "disabled",
866
- "data-disabled",
867
- "aria-disabled",
868
- "aria-activedescendant",
869
- "onCompositionupdate",
870
- "onCompositionend"
871
- ]);
872
- };
873
- }
874
- });
875
- //#endregion
876
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxItem.js
877
- var LISTBOX_SELECT = "listbox.select";
878
- var [injectListboxItemContext, provideListboxItemContext] = /*#__PURE__*/ createContext("ListboxItem");
879
- var ListboxItem_default = /* @__PURE__ */ defineComponent({
880
- __name: "ListboxItem",
881
- props: {
882
- value: {
883
- type: null,
884
- required: true
885
- },
886
- disabled: {
887
- type: Boolean,
888
- required: false
889
- },
890
- asChild: {
891
- type: Boolean,
892
- required: false
893
- },
894
- as: {
895
- type: null,
896
- required: false,
897
- default: "div"
898
- }
899
- },
900
- emits: ["select"],
901
- setup(__props, { emit: __emit }) {
902
- const props = __props;
903
- const emits = __emit;
904
- const id = useId$2(void 0, "reka-listbox-item");
905
- const { CollectionItem } = useCollection();
906
- const { forwardRef, currentElement } = useForwardExpose();
907
- const rootContext = injectListboxRootContext();
908
- const isHighlighted = computed(() => currentElement.value != null && currentElement.value === rootContext.highlightedElement.value);
909
- const isSelected = computed(() => valueComparator(rootContext.modelValue.value, props.value, rootContext.by));
910
- const disabled = computed(() => rootContext.disabled.value || props.disabled);
911
- async function handleSelect(ev) {
912
- emits("select", ev);
913
- if (ev?.defaultPrevented) return;
914
- if (!disabled.value && ev) {
915
- rootContext.onValueChange(props.value);
916
- rootContext.changeHighlight(currentElement.value);
917
- }
918
- }
919
- function handleSelectCustomEvent(ev) {
920
- const eventDetail = {
921
- originalEvent: ev,
922
- value: props.value
923
- };
924
- handleAndDispatchCustomEvent(LISTBOX_SELECT, handleSelect, eventDetail);
925
- }
926
- provideListboxItemContext({ isSelected });
927
- return (_ctx, _cache) => {
928
- return openBlock(), createBlock(unref(CollectionItem), { value: _ctx.value }, {
929
- default: withCtx(() => [withMemo([
930
- isHighlighted.value,
931
- isSelected.value,
932
- disabled.value,
933
- unref(rootContext).focusable.value
934
- ], () => createVNode(unref(Primitive), mergeProps({ id: unref(id) }, _ctx.$attrs, {
935
- ref: unref(forwardRef),
936
- role: "option",
937
- tabindex: unref(rootContext).focusable.value ? isHighlighted.value ? "0" : "-1" : -1,
938
- "aria-selected": isSelected.value,
939
- as: _ctx.as,
940
- "as-child": _ctx.asChild,
941
- disabled: disabled.value ? "" : void 0,
942
- "data-disabled": disabled.value ? "" : void 0,
943
- "data-highlighted": isHighlighted.value ? "" : void 0,
944
- "data-state": isSelected.value ? "checked" : "unchecked",
945
- onClick: handleSelectCustomEvent,
946
- onKeydown: withKeys(withModifiers(handleSelectCustomEvent, ["prevent"]), ["space"]),
947
- onPointermove: _cache[0] || (_cache[0] = () => {
948
- if (unref(rootContext).highlightedElement.value === unref(currentElement)) return;
949
- if (unref(rootContext).highlightOnHover.value) unref(rootContext).changeHighlight(unref(currentElement), false, false);
950
- })
951
- }), {
952
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
953
- _: 3
954
- }, 16, [
955
- "id",
956
- "tabindex",
957
- "aria-selected",
958
- "as",
959
- "as-child",
960
- "disabled",
961
- "data-disabled",
962
- "data-highlighted",
963
- "data-state",
964
- "onKeydown"
965
- ]), _cache, 1)]),
966
- _: 3
967
- }, 8, ["value"]);
968
- };
969
- }
970
- });
971
- //#endregion
972
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Listbox/ListboxItemIndicator.js
973
- var ListboxItemIndicator_default = /* @__PURE__ */ defineComponent({
974
- __name: "ListboxItemIndicator",
975
- props: {
976
- asChild: {
977
- type: Boolean,
978
- required: false
979
- },
980
- as: {
981
- type: null,
982
- required: false,
983
- default: "span"
984
- }
985
- },
986
- setup(__props) {
987
- const props = __props;
988
- useForwardExpose();
989
- const itemContext = injectListboxItemContext();
990
- return (_ctx, _cache) => {
991
- return unref(itemContext).isSelected.value ? (openBlock(), createBlock(unref(Primitive), mergeProps({
992
- key: 0,
993
- "aria-hidden": "true"
994
- }, props), {
995
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
996
- _: 3
997
- }, 16)) : createCommentVNode("v-if", true);
998
- };
999
- }
1000
- });
1001
- //#endregion
1002
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxRoot.js
1003
- var [injectComboboxRootContext, provideComboboxRootContext] = /*#__PURE__*/ createContext("ComboboxRoot");
1004
- var ComboboxRoot_default = /* @__PURE__ */ defineComponent({
1005
- __name: "ComboboxRoot",
1006
- props: {
1007
- open: {
1008
- type: Boolean,
1009
- required: false,
1010
- default: void 0
1011
- },
1012
- defaultOpen: {
1013
- type: Boolean,
1014
- required: false
1015
- },
1016
- resetSearchTermOnBlur: {
1017
- type: Boolean,
1018
- required: false,
1019
- default: true
1020
- },
1021
- resetSearchTermOnSelect: {
1022
- type: Boolean,
1023
- required: false,
1024
- default: true
1025
- },
1026
- openOnFocus: {
1027
- type: Boolean,
1028
- required: false,
1029
- default: false
1030
- },
1031
- openOnClick: {
1032
- type: Boolean,
1033
- required: false,
1034
- default: false
1035
- },
1036
- ignoreFilter: {
1037
- type: Boolean,
1038
- required: false
1039
- },
1040
- resetModelValueOnClear: {
1041
- type: Boolean,
1042
- required: false,
1043
- default: false
1044
- },
1045
- modelValue: {
1046
- type: null,
1047
- required: false
1048
- },
1049
- defaultValue: {
1050
- type: null,
1051
- required: false
1052
- },
1053
- multiple: {
1054
- type: Boolean,
1055
- required: false
1056
- },
1057
- dir: {
1058
- type: String,
1059
- required: false
1060
- },
1061
- disabled: {
1062
- type: Boolean,
1063
- required: false
1064
- },
1065
- highlightOnHover: {
1066
- type: Boolean,
1067
- required: false,
1068
- default: true
1069
- },
1070
- by: {
1071
- type: [String, Function],
1072
- required: false
1073
- },
1074
- asChild: {
1075
- type: Boolean,
1076
- required: false
1077
- },
1078
- as: {
1079
- type: null,
1080
- required: false
1081
- },
1082
- name: {
1083
- type: String,
1084
- required: false
1085
- },
1086
- required: {
1087
- type: Boolean,
1088
- required: false
1089
- }
1090
- },
1091
- emits: [
1092
- "update:modelValue",
1093
- "highlight",
1094
- "update:open"
1095
- ],
1096
- setup(__props, { expose: __expose, emit: __emit }) {
1097
- const props = __props;
1098
- const emits = __emit;
1099
- const { primitiveElement, currentElement: parentElement } = usePrimitiveElement();
1100
- const { multiple, disabled, ignoreFilter, resetSearchTermOnSelect, openOnFocus, openOnClick, dir: propDir, resetModelValueOnClear, highlightOnHover } = toRefs(props);
1101
- const dir = useDirection(propDir);
1102
- const modelValue = useVModel(props, "modelValue", emits, {
1103
- defaultValue: props.defaultValue ?? (multiple.value ? [] : void 0),
1104
- passive: props.modelValue === void 0,
1105
- deep: true
1106
- });
1107
- const open = useVModel(props, "open", emits, {
1108
- defaultValue: props.defaultOpen,
1109
- passive: props.open === void 0
1110
- });
1111
- async function onOpenChange(val) {
1112
- open.value = val;
1113
- filterSearch.value = "";
1114
- if (val) {
1115
- await nextTick();
1116
- primitiveElement.value?.highlightSelected();
1117
- isUserInputted.value = true;
1118
- inputElement.value?.focus();
1119
- } else {
1120
- isUserInputted.value = false;
1121
- setTimeout(() => {
1122
- if (!val && props.resetSearchTermOnBlur) resetSearchTerm.trigger();
1123
- }, 1);
1124
- }
1125
- }
1126
- const resetSearchTerm = createEventHook();
1127
- const isUserInputted = ref(false);
1128
- const isVirtual = ref(false);
1129
- const inputElement = ref();
1130
- const triggerElement = ref();
1131
- const highlightedElement = computed(() => primitiveElement.value?.highlightedElement ?? void 0);
1132
- const allItems = ref(/* @__PURE__ */ new Map());
1133
- const allGroups = ref(/* @__PURE__ */ new Map());
1134
- const { contains } = useFilter({ sensitivity: "base" });
1135
- const filterSearch = ref("");
1136
- const filterState = computed((oldValue) => {
1137
- if (!filterSearch.value || props.ignoreFilter || isVirtual.value) return {
1138
- count: allItems.value.size,
1139
- items: oldValue?.items ?? /* @__PURE__ */ new Map(),
1140
- groups: oldValue?.groups ?? new Set(allGroups.value.keys())
1141
- };
1142
- let itemCount = 0;
1143
- const filteredItems = /* @__PURE__ */ new Map();
1144
- const filteredGroups = /* @__PURE__ */ new Set();
1145
- for (const [id, value] of allItems.value) {
1146
- const score = contains(value, filterSearch.value);
1147
- filteredItems.set(id, score ? 1 : 0);
1148
- if (score) itemCount++;
1149
- }
1150
- for (const [groupId, group] of allGroups.value) for (const itemId of group) if (filteredItems.get(itemId) > 0) {
1151
- filteredGroups.add(groupId);
1152
- break;
1153
- }
1154
- return {
1155
- count: itemCount,
1156
- items: filteredItems,
1157
- groups: filteredGroups
1158
- };
1159
- });
1160
- const inst = getCurrentInstance();
1161
- onMounted(() => {
1162
- if (inst?.exposed) {
1163
- inst.exposed.highlightItem = primitiveElement.value?.highlightItem;
1164
- inst.exposed.highlightFirstItem = primitiveElement.value?.highlightFirstItem;
1165
- inst.exposed.highlightSelected = primitiveElement.value?.highlightSelected;
1166
- }
1167
- });
1168
- __expose({
1169
- filtered: filterState,
1170
- highlightedElement,
1171
- highlightItem: primitiveElement.value?.highlightItem,
1172
- highlightFirstItem: primitiveElement.value?.highlightFirstItem,
1173
- highlightSelected: primitiveElement.value?.highlightSelected
1174
- });
1175
- provideComboboxRootContext({
1176
- modelValue,
1177
- multiple,
1178
- disabled,
1179
- open,
1180
- onOpenChange,
1181
- contentId: "",
1182
- isUserInputted,
1183
- isVirtual,
1184
- inputElement,
1185
- highlightedElement,
1186
- onInputElementChange: (val) => inputElement.value = val,
1187
- triggerElement,
1188
- onTriggerElementChange: (val) => triggerElement.value = val,
1189
- parentElement,
1190
- resetSearchTermOnSelect,
1191
- onResetSearchTerm: resetSearchTerm.on,
1192
- allItems,
1193
- allGroups,
1194
- filterSearch,
1195
- filterState,
1196
- ignoreFilter,
1197
- openOnFocus,
1198
- openOnClick,
1199
- resetModelValueOnClear
1200
- });
1201
- return (_ctx, _cache) => {
1202
- return openBlock(), createBlock(unref(PopperRoot_default), null, {
1203
- default: withCtx(() => [createVNode(unref(ListboxRoot_default), mergeProps({
1204
- ref_key: "primitiveElement",
1205
- ref: primitiveElement
1206
- }, _ctx.$attrs, {
1207
- modelValue: unref(modelValue),
1208
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
1209
- style: { pointerEvents: unref(open) ? "auto" : void 0 },
1210
- as: _ctx.as,
1211
- "as-child": _ctx.asChild,
1212
- dir: unref(dir),
1213
- multiple: unref(multiple),
1214
- name: _ctx.name,
1215
- required: _ctx.required,
1216
- disabled: unref(disabled),
1217
- "highlight-on-hover": unref(highlightOnHover),
1218
- by: props.by,
1219
- onHighlight: _cache[1] || (_cache[1] = ($event) => emits("highlight", $event))
1220
- }), {
1221
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", {
1222
- open: unref(open),
1223
- modelValue: unref(modelValue)
1224
- })]),
1225
- _: 3
1226
- }, 16, [
1227
- "modelValue",
1228
- "style",
1229
- "as",
1230
- "as-child",
1231
- "dir",
1232
- "multiple",
1233
- "name",
1234
- "required",
1235
- "disabled",
1236
- "highlight-on-hover",
1237
- "by"
1238
- ])]),
1239
- _: 3
1240
- });
1241
- };
1242
- }
1243
- });
1244
- //#endregion
1245
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxAnchor.js
1246
- var ComboboxAnchor_default = /* @__PURE__ */ defineComponent({
1247
- __name: "ComboboxAnchor",
1248
- props: {
1249
- reference: {
1250
- type: null,
1251
- required: false
1252
- },
1253
- asChild: {
1254
- type: Boolean,
1255
- required: false
1256
- },
1257
- as: {
1258
- type: null,
1259
- required: false
1260
- }
1261
- },
1262
- setup(__props) {
1263
- const { forwardRef } = useForwardExpose();
1264
- return (_ctx, _cache) => {
1265
- return openBlock(), createBlock(unref(PopperAnchor_default), {
1266
- "as-child": "",
1267
- reference: _ctx.reference
1268
- }, {
1269
- default: withCtx(() => [createVNode(unref(Primitive), mergeProps({
1270
- ref: unref(forwardRef),
1271
- "as-child": _ctx.asChild,
1272
- as: _ctx.as
1273
- }, _ctx.$attrs), {
1274
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1275
- _: 3
1276
- }, 16, ["as-child", "as"])]),
1277
- _: 3
1278
- }, 8, ["reference"]);
1279
- };
1280
- }
1281
- });
1282
- //#endregion
1283
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxContentImpl.js
1284
- var [injectComboboxContentContext, provideComboboxContentContext] = /*#__PURE__*/ createContext("ComboboxContent");
1285
- var ComboboxContentImpl_default = /* @__PURE__ */ defineComponent({
1286
- __name: "ComboboxContentImpl",
1287
- props: {
1288
- position: {
1289
- type: String,
1290
- required: false,
1291
- default: "inline"
1292
- },
1293
- bodyLock: {
1294
- type: Boolean,
1295
- required: false
1296
- },
1297
- hideWhenEmpty: {
1298
- type: Boolean,
1299
- required: false
1300
- },
1301
- memoDependencies: {
1302
- type: Array,
1303
- required: false
1304
- },
1305
- side: {
1306
- type: null,
1307
- required: false
1308
- },
1309
- sideOffset: {
1310
- type: Number,
1311
- required: false
1312
- },
1313
- sideFlip: {
1314
- type: Boolean,
1315
- required: false
1316
- },
1317
- align: {
1318
- type: null,
1319
- required: false
1320
- },
1321
- alignOffset: {
1322
- type: Number,
1323
- required: false
1324
- },
1325
- alignFlip: {
1326
- type: Boolean,
1327
- required: false
1328
- },
1329
- avoidCollisions: {
1330
- type: Boolean,
1331
- required: false
1332
- },
1333
- collisionBoundary: {
1334
- type: null,
1335
- required: false
1336
- },
1337
- collisionPadding: {
1338
- type: [Number, Object],
1339
- required: false
1340
- },
1341
- arrowPadding: {
1342
- type: Number,
1343
- required: false
1344
- },
1345
- hideShiftedArrow: {
1346
- type: Boolean,
1347
- required: false
1348
- },
1349
- sticky: {
1350
- type: String,
1351
- required: false
1352
- },
1353
- hideWhenDetached: {
1354
- type: Boolean,
1355
- required: false
1356
- },
1357
- positionStrategy: {
1358
- type: String,
1359
- required: false
1360
- },
1361
- updatePositionStrategy: {
1362
- type: String,
1363
- required: false
1364
- },
1365
- disableUpdateOnLayoutShift: {
1366
- type: Boolean,
1367
- required: false
1368
- },
1369
- prioritizePosition: {
1370
- type: Boolean,
1371
- required: false
1372
- },
1373
- reference: {
1374
- type: null,
1375
- required: false
1376
- },
1377
- dir: {
1378
- type: String,
1379
- required: false
1380
- },
1381
- asChild: {
1382
- type: Boolean,
1383
- required: false
1384
- },
1385
- as: {
1386
- type: null,
1387
- required: false
1388
- },
1389
- disableOutsidePointerEvents: {
1390
- type: Boolean,
1391
- required: false
1392
- }
1393
- },
1394
- emits: [
1395
- "escapeKeyDown",
1396
- "pointerDownOutside",
1397
- "focusOutside",
1398
- "interactOutside"
1399
- ],
1400
- setup(__props, { emit: __emit }) {
1401
- const props = __props;
1402
- const emits = __emit;
1403
- const { position } = toRefs(props);
1404
- const rootContext = injectComboboxRootContext();
1405
- const isEmpty = computed(() => rootContext.ignoreFilter.value ? rootContext.allItems.value.size === 0 : rootContext.filterState.value.count === 0);
1406
- const { forwardRef, currentElement } = useForwardExpose();
1407
- useBodyScrollLock(props.bodyLock);
1408
- useFocusGuards();
1409
- useHideOthers(rootContext.parentElement);
1410
- const pickedProps = computed(() => {
1411
- if (props.position === "popper") return props;
1412
- else return {};
1413
- });
1414
- const forwardedProps = useForwardProps(pickedProps.value);
1415
- const popperStyle = {
1416
- "boxSizing": "border-box",
1417
- "--reka-combobox-content-transform-origin": "var(--reka-popper-transform-origin)",
1418
- "--reka-combobox-content-available-width": "var(--reka-popper-available-width)",
1419
- "--reka-combobox-content-available-height": "var(--reka-popper-available-height)",
1420
- "--reka-combobox-trigger-width": "var(--reka-popper-anchor-width)",
1421
- "--reka-combobox-trigger-height": "var(--reka-popper-anchor-height)"
1422
- };
1423
- provideComboboxContentContext({ position });
1424
- const isInputWithinContent = ref(false);
1425
- onMounted(() => {
1426
- if (rootContext.inputElement.value) {
1427
- isInputWithinContent.value = currentElement.value.contains(rootContext.inputElement.value);
1428
- if (isInputWithinContent.value) rootContext.inputElement.value.focus();
1429
- }
1430
- });
1431
- onUnmounted(() => {
1432
- const activeElement = getActiveElement();
1433
- if (isInputWithinContent.value && (!activeElement || activeElement === document.body)) rootContext.triggerElement.value?.focus();
1434
- });
1435
- function isEventTargetWithinCombobox(target) {
1436
- if (rootContext.parentElement.value?.contains(target)) return true;
1437
- const control = (target instanceof Element ? target.closest("label") : null)?.control;
1438
- return !!control && !!rootContext.parentElement.value?.contains(control);
1439
- }
1440
- return (_ctx, _cache) => {
1441
- return openBlock(), createBlock(unref(ListboxContent_default), { "as-child": "" }, {
1442
- default: withCtx(() => [createVNode(unref(FocusScope_default), {
1443
- "as-child": "",
1444
- onMountAutoFocus: _cache[5] || (_cache[5] = withModifiers(() => {}, ["prevent"])),
1445
- onUnmountAutoFocus: _cache[6] || (_cache[6] = withModifiers(() => {}, ["prevent"]))
1446
- }, {
1447
- default: withCtx(() => [createVNode(unref(DismissableLayer_default), {
1448
- "as-child": "",
1449
- "disable-outside-pointer-events": _ctx.disableOutsidePointerEvents,
1450
- onDismiss: _cache[0] || (_cache[0] = ($event) => unref(rootContext).onOpenChange(false)),
1451
- onFocusOutside: _cache[1] || (_cache[1] = (ev) => {
1452
- if (isEventTargetWithinCombobox(ev.target)) ev.preventDefault();
1453
- emits("focusOutside", ev);
1454
- }),
1455
- onInteractOutside: _cache[2] || (_cache[2] = ($event) => emits("interactOutside", $event)),
1456
- onEscapeKeyDown: _cache[3] || (_cache[3] = ($event) => emits("escapeKeyDown", $event)),
1457
- onPointerDownOutside: _cache[4] || (_cache[4] = (ev) => {
1458
- if (isEventTargetWithinCombobox(ev.target)) ev.preventDefault();
1459
- emits("pointerDownOutside", ev);
1460
- })
1461
- }, {
1462
- default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(unref(position) === "popper" ? unref(PopperContent_default) : unref(Primitive)), mergeProps({
1463
- ..._ctx.$attrs,
1464
- ...unref(forwardedProps)
1465
- }, {
1466
- id: unref(rootContext).contentId,
1467
- ref: unref(forwardRef),
1468
- "memo-dependencies": unref(position) === "popper" ? [unref(rootContext).filterSearch.value, unref(rootContext).filterState.value] : void 0,
1469
- "data-state": unref(rootContext).open.value ? "open" : "closed",
1470
- "data-empty": isEmpty.value ? "" : void 0,
1471
- style: {
1472
- display: props.hideWhenEmpty && isEmpty.value ? "none" : "flex",
1473
- flexDirection: "column",
1474
- outline: "none",
1475
- ...unref(position) === "popper" ? popperStyle : {}
1476
- }
1477
- }), {
1478
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1479
- _: 3
1480
- }, 16, [
1481
- "id",
1482
- "memo-dependencies",
1483
- "data-state",
1484
- "data-empty",
1485
- "style"
1486
- ]))]),
1487
- _: 3
1488
- }, 8, ["disable-outside-pointer-events"])]),
1489
- _: 3
1490
- })]),
1491
- _: 3
1492
- });
1493
- };
1494
- }
1495
- });
1496
- //#endregion
1497
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxContent.js
1498
- var ComboboxContent_default = /* @__PURE__ */ defineComponent({
1499
- __name: "ComboboxContent",
1500
- props: {
1501
- forceMount: {
1502
- type: Boolean,
1503
- required: false
1504
- },
1505
- position: {
1506
- type: String,
1507
- required: false
1508
- },
1509
- bodyLock: {
1510
- type: Boolean,
1511
- required: false
1512
- },
1513
- hideWhenEmpty: {
1514
- type: Boolean,
1515
- required: false
1516
- },
1517
- memoDependencies: {
1518
- type: Array,
1519
- required: false
1520
- },
1521
- side: {
1522
- type: null,
1523
- required: false
1524
- },
1525
- sideOffset: {
1526
- type: Number,
1527
- required: false
1528
- },
1529
- sideFlip: {
1530
- type: Boolean,
1531
- required: false
1532
- },
1533
- align: {
1534
- type: null,
1535
- required: false
1536
- },
1537
- alignOffset: {
1538
- type: Number,
1539
- required: false
1540
- },
1541
- alignFlip: {
1542
- type: Boolean,
1543
- required: false
1544
- },
1545
- avoidCollisions: {
1546
- type: Boolean,
1547
- required: false
1548
- },
1549
- collisionBoundary: {
1550
- type: null,
1551
- required: false
1552
- },
1553
- collisionPadding: {
1554
- type: [Number, Object],
1555
- required: false
1556
- },
1557
- arrowPadding: {
1558
- type: Number,
1559
- required: false
1560
- },
1561
- hideShiftedArrow: {
1562
- type: Boolean,
1563
- required: false
1564
- },
1565
- sticky: {
1566
- type: String,
1567
- required: false
1568
- },
1569
- hideWhenDetached: {
1570
- type: Boolean,
1571
- required: false
1572
- },
1573
- positionStrategy: {
1574
- type: String,
1575
- required: false
1576
- },
1577
- updatePositionStrategy: {
1578
- type: String,
1579
- required: false
1580
- },
1581
- disableUpdateOnLayoutShift: {
1582
- type: Boolean,
1583
- required: false
1584
- },
1585
- prioritizePosition: {
1586
- type: Boolean,
1587
- required: false
1588
- },
1589
- reference: {
1590
- type: null,
1591
- required: false
1592
- },
1593
- dir: {
1594
- type: String,
1595
- required: false
1596
- },
1597
- asChild: {
1598
- type: Boolean,
1599
- required: false
1600
- },
1601
- as: {
1602
- type: null,
1603
- required: false
1604
- },
1605
- disableOutsidePointerEvents: {
1606
- type: Boolean,
1607
- required: false
1608
- }
1609
- },
1610
- emits: [
1611
- "escapeKeyDown",
1612
- "pointerDownOutside",
1613
- "focusOutside",
1614
- "interactOutside"
1615
- ],
1616
- setup(__props, { emit: __emit }) {
1617
- const forwarded = useForwardPropsEmits(__props, __emit);
1618
- const { forwardRef } = useForwardExpose();
1619
- const rootContext = injectComboboxRootContext();
1620
- rootContext.contentId ||= useId$2(void 0, "reka-combobox-content");
1621
- return (_ctx, _cache) => {
1622
- return openBlock(), createBlock(unref(Presence_default), { present: _ctx.forceMount || unref(rootContext).open.value }, {
1623
- default: withCtx(() => [createVNode(ComboboxContentImpl_default, mergeProps({
1624
- ...unref(forwarded),
1625
- ..._ctx.$attrs
1626
- }, { ref: unref(forwardRef) }), {
1627
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1628
- _: 3
1629
- }, 16)]),
1630
- _: 3
1631
- }, 8, ["present"]);
1632
- };
1633
- }
1634
- });
1635
- //#endregion
1636
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxEmpty.js
1637
- var ComboboxEmpty_default = /* @__PURE__ */ defineComponent({
1638
- __name: "ComboboxEmpty",
1639
- props: {
1640
- asChild: {
1641
- type: Boolean,
1642
- required: false
1643
- },
1644
- as: {
1645
- type: null,
1646
- required: false
1647
- }
1648
- },
1649
- setup(__props) {
1650
- const props = __props;
1651
- const rootContext = injectComboboxRootContext();
1652
- const isRender = computed(() => rootContext.ignoreFilter.value ? rootContext.allItems.value.size === 0 : rootContext.filterState.value.count === 0);
1653
- return (_ctx, _cache) => {
1654
- return isRender.value ? (openBlock(), createBlock(unref(Primitive), normalizeProps(mergeProps({ key: 0 }, props)), {
1655
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("No options"))])]),
1656
- _: 3
1657
- }, 16)) : createCommentVNode("v-if", true);
1658
- };
1659
- }
1660
- });
1661
- //#endregion
1662
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxGroup.js
1663
- var [injectComboboxGroupContext, provideComboboxGroupContext] = /*#__PURE__*/ createContext("ComboboxGroup");
1664
- //#endregion
1665
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxInput.js
1666
- var ComboboxInput_default = /* @__PURE__ */ defineComponent({
1667
- __name: "ComboboxInput",
1668
- props: {
1669
- displayValue: {
1670
- type: Function,
1671
- required: false
1672
- },
1673
- modelValue: {
1674
- type: String,
1675
- required: false
1676
- },
1677
- autoFocus: {
1678
- type: Boolean,
1679
- required: false
1680
- },
1681
- disabled: {
1682
- type: Boolean,
1683
- required: false
1684
- },
1685
- asChild: {
1686
- type: Boolean,
1687
- required: false
1688
- },
1689
- as: {
1690
- type: null,
1691
- required: false,
1692
- default: "input"
1693
- }
1694
- },
1695
- emits: ["update:modelValue"],
1696
- setup(__props, { emit: __emit }) {
1697
- const props = __props;
1698
- const emits = __emit;
1699
- const rootContext = injectComboboxRootContext();
1700
- const listboxContext = injectListboxRootContext();
1701
- const { primitiveElement, currentElement } = usePrimitiveElement();
1702
- const modelValue = useVModel(props, "modelValue", emits, { passive: props.modelValue === void 0 });
1703
- onMounted(() => {
1704
- if (currentElement.value) rootContext.onInputElementChange(currentElement.value);
1705
- });
1706
- const { isComposing, shouldDeferInput, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposing((event) => {
1707
- const el = event.target;
1708
- if (el) processInputValue(el.value);
1709
- });
1710
- function handleKeyDown(ev) {
1711
- if (isComposing.value) return;
1712
- ev.preventDefault();
1713
- if (!rootContext.open.value) rootContext.onOpenChange(true);
1714
- }
1715
- function processInputValue(value) {
1716
- if (!rootContext.open.value) {
1717
- rootContext.onOpenChange(true);
1718
- nextTick(() => {
1719
- if (value) {
1720
- rootContext.filterSearch.value = value;
1721
- listboxContext.highlightFirstItem();
1722
- }
1723
- });
1724
- } else rootContext.filterSearch.value = value;
1725
- }
1726
- function handleInput(event) {
1727
- if (shouldDeferInput.value) return;
1728
- processInputValue(event.target.value);
1729
- }
1730
- function handleFocus() {
1731
- if (rootContext.openOnFocus.value && !rootContext.open.value) rootContext.onOpenChange(true);
1732
- }
1733
- function handleBlur(ev) {
1734
- if (!rootContext.open.value) return;
1735
- const nextFocus = ev.relatedTarget;
1736
- if (!nextFocus) return;
1737
- const isInsideRoot = rootContext.parentElement.value?.contains(nextFocus);
1738
- const isInsideContent = document.getElementById(rootContext.contentId)?.contains(nextFocus);
1739
- if (!isInsideRoot && !isInsideContent) requestAnimationFrame(() => {
1740
- if (!rootContext.open.value) return;
1741
- const active = document.activeElement;
1742
- if (!rootContext.parentElement.value?.contains(active) && !document.getElementById(rootContext.contentId)?.contains(active)) rootContext.onOpenChange(false);
1743
- });
1744
- }
1745
- function handleClick() {
1746
- if (rootContext.openOnClick.value && !rootContext.open.value) rootContext.onOpenChange(true);
1747
- }
1748
- function resetSearchTerm() {
1749
- const rootModelValue = rootContext.modelValue.value;
1750
- if (props.displayValue) modelValue.value = props.displayValue(rootModelValue);
1751
- else if (!rootContext.multiple.value && rootModelValue && !Array.isArray(rootModelValue)) if (typeof rootModelValue !== "object") modelValue.value = rootModelValue.toString();
1752
- else modelValue.value = "";
1753
- else modelValue.value = "";
1754
- nextTick(() => {
1755
- modelValue.value = modelValue.value;
1756
- });
1757
- }
1758
- rootContext.onResetSearchTerm(() => {
1759
- resetSearchTerm();
1760
- });
1761
- watch(rootContext.modelValue, async () => {
1762
- if (!rootContext.isUserInputted.value && rootContext.resetSearchTermOnSelect.value) resetSearchTerm();
1763
- }, {
1764
- immediate: true,
1765
- deep: true
1766
- });
1767
- watch(rootContext.filterState, (_newValue, oldValue) => {
1768
- if (!rootContext.isVirtual.value && oldValue.count === 0) listboxContext.highlightFirstItem();
1769
- });
1770
- return (_ctx, _cache) => {
1771
- return openBlock(), createBlock(unref(ListboxFilter_default), {
1772
- ref_key: "primitiveElement",
1773
- ref: primitiveElement,
1774
- modelValue: unref(modelValue),
1775
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
1776
- as: _ctx.as,
1777
- "as-child": _ctx.asChild,
1778
- "auto-focus": _ctx.autoFocus,
1779
- disabled: _ctx.disabled,
1780
- "aria-expanded": unref(rootContext).open.value,
1781
- "aria-controls": unref(rootContext).contentId,
1782
- "aria-autocomplete": "list",
1783
- role: "combobox",
1784
- autocomplete: "off",
1785
- onClick: handleClick,
1786
- onInput: handleInput,
1787
- onKeydown: withKeys(handleKeyDown, ["down", "up"]),
1788
- onFocus: handleFocus,
1789
- onBlur: handleBlur,
1790
- onCompositionstart: unref(handleCompositionStart),
1791
- onCompositionupdate: unref(handleCompositionUpdate),
1792
- onCompositionend: unref(handleCompositionEnd)
1793
- }, {
1794
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1795
- _: 3
1796
- }, 8, [
1797
- "modelValue",
1798
- "as",
1799
- "as-child",
1800
- "auto-focus",
1801
- "disabled",
1802
- "aria-expanded",
1803
- "aria-controls",
1804
- "onCompositionstart",
1805
- "onCompositionupdate",
1806
- "onCompositionend"
1807
- ]);
1808
- };
1809
- }
1810
- });
1811
- //#endregion
1812
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxItem.js
1813
- var ComboboxItem_default = /* @__PURE__ */ defineComponent({
1814
- __name: "ComboboxItem",
1815
- props: {
1816
- textValue: {
1817
- type: String,
1818
- required: false
1819
- },
1820
- value: {
1821
- type: null,
1822
- required: true
1823
- },
1824
- disabled: {
1825
- type: Boolean,
1826
- required: false
1827
- },
1828
- asChild: {
1829
- type: Boolean,
1830
- required: false
1831
- },
1832
- as: {
1833
- type: null,
1834
- required: false
1835
- }
1836
- },
1837
- emits: ["select"],
1838
- setup(__props, { emit: __emit }) {
1839
- const props = __props;
1840
- const emits = __emit;
1841
- const id = useId$2(void 0, "reka-combobox-item");
1842
- const rootContext = injectComboboxRootContext();
1843
- const groupContext = injectComboboxGroupContext(null);
1844
- const { primitiveElement, currentElement } = usePrimitiveElement();
1845
- if (props.value === "") throw new Error("A <ComboboxItem /> must have a value prop that is not an empty string. This is because the Combobox value can be set to an empty string to clear the selection and show the placeholder.");
1846
- const isRender = computed(() => {
1847
- if (rootContext.isVirtual.value || rootContext.ignoreFilter.value || !rootContext.filterSearch.value) return true;
1848
- else {
1849
- const filteredCurrentItem = rootContext.filterState.value.items.get(id);
1850
- if (filteredCurrentItem === void 0) return true;
1851
- return filteredCurrentItem > 0;
1852
- }
1853
- });
1854
- onMounted(() => {
1855
- rootContext.allItems.value.set(id, props.textValue || currentElement.value.textContent || currentElement.value.innerText);
1856
- const groupId = groupContext?.id;
1857
- if (groupId) if (!rootContext.allGroups.value.has(groupId)) rootContext.allGroups.value.set(groupId, /* @__PURE__ */ new Set([id]));
1858
- else rootContext.allGroups.value.get(groupId)?.add(id);
1859
- });
1860
- onUnmounted(() => {
1861
- rootContext.allItems.value.delete(id);
1862
- });
1863
- return (_ctx, _cache) => {
1864
- return isRender.value ? withMemo([
1865
- isRender.value,
1866
- unref(rootContext).filterSearch.value,
1867
- unref(rootContext).disabled.value,
1868
- _ctx.disabled,
1869
- props.value,
1870
- props.as,
1871
- props.asChild,
1872
- ...Object.values(_ctx.$attrs)
1873
- ], () => (openBlock(), createBlock(unref(ListboxItem_default), mergeProps({ key: 0 }, props, {
1874
- id: unref(id),
1875
- ref_key: "primitiveElement",
1876
- ref: primitiveElement,
1877
- disabled: unref(rootContext).disabled.value || _ctx.disabled,
1878
- onSelect: _cache[0] || (_cache[0] = (event) => {
1879
- emits("select", event);
1880
- if (event.defaultPrevented) return;
1881
- if (!unref(rootContext).multiple.value && !_ctx.disabled && !unref(rootContext).disabled.value) {
1882
- event.preventDefault();
1883
- unref(rootContext).onOpenChange(false);
1884
- unref(rootContext).modelValue.value = props.value;
1885
- } else if (unref(rootContext).multiple.value) unref(rootContext).inputElement.value?.focus();
1886
- })
1887
- }), {
1888
- default: withCtx(() => [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(_ctx.value), 1)])]),
1889
- _: 3
1890
- }, 16, ["id", "disabled"])), _cache, 1) : createCommentVNode("v-if", true);
1891
- };
1892
- }
1893
- });
1894
- //#endregion
1895
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxItemIndicator.js
1896
- var ComboboxItemIndicator_default = /* @__PURE__ */ defineComponent({
1897
- __name: "ComboboxItemIndicator",
1898
- props: {
1899
- asChild: {
1900
- type: Boolean,
1901
- required: false
1902
- },
1903
- as: {
1904
- type: null,
1905
- required: false,
1906
- default: "span"
1907
- }
1908
- },
1909
- setup(__props) {
1910
- const props = __props;
1911
- return (_ctx, _cache) => {
1912
- return openBlock(), createBlock(unref(ListboxItemIndicator_default), normalizeProps(guardReactiveProps(props)), {
1913
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1914
- _: 3
1915
- }, 16);
1916
- };
1917
- }
1918
- });
1919
- //#endregion
1920
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxPortal.js
1921
- var ComboboxPortal_default = /* @__PURE__ */ defineComponent({
1922
- __name: "ComboboxPortal",
1923
- props: {
1924
- to: {
1925
- type: null,
1926
- required: false
1927
- },
1928
- disabled: {
1929
- type: Boolean,
1930
- required: false
1931
- },
1932
- defer: {
1933
- type: Boolean,
1934
- required: false
1935
- },
1936
- forceMount: {
1937
- type: Boolean,
1938
- required: false
1939
- }
1940
- },
1941
- setup(__props) {
1942
- const props = __props;
1943
- return (_ctx, _cache) => {
1944
- return openBlock(), createBlock(unref(Teleport_default), normalizeProps(guardReactiveProps(props)), {
1945
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1946
- _: 3
1947
- }, 16);
1948
- };
1949
- }
1950
- });
1951
- //#endregion
1952
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxTrigger.js
1953
- var ComboboxTrigger_default = /* @__PURE__ */ defineComponent({
1954
- __name: "ComboboxTrigger",
1955
- props: {
1956
- disabled: {
1957
- type: Boolean,
1958
- required: false
1959
- },
1960
- asChild: {
1961
- type: Boolean,
1962
- required: false
1963
- },
1964
- as: {
1965
- type: null,
1966
- required: false,
1967
- default: "button"
1968
- }
1969
- },
1970
- setup(__props) {
1971
- const props = __props;
1972
- const { forwardRef, currentElement } = useForwardExpose();
1973
- const rootContext = injectComboboxRootContext();
1974
- const disabled = computed(() => props.disabled || rootContext.disabled.value || false);
1975
- onMounted(() => {
1976
- if (currentElement.value) rootContext.onTriggerElementChange(currentElement.value);
1977
- });
1978
- return (_ctx, _cache) => {
1979
- return openBlock(), createBlock(unref(Primitive), mergeProps(props, {
1980
- ref: unref(forwardRef),
1981
- type: _ctx.as === "button" ? "button" : void 0,
1982
- tabindex: "-1",
1983
- "aria-label": "Show popup",
1984
- "aria-haspopup": "listbox",
1985
- "aria-expanded": unref(rootContext).open.value,
1986
- "aria-controls": unref(rootContext).contentId,
1987
- "data-state": unref(rootContext).open.value ? "open" : "closed",
1988
- disabled: disabled.value,
1989
- "data-disabled": disabled.value ? "" : void 0,
1990
- "aria-disabled": disabled.value ?? void 0,
1991
- onClick: _cache[0] || (_cache[0] = ($event) => unref(rootContext).onOpenChange(!unref(rootContext).open.value))
1992
- }), {
1993
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
1994
- _: 3
1995
- }, 16, [
1996
- "type",
1997
- "aria-expanded",
1998
- "aria-controls",
1999
- "data-state",
2000
- "disabled",
2001
- "data-disabled",
2002
- "aria-disabled"
2003
- ]);
2004
- };
2005
- }
2006
- });
2007
- //#endregion
2008
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/shared/useNonce.js
2009
- function useNonce(nonce) {
2010
- const context = injectConfigProviderContext({ nonce: ref() });
2011
- return computed(() => nonce?.value || context.nonce?.value);
2012
- }
2013
- //#endregion
2014
- //#region ../../node_modules/.pnpm/reka-ui@2.10.3_vue@3.5.41_typescript@5.9.3_/node_modules/reka-ui/dist/Combobox/ComboboxViewport.js
2015
- var ComboboxViewport_default = /* @__PURE__ */ defineComponent({
2016
- __name: "ComboboxViewport",
2017
- props: {
2018
- nonce: {
2019
- type: String,
2020
- required: false
2021
- },
2022
- asChild: {
2023
- type: Boolean,
2024
- required: false
2025
- },
2026
- as: {
2027
- type: null,
2028
- required: false
2029
- }
2030
- },
2031
- setup(__props) {
2032
- const props = __props;
2033
- const { forwardRef } = useForwardExpose();
2034
- const { nonce: propNonce } = toRefs(props);
2035
- const nonce = useNonce(propNonce);
2036
- const rootContext = injectComboboxRootContext();
2037
- return (_ctx, _cache) => {
2038
- return openBlock(), createElementBlock(Fragment, null, [createVNode(unref(Primitive), mergeProps({
2039
- ..._ctx.$attrs,
2040
- ...props
2041
- }, {
2042
- ref: unref(forwardRef),
2043
- "data-reka-combobox-viewport": "",
2044
- role: "presentation",
2045
- style: {
2046
- position: "relative",
2047
- flex: unref(rootContext).isVirtual.value ? void 0 : 1,
2048
- overflow: "auto"
2049
- }
2050
- }), {
2051
- default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2052
- _: 3
2053
- }, 16, ["style"]), createVNode(unref(Primitive), {
2054
- as: "style",
2055
- nonce: unref(nonce)
2056
- }, {
2057
- default: withCtx(() => _cache[0] || (_cache[0] = [createTextVNode(" /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-combobox-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-combobox-viewport]::-webkit-scrollbar { display: none; } ")])),
2058
- _: 1,
2059
- __: [0]
2060
- }, 8, ["nonce"])], 64);
2061
- };
2062
- }
2063
- });
2064
- //#endregion
2065
- //#region src/components/BAutocomplete/BAutocomplete.vue?vue&type=script&setup=true&lang.ts
2066
- var _hoisted_1 = { key: 0 };
2067
- var _hoisted_2 = { class: "b-autocomplete-input-wrapper" };
2068
- //#endregion
2069
- //#region src/components/BAutocomplete/BAutocomplete.vue
2070
- var BAutocomplete_default = /* @__PURE__ */ defineComponent({
2071
- __name: "BAutocomplete",
2072
- props: /*@__PURE__*/ mergeModels({
2073
- ariaInvalid: {
2074
- type: [Boolean, String],
2075
- default: void 0
2076
- },
2077
- autocomplete: { default: void 0 },
2078
- autofocus: {
2079
- type: Boolean,
2080
- default: false
2081
- },
2082
- by: {
2083
- type: [String, Function],
2084
- default: void 0
2085
- },
2086
- dir: { default: void 0 },
2087
- disabled: {
2088
- type: Boolean,
2089
- default: false
2090
- },
2091
- disabledField: { default: "disabled" },
2092
- filterFunction: {
2093
- type: Function,
2094
- default: void 0
2095
- },
2096
- form: { default: void 0 },
2097
- formatter: {
2098
- type: Function,
2099
- default: void 0
2100
- },
2101
- id: { default: void 0 },
2102
- lazyFormatter: {
2103
- type: Boolean,
2104
- default: false
2105
- },
2106
- multiple: {
2107
- type: Boolean,
2108
- default: false
2109
- },
2110
- name: { default: void 0 },
2111
- noClearButton: {
2112
- type: Boolean,
2113
- default: false
2114
- },
2115
- noToggle: {
2116
- type: Boolean,
2117
- default: false
2118
- },
2119
- open: { type: Boolean },
2120
- openOnFocus: {
2121
- type: Boolean,
2122
- default: false
2123
- },
2124
- options: { default: () => [] },
2125
- placeholder: { default: void 0 },
2126
- plaintext: {
2127
- type: Boolean,
2128
- default: false
2129
- },
2130
- readonly: {
2131
- type: Boolean,
2132
- default: false
2133
- },
2134
- required: {
2135
- type: Boolean,
2136
- default: false
2137
- },
2138
- resetSearchTermOnBlur: {
2139
- type: Boolean,
2140
- default: true
2141
- },
2142
- resetSearchTermOnSelect: {
2143
- type: Boolean,
2144
- default: true
2145
- },
2146
- size: { default: void 0 },
2147
- state: {
2148
- type: [Boolean, null],
2149
- default: void 0
2150
- },
2151
- tags: {
2152
- type: Boolean,
2153
- default: false
2154
- },
2155
- teleportTo: { default: void 0 },
2156
- textField: { default: "text" },
2157
- valueField: { default: "value" }
2158
- }, {
2159
- "modelValue": { default: void 0 },
2160
- "modelModifiers": {},
2161
- "open": {
2162
- type: Boolean,
2163
- default: false
2164
- },
2165
- "openModifiers": {},
2166
- "search": { default: "" },
2167
- "searchModifiers": {}
2168
- }),
2169
- emits: /*@__PURE__*/ mergeModels([
2170
- "blur",
2171
- "change",
2172
- "clear",
2173
- "focus"
2174
- ], [
2175
- "update:modelValue",
2176
- "update:open",
2177
- "update:search"
2178
- ]),
2179
- setup(__props, { expose: __expose, emit: __emit }) {
2180
- const props = useDefaults(__props, "BAutocomplete");
2181
- const emit = __emit;
2182
- const _input = useTemplateRef("_input");
2183
- const modelValue = useModel(__props, "modelValue");
2184
- const isOpen = useModel(__props, "open");
2185
- const searchTerm = useModel(__props, "search");
2186
- const pendingDelete = ref(false);
2187
- const computedId = useId$1(() => props.id, "autocomplete");
2188
- const { normalizedOptions } = useFormSelect(() => props.options, props);
2189
- const singleSelectedLabelCache = ref(null);
2190
- const getLookupKey = (val) => {
2191
- if (props.by && typeof props.by === "string" && val !== null && typeof val === "object") {
2192
- const byVal = val?.[props.by];
2193
- return byVal === void 0 ? void 0 : `by:${String(byVal)}`;
2194
- }
2195
- if (val !== null && val !== void 0 && typeof val !== "object") return `value:${String(val)}`;
2196
- };
2197
- const cacheSingleSelectedLabel = (val, text) => {
2198
- const key = getLookupKey(val);
2199
- if (!key) return;
2200
- singleSelectedLabelCache.value = {
2201
- key,
2202
- text: String(text ?? "")
2203
- };
2204
- };
2205
- if (!props.multiple && modelValue.value !== null && modelValue.value !== void 0 && searchTerm.value !== "") cacheSingleSelectedLabel(modelValue.value, searchTerm.value);
2206
- const findOptionText = (val) => {
2207
- const match = normalizedOptions.value.find((opt) => {
2208
- if (props.by && typeof props.by === "string") return opt.value?.[props.by] === val?.[props.by];
2209
- return opt.value === val;
2210
- });
2211
- if (match) {
2212
- const resolvedText = String(match.text);
2213
- cacheSingleSelectedLabel(val, resolvedText);
2214
- return resolvedText;
2215
- }
2216
- const lookupKey = getLookupKey(val);
2217
- if (lookupKey && singleSelectedLabelCache.value?.key === lookupKey) return singleSelectedLabelCache.value.text;
2218
- return String(val);
2219
- };
2220
- const filteredOptions = computed(() => {
2221
- const filterText = searchTerm.value;
2222
- if (props.filterFunction) return props.filterFunction(normalizedOptions.value, filterText);
2223
- if (!filterText) return normalizedOptions.value;
2224
- const term = filterText.toLowerCase();
2225
- return normalizedOptions.value.filter((opt) => String(opt.text).toLowerCase().includes(term));
2226
- });
2227
- const displayValueFn = (val) => {
2228
- if (val === null || val === void 0) return "";
2229
- if (props.multiple) return "";
2230
- return findOptionText(val);
2231
- };
2232
- const hasSelection = computed(() => {
2233
- const currentValue = modelValue.value;
2234
- if (Array.isArray(currentValue)) return currentValue.length > 0;
2235
- return currentValue !== null && currentValue !== void 0;
2236
- });
2237
- const computedAriaInvalid = useAriaInvalid(() => props.ariaInvalid, () => props.state);
2238
- const selectedOptions = computed(() => {
2239
- if (!props.multiple || !modelValue.value) return [];
2240
- return (Array.isArray(modelValue.value) ? modelValue.value : [modelValue.value]).map((val) => normalizedOptions.value.find((opt) => {
2241
- if (props.by && typeof props.by === "string") return opt.value?.[props.by] === val?.[props.by];
2242
- return opt.value === val;
2243
- })).filter((opt) => !!opt);
2244
- });
2245
- const removeSelected = (option) => {
2246
- if (!Array.isArray(modelValue.value)) return;
2247
- modelValue.value = modelValue.value.filter((val) => {
2248
- if (props.by && typeof props.by === "string") return val?.[props.by] !== option.value?.[props.by];
2249
- return val !== option.value;
2250
- });
2251
- emit("change", modelValue.value);
2252
- };
2253
- const optionKey = (option, index) => {
2254
- const val = option.value;
2255
- if (val !== null && val !== void 0 && typeof val !== "object") return String(val);
2256
- return index;
2257
- };
2258
- const isLastSelectedOption = (_opt, index) => index === selectedOptions.value.length - 1;
2259
- const showClearButton = computed(() => !props.required && !props.noClearButton && !props.disabled && !props.readonly && hasSelection.value);
2260
- const clearSelection = () => {
2261
- modelValue.value = props.multiple ? [] : void 0;
2262
- searchTerm.value = "";
2263
- singleSelectedLabelCache.value = null;
2264
- emit("clear");
2265
- emit("change", modelValue.value);
2266
- _input.value?.focus();
2267
- };
2268
- const onOptionSelect = (option) => {
2269
- cacheSingleSelectedLabel(option.value, String(option.text));
2270
- nextTick(() => {
2271
- emit("change", modelValue.value);
2272
- });
2273
- _input.value?.focus();
2274
- };
2275
- const resetPendingDelete = () => {
2276
- pendingDelete.value = false;
2277
- };
2278
- const onInputKeydown = (event) => {
2279
- if (!props.multiple || !hasSelection.value) {
2280
- resetPendingDelete();
2281
- return;
2282
- }
2283
- if (event.key === "Backspace" && searchTerm.value === "") {
2284
- if (pendingDelete.value) {
2285
- const lastOpt = selectedOptions.value[selectedOptions.value.length - 1];
2286
- if (lastOpt) removeSelected(lastOpt);
2287
- pendingDelete.value = false;
2288
- } else pendingDelete.value = true;
2289
- return;
2290
- }
2291
- if (pendingDelete.value) resetPendingDelete();
2292
- };
2293
- const comboboxInputProps = computed(() => ({
2294
- "id": computedId.value,
2295
- "disabled": props.disabled,
2296
- "form": props.form || void 0,
2297
- "placeholder": props.placeholder,
2298
- "readonly": props.readonly || props.plaintext,
2299
- "required": props.required || void 0,
2300
- "autocomplete": props.autocomplete || void 0,
2301
- "plaintext": props.plaintext,
2302
- "size": props.size,
2303
- "state": props.state,
2304
- "aria-invalid": computedAriaInvalid.value,
2305
- "aria-required": props.required || void 0,
2306
- "onBlur": (event) => emit("blur", event),
2307
- "onFocus": (event) => emit("focus", event),
2308
- "onKeydown": (event) => onInputKeydown(event)
2309
- }));
2310
- __expose({
2311
- blur: () => _input.value?.blur(),
2312
- element: computed(() => _input.value?.element?.value ?? null),
2313
- focus: () => _input.value?.focus()
2314
- });
2315
- return (_ctx, _cache) => {
2316
- return openBlock(), createBlock(unref(ComboboxRoot_default), {
2317
- modelValue: modelValue.value,
2318
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
2319
- open: isOpen.value,
2320
- "onUpdate:open": _cache[2] || (_cache[2] = ($event) => isOpen.value = $event),
2321
- multiple: unref(props).multiple,
2322
- disabled: unref(props).disabled,
2323
- name: unref(props).name,
2324
- required: unref(props).required,
2325
- "ignore-filter": unref(props).multiple || !!unref(props).filterFunction,
2326
- "reset-search-term-on-select": unref(props).resetSearchTermOnSelect,
2327
- "reset-search-term-on-blur": unref(props).resetSearchTermOnBlur,
2328
- by: unref(props).by,
2329
- dir: unref(props).dir,
2330
- "open-on-focus": unref(props).openOnFocus,
2331
- class: "b-autocomplete"
2332
- }, {
2333
- default: withCtx(() => [createVNode(unref(ComboboxAnchor_default), { "as-child": "" }, {
2334
- default: withCtx(() => [createVNode(BInputGroup_default, { size: unref(props).size }, {
2335
- append: withCtx(() => [!unref(props).noToggle ? (openBlock(), createBlock(unref(ComboboxTrigger_default), {
2336
- key: 0,
2337
- "as-child": "",
2338
- disabled: unref(props).disabled
2339
- }, {
2340
- default: withCtx(() => [renderSlot(_ctx.$slots, "toggle", {
2341
- isOpen: isOpen.value,
2342
- disabled: unref(props).disabled
2343
- }, () => [createVNode(BButton_default, {
2344
- class: "b-autocomplete-trigger",
2345
- disabled: unref(props).disabled
2346
- }, {
2347
- default: withCtx(() => [renderSlot(_ctx.$slots, "toggle-icon", { isOpen: isOpen.value }, () => [(openBlock(), createElementBlock("svg", {
2348
- xmlns: "http://www.w3.org/2000/svg",
2349
- width: "16",
2350
- height: "16",
2351
- fill: "currentColor",
2352
- viewBox: "0 0 16 16",
2353
- class: normalizeClass(["b-autocomplete-chevron", { "b-autocomplete-chevron-open": isOpen.value }])
2354
- }, [..._cache[3] || (_cache[3] = [createElementVNode("path", {
2355
- "fill-rule": "evenodd",
2356
- d: "M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"
2357
- }, null, -1)])], 2))])]),
2358
- _: 3
2359
- }, 8, ["disabled"])])]),
2360
- _: 3
2361
- }, 8, ["disabled"])) : createCommentVNode("", true)]),
2362
- default: withCtx(() => [unref(props).multiple && hasSelection.value ? (openBlock(), createElementBlock("div", {
2363
- key: 0,
2364
- class: normalizeClass(["b-autocomplete-selection", {
2365
- "b-autocomplete-selection-tags": unref(props).tags,
2366
- "b-autocomplete-selection-pending-delete": pendingDelete.value
2367
- }])
2368
- }, [unref(props).tags ? renderSlot(_ctx.$slots, "tags", {
2369
- pendingDelete: pendingDelete.value,
2370
- selected: selectedOptions.value,
2371
- remove: removeSelected
2372
- }, () => [(openBlock(true), createElementBlock(Fragment, null, renderList(selectedOptions.value, (opt, i) => {
2373
- return openBlock(), createBlock(BFormTag_default, {
2374
- key: optionKey(opt, i),
2375
- title: String(opt.text),
2376
- disabled: unref(props).disabled,
2377
- variant: "secondary",
2378
- class: normalizeClass({
2379
- "b-autocomplete-tag-muted": pendingDelete.value && !isLastSelectedOption(opt, i),
2380
- "b-autocomplete-tag-pending-delete": pendingDelete.value && isLastSelectedOption(opt, i)
2381
- }),
2382
- onRemove: ($event) => removeSelected(opt)
2383
- }, {
2384
- default: withCtx(() => [createTextVNode(toDisplayString(opt.text), 1)]),
2385
- _: 2
2386
- }, 1032, [
2387
- "title",
2388
- "disabled",
2389
- "class",
2390
- "onRemove"
2391
- ]);
2392
- }), 128))], void 0, 0) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(selectedOptions.value, (opt, i) => {
2393
- return openBlock(), createElementBlock("span", {
2394
- key: optionKey(opt, i),
2395
- class: normalizeClass({ "text-body-tertiary": pendingDelete.value && !isLastSelectedOption(opt, i) })
2396
- }, [createTextVNode(toDisplayString(opt.text), 1), i < selectedOptions.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_1, ",\xA0")) : createCommentVNode("", true)], 2);
2397
- }), 128))], 2)) : createCommentVNode("", true), createElementVNode("div", _hoisted_2, [createVNode(unref(ComboboxInput_default), {
2398
- modelValue: searchTerm.value,
2399
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchTerm.value = $event),
2400
- "as-child": "",
2401
- "display-value": displayValueFn
2402
- }, {
2403
- default: withCtx(() => [renderSlot(_ctx.$slots, "input", mergeProps(comboboxInputProps.value, { searchTerm: searchTerm.value }), () => [createVNode(BFormInput_default, mergeProps({
2404
- ref_key: "_input",
2405
- ref: _input,
2406
- "model-value": searchTerm.value
2407
- }, comboboxInputProps.value, { class: { "b-autocomplete-input-clearable": showClearButton.value } }), null, 16, ["model-value", "class"])])]),
2408
- _: 3
2409
- }, 8, ["modelValue"]), showClearButton.value ? (openBlock(), createBlock(BCloseButton_default, {
2410
- key: 0,
2411
- class: "b-autocomplete-clear",
2412
- "aria-label": "Clear selected value",
2413
- onClick: withModifiers(clearSelection, ["stop"])
2414
- })) : createCommentVNode("", true)])]),
2415
- _: 3
2416
- }, 8, ["size"])]),
2417
- _: 3
2418
- }), createVNode(unref(ComboboxPortal_default), {
2419
- disabled: !unref(props).teleportTo,
2420
- to: unref(props).teleportTo
2421
- }, {
2422
- default: withCtx(() => [createVNode(unref(ComboboxContent_default), {
2423
- position: "popper",
2424
- "side-offset": 4,
2425
- align: "start",
2426
- class: normalizeClass([
2427
- "b-autocomplete-content",
2428
- "dropdown-menu",
2429
- "show"
2430
- ]),
2431
- "body-lock": false,
2432
- style: { width: "var(--reka-combobox-trigger-width)" }
2433
- }, {
2434
- default: withCtx(() => [createVNode(unref(ComboboxViewport_default), { class: "b-autocomplete-viewport" }, {
2435
- default: withCtx(() => [createVNode(unref(ComboboxEmpty_default), { class: "b-autocomplete-empty" }, {
2436
- default: withCtx(() => [renderSlot(_ctx.$slots, "empty", {}, () => [_cache[4] || (_cache[4] = createTextVNode(" No results found ", -1))])]),
2437
- _: 3
2438
- }), (openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
2439
- return openBlock(), createBlock(unref(ComboboxItem_default), {
2440
- key: optionKey(option, index),
2441
- value: option.value,
2442
- disabled: option.disabled,
2443
- class: normalizeClass(["b-autocomplete-item", "dropdown-item"]),
2444
- onSelect: ($event) => onOptionSelect(option)
2445
- }, {
2446
- default: withCtx(() => [renderSlot(_ctx.$slots, "option", mergeProps({ ref_for: true }, option), () => [createTextVNode(toDisplayString(option.text), 1)]), createVNode(unref(ComboboxItemIndicator_default), { class: "b-autocomplete-item-indicator" }, {
2447
- default: withCtx(() => [renderSlot(_ctx.$slots, "option-indicator", {}, () => [_cache[5] || (_cache[5] = createElementVNode("svg", {
2448
- xmlns: "http://www.w3.org/2000/svg",
2449
- width: "16",
2450
- height: "16",
2451
- fill: "currentColor",
2452
- viewBox: "0 0 16 16"
2453
- }, [createElementVNode("path", { d: "M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" })], -1))])]),
2454
- _: 3
2455
- })]),
2456
- _: 2
2457
- }, 1032, [
2458
- "value",
2459
- "disabled",
2460
- "onSelect"
2461
- ]);
2462
- }), 128))]),
2463
- _: 3
2464
- })]),
2465
- _: 3
2466
- })]),
2467
- _: 3
2468
- }, 8, ["disabled", "to"])]),
2469
- _: 3
2470
- }, 8, [
2471
- "modelValue",
2472
- "open",
2473
- "multiple",
2474
- "disabled",
2475
- "name",
2476
- "required",
2477
- "ignore-filter",
2478
- "reset-search-term-on-select",
2479
- "reset-search-term-on-blur",
2480
- "by",
2481
- "dir",
2482
- "open-on-focus"
2483
- ]);
2484
- };
2485
- }
2486
- });
2487
- //#endregion
2488
- export { BAutocomplete_default as t };
2489
-
2490
- //# sourceMappingURL=BAutocomplete-BFbbKtpz.js.map