@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,245 +1,284 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
const { data:
|
|
4
|
-
let
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
key:
|
|
9
|
-
record:
|
|
10
|
-
index:
|
|
11
|
-
level:
|
|
12
|
-
parentKey:
|
|
1
|
+
import { ref as _, watch as P, computed as k } from "vue";
|
|
2
|
+
function ne(w) {
|
|
3
|
+
const { data: c, childrenColumnName: d, getRowKey: R } = w, b = [];
|
|
4
|
+
let N = 0;
|
|
5
|
+
function I(y, C, h) {
|
|
6
|
+
y.forEach((f) => {
|
|
7
|
+
const p = N, z = R(f, p), a = f[d], S = {
|
|
8
|
+
key: z,
|
|
9
|
+
record: f,
|
|
10
|
+
index: p,
|
|
11
|
+
level: C,
|
|
12
|
+
parentKey: h?.key,
|
|
13
13
|
childrenKeys: []
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
b.push(S), h?.childrenKeys.push(z), N += 1, Array.isArray(a) && a.length > 0 && I(a, C + 1, S);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return I(c, 0), b;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
function le(
|
|
22
|
-
return
|
|
23
|
-
key:
|
|
24
|
-
record:
|
|
25
|
-
index:
|
|
20
|
+
const se = Object.freeze([]);
|
|
21
|
+
function le(w) {
|
|
22
|
+
return w.data.map((c, d) => ({
|
|
23
|
+
key: w.getRowKey(c, d),
|
|
24
|
+
record: c,
|
|
25
|
+
index: d,
|
|
26
26
|
level: 0,
|
|
27
|
-
childrenKeys:
|
|
27
|
+
childrenKeys: se
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const { rowSelection:
|
|
32
|
-
|
|
33
|
-
() =>
|
|
30
|
+
function oe(w) {
|
|
31
|
+
const { rowSelection: c, getRowKey: d, data: R, visibleData: b, childrenColumnName: N, onSelectionChange: I } = w, y = _(/* @__PURE__ */ new Set()), C = _(!1), h = _(null), f = /* @__PURE__ */ new Map();
|
|
32
|
+
P(
|
|
33
|
+
() => c()?.defaultSelectedRowKeys,
|
|
34
34
|
(e) => {
|
|
35
|
-
|
|
35
|
+
C.value || !e?.length || (y.value = new Set(e), C.value = !0);
|
|
36
36
|
},
|
|
37
37
|
{ immediate: !0 }
|
|
38
38
|
);
|
|
39
|
-
function
|
|
40
|
-
return
|
|
39
|
+
function p() {
|
|
40
|
+
return c()?.selectedRowKeys !== void 0;
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
data:
|
|
44
|
-
childrenColumnName:
|
|
45
|
-
getRowKey:
|
|
42
|
+
const z = k(() => c()?.checkStrictly === !1), a = k(() => c() ? z.value || w.paginate?.() && R().some((e) => Array.isArray(e[N?.() ?? "children"])) ? ne({
|
|
43
|
+
data: R(),
|
|
44
|
+
childrenColumnName: N?.() ?? "children",
|
|
45
|
+
getRowKey: d
|
|
46
46
|
}) : le({
|
|
47
|
-
data:
|
|
48
|
-
getRowKey:
|
|
49
|
-
}) : []),
|
|
47
|
+
data: R(),
|
|
48
|
+
getRowKey: d
|
|
49
|
+
}) : []), S = k(() => {
|
|
50
50
|
const e = /* @__PURE__ */ new Map();
|
|
51
|
-
return
|
|
52
|
-
})
|
|
53
|
-
|
|
51
|
+
return a.value.forEach((t) => e.set(t.key, t)), e;
|
|
52
|
+
});
|
|
53
|
+
P(
|
|
54
|
+
[
|
|
55
|
+
a,
|
|
56
|
+
() => c()?.preserveSelectedRowKeys,
|
|
57
|
+
() => c()?.selectedRowKeys
|
|
58
|
+
],
|
|
59
|
+
() => {
|
|
60
|
+
if (!c()?.preserveSelectedRowKeys) {
|
|
61
|
+
f.clear();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const e = new Set(c()?.selectedRowKeys ?? y.value);
|
|
65
|
+
for (const t of f.keys()) e.has(t) || f.delete(t);
|
|
66
|
+
for (const t of a.value)
|
|
67
|
+
e.has(t.key) && f.set(t.key, t.record);
|
|
68
|
+
},
|
|
69
|
+
{ immediate: !0, flush: "sync" }
|
|
70
|
+
), P(
|
|
71
|
+
() => b(),
|
|
72
|
+
() => {
|
|
73
|
+
h.value = null;
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
const L = k(
|
|
77
|
+
() => a.value.filter((e) => e.parentKey === void 0).map((e) => e.key)
|
|
54
78
|
);
|
|
55
|
-
function
|
|
56
|
-
return
|
|
79
|
+
function v(e) {
|
|
80
|
+
return c()?.getCheckboxProps?.(e)?.disabled ?? !1;
|
|
57
81
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
82
|
+
function j(e) {
|
|
83
|
+
return S.value.get(e)?.childrenKeys ?? [];
|
|
60
84
|
}
|
|
61
|
-
const
|
|
62
|
-
const e =
|
|
63
|
-
for (let
|
|
64
|
-
const
|
|
65
|
-
for (const r of
|
|
85
|
+
const O = k(() => {
|
|
86
|
+
const e = S.value, t = /* @__PURE__ */ new Map(), n = a.value;
|
|
87
|
+
for (let s = n.length - 1; s >= 0; s -= 1) {
|
|
88
|
+
const l = n[s], o = [];
|
|
89
|
+
for (const r of l.childrenKeys) {
|
|
66
90
|
const i = e.get(r);
|
|
67
|
-
if (!i ||
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
91
|
+
if (!i || v(i.record)) continue;
|
|
92
|
+
o.push(r);
|
|
93
|
+
const u = t.get(r);
|
|
94
|
+
u && o.push(...u);
|
|
71
95
|
}
|
|
72
|
-
t.set(
|
|
96
|
+
t.set(l.key, o);
|
|
73
97
|
}
|
|
74
98
|
return t;
|
|
75
99
|
});
|
|
76
|
-
function
|
|
77
|
-
if (
|
|
100
|
+
function V(e) {
|
|
101
|
+
if (c()?.checkStrictly !== !1)
|
|
78
102
|
return new Set(e);
|
|
79
|
-
const t = new Set(e),
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
84
|
-
const r =
|
|
103
|
+
const t = new Set(e), n = (s) => {
|
|
104
|
+
const l = j(s);
|
|
105
|
+
l.forEach(n);
|
|
106
|
+
const o = S.value.get(s);
|
|
107
|
+
if (!o || v(o.record)) return;
|
|
108
|
+
const r = l.map((u) => S.value.get(u)).filter((u) => !!u && !v(u.record));
|
|
85
109
|
if (r.length === 0) return;
|
|
86
|
-
r.every((
|
|
110
|
+
r.every((u) => t.has(u.key)) ? t.add(s) : t.delete(s);
|
|
87
111
|
};
|
|
88
|
-
return
|
|
112
|
+
return L.value.forEach(n), t;
|
|
89
113
|
}
|
|
90
|
-
const
|
|
91
|
-
const e =
|
|
92
|
-
return
|
|
114
|
+
const g = k(() => {
|
|
115
|
+
const e = c(), t = e?.selectedRowKeys !== void 0 ? new Set(e.selectedRowKeys) : y.value;
|
|
116
|
+
return V(t);
|
|
93
117
|
});
|
|
94
|
-
|
|
95
|
-
[
|
|
118
|
+
P(
|
|
119
|
+
[a, () => c()?.preserveSelectedRowKeys],
|
|
96
120
|
() => {
|
|
97
|
-
if (
|
|
98
|
-
const e = new Set(
|
|
99
|
-
Array.from(
|
|
121
|
+
if (p() || c()?.preserveSelectedRowKeys || y.value.size === 0) return;
|
|
122
|
+
const e = new Set(a.value.map((n) => n.key)), t = new Set(
|
|
123
|
+
Array.from(y.value).filter((n) => e.has(n))
|
|
100
124
|
);
|
|
101
|
-
t.size !==
|
|
125
|
+
t.size !== y.value.size && (y.value = t);
|
|
102
126
|
},
|
|
103
127
|
{ immediate: !0 }
|
|
104
128
|
);
|
|
105
|
-
function
|
|
106
|
-
return
|
|
129
|
+
function M(e) {
|
|
130
|
+
return g.value.has(e);
|
|
107
131
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
132
|
+
function m(e) {
|
|
133
|
+
const t = a.value.filter((n) => e.has(n.key)).map((n) => n.record);
|
|
134
|
+
if (c()?.preserveSelectedRowKeys)
|
|
135
|
+
for (const n of e)
|
|
136
|
+
!S.value.has(n) && f.has(n) && t.push(f.get(n));
|
|
137
|
+
return t;
|
|
110
138
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
139
|
+
function q() {
|
|
140
|
+
return b().map((e, t) => S.value.get(d(e, t)) ?? null).filter((e) => e !== null);
|
|
113
141
|
}
|
|
114
|
-
function
|
|
115
|
-
return
|
|
142
|
+
function E() {
|
|
143
|
+
return q().filter((e) => !v(e.record));
|
|
116
144
|
}
|
|
117
|
-
function
|
|
118
|
-
return
|
|
145
|
+
function B() {
|
|
146
|
+
return a.value.filter((e) => !v(e.record));
|
|
119
147
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
148
|
+
function F(e, t) {
|
|
149
|
+
const n = d(e, t), s = M(n), l = v(e);
|
|
150
|
+
if (c()?.checkStrictly !== !1)
|
|
123
151
|
return {
|
|
124
|
-
checked:
|
|
152
|
+
checked: s,
|
|
125
153
|
indeterminate: !1,
|
|
126
|
-
disabled:
|
|
154
|
+
disabled: l
|
|
127
155
|
};
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
156
|
+
const o = O.value.get(n) ?? [];
|
|
157
|
+
if (o.length === 0)
|
|
130
158
|
return {
|
|
131
|
-
checked:
|
|
159
|
+
checked: s,
|
|
132
160
|
indeterminate: !1,
|
|
133
|
-
disabled:
|
|
161
|
+
disabled: l
|
|
134
162
|
};
|
|
135
|
-
const r =
|
|
163
|
+
const r = o.filter((i) => g.value.has(i)).length;
|
|
136
164
|
return {
|
|
137
|
-
checked:
|
|
138
|
-
indeterminate: r > 0 && r <
|
|
139
|
-
disabled:
|
|
165
|
+
checked: s,
|
|
166
|
+
indeterminate: r > 0 && r < o.length,
|
|
167
|
+
disabled: l
|
|
140
168
|
};
|
|
141
169
|
}
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
|
|
170
|
+
function K(e, t) {
|
|
171
|
+
const n = V(e);
|
|
172
|
+
if (c()?.preserveSelectedRowKeys) {
|
|
173
|
+
if (!p())
|
|
174
|
+
for (const s of f.keys())
|
|
175
|
+
n.has(s) || f.delete(s);
|
|
176
|
+
for (const s of a.value)
|
|
177
|
+
n.has(s.key) && f.set(s.key, s.record);
|
|
178
|
+
}
|
|
179
|
+
p() || (y.value = n);
|
|
145
180
|
{
|
|
146
|
-
const
|
|
147
|
-
|
|
181
|
+
const s = Array.from(n), l = m(n);
|
|
182
|
+
c()?.onChange?.(s, l), I?.();
|
|
148
183
|
}
|
|
149
184
|
}
|
|
150
|
-
function
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
(r) =>
|
|
185
|
+
function Y(e, t, n, s) {
|
|
186
|
+
const l = S.value.get(e);
|
|
187
|
+
if (!l || v(l.record)) return;
|
|
188
|
+
const o = t.has(e);
|
|
189
|
+
n ? t.add(e) : t.delete(e), o !== n && s.push(l.record), j(e).forEach(
|
|
190
|
+
(r) => Y(r, t, n, s)
|
|
156
191
|
);
|
|
157
192
|
}
|
|
158
|
-
function
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
const i =
|
|
164
|
-
(
|
|
193
|
+
function G(e, t, n) {
|
|
194
|
+
const s = c();
|
|
195
|
+
if (!s) return;
|
|
196
|
+
const l = d(e, t), o = !M(l);
|
|
197
|
+
if (s.type !== "radio" && n?.shiftKey && h.value !== null && c()?.checkStrictly !== !1) {
|
|
198
|
+
const i = E(), u = i.findIndex((x) => x.key === l), D = i.findIndex(
|
|
199
|
+
(x) => x.key === h.value
|
|
165
200
|
);
|
|
166
|
-
if (
|
|
167
|
-
const [
|
|
168
|
-
i.slice(
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
}),
|
|
201
|
+
if (u !== -1 && D !== -1) {
|
|
202
|
+
const [x, ee] = u > D ? [D, u] : [u, D], A = new Set(g.value), H = [];
|
|
203
|
+
i.slice(x, ee + 1).forEach((T) => {
|
|
204
|
+
const te = A.has(T.key);
|
|
205
|
+
o ? A.add(T.key) : A.delete(T.key), te !== o && H.push(T.record);
|
|
206
|
+
}), K(A), s.onSelectMultiple?.(o, m(A), H), h.value = l;
|
|
172
207
|
return;
|
|
173
208
|
}
|
|
174
209
|
}
|
|
175
|
-
if (
|
|
176
|
-
const i =
|
|
177
|
-
|
|
210
|
+
if (s.type === "radio") {
|
|
211
|
+
const i = o ? /* @__PURE__ */ new Set([l]) : /* @__PURE__ */ new Set();
|
|
212
|
+
K(i), s.onSelect?.(e, o, m(i)), h.value = l;
|
|
178
213
|
return;
|
|
179
214
|
}
|
|
180
|
-
const r = new Set(
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
function
|
|
184
|
-
const
|
|
185
|
-
if (!
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
function
|
|
190
|
-
if (
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
|
|
215
|
+
const r = new Set(g.value);
|
|
216
|
+
o ? r.add(l) : r.delete(l), K(r), s.onSelect?.(e, o, m(r)), h.value = l;
|
|
217
|
+
}
|
|
218
|
+
function J(e, t) {
|
|
219
|
+
const n = c();
|
|
220
|
+
if (!n) return;
|
|
221
|
+
const s = d(e, t), l = !M(s), o = new Set(g.value);
|
|
222
|
+
Y(s, o, l, []), K(o), n.onSelect?.(e, l, m(o)), h.value = s;
|
|
223
|
+
}
|
|
224
|
+
function Q(e, t, n) {
|
|
225
|
+
if (v(e)) return;
|
|
226
|
+
const s = c();
|
|
227
|
+
if (s) {
|
|
228
|
+
if (s.checkStrictly === !1 && s.type !== "radio") {
|
|
229
|
+
J(e, t);
|
|
195
230
|
return;
|
|
196
231
|
}
|
|
197
|
-
|
|
232
|
+
G(e, t, n);
|
|
198
233
|
}
|
|
199
234
|
}
|
|
200
|
-
function
|
|
201
|
-
const
|
|
202
|
-
if (!
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
235
|
+
function U(e, t = !1) {
|
|
236
|
+
const n = c();
|
|
237
|
+
if (!n) return;
|
|
238
|
+
const s = w.paginate?.() && !t ? E() : B(), l = new Set(g.value), o = [];
|
|
239
|
+
s.forEach((r) => {
|
|
240
|
+
if (n.checkStrictly === !1) {
|
|
241
|
+
Y(r.key, l, e, o);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const i = l.has(r.key);
|
|
245
|
+
e ? l.add(r.key) : l.delete(r.key), i !== e && o.push(r.record);
|
|
246
|
+
}), K(l), n.onSelectAll?.(e, m(l), o);
|
|
247
|
+
}
|
|
248
|
+
const W = k(() => {
|
|
249
|
+
const e = E();
|
|
211
250
|
if (e.length === 0) return "none";
|
|
212
|
-
const t = e.filter((
|
|
251
|
+
const t = e.filter((n) => g.value.has(n.key)).length;
|
|
213
252
|
return t === 0 ? "none" : t === e.length ? "all" : "partial";
|
|
214
253
|
});
|
|
215
|
-
function W() {
|
|
216
|
-
const e = o();
|
|
217
|
-
if (!e) return;
|
|
218
|
-
const t = D(), l = new Set(v.value);
|
|
219
|
-
t.forEach((n) => {
|
|
220
|
-
l.has(n.key) ? l.delete(n.key) : l.add(n.key);
|
|
221
|
-
}), g(l), e.onSelectInvert?.(Array.from(P(l)));
|
|
222
|
-
}
|
|
223
254
|
function X() {
|
|
224
|
-
const e =
|
|
225
|
-
|
|
255
|
+
const e = c();
|
|
256
|
+
if (!e) return;
|
|
257
|
+
const t = E(), n = new Set(g.value);
|
|
258
|
+
t.forEach((s) => {
|
|
259
|
+
n.has(s.key) ? n.delete(s.key) : n.add(s.key);
|
|
260
|
+
}), K(n), e.onSelectInvert?.(Array.from(V(n)));
|
|
226
261
|
}
|
|
227
262
|
function Z() {
|
|
228
|
-
|
|
263
|
+
const e = c();
|
|
264
|
+
e && (K(/* @__PURE__ */ new Set()), e.onSelectNone?.());
|
|
265
|
+
}
|
|
266
|
+
function $() {
|
|
267
|
+
return E().map((e) => e.key);
|
|
229
268
|
}
|
|
230
269
|
return {
|
|
231
|
-
selectedKeySet:
|
|
232
|
-
isSelected:
|
|
233
|
-
isDisabled:
|
|
234
|
-
getSelectionState:
|
|
235
|
-
toggleRow:
|
|
236
|
-
toggleAll:
|
|
237
|
-
allCheckedState:
|
|
238
|
-
invertSelection:
|
|
239
|
-
clearSelection:
|
|
240
|
-
getChangeableRowKeys:
|
|
270
|
+
selectedKeySet: g,
|
|
271
|
+
isSelected: M,
|
|
272
|
+
isDisabled: v,
|
|
273
|
+
getSelectionState: F,
|
|
274
|
+
toggleRow: Q,
|
|
275
|
+
toggleAll: U,
|
|
276
|
+
allCheckedState: W,
|
|
277
|
+
invertSelection: X,
|
|
278
|
+
clearSelection: Z,
|
|
279
|
+
getChangeableRowKeys: $
|
|
241
280
|
};
|
|
242
281
|
}
|
|
243
282
|
export {
|
|
244
|
-
|
|
283
|
+
oe as useSelection
|
|
245
284
|
};
|
|
@@ -15,6 +15,10 @@ export interface FlattenRow<TRecord = Record<string, unknown>> {
|
|
|
15
15
|
export interface UseTreeDataOptions<TRecord = Record<string, unknown>> {
|
|
16
16
|
/** Data source accessor */
|
|
17
17
|
data: () => TRecord[];
|
|
18
|
+
/** Optional page roots; state initialization still uses the complete data. */
|
|
19
|
+
pageData?: () => TRecord[];
|
|
20
|
+
/** Keep user choices when a remote page replaces the loaded roots. */
|
|
21
|
+
preserveStateOnDataChange?: () => boolean;
|
|
18
22
|
/** Field name for children, defaults to 'children' */
|
|
19
23
|
childrenColumnName?: () => string | undefined;
|
|
20
24
|
/** Indent size in pixels, defaults to 15 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTreeData.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useTreeData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnC,MAAM,WAAW,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,2BAA2B;IAC3B,MAAM,EAAE,OAAO,CAAA;IACf,+BAA+B;IAC/B,KAAK,EAAE,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OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1D,iCAAiC;IACjC,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAA;IACrC,4BAA4B;IAC5B,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IAC3B,wBAAwB;IACxB,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAChC;AAED,wBAAgB,WAAW,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3F,OAAO,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACnC,iBAAiB,CAAC,OAAO,CAAC,CAmK5B"}
|
|
@@ -1,92 +1,97 @@
|
|
|
1
|
-
import { computed as s, ref as
|
|
2
|
-
function
|
|
3
|
-
const o = s(() => e.childrenColumnName?.() ?? "children"),
|
|
1
|
+
import { computed as s, ref as k, watch as z } from "vue";
|
|
2
|
+
function M(e) {
|
|
3
|
+
const o = s(() => e.childrenColumnName?.() ?? "children"), R = s(() => e.indentSize?.() ?? 15), v = s(() => {
|
|
4
4
|
const a = o.value;
|
|
5
5
|
return e.data().some(
|
|
6
6
|
(t) => Array.isArray(t[a]) && t[a].length > 0
|
|
7
7
|
);
|
|
8
|
-
}), r =
|
|
9
|
-
|
|
8
|
+
}), r = k(/* @__PURE__ */ new Set()), E = /* @__PURE__ */ new Set();
|
|
9
|
+
let g = !1;
|
|
10
|
+
const x = s(() => e.expandedRowKeys?.() !== void 0);
|
|
11
|
+
z(
|
|
10
12
|
[
|
|
11
13
|
() => e.data(),
|
|
12
14
|
() => e.defaultExpandAllRows?.(),
|
|
13
15
|
() => e.defaultExpandedRowKeys?.()
|
|
14
16
|
],
|
|
15
17
|
() => {
|
|
16
|
-
if (!
|
|
18
|
+
if (!x.value)
|
|
17
19
|
if (e.defaultExpandAllRows?.()) {
|
|
18
|
-
let a = function(
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
Array.isArray(
|
|
20
|
+
let a = function(n) {
|
|
21
|
+
n.forEach((u) => {
|
|
22
|
+
const c = u[w], f = l++;
|
|
23
|
+
if (Array.isArray(c) && c.length > 0) {
|
|
24
|
+
const y = e.getRowKey(u, f);
|
|
25
|
+
(!t || !E.has(y)) && d.add(y), E.add(y), a(c);
|
|
26
|
+
}
|
|
22
27
|
});
|
|
23
28
|
};
|
|
24
|
-
const t = /* @__PURE__ */ new Set(),
|
|
25
|
-
let
|
|
26
|
-
a(e.data()), r.value =
|
|
27
|
-
} else e.defaultExpandedRowKeys?.() && (r.value = new Set(e.defaultExpandedRowKeys()));
|
|
29
|
+
const t = e.preserveStateOnDataChange?.() === !0, d = t ? new Set(r.value) : /* @__PURE__ */ new Set(), w = o.value;
|
|
30
|
+
let l = 0;
|
|
31
|
+
a(e.data()), r.value = d;
|
|
32
|
+
} else e.defaultExpandedRowKeys?.() && (!e.preserveStateOnDataChange?.() || !g) && (r.value = new Set(e.defaultExpandedRowKeys()), g = !0);
|
|
28
33
|
},
|
|
29
34
|
{ immediate: !0 }
|
|
30
35
|
);
|
|
31
|
-
const
|
|
32
|
-
get: () =>
|
|
36
|
+
const i = s({
|
|
37
|
+
get: () => x.value ? new Set(e.expandedRowKeys()) : r.value,
|
|
33
38
|
set: (a) => {
|
|
34
39
|
r.value = a;
|
|
35
40
|
}
|
|
36
41
|
});
|
|
37
|
-
function
|
|
38
|
-
return
|
|
42
|
+
function A(a) {
|
|
43
|
+
return i.value.has(a);
|
|
39
44
|
}
|
|
40
|
-
function
|
|
41
|
-
const d = e.getRowKey(a, t), l = !
|
|
42
|
-
if (
|
|
45
|
+
function C(a, t) {
|
|
46
|
+
const d = e.getRowKey(a, t), l = !i.value.has(d);
|
|
47
|
+
if (x.value) {
|
|
43
48
|
e.onExpand?.(l, a);
|
|
44
|
-
const n = new Set(
|
|
49
|
+
const n = new Set(i.value);
|
|
45
50
|
l ? n.add(d) : n.delete(d), e.onExpandedRowsChange?.(Array.from(n));
|
|
46
51
|
} else {
|
|
47
52
|
const n = new Set(r.value);
|
|
48
53
|
l ? n.add(d) : n.delete(d), r.value = n, e.onExpand?.(l, a), e.onExpandedRowsChange?.(Array.from(n));
|
|
49
54
|
}
|
|
50
55
|
}
|
|
51
|
-
const
|
|
52
|
-
const a = e.data();
|
|
53
|
-
if (!
|
|
56
|
+
const K = s(() => {
|
|
57
|
+
const a = e.pageData?.() ?? e.data();
|
|
58
|
+
if (!v.value)
|
|
54
59
|
return a.map((n) => ({
|
|
55
60
|
record: n,
|
|
56
61
|
level: 0,
|
|
57
62
|
expanded: !1,
|
|
58
63
|
hasChildren: !1
|
|
59
64
|
}));
|
|
60
|
-
const t = o.value, d = [],
|
|
61
|
-
function l(n, u,
|
|
62
|
-
n.forEach((
|
|
63
|
-
const
|
|
65
|
+
const t = o.value, d = [], w = i.value;
|
|
66
|
+
function l(n, u, c) {
|
|
67
|
+
n.forEach((f, y) => {
|
|
68
|
+
const h = f[t], S = Array.isArray(h) && h.length > 0, m = e.getRowKey(f, d.length), p = S && w.has(m);
|
|
64
69
|
d.push({
|
|
65
|
-
record:
|
|
70
|
+
record: f,
|
|
66
71
|
level: u,
|
|
67
|
-
expanded:
|
|
68
|
-
hasChildren:
|
|
69
|
-
parentKey:
|
|
70
|
-
}),
|
|
72
|
+
expanded: p,
|
|
73
|
+
hasChildren: S,
|
|
74
|
+
parentKey: c
|
|
75
|
+
}), p && h && l(h, u + 1, m);
|
|
71
76
|
});
|
|
72
77
|
}
|
|
73
78
|
return l(a, 0), d;
|
|
74
|
-
}),
|
|
79
|
+
}), D = s(() => {
|
|
75
80
|
const a = /* @__PURE__ */ new Map();
|
|
76
|
-
for (const t of
|
|
81
|
+
for (const t of K.value)
|
|
77
82
|
a.set(t.record, t);
|
|
78
83
|
return a;
|
|
79
84
|
});
|
|
80
85
|
return {
|
|
81
|
-
flattenData:
|
|
82
|
-
rowMetaMap:
|
|
83
|
-
isTreeData:
|
|
84
|
-
toggleTreeExpand:
|
|
85
|
-
isTreeExpanded:
|
|
86
|
+
flattenData: K,
|
|
87
|
+
rowMetaMap: D,
|
|
88
|
+
isTreeData: v,
|
|
89
|
+
toggleTreeExpand: C,
|
|
90
|
+
isTreeExpanded: A,
|
|
86
91
|
expandedKeys: r,
|
|
87
|
-
indentSize:
|
|
92
|
+
indentSize: R
|
|
88
93
|
};
|
|
89
94
|
}
|
|
90
95
|
export {
|
|
91
|
-
|
|
96
|
+
M as useTreeData
|
|
92
97
|
};
|
|
@@ -8,6 +8,7 @@ import { FlattenRow } from './composables/useTreeData';
|
|
|
8
8
|
import { SelectionState } from './composables/useSelection';
|
|
9
9
|
import { RowDragBindings, RowDragDropTarget } from './composables/useRowDragSort';
|
|
10
10
|
import { SummaryFixed } from './components/VTableSummary';
|
|
11
|
+
import { ColumnLayout } from './composables/useColumnLayout';
|
|
11
12
|
/**
|
|
12
13
|
* 子组件主题 slot class 映射。
|
|
13
14
|
*
|
|
@@ -16,6 +17,9 @@ import { SummaryFixed } from './components/VTableSummary';
|
|
|
16
17
|
* 中调用具体字段才建立细粒度依赖,避免任一 variant 变化让全表失效。
|
|
17
18
|
*/
|
|
18
19
|
export interface SubThemeSlots {
|
|
20
|
+
widthConstraintCell: () => string;
|
|
21
|
+
widthConstraintInner: () => string;
|
|
22
|
+
widthLayoutCell: () => string;
|
|
19
23
|
thSortable: () => string;
|
|
20
24
|
thSorted: () => string;
|
|
21
25
|
tdSorted: () => string;
|
|
@@ -106,6 +110,7 @@ export interface SubThemeSlots {
|
|
|
106
110
|
* 所有后代组件(TableCell、TableHeaderCell 等)通过 inject 获取。
|
|
107
111
|
*/
|
|
108
112
|
export interface TableContext {
|
|
113
|
+
columnLayout?: ColumnLayout;
|
|
109
114
|
/**
|
|
110
115
|
* 用户定义的 bodyCell slot 函数。
|
|
111
116
|
* 来自 Table.vue 的 useSlots().bodyCell。
|
|
@@ -174,7 +179,7 @@ export interface TableContext {
|
|
|
174
179
|
/** 切换某行选中状态 */
|
|
175
180
|
toggleRow?: (record: Record<string, unknown>, index: number, nativeEvent?: MouseEvent) => void;
|
|
176
181
|
/** 全选/取消全选 */
|
|
177
|
-
toggleAll?: (selected: boolean) => void;
|
|
182
|
+
toggleAll?: (selected: boolean, allData?: boolean) => void;
|
|
178
183
|
/** 全选状态 */
|
|
179
184
|
allCheckedState?: () => 'all' | 'partial' | 'none';
|
|
180
185
|
/** 获取行 key */
|