hys-ui 0.3.0 → 0.5.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/CHANGELOG.md +27 -0
- package/README.md +68 -73
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +467 -2
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas2.vue.js +166 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.js +7 -0
- package/dist/components/HysAnimatedNumber/NumberDigits/NumberDigits2.vue.js +105 -0
- package/dist/components/HysAnimatedNumber/animation/digital.js +186 -0
- package/dist/components/HysAnimatedNumber/animation/morph.js +110 -0
- package/dist/components/HysAnimatedNumber/animation/paint.js +34 -0
- package/dist/components/HysAnimatedNumber/animation/particles.js +51 -0
- package/dist/components/HysAnimatedNumber/animation/paths.js +165 -0
- package/dist/components/HysAnimatedNumber/animation/physics.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/render.js +89 -0
- package/dist/components/HysAnimatedNumber/animation/reveal.js +125 -0
- package/dist/components/HysAnimatedNumber/animation/rolling.js +66 -0
- package/dist/components/HysAnimatedNumber/animation/scenarios.js +217 -0
- package/dist/components/HysAnimatedNumber/animation/spatial.js +112 -0
- package/dist/components/HysAnimatedNumber/useNumberCountdown.js +58 -0
- package/dist/components/HysAnimatedNumber/useNumberVisuals.js +60 -0
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- package/dist/components/HysFormItem/HysFormItem.vue.js +1 -1
- package/dist/components/HysFormItem/HysFormItem2.vue.js +231 -229
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +327 -274
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +1092 -154
- package/dist/components/HysModal/HysModal.vue.js +3 -3
- package/dist/components/HysModal/HysModal2.vue.js +81 -80
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- package/dist/components/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +472 -443
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1418 -1150
- package/dist/components/HysTextarea/HysTextarea.vue.js +56 -32
- package/dist/components/HysTour/HysTour.vue.js +291 -67
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- package/dist/composables/animatedNumberDigits.js +106 -0
- package/dist/composables/animatedNumberFormat.js +222 -0
- package/dist/composables/animatedNumberTiming.js +66 -0
- package/dist/composables/buttonGroup.js +12 -0
- package/dist/composables/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -0
- package/dist/composables/numberAnimation.js +72 -0
- package/dist/composables/numberAnimationCatalog.js +301 -0
- package/dist/composables/numberAnimationSequence.js +45 -0
- package/dist/composables/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- package/dist/composables/textInput.js +23 -14
- package/dist/composables/useDialog.js +50 -50
- package/dist/composables/useFloating.js +107 -103
- package/dist/composables/useHysAnimatedNumber.js +264 -0
- package/dist/composables/useHysNumberAnimationGroup.js +23 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -0
- package/dist/composables/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTextareaSize.js +62 -46
- package/dist/composables/useTourLayout.js +129 -0
- package/dist/config.js +11 -11
- package/dist/index.js +183 -152
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +99 -6
- package/dist/types/components/HysAnimatedNumber/NumberAnimationCanvas/NumberAnimationCanvas.vue.d.ts +19 -0
- package/dist/types/components/HysAnimatedNumber/NumberDigits/NumberDigits.vue.d.ts +31 -0
- package/dist/types/components/HysAnimatedNumber/animation/digital.d.ts +3 -0
- package/dist/types/components/HysAnimatedNumber/animation/morph.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/paint.d.ts +44 -0
- package/dist/types/components/HysAnimatedNumber/animation/particles.d.ts +5 -0
- package/dist/types/components/HysAnimatedNumber/animation/paths.d.ts +12 -0
- package/dist/types/components/HysAnimatedNumber/animation/physics.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/render.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/reveal.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/rolling.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/animation/scenarios.d.ts +4 -0
- package/dist/types/components/HysAnimatedNumber/animation/spatial.d.ts +2 -0
- package/dist/types/components/HysAnimatedNumber/useNumberCountdown.d.ts +8 -0
- package/dist/types/components/HysAnimatedNumber/useNumberVisuals.d.ts +12 -0
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +12 -3
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +2 -2
- package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- package/dist/types/components/HysCard/HysCard.vue.d.ts +1 -1
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +3 -3
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +3 -3
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +3 -3
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +2 -2
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +6 -6
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +3 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +2 -2
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
- package/dist/types/components/HysInput/HysInput.vue.d.ts +13 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -40
- package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +1 -1
- package/dist/types/components/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +46 -8
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +6 -1
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +2 -2
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1740 -3
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +1 -1
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +1 -1
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +13 -2
- package/dist/types/components/HysToast/HysToast.vue.d.ts +1 -1
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +1 -1
- package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -9
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +3 -3
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +2 -2
- package/dist/types/composables/animatedNumber.d.ts +220 -0
- package/dist/types/composables/animatedNumberDigits.d.ts +32 -0
- package/dist/types/composables/animatedNumberFormat.d.ts +16 -0
- package/dist/types/composables/animatedNumberTiming.d.ts +21 -0
- package/dist/types/composables/buttonGroup.d.ts +9 -0
- package/dist/types/composables/drawer.d.ts +1 -1
- package/dist/types/composables/floatingPosition.d.ts +14 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/modal.d.ts +2 -0
- package/dist/types/composables/numberAnimation.d.ts +29 -0
- package/dist/types/composables/numberAnimationCatalog.d.ts +58 -0
- package/dist/types/composables/numberAnimationSequence.d.ts +13 -0
- package/dist/types/composables/selectOptions.d.ts +5 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +116 -6
- package/dist/types/composables/textInput.d.ts +39 -4
- package/dist/types/composables/tour.d.ts +68 -0
- package/dist/types/composables/useFloating.d.ts +1 -1
- package/dist/types/composables/useHysAnimatedNumber.d.ts +37 -0
- package/dist/types/composables/useHysNumberAnimationGroup.d.ts +4 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTextareaSize.d.ts +5 -2
- package/dist/types/composables/useTourLayout.d.ts +33 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +46 -1
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- package/package.json +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
|
@@ -1,150 +1,173 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
for (const e of
|
|
6
|
-
if (
|
|
7
|
-
|
|
1
|
+
const C = (i) => typeof i + ":" + i;
|
|
2
|
+
function v(i, o) {
|
|
3
|
+
const a = typeof o == "string" ? o.split(".") : o;
|
|
4
|
+
let s = i;
|
|
5
|
+
for (const e of a) {
|
|
6
|
+
if (s == null || typeof s != "object") return;
|
|
7
|
+
s = s[e];
|
|
8
8
|
}
|
|
9
|
-
return
|
|
9
|
+
return s;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
function e(
|
|
15
|
-
return
|
|
16
|
-
if (
|
|
11
|
+
const F = (i) => i < 576 ? "xs" : i < 768 ? "sm" : i < 992 ? "md" : i < 1200 ? "lg" : i < 1600 ? "xl" : "xxl";
|
|
12
|
+
function I(i, o, a = !0) {
|
|
13
|
+
const s = /* @__PURE__ */ new Set();
|
|
14
|
+
function e(h, r, n = /* @__PURE__ */ new Set(), c = 0) {
|
|
15
|
+
return c > 32 ? [] : h.flatMap((l) => {
|
|
16
|
+
if (n.has(l) || l.hidden || !a && l.type === "expand" || l.responsive && !l.responsive.includes(o) || s.has(l.key))
|
|
17
17
|
return [];
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */ new Set([...
|
|
23
|
-
|
|
18
|
+
s.add(l.key);
|
|
19
|
+
const m = l.fixed === !1 ? void 0 : l.fixed === !0 ? "left" : l.fixed ?? r, k = l.children ? e(
|
|
20
|
+
l.children,
|
|
21
|
+
m,
|
|
22
|
+
/* @__PURE__ */ new Set([...n, l]),
|
|
23
|
+
c + 1
|
|
24
24
|
) : void 0;
|
|
25
|
-
return
|
|
25
|
+
return k && !k.length ? [] : [{ ...l, fixed: m, children: k }];
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
const t = e(
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
return
|
|
28
|
+
const t = e(i);
|
|
29
|
+
function u(h, r) {
|
|
30
|
+
return h.flatMap((n) => {
|
|
31
|
+
if (n.children) {
|
|
32
|
+
const c = u(n.children, r);
|
|
33
|
+
return c.length ? [{ ...n, children: c, fixed: r }] : [];
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return n.fixed === r ? [n] : [];
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
...
|
|
40
|
-
...
|
|
41
|
-
...
|
|
38
|
+
const d = [
|
|
39
|
+
...u(t, "left"),
|
|
40
|
+
...u(t),
|
|
41
|
+
...u(t, "right")
|
|
42
42
|
];
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function x(h) {
|
|
44
|
+
return h.flatMap((r) => r.children ? x(r.children) : [r]);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function f(h) {
|
|
47
47
|
return Math.max(
|
|
48
48
|
1,
|
|
49
|
-
...
|
|
49
|
+
...h.map((r) => r.children ? 1 + f(r.children) : 1)
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
function
|
|
54
|
-
for (const
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
column:
|
|
58
|
-
key:
|
|
59
|
-
leaves:
|
|
60
|
-
colspan:
|
|
61
|
-
rowspan:
|
|
62
|
-
fixed:
|
|
63
|
-
}),
|
|
52
|
+
const p = f(d), y = Array.from({ length: p }, () => []);
|
|
53
|
+
function b(h, r) {
|
|
54
|
+
for (const n of h) {
|
|
55
|
+
const c = n.children ? x(n.children) : [n];
|
|
56
|
+
y[r].push({
|
|
57
|
+
column: n,
|
|
58
|
+
key: n.key + ":" + (n.fixed || "center"),
|
|
59
|
+
leaves: c,
|
|
60
|
+
colspan: c.length,
|
|
61
|
+
rowspan: n.children ? 1 : p - r,
|
|
62
|
+
fixed: n.fixed === "left" || n.fixed === "right" ? n.fixed : void 0
|
|
63
|
+
}), n.children && b(n.children, r + 1);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
b(d, 0);
|
|
67
|
+
const N = x(d), M = new Map(N.map((h, r) => [h.key, r])), w = y.map((h) => {
|
|
68
|
+
const r = [];
|
|
69
|
+
for (let n = 0; n < h.length; n++) {
|
|
70
|
+
const c = h[n], l = c.column.headerColSpan;
|
|
71
|
+
if (l === 0) {
|
|
72
|
+
r.push({ ...c, blank: !0 });
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (l === void 0 || !Number.isSafeInteger(l) || l <= 1 || c.column.children) {
|
|
76
|
+
r.push(c);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const m = [...c.leaves], k = M.get(m[0].key);
|
|
80
|
+
for (; m.length < l; ) {
|
|
81
|
+
const g = h[n + 1];
|
|
82
|
+
if (!g || g.column.children || g.column.type && g.column.type !== "default" || g.fixed !== c.fixed || g.rowspan !== c.rowspan || M.get(g.column.key) !== k + m.length) break;
|
|
83
|
+
m.push(g.column), n++;
|
|
84
|
+
}
|
|
85
|
+
r.push({ ...c, leaves: m, colspan: m.length });
|
|
86
|
+
}
|
|
87
|
+
return r;
|
|
88
|
+
});
|
|
89
|
+
return { leaves: N, headers: w };
|
|
67
90
|
}
|
|
68
|
-
function
|
|
69
|
-
const
|
|
91
|
+
function B(i, o) {
|
|
92
|
+
const a = new Intl.Collator("zh-CN", {
|
|
70
93
|
numeric: !0,
|
|
71
94
|
sensitivity: "base"
|
|
72
|
-
}),
|
|
73
|
-
const t =
|
|
95
|
+
}), s = i.flatMap((e) => {
|
|
96
|
+
const t = o.find((u) => u.key === e.key);
|
|
74
97
|
return t && t.sortable !== "custom" ? [{ ...e, column: t }] : [];
|
|
75
98
|
});
|
|
76
99
|
return (e, t) => {
|
|
77
|
-
for (const { direction:
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
if (Number.isFinite(
|
|
81
|
-
return (
|
|
100
|
+
for (const { direction: u, column: d } of s) {
|
|
101
|
+
if (d.sorter) {
|
|
102
|
+
const f = d.sorter(e, t);
|
|
103
|
+
if (Number.isFinite(f) && f !== 0)
|
|
104
|
+
return (u === "asc" ? 1 : -1) * f;
|
|
82
105
|
continue;
|
|
83
106
|
}
|
|
84
|
-
const
|
|
85
|
-
for (const
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
107
|
+
const x = Array.isArray(d.sortBy) ? d.sortBy : [d.sortBy ?? d.dataIndex ?? d.key];
|
|
108
|
+
for (const f of x) {
|
|
109
|
+
const p = typeof f == "function" ? f(e) : v(e, f), y = typeof f == "function" ? f(t) : v(t, f);
|
|
110
|
+
if (p == null || y == null) {
|
|
111
|
+
if (p == null && y == null) continue;
|
|
112
|
+
return p == null ? 1 : -1;
|
|
90
113
|
}
|
|
91
|
-
const
|
|
92
|
-
if (Number.isFinite(
|
|
93
|
-
return (
|
|
114
|
+
const b = typeof p == "number" && typeof y == "number" ? Number.isNaN(p) ? Number.isNaN(y) ? 0 : 1 : Number.isNaN(y) ? -1 : p - y : a.compare(String(p), String(y));
|
|
115
|
+
if (Number.isFinite(b) && b !== 0)
|
|
116
|
+
return (u === "asc" ? 1 : -1) * b;
|
|
94
117
|
}
|
|
95
118
|
}
|
|
96
119
|
return 0;
|
|
97
120
|
};
|
|
98
121
|
}
|
|
99
|
-
function
|
|
100
|
-
var
|
|
101
|
-
const
|
|
102
|
-
for (const e of
|
|
103
|
-
const t =
|
|
122
|
+
function L(i, o) {
|
|
123
|
+
var s;
|
|
124
|
+
const a = /* @__PURE__ */ new Map();
|
|
125
|
+
for (const e of o) {
|
|
126
|
+
const t = i[e.key];
|
|
104
127
|
if (!(t != null && t.length) || !e.filters || e.filterMethod) continue;
|
|
105
|
-
const
|
|
106
|
-
for (const
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
for (const
|
|
110
|
-
|
|
128
|
+
const u = new Set(t), d = S(e.filters), x = new Map(d.map((f) => [f.value, f]));
|
|
129
|
+
for (const f of t) {
|
|
130
|
+
const p = (s = x.get(f)) == null ? void 0 : s.children;
|
|
131
|
+
if (p)
|
|
132
|
+
for (const y of S(p))
|
|
133
|
+
u.add(y.value);
|
|
111
134
|
}
|
|
112
|
-
|
|
135
|
+
a.set(e.key, u);
|
|
113
136
|
}
|
|
114
|
-
return (e) =>
|
|
115
|
-
const
|
|
116
|
-
return
|
|
117
|
-
|
|
137
|
+
return (e) => o.every((t) => {
|
|
138
|
+
const u = i[t.key];
|
|
139
|
+
return u != null && u.length ? a.has(t.key) ? a.get(t.key).has(
|
|
140
|
+
v(
|
|
118
141
|
e,
|
|
119
142
|
t.dataIndex ?? t.key
|
|
120
143
|
)
|
|
121
|
-
) :
|
|
122
|
-
(
|
|
144
|
+
) : u.some(
|
|
145
|
+
(d) => t.filterMethod ? t.filterMethod(d, e, t) : String(v(e, t.dataIndex ?? t.key) ?? "").toLocaleLowerCase().includes(String(d).toLocaleLowerCase())
|
|
123
146
|
) : !0;
|
|
124
147
|
});
|
|
125
148
|
}
|
|
126
|
-
function
|
|
127
|
-
const
|
|
128
|
-
for (;
|
|
129
|
-
const e =
|
|
130
|
-
|
|
149
|
+
function S(i) {
|
|
150
|
+
const o = [], a = /* @__PURE__ */ new Set(), s = [...i].reverse();
|
|
151
|
+
for (; s.length; ) {
|
|
152
|
+
const e = s.pop();
|
|
153
|
+
a.has(e) || (a.add(e), o.push(e), e.children && s.push(...[...e.children].reverse()));
|
|
131
154
|
}
|
|
132
|
-
return
|
|
155
|
+
return o;
|
|
133
156
|
}
|
|
134
|
-
function
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
const
|
|
139
|
-
return
|
|
157
|
+
function A(i, o) {
|
|
158
|
+
if (o.summary === "count") return i.length;
|
|
159
|
+
const a = i.map((e) => v(e, o.dataIndex ?? o.key)).filter((e) => typeof e == "number" && Number.isFinite(e));
|
|
160
|
+
if (!a.length) return "—";
|
|
161
|
+
const s = a.reduce((e, t) => e + t, 0);
|
|
162
|
+
return o.summary === "sum" ? +s.toFixed(12) : o.summary === "avg" ? +(s / a.length).toFixed(12) : o.summary === "min" ? a.reduce((e, t) => Math.min(e, t)) : o.summary === "max" ? a.reduce((e, t) => Math.max(e, t)) : "";
|
|
140
163
|
}
|
|
141
164
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
165
|
+
F as tableBreakpoint,
|
|
166
|
+
I as tableColumns,
|
|
167
|
+
B as tableCompare,
|
|
168
|
+
S as tableFilterOptions,
|
|
169
|
+
L as tableFilterPredicate,
|
|
170
|
+
A as tableSummary,
|
|
171
|
+
C as tableToken,
|
|
172
|
+
v as tableValue
|
|
150
173
|
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function l(t) {
|
|
2
|
+
return t === "small" ? "sm" : t === "middle" || t === "default" ? "md" : t === "large" ? "lg" : t;
|
|
3
|
+
}
|
|
4
|
+
function h(t, n) {
|
|
5
|
+
const r = n != null && n.trim ? t.trim() : t, e = n != null && n.number ? parseFloat(r) : NaN;
|
|
6
|
+
return Number.isNaN(e) ? r : String(e);
|
|
7
|
+
}
|
|
8
|
+
let c;
|
|
9
|
+
function f(t) {
|
|
3
10
|
const n = Intl.Segmenter;
|
|
4
|
-
return n && (
|
|
11
|
+
return n && (c ?? (c = new n(void 0, { granularity: "grapheme" })), c) ? Array.from(c.segment(t), (r) => r.segment) : Array.from(t);
|
|
5
12
|
}
|
|
6
13
|
function m(t, n) {
|
|
7
14
|
if (typeof n == "function")
|
|
@@ -10,25 +17,27 @@ function m(t, n) {
|
|
|
10
17
|
if (Number.isFinite(r) && r >= 0) return r;
|
|
11
18
|
} catch {
|
|
12
19
|
}
|
|
13
|
-
return n ?
|
|
20
|
+
return n ? f(t).length : t.length;
|
|
14
21
|
}
|
|
15
|
-
function
|
|
22
|
+
function g(t, n, r) {
|
|
16
23
|
if (n === void 0 || m(t, r) <= n) return t;
|
|
17
|
-
const
|
|
18
|
-
let
|
|
19
|
-
for (;
|
|
20
|
-
const
|
|
21
|
-
m(
|
|
24
|
+
const e = r ? f(t) : Array.from(t);
|
|
25
|
+
let o = 0, i = e.length;
|
|
26
|
+
for (; o < i; ) {
|
|
27
|
+
const u = Math.ceil((o + i) / 2);
|
|
28
|
+
m(e.slice(0, u).join(""), r) <= n ? o = u : i = u - 1;
|
|
22
29
|
}
|
|
23
|
-
return
|
|
30
|
+
return e.slice(0, o).join("");
|
|
24
31
|
}
|
|
25
|
-
function
|
|
32
|
+
function N(t) {
|
|
26
33
|
if (t === void 0 || t === "") return;
|
|
27
34
|
const n = Number(t);
|
|
28
35
|
return Number.isFinite(n) && n >= 0 ? Math.floor(n) : void 0;
|
|
29
36
|
}
|
|
30
37
|
export {
|
|
38
|
+
h as modelText,
|
|
31
39
|
m as textCount,
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
l as textInputSize,
|
|
41
|
+
N as textLengthLimit,
|
|
42
|
+
g as textLimit
|
|
34
43
|
};
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { ref as O, inject as P, computed as b, provide as R, shallowRef as g, watch as
|
|
2
|
-
import { overlayOwnerKey as
|
|
1
|
+
import { ref as O, inject as P, computed as b, provide as R, shallowRef as g, watch as D, nextTick as x, onActivated as B, onDeactivated as H, onBeforeUnmount as M } from "vue";
|
|
2
|
+
import { overlayOwnerKey as A, registerOverlay as j, lockBodyScroll as N } from "./overlayManager.js";
|
|
3
3
|
const U = 'a[href],button:not([disabled]),input:not([disabled]):not([type="hidden"]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
4
|
-
function J(
|
|
5
|
-
const
|
|
4
|
+
function J(z, r, T, u = {}) {
|
|
5
|
+
const o = O(!0), h = P(A, void 0), s = b(() => o.value && (h == null ? void 0 : h.value) !== !1), i = b(() => z.value && s.value);
|
|
6
6
|
R(
|
|
7
|
-
|
|
7
|
+
A,
|
|
8
8
|
b(() => {
|
|
9
9
|
var e;
|
|
10
|
-
return i.value && ((e =
|
|
10
|
+
return i.value && ((e = u.childVisible) == null ? void 0 : e.call(u)) !== !1;
|
|
11
11
|
})
|
|
12
12
|
);
|
|
13
|
-
const d = g(),
|
|
13
|
+
const d = g(), k = b(
|
|
14
14
|
() => {
|
|
15
|
-
var e,
|
|
16
|
-
return ((e = d.value) == null ? void 0 : e.zIndex.value) ?? ((
|
|
15
|
+
var e, t;
|
|
16
|
+
return ((e = d.value) == null ? void 0 : e.zIndex.value) ?? ((t = u.zIndex) == null ? void 0 : t.call(u)) ?? 100;
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
|
-
let E = null,
|
|
19
|
+
let E = null, a, m = 0;
|
|
20
20
|
function S() {
|
|
21
21
|
var e;
|
|
22
22
|
return Array.from(
|
|
23
|
-
((e =
|
|
23
|
+
((e = r.value) == null ? void 0 : e.querySelectorAll(U)) ?? []
|
|
24
24
|
).filter(
|
|
25
|
-
(
|
|
25
|
+
(t) => t.tabIndex >= 0 && t.getClientRects().length > 0 && getComputedStyle(t).visibility !== "hidden" && !t.closest('[inert],[aria-hidden="true"]')
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function w() {
|
|
29
29
|
var e;
|
|
30
|
-
(e = S()[0] ??
|
|
30
|
+
(e = S()[0] ?? r.value) == null || e.focus({ preventScroll: !0 });
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function C(e) {
|
|
33
33
|
var n, f;
|
|
34
|
-
if (!i.value || !((n = d.value) != null && n.isTop()) || !
|
|
34
|
+
if (!i.value || !((n = d.value) != null && n.isTop()) || !r.value) return;
|
|
35
35
|
if (e.key === "Escape") {
|
|
36
|
-
e.preventDefault(), e.stopImmediatePropagation(),
|
|
36
|
+
e.preventDefault(), e.stopImmediatePropagation(), T();
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
if (e.key !== "Tab" || ((f =
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
e.preventDefault(),
|
|
39
|
+
if (e.key !== "Tab" || ((f = u.trapFocus) == null ? void 0 : f.call(u)) === !1) return;
|
|
40
|
+
const t = S();
|
|
41
|
+
if (!t.length) {
|
|
42
|
+
e.preventDefault(), r.value.focus({ preventScroll: !0 });
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
const l =
|
|
46
|
-
e.shiftKey && (document.activeElement === l || document.activeElement ===
|
|
45
|
+
const l = t[0], c = t[t.length - 1];
|
|
46
|
+
e.shiftKey && (document.activeElement === l || document.activeElement === r.value || !r.value.contains(document.activeElement)) ? (e.preventDefault(), c.focus({ preventScroll: !0 })) : !e.shiftKey && (document.activeElement === c || !r.value.contains(document.activeElement)) && (e.preventDefault(), l.focus({ preventScroll: !0 }));
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
var
|
|
50
|
-
i.value && ((
|
|
48
|
+
function F(e) {
|
|
49
|
+
var t, l, c;
|
|
50
|
+
i.value && ((t = d.value) != null && t.isTop()) && ((l = u.trapFocus) == null ? void 0 : l.call(u)) !== !1 && e.target instanceof Node && !((c = r.value) != null && c.contains(e.target)) && w();
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function I() {
|
|
53
53
|
var e;
|
|
54
|
-
i.value && ((e =
|
|
54
|
+
i.value && ((e = u.lockScroll) == null ? void 0 : e.call(u)) !== !1 ? a ?? (a = N()) : (a == null || a(), a = void 0);
|
|
55
55
|
}
|
|
56
56
|
function y() {
|
|
57
|
-
var
|
|
58
|
-
const e = ((
|
|
59
|
-
return (l = d.value) == null || l.unregister(), d.value = void 0,
|
|
57
|
+
var t, l;
|
|
58
|
+
const e = ((t = d.value) == null ? void 0 : t.isTop()) ?? !1;
|
|
59
|
+
return (l = d.value) == null || l.unregister(), d.value = void 0, a == null || a(), a = void 0, document.removeEventListener("keydown", C, !0), document.removeEventListener("focusin", F, !0), e;
|
|
60
60
|
}
|
|
61
|
-
function q(e,
|
|
62
|
-
|
|
61
|
+
function q(e, t, l) {
|
|
62
|
+
x(() => {
|
|
63
63
|
var n, f;
|
|
64
|
-
if (
|
|
64
|
+
if (t !== m || !s.value || !l || ((n = u.restoreFocus) == null ? void 0 : n.call(u)) === !1)
|
|
65
65
|
return;
|
|
66
66
|
const c = new Event("hys-ui-close-auto-focus", { cancelable: !0 });
|
|
67
|
-
(f =
|
|
67
|
+
(f = u.onCloseAutoFocus) == null || f.call(u, c), !c.defaultPrevented && (e != null && e.isConnected) && e.focus({ preventScroll: !0 });
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
return
|
|
70
|
+
return typeof document > "u" ? { active: s, zIndex: k, focus: w } : (D(
|
|
71
71
|
i,
|
|
72
72
|
async (e) => {
|
|
73
73
|
var l, c, n, f;
|
|
74
|
-
const
|
|
74
|
+
const t = ++m;
|
|
75
75
|
if (e) {
|
|
76
|
-
if (y(), E = document.activeElement instanceof HTMLElement ? document.activeElement : null, d.value = j("dialog",
|
|
77
|
-
const
|
|
78
|
-
(l =
|
|
79
|
-
const v = (c =
|
|
80
|
-
!
|
|
81
|
-
} else q(E,
|
|
76
|
+
if (y(), E = document.activeElement instanceof HTMLElement ? document.activeElement : null, d.value = j("dialog", T, u.zIndex), I(), document.addEventListener("keydown", C, !0), document.addEventListener("focusin", F, !0), await x(), t !== m || !i.value) return;
|
|
77
|
+
const L = new Event("hys-ui-open-auto-focus", { cancelable: !0 });
|
|
78
|
+
(l = u.onOpenAutoFocus) == null || l.call(u, L);
|
|
79
|
+
const v = (c = u.initialFocus) == null ? void 0 : c.call(u), K = v instanceof HTMLElement && v.isConnected && v.getClientRects().length > 0 && getComputedStyle(v).visibility !== "hidden" && !v.closest('[inert],[aria-hidden="true"]') && !v.disabled ? v : void 0;
|
|
80
|
+
!L.defaultPrevented && v !== !1 && ((f = K ?? ((n = r.value) == null ? void 0 : n.querySelector("[autofocus]")) ?? S()[0] ?? r.value) == null || f.focus({ preventScroll: !0 }));
|
|
81
|
+
} else q(E, t, y());
|
|
82
82
|
},
|
|
83
83
|
{ immediate: !0, flush: "post" }
|
|
84
|
-
),
|
|
84
|
+
), D(() => {
|
|
85
85
|
var e;
|
|
86
|
-
return (e =
|
|
87
|
-
},
|
|
88
|
-
|
|
86
|
+
return (e = u.lockScroll) == null ? void 0 : e.call(u);
|
|
87
|
+
}, I), B(() => o.value = !0), H(() => {
|
|
88
|
+
o.value = !1, m++, y();
|
|
89
89
|
}), M(() => {
|
|
90
90
|
var c;
|
|
91
|
-
const e = E,
|
|
92
|
-
|
|
91
|
+
const e = E, t = y(), l = s.value && ((c = u.restoreFocus) == null ? void 0 : c.call(u)) !== !1;
|
|
92
|
+
o.value = !1, m++, l && t && x(() => {
|
|
93
93
|
e != null && e.isConnected && e.focus({ preventScroll: !0 });
|
|
94
94
|
});
|
|
95
|
-
}), { active:
|
|
95
|
+
}), { active: s, zIndex: k, focus: w });
|
|
96
96
|
}
|
|
97
97
|
export {
|
|
98
98
|
J as useDialog
|