@indielayer/ui 1.9.3 → 1.10.1

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 (101) hide show
  1. package/docs/components/menu/DocsMenu.vue +1 -0
  2. package/docs/pages/component/form/usage.vue +2 -0
  3. package/docs/pages/component/menu/usage.vue +2 -0
  4. package/docs/pages/component/select/index.vue +7 -0
  5. package/docs/pages/component/select/multiple.vue +42 -0
  6. package/docs/pages/component/select/usage.vue +8 -12
  7. package/docs/pages/component/table/virtual.vue +19 -6
  8. package/docs/pages/component/toggle/index.vue +1 -1
  9. package/docs/pages/component/tooltip/index.vue +1 -1
  10. package/docs/pages/component/upload/index.vue +29 -0
  11. package/docs/pages/component/upload/usage.vue +115 -0
  12. package/docs/search/components.json +1 -1
  13. package/lib/common/icons.d.ts +2 -0
  14. package/lib/common/icons.js +17 -15
  15. package/lib/components/button/theme/Button.base.theme.js +30 -27
  16. package/lib/components/checkbox/Checkbox.vue2.js +9 -9
  17. package/lib/components/datepicker/Datepicker.vue.d.ts +4 -4
  18. package/lib/components/datepicker/Datepicker.vue.js +1 -1
  19. package/lib/components/drawer/Drawer.vue.js +1 -17
  20. package/lib/components/form/Form.vue.d.ts +4 -4
  21. package/lib/components/form/Form.vue.js +34 -34
  22. package/lib/components/formGroup/FormGroup.vue.d.ts +1 -1
  23. package/lib/components/formGroup/FormGroup.vue.js +39 -37
  24. package/lib/components/index.d.ts +1 -0
  25. package/lib/components/index.js +68 -66
  26. package/lib/components/label/theme/Label.base.theme.js +7 -7
  27. package/lib/components/menu/Menu.vue.d.ts +2 -0
  28. package/lib/components/menu/MenuItem.vue.d.ts +15 -3
  29. package/lib/components/menu/MenuItem.vue.js +1 -1
  30. package/lib/components/menu/MenuItem.vue2.js +43 -37
  31. package/lib/components/modal/Modal.vue.d.ts +4 -4
  32. package/lib/components/modal/Modal.vue.js +38 -34
  33. package/lib/components/notifications/Notifications.vue.d.ts +15 -0
  34. package/lib/components/notifications/Notifications.vue.js +149 -127
  35. package/lib/components/progress/Progress.vue.d.ts +4 -4
  36. package/lib/components/progress/Progress.vue.js +7 -7
  37. package/lib/components/scroll/Scroll.vue2.js +1 -1
  38. package/lib/components/select/Select.vue.d.ts +43 -1
  39. package/lib/components/select/Select.vue.js +358 -258
  40. package/lib/components/select/theme/Select.base.theme.js +1 -0
  41. package/lib/components/tab/Tab.vue.js +1 -1
  42. package/lib/components/tab/TabGroup.vue.js +2 -2
  43. package/lib/components/table/TableCell.vue.d.ts +1 -1
  44. package/lib/components/table/theme/TableHead.base.theme.js +1 -1
  45. package/lib/components/table/theme/TableHeader.base.theme.js +1 -1
  46. package/lib/components/tag/Tag.vue.js +23 -21
  47. package/lib/components/textarea/Textarea.vue.js +1 -1
  48. package/lib/components/upload/Upload.vue.d.ts +195 -0
  49. package/lib/components/upload/Upload.vue.js +264 -0
  50. package/lib/components/upload/Upload.vue2.js +4 -0
  51. package/lib/components/upload/__tests__/Upload.spec.d.ts +1 -0
  52. package/lib/components/upload/index.d.ts +2 -0
  53. package/lib/components/upload/theme/Upload.base.theme.d.ts +3 -0
  54. package/lib/components/upload/theme/Upload.base.theme.js +8 -0
  55. package/lib/components/upload/theme/Upload.carbon.theme.d.ts +3 -0
  56. package/lib/components/upload/theme/Upload.carbon.theme.js +5 -0
  57. package/lib/composables/useVirtualList.js +56 -53
  58. package/lib/index.js +43 -41
  59. package/lib/index.umd.js +4 -4
  60. package/lib/node_modules/.pnpm/@vueuse_core@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/core/index.js +501 -0
  61. package/lib/node_modules/.pnpm/@vueuse_shared@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js +96 -0
  62. package/lib/theme.d.ts +2 -1
  63. package/lib/themes/base/components.d.ts +1 -0
  64. package/lib/themes/base/components.js +23 -21
  65. package/lib/themes/carbon/components.d.ts +1 -0
  66. package/lib/themes/carbon/components.js +23 -21
  67. package/lib/version.d.ts +1 -1
  68. package/lib/version.js +1 -1
  69. package/package.json +3 -3
  70. package/src/common/icons.ts +2 -0
  71. package/src/components/button/theme/Button.base.theme.ts +6 -3
  72. package/src/components/checkbox/Checkbox.vue +5 -5
  73. package/src/components/drawer/Drawer.vue +0 -16
  74. package/src/components/form/Form.vue +10 -4
  75. package/src/components/formGroup/FormGroup.vue +2 -0
  76. package/src/components/index.ts +1 -0
  77. package/src/components/label/theme/Label.base.theme.ts +7 -5
  78. package/src/components/menu/Menu.vue +2 -0
  79. package/src/components/menu/MenuItem.vue +8 -6
  80. package/src/components/modal/Modal.vue +6 -1
  81. package/src/components/notifications/Notifications.vue +34 -4
  82. package/src/components/progress/Progress.vue +2 -2
  83. package/src/components/select/Select.vue +166 -68
  84. package/src/components/select/theme/Select.base.theme.ts +2 -0
  85. package/src/components/table/theme/TableHead.base.theme.ts +1 -1
  86. package/src/components/table/theme/TableHeader.base.theme.ts +1 -1
  87. package/src/components/tag/Tag.vue +12 -10
  88. package/src/components/upload/Upload.vue +365 -0
  89. package/src/components/upload/__tests__/Upload.spec.ts +11 -0
  90. package/src/components/upload/index.ts +2 -0
  91. package/src/components/upload/theme/Upload.base.theme.ts +9 -0
  92. package/src/components/upload/theme/Upload.carbon.theme.ts +7 -0
  93. package/src/composables/useInputtable.ts +1 -1
  94. package/src/composables/useVirtualList.ts +8 -5
  95. package/src/theme.ts +2 -0
  96. package/src/themes/base/components.ts +1 -0
  97. package/src/themes/carbon/components.ts +1 -0
  98. package/src/version.ts +1 -1
  99. package/volar.d.ts +1 -0
  100. package/lib/node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/core/index.js +0 -412
  101. package/lib/node_modules/.pnpm/@vueuse_shared@10.2.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js +0 -90
