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