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