@@ -1,412 +0,0 @@
1
- import { noop as I, toValue as A, tryOnScopeDispose as W, isIOS as G, useThrottleFn as N, isClient as Q, increaseWithUnit as U, toRef as J, useDebounceFn as K } from "../../../../@vueuse_shared@10.2.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
2
- import { createFilterWrapper as Se, debounceFilter as Oe, throttleFilter as xe } from "../../../../@vueuse_shared@10.2.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
3
- import { watch as D, computed as O, ref as _, reactive as C, watchEffect as Z, getCurrentInstance as ee, onMounted as te } from "vue";
4
- function S(e) {
5
- var s;
6
- const o = A(e);
7
- return (s = o == null ? void 0 : o.$el) != null ? s : o;
8
- }
9
- const $ = Q ? window : void 0;
10
- function x(...e) {
11
- let s, o, n, i;
12
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([o, n, i] = e, s = $) : [s, o, n, i] = e, !s)
13
- return I;
14
- Array.isArray(o) || (o = [o]), Array.isArray(n) || (n = [n]);
15
- const m = [], u = () => {
16
- m.forEach((c) => c()), m.length = 0;
17
- }, t = (c, p, l, d) => (c.addEventListener(p, l, d), () => c.removeEventListener(p, l, d)), r = D(
18
- () => [S(s), A(i)],
19
- ([c, p]) => {
20
- u(), c && m.push(
21
- ...o.flatMap((l) => n.map((d) => t(c, l, d, p)))
22
- );
23
- },
24
- { immediate: !0, flush: "post" }
25
- ), a = () => {
26
- r(), u();
27
- };
28
- return W(a), a;
29
- }
30
- let H = !1;
31
- function ve(e, s, o = {}) {
32
- const { window: n = $, ignore: i = [], capture: m = !0, detectIframe: u = !1 } = o;
33
- if (!n)
34
- return;
35
- G && !H && (H = !0, Array.from(n.document.body.children).forEach((l) => l.addEventListener("click", I)));
36
- let t = !0;
37
- const r = (l) => i.some((d) => {
38
- if (typeof d == "string")
39
- return Array.from(n.document.querySelectorAll(d)).some((h) => h === l.target || l.composedPath().includes(h));
40
- {
41
- const h = S(d);
42
- return h && (l.target === h || l.composedPath().includes(h));
43
- }
44
- }), c = [
45
- x(n, "click", (l) => {
46
- const d = S(e);
47
- if (!(!d || d === l.target || l.composedPath().includes(d))) {
48
- if (l.detail === 0 && (t = !r(l)), !t) {
49
- t = !0;
50
- return;
51
- }
52
- s(l);
53
- }
54
- }, { passive: !0, capture: m }),
55
- x(n, "pointerdown", (l) => {
56
- const d = S(e);
57
- d && (t = !l.composedPath().includes(d) && !r(l));
58
- }, { passive: !0 }),
59
- u && x(n, "blur", (l) => {
60
- setTimeout(() => {
61
- var d;
62
- const h = S(e);
63
- ((d = n.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(h != null && h.contains(n.document.activeElement)) && s(l);
64
- }, 0);
65
- })
66
- ].filter(Boolean);
67
- return () => c.forEach((l) => l());
68
- }
69
- function ne() {
70
- const e = _(!1);
71
- return ee() && te(() => {
72
- e.value = !0;
73
- }), e;
74
- }
75
- function k(e) {
76
- const s = ne();
77
- return O(() => (s.value, !!e()));
78
- }
79
- function B(e, s = {}) {
80
- const { window: o = $ } = s, n = k(() => o && "matchMedia" in o && typeof o.matchMedia == "function");
81
- let i;
82
- const m = _(!1), u = () => {
83
- i && ("removeEventListener" in i ? i.removeEventListener("change", t) : i.removeListener(t));
84
- }, t = () => {
85
- n.value && (u(), i = o.matchMedia(J(e).value), m.value = !!(i != null && i.matches), i && ("addEventListener" in i ? i.addEventListener("change", t) : i.addListener(t)));
86
- };
87
- return Z(t), W(() => u()), m;
88
- }
89
- const pe = {
90
- sm: 640,
91
- md: 768,
92
- lg: 1024,
93
- xl: 1280,
94
- "2xl": 1536
95
- };
96
- function me(e, s = {}) {
97
- function o(t, r) {
98
- let a = e[t];
99
- return r != null && (a = U(a, r)), typeof a == "number" && (a = `${a}px`), a;
100
- }
101
- const { window: n = $ } = s;
102
- function i(t) {
103
- return n ? n.matchMedia(t).matches : !1;
104
- }
105
- const m = (t) => B(`(min-width: ${o(t)})`, s), u = Object.keys(e).reduce((t, r) => (Object.defineProperty(t, r, {
106
- get: () => m(r),
107
- enumerable: !0,
108
- configurable: !0
109
- }), t), {});
110
- return Object.assign(u, {
111
- greater(t) {
112
- return B(`(min-width: ${o(t, 0.1)})`, s);
113
- },
114
- greaterOrEqual: m,
115
- smaller(t) {
116
- return B(`(max-width: ${o(t, -0.1)})`, s);
117
- },
118
- smallerOrEqual(t) {
119
- return B(`(max-width: ${o(t)})`, s);
120
- },
121
- between(t, r) {
122
- return B(`(min-width: ${o(t)}) and (max-width: ${o(r, -0.1)})`, s);
123
- },
124
- isGreater(t) {
125
- return i(`(min-width: ${o(t, 0.1)})`);
126
- },
127
- isGreaterOrEqual(t) {
128
- return i(`(min-width: ${o(t)})`);
129
- },
130
- isSmaller(t) {
131
- return i(`(max-width: ${o(t, -0.1)})`);
132
- },
133
- isSmallerOrEqual(t) {
134
- return i(`(max-width: ${o(t)})`);
135
- },
136
- isInBetween(t, r) {
137
- return i(`(min-width: ${o(t)}) and (max-width: ${o(r, -0.1)})`);
138
- },
139
- current() {
140
- const t = Object.keys(e).map((r) => [r, m(r)]);
141
- return O(() => t.filter(([, r]) => r.value).map(([r]) => r));
142
- }
143
- });
144
- }
145
- var X = Object.getOwnPropertySymbols, oe = Object.prototype.hasOwnProperty, re = Object.prototype.propertyIsEnumerable, se = (e, s) => {
146
- var o = {};
147
- for (var n in e)
148
- oe.call(e, n) && s.indexOf(n) < 0 && (o[n] = e[n]);
149
- if (e != null && X)
150
- for (var n of X(e))
151
- s.indexOf(n) < 0 && re.call(e, n) && (o[n] = e[n]);
152
- return o;
153
- };
154
- function he(e, s, o = {}) {
155
- const n = o, { window: i = $ } = n, m = se(n, ["window"]);
156
- let u;
157
- const t = k(() => i && "MutationObserver" in i), r = () => {
158
- u && (u.disconnect(), u = void 0);
159
- }, a = D(
160
- () => S(e),
161
- (p) => {
162
- r(), t.value && i && p && (u = new MutationObserver(s), u.observe(p, m));
163
- },
164
- { immediate: !0 }
165
- ), c = () => {
166
- r(), a();
167
- };
168
- return W(c), {
169
- isSupported: t,
170
- stop: c
171
- };
172
- }
173
- var V = Object.getOwnPropertySymbols, ie = Object.prototype.hasOwnProperty, le = Object.prototype.propertyIsEnumerable, ue = (e, s) => {
174
- var o = {};
175
- for (var n in e)
176
- ie.call(e, n) && s.indexOf(n) < 0 && (o[n] = e[n]);
177
- if (e != null && V)
178
- for (var n of V(e))
179
- s.indexOf(n) < 0 && le.call(e, n) && (o[n] = e[n]);
180
- return o;
181
- };
182
- function ae(e, s, o = {}) {
183
- const n = o, { window: i = $ } = n, m = ue(n, ["window"]);
184
- let u;
185
- const t = k(() => i && "ResizeObserver" in i), r = () => {
186
- u && (u.disconnect(), u = void 0);
187
- }, a = O(
188
- () => Array.isArray(e) ? e.map((l) => S(l)) : [S(e)]
189
- ), c = D(
190
- a,
191
- (l) => {
192
- if (r(), t.value && i) {
193
- u = new ResizeObserver(s);
194
- for (const d of l)
195
- d && u.observe(d, m);
196
- }
197
- },
198
- { immediate: !0, flush: "post", deep: !0 }
199
- ), p = () => {
200
- r(), c();
201
- };
202
- return W(p), {
203
- isSupported: t,
204
- stop: p
205
- };
206
- }
207
- function be(e, s = { width: 0, height: 0 }, o = {}) {
208
- const { window: n = $, box: i = "content-box" } = o, m = O(() => {
209
- var r, a;
210
- return (a = (r = S(e)) == null ? void 0 : r.namespaceURI) == null ? void 0 : a.includes("svg");
211
- }), u = _(s.width), t = _(s.height);
212
- return ae(
213
- e,
214
- ([r]) => {
215
- const a = i === "border-box" ? r.borderBoxSize : i === "content-box" ? r.contentBoxSize : r.devicePixelContentBoxSize;
216
- if (n && m.value) {
217
- const c = S(e);
218
- if (c) {
219
- const p = n.getComputedStyle(c);
220
- u.value = Number.parseFloat(p.width), t.value = Number.parseFloat(p.height);
221
- }
222
- } else if (a) {
223
- const c = Array.isArray(a) ? a : [a];
224
- u.value = c.reduce((p, { inlineSize: l }) => p + l, 0), t.value = c.reduce((p, { blockSize: l }) => p + l, 0);
225
- } else
226
- u.value = r.contentRect.width, t.value = r.contentRect.height;
227
- },
228
- o
229
- ), D(
230
- () => S(e),
231
- (r) => {
232
- u.value = r ? s.width : 0, t.value = r ? s.height : 0;
233
- }
234
- ), {
235
- width: u,
236
- height: t
237
- };
238
- }
239
- const Y = 1;
240
- function we(e, s = {}) {
241
- const {
242
- throttle: o = 0,
243
- idle: n = 200,
244
- onStop: i = I,
245
- onScroll: m = I,
246
- offset: u = {
247
- left: 0,
248
- right: 0,
249
- top: 0,
250
- bottom: 0
251
- },
252
- eventListenerOptions: t = {
253
- capture: !1,
254
- passive: !0
255
- },
256
- behavior: r = "auto"
257
- } = s, a = _(0), c = _(0), p = O({
258
- get() {
259
- return a.value;
260
- },
261
- set(v) {
262
- d(v, void 0);
263
- }
264
- }), l = O({
265
- get() {
266
- return c.value;
267
- },
268
- set(v) {
269
- d(void 0, v);
270
- }
271
- });
272
- function d(v, y) {
273
- var M, T, f;
274
- const w = A(e);
275
- w && ((f = w instanceof Document ? document.body : w) == null || f.scrollTo({
276
- top: (M = A(y)) != null ? M : l.value,
277
- left: (T = A(v)) != null ? T : p.value,
278
- behavior: A(r)
279
- }));
280
- }
281
- const h = _(!1), b = C({
282
- left: !0,
283
- right: !1,
284
- top: !0,
285
- bottom: !1
286
- }), E = C({
287
- left: !1,
288
- right: !1,
289
- top: !1,
290
- bottom: !1
291
- }), R = (v) => {
292
- h.value && (h.value = !1, E.left = !1, E.right = !1, E.top = !1, E.bottom = !1, i(v));
293
- }, F = K(R, o + n), j = (v) => {
294
- const y = v === window ? v.document.documentElement : v === document ? v.documentElement : v, { display: M, flexDirection: T } = getComputedStyle(y), f = y.scrollLeft;
295
- E.left = f < a.value, E.right = f > a.value;
296
- const w = Math.abs(f) <= 0 + (u.left || 0), L = Math.abs(f) + y.clientWidth >= y.scrollWidth - (u.right || 0) - Y;
297
- M === "flex" && T === "row-reverse" ? (b.left = L, b.right = w) : (b.left = w, b.right = L), a.value = f;
298
- let P = y.scrollTop;
299
- v === document && !P && (P = document.body.scrollTop), E.top = P < c.value, E.bottom = P > c.value;
300
- const z = Math.abs(P) <= 0 + (u.top || 0), q = Math.abs(P) + y.clientHeight >= y.scrollHeight - (u.bottom || 0) - Y;
301
- M === "flex" && T === "column-reverse" ? (b.top = q, b.bottom = z) : (b.top = z, b.bottom = q), c.value = P;
302
- }, g = (v) => {
303
- const y = v.target === document ? v.target.documentElement : v.target;
304
- j(y), h.value = !0, F(v), m(v);
305
- };
306
- return x(
307
- e,
308
- "scroll",
309
- o ? N(g, o, !0, !1) : g,
310
- t
311
- ), x(
312
- e,
313
- "scrollend",
314
- R,
315
- t
316
- ), {
317
- x: p,
318
- y: l,
319
- isScrolling: h,
320
- arrivedState: b,
321
- directions: E,
322
- measure() {
323
- const v = A(e);
324
- v && j(v);
325
- }
326
- };
327
- }
328
- function ye(e, s = {}) {
329
- const {
330
- threshold: o = 50,
331
- onSwipe: n,
332
- onSwipeEnd: i,
333
- onSwipeStart: m,
334
- passive: u = !0,
335
- window: t = $
336
- } = s, r = C({ x: 0, y: 0 }), a = C({ x: 0, y: 0 }), c = O(() => r.x - a.x), p = O(() => r.y - a.y), { max: l, abs: d } = Math, h = O(() => l(d(c.value), d(p.value)) >= o), b = _(!1), E = O(() => h.value ? d(c.value) > d(p.value) ? c.value > 0 ? "left" : "right" : p.value > 0 ? "up" : "down" : "none"), R = (f) => [f.touches[0].clientX, f.touches[0].clientY], F = (f, w) => {
337
- r.x = f, r.y = w;
338
- }, j = (f, w) => {
339
- a.x = f, a.y = w;
340
- };
341
- let g;
342
- const v = ce(t == null ? void 0 : t.document);
343
- u ? g = v ? { passive: !0 } : { capture: !1 } : g = v ? { passive: !1, capture: !0 } : { capture: !0 };
344
- const y = (f) => {
345
- b.value && (i == null || i(f, E.value)), b.value = !1;
346
- }, M = [
347
- x(e, "touchstart", (f) => {
348
- if (f.touches.length !== 1)
349
- return;
350
- g.capture && !g.passive && f.preventDefault();
351
- const [w, L] = R(f);
352
- F(w, L), j(w, L), m == null || m(f);
353
- }, g),
354
- x(e, "touchmove", (f) => {
355
- if (f.touches.length !== 1)
356
- return;
357
- const [w, L] = R(f);
358
- j(w, L), !b.value && h.value && (b.value = !0), b.value && (n == null || n(f));
359
- }, g),
360
- x(e, "touchend", y, g),
361
- x(e, "touchcancel", y, g)
362
- ];
363
- return {
364
- isPassiveEventSupported: v,
365
- isSwiping: b,
366
- direction: E,
367
- coordsStart: r,
368
- coordsEnd: a,
369
- lengthX: c,
370
- lengthY: p,
371
- stop: () => M.forEach((f) => f())
372
- };
373
- }
374
- function ce(e) {
375
- if (!e)
376
- return !1;
377
- let s = !1;
378
- const o = {
379
- get passive() {
380
- return s = !0, !1;
381
- }
382
- };
383
- return e.addEventListener("x", I, o), e.removeEventListener("x", I), s;
384
- }
385
- export {
386
- pe as breakpointsTailwind,
387
- Se as createFilterWrapper,
388
- Oe as debounceFilter,
389
- $ as defaultWindow,
390
- U as increaseWithUnit,
391
- Q as isClient,
392
- G as isIOS,
393
- I as noop,
394
- ve as onClickOutside,
395
- xe as throttleFilter,
396
- J as toRef,
397
- A as toValue,
398
- W as tryOnScopeDispose,
399
- S as unrefElement,
400
- me as useBreakpoints,
401
- K as useDebounceFn,
402
- be as useElementSize,
403
- x as useEventListener,
404
- B as useMediaQuery,
405
- ne as useMounted,
406
- he as useMutationObserver,
407
- ae as useResizeObserver,
408
- we as useScroll,
409
- k as useSupported,
410
- ye as useSwipe,
411
- N as useThrottleFn
412
- };
@@ -1,90 +0,0 @@
1
- import { getCurrentScope as y, onScopeDispose as x, unref as F, toRef as P, readonly as R, customRef as b, ref as S } from "vue";
2
- function C(e) {
3
- return y() ? (x(e), !0) : !1;
4
- }
5
- function w(e) {
6
- return typeof e == "function" ? e() : F(e);
7
- }
8
- const N = typeof window < "u", f = () => {
9
- }, I = /* @__PURE__ */ O();
10
- function O() {
11
- var e;
12
- return N && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
13
- }
14
- function v(e, n) {
15
- function r(...t) {
16
- return new Promise((i, o) => {
17
- Promise.resolve(e(() => n.apply(this, t), { fn: n, thisArg: this, args: t })).then(i).catch(o);
18
- });
19
- }
20
- return r;
21
- }
22
- function g(e, n = {}) {
23
- let r, t, i = f;
24
- const o = (u) => {
25
- clearTimeout(u), i(), i = f;
26
- };
27
- return (u) => {
28
- const l = w(e), s = w(n.maxWait);
29
- return r && o(r), l <= 0 || s !== void 0 && s <= 0 ? (t && (o(t), t = null), Promise.resolve(u())) : new Promise((a, p) => {
30
- i = n.rejectOnCancel ? p : a, s && !t && (t = setTimeout(() => {
31
- r && o(r), t = null, a(u());
32
- }, s)), r = setTimeout(() => {
33
- t && o(t), t = null, a(u());
34
- }, l);
35
- });
36
- };
37
- }
38
- function j(e, n = !0, r = !0, t = !1) {
39
- let i = 0, o, c = !0, u = f, l;
40
- const s = () => {
41
- o && (clearTimeout(o), o = void 0, u(), u = f);
42
- };
43
- return (p) => {
44
- const m = w(e), h = Date.now() - i, d = () => l = p();
45
- return s(), m <= 0 ? (i = Date.now(), d()) : (h > m && (r || !c) ? (i = Date.now(), d()) : n && (l = new Promise((T, D) => {
46
- u = t ? D : T, o = setTimeout(() => {
47
- i = Date.now(), c = !0, T(d()), s();
48
- }, Math.max(0, m - h));
49
- })), !r && !o && (o = setTimeout(() => c = !0, m)), c = !1, l);
50
- };
51
- }
52
- function W(e, n) {
53
- var r;
54
- if (typeof e == "number")
55
- return e + n;
56
- const t = ((r = e.match(/^-?[0-9]+\.?[0-9]*/)) == null ? void 0 : r[0]) || "", i = e.slice(t.length), o = Number.parseFloat(t) + n;
57
- return Number.isNaN(o) ? e : o + i;
58
- }
59
- function _(...e) {
60
- if (e.length !== 1)
61
- return P(...e);
62
- const n = e[0];
63
- return typeof n == "function" ? R(b(() => ({ get: n, set: f }))) : S(n);
64
- }
65
- function V(e, n = 200, r = {}) {
66
- return v(
67
- g(n, r),
68
- e
69
- );
70
- }
71
- function E(e, n = 200, r = !1, t = !0, i = !1) {
72
- return v(
73
- j(n, r, t, i),
74
- e
75
- );
76
- }
77
- export {
78
- v as createFilterWrapper,
79
- g as debounceFilter,
80
- W as increaseWithUnit,
81
- N as isClient,
82
- I as isIOS,
83
- f as noop,
84
- j as throttleFilter,
85
- _ as toRef,
86
- w as toValue,
87
- C as tryOnScopeDispose,
88
- V as useDebounceFn,
89
- E as useThrottleFn
90
- };