@vtable-guild/vtable-guild 2.7.1 → 2.8.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/css/presets/antdv.css +36 -0
- package/css/presets/element-plus.css +38 -0
- package/css/style.css +436 -0
- package/css/tailwind3-utilities.css +337 -0
- package/css/tailwind3.css +99 -0
- package/css/tailwind4.css +99 -0
- package/css/transitions.css +25 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts +3 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/VirtualList.mjs +28 -27
- package/dist/core/src/components/VirtualList/VirtualScrollBar.d.ts +1 -1
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/utils/types.d.ts +18 -0
- package/dist/core/src/utils/types.d.ts.map +1 -1
- package/dist/css/presets/antdv.css +36 -0
- package/dist/css/presets/element-plus.css +38 -0
- package/dist/css/style.css +436 -0
- package/dist/css/tailwind3-utilities.css +337 -0
- package/dist/css/tailwind3.css +99 -0
- package/dist/css/tailwind4.css +99 -0
- package/dist/css/transitions.css +25 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.full.mjs +5229 -3895
- package/dist/index.mjs +85 -75
- package/dist/table/src/components/ColGroup.d.ts.map +1 -1
- package/dist/table/src/components/ColGroup.mjs +10 -10
- package/dist/table/src/components/ColumnWidthRow.d.ts +4 -0
- package/dist/table/src/components/ColumnWidthRow.d.ts.map +1 -0
- package/dist/table/src/components/ColumnWidthRow.mjs +23 -0
- package/dist/table/src/components/PaginationSizeSelect.d.ts +57 -0
- package/dist/table/src/components/PaginationSizeSelect.d.ts.map +1 -0
- package/dist/table/src/components/PaginationSizeSelect.mjs +138 -0
- package/dist/table/src/components/SelectionDropdown.d.ts +9 -0
- package/dist/table/src/components/SelectionDropdown.d.ts.map +1 -1
- package/dist/table/src/components/SelectionDropdown.mjs +32 -26
- package/dist/table/src/components/Table.d.ts +13 -2
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +497 -403
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +80 -74
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +85 -83
- package/dist/table/src/components/TablePagination.d.ts +74 -0
- package/dist/table/src/components/TablePagination.d.ts.map +1 -0
- package/dist/table/src/components/TablePagination.mjs +350 -0
- package/dist/table/src/components/TablePagination.test.d.ts +2 -0
- package/dist/table/src/components/TablePagination.test.d.ts.map +1 -0
- package/dist/table/src/components/TablePaginationCompatClass.test.d.ts +2 -0
- package/dist/table/src/components/TablePaginationCompatClass.test.d.ts.map +1 -0
- package/dist/table/src/components/TablePaginationLayout.test.d.ts +2 -0
- package/dist/table/src/components/TablePaginationLayout.test.d.ts.map +1 -0
- package/dist/table/src/components/VTable.vue.d.ts.map +1 -1
- package/dist/table/src/components/VTable.vue.mjs +34 -26
- package/dist/table/src/components/VTableMinWidth.test.d.ts +2 -0
- package/dist/table/src/components/VTableMinWidth.test.d.ts.map +1 -0
- package/dist/table/src/components/VTableSummaryCell.d.ts.map +1 -1
- package/dist/table/src/components/VTableSummaryCell.mjs +26 -24
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +106 -93
- package/dist/table/src/composables/useColumnLayout.d.ts +28 -0
- package/dist/table/src/composables/useColumnLayout.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnLayout.mjs +259 -0
- package/dist/table/src/composables/useColumnLayout.test.d.ts +2 -0
- package/dist/table/src/composables/useColumnLayout.test.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnMetrics.d.ts +5 -3
- package/dist/table/src/composables/useColumnMetrics.d.ts.map +1 -1
- package/dist/table/src/composables/useColumnMetrics.mjs +64 -55
- package/dist/table/src/composables/useExpand.d.ts +2 -0
- package/dist/table/src/composables/useExpand.d.ts.map +1 -1
- package/dist/table/src/composables/useExpand.mjs +44 -20
- package/dist/table/src/composables/usePagination.d.ts +15 -0
- package/dist/table/src/composables/usePagination.d.ts.map +1 -0
- package/dist/table/src/composables/usePagination.mjs +65 -0
- package/dist/table/src/composables/usePagination.test.d.ts +2 -0
- package/dist/table/src/composables/usePagination.test.d.ts.map +1 -0
- package/dist/table/src/composables/useResize.d.ts +1 -0
- package/dist/table/src/composables/useResize.d.ts.map +1 -1
- package/dist/table/src/composables/useResize.mjs +67 -39
- package/dist/table/src/composables/useScroll.d.ts +3 -0
- package/dist/table/src/composables/useScroll.d.ts.map +1 -1
- package/dist/table/src/composables/useScroll.mjs +43 -41
- package/dist/table/src/composables/useSelection.d.ts +2 -1
- package/dist/table/src/composables/useSelection.d.ts.map +1 -1
- package/dist/table/src/composables/useSelection.mjs +210 -171
- package/dist/table/src/composables/useTreeData.d.ts +4 -0
- package/dist/table/src/composables/useTreeData.d.ts.map +1 -1
- package/dist/table/src/composables/useTreeData.mjs +48 -43
- package/dist/table/src/context.d.ts +6 -1
- package/dist/table/src/context.d.ts.map +1 -1
- package/dist/table/src/index.d.ts +3 -1
- package/dist/table/src/index.d.ts.map +1 -1
- package/dist/table/src/types/column.d.ts +8 -2
- package/dist/table/src/types/column.d.ts.map +1 -1
- package/dist/table/src/types/index.d.ts +1 -0
- package/dist/table/src/types/index.d.ts.map +1 -1
- package/dist/table/src/types/pagination.d.ts +66 -0
- package/dist/table/src/types/pagination.d.ts.map +1 -0
- package/dist/table/src/types/pagination.typecheck.d.ts +25 -0
- package/dist/table/src/types/pagination.typecheck.d.ts.map +1 -0
- package/dist/table/src/types/table.d.ts +8 -1
- package/dist/table/src/types/table.d.ts.map +1 -1
- package/dist/table/src/utils/columnWidth.d.ts +55 -7
- package/dist/table/src/utils/columnWidth.d.ts.map +1 -1
- package/dist/table/src/utils/columnWidth.mjs +91 -21
- package/dist/table/src/utils/paginationLayout.d.ts +13 -0
- package/dist/table/src/utils/paginationLayout.d.ts.map +1 -0
- package/dist/table/src/utils/paginationLayout.mjs +55 -0
- package/dist/table/src/utils/paginationLayout.test.d.ts +2 -0
- package/dist/table/src/utils/paginationLayout.test.d.ts.map +1 -0
- package/dist/table/src/utils/popupPosition.d.ts +4 -1
- package/dist/table/src/utils/popupPosition.d.ts.map +1 -1
- package/dist/table/src/utils/popupPosition.mjs +34 -15
- package/dist/theme/src/augment.d.ts +2 -0
- package/dist/theme/src/augment.d.ts.map +1 -1
- package/dist/theme/src/compat/antdv-pagination.d.ts +4 -0
- package/dist/theme/src/compat/antdv-pagination.d.ts.map +1 -0
- package/dist/theme/src/compat/antdv-pagination.mjs +29 -0
- package/dist/theme/src/index.d.ts +5 -0
- package/dist/theme/src/index.d.ts.map +1 -1
- package/dist/theme/src/pagination.d.ts +153 -0
- package/dist/theme/src/pagination.d.ts.map +1 -0
- package/dist/theme/src/pagination.mjs +144 -0
- package/dist/theme/src/presets/antdv/table-locale.d.ts +2 -2
- package/dist/theme/src/presets/antdv/table-locale.mjs +2 -2
- package/dist/theme/src/presets/antdv/table.d.ts +3 -0
- package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
- package/dist/theme/src/presets/antdv/table.mjs +3 -0
- package/dist/theme/src/presets/element-plus/table-locale.d.ts +2 -2
- package/dist/theme/src/presets/element-plus/table-locale.mjs +2 -2
- package/dist/theme/src/presets/element-plus/table.d.ts +3 -0
- package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
- package/dist/theme/src/presets/element-plus/table.mjs +3 -0
- package/dist/theme/src/presets/index.d.ts.map +1 -1
- package/dist/theme/src/presets/index.mjs +60 -57
- package/dist/theme/src/presets/types.d.ts +1 -0
- package/dist/theme/src/presets/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,69 +1,77 @@
|
|
|
1
|
-
import { shallowRef as
|
|
2
|
-
import { getColumnKey as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { shallowRef as v, watch as y, onMounted as A, onBeforeUnmount as N } from "vue";
|
|
2
|
+
import { getColumnKey as C } from "./useColumns.mjs";
|
|
3
|
+
function H(e, n) {
|
|
4
|
+
const t = [...e.children].find((l) => l.hasAttribute("data-vtg-width-row"))?.querySelectorAll("[data-vtg-track]");
|
|
5
|
+
if (t?.length !== n) return null;
|
|
6
|
+
const r = Array.from(t, (l) => l.getBoundingClientRect().width);
|
|
7
|
+
if (r.some((l) => !Number.isFinite(l) || l < 0)) return null;
|
|
8
|
+
const i = r.reduce((l, f) => l + f, 0);
|
|
9
|
+
return i > 0 ? { widths: r, total: i } : null;
|
|
10
|
+
}
|
|
11
|
+
const F = 0.5;
|
|
12
|
+
function q(e, n) {
|
|
13
|
+
if (e === null || n === null) return e === n;
|
|
14
|
+
if (e.widths.length !== n.widths.length) return !1;
|
|
15
|
+
for (let u = 0; u < e.widths.length; u += 1)
|
|
16
|
+
if (Math.abs(e.widths[u] - n.widths[u]) > F) return !1;
|
|
9
17
|
return !0;
|
|
10
18
|
}
|
|
11
|
-
function
|
|
12
|
-
return
|
|
19
|
+
function O(e, n) {
|
|
20
|
+
return C(e) ?? n;
|
|
13
21
|
}
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
for (let
|
|
18
|
-
const
|
|
19
|
-
if (!Number.isFinite(
|
|
20
|
-
|
|
22
|
+
function R(e, n) {
|
|
23
|
+
const u = [];
|
|
24
|
+
let t = 0;
|
|
25
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
26
|
+
const i = n[String(O(e[r], r))] ?? e[r].width, l = typeof i == "number" ? i : Number.NaN;
|
|
27
|
+
if (!Number.isFinite(l) || l <= 0) return null;
|
|
28
|
+
u.push(l), t += l;
|
|
21
29
|
}
|
|
22
|
-
return
|
|
30
|
+
return t > 0 ? { widths: u, total: t } : null;
|
|
23
31
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
let
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
32
|
+
function I(e) {
|
|
33
|
+
const n = v(null);
|
|
34
|
+
let u = 0, t = null, r = null, i = null;
|
|
35
|
+
function l() {
|
|
36
|
+
const s = e.columns(), o = s.length;
|
|
37
|
+
if (o === 0) return null;
|
|
30
38
|
if (!e.hasHeader())
|
|
31
|
-
return
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
for (const c of
|
|
38
|
-
const
|
|
39
|
-
if (!Number.isInteger(
|
|
40
|
-
d
|
|
39
|
+
return R(s, e.columnWidths);
|
|
40
|
+
const b = e.headerEl();
|
|
41
|
+
if (!b) return null;
|
|
42
|
+
const g = b.querySelectorAll("th[data-vtg-leaf-col]");
|
|
43
|
+
if (g.length !== o) return null;
|
|
44
|
+
const h = new Array(o).fill(-1);
|
|
45
|
+
for (const c of g) {
|
|
46
|
+
const d = Number(c.dataset.vtgLeafCol);
|
|
47
|
+
if (!Number.isInteger(d) || d < 0 || d >= o) return null;
|
|
48
|
+
h[d] = c.getBoundingClientRect().width;
|
|
41
49
|
}
|
|
42
|
-
let
|
|
43
|
-
for (const c of
|
|
50
|
+
let m = 0;
|
|
51
|
+
for (const c of h) {
|
|
44
52
|
if (c < 0) return null;
|
|
45
|
-
|
|
53
|
+
m += c;
|
|
46
54
|
}
|
|
47
|
-
return
|
|
55
|
+
return m > 0 ? { widths: h, total: m } : null;
|
|
48
56
|
}
|
|
49
|
-
function
|
|
50
|
-
if (
|
|
51
|
-
|
|
57
|
+
function f() {
|
|
58
|
+
if (u = 0, !e.enabled()) {
|
|
59
|
+
n.value = null;
|
|
52
60
|
return;
|
|
53
61
|
}
|
|
54
|
-
const
|
|
55
|
-
q(
|
|
62
|
+
const s = l();
|
|
63
|
+
q(n.value, s) || (n.value = s);
|
|
56
64
|
}
|
|
57
65
|
function a() {
|
|
58
66
|
if (typeof requestAnimationFrame > "u") {
|
|
59
|
-
|
|
67
|
+
f();
|
|
60
68
|
return;
|
|
61
69
|
}
|
|
62
|
-
|
|
70
|
+
u || (u = requestAnimationFrame(f));
|
|
63
71
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
|
|
72
|
+
function w() {
|
|
73
|
+
const s = e.enabled() && e.hasHeader() ? e.headerEl() : null, o = s?.querySelector("table") ?? null;
|
|
74
|
+
s === r && o === i || (t && r && t.unobserve(r), t && i && t.unobserve(i), r = s, i = o, s && (!t && typeof ResizeObserver < "u" && (t = new ResizeObserver(a)), t?.observe(s), o && t?.observe(o)));
|
|
67
75
|
}
|
|
68
76
|
return y(
|
|
69
77
|
[
|
|
@@ -74,15 +82,16 @@ function M(e) {
|
|
|
74
82
|
() => ({ ...e.columnWidths })
|
|
75
83
|
],
|
|
76
84
|
() => {
|
|
77
|
-
|
|
85
|
+
w(), a();
|
|
78
86
|
},
|
|
79
87
|
{ deep: !1, flush: "post" }
|
|
80
|
-
),
|
|
81
|
-
|
|
82
|
-
}),
|
|
83
|
-
|
|
84
|
-
}), { metrics:
|
|
88
|
+
), A(() => {
|
|
89
|
+
w(), a();
|
|
90
|
+
}), N(() => {
|
|
91
|
+
u && cancelAnimationFrame(u), t?.disconnect(), t = null, r = null, i = null;
|
|
92
|
+
}), { metrics: n, remeasure: a };
|
|
85
93
|
}
|
|
86
94
|
export {
|
|
87
|
-
|
|
95
|
+
H as measureColumnTracks,
|
|
96
|
+
I as useColumnMetrics
|
|
88
97
|
};
|
|
@@ -10,5 +10,7 @@ export declare function useExpand(options: {
|
|
|
10
10
|
expandable: () => Expandable | undefined;
|
|
11
11
|
getRowKey: (record: Record<string, unknown>, index: number) => Key;
|
|
12
12
|
data: () => Record<string, unknown>[];
|
|
13
|
+
childrenColumnName?: () => string | undefined;
|
|
14
|
+
initializeNewRows?: () => boolean;
|
|
13
15
|
}): UseExpandReturn;
|
|
14
16
|
//# sourceMappingURL=useExpand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useExpand.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useExpand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,KAAK,CAAA;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAA;IACjC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtE,cAAc,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;CACtC;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE;IACjC,UAAU,EAAE,MAAM,UAAU,GAAG,SAAS,CAAA;IACxC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,GAAG,CAAA;IAClE,IAAI,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"useExpand.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useExpand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,KAAK,CAAA;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAA;IACjC,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtE,cAAc,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;CACtC;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE;IACjC,UAAU,EAAE,MAAM,UAAU,GAAG,SAAS,CAAA;IACxC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,GAAG,CAAA;IAClE,IAAI,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACrC,kBAAkB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IAC7C,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAA;CAClC,GAAG,eAAe,CA+FlB"}
|
|
@@ -1,37 +1,61 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
|
|
1
|
+
import { ref as R, watch as y, computed as v } from "vue";
|
|
2
|
+
function h(a) {
|
|
3
|
+
const t = R([]);
|
|
4
|
+
let o = !1;
|
|
5
|
+
const c = /* @__PURE__ */ new Set();
|
|
6
|
+
function w(e) {
|
|
7
|
+
const n = [];
|
|
8
|
+
function l(d) {
|
|
9
|
+
for (const u of d) {
|
|
10
|
+
n.push(a.getRowKey(u, n.length));
|
|
11
|
+
const i = u[a.childrenColumnName?.() ?? "children"];
|
|
12
|
+
Array.isArray(i) && l(i);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return l(e), n;
|
|
16
|
+
}
|
|
17
|
+
y(
|
|
6
18
|
() => a.expandable(),
|
|
7
19
|
(e) => {
|
|
8
|
-
|
|
20
|
+
o || !e || (o = !0, e.defaultExpandAllRows ? (t.value = a.initializeNewRows?.() ? w(a.data()) : a.data().map((n, l) => a.getRowKey(n, l)), t.value.forEach((n) => c.add(n))) : e.defaultExpandedRowKeys && (t.value = [...e.defaultExpandedRowKeys]));
|
|
21
|
+
},
|
|
22
|
+
{ immediate: !0 }
|
|
23
|
+
);
|
|
24
|
+
const f = v(() => a.expandable()?.expandedRowKeys !== void 0);
|
|
25
|
+
y(
|
|
26
|
+
() => a.initializeNewRows?.() && a.expandable()?.defaultExpandAllRows ? a.data() : null,
|
|
27
|
+
(e) => {
|
|
28
|
+
if (!e || f.value) return;
|
|
29
|
+
const n = new Set(t.value);
|
|
30
|
+
for (const l of w(e))
|
|
31
|
+
c.has(l) || n.add(l), c.add(l);
|
|
32
|
+
t.value = [...n];
|
|
9
33
|
},
|
|
10
34
|
{ immediate: !0 }
|
|
11
35
|
);
|
|
12
|
-
const
|
|
36
|
+
const r = v(() => {
|
|
13
37
|
const e = a.expandable();
|
|
14
38
|
if (!e) return /* @__PURE__ */ new Set();
|
|
15
|
-
const
|
|
16
|
-
return new Set(
|
|
39
|
+
const n = f.value ? e.expandedRowKeys : t.value;
|
|
40
|
+
return new Set(n);
|
|
17
41
|
});
|
|
18
42
|
function x(e) {
|
|
19
|
-
return
|
|
43
|
+
return r.value.has(e);
|
|
20
44
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
45
|
+
function K(e, n) {
|
|
46
|
+
const l = a.expandable();
|
|
47
|
+
if (!l) return;
|
|
48
|
+
const d = a.getRowKey(e, n), u = !x(d);
|
|
49
|
+
f.value || (u ? t.value = [...t.value, d] : t.value = t.value.filter((s) => s !== d)), l.onExpand?.(u, e);
|
|
50
|
+
const i = u ? [...r.value, d] : [...r.value].filter((s) => s !== d);
|
|
51
|
+
l.onExpandedRowsChange?.(i);
|
|
28
52
|
}
|
|
29
53
|
return {
|
|
30
54
|
isExpanded: x,
|
|
31
|
-
toggleExpand:
|
|
32
|
-
expandedKeySet:
|
|
55
|
+
toggleExpand: K,
|
|
56
|
+
expandedKeySet: r
|
|
33
57
|
};
|
|
34
58
|
}
|
|
35
59
|
export {
|
|
36
|
-
|
|
60
|
+
h as useExpand
|
|
37
61
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TablePaginationConfig, TablePaginationState } from '../types/pagination';
|
|
2
|
+
export declare function positiveInteger(value: unknown, fallback: number): number;
|
|
3
|
+
export declare function usePagination<T>(options: {
|
|
4
|
+
pagination: () => false | TablePaginationConfig | undefined;
|
|
5
|
+
data: () => T[];
|
|
6
|
+
onChange: (state: TablePaginationState) => void;
|
|
7
|
+
}): {
|
|
8
|
+
enabled: import('vue').ComputedRef<boolean>;
|
|
9
|
+
config: import('vue').ComputedRef<TablePaginationConfig>;
|
|
10
|
+
state: import('vue').ComputedRef<TablePaginationState>;
|
|
11
|
+
pageData: import('vue').ComputedRef<T[]>;
|
|
12
|
+
change: (current: number, pageSize?: number) => void;
|
|
13
|
+
resetForFilter: () => TablePaginationState | undefined;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=usePagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagination.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/usePagination.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAEtF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE;IACxC,UAAU,EAAE,MAAM,KAAK,GAAG,qBAAqB,GAAG,SAAS,CAAA;IAC3D,IAAI,EAAE,MAAM,CAAC,EAAE,CAAA;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAChD;;;;;sBAsE0B,MAAM;0BAeJ,oBAAoB,GAAG,SAAS;EAQ5D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { computed as g, ref as p, watch as f } from "vue";
|
|
2
|
+
function o(r, u) {
|
|
3
|
+
return typeof r == "number" && Number.isSafeInteger(r) && r > 0 ? r : u;
|
|
4
|
+
}
|
|
5
|
+
function C(r) {
|
|
6
|
+
const u = g(() => !!r.pagination()), l = g(() => r.pagination() || {}), c = p(1), v = p(10);
|
|
7
|
+
let d = !1;
|
|
8
|
+
f(
|
|
9
|
+
u,
|
|
10
|
+
(e) => {
|
|
11
|
+
!e || d || (d = !0, v.value = o(l.value.defaultPageSize, 10), c.value = o(l.value.defaultCurrent, 1));
|
|
12
|
+
},
|
|
13
|
+
{ immediate: !0, flush: "sync" }
|
|
14
|
+
);
|
|
15
|
+
const i = g(() => {
|
|
16
|
+
const e = l.value, n = o(e.pageSize, v.value), t = o(e.total, r.data().length);
|
|
17
|
+
return { current: Math.min(
|
|
18
|
+
o(e.current, c.value),
|
|
19
|
+
Math.max(1, Math.ceil(t / n))
|
|
20
|
+
), pageSize: n, total: t };
|
|
21
|
+
});
|
|
22
|
+
f(
|
|
23
|
+
() => i.value.current,
|
|
24
|
+
(e) => {
|
|
25
|
+
u.value && l.value.current === void 0 && (c.value = e);
|
|
26
|
+
},
|
|
27
|
+
{ flush: "sync" }
|
|
28
|
+
);
|
|
29
|
+
const m = g(() => {
|
|
30
|
+
const e = r.data();
|
|
31
|
+
if (!u.value) return e;
|
|
32
|
+
const { current: n, pageSize: t, total: a } = i.value;
|
|
33
|
+
return e.length < a && e.length <= t ? e : e.slice((n - 1) * t, n * t);
|
|
34
|
+
});
|
|
35
|
+
f(
|
|
36
|
+
() => [u.value, r.data().length, i.value.total, i.value.pageSize],
|
|
37
|
+
([e, n, t, a]) => {
|
|
38
|
+
},
|
|
39
|
+
{ immediate: !0 }
|
|
40
|
+
);
|
|
41
|
+
function h(e, n, t) {
|
|
42
|
+
const a = l.value;
|
|
43
|
+
a.current === void 0 && (c.value = e), a.pageSize === void 0 && (v.value = n), a["onUpdate:current"]?.(e), t && (a["onUpdate:pageSize"]?.(n), a.onShowSizeChange?.(e, n)), a.onChange?.(e, n);
|
|
44
|
+
}
|
|
45
|
+
function z(e, n = i.value.pageSize) {
|
|
46
|
+
if (!u.value || l.value.disabled) return;
|
|
47
|
+
const t = i.value, a = o(n, t.pageSize), s = Math.min(
|
|
48
|
+
o(e, t.current),
|
|
49
|
+
Math.max(1, Math.ceil(t.total / a))
|
|
50
|
+
);
|
|
51
|
+
if (s === t.current && a === t.pageSize) return;
|
|
52
|
+
const M = { current: s, pageSize: a, total: t.total };
|
|
53
|
+
h(s, a, a !== t.pageSize), r.onChange(M);
|
|
54
|
+
}
|
|
55
|
+
function S() {
|
|
56
|
+
if (!u.value) return;
|
|
57
|
+
const e = { ...i.value, current: 1 };
|
|
58
|
+
return h(1, e.pageSize, !1), e;
|
|
59
|
+
}
|
|
60
|
+
return { enabled: u, config: l, state: i, pageData: m, change: z, resetForFilter: S };
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
o as positiveInteger,
|
|
64
|
+
C as usePagination
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePagination.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/usePagination.test.ts"],"names":[],"mappings":""}
|
|
@@ -6,6 +6,7 @@ export interface UseResizeReturn {
|
|
|
6
6
|
isResizing: Ref<boolean>;
|
|
7
7
|
}
|
|
8
8
|
export declare function useResize(options: {
|
|
9
|
+
columns?: () => readonly ColumnType<Record<string, unknown>>[];
|
|
9
10
|
onResizeColumn?: (column: ColumnType<Record<string, unknown>>, width: number) => void;
|
|
10
11
|
}): UseResizeReturn;
|
|
11
12
|
//# sourceMappingURL=useResize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResize.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useResize.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useResize.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,WAAW,EAAE,CACX,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC3C,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,YAAY,KAChB,IAAI,CAAA;IACT,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACzB;AAUD,wBAAgB,SAAS,CAAC,OAAO,EAAE;IACjC,OAAO,CAAC,EAAE,MAAM,SAAS,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAA;IAC9D,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACtF,GAAG,eAAe,CA6IlB"}
|
|
@@ -1,48 +1,76 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { reactive as C, ref as E, watch as M, onBeforeUnmount as k } from "vue";
|
|
2
|
+
import { normalizeMinWidth as u, parseColumnWidth as w } from "../utils/columnWidth.mjs";
|
|
3
|
+
import { getColumnKey as h } from "./useColumns.mjs";
|
|
4
|
+
function L(c) {
|
|
5
|
+
const i = c.currentTarget;
|
|
6
|
+
if (!(i instanceof Element)) return;
|
|
7
|
+
const o = i.closest("th")?.getBoundingClientRect().width;
|
|
8
|
+
return o !== void 0 && Number.isFinite(o) && o > 0 ? o : void 0;
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const l = o.minWidth ?? 50, s = o.maxWidth;
|
|
17
|
-
e = Math.max(l, e), s !== void 0 && (e = Math.min(s, e)), n[u] = e;
|
|
10
|
+
function U(c) {
|
|
11
|
+
const i = C({}), o = E(!1);
|
|
12
|
+
let d = null, s = "", v = 0, y = 0, a = !1, p = "", g = "";
|
|
13
|
+
const m = {};
|
|
14
|
+
function W(t, n) {
|
|
15
|
+
const e = u(t.minWidth) ?? 50, r = u(t.maxWidth);
|
|
16
|
+
return Math.max(e, r === void 0 ? n : Math.min(r, n));
|
|
18
17
|
}
|
|
19
|
-
function
|
|
20
|
-
if (!
|
|
21
|
-
const
|
|
22
|
-
|
|
18
|
+
function f() {
|
|
19
|
+
if (!d || !c.columns) return d;
|
|
20
|
+
const t = c.columns().find((n, e) => String(h(n) ?? e) === s);
|
|
21
|
+
return t?.resizable ? (d = t, t) : (l(), null);
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
23
|
+
function b(t) {
|
|
24
|
+
const n = f();
|
|
25
|
+
if (!n) return;
|
|
26
|
+
const e = t.clientX - v;
|
|
27
|
+
if (!Number.isFinite(e) || !a && e === 0) return;
|
|
28
|
+
const r = W(n, y + e);
|
|
29
|
+
a = !0, m[s] = r, i[s] = r;
|
|
26
30
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (s !== void 0)
|
|
33
|
-
d = s;
|
|
34
|
-
else {
|
|
35
|
-
const a = i.width;
|
|
36
|
-
d = typeof a == "number" && Number.isFinite(a) ? a : w(e) ?? 100;
|
|
37
|
-
}
|
|
38
|
-
t.value = !0, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", f), document.addEventListener("pointerup", v);
|
|
31
|
+
function z(t) {
|
|
32
|
+
const n = f();
|
|
33
|
+
if (!n) return;
|
|
34
|
+
const e = i[s], r = a && u(e) !== void 0;
|
|
35
|
+
r && (m[s] = e), l(), r && c.onResizeColumn?.(n, e);
|
|
39
36
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
function l() {
|
|
38
|
+
document.removeEventListener("pointermove", b), document.removeEventListener("pointerup", z), document.removeEventListener("pointercancel", l), o.value && (document.body.style.cursor = p, document.body.style.userSelect = g), o.value = !1, d = null, a = !1;
|
|
39
|
+
}
|
|
40
|
+
function x(t, n, e) {
|
|
41
|
+
if (!t.resizable) return;
|
|
42
|
+
o.value && l(), e.preventDefault(), e.stopPropagation(), d = t;
|
|
43
|
+
const r = h(t) ?? String(n);
|
|
44
|
+
s = String(r), v = e.clientX, y = L(e) ?? u(i[s]) ?? w(t.width) ?? Math.max(u(t.minWidth) ?? 50, 100), a = !1, p = document.body.style.cursor, g = document.body.style.userSelect, o.value = !0, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("pointermove", b), document.addEventListener("pointerup", z), document.addEventListener("pointercancel", l);
|
|
45
|
+
}
|
|
46
|
+
return c.columns && M(
|
|
47
|
+
() => c.columns().map((t, n) => ({
|
|
48
|
+
column: t,
|
|
49
|
+
key: String(h(t) ?? n),
|
|
50
|
+
minWidth: u(t.minWidth),
|
|
51
|
+
maxWidth: u(t.maxWidth),
|
|
52
|
+
resizable: t.resizable
|
|
53
|
+
})),
|
|
54
|
+
(t) => {
|
|
55
|
+
const n = new Set(t.map((e) => e.key));
|
|
56
|
+
for (const e of Object.keys(i))
|
|
57
|
+
n.has(e) || (delete i[e], delete m[e]);
|
|
58
|
+
for (const { key: e, minWidth: r } of t) {
|
|
59
|
+
const S = m[e] ?? u(i[e]);
|
|
60
|
+
S !== void 0 && (i[e] = Math.max(S, r ?? 0));
|
|
61
|
+
}
|
|
62
|
+
if (d) {
|
|
63
|
+
const e = f();
|
|
64
|
+
e && a && (i[s] = W(e, i[s]));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{ flush: "sync" }
|
|
68
|
+
), k(l), {
|
|
69
|
+
columnWidths: i,
|
|
70
|
+
startResize: x,
|
|
71
|
+
isResizing: o
|
|
44
72
|
};
|
|
45
73
|
}
|
|
46
74
|
export {
|
|
47
|
-
|
|
75
|
+
U as useResize
|
|
48
76
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComputedRef, Ref } from 'vue';
|
|
2
2
|
import { ColumnType, Key } from '../types';
|
|
3
3
|
export interface ScrollConfig {
|
|
4
|
+
scrollToFirstRowOnChange?: boolean;
|
|
4
5
|
x?: number | string;
|
|
5
6
|
/**
|
|
6
7
|
* 纵向滚动高度(启用固定表头)。
|
|
@@ -36,5 +37,7 @@ export interface UseScrollReturn {
|
|
|
36
37
|
export declare function useScroll(options: {
|
|
37
38
|
displayColumns: () => ColumnType<Record<string, unknown>>[];
|
|
38
39
|
columnWidths?: Record<string, number>;
|
|
40
|
+
layoutWidths?: () => readonly number[] | undefined;
|
|
41
|
+
syncElements?: () => HTMLElement[];
|
|
39
42
|
}): UseScrollReturn;
|
|
40
43
|
//# sourceMappingURL=useScroll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScroll.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"useScroll.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,WAAW,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAQ/C,MAAM,WAA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,SAAS,CAAA;IAClD,YAAY,CAAC,EAAE,MAAM,WAAW,EAAE,CAAA;CACnC,GAAG,eAAe,CAuGlB"}
|
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { getColumnKey as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ref as i, computed as m, watch as w, nextTick as C } from "vue";
|
|
2
|
+
import { getColumnKey as R } from "./useColumns.mjs";
|
|
3
|
+
import { resolveDeclaredColumnWidth as p } from "../utils/columnWidth.mjs";
|
|
4
|
+
function x(o, c) {
|
|
5
|
+
return R(o) ?? c;
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
atStart: m(() =>
|
|
9
|
-
atEnd: m(() =>
|
|
7
|
+
function I(o) {
|
|
8
|
+
const c = i(null), f = i(null), s = i(0), u = i(0), L = {
|
|
9
|
+
atStart: m(() => s.value <= 0),
|
|
10
|
+
atEnd: m(() => s.value >= u.value - 1)
|
|
10
11
|
};
|
|
11
|
-
function
|
|
12
|
-
|
|
12
|
+
function a(e, l) {
|
|
13
|
+
s.value = e, typeof l == "number" && (u.value = Math.max(0, l)), c.value && (c.value.scrollLeft = e);
|
|
14
|
+
for (const r of o.syncElements?.() ?? []) r.scrollLeft = e;
|
|
13
15
|
}
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
|
|
16
|
+
function S(e) {
|
|
17
|
+
const l = f.value;
|
|
18
|
+
a(e.scrollLeft, l ? l.scrollWidth - l.clientWidth : u.value);
|
|
17
19
|
}
|
|
18
20
|
function g() {
|
|
19
|
-
const e =
|
|
20
|
-
e &&
|
|
21
|
+
const e = f.value;
|
|
22
|
+
e && a(e.scrollLeft, e.scrollWidth - e.clientWidth);
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
w(f, () => {
|
|
25
|
+
C(g);
|
|
24
26
|
});
|
|
25
|
-
const
|
|
26
|
-
const e = o.displayColumns(),
|
|
27
|
-
let
|
|
27
|
+
const k = m(() => {
|
|
28
|
+
const e = o.displayColumns(), l = /* @__PURE__ */ new Map();
|
|
29
|
+
let r = 0, y = -1;
|
|
28
30
|
for (let t = 0; t < e.length; t++)
|
|
29
31
|
e[t].fixed === "left" && (y = t);
|
|
30
32
|
for (let t = 0; t < e.length; t++) {
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
left:
|
|
33
|
+
const n = e[t];
|
|
34
|
+
if (n.fixed !== "left") continue;
|
|
35
|
+
const d = x(n, t), h = o.layoutWidths?.()?.[t] ?? p(n, t, o.columnWidths);
|
|
36
|
+
l.set(d, {
|
|
37
|
+
left: r,
|
|
36
38
|
isLastLeft: t === y
|
|
37
|
-
}),
|
|
39
|
+
}), r += h;
|
|
38
40
|
}
|
|
39
|
-
let v = 0,
|
|
41
|
+
let v = 0, W = e.length;
|
|
40
42
|
for (let t = 0; t < e.length; t++)
|
|
41
43
|
if (e[t].fixed === "right") {
|
|
42
|
-
|
|
44
|
+
W = t;
|
|
43
45
|
break;
|
|
44
46
|
}
|
|
45
47
|
for (let t = e.length - 1; t >= 0; t--) {
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
48
|
+
const n = e[t];
|
|
49
|
+
if (n.fixed !== "right") continue;
|
|
50
|
+
const d = x(n, t), h = o.layoutWidths?.()?.[t] ?? p(n, t, o.columnWidths);
|
|
51
|
+
l.set(d, {
|
|
50
52
|
right: v,
|
|
51
|
-
isFirstRight: t ===
|
|
53
|
+
isFirstRight: t === W
|
|
52
54
|
}), v += h;
|
|
53
55
|
}
|
|
54
|
-
return
|
|
56
|
+
return l;
|
|
55
57
|
});
|
|
56
58
|
return {
|
|
57
|
-
headerWrapRef:
|
|
58
|
-
bodyWrapRef:
|
|
59
|
-
scrollState:
|
|
60
|
-
handleBodyScroll:
|
|
61
|
-
fixedOffsets:
|
|
59
|
+
headerWrapRef: c,
|
|
60
|
+
bodyWrapRef: f,
|
|
61
|
+
scrollState: L,
|
|
62
|
+
handleBodyScroll: S,
|
|
63
|
+
fixedOffsets: k,
|
|
62
64
|
updateScrollState: g,
|
|
63
|
-
syncHorizontalScroll:
|
|
65
|
+
syncHorizontalScroll: a
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
I as useScroll
|
|
68
70
|
};
|
|
@@ -9,6 +9,7 @@ export interface UseSelectionOptions<TRecord extends Record<string, unknown>> {
|
|
|
9
9
|
getRowKey: (record: TRecord, index: number) => Key;
|
|
10
10
|
data: () => TRecord[];
|
|
11
11
|
visibleData: () => TRecord[];
|
|
12
|
+
paginate?: () => boolean;
|
|
12
13
|
childrenColumnName?: () => string | undefined;
|
|
13
14
|
onSelectionChange?: () => void;
|
|
14
15
|
}
|
|
@@ -18,7 +19,7 @@ export declare function useSelection<TRecord extends Record<string, unknown>>(op
|
|
|
18
19
|
isDisabled: (record: TRecord) => boolean;
|
|
19
20
|
getSelectionState: (record: TRecord, index: number) => SelectionState;
|
|
20
21
|
toggleRow: (record: TRecord, index: number, nativeEvent?: MouseEvent) => void;
|
|
21
|
-
toggleAll: (selected: boolean) => void;
|
|
22
|
+
toggleAll: (selected: boolean, allData?: boolean) => void;
|
|
22
23
|
allCheckedState: import('vue').ComputedRef<"none" | "all" | "partial">;
|
|
23
24
|
invertSelection: () => void;
|
|
24
25
|
clearSelection: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSelection.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useSelection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAWjD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,OAAO,CAAA;IACtB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,mBAAmB,CAAC,OAAO,S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