@vtable-guild/vtable-guild 2.5.0 → 2.6.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 +3 -0
- package/css/tailwind3-utilities.css +3 -0
- package/dist/core/src/components/VTableGuildConfigProvider.d.ts.map +1 -1
- package/dist/core/src/components/VTableGuildConfigProvider.mjs +17 -12
- package/dist/core/src/composables/useTheme.d.ts +9 -1
- package/dist/core/src/composables/useTheme.d.ts.map +1 -1
- package/dist/core/src/composables/useTheme.mjs +83 -60
- package/dist/core/src/index.d.ts +4 -0
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/plugin/index.d.ts.map +1 -1
- package/dist/core/src/plugin/index.mjs +4 -3
- package/dist/core/src/utils/types.d.ts +3 -0
- package/dist/core/src/utils/types.d.ts.map +1 -1
- package/dist/css/style.css +3 -0
- package/dist/css/tailwind3-utilities.css +3 -0
- package/dist/index.full.mjs +3142 -3020
- package/dist/index.mjs +39 -37
- package/dist/table/src/components/Table.d.ts +6 -6
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +264 -255
- package/dist/table/src/components/TableBody.d.ts.map +1 -1
- package/dist/table/src/components/TableBody.mjs +44 -43
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +69 -55
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +12 -12
- package/dist/table/src/components/VTableCompatClass.test.d.ts +2 -0
- package/dist/table/src/components/VTableCompatClass.test.d.ts.map +1 -0
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +31 -30
- package/dist/table/src/composables/useFixedColumnStyle.d.ts.map +1 -1
- package/dist/table/src/composables/useFixedColumnStyle.mjs +12 -11
- package/dist/table/src/context.d.ts +7 -0
- package/dist/table/src/context.d.ts.map +1 -1
- package/dist/table/src/utils/compat.d.ts +9 -0
- package/dist/table/src/utils/compat.d.ts.map +1 -0
- package/dist/table/src/utils/compat.mjs +28 -0
- package/dist/theme/src/compat/antdv-table.d.ts +4 -0
- package/dist/theme/src/compat/antdv-table.d.ts.map +1 -0
- package/dist/theme/src/compat/antdv-table.mjs +51 -0
- package/dist/theme/src/index.d.ts +2 -0
- package/dist/theme/src/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableBody.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAOtE,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;;;
|
|
1
|
+
{"version":3,"file":"TableBody.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableBody.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAOtE,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;;;cAmBd,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;cAO3C,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;;;;;cAR9D,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;cAO3C,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;;;;+BAAjC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG;;AAX7F,wBAiKE"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as b, inject as x, computed as h, createVNode as
|
|
1
|
+
import { defineComponent as b, inject as x, computed as h, createVNode as m } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
3
|
import E from "./TableRow.mjs";
|
|
4
4
|
import T from "./TableCell.mjs";
|
|
5
5
|
import v from "./TableEmpty.mjs";
|
|
6
6
|
import { TABLE_CONTEXT_KEY as k } from "../context.mjs";
|
|
7
7
|
import { resolveBodyCell as K } from "../utils/cell.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import { getRowCompatClass as N } from "../utils/compat.mjs";
|
|
9
|
+
import { getByDataIndex as q } from "../composables/useColumns.mjs";
|
|
10
|
+
import { cn as p } from "tailwind-variants";
|
|
11
|
+
function R(e) {
|
|
11
12
|
return Number.isFinite(e) ? e <= 0 ? 0 : Math.floor(e) : 1;
|
|
12
13
|
}
|
|
13
|
-
const
|
|
14
|
+
const L = /* @__PURE__ */ b({
|
|
14
15
|
name: "TableBody",
|
|
15
16
|
props: {
|
|
16
17
|
dataSource: {
|
|
@@ -47,72 +48,72 @@ const j = /* @__PURE__ */ b({
|
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
setup(e) {
|
|
50
|
-
const
|
|
51
|
-
function g(t,
|
|
52
|
-
return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] :
|
|
51
|
+
const l = x(k, {});
|
|
52
|
+
function g(t, a) {
|
|
53
|
+
return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] : a;
|
|
53
54
|
}
|
|
54
55
|
const S = h(() => {
|
|
55
56
|
const t = /* @__PURE__ */ new Set();
|
|
56
|
-
return e.dataSource.map((
|
|
57
|
+
return e.dataSource.map((a, o) => {
|
|
57
58
|
const s = [];
|
|
58
|
-
return e.columns.forEach((
|
|
59
|
+
return e.columns.forEach((C, r) => {
|
|
59
60
|
const c = `${o}:${r}`;
|
|
60
61
|
if (t.has(c)) return;
|
|
61
62
|
const y = K({
|
|
62
|
-
text:
|
|
63
|
-
record:
|
|
63
|
+
text: q(a, C.dataIndex),
|
|
64
|
+
record: a,
|
|
64
65
|
rowIndex: o,
|
|
65
|
-
column:
|
|
66
|
-
bodyCell:
|
|
67
|
-
transformCellText:
|
|
68
|
-
}),
|
|
69
|
-
if (
|
|
70
|
-
const f = Math.min(e.dataSource.length, o + d), w = Math.min(e.columns.length, r +
|
|
71
|
-
for (let
|
|
72
|
-
for (let
|
|
73
|
-
|
|
66
|
+
column: C,
|
|
67
|
+
bodyCell: l.bodyCell,
|
|
68
|
+
transformCellText: l.transformCellText
|
|
69
|
+
}), i = R(y.colSpan), d = R(y.rowSpan);
|
|
70
|
+
if (i === 0 || d === 0) return;
|
|
71
|
+
const f = Math.min(e.dataSource.length, o + d), w = Math.min(e.columns.length, r + i);
|
|
72
|
+
for (let u = o; u < f; u += 1)
|
|
73
|
+
for (let n = r; n < w; n += 1)
|
|
74
|
+
u === o && n === r || t.add(`${u}:${n}`);
|
|
74
75
|
s.push({
|
|
75
|
-
column:
|
|
76
|
+
column: C,
|
|
76
77
|
colIndex: r,
|
|
77
78
|
resolvedCell: {
|
|
78
79
|
...y,
|
|
79
|
-
colSpan:
|
|
80
|
+
colSpan: i,
|
|
80
81
|
rowSpan: d
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
84
|
}), s;
|
|
84
85
|
});
|
|
85
86
|
});
|
|
86
|
-
return () =>
|
|
87
|
+
return () => m("tbody", {
|
|
87
88
|
class: e.tbodyClass
|
|
88
|
-
}, [e.dataSource.length > 0 ? e.dataSource.map((t,
|
|
89
|
-
const o = g(t,
|
|
90
|
-
c &&
|
|
89
|
+
}, [e.dataSource.length > 0 ? e.dataSource.map((t, a) => {
|
|
90
|
+
const o = g(t, a), s = l.expandable?.(), C = l.isExpanded?.(o) ?? !1, r = s?.expandRowByClick ?? !1, c = l.isRowExpandable?.(t) ?? !1, i = (l.isTreeData?.value ? l.getFlattenRow?.(t) : void 0)?.level ?? 0, d = l.getRowClassName?.(t, a), f = l.getRowProps?.(t, a), w = typeof s?.expandedRowClassName == "function" ? s.expandedRowClassName(t, a, i) : s?.expandedRowClassName, u = r ? () => {
|
|
91
|
+
c && l.toggleExpand?.(t, a);
|
|
91
92
|
} : void 0;
|
|
92
|
-
return [
|
|
93
|
+
return [m(E, {
|
|
93
94
|
key: o,
|
|
94
|
-
rowClass:
|
|
95
|
+
rowClass: p(e.rowClass, d, N(l, t, a, i)) ?? "",
|
|
95
96
|
rowProps: f,
|
|
96
|
-
onClick:
|
|
97
|
+
onClick: u
|
|
97
98
|
}, {
|
|
98
|
-
default: () => [S.value[
|
|
99
|
-
key:
|
|
99
|
+
default: () => [S.value[a]?.map((n) => m(T, {
|
|
100
|
+
key: n.column.key ?? String(n.column.dataIndex ?? n.colIndex),
|
|
100
101
|
record: t,
|
|
101
|
-
rowIndex:
|
|
102
|
-
column:
|
|
103
|
-
colIndex:
|
|
104
|
-
resolvedCell:
|
|
102
|
+
rowIndex: a,
|
|
103
|
+
column: n.column,
|
|
104
|
+
colIndex: n.colIndex,
|
|
105
|
+
resolvedCell: n.resolvedCell,
|
|
105
106
|
tdClass: e.tdClass,
|
|
106
107
|
bodyCellEllipsisClass: e.bodyCellEllipsisClass
|
|
107
108
|
}, null))]
|
|
108
|
-
}),
|
|
109
|
+
}), C && s?.expandedRowRender && m("tr", {
|
|
109
110
|
key: `${o}-expanded`,
|
|
110
|
-
class:
|
|
111
|
-
}, [
|
|
111
|
+
class: p(e.rowClass, d, l.subThemeSlots?.expandedRow(), w)
|
|
112
|
+
}, [m("td", {
|
|
112
113
|
colspan: e.columns.length,
|
|
113
|
-
class:
|
|
114
|
-
}, [s.expandedRowRender(t,
|
|
115
|
-
}) :
|
|
114
|
+
class: p(e.tdClass, l.subThemeSlots?.expandedRowCell())
|
|
115
|
+
}, [s.expandedRowRender(t, a, 0, !0)])])];
|
|
116
|
+
}) : m(v, {
|
|
116
117
|
colSpan: e.columns.length || 1,
|
|
117
118
|
emptyClass: e.emptyClass,
|
|
118
119
|
tdClass: e.tdClass
|
|
@@ -120,5 +121,5 @@ const j = /* @__PURE__ */ b({
|
|
|
120
121
|
}
|
|
121
122
|
});
|
|
122
123
|
export {
|
|
123
|
-
|
|
124
|
+
L as default
|
|
124
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,QAAQ,EAAmB,MAAM,KAAK,CAAA;AAG5F,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,UAAU,CAAA;AAK/D,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;;;cAQQ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;cAEjC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;cAGrD,QAAQ,CAAC,gBAAgB,CAAC;;;;;;;;;;;IAK5C;;;;;;OAMG;;;;;;;cAhBuB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;cAEjC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;cAGrD,QAAQ,CAAC,gBAAgB,CAAC;;;;;;;;;;;IAK5C;;;;;;OAMG;;;;;;;;;AAnBP,
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,QAAQ,EAAmB,MAAM,KAAK,CAAA;AAG5F,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,UAAU,CAAA;AAK/D,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;;;cAQQ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;cAEjC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;cAGrD,QAAQ,CAAC,gBAAgB,CAAC;;;;;;;;;;;IAK5C;;;;;;OAMG;;;;;;;cAhBuB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;;;;;;;;cAEjC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;;;;;;;;cAGrD,QAAQ,CAAC,gBAAgB,CAAC;;;;;;;;;;;IAK5C;;;;;;OAMG;;;;;;;;;AAnBP,wBA0aE"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as U, inject as Z, ref as q, computed as c, createVNode as r, mergeProps as B } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
|
-
import
|
|
4
|
-
import { TABLE_CONTEXT_KEY as
|
|
5
|
-
import { getByDataIndex as
|
|
6
|
-
import { useFixedColumnStyle as
|
|
7
|
-
import { resolveBodyCell as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
3
|
+
import ee from "../../../core/src/components/Tooltip.mjs";
|
|
4
|
+
import { TABLE_CONTEXT_KEY as le } from "../context.mjs";
|
|
5
|
+
import { getByDataIndex as ne, getColumnKey as L } from "../composables/useColumns.mjs";
|
|
6
|
+
import { useFixedColumnStyle as te } from "../composables/useFixedColumnStyle.mjs";
|
|
7
|
+
import { resolveBodyCell as oe, getEllipsisConfig as D, omitCellProps as N, isRenderedCell as ae } from "../utils/cell.mjs";
|
|
8
|
+
import se from "./SelectionCheckbox.mjs";
|
|
9
|
+
import re from "./SelectionRadio.mjs";
|
|
10
10
|
import P from "./ExpandIcon.mjs";
|
|
11
|
-
import { isInHoverRange as
|
|
11
|
+
import { isInHoverRange as ce } from "../composables/useHoverState.mjs";
|
|
12
12
|
import { TABLE_ALIGN_CLASSES as de } from "../../../theme/src/presets/antdv/table.mjs";
|
|
13
13
|
import { cn as m } from "tailwind-variants";
|
|
14
|
-
const
|
|
14
|
+
const Te = /* @__PURE__ */ U({
|
|
15
15
|
name: "TableCell",
|
|
16
16
|
props: {
|
|
17
17
|
record: {
|
|
@@ -55,27 +55,27 @@ const Ie = /* @__PURE__ */ J({
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
setup(e) {
|
|
58
|
-
const l =
|
|
59
|
-
text:
|
|
58
|
+
const l = Z(le, {}), H = q(null), I = q(!1), o = c(() => e.resolvedCell ?? oe({
|
|
59
|
+
text: ne(e.record, e.column.dataIndex),
|
|
60
60
|
record: e.record,
|
|
61
61
|
rowIndex: e.rowIndex,
|
|
62
62
|
column: e.column,
|
|
63
63
|
bodyCell: l.bodyCell,
|
|
64
64
|
transformCellText: l.transformCellText
|
|
65
|
-
})),
|
|
65
|
+
})), j = c(() => {
|
|
66
66
|
if (!e.column.fixed) return null;
|
|
67
67
|
const n = L(e.column) ?? e.colIndex;
|
|
68
68
|
return l.fixedOffsets?.value?.get(n) ?? null;
|
|
69
69
|
}), {
|
|
70
|
-
fixedStyle:
|
|
70
|
+
fixedStyle: A,
|
|
71
71
|
fixedClass: T
|
|
72
|
-
} =
|
|
73
|
-
fixedInfo: () =>
|
|
74
|
-
}), i =
|
|
72
|
+
} = te({
|
|
73
|
+
fixedInfo: () => j.value
|
|
74
|
+
}), W = c(() => D(e.column).enabled ? l.compatClass?.("cell-ellipsis") ?? "" : ""), i = c(() => l.getSelectionState?.(e.record, e.rowIndex) ?? {
|
|
75
75
|
checked: !1,
|
|
76
76
|
indeterminate: !1,
|
|
77
77
|
disabled: !1
|
|
78
|
-
}), f =
|
|
78
|
+
}), f = c(() => i.value.checked), _ = c(() => ce(e.rowIndex, o.value.rowSpan ?? 1, l.hoverRange?.value ?? null));
|
|
79
79
|
function S() {
|
|
80
80
|
if (!l.hoverable?.value) return;
|
|
81
81
|
const n = Math.max(1, o.value.rowSpan ?? 1);
|
|
@@ -84,46 +84,60 @@ const Ie = /* @__PURE__ */ J({
|
|
|
84
84
|
function h() {
|
|
85
85
|
l.hoverable?.value && l.clearHoverRange?.();
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function K(n) {
|
|
88
88
|
return (t) => {
|
|
89
89
|
S(), typeof n == "function" && n(t);
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function z(n) {
|
|
93
93
|
return (t) => {
|
|
94
94
|
h(), typeof n == "function" && n(t);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
const E =
|
|
97
|
+
const E = c(() => ({
|
|
98
98
|
...N(o.value.renderCellProps),
|
|
99
99
|
...N(o.value.customCellProps)
|
|
100
|
-
})),
|
|
101
|
-
const n = e.column.align ? de[e.column.align] : "", t = l.subThemeSlots, a = _.value && l.hoverable?.value,
|
|
102
|
-
return m(
|
|
103
|
-
|
|
100
|
+
})), F = c(() => {
|
|
101
|
+
const n = e.column.align ? de[e.column.align] : "", t = l.subThemeSlots, a = _.value && l.hoverable?.value, C = l.isColumnSorted?.(e.column) && t ? t.tdSorted() : "", R = f.value && t ? m(t.tdSelected(), a ? t.tdRowSelectedHover() : "") : "", p = a && t && !f.value ? t.tdRowHover() : "";
|
|
102
|
+
return m(
|
|
103
|
+
e.tdClass,
|
|
104
|
+
n,
|
|
105
|
+
e.column.className,
|
|
106
|
+
o.value.customCellProps?.class,
|
|
107
|
+
o.value.customCellProps?.className,
|
|
108
|
+
o.value.renderCellProps?.class,
|
|
109
|
+
o.value.renderCellProps?.className,
|
|
110
|
+
C,
|
|
111
|
+
R,
|
|
112
|
+
p,
|
|
113
|
+
T.value,
|
|
114
|
+
// antdv 把 ellipsis 类放在 td 上,我们的 slot 落在内层 span,故在此补
|
|
115
|
+
W.value
|
|
116
|
+
);
|
|
117
|
+
}), w = c(() => {
|
|
104
118
|
const n = {}, t = l.columnWidths?.[String(L(e.column) ?? e.colIndex)], a = e.widthOverride ?? t ?? e.column.width;
|
|
105
119
|
return a && (n.width = typeof a == "number" ? `${a}px` : a), {
|
|
106
120
|
...n,
|
|
107
|
-
...
|
|
121
|
+
...A.value ?? {},
|
|
108
122
|
...o.value.customCellProps?.style ?? {},
|
|
109
123
|
...o.value.renderCellProps?.style ?? {}
|
|
110
124
|
};
|
|
111
|
-
}),
|
|
125
|
+
}), $ = c(() => l.isTreeData?.value ? l.getFlattenRow?.(e.record) ?? null : null), G = c(() => l.isTreeData?.value && e.column.key !== "__vtg_selection__" && e.column.key !== "__vtg_expand__" && e.colIndex <= 2 ? (() => {
|
|
112
126
|
const n = l.rowSelection?.(), t = l.expandable?.();
|
|
113
127
|
let a = 0;
|
|
114
128
|
return n && (a += 1), t && t.showExpandColumn !== !1 && (a += 1), e.colIndex === a;
|
|
115
129
|
})() : !1);
|
|
116
|
-
function
|
|
130
|
+
function V(n) {
|
|
117
131
|
return {
|
|
118
132
|
...w.value,
|
|
119
133
|
...n ?? {}
|
|
120
134
|
};
|
|
121
135
|
}
|
|
122
|
-
function
|
|
136
|
+
function X() {
|
|
123
137
|
const n = H.value, t = o.value.tooltipText;
|
|
124
138
|
I.value = !!(n && t && (n.scrollWidth > n.clientWidth || n.scrollHeight > n.clientHeight));
|
|
125
139
|
}
|
|
126
|
-
function
|
|
140
|
+
function Y() {
|
|
127
141
|
I.value = !1;
|
|
128
142
|
}
|
|
129
143
|
return () => {
|
|
@@ -131,25 +145,25 @@ const Ie = /* @__PURE__ */ J({
|
|
|
131
145
|
return null;
|
|
132
146
|
const n = o.value.colSpan !== 1 ? o.value.colSpan : void 0, t = o.value.rowSpan !== 1 ? o.value.rowSpan : void 0;
|
|
133
147
|
if (e.column.key === "__vtg_selection__") {
|
|
134
|
-
const v = l.rowSelection?.(),
|
|
148
|
+
const v = l.rowSelection?.(), x = v?.type === "radio" ? r(re, {
|
|
135
149
|
checked: i.value.checked,
|
|
136
150
|
disabled: i.value.disabled,
|
|
137
|
-
onChange: (
|
|
138
|
-
}, null) : r(
|
|
151
|
+
onChange: (d) => l.toggleRow?.(e.record, e.rowIndex, d)
|
|
152
|
+
}, null) : r(se, {
|
|
139
153
|
checked: i.value.checked,
|
|
140
154
|
indeterminate: i.value.indeterminate,
|
|
141
155
|
disabled: i.value.disabled,
|
|
142
|
-
onChange: (
|
|
156
|
+
onChange: (d, y) => l.toggleRow?.(e.record, e.rowIndex, y)
|
|
143
157
|
}, null);
|
|
144
|
-
let u =
|
|
158
|
+
let u = x, s;
|
|
145
159
|
if (v?.renderCell) {
|
|
146
|
-
const
|
|
147
|
-
|
|
160
|
+
const d = v.renderCell(i.value.checked, e.record, e.rowIndex, x);
|
|
161
|
+
ae(d) ? (u = d.children, s = d.props) : u = d;
|
|
148
162
|
}
|
|
149
|
-
const b = !!v?.renderCell, g = _.value && l.hoverable?.value, M = m(e.tdClass, l.vtgClass?.(b ? "text-center" : "text-center leading-[0]"), e.column.className, s?.class, s?.className, f.value && l.subThemeSlots ? m(l.subThemeSlots.tdSelected(), g ? l.subThemeSlots.tdRowSelectedHover() : "") : g && l.subThemeSlots ? l.subThemeSlots.tdRowHover() : "", T.value);
|
|
163
|
+
const b = !!v?.renderCell, g = _.value && l.hoverable?.value, M = m(e.tdClass, l.vtgClass?.(b ? "text-center" : "text-center leading-[0]"), e.column.className, s?.class, s?.className, f.value && l.subThemeSlots ? m(l.subThemeSlots.tdSelected(), g ? l.subThemeSlots.tdRowSelectedHover() : "") : g && l.subThemeSlots ? l.subThemeSlots.tdRowHover() : "", T.value, l.compatClass?.("selection-column"));
|
|
150
164
|
return r("td", B(N(s), {
|
|
151
165
|
class: M,
|
|
152
|
-
style:
|
|
166
|
+
style: V(s?.style),
|
|
153
167
|
colspan: n,
|
|
154
168
|
rowspan: t,
|
|
155
169
|
onMouseenter: S,
|
|
@@ -157,7 +171,7 @@ const Ie = /* @__PURE__ */ J({
|
|
|
157
171
|
}), [u]);
|
|
158
172
|
}
|
|
159
173
|
if (e.column.key === "__vtg_expand__") {
|
|
160
|
-
const v = l.expandable?.(),
|
|
174
|
+
const v = l.expandable?.(), k = l.getRowKey?.(e.record, e.rowIndex), x = k !== void 0 && (l.isExpanded?.(k) ?? !1), u = l.isRowExpandable?.(e.record) ?? !1, s = l.subThemeSlots, b = _.value && l.hoverable?.value, g = l.isColumnSorted?.(e.column) && s ? s.tdSorted() : "", M = f.value && s ? m(s.tdSelected(), b ? s.tdRowSelectedHover() : "") : "", d = b && s && !f.value ? s.tdRowHover() : "", y = m(e.tdClass, l.vtgClass?.("text-center"), e.column.className, g, M, d, T.value, l.compatClass?.("row-expand-icon-cell"));
|
|
161
175
|
return v?.expandIcon ? r("td", {
|
|
162
176
|
class: y,
|
|
163
177
|
style: w.value,
|
|
@@ -166,11 +180,11 @@ const Ie = /* @__PURE__ */ J({
|
|
|
166
180
|
onMouseenter: S,
|
|
167
181
|
onMouseleave: h
|
|
168
182
|
}, [v.expandIcon({
|
|
169
|
-
expanded:
|
|
183
|
+
expanded: x,
|
|
170
184
|
record: e.record,
|
|
171
185
|
expandable: u,
|
|
172
|
-
onExpand: (
|
|
173
|
-
|
|
186
|
+
onExpand: (ue, Q) => {
|
|
187
|
+
Q.stopPropagation(), u && l.toggleExpand?.(e.record, e.rowIndex);
|
|
174
188
|
}
|
|
175
189
|
})]) : r("td", {
|
|
176
190
|
class: y,
|
|
@@ -180,7 +194,7 @@ const Ie = /* @__PURE__ */ J({
|
|
|
180
194
|
onMouseenter: S,
|
|
181
195
|
onMouseleave: h
|
|
182
196
|
}, [r(P, {
|
|
183
|
-
expanded:
|
|
197
|
+
expanded: x,
|
|
184
198
|
expandable: u,
|
|
185
199
|
variant: "row",
|
|
186
200
|
onClick: () => {
|
|
@@ -188,21 +202,21 @@ const Ie = /* @__PURE__ */ J({
|
|
|
188
202
|
}
|
|
189
203
|
}, null)]);
|
|
190
204
|
}
|
|
191
|
-
const a =
|
|
205
|
+
const a = $.value, C = G.value && a, R = C ? r("span", {
|
|
192
206
|
style: {
|
|
193
207
|
display: "inline-block",
|
|
194
208
|
width: `${a.level * (l.treeIndentSize?.value ?? 15)}px`
|
|
195
209
|
}
|
|
196
|
-
}, null) : null,
|
|
210
|
+
}, null) : null, p = C && a.hasChildren ? r(P, {
|
|
197
211
|
expanded: a.expanded,
|
|
198
212
|
expandable: !0,
|
|
199
213
|
variant: "tree",
|
|
200
214
|
onClick: () => l.toggleTreeExpand?.(e.record, e.rowIndex)
|
|
201
|
-
}, null) :
|
|
215
|
+
}, null) : C ? r(P, {
|
|
202
216
|
expanded: !1,
|
|
203
217
|
expandable: !1,
|
|
204
218
|
variant: "tree"
|
|
205
|
-
}, null) : null, O =
|
|
219
|
+
}, null) : null, O = D(e.column), J = O.enabled ? O.showTitle ? r(ee, {
|
|
206
220
|
block: !0,
|
|
207
221
|
title: o.value.tooltipText,
|
|
208
222
|
placement: "top",
|
|
@@ -211,23 +225,23 @@ const Ie = /* @__PURE__ */ J({
|
|
|
211
225
|
default: () => [r("div", {
|
|
212
226
|
ref: H,
|
|
213
227
|
class: e.bodyCellEllipsisClass,
|
|
214
|
-
onMouseenter:
|
|
215
|
-
onMouseleave:
|
|
228
|
+
onMouseenter: X,
|
|
229
|
+
onMouseleave: Y
|
|
216
230
|
}, [o.value.content])]
|
|
217
231
|
}) : r("div", {
|
|
218
232
|
class: e.bodyCellEllipsisClass
|
|
219
233
|
}, [o.value.content]) : o.value.content;
|
|
220
234
|
return r("td", B(E.value, {
|
|
221
|
-
class:
|
|
235
|
+
class: F.value,
|
|
222
236
|
style: w.value,
|
|
223
237
|
colspan: n,
|
|
224
238
|
rowspan: t,
|
|
225
|
-
onMouseenter:
|
|
226
|
-
onMouseleave:
|
|
227
|
-
}), [R,
|
|
239
|
+
onMouseenter: K(E.value.onMouseenter),
|
|
240
|
+
onMouseleave: z(E.value.onMouseleave)
|
|
241
|
+
}), [R, p, J]);
|
|
228
242
|
};
|
|
229
243
|
}
|
|
230
244
|
});
|
|
231
245
|
export {
|
|
232
|
-
|
|
246
|
+
Te as default
|
|
233
247
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,QAAQ,EACd,MAAM,KAAK,CAAA;AAOZ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;;;cAuBzC,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,
|
|
1
|
+
{"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableHeaderCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,QAAQ,EACd,MAAM,KAAK,CAAA;AAOZ,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;;;cAuBzC,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,wBA4uBE"}
|
|
@@ -16,7 +16,7 @@ import ol from "./SelectionCheckbox.mjs";
|
|
|
16
16
|
import nl from "./SelectionDropdown.mjs";
|
|
17
17
|
import rl from "./ResizeHandle.mjs";
|
|
18
18
|
import { TABLE_ALIGN_CLASSES as sl } from "../../../theme/src/presets/antdv/table.mjs";
|
|
19
|
-
import { cn as
|
|
19
|
+
import { cn as C } from "tailwind-variants";
|
|
20
20
|
function al(t) {
|
|
21
21
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Be(t);
|
|
22
22
|
}
|
|
@@ -105,7 +105,7 @@ const Il = /* @__PURE__ */ Re({
|
|
|
105
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], g = J(r) ?? t.cell.colStart, s = J(u) ?? t.cell.colEnd, x = e.fixedOffsets?.value?.get(g), 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
|
|
@@ -140,8 +140,8 @@ const Il = /* @__PURE__ */ Re({
|
|
|
140
140
|
}
|
|
141
141
|
return ne.value;
|
|
142
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() : "",
|
|
144
|
-
return
|
|
143
|
+
const l = t.cell.column.align ? sl[t.cell.column.align] : "", r = I.value ? e.subThemeSlots?.thSortable() : "", u = _.value ? e.subThemeSlots?.thSorted() : "", g = o.value?.key === "__vtg_expand__";
|
|
144
|
+
return C(t.thClass, l, r, u, Se.value, t.cell.column.className, g ? e.vtgClass?.("before:hidden") : "", d.value?.class, d.value?.className, oe.value, be.value, g ? e.compatClass?.("row-expand-icon-cell") : "");
|
|
145
145
|
}), re = a(() => {
|
|
146
146
|
const l = {};
|
|
147
147
|
if (o.value) {
|
|
@@ -202,7 +202,7 @@ const Il = /* @__PURE__ */ Re({
|
|
|
202
202
|
return null;
|
|
203
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?.(), 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 =
|
|
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 = C(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, e.compatClass?.("selection-column")), fe = re.value;
|
|
206
206
|
let Y = [];
|
|
207
207
|
if (X && (n?.selections === !0 ? Y = [{
|
|
208
208
|
key: "__vtg_select_all__",
|
|
@@ -255,7 +255,7 @@ const Il = /* @__PURE__ */ Re({
|
|
|
255
255
|
onChange: (b) => e.toggleAll?.(b)
|
|
256
256
|
}, null), Ne, X && i("span", {
|
|
257
257
|
ref: M,
|
|
258
|
-
class:
|
|
258
|
+
class: C(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
|
|
259
259
|
onMouseenter: xe,
|
|
260
260
|
onMouseleave: se,
|
|
261
261
|
role: "button",
|
|
@@ -270,17 +270,17 @@ const Il = /* @__PURE__ */ Re({
|
|
|
270
270
|
onMouseleave: se
|
|
271
271
|
}, null)]);
|
|
272
272
|
}
|
|
273
|
-
const u = e.locale?.value,
|
|
273
|
+
const u = e.locale?.value, g = _.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", {
|
|
274
274
|
class: x
|
|
275
275
|
}, [i("span", {
|
|
276
|
-
class:
|
|
276
|
+
class: C(D, we.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
|
|
277
277
|
}, [_e.value]), I.value && i(el, {
|
|
278
278
|
sortOrder: _.value
|
|
279
279
|
}, null)]), ae = e.subThemeSlots?.sortAreaOuter(), Me = F.value ? i("span", {
|
|
280
280
|
class: ae
|
|
281
281
|
}, [i(We, {
|
|
282
282
|
block: !0,
|
|
283
|
-
title:
|
|
283
|
+
title: g,
|
|
284
284
|
placement: "top",
|
|
285
285
|
open: Ie.value
|
|
286
286
|
}, al(p) ? p : {
|
|
@@ -288,7 +288,7 @@ const Il = /* @__PURE__ */ Re({
|
|
|
288
288
|
})]) : i("span", {
|
|
289
289
|
class: ae
|
|
290
290
|
}, [p]), Ee = s && (s.filterIcon ? i("span", {
|
|
291
|
-
class:
|
|
291
|
+
class: C(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
|
|
292
292
|
ref: m,
|
|
293
293
|
onMouseenter: q,
|
|
294
294
|
onMouseleave: z,
|
|
@@ -301,7 +301,7 @@ const Il = /* @__PURE__ */ Re({
|
|
|
301
301
|
}, [s.filterIcon({
|
|
302
302
|
filtered: P.value
|
|
303
303
|
})]) : e.customFilterIcon ? i("span", {
|
|
304
|
-
class:
|
|
304
|
+
class: C(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
|
|
305
305
|
ref: m,
|
|
306
306
|
onMouseenter: q,
|
|
307
307
|
onMouseleave: z,
|
|
@@ -381,7 +381,7 @@ const Il = /* @__PURE__ */ Re({
|
|
|
381
381
|
onMouseleave: Le,
|
|
382
382
|
"aria-sort": o.value ? il(_.value) : void 0
|
|
383
383
|
}), [i("span", {
|
|
384
|
-
class:
|
|
384
|
+
class: C(e.vtgClass?.("flex items-center"), t.headerCellInnerClass)
|
|
385
385
|
}, [Me, N.value && Ee]), N.value && ke, o.value?.resizable && i(rl, {
|
|
386
386
|
column: o.value,
|
|
387
387
|
colIndex: t.cell.colStart
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VTableCompatClass.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableCompatClass.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTableBody.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VirtualTableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,KAAK,CAAA;AAElD,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAMpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"VirtualTableBody.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VirtualTableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,KAAK,CAAA;AAElD,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAMpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAG/C,KAAK,sBAAsB,GAAG,iBAAiB,GAAG;IAChD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;;;cAQgC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAO3C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;;cAEhC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;;;;;;;;;;;IAK3F,wCAAwC;;;;;IAExC;;;OAGG;;;;;IAEH,qCAAqC;;cACJ,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC;;;IAC/D,gEAAgE;;cAE5C,QAAQ,CAAC,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;;;;cAIvC,QAAQ,CAAC,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;;;;;cA9BxC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAO3C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;;cAEhC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;;;;;;;;;;;IAK3F,wCAAwC;;;;;IAExC;;;OAGG;;;;;IAEH,qCAAqC;;cACJ,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC;;;IAC/D,gEAAgE;;cAE5C,QAAQ,CAAC,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;;;;cAIvC,QAAQ,CAAC,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;;;;;4BAJjC,sBAAsB,KAAK,IAAI;+BAhBT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG;;;;;;AAb7F,wBAuYE"}
|