@indielayer/ui 1.8.3 → 1.9.0

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