@vtable-guild/vtable-guild 2.4.1 → 2.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/css/style.css +9 -0
- package/css/tailwind3-utilities.css +9 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts +21 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/VirtualList.mjs +201 -216
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts +7 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +29 -27
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts +3 -1
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.mjs +57 -50
- package/dist/core/src/components/VirtualList/index.d.ts +1 -0
- package/dist/core/src/components/VirtualList/index.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/utils/PrefixSums.d.ts +50 -0
- package/dist/core/src/components/VirtualList/utils/PrefixSums.d.ts.map +1 -0
- package/dist/core/src/components/VirtualList/utils/PrefixSums.mjs +54 -0
- package/dist/core/src/components/VirtualList/utils/PrefixSums.test.d.ts +2 -0
- package/dist/core/src/components/VirtualList/utils/PrefixSums.test.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +5 -0
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/css/style.css +9 -0
- package/dist/css/tailwind3-utilities.css +9 -0
- package/dist/index.full.mjs +3609 -3287
- package/dist/index.mjs +32 -30
- package/dist/table/src/components/ColGroup.d.ts.map +1 -1
- package/dist/table/src/components/ColGroup.mjs +11 -8
- package/dist/table/src/components/Table.d.ts +62 -0
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +353 -298
- package/dist/table/src/components/TableBody.d.ts.map +1 -1
- package/dist/table/src/components/TableBody.mjs +22 -22
- package/dist/table/src/components/TableCell.d.ts +23 -0
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +50 -39
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +172 -169
- package/dist/table/src/components/VTable.vue.mjs +10 -8
- package/dist/table/src/components/VirtualTableBody.d.ts +40 -0
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +157 -67
- package/dist/table/src/composables/index.d.ts +4 -0
- package/dist/table/src/composables/index.d.ts.map +1 -1
- package/dist/table/src/composables/useColumnMetrics.d.ts +39 -0
- package/dist/table/src/composables/useColumnMetrics.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnMetrics.mjs +88 -0
- package/dist/table/src/composables/useColumnWindow.d.ts +90 -0
- package/dist/table/src/composables/useColumnWindow.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnWindow.mjs +62 -0
- package/dist/table/src/composables/useColumnWindow.test.d.ts +2 -0
- package/dist/table/src/composables/useColumnWindow.test.d.ts.map +1 -0
- package/dist/table/src/composables/useColumns.d.ts +8 -0
- package/dist/table/src/composables/useColumns.d.ts.map +1 -1
- package/dist/table/src/composables/useColumns.mjs +46 -43
- package/dist/table/src/composables/useSelection.d.ts.map +1 -1
- package/dist/table/src/composables/useSelection.mjs +93 -94
- package/dist/table/src/composables/useVirtual.d.ts +10 -0
- package/dist/table/src/composables/useVirtual.d.ts.map +1 -1
- package/dist/table/src/composables/useVirtual.mjs +15 -11
- package/dist/table/src/index.d.ts +2 -0
- package/dist/table/src/index.d.ts.map +1 -1
- package/dist/table/src/types/table.d.ts +25 -0
- package/dist/table/src/types/table.d.ts.map +1 -1
- 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 +4 -1
- package/package.json +1 -1
- package/dist/core/src/components/VirtualList/hooks/useDiffItem.d.ts +0 -4
- package/dist/core/src/components/VirtualList/hooks/useDiffItem.d.ts.map +0 -1
- package/dist/core/src/components/VirtualList/hooks/useDiffItem.mjs +0 -16
- package/dist/core/src/components/VirtualList/utils/algorithmUtil.d.ts +0 -7
- package/dist/core/src/components/VirtualList/utils/algorithmUtil.d.ts.map +0 -1
- package/dist/core/src/components/VirtualList/utils/algorithmUtil.mjs +0 -22
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Re, inject as Pe, computed as a, ref as f, watch as ve, nextTick as He, onBeforeUnmount as Ve, createVNode as i, mergeProps as $, Teleport as Ke, isVNode as Be } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { SELECTION_ALL as
|
|
6
|
-
import { TABLE_CONTEXT_KEY as
|
|
7
|
-
import { getColumnKey as
|
|
8
|
-
import { useFixedColumnStyle as
|
|
9
|
-
import { getCellSpan as
|
|
10
|
-
import { resolvePopupContainer as
|
|
11
|
-
import { ensureValidVNode as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { TABLE_ALIGN_CLASSES as
|
|
3
|
+
import We from "../../../core/src/components/Tooltip.mjs";
|
|
4
|
+
import je from "../../../icons/src/DownOutlinedIcon.mjs";
|
|
5
|
+
import { SELECTION_ALL as qe, SELECTION_INVERT as ze, SELECTION_NONE as Ue } from "../constants.mjs";
|
|
6
|
+
import { TABLE_CONTEXT_KEY as Ge } from "../context.mjs";
|
|
7
|
+
import { getColumnKey as J } from "../composables/useColumns.mjs";
|
|
8
|
+
import { useFixedColumnStyle as Xe } from "../composables/useFixedColumnStyle.mjs";
|
|
9
|
+
import { getCellSpan as Ye, omitCellProps as $e, getEllipsisConfig as Je } from "../utils/cell.mjs";
|
|
10
|
+
import { resolvePopupContainer as Q, getPopupPositionStyle as Qe } from "../utils/popupPosition.mjs";
|
|
11
|
+
import { ensureValidVNode as Ze } from "../utils/vnode.mjs";
|
|
12
|
+
import el from "./SortButton.mjs";
|
|
13
|
+
import ll from "./FilterIcon.mjs";
|
|
14
|
+
import tl from "./FilterDropdown.mjs";
|
|
15
|
+
import ol from "./SelectionCheckbox.mjs";
|
|
16
|
+
import nl from "./SelectionDropdown.mjs";
|
|
17
|
+
import rl from "./ResizeHandle.mjs";
|
|
18
|
+
import { TABLE_ALIGN_CLASSES as sl } from "../../../theme/src/presets/antdv/table.mjs";
|
|
19
19
|
import { cn as g } from "tailwind-variants";
|
|
20
|
-
function sl(t) {
|
|
21
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Ke(t);
|
|
22
|
-
}
|
|
23
20
|
function al(t) {
|
|
21
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Be(t);
|
|
22
|
+
}
|
|
23
|
+
function il(t) {
|
|
24
24
|
if (t === "ascend") return "ascending";
|
|
25
25
|
if (t === "descend") return "descending";
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const Il = /* @__PURE__ */ Re({
|
|
28
28
|
name: "TableHeaderCell",
|
|
29
29
|
props: {
|
|
30
30
|
cell: {
|
|
@@ -45,41 +45,41 @@ const Al = /* @__PURE__ */ Ne({
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
setup(t) {
|
|
48
|
-
const e =
|
|
48
|
+
const e = Pe(Ge, {}), o = a(() => t.cell.isLeaf ? t.cell.column : null), E = a(() => t.cell.leafIndex >= 0 ? String(t.cell.leafIndex) : void 0), d = a(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), k = a(() => Ye(d.value, "colSpan") ?? t.cell.colSpan), O = a(() => t.cell.rowSpan), w = a(() => {
|
|
49
49
|
const {
|
|
50
50
|
onClick: l,
|
|
51
51
|
...r
|
|
52
|
-
} =
|
|
52
|
+
} = $e(d.value);
|
|
53
53
|
return r;
|
|
54
|
-
}), _ =
|
|
54
|
+
}), _ = a(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null), I = a(() => !!o.value?.sorter), F = a(() => !o.value || !I.value ? !1 : o.value.showSorterTooltip ?? e.showSorterTooltip?.value ?? !0), N = a(() => {
|
|
55
55
|
const l = o.value;
|
|
56
56
|
return l ? (l.filters?.length ?? 0) > 0 || !!l.customFilterDropdown || !!l.filterDropdown : !1;
|
|
57
|
-
}),
|
|
57
|
+
}), R = a(() => !o.value || !N.value ? [] : e.getFilteredValue?.(o.value) ?? []), P = a(() => {
|
|
58
58
|
const l = o.value;
|
|
59
|
-
return l ? l.filtered !== void 0 ? l.filtered :
|
|
60
|
-
}),
|
|
59
|
+
return l ? l.filtered !== void 0 ? l.filtered : R.value.length > 0 : !1;
|
|
60
|
+
}), Z = a(() => o.value?.filterDropdownOpen !== void 0), ee = f(!1), y = a(() => Z.value ? o.value?.filterDropdownOpen ?? !1 : ee.value);
|
|
61
61
|
function v(l) {
|
|
62
|
-
|
|
62
|
+
Z.value || (ee.value = l), o.value?.onFilterDropdownOpenChange?.(l);
|
|
63
63
|
}
|
|
64
|
-
const m = f(null),
|
|
65
|
-
function
|
|
64
|
+
const m = f(null), H = f(null);
|
|
65
|
+
function V() {
|
|
66
66
|
v(!y.value);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
|
|
68
|
+
function K(l) {
|
|
69
|
+
H.value && !H.value.contains(l.target) && !m.value?.contains(l.target) && v(!1);
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const me = a(() => {
|
|
72
72
|
const l = o.value;
|
|
73
73
|
return l ? !!l.filterDropdown || !!l.customFilterDropdown && !!e.customFilterDropdown : !1;
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
l &&
|
|
77
|
-
document.addEventListener("mousedown",
|
|
78
|
-
}) : document.removeEventListener("mousedown",
|
|
79
|
-
}),
|
|
80
|
-
document.removeEventListener("mousedown",
|
|
75
|
+
ve(y, (l) => {
|
|
76
|
+
l && me.value ? He(() => {
|
|
77
|
+
document.addEventListener("mousedown", K);
|
|
78
|
+
}) : document.removeEventListener("mousedown", K);
|
|
79
|
+
}), Ve(() => {
|
|
80
|
+
document.removeEventListener("mousedown", K);
|
|
81
81
|
});
|
|
82
|
-
function
|
|
82
|
+
function le() {
|
|
83
83
|
return m.value ? m.value.getBoundingClientRect() : {
|
|
84
84
|
top: 0,
|
|
85
85
|
left: 0,
|
|
@@ -87,25 +87,25 @@ const Al = /* @__PURE__ */ Ne({
|
|
|
87
87
|
bottom: 0
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
const T = f([]),
|
|
91
|
-
|
|
90
|
+
const T = f([]), te = f(null);
|
|
91
|
+
ve(() => R.value, (l) => {
|
|
92
92
|
T.value = [...l];
|
|
93
93
|
}, {
|
|
94
94
|
immediate: !0
|
|
95
95
|
});
|
|
96
|
-
function
|
|
96
|
+
function B(l) {
|
|
97
97
|
o.value && (e.confirmFilter?.(o.value, l), v(!1));
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function pe() {
|
|
100
100
|
o.value && (e.resetFilter?.(o.value), v(!1));
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function ge() {
|
|
103
103
|
v(!1);
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const Ce = a(() => {
|
|
106
106
|
const l = t.cell.leafColumns;
|
|
107
107
|
if (!l.length) return null;
|
|
108
|
-
const r = l[0], u = l[l.length - 1],
|
|
108
|
+
const r = l[0], u = l[l.length - 1], C = J(r) ?? t.cell.colStart, s = J(u) ?? t.cell.colEnd, x = e.fixedOffsets?.value?.get(C), D = e.fixedOffsets?.value?.get(s);
|
|
109
109
|
return l.every((p) => p.fixed === "left") && x?.left !== void 0 ? {
|
|
110
110
|
left: x.left,
|
|
111
111
|
isLastLeft: D?.isLastLeft
|
|
@@ -115,37 +115,37 @@ const Al = /* @__PURE__ */ Ne({
|
|
|
115
115
|
} : null;
|
|
116
116
|
}), {
|
|
117
117
|
fixedStyle: he,
|
|
118
|
-
fixedClass:
|
|
119
|
-
} =
|
|
120
|
-
fixedInfo: () =>
|
|
121
|
-
}),
|
|
118
|
+
fixedClass: oe
|
|
119
|
+
} = Xe({
|
|
120
|
+
fixedInfo: () => Ce.value
|
|
121
|
+
}), Se = a(() => {
|
|
122
122
|
const l = e.themePreset?.value === "antdv", r = e.bordered?.value ?? !1;
|
|
123
123
|
return !l || r || t.cell.isLeaf ? "" : e.vtgClass?.("before:hidden border-b-0") ?? "";
|
|
124
|
-
}),
|
|
124
|
+
}), be = a(() => {
|
|
125
125
|
const l = e.leafColumnCount?.value ?? 0;
|
|
126
126
|
return l > 0 && t.cell.colEnd < l - 1 ? e.bordered?.value ?? !1 ? e.vtgClass?.("last:border-r last:border-[color:var(--vtg-table-border-color)]") ?? "" : e.vtgClass?.("last:before:bg-[color:var(--vtg-table-header-split-color)]") ?? "" : "";
|
|
127
|
-
}),
|
|
127
|
+
}), ne = a(() => e.getColumnTitle?.(t.cell.column) ?? t.cell.column.title ?? ""), we = a(() => {
|
|
128
128
|
if (!t.cell.isLeaf) return !1;
|
|
129
129
|
const l = o.value;
|
|
130
|
-
return !l ||
|
|
131
|
-
}),
|
|
130
|
+
return !l || !Je(l).enabled ? !1 : e.headerEllipsis?.value === !0;
|
|
131
|
+
}), _e = a(() => {
|
|
132
132
|
if (e.headerCell) {
|
|
133
133
|
const l = e.headerCell({
|
|
134
|
-
title:
|
|
134
|
+
title: ne.value,
|
|
135
135
|
column: t.cell.column,
|
|
136
136
|
index: t.index
|
|
137
137
|
});
|
|
138
|
-
if (
|
|
138
|
+
if (Ze(l) !== null)
|
|
139
139
|
return l;
|
|
140
140
|
}
|
|
141
|
-
return
|
|
142
|
-
}),
|
|
143
|
-
const l = t.cell.column.align ?
|
|
144
|
-
return g(t.thClass, l, r, u,
|
|
145
|
-
}),
|
|
141
|
+
return ne.value;
|
|
142
|
+
}), ye = a(() => {
|
|
143
|
+
const l = t.cell.column.align ? sl[t.cell.column.align] : "", r = I.value ? e.subThemeSlots?.thSortable() : "", u = _.value ? e.subThemeSlots?.thSorted() : "", C = o.value?.key === "__vtg_expand__";
|
|
144
|
+
return g(t.thClass, l, r, u, Se.value, t.cell.column.className, C ? e.vtgClass?.("before:hidden") : "", d.value?.class, d.value?.className, oe.value, be.value);
|
|
145
|
+
}), re = a(() => {
|
|
146
146
|
const l = {};
|
|
147
147
|
if (o.value) {
|
|
148
|
-
const s = e.columnWidths?.[String(
|
|
148
|
+
const s = e.columnWidths?.[String(J(o.value) ?? t.cell.colStart)] ?? o.value.width;
|
|
149
149
|
s && (l.width = typeof s == "number" ? `${s}px` : s);
|
|
150
150
|
}
|
|
151
151
|
const r = d.value?.style, u = he.value;
|
|
@@ -155,7 +155,7 @@ const Al = /* @__PURE__ */ Ne({
|
|
|
155
155
|
...r ?? {}
|
|
156
156
|
};
|
|
157
157
|
}), L = f(!1), M = f(null);
|
|
158
|
-
function
|
|
158
|
+
function Te() {
|
|
159
159
|
return M.value ? M.value.getBoundingClientRect() : {
|
|
160
160
|
top: 0,
|
|
161
161
|
left: 0,
|
|
@@ -164,47 +164,47 @@ const Al = /* @__PURE__ */ Ne({
|
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
166
|
let c = null;
|
|
167
|
-
function
|
|
167
|
+
function xe() {
|
|
168
168
|
c && clearTimeout(c), L.value = !0;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function se() {
|
|
171
171
|
c && clearTimeout(c), c = setTimeout(() => {
|
|
172
172
|
L.value = !1;
|
|
173
173
|
}, 100);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function De() {
|
|
176
176
|
c && clearTimeout(c);
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Ae() {
|
|
179
179
|
c && clearTimeout(c), L.value = !1;
|
|
180
180
|
}
|
|
181
|
-
const
|
|
182
|
-
function
|
|
181
|
+
const W = f(!1), j = f(!1), Ie = a(() => F.value && W.value && !j.value);
|
|
182
|
+
function Fe(l) {
|
|
183
183
|
const r = w.value.onMouseenter;
|
|
184
|
-
typeof r == "function" && r(l), F.value && (
|
|
184
|
+
typeof r == "function" && r(l), F.value && (W.value = !0);
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Le(l) {
|
|
187
187
|
const r = w.value.onMouseleave;
|
|
188
|
-
typeof r == "function" && r(l), F.value && (
|
|
189
|
-
}
|
|
190
|
-
function j() {
|
|
191
|
-
W.value = !0;
|
|
188
|
+
typeof r == "function" && r(l), F.value && (W.value = !1);
|
|
192
189
|
}
|
|
193
190
|
function q() {
|
|
194
|
-
|
|
191
|
+
j.value = !0;
|
|
195
192
|
}
|
|
196
|
-
function z(
|
|
193
|
+
function z() {
|
|
194
|
+
j.value = !1;
|
|
195
|
+
}
|
|
196
|
+
function U(l) {
|
|
197
197
|
const r = d.value?.onClick;
|
|
198
198
|
typeof r == "function" && r(l), o.value && I.value && e.toggleSortOrder?.(o.value);
|
|
199
199
|
}
|
|
200
200
|
return () => {
|
|
201
|
-
if (
|
|
201
|
+
if (k.value === 0 || O.value === 0)
|
|
202
202
|
return null;
|
|
203
|
-
const l =
|
|
203
|
+
const l = k.value !== 1 ? k.value : void 0, r = O.value !== 1 ? O.value : void 0;
|
|
204
204
|
if (o.value?.key === "__vtg_selection__") {
|
|
205
|
-
const n = e.rowSelection?.(),
|
|
206
|
-
let
|
|
207
|
-
if (
|
|
205
|
+
const n = e.rowSelection?.(), h = n?.type === "radio", ue = n?.hideSelectAll === !0, X = n?.selections !== void 0 && n.selections !== !1, S = e.locale?.value, A = n?.columnTitle, Oe = A !== void 0, ce = g(t.thClass, e.vtgClass?.(Oe ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, d.value?.class, d.value?.className, oe.value), fe = re.value;
|
|
206
|
+
let Y = [];
|
|
207
|
+
if (X && (n?.selections === !0 ? Y = [{
|
|
208
208
|
key: "__vtg_select_all__",
|
|
209
209
|
text: S?.selection?.selectAll ?? "全选当页",
|
|
210
210
|
onSelect: () => e.toggleAll?.(!0)
|
|
@@ -216,170 +216,173 @@ const Al = /* @__PURE__ */ Ne({
|
|
|
216
216
|
key: "__vtg_select_none__",
|
|
217
217
|
text: S?.selection?.selectNone ?? "清空所有",
|
|
218
218
|
onSelect: () => e.clearSelection?.()
|
|
219
|
-
}] : Array.isArray(n?.selections) && (
|
|
219
|
+
}] : Array.isArray(n?.selections) && (Y = n.selections.map((b) => b === qe ? {
|
|
220
220
|
key: "__vtg_select_all__",
|
|
221
221
|
text: S?.selection?.selectAll ?? "全选当页",
|
|
222
222
|
onSelect: () => e.toggleAll?.(!0)
|
|
223
|
-
} : b ===
|
|
223
|
+
} : b === ze ? {
|
|
224
224
|
key: "__vtg_select_invert__",
|
|
225
225
|
text: S?.selection?.selectInvert ?? "反选当页",
|
|
226
226
|
onSelect: () => e.invertSelection?.()
|
|
227
|
-
} : b ===
|
|
227
|
+
} : b === Ue ? {
|
|
228
228
|
key: "__vtg_select_none__",
|
|
229
229
|
text: S?.selection?.selectNone ?? "清空所有",
|
|
230
230
|
onSelect: () => e.clearSelection?.()
|
|
231
|
-
} : b))),
|
|
232
|
-
return
|
|
233
|
-
class:
|
|
234
|
-
style:
|
|
231
|
+
} : b))), h)
|
|
232
|
+
return i("th", $(w.value, {
|
|
233
|
+
class: ce,
|
|
234
|
+
style: fe,
|
|
235
235
|
colspan: l,
|
|
236
236
|
rowspan: r,
|
|
237
|
-
|
|
237
|
+
"data-vtg-leaf-col": E.value,
|
|
238
|
+
onClick: U
|
|
238
239
|
}), [A]);
|
|
239
|
-
const
|
|
240
|
+
const de = e.allCheckedState?.() ?? "none", Ne = A ? i("span", {
|
|
240
241
|
class: e.vtgClass?.("ml-2")
|
|
241
242
|
}, [A]) : null;
|
|
242
|
-
return
|
|
243
|
-
class:
|
|
244
|
-
style:
|
|
243
|
+
return i("th", $(w.value, {
|
|
244
|
+
class: ce,
|
|
245
|
+
style: fe,
|
|
245
246
|
colspan: l,
|
|
246
247
|
rowspan: r,
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
"data-vtg-leaf-col": E.value,
|
|
249
|
+
onClick: U
|
|
250
|
+
}), [ue ? A : i("span", {
|
|
249
251
|
class: e.vtgClass?.("inline-flex items-center justify-center relative")
|
|
250
|
-
}, [
|
|
251
|
-
checked:
|
|
252
|
-
indeterminate:
|
|
252
|
+
}, [i(ol, {
|
|
253
|
+
checked: de === "all",
|
|
254
|
+
indeterminate: de === "partial",
|
|
253
255
|
onChange: (b) => e.toggleAll?.(b)
|
|
254
|
-
}, null),
|
|
256
|
+
}, null), Ne, X && i("span", {
|
|
255
257
|
ref: M,
|
|
256
258
|
class: g(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
|
|
257
|
-
onMouseenter:
|
|
258
|
-
onMouseleave:
|
|
259
|
+
onMouseenter: xe,
|
|
260
|
+
onMouseleave: se,
|
|
259
261
|
role: "button",
|
|
260
262
|
"aria-label": "Selection options"
|
|
261
|
-
}, [
|
|
262
|
-
items:
|
|
263
|
-
anchorRect:
|
|
264
|
-
popupContainer:
|
|
263
|
+
}, [i(je, null, null)])]), !ue && X && i(nl, {
|
|
264
|
+
items: Y,
|
|
265
|
+
anchorRect: Te(),
|
|
266
|
+
popupContainer: Q(e, M.value),
|
|
265
267
|
visible: L.value,
|
|
266
|
-
onClose:
|
|
267
|
-
onMouseenter:
|
|
268
|
-
onMouseleave:
|
|
268
|
+
onClose: Ae,
|
|
269
|
+
onMouseenter: De,
|
|
270
|
+
onMouseleave: se
|
|
269
271
|
}, null)]);
|
|
270
272
|
}
|
|
271
|
-
const u = e.locale?.value,
|
|
273
|
+
const u = e.locale?.value, C = _.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : _.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", s = o.value, x = e.subThemeSlots?.sortAreaWrapper(), D = e.subThemeSlots?.sortAreaTitle(), p = i("span", {
|
|
272
274
|
class: x
|
|
273
|
-
}, [
|
|
274
|
-
class: g(D,
|
|
275
|
-
}, [
|
|
275
|
+
}, [i("span", {
|
|
276
|
+
class: g(D, we.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
|
|
277
|
+
}, [_e.value]), I.value && i(el, {
|
|
276
278
|
sortOrder: _.value
|
|
277
|
-
}, null)]),
|
|
278
|
-
class:
|
|
279
|
-
}, [
|
|
279
|
+
}, null)]), ae = e.subThemeSlots?.sortAreaOuter(), Me = F.value ? i("span", {
|
|
280
|
+
class: ae
|
|
281
|
+
}, [i(We, {
|
|
280
282
|
block: !0,
|
|
281
|
-
title:
|
|
283
|
+
title: C,
|
|
282
284
|
placement: "top",
|
|
283
|
-
open:
|
|
284
|
-
},
|
|
285
|
+
open: Ie.value
|
|
286
|
+
}, al(p) ? p : {
|
|
285
287
|
default: () => [p]
|
|
286
|
-
})]) :
|
|
287
|
-
class:
|
|
288
|
-
}, [p]),
|
|
288
|
+
})]) : i("span", {
|
|
289
|
+
class: ae
|
|
290
|
+
}, [p]), Ee = s && (s.filterIcon ? i("span", {
|
|
289
291
|
class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
|
|
290
292
|
ref: m,
|
|
291
|
-
onMouseenter:
|
|
292
|
-
onMouseleave:
|
|
293
|
+
onMouseenter: q,
|
|
294
|
+
onMouseleave: z,
|
|
293
295
|
onMousedown: (n) => n.stopPropagation(),
|
|
294
296
|
onClick: (n) => {
|
|
295
|
-
n.stopPropagation(),
|
|
297
|
+
n.stopPropagation(), V();
|
|
296
298
|
},
|
|
297
299
|
role: "button",
|
|
298
300
|
"aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
|
|
299
301
|
}, [s.filterIcon({
|
|
300
|
-
filtered:
|
|
301
|
-
})]) : e.customFilterIcon ?
|
|
302
|
+
filtered: P.value
|
|
303
|
+
})]) : e.customFilterIcon ? i("span", {
|
|
302
304
|
class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
|
|
303
305
|
ref: m,
|
|
304
|
-
onMouseenter:
|
|
305
|
-
onMouseleave:
|
|
306
|
+
onMouseenter: q,
|
|
307
|
+
onMouseleave: z,
|
|
306
308
|
onMousedown: (n) => n.stopPropagation(),
|
|
307
309
|
onClick: (n) => {
|
|
308
|
-
n.stopPropagation(),
|
|
310
|
+
n.stopPropagation(), V();
|
|
309
311
|
},
|
|
310
312
|
role: "button",
|
|
311
313
|
"aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
|
|
312
314
|
}, [e.customFilterIcon({
|
|
313
315
|
column: s,
|
|
314
|
-
filtered:
|
|
315
|
-
})]) :
|
|
316
|
+
filtered: P.value
|
|
317
|
+
})]) : i("span", {
|
|
316
318
|
ref: m,
|
|
317
319
|
class: e.subThemeSlots?.filterIconWrapper(),
|
|
318
|
-
onMouseenter:
|
|
319
|
-
onMouseleave:
|
|
320
|
+
onMouseenter: q,
|
|
321
|
+
onMouseleave: z,
|
|
320
322
|
onMousedown: (n) => n.stopPropagation()
|
|
321
|
-
}, [
|
|
322
|
-
active:
|
|
323
|
-
onClick: () =>
|
|
324
|
-
}, null)])),
|
|
323
|
+
}, [i(ll, {
|
|
324
|
+
active: P.value,
|
|
325
|
+
onClick: () => V()
|
|
326
|
+
}, null)])), G = s && {
|
|
325
327
|
column: s,
|
|
326
328
|
selectedKeys: T.value,
|
|
327
329
|
setSelectedKeys: (n) => {
|
|
328
330
|
T.value = [...n];
|
|
329
331
|
},
|
|
330
332
|
confirm: (n) => {
|
|
331
|
-
|
|
333
|
+
B(T.value), n?.closeDropdown === !1 && v(!0);
|
|
332
334
|
},
|
|
333
335
|
clearFilters: (n) => {
|
|
334
|
-
e.resetFilter?.(s), T.value = [], n?.confirm &&
|
|
336
|
+
e.resetFilter?.(s), T.value = [], n?.confirm && B([]), n?.closeDropdown !== !1 && v(!1);
|
|
335
337
|
},
|
|
336
338
|
filters: s.filters ?? [],
|
|
337
339
|
visible: y.value,
|
|
338
340
|
close: () => v(!1)
|
|
339
|
-
},
|
|
340
|
-
const n = typeof s.filterDropdown == "function" ? s.filterDropdown(
|
|
341
|
+
}, ie = s?.customFilterDropdown ? e.customFilterDropdown : void 0, ke = s && G && (() => {
|
|
342
|
+
const n = typeof s.filterDropdown == "function" ? s.filterDropdown(G) : s.filterDropdown ?? (ie ? ie(G) : null);
|
|
341
343
|
if (n) {
|
|
342
|
-
const
|
|
343
|
-
return
|
|
344
|
-
to:
|
|
344
|
+
const h = Q(e, m.value);
|
|
345
|
+
return i(Ke, {
|
|
346
|
+
to: h
|
|
345
347
|
}, {
|
|
346
|
-
default: () => [y.value &&
|
|
347
|
-
ref:
|
|
348
|
+
default: () => [y.value && i("div", {
|
|
349
|
+
ref: H,
|
|
348
350
|
class: e.subThemeSlots?.filterDropdown(),
|
|
349
|
-
style:
|
|
351
|
+
style: Qe(le(), h, 150)
|
|
350
352
|
}, [n])]
|
|
351
353
|
});
|
|
352
354
|
}
|
|
353
|
-
return
|
|
355
|
+
return i(tl, {
|
|
354
356
|
filters: s.filters ?? [],
|
|
355
|
-
selectedKeys:
|
|
357
|
+
selectedKeys: R.value,
|
|
356
358
|
multiple: s.filterMultiple !== !1,
|
|
357
|
-
anchorRect:
|
|
358
|
-
popupContainer:
|
|
359
|
+
anchorRect: le(),
|
|
360
|
+
popupContainer: Q(e, m.value),
|
|
359
361
|
filterSearch: s.filterSearch ?? !1,
|
|
360
362
|
filterMode: s.filterMode ?? "menu",
|
|
361
|
-
expandedKeys:
|
|
363
|
+
expandedKeys: te.value,
|
|
362
364
|
visible: y.value,
|
|
363
|
-
onConfirm:
|
|
364
|
-
onReset:
|
|
365
|
-
onClose:
|
|
366
|
-
"onUpdate:expandedKeys": (
|
|
367
|
-
|
|
365
|
+
onConfirm: B,
|
|
366
|
+
onReset: pe,
|
|
367
|
+
onClose: ge,
|
|
368
|
+
"onUpdate:expandedKeys": (h) => {
|
|
369
|
+
te.value = h;
|
|
368
370
|
}
|
|
369
371
|
}, null);
|
|
370
372
|
})();
|
|
371
|
-
return
|
|
372
|
-
class:
|
|
373
|
-
style:
|
|
373
|
+
return i("th", $(w.value, {
|
|
374
|
+
class: ye.value,
|
|
375
|
+
style: re.value,
|
|
374
376
|
colspan: l,
|
|
375
377
|
rowspan: r,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
"data-vtg-leaf-col": E.value,
|
|
379
|
+
onClick: U,
|
|
380
|
+
onMouseenter: Fe,
|
|
381
|
+
onMouseleave: Le,
|
|
382
|
+
"aria-sort": o.value ? il(_.value) : void 0
|
|
383
|
+
}), [i("span", {
|
|
381
384
|
class: g(e.vtgClass?.("flex items-center"), t.headerCellInnerClass)
|
|
382
|
-
}, [
|
|
385
|
+
}, [Me, N.value && Ee]), N.value && ke, o.value?.resizable && i(rl, {
|
|
383
386
|
column: o.value,
|
|
384
387
|
colIndex: t.cell.colStart
|
|
385
388
|
}, null)]);
|
|
@@ -387,5 +390,5 @@ const Al = /* @__PURE__ */ Ne({
|
|
|
387
390
|
}
|
|
388
391
|
});
|
|
389
392
|
export {
|
|
390
|
-
|
|
393
|
+
Il as default
|
|
391
394
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as g, getCurrentInstance as w, createBlock as F, openBlock as $, unref as v, mergeProps as B, createSlots as b, withCtx as n, renderSlot as t, normalizeProps as s, guardReactiveProps as r } from "vue";
|
|
2
2
|
import k from "./Table.mjs";
|
|
3
|
-
const D = /* @__PURE__ */
|
|
3
|
+
const D = /* @__PURE__ */ g({
|
|
4
4
|
name: "VTable",
|
|
5
5
|
__name: "VTable",
|
|
6
6
|
props: {
|
|
@@ -34,6 +34,8 @@ const D = /* @__PURE__ */ F({
|
|
|
34
34
|
footer: { type: Function },
|
|
35
35
|
scroll: {},
|
|
36
36
|
virtual: { type: Boolean },
|
|
37
|
+
rowHeight: {},
|
|
38
|
+
virtualColumn: { type: Boolean },
|
|
37
39
|
childrenColumnName: {},
|
|
38
40
|
indentSize: {},
|
|
39
41
|
expandedRowKeys: {},
|
|
@@ -44,7 +46,7 @@ const D = /* @__PURE__ */ F({
|
|
|
44
46
|
},
|
|
45
47
|
emits: ["change", "resizeColumn"],
|
|
46
48
|
setup(S, { emit: u }) {
|
|
47
|
-
const a = u, p =
|
|
49
|
+
const a = u, p = w();
|
|
48
50
|
function d() {
|
|
49
51
|
const e = {};
|
|
50
52
|
for (const [l, o] of Object.entries(p?.vnode.props ?? {}))
|
|
@@ -62,10 +64,10 @@ const D = /* @__PURE__ */ F({
|
|
|
62
64
|
o
|
|
63
65
|
);
|
|
64
66
|
}
|
|
65
|
-
function
|
|
67
|
+
function y(e, l) {
|
|
66
68
|
a("resizeColumn", e, l);
|
|
67
69
|
}
|
|
68
|
-
function
|
|
70
|
+
function c(e) {
|
|
69
71
|
return e;
|
|
70
72
|
}
|
|
71
73
|
function f(e) {
|
|
@@ -80,14 +82,14 @@ const D = /* @__PURE__ */ F({
|
|
|
80
82
|
function i(e) {
|
|
81
83
|
return e;
|
|
82
84
|
}
|
|
83
|
-
return (e, l) => ($(),
|
|
85
|
+
return (e, l) => ($(), F(v(k), B(d(), {
|
|
84
86
|
onChange: m,
|
|
85
|
-
onResizeColumn:
|
|
87
|
+
onResizeColumn: y
|
|
86
88
|
}), b({ _: 2 }, [
|
|
87
89
|
e.$slots.bodyCell ? {
|
|
88
90
|
name: "bodyCell",
|
|
89
91
|
fn: n((o) => [
|
|
90
|
-
t(e.$slots, "bodyCell", s(r(
|
|
92
|
+
t(e.$slots, "bodyCell", s(r(c(o))))
|
|
91
93
|
]),
|
|
92
94
|
key: "0"
|
|
93
95
|
} : void 0,
|