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,1302 +0,0 @@
1
- import { C as watchImmediate, _ as toRef$1, a as increaseWithUnit, b as useIntervalFn, c as isDef, d as noop, f as notNullish, g as toArray, h as timestamp, i as hasOwn, l as isIOS, o as injectLocal, p as pxValue, s as isClient, t as createEventHook, u as isObject, v as tryOnMounted, w as watchPausable, y as tryOnScopeDispose } from "./dist-DKc2ivHS.js";
2
- import { computed, getCurrentInstance, hasInjectionContext, nextTick, onMounted, reactive, readonly, ref, shallowRef, toValue, unref, watch, watchEffect } from "vue";
3
- //#region ../../node_modules/.pnpm/@vueuse+core@14.2.1_vue@3.5.41_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
4
- var defaultWindow = isClient ? window : void 0;
5
- var defaultDocument = isClient ? window.document : void 0;
6
- isClient && window.navigator;
7
- isClient && window.location;
8
- /**
9
- * Get the dom element of a ref of element or Vue component instance
10
- *
11
- * @param elRef
12
- */
13
- function unrefElement(elRef) {
14
- var _$el;
15
- const plain = toValue(elRef);
16
- return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
17
- }
18
- function useEventListener(...args) {
19
- const register = (el, event, listener, options) => {
20
- el.addEventListener(event, listener, options);
21
- return () => el.removeEventListener(event, listener, options);
22
- };
23
- const firstParamTargets = computed(() => {
24
- const test = toArray(toValue(args[0])).filter((e) => e != null);
25
- return test.every((e) => typeof e !== "string") ? test : void 0;
26
- });
27
- return watchImmediate(() => {
28
- var _firstParamTargets$va, _firstParamTargets$va2;
29
- return [
30
- (_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
31
- toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
32
- toArray(unref(firstParamTargets.value ? args[2] : args[1])),
33
- toValue(firstParamTargets.value ? args[3] : args[2])
34
- ];
35
- }, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
36
- if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
37
- const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
38
- const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
39
- onCleanup(() => {
40
- cleanups.forEach((fn) => fn());
41
- });
42
- }, { flush: "post" });
43
- }
44
- var _iOSWorkaround = false;
45
- function onClickOutside(target, handler, options = {}) {
46
- const { window: window$1 = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;
47
- if (!window$1) return controls ? {
48
- stop: noop,
49
- cancel: noop,
50
- trigger: noop
51
- } : noop;
52
- if (isIOS && !_iOSWorkaround) {
53
- _iOSWorkaround = true;
54
- const listenerOptions = { passive: true };
55
- Array.from(window$1.document.body.children).forEach((el) => el.addEventListener("click", noop, listenerOptions));
56
- window$1.document.documentElement.addEventListener("click", noop, listenerOptions);
57
- }
58
- let shouldListen = true;
59
- const shouldIgnore = (event) => {
60
- return toValue(ignore).some((target$1) => {
61
- if (typeof target$1 === "string") return Array.from(window$1.document.querySelectorAll(target$1)).some((el) => el === event.target || event.composedPath().includes(el));
62
- else {
63
- const el = unrefElement(target$1);
64
- return el && (event.target === el || event.composedPath().includes(el));
65
- }
66
- });
67
- };
68
- /**
69
- * Determines if the given target has multiple root elements.
70
- * Referenced from: https://github.com/vuejs/test-utils/blob/ccb460be55f9f6be05ab708500a41ec8adf6f4bc/src/vue-wrapper.ts#L21
71
- */
72
- function hasMultipleRoots(target$1) {
73
- const vm = toValue(target$1);
74
- return vm && vm.$.subTree.shapeFlag === 16;
75
- }
76
- function checkMultipleRoots(target$1, event) {
77
- const vm = toValue(target$1);
78
- const children = vm.$.subTree && vm.$.subTree.children;
79
- if (children == null || !Array.isArray(children)) return false;
80
- return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
81
- }
82
- const listener = (event) => {
83
- const el = unrefElement(target);
84
- if (event.target == null) return;
85
- if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;
86
- if (!el || el === event.target || event.composedPath().includes(el)) return;
87
- if ("detail" in event && event.detail === 0) shouldListen = !shouldIgnore(event);
88
- if (!shouldListen) {
89
- shouldListen = true;
90
- return;
91
- }
92
- handler(event);
93
- };
94
- let isProcessingClick = false;
95
- const cleanup = [
96
- useEventListener(window$1, "click", (event) => {
97
- if (!isProcessingClick) {
98
- isProcessingClick = true;
99
- setTimeout(() => {
100
- isProcessingClick = false;
101
- }, 0);
102
- listener(event);
103
- }
104
- }, {
105
- passive: true,
106
- capture
107
- }),
108
- useEventListener(window$1, "pointerdown", (e) => {
109
- const el = unrefElement(target);
110
- shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
111
- }, { passive: true }),
112
- detectIframe && useEventListener(window$1, "blur", (event) => {
113
- setTimeout(() => {
114
- var _window$document$acti;
115
- const el = unrefElement(target);
116
- if (((_window$document$acti = window$1.document.activeElement) === null || _window$document$acti === void 0 ? void 0 : _window$document$acti.tagName) === "IFRAME" && !(el === null || el === void 0 ? void 0 : el.contains(window$1.document.activeElement))) handler(event);
117
- }, 0);
118
- }, { passive: true })
119
- ].filter(Boolean);
120
- const stop = () => cleanup.forEach((fn) => fn());
121
- if (controls) return {
122
- stop,
123
- cancel: () => {
124
- shouldListen = false;
125
- },
126
- trigger: (event) => {
127
- shouldListen = true;
128
- listener(event);
129
- shouldListen = false;
130
- }
131
- };
132
- return stop;
133
- }
134
- /**
135
- * Mounted state in ref.
136
- *
137
- * @see https://vueuse.org/useMounted
138
- *
139
- * @__NO_SIDE_EFFECTS__
140
- */
141
- function useMounted() {
142
- const isMounted = shallowRef(false);
143
- const instance = getCurrentInstance();
144
- if (instance) onMounted(() => {
145
- isMounted.value = true;
146
- }, instance);
147
- return isMounted;
148
- }
149
- /* @__NO_SIDE_EFFECTS__ */
150
- function useSupported(callback) {
151
- const isMounted = useMounted();
152
- return computed(() => {
153
- isMounted.value;
154
- return Boolean(callback());
155
- });
156
- }
157
- /**
158
- * Watch for changes being made to the DOM tree.
159
- *
160
- * @see https://vueuse.org/useMutationObserver
161
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN
162
- * @param target
163
- * @param callback
164
- * @param options
165
- */
166
- function useMutationObserver(target, callback, options = {}) {
167
- const { window: window$1 = defaultWindow, ...mutationOptions } = options;
168
- let observer;
169
- const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "MutationObserver" in window$1);
170
- const cleanup = () => {
171
- if (observer) {
172
- observer.disconnect();
173
- observer = void 0;
174
- }
175
- };
176
- const stopWatch = watch(computed(() => {
177
- const items = toArray(toValue(target)).map(unrefElement).filter(notNullish);
178
- return new Set(items);
179
- }), (newTargets) => {
180
- cleanup();
181
- if (isSupported.value && newTargets.size) {
182
- observer = new MutationObserver(callback);
183
- newTargets.forEach((el) => observer.observe(el, mutationOptions));
184
- }
185
- }, {
186
- immediate: true,
187
- flush: "post"
188
- });
189
- const takeRecords = () => {
190
- return observer === null || observer === void 0 ? void 0 : observer.takeRecords();
191
- };
192
- const stop = () => {
193
- stopWatch();
194
- cleanup();
195
- };
196
- tryOnScopeDispose(stop);
197
- return {
198
- isSupported,
199
- stop,
200
- takeRecords
201
- };
202
- }
203
- /**
204
- * Fires when the element or any element containing it is removed.
205
- *
206
- * @param target
207
- * @param callback
208
- * @param options
209
- */
210
- function onElementRemoval(target, callback, options = {}) {
211
- const { window: window$1 = defaultWindow, document: document$1 = window$1 === null || window$1 === void 0 ? void 0 : window$1.document, flush = "sync" } = options;
212
- if (!window$1 || !document$1) return noop;
213
- let stopFn;
214
- const cleanupAndUpdate = (fn) => {
215
- stopFn === null || stopFn === void 0 || stopFn();
216
- stopFn = fn;
217
- };
218
- const stopWatch = watchEffect(() => {
219
- const el = unrefElement(target);
220
- if (el) {
221
- const { stop } = useMutationObserver(document$1, (mutationsList) => {
222
- if (mutationsList.map((mutation) => [...mutation.removedNodes]).flat().some((node) => node === el || node.contains(el))) callback(mutationsList);
223
- }, {
224
- window: window$1,
225
- childList: true,
226
- subtree: true
227
- });
228
- cleanupAndUpdate(stop);
229
- }
230
- }, { flush });
231
- const stopHandle = () => {
232
- stopWatch();
233
- cleanupAndUpdate();
234
- };
235
- tryOnScopeDispose(stopHandle);
236
- return stopHandle;
237
- }
238
- function createKeyPredicate(keyFilter) {
239
- if (typeof keyFilter === "function") return keyFilter;
240
- else if (typeof keyFilter === "string") return (event) => event.key === keyFilter;
241
- else if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);
242
- return () => true;
243
- }
244
- function onKeyStroke(...args) {
245
- let key;
246
- let handler;
247
- let options = {};
248
- if (args.length === 3) {
249
- key = args[0];
250
- handler = args[1];
251
- options = args[2];
252
- } else if (args.length === 2) if (typeof args[1] === "object") {
253
- key = true;
254
- handler = args[0];
255
- options = args[1];
256
- } else {
257
- key = args[0];
258
- handler = args[1];
259
- }
260
- else {
261
- key = true;
262
- handler = args[0];
263
- }
264
- const { target = defaultWindow, eventName = "keydown", passive = false, dedupe = false } = options;
265
- const predicate = createKeyPredicate(key);
266
- const listener = (e) => {
267
- if (e.repeat && toValue(dedupe)) return;
268
- if (predicate(e)) handler(e);
269
- };
270
- return useEventListener(target, eventName, listener, passive);
271
- }
272
- /**
273
- * Call function on every `requestAnimationFrame`. With controls of pausing and resuming.
274
- *
275
- * @see https://vueuse.org/useRafFn
276
- * @param fn
277
- * @param options
278
- */
279
- function useRafFn(fn, options = {}) {
280
- const { immediate = true, fpsLimit = null, window: window$1 = defaultWindow, once = false } = options;
281
- const isActive = shallowRef(false);
282
- const intervalLimit = computed(() => {
283
- const limit = toValue(fpsLimit);
284
- return limit ? 1e3 / limit : null;
285
- });
286
- let previousFrameTimestamp = 0;
287
- let rafId = null;
288
- function loop(timestamp$1) {
289
- if (!isActive.value || !window$1) return;
290
- if (!previousFrameTimestamp) previousFrameTimestamp = timestamp$1;
291
- const delta = timestamp$1 - previousFrameTimestamp;
292
- if (intervalLimit.value && delta < intervalLimit.value) {
293
- rafId = window$1.requestAnimationFrame(loop);
294
- return;
295
- }
296
- previousFrameTimestamp = timestamp$1;
297
- fn({
298
- delta,
299
- timestamp: timestamp$1
300
- });
301
- if (once) {
302
- isActive.value = false;
303
- rafId = null;
304
- return;
305
- }
306
- rafId = window$1.requestAnimationFrame(loop);
307
- }
308
- function resume() {
309
- if (!isActive.value && window$1) {
310
- isActive.value = true;
311
- previousFrameTimestamp = 0;
312
- rafId = window$1.requestAnimationFrame(loop);
313
- }
314
- }
315
- function pause() {
316
- isActive.value = false;
317
- if (rafId != null && window$1) {
318
- window$1.cancelAnimationFrame(rafId);
319
- rafId = null;
320
- }
321
- }
322
- if (immediate) resume();
323
- tryOnScopeDispose(pause);
324
- return {
325
- isActive: readonly(isActive),
326
- pause,
327
- resume
328
- };
329
- }
330
- var ssrWidthSymbol = Symbol("vueuse-ssr-width");
331
- /* @__NO_SIDE_EFFECTS__ */
332
- function useSSRWidth() {
333
- const ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;
334
- return typeof ssrWidth === "number" ? ssrWidth : void 0;
335
- }
336
- /**
337
- * Reactive Media Query.
338
- *
339
- * @see https://vueuse.org/useMediaQuery
340
- * @param query
341
- * @param options
342
- */
343
- function useMediaQuery(query, options = {}) {
344
- const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
345
- const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
346
- const ssrSupport = shallowRef(typeof ssrWidth === "number");
347
- const mediaQuery = shallowRef();
348
- const matches = shallowRef(false);
349
- const handler = (event) => {
350
- matches.value = event.matches;
351
- };
352
- watchEffect(() => {
353
- if (ssrSupport.value) {
354
- ssrSupport.value = !isSupported.value;
355
- matches.value = toValue(query).split(",").some((queryString) => {
356
- const not = queryString.includes("not all");
357
- const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
358
- const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
359
- let res = Boolean(minWidth || maxWidth);
360
- if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
361
- if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
362
- return not ? !res : res;
363
- });
364
- return;
365
- }
366
- if (!isSupported.value) return;
367
- mediaQuery.value = window$1.matchMedia(toValue(query));
368
- matches.value = mediaQuery.value.matches;
369
- });
370
- useEventListener(mediaQuery, "change", handler, { passive: true });
371
- return computed(() => matches.value);
372
- }
373
- /**
374
- * Breakpoints from Bootstrap V5
375
- *
376
- * @see https://getbootstrap.com/docs/5.0/layout/breakpoints
377
- */
378
- var breakpointsBootstrapV5 = {
379
- xs: 0,
380
- sm: 576,
381
- md: 768,
382
- lg: 992,
383
- xl: 1200,
384
- xxl: 1400
385
- };
386
- /**
387
- * Reactively viewport breakpoints
388
- *
389
- * @see https://vueuse.org/useBreakpoints
390
- *
391
- * @__NO_SIDE_EFFECTS__
392
- */
393
- function useBreakpoints(breakpoints, options = {}) {
394
- function getValue$1(k, delta) {
395
- let v = toValue(breakpoints[toValue(k)]);
396
- if (delta != null) v = increaseWithUnit(v, delta);
397
- if (typeof v === "number") v = `${v}px`;
398
- return v;
399
- }
400
- const { window: window$1 = defaultWindow, strategy = "min-width", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
401
- const ssrSupport = typeof ssrWidth === "number";
402
- const mounted = ssrSupport ? shallowRef(false) : { value: true };
403
- if (ssrSupport) tryOnMounted(() => mounted.value = !!window$1);
404
- function match(query, size) {
405
- if (!mounted.value && ssrSupport) return query === "min" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);
406
- if (!window$1) return false;
407
- return window$1.matchMedia(`(${query}-width: ${size})`).matches;
408
- }
409
- const greaterOrEqual = (k) => {
410
- return useMediaQuery(() => `(min-width: ${getValue$1(k)})`, options);
411
- };
412
- const smallerOrEqual = (k) => {
413
- return useMediaQuery(() => `(max-width: ${getValue$1(k)})`, options);
414
- };
415
- const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {
416
- Object.defineProperty(shortcuts, k, {
417
- get: () => strategy === "min-width" ? greaterOrEqual(k) : smallerOrEqual(k),
418
- enumerable: true,
419
- configurable: true
420
- });
421
- return shortcuts;
422
- }, {});
423
- function current() {
424
- const points = Object.keys(breakpoints).map((k) => [
425
- k,
426
- shortcutMethods[k],
427
- pxValue(getValue$1(k))
428
- ]).sort((a, b) => a[2] - b[2]);
429
- return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));
430
- }
431
- return Object.assign(shortcutMethods, {
432
- greaterOrEqual,
433
- smallerOrEqual,
434
- greater(k) {
435
- return useMediaQuery(() => `(min-width: ${getValue$1(k, .1)})`, options);
436
- },
437
- smaller(k) {
438
- return useMediaQuery(() => `(max-width: ${getValue$1(k, -.1)})`, options);
439
- },
440
- between(a, b) {
441
- return useMediaQuery(() => `(min-width: ${getValue$1(a)}) and (max-width: ${getValue$1(b, -.1)})`, options);
442
- },
443
- isGreater(k) {
444
- return match("min", getValue$1(k, .1));
445
- },
446
- isGreaterOrEqual(k) {
447
- return match("min", getValue$1(k));
448
- },
449
- isSmaller(k) {
450
- return match("max", getValue$1(k, -.1));
451
- },
452
- isSmallerOrEqual(k) {
453
- return match("max", getValue$1(k));
454
- },
455
- isInBetween(a, b) {
456
- return match("min", getValue$1(a)) && match("max", getValue$1(b, -.1));
457
- },
458
- current,
459
- active() {
460
- const bps = current();
461
- return computed(() => bps.value.length === 0 ? "" : bps.value.at(strategy === "min-width" ? -1 : 0));
462
- }
463
- });
464
- }
465
- function cloneFnJSON(source) {
466
- return JSON.parse(JSON.stringify(source));
467
- }
468
- var _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
469
- var globalKey = "__vueuse_ssr_handlers__";
470
- var handlers = /* @__PURE__ */ getHandlers();
471
- function getHandlers() {
472
- if (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};
473
- return _global[globalKey];
474
- }
475
- function getSSRHandler(key, fallback) {
476
- return handlers[key] || fallback;
477
- }
478
- /**
479
- * Reactive dark theme preference.
480
- *
481
- * @see https://vueuse.org/usePreferredDark
482
- * @param [options]
483
- *
484
- * @__NO_SIDE_EFFECTS__
485
- */
486
- function usePreferredDark(options) {
487
- return useMediaQuery("(prefers-color-scheme: dark)", options);
488
- }
489
- function guessSerializerType(rawInit) {
490
- return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any";
491
- }
492
- var StorageSerializers = {
493
- boolean: {
494
- read: (v) => v === "true",
495
- write: (v) => String(v)
496
- },
497
- object: {
498
- read: (v) => JSON.parse(v),
499
- write: (v) => JSON.stringify(v)
500
- },
501
- number: {
502
- read: (v) => Number.parseFloat(v),
503
- write: (v) => String(v)
504
- },
505
- any: {
506
- read: (v) => v,
507
- write: (v) => String(v)
508
- },
509
- string: {
510
- read: (v) => v,
511
- write: (v) => String(v)
512
- },
513
- map: {
514
- read: (v) => new Map(JSON.parse(v)),
515
- write: (v) => JSON.stringify(Array.from(v.entries()))
516
- },
517
- set: {
518
- read: (v) => new Set(JSON.parse(v)),
519
- write: (v) => JSON.stringify(Array.from(v))
520
- },
521
- date: {
522
- read: (v) => new Date(v),
523
- write: (v) => v.toISOString()
524
- }
525
- };
526
- var customStorageEventName = "vueuse-storage";
527
- /**
528
- * Reactive LocalStorage/SessionStorage.
529
- *
530
- * @see https://vueuse.org/useStorage
531
- */
532
- function useStorage(key, defaults$1, storage, options = {}) {
533
- var _options$serializer;
534
- const { flush = "pre", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window: window$1 = defaultWindow, eventFilter, onError = (e) => {
535
- console.error(e);
536
- }, initOnMounted } = options;
537
- const data = (shallow ? shallowRef : ref)(typeof defaults$1 === "function" ? defaults$1() : defaults$1);
538
- const keyComputed = computed(() => toValue(key));
539
- if (!storage) try {
540
- storage = getSSRHandler("getDefaultStorage", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();
541
- } catch (e) {
542
- onError(e);
543
- }
544
- if (!storage) return data;
545
- const rawInit = toValue(defaults$1);
546
- const type = guessSerializerType(rawInit);
547
- const serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];
548
- const { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {
549
- flush,
550
- deep,
551
- eventFilter
552
- });
553
- watch(keyComputed, () => update(), { flush });
554
- let firstMounted = false;
555
- const onStorageEvent = (ev) => {
556
- if (initOnMounted && !firstMounted) return;
557
- update(ev);
558
- };
559
- const onStorageCustomEvent = (ev) => {
560
- if (initOnMounted && !firstMounted) return;
561
- updateFromCustomEvent(ev);
562
- };
563
- /**
564
- * The custom event is needed for same-document syncing when using custom
565
- * storage backends, but it doesn't work across different documents.
566
- *
567
- * TODO: Consider implementing a BroadcastChannel-based solution that fixes this.
568
- */
569
- if (window$1 && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window$1, "storage", onStorageEvent, { passive: true });
570
- else useEventListener(window$1, customStorageEventName, onStorageCustomEvent);
571
- if (initOnMounted) tryOnMounted(() => {
572
- firstMounted = true;
573
- update();
574
- });
575
- else update();
576
- function dispatchWriteEvent(oldValue, newValue) {
577
- if (window$1) {
578
- const payload = {
579
- key: keyComputed.value,
580
- oldValue,
581
- newValue,
582
- storageArea: storage
583
- };
584
- window$1.dispatchEvent(storage instanceof Storage ? new StorageEvent("storage", payload) : new CustomEvent(customStorageEventName, { detail: payload }));
585
- }
586
- }
587
- function write(v) {
588
- try {
589
- const oldValue = storage.getItem(keyComputed.value);
590
- if (v == null) {
591
- dispatchWriteEvent(oldValue, null);
592
- storage.removeItem(keyComputed.value);
593
- } else {
594
- const serialized = serializer.write(v);
595
- if (oldValue !== serialized) {
596
- storage.setItem(keyComputed.value, serialized);
597
- dispatchWriteEvent(oldValue, serialized);
598
- }
599
- }
600
- } catch (e) {
601
- onError(e);
602
- }
603
- }
604
- function read(event) {
605
- const rawValue = event ? event.newValue : storage.getItem(keyComputed.value);
606
- if (rawValue == null) {
607
- if (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));
608
- return rawInit;
609
- } else if (!event && mergeDefaults) {
610
- const value = serializer.read(rawValue);
611
- if (typeof mergeDefaults === "function") return mergeDefaults(value, rawInit);
612
- else if (type === "object" && !Array.isArray(value)) return {
613
- ...rawInit,
614
- ...value
615
- };
616
- return value;
617
- } else if (typeof rawValue !== "string") return rawValue;
618
- else return serializer.read(rawValue);
619
- }
620
- function update(event) {
621
- if (event && event.storageArea !== storage) return;
622
- if (event && event.key == null) {
623
- data.value = rawInit;
624
- return;
625
- }
626
- if (event && event.key !== keyComputed.value) return;
627
- pauseWatch();
628
- try {
629
- const serializedData = serializer.write(data.value);
630
- if (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);
631
- } catch (e) {
632
- onError(e);
633
- } finally {
634
- if (event) nextTick(resumeWatch);
635
- else resumeWatch();
636
- }
637
- }
638
- function updateFromCustomEvent(event) {
639
- update(event.detail);
640
- }
641
- return data;
642
- }
643
- var CSS_DISABLE_TRANS = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
644
- /**
645
- * Reactive color mode with auto data persistence.
646
- *
647
- * @see https://vueuse.org/useColorMode
648
- * @param options
649
- */
650
- function useColorMode(options = {}) {
651
- const { selector = "html", attribute = "class", initialValue = "auto", window: window$1 = defaultWindow, storage, storageKey = "vueuse-color-scheme", listenToStorageChanges = true, storageRef, emitAuto, disableTransition = true } = options;
652
- const modes = {
653
- auto: "",
654
- light: "light",
655
- dark: "dark",
656
- ...options.modes || {}
657
- };
658
- const preferredDark = usePreferredDark({ window: window$1 });
659
- const system = computed(() => preferredDark.value ? "dark" : "light");
660
- const store = storageRef || (storageKey == null ? toRef$1(initialValue) : useStorage(storageKey, initialValue, storage, {
661
- window: window$1,
662
- listenToStorageChanges
663
- }));
664
- const state = computed(() => store.value === "auto" ? system.value : store.value);
665
- const updateHTMLAttrs = getSSRHandler("updateHTMLAttrs", (selector$1, attribute$1, value) => {
666
- const el = typeof selector$1 === "string" ? window$1 === null || window$1 === void 0 ? void 0 : window$1.document.querySelector(selector$1) : unrefElement(selector$1);
667
- if (!el) return;
668
- const classesToAdd = /* @__PURE__ */ new Set();
669
- const classesToRemove = /* @__PURE__ */ new Set();
670
- let attributeToChange = null;
671
- if (attribute$1 === "class") {
672
- const current = value.split(/\s/g);
673
- Object.values(modes).flatMap((i) => (i || "").split(/\s/g)).filter(Boolean).forEach((v) => {
674
- if (current.includes(v)) classesToAdd.add(v);
675
- else classesToRemove.add(v);
676
- });
677
- } else attributeToChange = {
678
- key: attribute$1,
679
- value
680
- };
681
- if (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null) return;
682
- let style;
683
- if (disableTransition) {
684
- style = window$1.document.createElement("style");
685
- style.appendChild(document.createTextNode(CSS_DISABLE_TRANS));
686
- window$1.document.head.appendChild(style);
687
- }
688
- for (const c of classesToAdd) el.classList.add(c);
689
- for (const c of classesToRemove) el.classList.remove(c);
690
- if (attributeToChange) el.setAttribute(attributeToChange.key, attributeToChange.value);
691
- if (disableTransition) {
692
- window$1.getComputedStyle(style).opacity;
693
- document.head.removeChild(style);
694
- }
695
- });
696
- function defaultOnChanged(mode) {
697
- var _modes$mode;
698
- updateHTMLAttrs(selector, attribute, (_modes$mode = modes[mode]) !== null && _modes$mode !== void 0 ? _modes$mode : mode);
699
- }
700
- function onChanged(mode) {
701
- if (options.onChanged) options.onChanged(mode, defaultOnChanged);
702
- else defaultOnChanged(mode);
703
- }
704
- watch(state, onChanged, {
705
- flush: "post",
706
- immediate: true
707
- });
708
- tryOnMounted(() => onChanged(state.value));
709
- const auto = computed({
710
- get() {
711
- return emitAuto ? store.value : state.value;
712
- },
713
- set(v) {
714
- store.value = v;
715
- }
716
- });
717
- return Object.assign(auto, {
718
- store,
719
- system,
720
- state
721
- });
722
- }
723
- /**
724
- * Reactively track `document.visibilityState`.
725
- *
726
- * @see https://vueuse.org/useDocumentVisibility
727
- *
728
- * @__NO_SIDE_EFFECTS__
729
- */
730
- function useDocumentVisibility(options = {}) {
731
- const { document: document$1 = defaultDocument } = options;
732
- if (!document$1) return shallowRef("visible");
733
- const visibility = shallowRef(document$1.visibilityState);
734
- useEventListener(document$1, "visibilitychange", () => {
735
- visibility.value = document$1.visibilityState;
736
- }, { passive: true });
737
- return visibility;
738
- }
739
- function useDropZone(target, options = {}) {
740
- const isOverDropZone = shallowRef(false);
741
- const files = shallowRef(null);
742
- let counter = 0;
743
- let isValid = true;
744
- if (isClient) {
745
- var _options$multiple, _options$preventDefau;
746
- const _options = typeof options === "function" ? { onDrop: options } : options;
747
- const multiple = (_options$multiple = _options.multiple) !== null && _options$multiple !== void 0 ? _options$multiple : true;
748
- const preventDefaultForUnhandled = (_options$preventDefau = _options.preventDefaultForUnhandled) !== null && _options$preventDefau !== void 0 ? _options$preventDefau : false;
749
- const getFiles = (event) => {
750
- var _event$dataTransfer$f, _event$dataTransfer;
751
- const list = Array.from((_event$dataTransfer$f = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files) !== null && _event$dataTransfer$f !== void 0 ? _event$dataTransfer$f : []);
752
- return list.length === 0 ? null : multiple ? list : [list[0]];
753
- };
754
- const checkDataTypes = (types) => {
755
- const dataTypes = unref(_options.dataTypes);
756
- if (typeof dataTypes === "function") return dataTypes(types);
757
- if (!(dataTypes === null || dataTypes === void 0 ? void 0 : dataTypes.length)) return true;
758
- if (types.length === 0) return false;
759
- return types.every((type) => dataTypes.some((allowedType) => type.includes(allowedType)));
760
- };
761
- const checkValidity = (items) => {
762
- if (_options.checkValidity) return _options.checkValidity(items);
763
- const dataTypesValid = checkDataTypes(Array.from(items !== null && items !== void 0 ? items : []).map((item) => item.type));
764
- const multipleFilesValid = multiple || items.length <= 1;
765
- return dataTypesValid && multipleFilesValid;
766
- };
767
- const isSafari = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !("chrome" in window);
768
- const handleDragEvent = (event, eventType) => {
769
- var _event$dataTransfer2, _ref;
770
- const dataTransferItemList = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.items;
771
- isValid = (_ref = dataTransferItemList && checkValidity(dataTransferItemList)) !== null && _ref !== void 0 ? _ref : false;
772
- if (preventDefaultForUnhandled) event.preventDefault();
773
- if (!isSafari() && !isValid) {
774
- if (event.dataTransfer) event.dataTransfer.dropEffect = "none";
775
- return;
776
- }
777
- event.preventDefault();
778
- if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
779
- const currentFiles = getFiles(event);
780
- switch (eventType) {
781
- case "enter":
782
- var _options$onEnter;
783
- counter += 1;
784
- isOverDropZone.value = true;
785
- (_options$onEnter = _options.onEnter) === null || _options$onEnter === void 0 || _options$onEnter.call(_options, null, event);
786
- break;
787
- case "over":
788
- var _options$onOver;
789
- (_options$onOver = _options.onOver) === null || _options$onOver === void 0 || _options$onOver.call(_options, null, event);
790
- break;
791
- case "leave":
792
- var _options$onLeave;
793
- counter -= 1;
794
- if (counter === 0) isOverDropZone.value = false;
795
- (_options$onLeave = _options.onLeave) === null || _options$onLeave === void 0 || _options$onLeave.call(_options, null, event);
796
- break;
797
- case "drop":
798
- counter = 0;
799
- isOverDropZone.value = false;
800
- if (isValid) {
801
- var _options$onDrop;
802
- files.value = currentFiles;
803
- (_options$onDrop = _options.onDrop) === null || _options$onDrop === void 0 || _options$onDrop.call(_options, currentFiles, event);
804
- }
805
- }
806
- };
807
- useEventListener(target, "dragenter", (event) => handleDragEvent(event, "enter"));
808
- useEventListener(target, "dragover", (event) => handleDragEvent(event, "over"));
809
- useEventListener(target, "dragleave", (event) => handleDragEvent(event, "leave"));
810
- useEventListener(target, "drop", (event) => handleDragEvent(event, "drop"));
811
- }
812
- return {
813
- files,
814
- isOverDropZone
815
- };
816
- }
817
- function useElementHover(el, options = {}) {
818
- const { delayEnter = 0, delayLeave = 0, triggerOnRemoval = false, window: window$1 = defaultWindow } = options;
819
- const isHovered = shallowRef(false);
820
- let timer;
821
- const toggle = (entering) => {
822
- const delay = entering ? delayEnter : delayLeave;
823
- if (timer) {
824
- clearTimeout(timer);
825
- timer = void 0;
826
- }
827
- if (delay) timer = setTimeout(() => isHovered.value = entering, delay);
828
- else isHovered.value = entering;
829
- };
830
- if (!window$1) return isHovered;
831
- useEventListener(el, "mouseenter", () => toggle(true), { passive: true });
832
- useEventListener(el, "mouseleave", () => toggle(false), { passive: true });
833
- if (triggerOnRemoval) onElementRemoval(computed(() => unrefElement(el)), () => toggle(false));
834
- return isHovered;
835
- }
836
- /**
837
- * Detects that a target element's visibility.
838
- *
839
- * @see https://vueuse.org/useIntersectionObserver
840
- * @param target
841
- * @param callback
842
- * @param options
843
- */
844
- function useIntersectionObserver(target, callback, options = {}) {
845
- const { root, rootMargin, threshold = 0, window: window$1 = defaultWindow, immediate = true } = options;
846
- const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "IntersectionObserver" in window$1);
847
- const targets = computed(() => {
848
- return toArray(toValue(target)).map(unrefElement).filter(notNullish);
849
- });
850
- let cleanup = noop;
851
- const isActive = shallowRef(immediate);
852
- const stopWatch = isSupported.value ? watch(() => [
853
- targets.value,
854
- unrefElement(root),
855
- toValue(rootMargin),
856
- isActive.value
857
- ], ([targets$1, root$1, rootMargin$1]) => {
858
- cleanup();
859
- if (!isActive.value) return;
860
- if (!targets$1.length) return;
861
- const observer = new IntersectionObserver(callback, {
862
- root: unrefElement(root$1),
863
- rootMargin: rootMargin$1,
864
- threshold
865
- });
866
- targets$1.forEach((el) => el && observer.observe(el));
867
- cleanup = () => {
868
- observer.disconnect();
869
- cleanup = noop;
870
- };
871
- }, {
872
- immediate,
873
- flush: "post"
874
- }) : noop;
875
- const stop = () => {
876
- cleanup();
877
- stopWatch();
878
- isActive.value = false;
879
- };
880
- tryOnScopeDispose(stop);
881
- return {
882
- isSupported,
883
- isActive,
884
- pause() {
885
- cleanup();
886
- isActive.value = false;
887
- },
888
- resume() {
889
- isActive.value = true;
890
- },
891
- stop
892
- };
893
- }
894
- var DEFAULT_OPTIONS = {
895
- multiple: true,
896
- accept: "*",
897
- reset: false,
898
- directory: false
899
- };
900
- function prepareInitialFiles(files) {
901
- if (!files) return null;
902
- if (files instanceof FileList) return files;
903
- const dt = new DataTransfer();
904
- for (const file of files) dt.items.add(file);
905
- return dt.files;
906
- }
907
- /**
908
- * Open file dialog with ease.
909
- *
910
- * @see https://vueuse.org/useFileDialog
911
- * @param options
912
- */
913
- function useFileDialog(options = {}) {
914
- const { document: document$1 = defaultDocument } = options;
915
- const files = ref(prepareInitialFiles(options.initialFiles));
916
- const { on: onChange, trigger: changeTrigger } = createEventHook();
917
- const { on: onCancel, trigger: cancelTrigger } = createEventHook();
918
- const inputRef = computed(() => {
919
- var _unrefElement;
920
- const input = (_unrefElement = unrefElement(options.input)) !== null && _unrefElement !== void 0 ? _unrefElement : document$1 ? document$1.createElement("input") : void 0;
921
- if (input) {
922
- input.type = "file";
923
- input.onchange = (event) => {
924
- files.value = event.target.files;
925
- changeTrigger(files.value);
926
- };
927
- input.oncancel = () => {
928
- cancelTrigger();
929
- };
930
- }
931
- return input;
932
- });
933
- const reset = () => {
934
- files.value = null;
935
- if (inputRef.value && inputRef.value.value) {
936
- inputRef.value.value = "";
937
- changeTrigger(null);
938
- }
939
- };
940
- const applyOptions = (options$1) => {
941
- const el = inputRef.value;
942
- if (!el) return;
943
- el.multiple = toValue(options$1.multiple);
944
- el.accept = toValue(options$1.accept);
945
- el.webkitdirectory = toValue(options$1.directory);
946
- if (hasOwn(options$1, "capture")) el.capture = toValue(options$1.capture);
947
- };
948
- const open = (localOptions) => {
949
- const el = inputRef.value;
950
- if (!el) return;
951
- const mergedOptions = {
952
- ...DEFAULT_OPTIONS,
953
- ...options,
954
- ...localOptions
955
- };
956
- applyOptions(mergedOptions);
957
- if (toValue(mergedOptions.reset)) reset();
958
- el.click();
959
- };
960
- watchEffect(() => {
961
- applyOptions(options);
962
- });
963
- return {
964
- files: readonly(files),
965
- open,
966
- reset,
967
- onCancel,
968
- onChange
969
- };
970
- }
971
- /**
972
- * Track or set the focus state of a DOM element.
973
- *
974
- * @see https://vueuse.org/useFocus
975
- * @param target The target element for the focus and blur events.
976
- * @param options
977
- */
978
- function useFocus(target, options = {}) {
979
- const { initialValue = false, focusVisible = false, preventScroll = false } = options;
980
- const innerFocused = shallowRef(false);
981
- const targetElement = computed(() => unrefElement(target));
982
- const listenerOptions = { passive: true };
983
- useEventListener(targetElement, "focus", (event) => {
984
- var _matches, _ref;
985
- if (!focusVisible || ((_matches = (_ref = event.target).matches) === null || _matches === void 0 ? void 0 : _matches.call(_ref, ":focus-visible"))) innerFocused.value = true;
986
- }, listenerOptions);
987
- useEventListener(targetElement, "blur", () => innerFocused.value = false, listenerOptions);
988
- const focused = computed({
989
- get: () => innerFocused.value,
990
- set(value) {
991
- var _targetElement$value, _targetElement$value2;
992
- if (!value && innerFocused.value) (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || _targetElement$value.blur();
993
- else if (value && !innerFocused.value) (_targetElement$value2 = targetElement.value) === null || _targetElement$value2 === void 0 || _targetElement$value2.focus({ preventScroll });
994
- }
995
- });
996
- watch(targetElement, () => {
997
- focused.value = initialValue;
998
- }, {
999
- immediate: true,
1000
- flush: "post"
1001
- });
1002
- return { focused };
1003
- }
1004
- /**
1005
- * Resolves an element from a given element, window, or document.
1006
- *
1007
- * @internal
1008
- */
1009
- function resolveElement(el) {
1010
- if (typeof Window !== "undefined" && el instanceof Window) return el.document.documentElement;
1011
- if (typeof Document !== "undefined" && el instanceof Document) return el.documentElement;
1012
- return el;
1013
- }
1014
- var UseMouseBuiltinExtractors = {
1015
- page: (event) => [event.pageX, event.pageY],
1016
- client: (event) => [event.clientX, event.clientY],
1017
- screen: (event) => [event.screenX, event.screenY],
1018
- movement: (event) => event instanceof MouseEvent ? [event.movementX, event.movementY] : null
1019
- };
1020
- /**
1021
- * Reactive mouse position.
1022
- *
1023
- * @see https://vueuse.org/useMouse
1024
- * @param options
1025
- */
1026
- function useMouse(options = {}) {
1027
- const { type = "page", touch = true, resetOnTouchEnds = false, initialValue = {
1028
- x: 0,
1029
- y: 0
1030
- }, window: window$1 = defaultWindow, target = window$1, scroll = true, eventFilter } = options;
1031
- let _prevMouseEvent = null;
1032
- let _prevScrollX = 0;
1033
- let _prevScrollY = 0;
1034
- const x = shallowRef(initialValue.x);
1035
- const y = shallowRef(initialValue.y);
1036
- const sourceType = shallowRef(null);
1037
- const extractor = typeof type === "function" ? type : UseMouseBuiltinExtractors[type];
1038
- const mouseHandler = (event) => {
1039
- const result = extractor(event);
1040
- _prevMouseEvent = event;
1041
- if (result) {
1042
- [x.value, y.value] = result;
1043
- sourceType.value = "mouse";
1044
- }
1045
- if (window$1) {
1046
- _prevScrollX = window$1.scrollX;
1047
- _prevScrollY = window$1.scrollY;
1048
- }
1049
- };
1050
- const touchHandler = (event) => {
1051
- if (event.touches.length > 0) {
1052
- const result = extractor(event.touches[0]);
1053
- if (result) {
1054
- [x.value, y.value] = result;
1055
- sourceType.value = "touch";
1056
- }
1057
- }
1058
- };
1059
- const scrollHandler = () => {
1060
- if (!_prevMouseEvent || !window$1) return;
1061
- const pos = extractor(_prevMouseEvent);
1062
- if (_prevMouseEvent instanceof MouseEvent && pos) {
1063
- x.value = pos[0] + window$1.scrollX - _prevScrollX;
1064
- y.value = pos[1] + window$1.scrollY - _prevScrollY;
1065
- }
1066
- };
1067
- const reset = () => {
1068
- x.value = initialValue.x;
1069
- y.value = initialValue.y;
1070
- };
1071
- const mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);
1072
- const touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);
1073
- const scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();
1074
- if (target) {
1075
- const listenerOptions = { passive: true };
1076
- useEventListener(target, ["mousemove", "dragover"], mouseHandlerWrapper, listenerOptions);
1077
- if (touch && type !== "movement") {
1078
- useEventListener(target, ["touchstart", "touchmove"], touchHandlerWrapper, listenerOptions);
1079
- if (resetOnTouchEnds) useEventListener(target, "touchend", reset, listenerOptions);
1080
- }
1081
- if (scroll && type === "page") useEventListener(window$1, "scroll", scrollHandlerWrapper, listenerOptions);
1082
- }
1083
- return {
1084
- x,
1085
- y,
1086
- sourceType
1087
- };
1088
- }
1089
- function checkOverflowScroll(ele) {
1090
- const style = window.getComputedStyle(ele);
1091
- if (style.overflowX === "scroll" || style.overflowY === "scroll" || style.overflowX === "auto" && ele.clientWidth < ele.scrollWidth || style.overflowY === "auto" && ele.clientHeight < ele.scrollHeight) return true;
1092
- else {
1093
- const parent = ele.parentNode;
1094
- if (!parent || parent.tagName === "BODY") return false;
1095
- return checkOverflowScroll(parent);
1096
- }
1097
- }
1098
- function preventDefault(rawEvent) {
1099
- const e = rawEvent || window.event;
1100
- const _target = e.target;
1101
- if (checkOverflowScroll(_target)) return false;
1102
- if (e.touches.length > 1) return true;
1103
- if (e.preventDefault) e.preventDefault();
1104
- return false;
1105
- }
1106
- var elInitialOverflow = /* @__PURE__ */ new WeakMap();
1107
- /**
1108
- * Lock scrolling of the element.
1109
- *
1110
- * @see https://vueuse.org/useScrollLock
1111
- * @param element
1112
- */
1113
- function useScrollLock(element, initialState = false) {
1114
- const isLocked = shallowRef(initialState);
1115
- let stopTouchMoveListener = null;
1116
- let initialOverflow = "";
1117
- watch(toRef$1(element), (el) => {
1118
- const target = resolveElement(toValue(el));
1119
- if (target) {
1120
- const ele = target;
1121
- if (!elInitialOverflow.get(ele)) elInitialOverflow.set(ele, ele.style.overflow);
1122
- if (ele.style.overflow !== "hidden") initialOverflow = ele.style.overflow;
1123
- if (ele.style.overflow === "hidden") return isLocked.value = true;
1124
- if (isLocked.value) return ele.style.overflow = "hidden";
1125
- }
1126
- }, { immediate: true });
1127
- const lock = () => {
1128
- const el = resolveElement(toValue(element));
1129
- if (!el || isLocked.value) return;
1130
- if (isIOS) stopTouchMoveListener = useEventListener(el, "touchmove", (e) => {
1131
- preventDefault(e);
1132
- }, { passive: false });
1133
- el.style.overflow = "hidden";
1134
- isLocked.value = true;
1135
- };
1136
- const unlock = () => {
1137
- const el = resolveElement(toValue(element));
1138
- if (!el || !isLocked.value) return;
1139
- if (isIOS) stopTouchMoveListener === null || stopTouchMoveListener === void 0 || stopTouchMoveListener();
1140
- el.style.overflow = initialOverflow;
1141
- elInitialOverflow.delete(el);
1142
- isLocked.value = false;
1143
- };
1144
- tryOnScopeDispose(unlock);
1145
- return computed({
1146
- get() {
1147
- return isLocked.value;
1148
- },
1149
- set(v) {
1150
- if (v) lock();
1151
- else unlock();
1152
- }
1153
- });
1154
- }
1155
- /**
1156
- * Reactive swipe detection.
1157
- *
1158
- * @see https://vueuse.org/useSwipe
1159
- * @param target
1160
- * @param options
1161
- */
1162
- function useSwipe(target, options = {}) {
1163
- const { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, passive = true } = options;
1164
- const coordsStart = reactive({
1165
- x: 0,
1166
- y: 0
1167
- });
1168
- const coordsEnd = reactive({
1169
- x: 0,
1170
- y: 0
1171
- });
1172
- const diffX = computed(() => coordsStart.x - coordsEnd.x);
1173
- const diffY = computed(() => coordsStart.y - coordsEnd.y);
1174
- const { max, abs } = Math;
1175
- const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);
1176
- const isSwiping = shallowRef(false);
1177
- const direction = computed(() => {
1178
- if (!isThresholdExceeded.value) return "none";
1179
- if (abs(diffX.value) > abs(diffY.value)) return diffX.value > 0 ? "left" : "right";
1180
- else return diffY.value > 0 ? "up" : "down";
1181
- });
1182
- const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];
1183
- const updateCoordsStart = (x, y) => {
1184
- coordsStart.x = x;
1185
- coordsStart.y = y;
1186
- };
1187
- const updateCoordsEnd = (x, y) => {
1188
- coordsEnd.x = x;
1189
- coordsEnd.y = y;
1190
- };
1191
- const listenerOptions = {
1192
- passive,
1193
- capture: !passive
1194
- };
1195
- const onTouchEnd = (e) => {
1196
- if (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);
1197
- isSwiping.value = false;
1198
- };
1199
- const stops = [
1200
- useEventListener(target, "touchstart", (e) => {
1201
- if (e.touches.length !== 1) return;
1202
- const [x, y] = getTouchEventCoords(e);
1203
- updateCoordsStart(x, y);
1204
- updateCoordsEnd(x, y);
1205
- onSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);
1206
- }, listenerOptions),
1207
- useEventListener(target, "touchmove", (e) => {
1208
- if (e.touches.length !== 1) return;
1209
- const [x, y] = getTouchEventCoords(e);
1210
- updateCoordsEnd(x, y);
1211
- if (listenerOptions.capture && !listenerOptions.passive && Math.abs(diffX.value) > Math.abs(diffY.value)) e.preventDefault();
1212
- if (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;
1213
- if (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);
1214
- }, listenerOptions),
1215
- useEventListener(target, ["touchend", "touchcancel"], onTouchEnd, listenerOptions)
1216
- ];
1217
- const stop = () => stops.forEach((s) => s());
1218
- return {
1219
- isSwiping,
1220
- direction,
1221
- coordsStart,
1222
- coordsEnd,
1223
- lengthX: diffX,
1224
- lengthY: diffY,
1225
- stop
1226
- };
1227
- }
1228
- Number.POSITIVE_INFINITY;
1229
- function getDefaultScheduler$2(options) {
1230
- if ("interval" in options || "immediate" in options) {
1231
- const { interval = "requestAnimationFrame", immediate = true } = options;
1232
- return interval === "requestAnimationFrame" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });
1233
- }
1234
- return useRafFn;
1235
- }
1236
- function useTimestamp(options = {}) {
1237
- const { controls: exposeControls = false, offset = 0, scheduler = getDefaultScheduler$2(options), callback } = options;
1238
- const ts = shallowRef(timestamp() + offset);
1239
- const update = () => ts.value = timestamp() + offset;
1240
- const controls = scheduler(callback ? () => {
1241
- update();
1242
- callback(ts.value);
1243
- } : update);
1244
- if (exposeControls) return {
1245
- timestamp: ts,
1246
- ...controls
1247
- };
1248
- else return ts;
1249
- }
1250
- /**
1251
- * Shorthand for v-model binding, props + emit -> ref
1252
- *
1253
- * @see https://vueuse.org/useVModel
1254
- * @param props
1255
- * @param key (default 'modelValue')
1256
- * @param emit
1257
- * @param options
1258
- *
1259
- * @__NO_SIDE_EFFECTS__
1260
- */
1261
- function useVModel(props, key, emit, options = {}) {
1262
- var _vm$$emit, _vm$proxy;
1263
- const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;
1264
- const vm = getCurrentInstance();
1265
- const _emit = emit || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy));
1266
- let event = eventName;
1267
- if (!key) key = "modelValue";
1268
- event = event || `update:${key.toString()}`;
1269
- const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
1270
- const getValue$1 = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;
1271
- const triggerEmit = (value) => {
1272
- if (shouldEmit) {
1273
- if (shouldEmit(value)) _emit(event, value);
1274
- } else _emit(event, value);
1275
- };
1276
- if (passive) {
1277
- const proxy = ref(getValue$1());
1278
- let isUpdating = false;
1279
- watch(() => props[key], (v) => {
1280
- if (!isUpdating) {
1281
- isUpdating = true;
1282
- proxy.value = cloneFn(v);
1283
- nextTick(() => isUpdating = false);
1284
- }
1285
- });
1286
- watch(proxy, (v) => {
1287
- if (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);
1288
- }, { deep });
1289
- return proxy;
1290
- } else return computed({
1291
- get() {
1292
- return getValue$1();
1293
- },
1294
- set(value) {
1295
- triggerEmit(value);
1296
- }
1297
- });
1298
- }
1299
- //#endregion
1300
- export { useVModel as S, useMouse as _, onKeyStroke as a, useSwipe as b, useColorMode as c, useElementHover as d, useEventListener as f, useMounted as g, useIntersectionObserver as h, onClickOutside as i, useDocumentVisibility as l, useFocus as m, defaultWindow as n, unrefElement as o, useFileDialog as p, getSSRHandler as r, useBreakpoints as s, breakpointsBootstrapV5 as t, useDropZone as u, useMutationObserver as v, useTimestamp as x, useScrollLock as y };
1301
-
1302
- //# sourceMappingURL=dist-9-XTMhb-.js.map