@vtable-guild/vtable-guild 2.9.0-alpha.4 → 2.9.0-alpha.5
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/index.css +17 -0
- package/css/presets/antdv.css +10 -5
- package/css/presets/element-plus.css +9 -4
- package/css/style.css +69 -84
- package/css/tailwind3-utilities.css +21 -44
- package/css/tailwind3.css +48 -40
- package/css/tailwind4.css +48 -40
- package/css/transitions.css +12 -31
- package/dist/css/index.css +17 -0
- package/dist/css/presets/antdv.css +10 -5
- package/dist/css/presets/element-plus.css +9 -4
- package/dist/css/style.css +69 -84
- package/dist/css/tailwind3-utilities.css +21 -44
- package/dist/css/tailwind3.css +48 -40
- package/dist/css/tailwind4.css +48 -40
- package/dist/css/transitions.css +12 -31
- package/dist/index.full.mjs +5114 -5140
- package/dist/table/src/components/FilterDropdown.d.ts +23 -23
- package/dist/table/src/components/FilterDropdown.d.ts.map +1 -1
- package/dist/table/src/components/FilterDropdown.mjs +163 -175
- package/dist/table/src/components/PaginationSizeSelect.d.ts.map +1 -1
- package/dist/table/src/components/PaginationSizeSelect.mjs +85 -95
- package/dist/table/src/components/SelectionDropdown.d.ts +0 -27
- package/dist/table/src/components/SelectionDropdown.d.ts.map +1 -1
- package/dist/table/src/components/SelectionDropdown.mjs +31 -56
- package/dist/table/src/components/Table.d.ts +1 -1
- package/dist/table/src/components/TableColumnSettings.d.ts.map +1 -1
- package/dist/table/src/components/TableColumnSettings.mjs +212 -236
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +278 -299
- package/dist/table/src/components/TablePopup.d.ts +77 -0
- package/dist/table/src/components/TablePopup.d.ts.map +1 -0
- package/dist/table/src/components/TablePopup.mjs +104 -0
- package/dist/table/src/components/TablePopup.test.d.ts +2 -0
- package/dist/table/src/components/TablePopup.test.d.ts.map +1 -0
- package/dist/table/src/utils/popupPosition.d.ts +1 -6
- package/dist/table/src/utils/popupPosition.d.ts.map +1 -1
- package/dist/table/src/utils/popupPosition.mjs +22 -26
- package/dist/theme/src/column-settings.d.ts +8 -8
- package/dist/theme/src/column-settings.d.ts.map +1 -1
- package/dist/theme/src/column-settings.mjs +16 -18
- package/dist/theme/src/pagination.d.ts +2 -2
- package/dist/theme/src/pagination.d.ts.map +1 -1
- package/dist/theme/src/pagination.mjs +7 -8
- package/dist/theme/src/presets/antdv/table.d.ts +3 -3
- package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
- package/dist/theme/src/presets/antdv/table.mjs +3 -16
- package/dist/theme/src/presets/element-plus/table.d.ts +3 -3
- package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
- package/dist/theme/src/presets/element-plus/table.mjs +3 -17
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Ue, inject as Ge, computed as i, ref as c, watch as Xe, onBeforeUnmount as Ye, createVNode as r, mergeProps as m, isVNode as Je } 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
|
|
3
|
+
import _e from "../../../core/src/components/Tooltip.mjs";
|
|
4
|
+
import Qe from "../../../icons/src/DownOutlinedIcon.mjs";
|
|
5
|
+
import { SELECTION_ALL as Ze, SELECTION_INVERT as el, SELECTION_NONE as ll } from "../constants.mjs";
|
|
6
|
+
import { TABLE_CONTEXT_KEY as tl } from "../context.mjs";
|
|
7
7
|
import { getColumnKey as Q } from "../composables/useColumns.mjs";
|
|
8
|
-
import { useFixedColumnStyle as
|
|
9
|
-
import { useHeaderTitleBalance as
|
|
10
|
-
import { getCellSpan as
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { getColumnFilters as
|
|
19
|
-
import
|
|
20
|
-
import { TABLE_ALIGN_CLASSES as
|
|
8
|
+
import { useFixedColumnStyle as nl } from "../composables/useFixedColumnStyle.mjs";
|
|
9
|
+
import { useHeaderTitleBalance as ol } from "../composables/useHeaderTitleBalance.mjs";
|
|
10
|
+
import { getCellSpan as al, omitCellProps as rl, getEllipsisConfig as sl } from "../utils/cell.mjs";
|
|
11
|
+
import { ensureValidVNode as il } from "../utils/vnode.mjs";
|
|
12
|
+
import ul from "./SortButton.mjs";
|
|
13
|
+
import cl from "./FilterIcon.mjs";
|
|
14
|
+
import fl from "./FilterDropdown.mjs";
|
|
15
|
+
import dl from "./SelectionCheckbox.mjs";
|
|
16
|
+
import vl from "./SelectionDropdown.mjs";
|
|
17
|
+
import ml from "./TablePopup.mjs";
|
|
18
|
+
import { getColumnFilters as Z } from "../utils/valueEnum.mjs";
|
|
19
|
+
import gl from "./ResizeHandle.mjs";
|
|
20
|
+
import { TABLE_ALIGN_CLASSES as pl } from "../../../theme/src/presets/antdv/table.mjs";
|
|
21
21
|
import { cn as g } from "tailwind-variants";
|
|
22
|
-
function
|
|
23
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
22
|
+
function we(t) {
|
|
23
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Je(t);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function hl(t) {
|
|
26
26
|
if (t === "ascend") return "ascending";
|
|
27
27
|
if (t === "descend") return "descending";
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const Vl = /* @__PURE__ */ Ue({
|
|
30
30
|
name: "TableHeaderCell",
|
|
31
31
|
props: {
|
|
32
32
|
cell: {
|
|
@@ -47,407 +47,386 @@ const jl = /* @__PURE__ */ Xe({
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
setup(t) {
|
|
50
|
-
const e =
|
|
50
|
+
const e = Ge(tl, {}), o = i(() => t.cell.isLeaf ? t.cell.column : null), K = i(() => t.cell.leafIndex >= 0 ? String(t.cell.leafIndex) : void 0), d = i(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), O = i(() => al(d.value, "colSpan") ?? t.cell.colSpan), B = i(() => t.cell.rowSpan), w = i(() => {
|
|
51
51
|
const {
|
|
52
52
|
onClick: l,
|
|
53
|
-
...
|
|
54
|
-
} =
|
|
55
|
-
return
|
|
56
|
-
}), x =
|
|
57
|
-
const l =
|
|
58
|
-
return l ?
|
|
59
|
-
}),
|
|
60
|
-
const l =
|
|
61
|
-
return l ? l.filtered !== void 0 ? l.filtered :
|
|
62
|
-
}),
|
|
63
|
-
function
|
|
64
|
-
|
|
53
|
+
...a
|
|
54
|
+
} = rl(d.value);
|
|
55
|
+
return a;
|
|
56
|
+
}), x = i(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null), A = i(() => !!o.value?.sorter), C = i(() => o.value?.showSorterTooltip ?? e.showSorterTooltip?.value ?? !0), N = i(() => !o.value || !A.value ? !1 : C.value !== !1), I = i(() => {
|
|
57
|
+
const l = o.value;
|
|
58
|
+
return l ? Z(l).length > 0 || !!l.customFilterDropdown || !!l.filterDropdown : !1;
|
|
59
|
+
}), ee = c(null), le = c(null), te = c(null), xe = i(() => te.value?.$el ?? null), Ae = i(() => t.cell.column.align === "center" && (A.value || I.value) && e.presetConfig?.value.headerTitleCenter === "cell"), j = i(() => !o.value || !I.value ? [] : e.getFilteredValue?.(o.value) ?? []), S = i(() => {
|
|
60
|
+
const l = o.value;
|
|
61
|
+
return l ? l.filtered !== void 0 ? l.filtered : j.value.length > 0 : !1;
|
|
62
|
+
}), ne = i(() => o.value?.filterDropdownOpen !== void 0), oe = c(!1), D = i(() => ne.value ? o.value?.filterDropdownOpen ?? !1 : oe.value);
|
|
63
|
+
function b(l) {
|
|
64
|
+
ne.value || (oe.value = l), o.value?.onFilterDropdownOpenChange?.(l);
|
|
65
65
|
}
|
|
66
|
-
const
|
|
67
|
-
function
|
|
68
|
-
|
|
66
|
+
const F = c(null), Ie = ol(Ae, ee, le, F, xe);
|
|
67
|
+
function P() {
|
|
68
|
+
b(!D.value);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
70
|
+
function De(l) {
|
|
71
|
+
l.key !== "Enter" && l.key !== " " || (l.preventDefault(), l.stopPropagation(), P());
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
ye([A, Ie], ([l, o], u, f) => {
|
|
78
|
-
!l || !o || (document.addEventListener("mousedown", re), f(() => document.removeEventListener("mousedown", re)));
|
|
79
|
-
}, {
|
|
80
|
-
flush: "post",
|
|
81
|
-
immediate: !0
|
|
82
|
-
});
|
|
83
|
-
function se() {
|
|
84
|
-
return d.value ? d.value.getBoundingClientRect() : {
|
|
85
|
-
top: 0,
|
|
86
|
-
left: 0,
|
|
87
|
-
right: 0,
|
|
88
|
-
bottom: 0
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const F = c([]), ie = c(null);
|
|
92
|
-
ye(() => K.value, (l) => {
|
|
93
|
-
F.value = [...l];
|
|
73
|
+
const M = c([]), ae = c(null);
|
|
74
|
+
Xe(() => j.value, (l) => {
|
|
75
|
+
M.value = [...l];
|
|
94
76
|
}, {
|
|
95
77
|
immediate: !0
|
|
96
78
|
});
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
function Ae() {
|
|
101
|
-
n.value && (e.resetFilter?.(n.value), h(!1));
|
|
79
|
+
function re(l, a = !0) {
|
|
80
|
+
o.value && (e.confirmFilter?.(o.value, l), a && b(!1));
|
|
102
81
|
}
|
|
103
82
|
function Fe() {
|
|
104
|
-
|
|
83
|
+
o.value && (e.resetFilter?.(o.value), b(!1));
|
|
84
|
+
}
|
|
85
|
+
function se() {
|
|
86
|
+
b(!1);
|
|
105
87
|
}
|
|
106
|
-
const Me =
|
|
88
|
+
const Me = i(() => {
|
|
107
89
|
const l = t.cell.leafColumns;
|
|
108
90
|
if (!l.length) return null;
|
|
109
|
-
const
|
|
110
|
-
return l.every((E) => E.fixed === "left") &&
|
|
111
|
-
left:
|
|
112
|
-
isLastLeft:
|
|
113
|
-
} : l.every((E) => E.fixed === "right") &&
|
|
114
|
-
right:
|
|
115
|
-
isFirstRight:
|
|
91
|
+
const a = l[0], u = l[l.length - 1], v = Q(a) ?? t.cell.colStart, s = Q(u) ?? t.cell.colEnd, p = e.fixedOffsets?.value?.get(v), h = e.fixedOffsets?.value?.get(s);
|
|
92
|
+
return l.every((E) => E.fixed === "left") && p?.left !== void 0 ? {
|
|
93
|
+
left: p.left,
|
|
94
|
+
isLastLeft: h?.isLastLeft
|
|
95
|
+
} : l.every((E) => E.fixed === "right") && h?.right !== void 0 ? {
|
|
96
|
+
right: h.right,
|
|
97
|
+
isFirstRight: p?.isFirstRight
|
|
116
98
|
} : null;
|
|
117
99
|
}), {
|
|
118
|
-
fixedStyle:
|
|
119
|
-
fixedClass:
|
|
120
|
-
} =
|
|
100
|
+
fixedStyle: ke,
|
|
101
|
+
fixedClass: ie
|
|
102
|
+
} = nl({
|
|
121
103
|
fixedInfo: () => Me.value
|
|
122
|
-
}), Ee =
|
|
123
|
-
const l = e.themePreset?.value === "antdv",
|
|
124
|
-
return !l ||
|
|
125
|
-
}),
|
|
104
|
+
}), Ee = i(() => {
|
|
105
|
+
const l = e.themePreset?.value === "antdv", a = e.bordered?.value ?? !1;
|
|
106
|
+
return !l || a || t.cell.isLeaf ? "" : e.vtgClass?.("before:hidden border-b-0") ?? "";
|
|
107
|
+
}), Le = i(() => {
|
|
126
108
|
const l = e.leafColumnCount?.value ?? 0;
|
|
127
109
|
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)]") ?? "" : "";
|
|
128
|
-
}),
|
|
110
|
+
}), ue = i(() => e.getColumnTitle?.(t.cell.column) ?? t.cell.column.title ?? ""), ce = i(() => {
|
|
129
111
|
if (!t.cell.isLeaf) return !1;
|
|
130
|
-
const l =
|
|
131
|
-
return !l || !
|
|
132
|
-
}),
|
|
112
|
+
const l = o.value;
|
|
113
|
+
return !l || !sl(l).enabled ? !1 : e.headerEllipsis?.value === !0;
|
|
114
|
+
}), Oe = i(() => {
|
|
133
115
|
if (e.headerCell) {
|
|
134
116
|
const l = e.headerCell({
|
|
135
|
-
title:
|
|
117
|
+
title: ue.value,
|
|
136
118
|
column: t.cell.column,
|
|
137
119
|
index: t.index
|
|
138
120
|
});
|
|
139
|
-
if (
|
|
121
|
+
if (il(l) !== null)
|
|
140
122
|
return l;
|
|
141
123
|
}
|
|
142
|
-
return
|
|
143
|
-
}),
|
|
144
|
-
const l = t.cell.column.align ? e.vtgClass?.(
|
|
145
|
-
return g(t.thClass, l,
|
|
146
|
-
}),
|
|
124
|
+
return ue.value;
|
|
125
|
+
}), Ne = i(() => {
|
|
126
|
+
const l = t.cell.column.align ? e.vtgClass?.(pl[t.cell.column.align]) ?? "" : "", a = A.value ? e.subThemeSlots?.thSortable() : "", u = x.value ? e.subThemeSlots?.thSorted() : "", v = o.value?.key === "__vtg_expand__";
|
|
127
|
+
return g(t.thClass, l, a, u, Ee.value, t.cell.column.className, v ? e.vtgClass?.("before:hidden") : "", d.value?.class, d.value?.className, ie.value, Le.value, v ? e.compatClass?.("row-expand-icon-cell") : "", ce.value ? e.compatClass?.("cell-ellipsis") : "");
|
|
128
|
+
}), fe = i(() => {
|
|
147
129
|
const l = {};
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
|
|
130
|
+
if (o.value) {
|
|
131
|
+
const s = e.columnWidths?.[String(Q(o.value) ?? t.cell.leafIndex)] ?? o.value.width;
|
|
132
|
+
s && (l.width = typeof s == "number" ? `${s}px` : s);
|
|
151
133
|
}
|
|
152
|
-
const
|
|
134
|
+
const a = d.value?.style, u = ke.value;
|
|
153
135
|
return {
|
|
154
136
|
...l,
|
|
155
137
|
...u ?? {},
|
|
156
|
-
...
|
|
157
|
-
...
|
|
158
|
-
};
|
|
159
|
-
}), H = c(!1), M = c(null);
|
|
160
|
-
function Ne() {
|
|
161
|
-
return M.value ? M.value.getBoundingClientRect() : {
|
|
162
|
-
top: 0,
|
|
163
|
-
left: 0,
|
|
164
|
-
right: 0,
|
|
165
|
-
bottom: 0
|
|
138
|
+
...a ?? {},
|
|
139
|
+
...o.value ? e.columnLayout?.columnStyle(t.cell.leafIndex, O.value) : {}
|
|
166
140
|
};
|
|
141
|
+
}), H = c(!1), de = c(null);
|
|
142
|
+
let f = null;
|
|
143
|
+
function Pe() {
|
|
144
|
+
f && clearTimeout(f), H.value = !0;
|
|
167
145
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
v && clearTimeout(v), H.value = !0;
|
|
171
|
-
}
|
|
172
|
-
function me() {
|
|
173
|
-
v && clearTimeout(v), v = setTimeout(() => {
|
|
146
|
+
function ve() {
|
|
147
|
+
f && clearTimeout(f), f = setTimeout(() => {
|
|
174
148
|
H.value = !1;
|
|
175
149
|
}, 100);
|
|
176
150
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
151
|
+
function me() {
|
|
152
|
+
f && clearTimeout(f);
|
|
179
153
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
154
|
+
function He() {
|
|
155
|
+
f && clearTimeout(f), H.value = !1;
|
|
182
156
|
}
|
|
183
|
-
const
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
157
|
+
const W = c(!1);
|
|
158
|
+
let q;
|
|
159
|
+
Ye(() => {
|
|
160
|
+
clearTimeout(q), me();
|
|
161
|
+
});
|
|
162
|
+
function ge(l) {
|
|
163
|
+
clearTimeout(q);
|
|
164
|
+
const a = C.value, u = typeof a == "object" ? l ? a.mouseEnterDelay : a.mouseLeaveDelay : 0;
|
|
165
|
+
u && u > 0 ? q = setTimeout(() => {
|
|
166
|
+
W.value = l;
|
|
167
|
+
}, u * 1e3) : W.value = l;
|
|
168
|
+
}
|
|
169
|
+
const k = c(!1), Re = i(() => N.value && W.value && !k.value);
|
|
170
|
+
function Ve(l) {
|
|
171
|
+
const a = w.value.onMouseenter;
|
|
172
|
+
typeof a == "function" && a(l), N.value && ge(!0);
|
|
192
173
|
}
|
|
193
|
-
const L = c(!1), Be = s(() => N.value && q.value && !L.value);
|
|
194
174
|
function Ke(l) {
|
|
195
|
-
const
|
|
196
|
-
typeof
|
|
175
|
+
const a = w.value.onMouseleave;
|
|
176
|
+
typeof a == "function" && a(l), N.value && ge(!1);
|
|
197
177
|
}
|
|
198
|
-
function
|
|
199
|
-
|
|
200
|
-
typeof o == "function" && o(l), N.value && pe(!1);
|
|
178
|
+
function z() {
|
|
179
|
+
k.value = !0;
|
|
201
180
|
}
|
|
202
181
|
function $() {
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
function U() {
|
|
206
|
-
L.value = !1;
|
|
182
|
+
k.value = !1;
|
|
207
183
|
}
|
|
208
|
-
function
|
|
209
|
-
const
|
|
210
|
-
typeof
|
|
184
|
+
function U(l) {
|
|
185
|
+
const a = d.value?.onClick;
|
|
186
|
+
typeof a == "function" && a(l), o.value && A.value && e.toggleSortOrder?.(o.value);
|
|
211
187
|
}
|
|
212
188
|
return () => {
|
|
213
189
|
if (O.value === 0 || B.value === 0)
|
|
214
190
|
return null;
|
|
215
|
-
const l = O.value !== 1 ? O.value : void 0,
|
|
216
|
-
if (
|
|
217
|
-
const
|
|
191
|
+
const l = O.value !== 1 ? O.value : void 0, a = B.value !== 1 ? B.value : void 0;
|
|
192
|
+
if (o.value?.key === "__vtg_selection__") {
|
|
193
|
+
const n = e.rowSelection?.(), y = n?.type === "radio", Se = n?.hideSelectAll === !0, Y = n?.selections !== void 0 && n.selections !== !1, T = e.locale?.value, L = n?.columnTitle, ze = L !== void 0, be = g(t.thClass, e.vtgClass?.(ze ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, d.value?.class, d.value?.className, ie.value, e.compatClass?.("selection-column")), ye = fe.value;
|
|
218
194
|
let J = [];
|
|
219
|
-
if (Y && (
|
|
195
|
+
if (Y && (n?.selections === !0 ? J = [{
|
|
220
196
|
key: "__vtg_select_all__",
|
|
221
|
-
text:
|
|
197
|
+
text: T?.selection?.selectAll ?? "全选所有",
|
|
222
198
|
onSelect: () => e.toggleAll?.(!0, !0)
|
|
223
199
|
}, {
|
|
224
200
|
key: "__vtg_select_invert__",
|
|
225
|
-
text:
|
|
201
|
+
text: T?.selection?.selectInvert ?? "反选当页",
|
|
226
202
|
onSelect: () => e.invertSelection?.()
|
|
227
203
|
}, {
|
|
228
204
|
key: "__vtg_select_none__",
|
|
229
|
-
text:
|
|
205
|
+
text: T?.selection?.selectNone ?? "清空所有",
|
|
230
206
|
onSelect: () => e.clearSelection?.()
|
|
231
|
-
}] : Array.isArray(
|
|
207
|
+
}] : Array.isArray(n?.selections) && (J = n.selections.map((_) => _ === Ze ? {
|
|
232
208
|
key: "__vtg_select_all__",
|
|
233
|
-
text:
|
|
209
|
+
text: T?.selection?.selectAll ?? "全选所有",
|
|
234
210
|
onSelect: () => e.toggleAll?.(!0, !0)
|
|
235
|
-
} :
|
|
211
|
+
} : _ === el ? {
|
|
236
212
|
key: "__vtg_select_invert__",
|
|
237
|
-
text:
|
|
213
|
+
text: T?.selection?.selectInvert ?? "反选当页",
|
|
238
214
|
onSelect: () => e.invertSelection?.()
|
|
239
|
-
} :
|
|
215
|
+
} : _ === ll ? {
|
|
240
216
|
key: "__vtg_select_none__",
|
|
241
|
-
text:
|
|
217
|
+
text: T?.selection?.selectNone ?? "清空所有",
|
|
242
218
|
onSelect: () => e.clearSelection?.()
|
|
243
|
-
} :
|
|
244
|
-
return
|
|
245
|
-
class:
|
|
246
|
-
style:
|
|
219
|
+
} : _))), y)
|
|
220
|
+
return r("th", m(w.value, {
|
|
221
|
+
class: be,
|
|
222
|
+
style: ye,
|
|
247
223
|
colspan: l,
|
|
248
|
-
rowspan:
|
|
249
|
-
"data-vtg-leaf-col":
|
|
250
|
-
onClick:
|
|
251
|
-
}), [
|
|
252
|
-
const
|
|
224
|
+
rowspan: a,
|
|
225
|
+
"data-vtg-leaf-col": K.value,
|
|
226
|
+
onClick: U
|
|
227
|
+
}), [L]);
|
|
228
|
+
const Te = e.allCheckedState?.() ?? "none", $e = L ? r("span", {
|
|
253
229
|
class: e.vtgClass?.("ml-2")
|
|
254
|
-
}, [
|
|
255
|
-
return
|
|
256
|
-
class:
|
|
257
|
-
style:
|
|
230
|
+
}, [L]) : null;
|
|
231
|
+
return r("th", m(w.value, {
|
|
232
|
+
class: be,
|
|
233
|
+
style: ye,
|
|
258
234
|
colspan: l,
|
|
259
|
-
rowspan:
|
|
260
|
-
"data-vtg-leaf-col":
|
|
261
|
-
onClick:
|
|
262
|
-
}), [
|
|
235
|
+
rowspan: a,
|
|
236
|
+
"data-vtg-leaf-col": K.value,
|
|
237
|
+
onClick: U
|
|
238
|
+
}), [Se ? L : r("span", {
|
|
263
239
|
class: g(e.vtgClass?.("inline-flex items-center justify-center relative"), e.compatClass?.("selection"))
|
|
264
|
-
}, [
|
|
265
|
-
checked:
|
|
266
|
-
indeterminate:
|
|
267
|
-
onChange: (
|
|
268
|
-
}, null),
|
|
269
|
-
ref:
|
|
240
|
+
}, [r(dl, {
|
|
241
|
+
checked: Te === "all",
|
|
242
|
+
indeterminate: Te === "partial",
|
|
243
|
+
onChange: (_) => e.toggleAll?.(_)
|
|
244
|
+
}, null), $e, Y && r("span", {
|
|
245
|
+
ref: de,
|
|
270
246
|
class: g(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
|
|
271
|
-
onMouseenter:
|
|
272
|
-
onMouseleave:
|
|
247
|
+
onMouseenter: Pe,
|
|
248
|
+
onMouseleave: ve,
|
|
273
249
|
role: "button",
|
|
274
250
|
"aria-label": "Selection options"
|
|
275
|
-
}, [
|
|
251
|
+
}, [r(Qe, null, null)])]), !Se && Y && r(vl, {
|
|
276
252
|
items: J,
|
|
277
|
-
anchorElement:
|
|
278
|
-
anchorRect: Ne(),
|
|
279
|
-
popupContainer: Z(e, M.value),
|
|
253
|
+
anchorElement: de.value,
|
|
280
254
|
visible: H.value,
|
|
281
|
-
onClose:
|
|
282
|
-
onMouseenter:
|
|
283
|
-
onMouseleave:
|
|
255
|
+
onClose: He,
|
|
256
|
+
onMouseenter: me,
|
|
257
|
+
onMouseleave: ve
|
|
284
258
|
}, null)]);
|
|
285
259
|
}
|
|
286
|
-
const u = e.locale?.value,
|
|
287
|
-
title:
|
|
288
|
-
} :
|
|
260
|
+
const u = e.locale?.value, v = x.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : x.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", s = o.value, p = t.cell.column.tooltip, h = typeof p == "string" ? {
|
|
261
|
+
title: p
|
|
262
|
+
} : p, E = e.subThemeSlots?.sortAreaWrapper(), Be = e.subThemeSlots?.sortAreaTitle(), R = r("span", {
|
|
289
263
|
class: E,
|
|
290
264
|
"data-align": t.cell.column.align
|
|
291
|
-
}, [
|
|
292
|
-
ref:
|
|
265
|
+
}, [r("span", {
|
|
266
|
+
ref: le,
|
|
293
267
|
"data-align": t.cell.column.align,
|
|
294
|
-
class: g(
|
|
295
|
-
}, [
|
|
268
|
+
class: g(Be, ce.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
|
|
269
|
+
}, [Oe.value, h && r("span", {
|
|
296
270
|
class: e.subThemeSlots?.headerHelp(),
|
|
297
|
-
onClick: (
|
|
271
|
+
onClick: (n) => n.stopPropagation(),
|
|
298
272
|
onMouseenter: () => {
|
|
299
|
-
|
|
273
|
+
k.value = !0;
|
|
300
274
|
},
|
|
301
275
|
onMouseleave: () => {
|
|
302
|
-
|
|
276
|
+
k.value = !1;
|
|
303
277
|
}
|
|
304
|
-
}, [
|
|
305
|
-
title:
|
|
278
|
+
}, [r(_e, m(h, {
|
|
279
|
+
title: h.title
|
|
306
280
|
}), {
|
|
307
|
-
default: () => [
|
|
281
|
+
default: () => [r("span", null, [r("svg", {
|
|
308
282
|
width: "1em",
|
|
309
283
|
height: "1em",
|
|
310
284
|
viewBox: "0 0 16 16",
|
|
311
285
|
fill: "none",
|
|
312
286
|
stroke: "currentColor",
|
|
313
287
|
"aria-hidden": "true"
|
|
314
|
-
}, [
|
|
288
|
+
}, [r("circle", {
|
|
315
289
|
cx: "8",
|
|
316
290
|
cy: "8",
|
|
317
291
|
r: "6"
|
|
318
|
-
}, null),
|
|
292
|
+
}, null), r("path", {
|
|
319
293
|
d: "M6.2 5.7a1.8 1.8 0 1 1 3 1.3C8.4 7.6 8 8 8 9"
|
|
320
|
-
}, null),
|
|
294
|
+
}, null), r("path", {
|
|
321
295
|
d: "M8 11h.01"
|
|
322
296
|
}, null)])])]
|
|
323
|
-
})])]),
|
|
324
|
-
ref:
|
|
297
|
+
})])]), A.value && r(ul, {
|
|
298
|
+
ref: te,
|
|
325
299
|
sortOrder: x.value
|
|
326
|
-
}, null)]),
|
|
327
|
-
class:
|
|
300
|
+
}, null)]), pe = e.subThemeSlots?.sortAreaOuter(), je = N.value ? r("span", {
|
|
301
|
+
class: pe,
|
|
328
302
|
"data-align": t.cell.column.align
|
|
329
|
-
}, [
|
|
303
|
+
}, [r(_e, m({
|
|
330
304
|
block: !0,
|
|
331
305
|
placement: "top"
|
|
332
|
-
}, typeof
|
|
333
|
-
title: typeof
|
|
334
|
-
open: !!
|
|
335
|
-
}),
|
|
336
|
-
default: () => [
|
|
337
|
-
})]) :
|
|
338
|
-
class:
|
|
306
|
+
}, typeof C.value == "object" ? C.value : {}, {
|
|
307
|
+
title: typeof C.value == "object" ? C.value.title ?? v : v,
|
|
308
|
+
open: !!Re.value
|
|
309
|
+
}), we(R) ? R : {
|
|
310
|
+
default: () => [R]
|
|
311
|
+
})]) : r("span", {
|
|
312
|
+
class: pe,
|
|
339
313
|
"data-align": t.cell.column.align
|
|
340
|
-
}, [
|
|
314
|
+
}, [R]), G = {
|
|
315
|
+
tabindex: 0,
|
|
316
|
+
"aria-expanded": D.value,
|
|
317
|
+
onKeydown: De
|
|
318
|
+
}, We = s && (s.filterIcon ? r("span", m({
|
|
341
319
|
"data-align": t.cell.column.align,
|
|
342
|
-
class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(),
|
|
343
|
-
ref:
|
|
344
|
-
onMouseenter:
|
|
345
|
-
onMouseleave:
|
|
346
|
-
onMousedown: (
|
|
347
|
-
onClick: (
|
|
348
|
-
|
|
320
|
+
class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(), S.value && e.compatClass && "active"),
|
|
321
|
+
ref: F,
|
|
322
|
+
onMouseenter: z,
|
|
323
|
+
onMouseleave: $,
|
|
324
|
+
onMousedown: (n) => n.stopPropagation(),
|
|
325
|
+
onClick: (n) => {
|
|
326
|
+
n.stopPropagation(), P();
|
|
349
327
|
},
|
|
350
328
|
role: "button",
|
|
351
329
|
"aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
|
|
352
|
-
}, [
|
|
353
|
-
filtered:
|
|
354
|
-
})]) : e.customFilterIcon ?
|
|
330
|
+
}, G), [s.filterIcon({
|
|
331
|
+
filtered: S.value
|
|
332
|
+
})]) : e.customFilterIcon ? r("span", m({
|
|
355
333
|
"data-align": t.cell.column.align,
|
|
356
|
-
class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(),
|
|
357
|
-
ref:
|
|
358
|
-
onMouseenter:
|
|
359
|
-
onMouseleave:
|
|
360
|
-
onMousedown: (
|
|
361
|
-
onClick: (
|
|
362
|
-
|
|
334
|
+
class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(), S.value && e.compatClass && "active"),
|
|
335
|
+
ref: F,
|
|
336
|
+
onMouseenter: z,
|
|
337
|
+
onMouseleave: $,
|
|
338
|
+
onMousedown: (n) => n.stopPropagation(),
|
|
339
|
+
onClick: (n) => {
|
|
340
|
+
n.stopPropagation(), P();
|
|
363
341
|
},
|
|
364
342
|
role: "button",
|
|
365
343
|
"aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
|
|
366
|
-
}, [e.customFilterIcon({
|
|
367
|
-
column:
|
|
368
|
-
filtered:
|
|
369
|
-
})]) :
|
|
370
|
-
ref:
|
|
344
|
+
}, G), [e.customFilterIcon({
|
|
345
|
+
column: s,
|
|
346
|
+
filtered: S.value
|
|
347
|
+
})]) : r("span", {
|
|
348
|
+
ref: F,
|
|
371
349
|
"data-align": t.cell.column.align,
|
|
372
|
-
class: [e.subThemeSlots?.filterIconWrapper(),
|
|
373
|
-
onMouseenter:
|
|
374
|
-
onMouseleave:
|
|
375
|
-
onMousedown: (
|
|
376
|
-
}, [
|
|
377
|
-
active:
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
350
|
+
class: [e.subThemeSlots?.filterIconWrapper(), S.value && e.compatClass && "active"],
|
|
351
|
+
onMouseenter: z,
|
|
352
|
+
onMouseleave: $,
|
|
353
|
+
onMousedown: (n) => n.stopPropagation()
|
|
354
|
+
}, [r(cl, m({
|
|
355
|
+
active: S.value,
|
|
356
|
+
"data-vtg-filter-trigger": !0,
|
|
357
|
+
onClick: P
|
|
358
|
+
}, G), null)])), X = s && {
|
|
359
|
+
column: s,
|
|
360
|
+
selectedKeys: M.value,
|
|
361
|
+
setSelectedKeys: (n) => {
|
|
362
|
+
M.value = [...n];
|
|
384
363
|
},
|
|
385
|
-
confirm: (
|
|
386
|
-
|
|
364
|
+
confirm: (n) => {
|
|
365
|
+
re(M.value, n?.closeDropdown !== !1);
|
|
387
366
|
},
|
|
388
|
-
clearFilters: (
|
|
389
|
-
const
|
|
390
|
-
|
|
367
|
+
clearFilters: (n) => {
|
|
368
|
+
const y = s.filterResetToDefaultFilteredValue ? [...s.defaultFilteredValue ?? []] : [];
|
|
369
|
+
M.value = y, n?.confirm !== !1 && e.confirmFilter?.(s, y), n?.closeDropdown !== !1 && b(!1);
|
|
391
370
|
},
|
|
392
|
-
filters:
|
|
393
|
-
visible:
|
|
394
|
-
close: () =>
|
|
395
|
-
}, he =
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
filterSearch:
|
|
416
|
-
filterMode:
|
|
417
|
-
expandedKeys:
|
|
418
|
-
visible:
|
|
419
|
-
onConfirm:
|
|
420
|
-
onReset:
|
|
421
|
-
onClose:
|
|
422
|
-
"onUpdate:expandedKeys": (
|
|
423
|
-
|
|
371
|
+
filters: Z(s),
|
|
372
|
+
visible: D.value,
|
|
373
|
+
close: () => b(!1)
|
|
374
|
+
}, he = s?.customFilterDropdown ? e.customFilterDropdown : void 0, V = F.value, Ce = V?.querySelector("[data-vtg-filter-trigger]") ?? V, qe = s && X && (() => {
|
|
375
|
+
const n = typeof s.filterDropdown == "function" ? s.filterDropdown(X) : s.filterDropdown ?? (he ? he(X) : null);
|
|
376
|
+
return n ? r(ml, {
|
|
377
|
+
open: D.value,
|
|
378
|
+
anchor: V,
|
|
379
|
+
focusAnchor: Ce,
|
|
380
|
+
getPopupContainer: e.getPopupContainer,
|
|
381
|
+
preset: e.themePreset?.value ?? "antdv",
|
|
382
|
+
alignmentWidth: 150,
|
|
383
|
+
class: e.subThemeSlots?.filterDropdown(),
|
|
384
|
+
onDismiss: se
|
|
385
|
+
}, we(n) ? n : {
|
|
386
|
+
default: () => [n]
|
|
387
|
+
}) : r(fl, {
|
|
388
|
+
filters: Z(s),
|
|
389
|
+
selectedKeys: j.value,
|
|
390
|
+
multiple: s.filterMultiple !== !1,
|
|
391
|
+
anchor: V,
|
|
392
|
+
focusAnchor: Ce,
|
|
393
|
+
getPopupContainer: e.getPopupContainer,
|
|
394
|
+
filterSearch: s.filterSearch ?? !1,
|
|
395
|
+
filterMode: s.filterMode ?? "menu",
|
|
396
|
+
expandedKeys: ae.value,
|
|
397
|
+
visible: D.value,
|
|
398
|
+
onConfirm: re,
|
|
399
|
+
onReset: Fe,
|
|
400
|
+
onClose: se,
|
|
401
|
+
"onUpdate:expandedKeys": (y) => {
|
|
402
|
+
ae.value = y;
|
|
424
403
|
}
|
|
425
404
|
}, null);
|
|
426
405
|
})();
|
|
427
|
-
return
|
|
428
|
-
class:
|
|
429
|
-
style:
|
|
406
|
+
return r("th", m(w.value, {
|
|
407
|
+
class: Ne.value,
|
|
408
|
+
style: fe.value,
|
|
430
409
|
colspan: l,
|
|
431
|
-
rowspan:
|
|
432
|
-
"data-vtg-leaf-col":
|
|
433
|
-
onClick:
|
|
434
|
-
onMouseenter:
|
|
435
|
-
onMouseleave:
|
|
436
|
-
"aria-sort":
|
|
437
|
-
}), [
|
|
438
|
-
ref:
|
|
410
|
+
rowspan: a,
|
|
411
|
+
"data-vtg-leaf-col": K.value,
|
|
412
|
+
onClick: U,
|
|
413
|
+
onMouseenter: Ve,
|
|
414
|
+
onMouseleave: Ke,
|
|
415
|
+
"aria-sort": o.value ? hl(x.value) : void 0
|
|
416
|
+
}), [r("span", {
|
|
417
|
+
ref: ee,
|
|
439
418
|
"data-align": t.cell.column.align,
|
|
440
419
|
style: {
|
|
441
|
-
"--vtg-header-title-spacer": `${
|
|
420
|
+
"--vtg-header-title-spacer": `${Ie.value}px`
|
|
442
421
|
},
|
|
443
422
|
class: g(e.vtgClass?.("flex items-center"), t.headerCellInnerClass, I.value && e.compatClass?.("filter-column"))
|
|
444
|
-
}, [
|
|
445
|
-
column:
|
|
423
|
+
}, [je, I.value && We]), I.value && qe, o.value?.resizable && r(gl, {
|
|
424
|
+
column: o.value,
|
|
446
425
|
colIndex: t.cell.leafIndex
|
|
447
426
|
}, null)]);
|
|
448
427
|
};
|
|
449
428
|
}
|
|
450
429
|
});
|
|
451
430
|
export {
|
|
452
|
-
|
|
431
|
+
Vl as default
|
|
453
432
|
};
|