@vtable-guild/vtable-guild 2.6.0 → 2.6.2
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/core/src/components/VirtualList/hooks/useChildren.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useChildren.mjs +8 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +38 -34
- package/dist/index.full.mjs +2361 -2319
- package/dist/table/src/components/ColGroup.d.ts.map +1 -1
- package/dist/table/src/components/ColGroup.mjs +11 -10
- package/dist/table/src/components/FilterIcon.d.ts.map +1 -1
- package/dist/table/src/components/FilterIcon.mjs +10 -10
- package/dist/table/src/components/ResizeHandle.d.ts.map +1 -1
- package/dist/table/src/components/ResizeHandle.mjs +14 -11
- package/dist/table/src/components/SortButton.d.ts.map +1 -1
- package/dist/table/src/components/SortButton.mjs +18 -13
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +271 -266
- package/dist/table/src/components/TableBody.d.ts.map +1 -1
- package/dist/table/src/components/TableBody.mjs +44 -42
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +85 -83
- package/dist/table/src/components/TableEmpty.mjs +10 -8
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +89 -89
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +64 -62
- package/dist/table/src/composables/useVirtual.d.ts.map +1 -1
- package/dist/table/src/composables/useVirtual.mjs +10 -10
- package/dist/table/src/utils/compat.d.ts +9 -1
- package/dist/table/src/utils/compat.d.ts.map +1 -1
- package/dist/table/src/utils/compat.mjs +24 -20
- package/dist/theme/src/compat/antdv-table.d.ts.map +1 -1
- package/dist/theme/src/compat/antdv-table.mjs +14 -8
- 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;;;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,
|
|
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,wBAyKE"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, inject as b, computed as h, createVNode as i } 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 { getRowCompatClass as N } from "../utils/compat.mjs";
|
|
9
|
-
import { getByDataIndex as
|
|
8
|
+
import { getRowCompatClass as N, getExpandedRowCompatClass as q } from "../utils/compat.mjs";
|
|
9
|
+
import { getByDataIndex as B } from "../composables/useColumns.mjs";
|
|
10
10
|
import { cn as p } from "tailwind-variants";
|
|
11
11
|
function R(e) {
|
|
12
12
|
return Number.isFinite(e) ? e <= 0 ? 0 : Math.floor(e) : 1;
|
|
13
13
|
}
|
|
14
|
-
const L = /* @__PURE__ */
|
|
14
|
+
const L = /* @__PURE__ */ S({
|
|
15
15
|
name: "TableBody",
|
|
16
16
|
props: {
|
|
17
17
|
dataSource: {
|
|
@@ -48,72 +48,74 @@ const L = /* @__PURE__ */ b({
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
setup(e) {
|
|
51
|
-
const
|
|
52
|
-
function g(t,
|
|
53
|
-
return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] :
|
|
51
|
+
const a = b(k, {});
|
|
52
|
+
function g(t, l) {
|
|
53
|
+
return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] : l;
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const x = h(() => {
|
|
56
56
|
const t = /* @__PURE__ */ new Set();
|
|
57
|
-
return e.dataSource.map((
|
|
58
|
-
const
|
|
57
|
+
return e.dataSource.map((l, s) => {
|
|
58
|
+
const o = [];
|
|
59
59
|
return e.columns.forEach((C, r) => {
|
|
60
|
-
const c = `${
|
|
60
|
+
const c = `${s}:${r}`;
|
|
61
61
|
if (t.has(c)) return;
|
|
62
62
|
const y = K({
|
|
63
|
-
text:
|
|
64
|
-
record:
|
|
65
|
-
rowIndex:
|
|
63
|
+
text: B(l, C.dataIndex),
|
|
64
|
+
record: l,
|
|
65
|
+
rowIndex: s,
|
|
66
66
|
column: C,
|
|
67
|
-
bodyCell:
|
|
68
|
-
transformCellText:
|
|
69
|
-
}),
|
|
70
|
-
if (
|
|
71
|
-
const f = Math.min(e.dataSource.length,
|
|
72
|
-
for (let
|
|
67
|
+
bodyCell: a.bodyCell,
|
|
68
|
+
transformCellText: a.transformCellText
|
|
69
|
+
}), d = R(y.colSpan), u = R(y.rowSpan);
|
|
70
|
+
if (d === 0 || u === 0) return;
|
|
71
|
+
const f = Math.min(e.dataSource.length, s + u), w = Math.min(e.columns.length, r + d);
|
|
72
|
+
for (let m = s; m < f; m += 1)
|
|
73
73
|
for (let n = r; n < w; n += 1)
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
m === s && n === r || t.add(`${m}:${n}`);
|
|
75
|
+
o.push({
|
|
76
76
|
column: C,
|
|
77
77
|
colIndex: r,
|
|
78
78
|
resolvedCell: {
|
|
79
79
|
...y,
|
|
80
|
-
colSpan:
|
|
81
|
-
rowSpan:
|
|
80
|
+
colSpan: d,
|
|
81
|
+
rowSpan: u
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
-
}),
|
|
84
|
+
}), o;
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
-
return () =>
|
|
87
|
+
return () => i("tbody", {
|
|
88
88
|
class: e.tbodyClass
|
|
89
|
-
}, [e.dataSource.length > 0 ? e.dataSource.map((t,
|
|
90
|
-
const
|
|
91
|
-
c &&
|
|
89
|
+
}, [e.dataSource.length > 0 ? e.dataSource.map((t, l) => {
|
|
90
|
+
const s = g(t, l), o = a.expandable?.(), C = a.isExpanded?.(s) ?? !1, r = o?.expandRowByClick ?? !1, c = a.isRowExpandable?.(t) ?? !1, d = (a.isTreeData?.value ? a.getFlattenRow?.(t) : void 0)?.level ?? 0, u = a.getRowClassName?.(t, l), f = a.getRowProps?.(t, l), w = typeof o?.expandedRowClassName == "function" ? o.expandedRowClassName(t, l, d) : o?.expandedRowClassName, m = r ? () => {
|
|
91
|
+
c && a.toggleExpand?.(t, l);
|
|
92
92
|
} : void 0;
|
|
93
|
-
return [
|
|
94
|
-
key:
|
|
95
|
-
rowClass: p(e.rowClass,
|
|
93
|
+
return [i(E, {
|
|
94
|
+
key: s,
|
|
95
|
+
rowClass: p(e.rowClass, u, N(a, t, l, d)) ?? "",
|
|
96
96
|
rowProps: f,
|
|
97
|
-
onClick:
|
|
97
|
+
onClick: m
|
|
98
98
|
}, {
|
|
99
|
-
default: () => [
|
|
99
|
+
default: () => [x.value[l]?.map((n) => i(T, {
|
|
100
100
|
key: n.column.key ?? String(n.column.dataIndex ?? n.colIndex),
|
|
101
101
|
record: t,
|
|
102
|
-
rowIndex:
|
|
102
|
+
rowIndex: l,
|
|
103
103
|
column: n.column,
|
|
104
104
|
colIndex: n.colIndex,
|
|
105
105
|
resolvedCell: n.resolvedCell,
|
|
106
106
|
tdClass: e.tdClass,
|
|
107
107
|
bodyCellEllipsisClass: e.bodyCellEllipsisClass
|
|
108
108
|
}, null))]
|
|
109
|
-
}), C &&
|
|
110
|
-
key: `${
|
|
111
|
-
class: p(e.rowClass,
|
|
112
|
-
}, [
|
|
109
|
+
}), C && o?.expandedRowRender && i("tr", {
|
|
110
|
+
key: `${s}-expanded`,
|
|
111
|
+
class: p(e.rowClass, u, a.subThemeSlots?.expandedRow(), q(a, d), w)
|
|
112
|
+
}, [i("td", {
|
|
113
113
|
colspan: e.columns.length,
|
|
114
|
-
class: p(e.tdClass,
|
|
115
|
-
}, [
|
|
116
|
-
|
|
114
|
+
class: p(e.tdClass, a.subThemeSlots?.expandedRowCell())
|
|
115
|
+
}, [a.compatClass && (a.fixedOffsets?.value?.size ?? 0) > 0 ? i("div", {
|
|
116
|
+
class: a.compatClass("expanded-row-fixed")
|
|
117
|
+
}, [o.expandedRowRender(t, l, 0, !0)]) : o.expandedRowRender(t, l, 0, !0)])])];
|
|
118
|
+
}) : i(v, {
|
|
117
119
|
colSpan: e.columns.length || 1,
|
|
118
120
|
emptyClass: e.emptyClass,
|
|
119
121
|
tdClass: e.tdClass
|
|
@@ -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,wBA2bE"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ee, inject as le, ref as B, computed as r, createVNode as c, mergeProps as L } 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
|
|
10
|
-
import
|
|
11
|
-
import { isInHoverRange as
|
|
12
|
-
import { TABLE_ALIGN_CLASSES as
|
|
3
|
+
import ne from "../../../core/src/components/Tooltip.mjs";
|
|
4
|
+
import { TABLE_CONTEXT_KEY as te } from "../context.mjs";
|
|
5
|
+
import { getByDataIndex as oe, getColumnKey as A } from "../composables/useColumns.mjs";
|
|
6
|
+
import { useFixedColumnStyle as ae } from "../composables/useFixedColumnStyle.mjs";
|
|
7
|
+
import { resolveBodyCell as se, getEllipsisConfig as D, omitCellProps as P, isRenderedCell as ce } from "../utils/cell.mjs";
|
|
8
|
+
import re from "./SelectionCheckbox.mjs";
|
|
9
|
+
import de from "./SelectionRadio.mjs";
|
|
10
|
+
import H from "./ExpandIcon.mjs";
|
|
11
|
+
import { isInHoverRange as ue } from "../composables/useHoverState.mjs";
|
|
12
|
+
import { TABLE_ALIGN_CLASSES as ie } from "../../../theme/src/presets/antdv/table.mjs";
|
|
13
13
|
import { cn as m } from "tailwind-variants";
|
|
14
|
-
const
|
|
14
|
+
const _e = /* @__PURE__ */ ee({
|
|
15
15
|
name: "TableCell",
|
|
16
16
|
props: {
|
|
17
17
|
record: {
|
|
@@ -55,50 +55,50 @@ const Te = /* @__PURE__ */ U({
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
setup(e) {
|
|
58
|
-
const l =
|
|
59
|
-
text:
|
|
58
|
+
const l = le(te, {}), O = B(null), T = B(!1), o = r(() => e.resolvedCell ?? se({
|
|
59
|
+
text: oe(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
|
-
})), j =
|
|
65
|
+
})), j = r(() => {
|
|
66
66
|
if (!e.column.fixed) return null;
|
|
67
|
-
const n =
|
|
67
|
+
const n = A(e.column) ?? e.colIndex;
|
|
68
68
|
return l.fixedOffsets?.value?.get(n) ?? null;
|
|
69
69
|
}), {
|
|
70
|
-
fixedStyle:
|
|
71
|
-
fixedClass:
|
|
72
|
-
} =
|
|
70
|
+
fixedStyle: W,
|
|
71
|
+
fixedClass: p
|
|
72
|
+
} = ae({
|
|
73
73
|
fixedInfo: () => j.value
|
|
74
|
-
}),
|
|
74
|
+
}), $ = r(() => D(e.column).enabled ? l.compatClass?.("cell-ellipsis") ?? "" : ""), i = r(() => l.getSelectionState?.(e.record, e.rowIndex) ?? {
|
|
75
75
|
checked: !1,
|
|
76
76
|
indeterminate: !1,
|
|
77
77
|
disabled: !1
|
|
78
|
-
}), f =
|
|
79
|
-
function
|
|
78
|
+
}), f = r(() => i.value.checked), h = r(() => ue(e.rowIndex, o.value.rowSpan ?? 1, l.hoverRange?.value ?? null)), _ = r(() => h.value && l.hoverable?.value ? l.compatClass?.("cell-row-hover") ?? "" : "");
|
|
79
|
+
function w() {
|
|
80
80
|
if (!l.hoverable?.value) return;
|
|
81
81
|
const n = Math.max(1, o.value.rowSpan ?? 1);
|
|
82
82
|
l.setHoverRange?.(e.rowIndex, e.rowIndex + n - 1);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function S() {
|
|
85
85
|
l.hoverable?.value && l.clearHoverRange?.();
|
|
86
86
|
}
|
|
87
87
|
function K(n) {
|
|
88
88
|
return (t) => {
|
|
89
|
-
|
|
89
|
+
w(), typeof n == "function" && n(t);
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
function z(n) {
|
|
93
93
|
return (t) => {
|
|
94
|
-
|
|
94
|
+
S(), typeof n == "function" && n(t);
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
const E =
|
|
98
|
-
...
|
|
99
|
-
...
|
|
100
|
-
})), F =
|
|
101
|
-
const n = e.column.align ?
|
|
97
|
+
const E = r(() => ({
|
|
98
|
+
...P(o.value.renderCellProps),
|
|
99
|
+
...P(o.value.customCellProps)
|
|
100
|
+
})), F = r(() => {
|
|
101
|
+
const n = e.column.align ? ie[e.column.align] : "", t = l.subThemeSlots, a = h.value && l.hoverable?.value, C = l.isColumnSorted?.(e.column) && t ? t.tdSorted() : "", R = f.value && t ? m(t.tdSelected(), a ? t.tdRowSelectedHover() : "") : "", k = a && t && !f.value ? t.tdRowHover() : "";
|
|
102
102
|
return m(
|
|
103
103
|
e.tdClass,
|
|
104
104
|
n,
|
|
@@ -109,91 +109,92 @@ const Te = /* @__PURE__ */ U({
|
|
|
109
109
|
o.value.renderCellProps?.className,
|
|
110
110
|
C,
|
|
111
111
|
R,
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
k,
|
|
113
|
+
p.value,
|
|
114
|
+
_.value,
|
|
114
115
|
// antdv 把 ellipsis 类放在 td 上,我们的 slot 落在内层 span,故在此补
|
|
115
|
-
|
|
116
|
+
$.value
|
|
116
117
|
);
|
|
117
|
-
}),
|
|
118
|
-
const n = {}, t = l.columnWidths?.[String(
|
|
118
|
+
}), b = r(() => {
|
|
119
|
+
const n = {}, t = l.columnWidths?.[String(A(e.column) ?? e.colIndex)], a = e.widthOverride ?? t ?? e.column.width;
|
|
119
120
|
return a && (n.width = typeof a == "number" ? `${a}px` : a), {
|
|
120
121
|
...n,
|
|
121
|
-
...
|
|
122
|
+
...W.value ?? {},
|
|
122
123
|
...o.value.customCellProps?.style ?? {},
|
|
123
124
|
...o.value.renderCellProps?.style ?? {}
|
|
124
125
|
};
|
|
125
|
-
}),
|
|
126
|
+
}), G = r(() => l.isTreeData?.value ? l.getFlattenRow?.(e.record) ?? null : null), V = r(() => l.isTreeData?.value && e.column.key !== "__vtg_selection__" && e.column.key !== "__vtg_expand__" && e.colIndex <= 2 ? (() => {
|
|
126
127
|
const n = l.rowSelection?.(), t = l.expandable?.();
|
|
127
128
|
let a = 0;
|
|
128
129
|
return n && (a += 1), t && t.showExpandColumn !== !1 && (a += 1), e.colIndex === a;
|
|
129
130
|
})() : !1);
|
|
130
|
-
function
|
|
131
|
+
function X(n) {
|
|
131
132
|
return {
|
|
132
|
-
...
|
|
133
|
+
...b.value,
|
|
133
134
|
...n ?? {}
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
|
-
function X() {
|
|
137
|
-
const n = H.value, t = o.value.tooltipText;
|
|
138
|
-
I.value = !!(n && t && (n.scrollWidth > n.clientWidth || n.scrollHeight > n.clientHeight));
|
|
139
|
-
}
|
|
140
137
|
function Y() {
|
|
141
|
-
|
|
138
|
+
const n = O.value, t = o.value.tooltipText;
|
|
139
|
+
T.value = !!(n && t && (n.scrollWidth > n.clientWidth || n.scrollHeight > n.clientHeight));
|
|
140
|
+
}
|
|
141
|
+
function J() {
|
|
142
|
+
T.value = !1;
|
|
142
143
|
}
|
|
143
144
|
return () => {
|
|
144
145
|
if (o.value.colSpan === 0 || o.value.rowSpan === 0)
|
|
145
146
|
return null;
|
|
146
147
|
const n = o.value.colSpan !== 1 ? o.value.colSpan : void 0, t = o.value.rowSpan !== 1 ? o.value.rowSpan : void 0;
|
|
147
148
|
if (e.column.key === "__vtg_selection__") {
|
|
148
|
-
const v = l.rowSelection?.(), x = v?.type === "radio" ?
|
|
149
|
+
const v = l.rowSelection?.(), x = v?.type === "radio" ? c(de, {
|
|
149
150
|
checked: i.value.checked,
|
|
150
151
|
disabled: i.value.disabled,
|
|
151
152
|
onChange: (d) => l.toggleRow?.(e.record, e.rowIndex, d)
|
|
152
|
-
}, null) :
|
|
153
|
+
}, null) : c(re, {
|
|
153
154
|
checked: i.value.checked,
|
|
154
155
|
indeterminate: i.value.indeterminate,
|
|
155
156
|
disabled: i.value.disabled,
|
|
156
|
-
onChange: (d,
|
|
157
|
+
onChange: (d, I) => l.toggleRow?.(e.record, e.rowIndex, I)
|
|
157
158
|
}, null);
|
|
158
159
|
let u = x, s;
|
|
159
160
|
if (v?.renderCell) {
|
|
160
161
|
const d = v.renderCell(i.value.checked, e.record, e.rowIndex, x);
|
|
161
|
-
|
|
162
|
+
ce(d) ? (u = d.children, s = d.props) : u = d;
|
|
162
163
|
}
|
|
163
|
-
const
|
|
164
|
-
return
|
|
165
|
-
class:
|
|
166
|
-
style:
|
|
164
|
+
const g = !!v?.renderCell, y = h.value && l.hoverable?.value, N = m(e.tdClass, l.vtgClass?.(g ? "text-center" : "text-center leading-[0]"), e.column.className, s?.class, s?.className, f.value && l.subThemeSlots ? m(l.subThemeSlots.tdSelected(), y ? l.subThemeSlots.tdRowSelectedHover() : "") : y && l.subThemeSlots ? l.subThemeSlots.tdRowHover() : "", p.value, _.value, l.compatClass?.("selection-column"));
|
|
165
|
+
return c("td", L(P(s), {
|
|
166
|
+
class: N,
|
|
167
|
+
style: X(s?.style),
|
|
167
168
|
colspan: n,
|
|
168
169
|
rowspan: t,
|
|
169
|
-
onMouseenter:
|
|
170
|
-
onMouseleave:
|
|
170
|
+
onMouseenter: w,
|
|
171
|
+
onMouseleave: S
|
|
171
172
|
}), [u]);
|
|
172
173
|
}
|
|
173
174
|
if (e.column.key === "__vtg_expand__") {
|
|
174
|
-
const v = l.expandable?.(),
|
|
175
|
-
return v?.expandIcon ?
|
|
176
|
-
class:
|
|
177
|
-
style:
|
|
175
|
+
const v = l.expandable?.(), M = l.getRowKey?.(e.record, e.rowIndex), x = M !== void 0 && (l.isExpanded?.(M) ?? !1), u = l.isRowExpandable?.(e.record) ?? !1, s = l.subThemeSlots, g = h.value && l.hoverable?.value, y = l.isColumnSorted?.(e.column) && s ? s.tdSorted() : "", N = f.value && s ? m(s.tdSelected(), g ? s.tdRowSelectedHover() : "") : "", d = g && s && !f.value ? s.tdRowHover() : "", I = m(e.tdClass, l.vtgClass?.("text-center"), e.column.className, y, N, d, p.value, _.value, l.compatClass?.("row-expand-icon-cell"));
|
|
176
|
+
return v?.expandIcon ? c("td", {
|
|
177
|
+
class: I,
|
|
178
|
+
style: b.value,
|
|
178
179
|
colspan: n,
|
|
179
180
|
rowspan: t,
|
|
180
|
-
onMouseenter:
|
|
181
|
-
onMouseleave:
|
|
181
|
+
onMouseenter: w,
|
|
182
|
+
onMouseleave: S
|
|
182
183
|
}, [v.expandIcon({
|
|
183
184
|
expanded: x,
|
|
184
185
|
record: e.record,
|
|
185
186
|
expandable: u,
|
|
186
|
-
onExpand: (
|
|
187
|
-
|
|
187
|
+
onExpand: (ve, Z) => {
|
|
188
|
+
Z.stopPropagation(), u && l.toggleExpand?.(e.record, e.rowIndex);
|
|
188
189
|
}
|
|
189
|
-
})]) :
|
|
190
|
-
class:
|
|
191
|
-
style:
|
|
190
|
+
})]) : c("td", {
|
|
191
|
+
class: I,
|
|
192
|
+
style: b.value,
|
|
192
193
|
colspan: n,
|
|
193
194
|
rowspan: t,
|
|
194
|
-
onMouseenter:
|
|
195
|
-
onMouseleave:
|
|
196
|
-
}, [
|
|
195
|
+
onMouseenter: w,
|
|
196
|
+
onMouseleave: S
|
|
197
|
+
}, [c(H, {
|
|
197
198
|
expanded: x,
|
|
198
199
|
expandable: u,
|
|
199
200
|
variant: "row",
|
|
@@ -202,46 +203,47 @@ const Te = /* @__PURE__ */ U({
|
|
|
202
203
|
}
|
|
203
204
|
}, null)]);
|
|
204
205
|
}
|
|
205
|
-
const a =
|
|
206
|
+
const a = G.value, C = V.value && a, R = C ? c("span", {
|
|
207
|
+
class: l.compatClass ? `${l.compatClass("row-indent")} indent-level-${a.level}` : void 0,
|
|
206
208
|
style: {
|
|
207
209
|
display: "inline-block",
|
|
208
210
|
width: `${a.level * (l.treeIndentSize?.value ?? 15)}px`
|
|
209
211
|
}
|
|
210
|
-
}, null) : null,
|
|
212
|
+
}, null) : null, k = C && a.hasChildren ? c(H, {
|
|
211
213
|
expanded: a.expanded,
|
|
212
214
|
expandable: !0,
|
|
213
215
|
variant: "tree",
|
|
214
216
|
onClick: () => l.toggleTreeExpand?.(e.record, e.rowIndex)
|
|
215
|
-
}, null) : C ?
|
|
217
|
+
}, null) : C ? c(H, {
|
|
216
218
|
expanded: !1,
|
|
217
219
|
expandable: !1,
|
|
218
220
|
variant: "tree"
|
|
219
|
-
}, null) : null,
|
|
221
|
+
}, null) : null, q = D(e.column), Q = C ? l.compatClass?.("cell-with-append") ?? "" : "", U = q.enabled ? q.showTitle ? c(ne, {
|
|
220
222
|
block: !0,
|
|
221
223
|
title: o.value.tooltipText,
|
|
222
224
|
placement: "top",
|
|
223
|
-
open:
|
|
225
|
+
open: T.value
|
|
224
226
|
}, {
|
|
225
|
-
default: () => [
|
|
226
|
-
ref:
|
|
227
|
+
default: () => [c("div", {
|
|
228
|
+
ref: O,
|
|
227
229
|
class: e.bodyCellEllipsisClass,
|
|
228
|
-
onMouseenter:
|
|
229
|
-
onMouseleave:
|
|
230
|
+
onMouseenter: Y,
|
|
231
|
+
onMouseleave: J
|
|
230
232
|
}, [o.value.content])]
|
|
231
|
-
}) :
|
|
233
|
+
}) : c("div", {
|
|
232
234
|
class: e.bodyCellEllipsisClass
|
|
233
235
|
}, [o.value.content]) : o.value.content;
|
|
234
|
-
return
|
|
235
|
-
class: F.value,
|
|
236
|
-
style:
|
|
236
|
+
return c("td", L(E.value, {
|
|
237
|
+
class: m(F.value, Q),
|
|
238
|
+
style: b.value,
|
|
237
239
|
colspan: n,
|
|
238
240
|
rowspan: t,
|
|
239
241
|
onMouseenter: K(E.value.onMouseenter),
|
|
240
242
|
onMouseleave: z(E.value.onMouseleave)
|
|
241
|
-
}), [R,
|
|
243
|
+
}), [R, k, U]);
|
|
242
244
|
};
|
|
243
245
|
}
|
|
244
246
|
});
|
|
245
247
|
export {
|
|
246
|
-
|
|
248
|
+
_e as default
|
|
247
249
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as r, inject as a, createVNode as t, h as l, resolveDynamicComponent as n } from "vue";
|
|
2
2
|
import { TABLE_CONTEXT_KEY as m } from "../context.mjs";
|
|
3
|
-
const
|
|
3
|
+
const u = /* @__PURE__ */ r({
|
|
4
4
|
name: "TableEmpty",
|
|
5
5
|
props: {
|
|
6
6
|
colSpan: {
|
|
@@ -17,22 +17,24 @@ const y = /* @__PURE__ */ n({
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
setup(s) {
|
|
20
|
-
const e =
|
|
20
|
+
const e = a(m, {});
|
|
21
21
|
return () => {
|
|
22
|
-
const p = e.subThemeSlots,
|
|
23
|
-
return t("tr",
|
|
22
|
+
const p = e.subThemeSlots, o = e.presetConfig?.value;
|
|
23
|
+
return t("tr", {
|
|
24
|
+
class: e.compatClass?.("placeholder")
|
|
25
|
+
}, [t("td", {
|
|
24
26
|
class: [s.tdClass, s.emptyClass],
|
|
25
27
|
colspan: s.colSpan
|
|
26
28
|
}, [e.empty ? e.empty() : t("div", {
|
|
27
29
|
class: p?.emptyWrapper()
|
|
28
|
-
}, [
|
|
30
|
+
}, [o?.emptyIcon && t("div", {
|
|
29
31
|
class: p?.emptyIcon()
|
|
30
|
-
}, [l(
|
|
32
|
+
}, [l(n(o.emptyIcon))]), t("p", {
|
|
31
33
|
class: p?.emptyText()
|
|
32
34
|
}, [e.locale?.value.empty.text ?? "暂无数据"])])])]);
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
export {
|
|
37
|
-
|
|
39
|
+
u as default
|
|
38
40
|
};
|
|
@@ -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,wBAwvBE"}
|