@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.
- package/docs/components/menu/DocsMenu.vue +1 -0
- package/docs/pages/component/form/usage.vue +2 -0
- package/docs/pages/component/menu/usage.vue +2 -0
- package/docs/pages/component/select/index.vue +7 -0
- package/docs/pages/component/select/multiple.vue +42 -0
- package/docs/pages/component/select/usage.vue +8 -12
- package/docs/pages/component/table/virtual.vue +19 -6
- package/docs/pages/component/toggle/index.vue +1 -1
- package/docs/pages/component/tooltip/index.vue +1 -1
- package/docs/pages/component/upload/index.vue +29 -0
- package/docs/pages/component/upload/usage.vue +115 -0
- package/docs/search/components.json +1 -1
- package/lib/common/icons.d.ts +2 -0
- package/lib/common/icons.js +17 -15
- package/lib/components/button/theme/Button.base.theme.js +30 -27
- package/lib/components/checkbox/Checkbox.vue2.js +9 -9
- package/lib/components/datepicker/Datepicker.vue.d.ts +4 -4
- package/lib/components/datepicker/Datepicker.vue.js +1 -1
- package/lib/components/drawer/Drawer.vue.js +1 -17
- package/lib/components/form/Form.vue.d.ts +4 -4
- package/lib/components/form/Form.vue.js +34 -34
- package/lib/components/formGroup/FormGroup.vue.d.ts +1 -1
- package/lib/components/formGroup/FormGroup.vue.js +39 -37
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +68 -66
- package/lib/components/label/theme/Label.base.theme.js +7 -7
- package/lib/components/menu/Menu.vue.d.ts +2 -0
- package/lib/components/menu/MenuItem.vue.d.ts +15 -3
- package/lib/components/menu/MenuItem.vue.js +1 -1
- package/lib/components/menu/MenuItem.vue2.js +43 -37
- package/lib/components/modal/Modal.vue.d.ts +4 -4
- package/lib/components/modal/Modal.vue.js +38 -34
- package/lib/components/notifications/Notifications.vue.d.ts +15 -0
- package/lib/components/notifications/Notifications.vue.js +149 -127
- package/lib/components/progress/Progress.vue.d.ts +4 -4
- package/lib/components/progress/Progress.vue.js +7 -7
- package/lib/components/scroll/Scroll.vue2.js +1 -1
- package/lib/components/select/Select.vue.d.ts +43 -1
- package/lib/components/select/Select.vue.js +358 -258
- package/lib/components/select/theme/Select.base.theme.js +1 -0
- package/lib/components/tab/Tab.vue.js +1 -1
- package/lib/components/tab/TabGroup.vue.js +2 -2
- package/lib/components/table/TableCell.vue.d.ts +1 -1
- package/lib/components/table/theme/TableHead.base.theme.js +1 -1
- package/lib/components/table/theme/TableHeader.base.theme.js +1 -1
- package/lib/components/tag/Tag.vue.js +23 -21
- package/lib/components/textarea/Textarea.vue.js +1 -1
- package/lib/components/upload/Upload.vue.d.ts +195 -0
- package/lib/components/upload/Upload.vue.js +264 -0
- package/lib/components/upload/Upload.vue2.js +4 -0
- package/lib/components/upload/__tests__/Upload.spec.d.ts +1 -0
- package/lib/components/upload/index.d.ts +2 -0
- package/lib/components/upload/theme/Upload.base.theme.d.ts +3 -0
- package/lib/components/upload/theme/Upload.base.theme.js +8 -0
- package/lib/components/upload/theme/Upload.carbon.theme.d.ts +3 -0
- package/lib/components/upload/theme/Upload.carbon.theme.js +5 -0
- package/lib/composables/useVirtualList.js +56 -53
- package/lib/index.js +43 -41
- package/lib/index.umd.js +4 -4
- 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
- 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
- package/lib/theme.d.ts +2 -1
- package/lib/themes/base/components.d.ts +1 -0
- package/lib/themes/base/components.js +23 -21
- package/lib/themes/carbon/components.d.ts +1 -0
- package/lib/themes/carbon/components.js +23 -21
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/common/icons.ts +2 -0
- package/src/components/button/theme/Button.base.theme.ts +6 -3
- package/src/components/checkbox/Checkbox.vue +5 -5
- package/src/components/drawer/Drawer.vue +0 -16
- package/src/components/form/Form.vue +10 -4
- package/src/components/formGroup/FormGroup.vue +2 -0
- package/src/components/index.ts +1 -0
- package/src/components/label/theme/Label.base.theme.ts +7 -5
- package/src/components/menu/Menu.vue +2 -0
- package/src/components/menu/MenuItem.vue +8 -6
- package/src/components/modal/Modal.vue +6 -1
- package/src/components/notifications/Notifications.vue +34 -4
- package/src/components/progress/Progress.vue +2 -2
- package/src/components/select/Select.vue +166 -68
- package/src/components/select/theme/Select.base.theme.ts +2 -0
- package/src/components/table/theme/TableHead.base.theme.ts +1 -1
- package/src/components/table/theme/TableHeader.base.theme.ts +1 -1
- package/src/components/tag/Tag.vue +12 -10
- package/src/components/upload/Upload.vue +365 -0
- package/src/components/upload/__tests__/Upload.spec.ts +11 -0
- package/src/components/upload/index.ts +2 -0
- package/src/components/upload/theme/Upload.base.theme.ts +9 -0
- package/src/components/upload/theme/Upload.carbon.theme.ts +7 -0
- package/src/composables/useInputtable.ts +1 -1
- package/src/composables/useVirtualList.ts +8 -5
- package/src/theme.ts +2 -0
- package/src/themes/base/components.ts +1 -0
- package/src/themes/carbon/components.ts +1 -0
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -0
- 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
- 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
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
import { noop as F, toValue as S, isObject as Q, tryOnScopeDispose as H, isIOS as Z, notNullish as J, isClient as G, useThrottleFn as K, tryOnMounted as N, increaseWithUnit as ee, useDebounceFn as te } from "../../../../@vueuse_shared@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
|
|
2
|
+
import { createFilterWrapper as xe, debounceFilter as Se, getLifeCycleTarget as _e, throttleFilter as Te } from "../../../../@vueuse_shared@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/shared/index.js";
|
|
3
|
+
import { watch as j, computed as O, ref as $, shallowRef as ne, reactive as V, watchEffect as oe, getCurrentInstance as re, onMounted as se, unref as le } from "vue";
|
|
4
|
+
const R = G ? window : void 0;
|
|
5
|
+
function _(o) {
|
|
6
|
+
var l;
|
|
7
|
+
const r = S(o);
|
|
8
|
+
return (l = r == null ? void 0 : r.$el) != null ? l : r;
|
|
9
|
+
}
|
|
10
|
+
function L(...o) {
|
|
11
|
+
let l, r, a, d;
|
|
12
|
+
if (typeof o[0] == "string" || Array.isArray(o[0]) ? ([r, a, d] = o, l = R) : [l, r, a, d] = o, !l)
|
|
13
|
+
return F;
|
|
14
|
+
Array.isArray(r) || (r = [r]), Array.isArray(a) || (a = [a]);
|
|
15
|
+
const u = [], c = () => {
|
|
16
|
+
u.forEach((t) => t()), u.length = 0;
|
|
17
|
+
}, f = (t, e, i, s) => (t.addEventListener(e, i, s), () => t.removeEventListener(e, i, s)), v = j(
|
|
18
|
+
() => [_(l), S(d)],
|
|
19
|
+
([t, e]) => {
|
|
20
|
+
if (c(), !t)
|
|
21
|
+
return;
|
|
22
|
+
const i = Q(e) ? { ...e } : e;
|
|
23
|
+
u.push(
|
|
24
|
+
...r.flatMap((s) => a.map((p) => f(t, s, p, i)))
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
{ immediate: !0, flush: "post" }
|
|
28
|
+
), h = () => {
|
|
29
|
+
v(), c();
|
|
30
|
+
};
|
|
31
|
+
return H(h), h;
|
|
32
|
+
}
|
|
33
|
+
let U = !1;
|
|
34
|
+
function fe(o, l, r = {}) {
|
|
35
|
+
const { window: a = R, ignore: d = [], capture: u = !0, detectIframe: c = !1 } = r;
|
|
36
|
+
if (!a)
|
|
37
|
+
return F;
|
|
38
|
+
Z && !U && (U = !0, Array.from(a.document.body.children).forEach((s) => s.addEventListener("click", F)), a.document.documentElement.addEventListener("click", F));
|
|
39
|
+
let f = !0;
|
|
40
|
+
const v = (s) => S(d).some((p) => {
|
|
41
|
+
if (typeof p == "string")
|
|
42
|
+
return Array.from(a.document.querySelectorAll(p)).some((n) => n === s.target || s.composedPath().includes(n));
|
|
43
|
+
{
|
|
44
|
+
const n = _(p);
|
|
45
|
+
return n && (s.target === n || s.composedPath().includes(n));
|
|
46
|
+
}
|
|
47
|
+
}), h = (s) => {
|
|
48
|
+
const p = _(o);
|
|
49
|
+
if (!(!p || p === s.target || s.composedPath().includes(p))) {
|
|
50
|
+
if (s.detail === 0 && (f = !v(s)), !f) {
|
|
51
|
+
f = !0;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
l(s);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
let t = !1;
|
|
58
|
+
const e = [
|
|
59
|
+
L(a, "click", (s) => {
|
|
60
|
+
t || (t = !0, setTimeout(() => {
|
|
61
|
+
t = !1;
|
|
62
|
+
}, 0), h(s));
|
|
63
|
+
}, { passive: !0, capture: u }),
|
|
64
|
+
L(a, "pointerdown", (s) => {
|
|
65
|
+
const p = _(o);
|
|
66
|
+
f = !v(s) && !!(p && !s.composedPath().includes(p));
|
|
67
|
+
}, { passive: !0 }),
|
|
68
|
+
c && L(a, "blur", (s) => {
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
var p;
|
|
71
|
+
const n = _(o);
|
|
72
|
+
((p = a.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(n != null && n.contains(a.document.activeElement)) && l(s);
|
|
73
|
+
}, 0);
|
|
74
|
+
})
|
|
75
|
+
].filter(Boolean);
|
|
76
|
+
return () => e.forEach((s) => s());
|
|
77
|
+
}
|
|
78
|
+
function ie() {
|
|
79
|
+
const o = $(!1), l = re();
|
|
80
|
+
return l && se(() => {
|
|
81
|
+
o.value = !0;
|
|
82
|
+
}, l), o;
|
|
83
|
+
}
|
|
84
|
+
function q(o) {
|
|
85
|
+
const l = ie();
|
|
86
|
+
return O(() => (l.value, !!o()));
|
|
87
|
+
}
|
|
88
|
+
function ve(o, l, r = {}) {
|
|
89
|
+
const { window: a = R, ...d } = r;
|
|
90
|
+
let u;
|
|
91
|
+
const c = q(() => a && "MutationObserver" in a), f = () => {
|
|
92
|
+
u && (u.disconnect(), u = void 0);
|
|
93
|
+
}, v = O(() => {
|
|
94
|
+
const i = S(o), s = (Array.isArray(i) ? i : [i]).map(_).filter(J);
|
|
95
|
+
return new Set(s);
|
|
96
|
+
}), h = j(
|
|
97
|
+
() => v.value,
|
|
98
|
+
(i) => {
|
|
99
|
+
f(), c.value && i.size && (u = new MutationObserver(l), i.forEach((s) => u.observe(s, d)));
|
|
100
|
+
},
|
|
101
|
+
{ immediate: !0, flush: "post" }
|
|
102
|
+
), t = () => u == null ? void 0 : u.takeRecords(), e = () => {
|
|
103
|
+
h(), f();
|
|
104
|
+
};
|
|
105
|
+
return H(e), {
|
|
106
|
+
isSupported: c,
|
|
107
|
+
stop: e,
|
|
108
|
+
takeRecords: t
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function I(o, l = {}) {
|
|
112
|
+
const { window: r = R } = l, a = q(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
|
|
113
|
+
let d;
|
|
114
|
+
const u = $(!1), c = (h) => {
|
|
115
|
+
u.value = h.matches;
|
|
116
|
+
}, f = () => {
|
|
117
|
+
d && ("removeEventListener" in d ? d.removeEventListener("change", c) : d.removeListener(c));
|
|
118
|
+
}, v = oe(() => {
|
|
119
|
+
a.value && (f(), d = r.matchMedia(S(o)), "addEventListener" in d ? d.addEventListener("change", c) : d.addListener(c), u.value = d.matches);
|
|
120
|
+
});
|
|
121
|
+
return H(() => {
|
|
122
|
+
v(), f(), d = void 0;
|
|
123
|
+
}), u;
|
|
124
|
+
}
|
|
125
|
+
const pe = {
|
|
126
|
+
sm: 640,
|
|
127
|
+
md: 768,
|
|
128
|
+
lg: 1024,
|
|
129
|
+
xl: 1280,
|
|
130
|
+
"2xl": 1536
|
|
131
|
+
};
|
|
132
|
+
function he(o, l = {}) {
|
|
133
|
+
function r(t, e) {
|
|
134
|
+
let i = S(o[S(t)]);
|
|
135
|
+
return e != null && (i = ee(i, e)), typeof i == "number" && (i = `${i}px`), i;
|
|
136
|
+
}
|
|
137
|
+
const { window: a = R, strategy: d = "min-width" } = l;
|
|
138
|
+
function u(t) {
|
|
139
|
+
return a ? a.matchMedia(t).matches : !1;
|
|
140
|
+
}
|
|
141
|
+
const c = (t) => I(() => `(min-width: ${r(t)})`, l), f = (t) => I(() => `(max-width: ${r(t)})`, l), v = Object.keys(o).reduce((t, e) => (Object.defineProperty(t, e, {
|
|
142
|
+
get: () => d === "min-width" ? c(e) : f(e),
|
|
143
|
+
enumerable: !0,
|
|
144
|
+
configurable: !0
|
|
145
|
+
}), t), {});
|
|
146
|
+
function h() {
|
|
147
|
+
const t = Object.keys(o).map((e) => [e, c(e)]);
|
|
148
|
+
return O(() => t.filter(([, e]) => e.value).map(([e]) => e));
|
|
149
|
+
}
|
|
150
|
+
return Object.assign(v, {
|
|
151
|
+
greaterOrEqual: c,
|
|
152
|
+
smallerOrEqual: f,
|
|
153
|
+
greater(t) {
|
|
154
|
+
return I(() => `(min-width: ${r(t, 0.1)})`, l);
|
|
155
|
+
},
|
|
156
|
+
smaller(t) {
|
|
157
|
+
return I(() => `(max-width: ${r(t, -0.1)})`, l);
|
|
158
|
+
},
|
|
159
|
+
between(t, e) {
|
|
160
|
+
return I(() => `(min-width: ${r(t)}) and (max-width: ${r(e, -0.1)})`, l);
|
|
161
|
+
},
|
|
162
|
+
isGreater(t) {
|
|
163
|
+
return u(`(min-width: ${r(t, 0.1)})`);
|
|
164
|
+
},
|
|
165
|
+
isGreaterOrEqual(t) {
|
|
166
|
+
return u(`(min-width: ${r(t)})`);
|
|
167
|
+
},
|
|
168
|
+
isSmaller(t) {
|
|
169
|
+
return u(`(max-width: ${r(t, -0.1)})`);
|
|
170
|
+
},
|
|
171
|
+
isSmallerOrEqual(t) {
|
|
172
|
+
return u(`(max-width: ${r(t)})`);
|
|
173
|
+
},
|
|
174
|
+
isInBetween(t, e) {
|
|
175
|
+
return u(`(min-width: ${r(t)}) and (max-width: ${r(e, -0.1)})`);
|
|
176
|
+
},
|
|
177
|
+
current: h,
|
|
178
|
+
active() {
|
|
179
|
+
const t = h();
|
|
180
|
+
return O(() => t.value.length === 0 ? "" : t.value.at(-1));
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function me(o, l = {}) {
|
|
185
|
+
var r, a;
|
|
186
|
+
const d = $(!1), u = ne(null);
|
|
187
|
+
let c = 0, f = !0;
|
|
188
|
+
if (G) {
|
|
189
|
+
const v = typeof l == "function" ? { onDrop: l } : l, h = (r = v.multiple) != null ? r : !0, t = (a = v.preventDefaultForUnhandled) != null ? a : !1, e = (n) => {
|
|
190
|
+
var y, w;
|
|
191
|
+
const g = Array.from((w = (y = n.dataTransfer) == null ? void 0 : y.files) != null ? w : []);
|
|
192
|
+
return g.length === 0 ? null : h ? g : [g[0]];
|
|
193
|
+
}, i = (n) => {
|
|
194
|
+
if (v.dataTypes) {
|
|
195
|
+
const y = le(v.dataTypes);
|
|
196
|
+
return typeof y == "function" ? y(n) : y ? y.some((w) => n.includes(w)) : !0;
|
|
197
|
+
}
|
|
198
|
+
return !0;
|
|
199
|
+
}, s = (n) => {
|
|
200
|
+
var y, w;
|
|
201
|
+
const g = Array.from((w = (y = n.dataTransfer) == null ? void 0 : y.items) != null ? w : []), M = g.filter((k) => k.kind === "file").map((k) => k.type), E = i(M), T = h || g.filter((k) => k.kind === "file").length <= 1;
|
|
202
|
+
return E && T;
|
|
203
|
+
}, p = (n, y) => {
|
|
204
|
+
var w, g, M, E;
|
|
205
|
+
if (f = s(n), !f) {
|
|
206
|
+
t && n.preventDefault(), n.dataTransfer && (n.dataTransfer.dropEffect = "none");
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
n.preventDefault(), n.dataTransfer && (n.dataTransfer.dropEffect = "copy");
|
|
210
|
+
const T = e(n);
|
|
211
|
+
switch (y) {
|
|
212
|
+
case "enter":
|
|
213
|
+
c += 1, d.value = !0, (w = v.onEnter) == null || w.call(v, null, n);
|
|
214
|
+
break;
|
|
215
|
+
case "over":
|
|
216
|
+
(g = v.onOver) == null || g.call(v, null, n);
|
|
217
|
+
break;
|
|
218
|
+
case "leave":
|
|
219
|
+
c -= 1, c === 0 && (d.value = !1), (M = v.onLeave) == null || M.call(v, null, n);
|
|
220
|
+
break;
|
|
221
|
+
case "drop":
|
|
222
|
+
c = 0, d.value = !1, f && (u.value = T, (E = v.onDrop) == null || E.call(v, T, n));
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
L(o, "dragenter", (n) => p(n, "enter")), L(o, "dragover", (n) => p(n, "over")), L(o, "dragleave", (n) => p(n, "leave")), L(o, "drop", (n) => p(n, "drop"));
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
files: u,
|
|
230
|
+
isOverDropZone: d
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function ue(o, l, r = {}) {
|
|
234
|
+
const { window: a = R, ...d } = r;
|
|
235
|
+
let u;
|
|
236
|
+
const c = q(() => a && "ResizeObserver" in a), f = () => {
|
|
237
|
+
u && (u.disconnect(), u = void 0);
|
|
238
|
+
}, v = O(() => {
|
|
239
|
+
const e = S(o);
|
|
240
|
+
return Array.isArray(e) ? e.map((i) => _(i)) : [_(e)];
|
|
241
|
+
}), h = j(
|
|
242
|
+
v,
|
|
243
|
+
(e) => {
|
|
244
|
+
if (f(), c.value && a) {
|
|
245
|
+
u = new ResizeObserver(l);
|
|
246
|
+
for (const i of e)
|
|
247
|
+
i && u.observe(i, d);
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{ immediate: !0, flush: "post" }
|
|
251
|
+
), t = () => {
|
|
252
|
+
f(), h();
|
|
253
|
+
};
|
|
254
|
+
return H(t), {
|
|
255
|
+
isSupported: c,
|
|
256
|
+
stop: t
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
function be(o, l = { width: 0, height: 0 }, r = {}) {
|
|
260
|
+
const { window: a = R, box: d = "content-box" } = r, u = O(() => {
|
|
261
|
+
var e, i;
|
|
262
|
+
return (i = (e = _(o)) == null ? void 0 : e.namespaceURI) == null ? void 0 : i.includes("svg");
|
|
263
|
+
}), c = $(l.width), f = $(l.height), { stop: v } = ue(
|
|
264
|
+
o,
|
|
265
|
+
([e]) => {
|
|
266
|
+
const i = d === "border-box" ? e.borderBoxSize : d === "content-box" ? e.contentBoxSize : e.devicePixelContentBoxSize;
|
|
267
|
+
if (a && u.value) {
|
|
268
|
+
const s = _(o);
|
|
269
|
+
if (s) {
|
|
270
|
+
const p = s.getBoundingClientRect();
|
|
271
|
+
c.value = p.width, f.value = p.height;
|
|
272
|
+
}
|
|
273
|
+
} else if (i) {
|
|
274
|
+
const s = Array.isArray(i) ? i : [i];
|
|
275
|
+
c.value = s.reduce((p, { inlineSize: n }) => p + n, 0), f.value = s.reduce((p, { blockSize: n }) => p + n, 0);
|
|
276
|
+
} else
|
|
277
|
+
c.value = e.contentRect.width, f.value = e.contentRect.height;
|
|
278
|
+
},
|
|
279
|
+
r
|
|
280
|
+
);
|
|
281
|
+
N(() => {
|
|
282
|
+
const e = _(o);
|
|
283
|
+
e && (c.value = "offsetWidth" in e ? e.offsetWidth : l.width, f.value = "offsetHeight" in e ? e.offsetHeight : l.height);
|
|
284
|
+
});
|
|
285
|
+
const h = j(
|
|
286
|
+
() => _(o),
|
|
287
|
+
(e) => {
|
|
288
|
+
c.value = e ? l.width : 0, f.value = e ? l.height : 0;
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
function t() {
|
|
292
|
+
v(), h();
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
width: c,
|
|
296
|
+
height: f,
|
|
297
|
+
stop: t
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
const Y = 1;
|
|
301
|
+
function we(o, l = {}) {
|
|
302
|
+
const {
|
|
303
|
+
throttle: r = 0,
|
|
304
|
+
idle: a = 200,
|
|
305
|
+
onStop: d = F,
|
|
306
|
+
onScroll: u = F,
|
|
307
|
+
offset: c = {
|
|
308
|
+
left: 0,
|
|
309
|
+
right: 0,
|
|
310
|
+
top: 0,
|
|
311
|
+
bottom: 0
|
|
312
|
+
},
|
|
313
|
+
eventListenerOptions: f = {
|
|
314
|
+
capture: !1,
|
|
315
|
+
passive: !0
|
|
316
|
+
},
|
|
317
|
+
behavior: v = "auto",
|
|
318
|
+
window: h = R,
|
|
319
|
+
onError: t = (b) => {
|
|
320
|
+
console.error(b);
|
|
321
|
+
}
|
|
322
|
+
} = l, e = $(0), i = $(0), s = O({
|
|
323
|
+
get() {
|
|
324
|
+
return e.value;
|
|
325
|
+
},
|
|
326
|
+
set(b) {
|
|
327
|
+
n(b, void 0);
|
|
328
|
+
}
|
|
329
|
+
}), p = O({
|
|
330
|
+
get() {
|
|
331
|
+
return i.value;
|
|
332
|
+
},
|
|
333
|
+
set(b) {
|
|
334
|
+
n(void 0, b);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
function n(b, C) {
|
|
338
|
+
var m, x, D, W;
|
|
339
|
+
if (!h)
|
|
340
|
+
return;
|
|
341
|
+
const A = S(o);
|
|
342
|
+
if (!A)
|
|
343
|
+
return;
|
|
344
|
+
(D = A instanceof Document ? h.document.body : A) == null || D.scrollTo({
|
|
345
|
+
top: (m = S(C)) != null ? m : p.value,
|
|
346
|
+
left: (x = S(b)) != null ? x : s.value,
|
|
347
|
+
behavior: S(v)
|
|
348
|
+
});
|
|
349
|
+
const B = ((W = A == null ? void 0 : A.document) == null ? void 0 : W.documentElement) || (A == null ? void 0 : A.documentElement) || A;
|
|
350
|
+
s != null && (e.value = B.scrollLeft), p != null && (i.value = B.scrollTop);
|
|
351
|
+
}
|
|
352
|
+
const y = $(!1), w = V({
|
|
353
|
+
left: !0,
|
|
354
|
+
right: !1,
|
|
355
|
+
top: !0,
|
|
356
|
+
bottom: !1
|
|
357
|
+
}), g = V({
|
|
358
|
+
left: !1,
|
|
359
|
+
right: !1,
|
|
360
|
+
top: !1,
|
|
361
|
+
bottom: !1
|
|
362
|
+
}), M = (b) => {
|
|
363
|
+
y.value && (y.value = !1, g.left = !1, g.right = !1, g.top = !1, g.bottom = !1, d(b));
|
|
364
|
+
}, E = te(M, r + a), T = (b) => {
|
|
365
|
+
var C;
|
|
366
|
+
if (!h)
|
|
367
|
+
return;
|
|
368
|
+
const m = ((C = b == null ? void 0 : b.document) == null ? void 0 : C.documentElement) || (b == null ? void 0 : b.documentElement) || _(b), { display: x, flexDirection: D } = getComputedStyle(m), W = m.scrollLeft;
|
|
369
|
+
g.left = W < e.value, g.right = W > e.value;
|
|
370
|
+
const A = Math.abs(W) <= (c.left || 0), B = Math.abs(W) + m.clientWidth >= m.scrollWidth - (c.right || 0) - Y;
|
|
371
|
+
x === "flex" && D === "row-reverse" ? (w.left = B, w.right = A) : (w.left = A, w.right = B), e.value = W;
|
|
372
|
+
let P = m.scrollTop;
|
|
373
|
+
b === h.document && !P && (P = h.document.body.scrollTop), g.top = P < i.value, g.bottom = P > i.value;
|
|
374
|
+
const z = Math.abs(P) <= (c.top || 0), X = Math.abs(P) + m.clientHeight >= m.scrollHeight - (c.bottom || 0) - Y;
|
|
375
|
+
x === "flex" && D === "column-reverse" ? (w.top = X, w.bottom = z) : (w.top = z, w.bottom = X), i.value = P;
|
|
376
|
+
}, k = (b) => {
|
|
377
|
+
var C;
|
|
378
|
+
if (!h)
|
|
379
|
+
return;
|
|
380
|
+
const m = (C = b.target.documentElement) != null ? C : b.target;
|
|
381
|
+
T(m), y.value = !0, E(b), u(b);
|
|
382
|
+
};
|
|
383
|
+
return L(
|
|
384
|
+
o,
|
|
385
|
+
"scroll",
|
|
386
|
+
r ? K(k, r, !0, !1) : k,
|
|
387
|
+
f
|
|
388
|
+
), N(() => {
|
|
389
|
+
try {
|
|
390
|
+
const b = S(o);
|
|
391
|
+
if (!b)
|
|
392
|
+
return;
|
|
393
|
+
T(b);
|
|
394
|
+
} catch (b) {
|
|
395
|
+
t(b);
|
|
396
|
+
}
|
|
397
|
+
}), L(
|
|
398
|
+
o,
|
|
399
|
+
"scrollend",
|
|
400
|
+
M,
|
|
401
|
+
f
|
|
402
|
+
), {
|
|
403
|
+
x: s,
|
|
404
|
+
y: p,
|
|
405
|
+
isScrolling: y,
|
|
406
|
+
arrivedState: w,
|
|
407
|
+
directions: g,
|
|
408
|
+
measure() {
|
|
409
|
+
const b = S(o);
|
|
410
|
+
h && b && T(b);
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function ge(o, l = {}) {
|
|
415
|
+
const {
|
|
416
|
+
threshold: r = 50,
|
|
417
|
+
onSwipe: a,
|
|
418
|
+
onSwipeEnd: d,
|
|
419
|
+
onSwipeStart: u,
|
|
420
|
+
passive: c = !0,
|
|
421
|
+
window: f = R
|
|
422
|
+
} = l, v = V({ x: 0, y: 0 }), h = V({ x: 0, y: 0 }), t = O(() => v.x - h.x), e = O(() => v.y - h.y), { max: i, abs: s } = Math, p = O(() => i(s(t.value), s(e.value)) >= r), n = $(!1), y = O(() => p.value ? s(t.value) > s(e.value) ? t.value > 0 ? "left" : "right" : e.value > 0 ? "up" : "down" : "none"), w = (m) => [m.touches[0].clientX, m.touches[0].clientY], g = (m, x) => {
|
|
423
|
+
v.x = m, v.y = x;
|
|
424
|
+
}, M = (m, x) => {
|
|
425
|
+
h.x = m, h.y = x;
|
|
426
|
+
};
|
|
427
|
+
let E;
|
|
428
|
+
const T = ae(f == null ? void 0 : f.document);
|
|
429
|
+
c ? E = T ? { passive: !0 } : { capture: !1 } : E = T ? { passive: !1, capture: !0 } : { capture: !0 };
|
|
430
|
+
const k = (m) => {
|
|
431
|
+
n.value && (d == null || d(m, y.value)), n.value = !1;
|
|
432
|
+
}, b = [
|
|
433
|
+
L(o, "touchstart", (m) => {
|
|
434
|
+
if (m.touches.length !== 1)
|
|
435
|
+
return;
|
|
436
|
+
E.capture && !E.passive && m.preventDefault();
|
|
437
|
+
const [x, D] = w(m);
|
|
438
|
+
g(x, D), M(x, D), u == null || u(m);
|
|
439
|
+
}, E),
|
|
440
|
+
L(o, "touchmove", (m) => {
|
|
441
|
+
if (m.touches.length !== 1)
|
|
442
|
+
return;
|
|
443
|
+
const [x, D] = w(m);
|
|
444
|
+
M(x, D), !n.value && p.value && (n.value = !0), n.value && (a == null || a(m));
|
|
445
|
+
}, E),
|
|
446
|
+
L(o, ["touchend", "touchcancel"], k, E)
|
|
447
|
+
];
|
|
448
|
+
return {
|
|
449
|
+
isPassiveEventSupported: T,
|
|
450
|
+
isSwiping: n,
|
|
451
|
+
direction: y,
|
|
452
|
+
coordsStart: v,
|
|
453
|
+
coordsEnd: h,
|
|
454
|
+
lengthX: t,
|
|
455
|
+
lengthY: e,
|
|
456
|
+
stop: () => b.forEach((m) => m())
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function ae(o) {
|
|
460
|
+
if (!o)
|
|
461
|
+
return !1;
|
|
462
|
+
let l = !1;
|
|
463
|
+
const r = {
|
|
464
|
+
get passive() {
|
|
465
|
+
return l = !0, !1;
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
return o.addEventListener("x", F, r), o.removeEventListener("x", F), l;
|
|
469
|
+
}
|
|
470
|
+
export {
|
|
471
|
+
pe as breakpointsTailwind,
|
|
472
|
+
xe as createFilterWrapper,
|
|
473
|
+
Se as debounceFilter,
|
|
474
|
+
R as defaultWindow,
|
|
475
|
+
_e as getLifeCycleTarget,
|
|
476
|
+
ee as increaseWithUnit,
|
|
477
|
+
G as isClient,
|
|
478
|
+
Z as isIOS,
|
|
479
|
+
Q as isObject,
|
|
480
|
+
F as noop,
|
|
481
|
+
J as notNullish,
|
|
482
|
+
fe as onClickOutside,
|
|
483
|
+
Te as throttleFilter,
|
|
484
|
+
S as toValue,
|
|
485
|
+
N as tryOnMounted,
|
|
486
|
+
H as tryOnScopeDispose,
|
|
487
|
+
_ as unrefElement,
|
|
488
|
+
he as useBreakpoints,
|
|
489
|
+
te as useDebounceFn,
|
|
490
|
+
me as useDropZone,
|
|
491
|
+
be as useElementSize,
|
|
492
|
+
L as useEventListener,
|
|
493
|
+
I as useMediaQuery,
|
|
494
|
+
ie as useMounted,
|
|
495
|
+
ve as useMutationObserver,
|
|
496
|
+
ue as useResizeObserver,
|
|
497
|
+
we as useScroll,
|
|
498
|
+
q as useSupported,
|
|
499
|
+
ge as useSwipe,
|
|
500
|
+
K as useThrottleFn
|
|
501
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { getCurrentScope as y, onScopeDispose as j, unref as O, isRef as S, onMounted as x, nextTick as D, getCurrentInstance as P } from "vue";
|
|
2
|
+
function _(e) {
|
|
3
|
+
return y() ? (j(e), !0) : !1;
|
|
4
|
+
}
|
|
5
|
+
function p(e) {
|
|
6
|
+
return typeof e == "function" ? e() : O(e);
|
|
7
|
+
}
|
|
8
|
+
const C = typeof window < "u" && typeof document < "u";
|
|
9
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
10
|
+
const R = (e) => e != null, F = Object.prototype.toString, k = (e) => F.call(e) === "[object Object]", d = () => {
|
|
11
|
+
}, G = /* @__PURE__ */ N();
|
|
12
|
+
function N() {
|
|
13
|
+
var e, o;
|
|
14
|
+
return C && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((o = window == null ? void 0 : window.navigator) == null ? void 0 : o.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
|
|
15
|
+
}
|
|
16
|
+
function v(e, o) {
|
|
17
|
+
function t(...n) {
|
|
18
|
+
return new Promise((i, r) => {
|
|
19
|
+
Promise.resolve(e(() => o.apply(this, n), { fn: o, thisArg: this, args: n })).then(i).catch(r);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
function W(e, o = {}) {
|
|
25
|
+
let t, n, i = d;
|
|
26
|
+
const r = (u) => {
|
|
27
|
+
clearTimeout(u), i(), i = d;
|
|
28
|
+
};
|
|
29
|
+
return (u) => {
|
|
30
|
+
const c = p(e), l = p(o.maxWait);
|
|
31
|
+
return t && r(t), c <= 0 || l !== void 0 && l <= 0 ? (n && (r(n), n = null), Promise.resolve(u())) : new Promise((s, w) => {
|
|
32
|
+
i = o.rejectOnCancel ? w : s, l && !n && (n = setTimeout(() => {
|
|
33
|
+
t && r(t), n = null, s(u());
|
|
34
|
+
}, l)), t = setTimeout(() => {
|
|
35
|
+
n && r(n), n = null, s(u());
|
|
36
|
+
}, c);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function A(...e) {
|
|
41
|
+
let o = 0, t, n = !0, i = d, r, a, u, c, l;
|
|
42
|
+
!S(e[0]) && typeof e[0] == "object" ? { delay: a, trailing: u = !0, leading: c = !0, rejectOnCancel: l = !1 } = e[0] : [a, u = !0, c = !0, l = !1] = e;
|
|
43
|
+
const s = () => {
|
|
44
|
+
t && (clearTimeout(t), t = void 0, i(), i = d);
|
|
45
|
+
};
|
|
46
|
+
return (T) => {
|
|
47
|
+
const f = p(a), h = Date.now() - o, m = () => r = T();
|
|
48
|
+
return s(), f <= 0 ? (o = Date.now(), m()) : (h > f && (c || !n) ? (o = Date.now(), m()) : u && (r = new Promise((b, g) => {
|
|
49
|
+
i = l ? g : b, t = setTimeout(() => {
|
|
50
|
+
o = Date.now(), n = !0, b(m()), s();
|
|
51
|
+
}, Math.max(0, f - h));
|
|
52
|
+
})), !c && !t && (t = setTimeout(() => n = !0, f)), n = !1, r);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function L(e, o) {
|
|
56
|
+
var t;
|
|
57
|
+
if (typeof e == "number")
|
|
58
|
+
return e + o;
|
|
59
|
+
const n = ((t = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : t[0]) || "", i = e.slice(n.length), r = Number.parseFloat(n) + o;
|
|
60
|
+
return Number.isNaN(r) ? e : r + i;
|
|
61
|
+
}
|
|
62
|
+
function I(e) {
|
|
63
|
+
return e || P();
|
|
64
|
+
}
|
|
65
|
+
function V(e, o = 200, t = {}) {
|
|
66
|
+
return v(
|
|
67
|
+
W(o, t),
|
|
68
|
+
e
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function E(e, o = 200, t = !1, n = !0, i = !1) {
|
|
72
|
+
return v(
|
|
73
|
+
A(o, t, n, i),
|
|
74
|
+
e
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function U(e, o = !0, t) {
|
|
78
|
+
I() ? x(e, t) : o ? e() : D(e);
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
v as createFilterWrapper,
|
|
82
|
+
W as debounceFilter,
|
|
83
|
+
I as getLifeCycleTarget,
|
|
84
|
+
L as increaseWithUnit,
|
|
85
|
+
C as isClient,
|
|
86
|
+
G as isIOS,
|
|
87
|
+
k as isObject,
|
|
88
|
+
d as noop,
|
|
89
|
+
R as notNullish,
|
|
90
|
+
A as throttleFilter,
|
|
91
|
+
p as toValue,
|
|
92
|
+
U as tryOnMounted,
|
|
93
|
+
_ as tryOnScopeDispose,
|
|
94
|
+
V as useDebounceFn,
|
|
95
|
+
E as useThrottleFn
|
|
96
|
+
};
|
package/lib/theme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColorLibrary } from './composables/useColors';
|
|
2
|
-
import type { AccordionTheme, AccordionItemTheme, AlertTheme, AvatarTheme, BadgeTheme, BreadcrumbsTheme, ButtonTheme, ButtonGroupTheme, CardTheme, CarouselTheme, CarouselSlideTheme, CheckboxTheme, ContainerTheme, DatepickerTheme, DividerTheme, DrawerTheme, FormTheme, FormGroupTheme, IconTheme, ImageTheme, InputTheme, InputFooterTheme, LabelTheme, LinkTheme, LoaderTheme, MenuTheme, MenuItemTheme, ModalTheme, NotificationsTheme, PaginationTheme, PaginationItemTheme, PopoverTheme, PopoverContainerTheme, ProgressTheme, QrCodeTheme, RadioTheme, ScrollTheme, SelectTheme, SkeletonTheme, SliderTheme, StepperTheme, TabTheme, TabGroupTheme, TableTheme, TableCellTheme, TableHeadTheme, TableHeaderTheme, TableRowTheme, TagTheme, TextareaTheme, ToggleTheme } from './components';
|
|
2
|
+
import type { AccordionTheme, AccordionItemTheme, AlertTheme, AvatarTheme, BadgeTheme, BreadcrumbsTheme, ButtonTheme, ButtonGroupTheme, CardTheme, CarouselTheme, CarouselSlideTheme, CheckboxTheme, ContainerTheme, DatepickerTheme, DividerTheme, DrawerTheme, FormTheme, FormGroupTheme, IconTheme, ImageTheme, InputTheme, InputFooterTheme, LabelTheme, LinkTheme, LoaderTheme, MenuTheme, MenuItemTheme, ModalTheme, NotificationsTheme, PaginationTheme, PaginationItemTheme, PopoverTheme, PopoverContainerTheme, ProgressTheme, QrCodeTheme, RadioTheme, ScrollTheme, SelectTheme, SkeletonTheme, SliderTheme, StepperTheme, TabTheme, TabGroupTheme, TableTheme, TableCellTheme, TableHeadTheme, TableHeaderTheme, TableRowTheme, TagTheme, TextareaTheme, ToggleTheme, UploadTheme } from './components';
|
|
3
3
|
export type ComponentThemes = {
|
|
4
4
|
Accordion: AccordionTheme;
|
|
5
5
|
AccordionItem: AccordionItemTheme;
|
|
@@ -52,6 +52,7 @@ export type ComponentThemes = {
|
|
|
52
52
|
Tag: TagTheme;
|
|
53
53
|
Textarea: TextareaTheme;
|
|
54
54
|
Toggle: ToggleTheme;
|
|
55
|
+
Upload: UploadTheme;
|
|
55
56
|
};
|
|
56
57
|
export type UITheme = {
|
|
57
58
|
name?: string;
|
|
@@ -49,3 +49,4 @@ export { default as TableRow } from '../../components/table/theme/TableRow.base.
|
|
|
49
49
|
export { default as Tag } from '../../components/tag/theme/Tag.base.theme';
|
|
50
50
|
export { default as Textarea } from '../../components/textarea/theme/Textarea.base.theme';
|
|
51
51
|
export { default as Toggle } from '../../components/toggle/theme/Toggle.base.theme';
|
|
52
|
+
export { default as Upload } from '../../components/upload/theme/Upload.base.theme';
|
|
@@ -16,11 +16,11 @@ import { default as L } from "../../components/divider/theme/Divider.base.theme.
|
|
|
16
16
|
import { default as w } from "../../components/drawer/theme/Drawer.base.theme.js";
|
|
17
17
|
import { default as R } from "../../components/form/theme/Form.base.theme.js";
|
|
18
18
|
import { default as N } from "../../components/formGroup/theme/FormGroup.base.theme.js";
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
19
|
+
import { default as U } from "../../components/icon/theme/Icon.base.theme.js";
|
|
20
|
+
import { default as q } from "../../components/image/theme/Image.base.theme.js";
|
|
21
|
+
import { default as z } from "../../components/input/theme/Input.base.theme.js";
|
|
22
|
+
import { default as J } from "../../components/inputFooter/theme/InputFooter.base.theme.js";
|
|
23
|
+
import { default as O } from "../../components/label/theme/Label.base.theme.js";
|
|
24
24
|
import { default as W } from "../../components/link/theme/Link.base.theme.js";
|
|
25
25
|
import { default as Y } from "../../components/loader/theme/Loader.base.theme.js";
|
|
26
26
|
import { default as _ } from "../../components/menu/theme/Menu.base.theme.js";
|
|
@@ -43,12 +43,13 @@ import { default as Le } from "../../components/tab/theme/Tab.base.theme.js";
|
|
|
43
43
|
import { default as we } from "../../components/tab/theme/TabGroup.base.theme.js";
|
|
44
44
|
import { default as Re } from "../../components/table/theme/Table.base.theme.js";
|
|
45
45
|
import { default as Ne } from "../../components/table/theme/TableCell.base.theme.js";
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
46
|
+
import { default as Ue } from "../../components/table/theme/TableHead.base.theme.js";
|
|
47
|
+
import { default as qe } from "../../components/table/theme/TableHeader.base.theme.js";
|
|
48
|
+
import { default as ze } from "../../components/table/theme/TableRow.base.theme.js";
|
|
49
|
+
import { default as Je } from "../../components/tag/theme/Tag.base.theme.js";
|
|
50
|
+
import { default as Oe } from "../../components/textarea/theme/Textarea.base.theme.js";
|
|
51
51
|
import { default as We } from "../../components/toggle/theme/Toggle.base.theme.js";
|
|
52
|
+
import { default as Ye } from "../../components/upload/theme/Upload.base.theme.js";
|
|
52
53
|
export {
|
|
53
54
|
a as Accordion,
|
|
54
55
|
t as AccordionItem,
|
|
@@ -68,11 +69,11 @@ export {
|
|
|
68
69
|
w as Drawer,
|
|
69
70
|
R as Form,
|
|
70
71
|
N as FormGroup,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
U as Icon,
|
|
73
|
+
q as Image,
|
|
74
|
+
z as Input,
|
|
75
|
+
J as InputFooter,
|
|
76
|
+
O as Label,
|
|
76
77
|
W as Link,
|
|
77
78
|
Y as Loader,
|
|
78
79
|
_ as Menu,
|
|
@@ -95,10 +96,11 @@ export {
|
|
|
95
96
|
we as TabGroup,
|
|
96
97
|
Re as Table,
|
|
97
98
|
Ne as TableCell,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
We as Toggle
|
|
99
|
+
Ue as TableHead,
|
|
100
|
+
qe as TableHeader,
|
|
101
|
+
ze as TableRow,
|
|
102
|
+
Je as Tag,
|
|
103
|
+
Oe as Textarea,
|
|
104
|
+
We as Toggle,
|
|
105
|
+
Ye as Upload
|
|
104
106
|
};
|
|
@@ -49,3 +49,4 @@ export { default as TableRow } from '../../components/table/theme/TableRow.carbo
|
|
|
49
49
|
export { default as Tag } from '../../components/tag/theme/Tag.carbon.theme';
|
|
50
50
|
export { default as Textarea } from '../../components/textarea/theme/Textarea.carbon.theme';
|
|
51
51
|
export { default as Toggle } from '../../components/toggle/theme/Toggle.carbon.theme';
|
|
52
|
+
export { default as Upload } from '../../components/upload/theme/Upload.carbon.theme';
|