@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.
- package/docs/pages/component/menu/usage.vue +1 -0
- package/docs/pages/component/select/usage.vue +17 -5
- package/docs/pages/component/table/index.vue +7 -0
- package/docs/pages/component/table/virtual.vue +53 -0
- package/lib/components/menu/MenuItem.vue.d.ts +3 -3
- package/lib/components/menu/MenuItem.vue.js +1 -1
- package/lib/components/menu/MenuItem.vue2.js +16 -16
- package/lib/components/menu/theme/MenuItem.base.theme.js +30 -30
- package/lib/components/select/Select.vue.d.ts +36 -0
- package/lib/components/select/Select.vue.js +224 -201
- package/lib/components/select/theme/Select.base.theme.js +1 -1
- package/lib/components/table/Table.vue.d.ts +91 -4
- package/lib/components/table/Table.vue.js +214 -180
- package/lib/components/table/TableHead.vue.d.ts +10 -2
- package/lib/components/table/TableHead.vue.js +16 -13
- package/lib/components/table/TableHeader.vue.d.ts +0 -4
- package/lib/components/table/TableHeader.vue.js +9 -10
- package/lib/components/table/theme/TableHead.base.theme.js +7 -4
- package/lib/components/table/theme/TableHead.carbon.theme.js +7 -4
- package/lib/components/table/theme/TableHeader.base.theme.js +3 -3
- package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
- package/lib/composables/index.d.ts +1 -0
- package/lib/composables/useVirtualList.d.ts +48 -0
- package/lib/composables/useVirtualList.js +123 -0
- package/lib/index.js +35 -33
- package/lib/index.umd.js +4 -4
- 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
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/menu/MenuItem.vue +1 -1
- package/src/components/menu/theme/MenuItem.base.theme.ts +8 -8
- package/src/components/select/Select.vue +56 -26
- package/src/components/select/theme/Select.base.theme.ts +1 -1
- package/src/components/table/Table.vue +152 -113
- package/src/components/table/TableHead.vue +6 -2
- package/src/components/table/TableHeader.vue +0 -1
- package/src/components/table/theme/TableHead.base.theme.ts +7 -1
- package/src/components/table/theme/TableHead.carbon.theme.ts +7 -1
- package/src/components/table/theme/TableHeader.base.theme.ts +0 -2
- package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -2
- package/src/composables/index.ts +1 -0
- package/src/composables/useVirtualList.ts +286 -0
- package/src/version.ts +1 -1
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { noop as
|
|
2
|
-
import { createFilterWrapper as
|
|
3
|
-
import { watch as
|
|
4
|
-
function
|
|
5
|
-
var
|
|
6
|
-
const
|
|
7
|
-
return (
|
|
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
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([
|
|
13
|
-
return
|
|
14
|
-
Array.isArray(
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
}, t = (
|
|
18
|
-
() => [
|
|
19
|
-
([
|
|
20
|
-
u(),
|
|
21
|
-
...
|
|
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
|
-
),
|
|
26
|
-
|
|
25
|
+
), a = () => {
|
|
26
|
+
r(), u();
|
|
27
27
|
};
|
|
28
|
-
return
|
|
28
|
+
return W(a), a;
|
|
29
29
|
}
|
|
30
|
-
let
|
|
31
|
-
function
|
|
32
|
-
const { window: n =
|
|
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 && !
|
|
35
|
+
G && !H && (H = !0, Array.from(n.document.body.children).forEach((l) => l.addEventListener("click", I)));
|
|
36
36
|
let t = !0;
|
|
37
|
-
const
|
|
38
|
-
if (typeof
|
|
39
|
-
return Array.from(n.document.querySelectorAll(
|
|
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 =
|
|
41
|
+
const h = S(d);
|
|
42
42
|
return h && (l.target === h || l.composedPath().includes(h));
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
if (!(!
|
|
48
|
-
if (l.detail === 0 && (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
|
-
|
|
52
|
+
s(l);
|
|
53
53
|
}
|
|
54
|
-
}, { passive: !0, capture:
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
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 &&
|
|
59
|
+
u && x(n, "blur", (l) => {
|
|
60
60
|
setTimeout(() => {
|
|
61
|
-
var
|
|
62
|
-
const h =
|
|
63
|
-
((
|
|
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 () =>
|
|
67
|
+
return () => c.forEach((l) => l());
|
|
68
68
|
}
|
|
69
69
|
function ne() {
|
|
70
|
-
const e =
|
|
70
|
+
const e = _(!1);
|
|
71
71
|
return ee() && te(() => {
|
|
72
72
|
e.value = !0;
|
|
73
73
|
}), e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
const
|
|
77
|
-
return
|
|
75
|
+
function k(e) {
|
|
76
|
+
const s = ne();
|
|
77
|
+
return O(() => (s.value, !!e()));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const { window:
|
|
81
|
-
let
|
|
82
|
-
const
|
|
83
|
-
|
|
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(),
|
|
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),
|
|
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
|
|
97
|
-
function
|
|
98
|
-
let
|
|
99
|
-
return
|
|
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 =
|
|
102
|
-
function
|
|
101
|
+
const { window: n = $ } = s;
|
|
102
|
+
function i(t) {
|
|
103
103
|
return n ? n.matchMedia(t).matches : !1;
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
get: () =>
|
|
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
|
|
112
|
+
return B(`(min-width: ${o(t, 0.1)})`, s);
|
|
113
113
|
},
|
|
114
|
-
greaterOrEqual:
|
|
114
|
+
greaterOrEqual: m,
|
|
115
115
|
smaller(t) {
|
|
116
|
-
return
|
|
116
|
+
return B(`(max-width: ${o(t, -0.1)})`, s);
|
|
117
117
|
},
|
|
118
118
|
smallerOrEqual(t) {
|
|
119
|
-
return
|
|
119
|
+
return B(`(max-width: ${o(t)})`, s);
|
|
120
120
|
},
|
|
121
|
-
between(t,
|
|
122
|
-
return
|
|
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
|
|
125
|
+
return i(`(min-width: ${o(t, 0.1)})`);
|
|
126
126
|
},
|
|
127
127
|
isGreaterOrEqual(t) {
|
|
128
|
-
return
|
|
128
|
+
return i(`(min-width: ${o(t)})`);
|
|
129
129
|
},
|
|
130
130
|
isSmaller(t) {
|
|
131
|
-
return
|
|
131
|
+
return i(`(max-width: ${o(t, -0.1)})`);
|
|
132
132
|
},
|
|
133
133
|
isSmallerOrEqual(t) {
|
|
134
|
-
return
|
|
134
|
+
return i(`(max-width: ${o(t)})`);
|
|
135
135
|
},
|
|
136
|
-
isInBetween(t,
|
|
137
|
-
return
|
|
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((
|
|
141
|
-
return
|
|
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
|
|
146
|
-
var
|
|
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
|
-
|
|
149
|
-
if (e != null &&
|
|
150
|
-
for (var n of
|
|
151
|
-
|
|
152
|
-
return
|
|
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
|
|
155
|
-
const n =
|
|
154
|
+
function he(e, s, o = {}) {
|
|
155
|
+
const n = o, { window: i = $ } = n, m = se(n, ["window"]);
|
|
156
156
|
let u;
|
|
157
|
-
const t =
|
|
157
|
+
const t = k(() => i && "MutationObserver" in i), r = () => {
|
|
158
158
|
u && (u.disconnect(), u = void 0);
|
|
159
|
-
},
|
|
160
|
-
() =>
|
|
161
|
-
(
|
|
162
|
-
|
|
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
|
-
),
|
|
166
|
-
|
|
165
|
+
), c = () => {
|
|
166
|
+
r(), a();
|
|
167
167
|
};
|
|
168
|
-
return
|
|
168
|
+
return W(c), {
|
|
169
169
|
isSupported: t,
|
|
170
|
-
stop:
|
|
170
|
+
stop: c
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
var
|
|
174
|
-
var
|
|
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) &&
|
|
177
|
-
if (e != null &&
|
|
178
|
-
for (var n of
|
|
179
|
-
|
|
180
|
-
return
|
|
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
|
|
183
|
-
const n =
|
|
182
|
+
function ae(e, s, o = {}) {
|
|
183
|
+
const n = o, { window: i = $ } = n, m = ue(n, ["window"]);
|
|
184
184
|
let u;
|
|
185
|
-
const t =
|
|
185
|
+
const t = k(() => i && "ResizeObserver" in i), r = () => {
|
|
186
186
|
u && (u.disconnect(), u = void 0);
|
|
187
|
-
},
|
|
188
|
-
() => Array.isArray(e) ? e.map((l) =>
|
|
189
|
-
),
|
|
190
|
-
|
|
187
|
+
}, a = O(
|
|
188
|
+
() => Array.isArray(e) ? e.map((l) => S(l)) : [S(e)]
|
|
189
|
+
), c = D(
|
|
190
|
+
a,
|
|
191
191
|
(l) => {
|
|
192
|
-
if (
|
|
193
|
-
u = new ResizeObserver(
|
|
194
|
-
for (const
|
|
195
|
-
|
|
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
|
-
),
|
|
200
|
-
|
|
199
|
+
), p = () => {
|
|
200
|
+
r(), c();
|
|
201
201
|
};
|
|
202
|
-
return
|
|
202
|
+
return W(p), {
|
|
203
203
|
isSupported: t,
|
|
204
|
-
stop:
|
|
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
|
|
208
|
-
function
|
|
239
|
+
const Y = 1;
|
|
240
|
+
function we(e, s = {}) {
|
|
209
241
|
const {
|
|
210
|
-
throttle:
|
|
242
|
+
throttle: o = 0,
|
|
211
243
|
idle: n = 200,
|
|
212
|
-
onStop:
|
|
213
|
-
onScroll:
|
|
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:
|
|
225
|
-
} =
|
|
256
|
+
behavior: r = "auto"
|
|
257
|
+
} = s, a = _(0), c = _(0), p = O({
|
|
226
258
|
get() {
|
|
227
|
-
return
|
|
259
|
+
return a.value;
|
|
228
260
|
},
|
|
229
|
-
set(
|
|
230
|
-
|
|
261
|
+
set(v) {
|
|
262
|
+
d(v, void 0);
|
|
231
263
|
}
|
|
232
|
-
}), l =
|
|
264
|
+
}), l = O({
|
|
233
265
|
get() {
|
|
234
|
-
return
|
|
266
|
+
return c.value;
|
|
235
267
|
},
|
|
236
|
-
set(
|
|
237
|
-
|
|
268
|
+
set(v) {
|
|
269
|
+
d(void 0, v);
|
|
238
270
|
}
|
|
239
271
|
});
|
|
240
|
-
function
|
|
241
|
-
var
|
|
242
|
-
const w =
|
|
243
|
-
w && ((
|
|
244
|
-
top: (
|
|
245
|
-
left: (
|
|
246
|
-
behavior:
|
|
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 =
|
|
281
|
+
const h = _(!1), b = C({
|
|
250
282
|
left: !0,
|
|
251
283
|
right: !1,
|
|
252
284
|
top: !0,
|
|
253
285
|
bottom: !1
|
|
254
|
-
}), E =
|
|
286
|
+
}), E = C({
|
|
255
287
|
left: !1,
|
|
256
288
|
right: !1,
|
|
257
289
|
top: !1,
|
|
258
290
|
bottom: !1
|
|
259
|
-
}),
|
|
260
|
-
h.value && (h.value = !1, E.left = !1, E.right = !1, E.top = !1, E.bottom = !1,
|
|
261
|
-
},
|
|
262
|
-
const y =
|
|
263
|
-
E.left =
|
|
264
|
-
const w = Math.abs(
|
|
265
|
-
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
const y =
|
|
272
|
-
|
|
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
|
|
306
|
+
return x(
|
|
275
307
|
e,
|
|
276
308
|
"scroll",
|
|
277
|
-
|
|
309
|
+
o ? N(g, o, !0, !1) : g,
|
|
278
310
|
t
|
|
279
|
-
),
|
|
311
|
+
), x(
|
|
280
312
|
e,
|
|
281
313
|
"scrollend",
|
|
282
|
-
|
|
314
|
+
R,
|
|
283
315
|
t
|
|
284
316
|
), {
|
|
285
|
-
x:
|
|
317
|
+
x: p,
|
|
286
318
|
y: l,
|
|
287
319
|
isScrolling: h,
|
|
288
320
|
arrivedState: b,
|
|
289
321
|
directions: E,
|
|
290
322
|
measure() {
|
|
291
|
-
const
|
|
292
|
-
|
|
323
|
+
const v = A(e);
|
|
324
|
+
v && j(v);
|
|
293
325
|
}
|
|
294
326
|
};
|
|
295
327
|
}
|
|
296
|
-
function
|
|
328
|
+
function ye(e, s = {}) {
|
|
297
329
|
const {
|
|
298
|
-
threshold:
|
|
330
|
+
threshold: o = 50,
|
|
299
331
|
onSwipe: n,
|
|
300
|
-
onSwipeEnd:
|
|
301
|
-
onSwipeStart:
|
|
332
|
+
onSwipeEnd: i,
|
|
333
|
+
onSwipeStart: m,
|
|
302
334
|
passive: u = !0,
|
|
303
|
-
window: t =
|
|
304
|
-
} =
|
|
305
|
-
|
|
306
|
-
},
|
|
307
|
-
|
|
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
|
|
310
|
-
const
|
|
311
|
-
u ?
|
|
312
|
-
const y = (
|
|
313
|
-
b.value && (
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
if (
|
|
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
|
-
|
|
319
|
-
const [w,
|
|
320
|
-
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
if (
|
|
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,
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
|
|
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:
|
|
364
|
+
isPassiveEventSupported: v,
|
|
333
365
|
isSwiping: b,
|
|
334
366
|
direction: E,
|
|
335
|
-
coordsStart:
|
|
336
|
-
coordsEnd:
|
|
337
|
-
lengthX:
|
|
338
|
-
lengthY:
|
|
339
|
-
stop: () =>
|
|
367
|
+
coordsStart: r,
|
|
368
|
+
coordsEnd: a,
|
|
369
|
+
lengthX: c,
|
|
370
|
+
lengthY: p,
|
|
371
|
+
stop: () => M.forEach((f) => f())
|
|
340
372
|
};
|
|
341
373
|
}
|
|
342
|
-
function
|
|
374
|
+
function ce(e) {
|
|
343
375
|
if (!e)
|
|
344
376
|
return !1;
|
|
345
|
-
let
|
|
346
|
-
const
|
|
377
|
+
let s = !1;
|
|
378
|
+
const o = {
|
|
347
379
|
get passive() {
|
|
348
|
-
return
|
|
380
|
+
return s = !0, !1;
|
|
349
381
|
}
|
|
350
382
|
};
|
|
351
|
-
return e.addEventListener("x",
|
|
383
|
+
return e.addEventListener("x", I, o), e.removeEventListener("x", I), s;
|
|
352
384
|
}
|
|
353
385
|
export {
|
|
354
386
|
pe as breakpointsTailwind,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
387
|
+
Se as createFilterWrapper,
|
|
388
|
+
Oe as debounceFilter,
|
|
389
|
+
$ as defaultWindow,
|
|
358
390
|
U as increaseWithUnit,
|
|
359
|
-
|
|
391
|
+
Q as isClient,
|
|
360
392
|
G as isIOS,
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
393
|
+
I as noop,
|
|
394
|
+
ve as onClickOutside,
|
|
395
|
+
xe as throttleFilter,
|
|
364
396
|
J as toRef,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
397
|
+
A as toValue,
|
|
398
|
+
W as tryOnScopeDispose,
|
|
399
|
+
S as unrefElement,
|
|
400
|
+
me as useBreakpoints,
|
|
369
401
|
K as useDebounceFn,
|
|
370
|
-
|
|
371
|
-
|
|
402
|
+
be as useElementSize,
|
|
403
|
+
x as useEventListener,
|
|
404
|
+
B as useMediaQuery,
|
|
372
405
|
ne as useMounted,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
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.
|
|
1
|
+
declare const _default: "1.9.0";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED