@vtable-guild/vtable-guild 2.5.0 → 2.6.1
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 +3018 -2865
- package/dist/index.mjs +39 -37
- 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 +6 -6
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +288 -274
- package/dist/table/src/components/TableBody.d.ts.map +1 -1
- package/dist/table/src/components/TableBody.mjs +53 -50
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +107 -91
- 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 +93 -93
- 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 +63 -60
- 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 +17 -0
- package/dist/table/src/utils/compat.d.ts.map +1 -0
- package/dist/table/src/utils/compat.mjs +32 -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 +57 -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,wBAyKE"}
|
|
@@ -1,16 +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 {
|
|
9
|
-
import {
|
|
10
|
-
|
|
8
|
+
import { getRowCompatClass as N, getExpandedRowCompatClass as q } from "../utils/compat.mjs";
|
|
9
|
+
import { getByDataIndex as B } 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__ */ S({
|
|
14
15
|
name: "TableBody",
|
|
15
16
|
props: {
|
|
16
17
|
dataSource: {
|
|
@@ -47,72 +48,74 @@ const j = /* @__PURE__ */ b({
|
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
setup(e) {
|
|
50
|
-
const a =
|
|
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 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;
|
|
53
54
|
}
|
|
54
|
-
const
|
|
55
|
+
const x = h(() => {
|
|
55
56
|
const t = /* @__PURE__ */ new Set();
|
|
56
|
-
return e.dataSource.map((
|
|
57
|
-
const
|
|
58
|
-
return e.columns.forEach((
|
|
59
|
-
const c = `${
|
|
57
|
+
return e.dataSource.map((l, s) => {
|
|
58
|
+
const o = [];
|
|
59
|
+
return e.columns.forEach((C, r) => {
|
|
60
|
+
const c = `${s}:${r}`;
|
|
60
61
|
if (t.has(c)) return;
|
|
61
62
|
const y = K({
|
|
62
|
-
text:
|
|
63
|
-
record:
|
|
64
|
-
rowIndex:
|
|
65
|
-
column:
|
|
63
|
+
text: B(l, C.dataIndex),
|
|
64
|
+
record: l,
|
|
65
|
+
rowIndex: s,
|
|
66
|
+
column: C,
|
|
66
67
|
bodyCell: a.bodyCell,
|
|
67
68
|
transformCellText: a.transformCellText
|
|
68
|
-
}),
|
|
69
|
-
if (
|
|
70
|
-
const f = Math.min(e.dataSource.length,
|
|
71
|
-
for (let
|
|
72
|
-
for (let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
column:
|
|
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
|
+
for (let n = r; n < w; n += 1)
|
|
74
|
+
m === s && n === r || t.add(`${m}:${n}`);
|
|
75
|
+
o.push({
|
|
76
|
+
column: C,
|
|
76
77
|
colIndex: r,
|
|
77
78
|
resolvedCell: {
|
|
78
79
|
...y,
|
|
79
|
-
colSpan:
|
|
80
|
-
rowSpan:
|
|
80
|
+
colSpan: d,
|
|
81
|
+
rowSpan: u
|
|
81
82
|
}
|
|
82
83
|
});
|
|
83
|
-
}),
|
|
84
|
+
}), o;
|
|
84
85
|
});
|
|
85
86
|
});
|
|
86
|
-
return () =>
|
|
87
|
+
return () => i("tbody", {
|
|
87
88
|
class: e.tbodyClass
|
|
88
|
-
}, [e.dataSource.length > 0 ? e.dataSource.map((t,
|
|
89
|
-
const
|
|
90
|
-
c && a.toggleExpand?.(t,
|
|
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);
|
|
91
92
|
} : void 0;
|
|
92
|
-
return [
|
|
93
|
-
key:
|
|
94
|
-
rowClass:
|
|
93
|
+
return [i(E, {
|
|
94
|
+
key: s,
|
|
95
|
+
rowClass: p(e.rowClass, u, N(a, t, l, d)) ?? "",
|
|
95
96
|
rowProps: f,
|
|
96
|
-
onClick:
|
|
97
|
+
onClick: m
|
|
97
98
|
}, {
|
|
98
|
-
default: () => [
|
|
99
|
-
key:
|
|
99
|
+
default: () => [x.value[l]?.map((n) => i(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: l,
|
|
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
|
-
key: `${
|
|
110
|
-
class:
|
|
111
|
-
}, [
|
|
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", {
|
|
112
113
|
colspan: e.columns.length,
|
|
113
|
-
class:
|
|
114
|
-
}, [
|
|
115
|
-
|
|
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, {
|
|
116
119
|
colSpan: e.columns.length || 1,
|
|
117
120
|
emptyClass: e.emptyClass,
|
|
118
121
|
tdClass: e.tdClass
|
|
@@ -120,5 +123,5 @@ const j = /* @__PURE__ */ b({
|
|
|
120
123
|
}
|
|
121
124
|
});
|
|
122
125
|
export {
|
|
123
|
-
|
|
126
|
+
L as default
|
|
124
127
|
};
|
|
@@ -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,132 +55,147 @@ const Ie = /* @__PURE__ */ J({
|
|
|
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
|
-
})),
|
|
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
|
-
} =
|
|
73
|
-
fixedInfo: () =>
|
|
74
|
-
}), i =
|
|
70
|
+
fixedStyle: W,
|
|
71
|
+
fixedClass: p
|
|
72
|
+
} = ae({
|
|
73
|
+
fixedInfo: () => j.value
|
|
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
|
-
function
|
|
87
|
+
function K(n) {
|
|
88
88
|
return (t) => {
|
|
89
|
-
|
|
89
|
+
w(), typeof n == "function" && n(t);
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
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
|
-
})),
|
|
101
|
-
const n = e.column.align ?
|
|
102
|
-
return m(
|
|
103
|
-
|
|
104
|
-
|
|
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
|
+
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
|
+
k,
|
|
113
|
+
p.value,
|
|
114
|
+
_.value,
|
|
115
|
+
// antdv 把 ellipsis 类放在 td 上,我们的 slot 落在内层 span,故在此补
|
|
116
|
+
$.value
|
|
117
|
+
);
|
|
118
|
+
}), b = r(() => {
|
|
119
|
+
const n = {}, t = l.columnWidths?.[String(A(e.column) ?? e.colIndex)], a = e.widthOverride ?? t ?? e.column.width;
|
|
105
120
|
return a && (n.width = typeof a == "number" ? `${a}px` : a), {
|
|
106
121
|
...n,
|
|
107
|
-
...
|
|
122
|
+
...W.value ?? {},
|
|
108
123
|
...o.value.customCellProps?.style ?? {},
|
|
109
124
|
...o.value.renderCellProps?.style ?? {}
|
|
110
125
|
};
|
|
111
|
-
}),
|
|
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 ? (() => {
|
|
112
127
|
const n = l.rowSelection?.(), t = l.expandable?.();
|
|
113
128
|
let a = 0;
|
|
114
129
|
return n && (a += 1), t && t.showExpandColumn !== !1 && (a += 1), e.colIndex === a;
|
|
115
130
|
})() : !1);
|
|
116
|
-
function
|
|
131
|
+
function X(n) {
|
|
117
132
|
return {
|
|
118
|
-
...
|
|
133
|
+
...b.value,
|
|
119
134
|
...n ?? {}
|
|
120
135
|
};
|
|
121
136
|
}
|
|
122
|
-
function
|
|
123
|
-
const n =
|
|
124
|
-
|
|
137
|
+
function Y() {
|
|
138
|
+
const n = O.value, t = o.value.tooltipText;
|
|
139
|
+
T.value = !!(n && t && (n.scrollWidth > n.clientWidth || n.scrollHeight > n.clientHeight));
|
|
125
140
|
}
|
|
126
|
-
function
|
|
127
|
-
|
|
141
|
+
function J() {
|
|
142
|
+
T.value = !1;
|
|
128
143
|
}
|
|
129
144
|
return () => {
|
|
130
145
|
if (o.value.colSpan === 0 || o.value.rowSpan === 0)
|
|
131
146
|
return null;
|
|
132
147
|
const n = o.value.colSpan !== 1 ? o.value.colSpan : void 0, t = o.value.rowSpan !== 1 ? o.value.rowSpan : void 0;
|
|
133
148
|
if (e.column.key === "__vtg_selection__") {
|
|
134
|
-
const v = l.rowSelection?.(),
|
|
149
|
+
const v = l.rowSelection?.(), x = v?.type === "radio" ? c(de, {
|
|
135
150
|
checked: i.value.checked,
|
|
136
151
|
disabled: i.value.disabled,
|
|
137
|
-
onChange: (
|
|
138
|
-
}, null) :
|
|
152
|
+
onChange: (d) => l.toggleRow?.(e.record, e.rowIndex, d)
|
|
153
|
+
}, null) : c(re, {
|
|
139
154
|
checked: i.value.checked,
|
|
140
155
|
indeterminate: i.value.indeterminate,
|
|
141
156
|
disabled: i.value.disabled,
|
|
142
|
-
onChange: (
|
|
157
|
+
onChange: (d, I) => l.toggleRow?.(e.record, e.rowIndex, I)
|
|
143
158
|
}, null);
|
|
144
|
-
let u =
|
|
159
|
+
let u = x, s;
|
|
145
160
|
if (v?.renderCell) {
|
|
146
|
-
const
|
|
147
|
-
|
|
161
|
+
const d = v.renderCell(i.value.checked, e.record, e.rowIndex, x);
|
|
162
|
+
ce(d) ? (u = d.children, s = d.props) : u = d;
|
|
148
163
|
}
|
|
149
|
-
const
|
|
150
|
-
return
|
|
151
|
-
class:
|
|
152
|
-
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),
|
|
153
168
|
colspan: n,
|
|
154
169
|
rowspan: t,
|
|
155
|
-
onMouseenter:
|
|
156
|
-
onMouseleave:
|
|
170
|
+
onMouseenter: w,
|
|
171
|
+
onMouseleave: S
|
|
157
172
|
}), [u]);
|
|
158
173
|
}
|
|
159
174
|
if (e.column.key === "__vtg_expand__") {
|
|
160
|
-
const v = l.expandable?.(),
|
|
161
|
-
return v?.expandIcon ?
|
|
162
|
-
class:
|
|
163
|
-
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,
|
|
164
179
|
colspan: n,
|
|
165
180
|
rowspan: t,
|
|
166
|
-
onMouseenter:
|
|
167
|
-
onMouseleave:
|
|
181
|
+
onMouseenter: w,
|
|
182
|
+
onMouseleave: S
|
|
168
183
|
}, [v.expandIcon({
|
|
169
|
-
expanded:
|
|
184
|
+
expanded: x,
|
|
170
185
|
record: e.record,
|
|
171
186
|
expandable: u,
|
|
172
|
-
onExpand: (
|
|
173
|
-
|
|
187
|
+
onExpand: (ve, Z) => {
|
|
188
|
+
Z.stopPropagation(), u && l.toggleExpand?.(e.record, e.rowIndex);
|
|
174
189
|
}
|
|
175
|
-
})]) :
|
|
176
|
-
class:
|
|
177
|
-
style:
|
|
190
|
+
})]) : c("td", {
|
|
191
|
+
class: I,
|
|
192
|
+
style: b.value,
|
|
178
193
|
colspan: n,
|
|
179
194
|
rowspan: t,
|
|
180
|
-
onMouseenter:
|
|
181
|
-
onMouseleave:
|
|
182
|
-
}, [
|
|
183
|
-
expanded:
|
|
195
|
+
onMouseenter: w,
|
|
196
|
+
onMouseleave: S
|
|
197
|
+
}, [c(H, {
|
|
198
|
+
expanded: x,
|
|
184
199
|
expandable: u,
|
|
185
200
|
variant: "row",
|
|
186
201
|
onClick: () => {
|
|
@@ -188,46 +203,47 @@ const Ie = /* @__PURE__ */ J({
|
|
|
188
203
|
}
|
|
189
204
|
}, null)]);
|
|
190
205
|
}
|
|
191
|
-
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,
|
|
192
208
|
style: {
|
|
193
209
|
display: "inline-block",
|
|
194
210
|
width: `${a.level * (l.treeIndentSize?.value ?? 15)}px`
|
|
195
211
|
}
|
|
196
|
-
}, null) : null, k =
|
|
212
|
+
}, null) : null, k = C && a.hasChildren ? c(H, {
|
|
197
213
|
expanded: a.expanded,
|
|
198
214
|
expandable: !0,
|
|
199
215
|
variant: "tree",
|
|
200
216
|
onClick: () => l.toggleTreeExpand?.(e.record, e.rowIndex)
|
|
201
|
-
}, null) :
|
|
217
|
+
}, null) : C ? c(H, {
|
|
202
218
|
expanded: !1,
|
|
203
219
|
expandable: !1,
|
|
204
220
|
variant: "tree"
|
|
205
|
-
}, null) : null,
|
|
221
|
+
}, null) : null, q = D(e.column), Q = C ? l.compatClass?.("cell-with-append") ?? "" : "", U = q.enabled ? q.showTitle ? c(ne, {
|
|
206
222
|
block: !0,
|
|
207
223
|
title: o.value.tooltipText,
|
|
208
224
|
placement: "top",
|
|
209
|
-
open:
|
|
225
|
+
open: T.value
|
|
210
226
|
}, {
|
|
211
|
-
default: () => [
|
|
212
|
-
ref:
|
|
227
|
+
default: () => [c("div", {
|
|
228
|
+
ref: O,
|
|
213
229
|
class: e.bodyCellEllipsisClass,
|
|
214
|
-
onMouseenter:
|
|
215
|
-
onMouseleave:
|
|
230
|
+
onMouseenter: Y,
|
|
231
|
+
onMouseleave: J
|
|
216
232
|
}, [o.value.content])]
|
|
217
|
-
}) :
|
|
233
|
+
}) : c("div", {
|
|
218
234
|
class: e.bodyCellEllipsisClass
|
|
219
235
|
}, [o.value.content]) : o.value.content;
|
|
220
|
-
return
|
|
221
|
-
class:
|
|
222
|
-
style:
|
|
236
|
+
return c("td", L(E.value, {
|
|
237
|
+
class: m(F.value, Q),
|
|
238
|
+
style: b.value,
|
|
223
239
|
colspan: n,
|
|
224
240
|
rowspan: t,
|
|
225
|
-
onMouseenter:
|
|
226
|
-
onMouseleave:
|
|
227
|
-
}), [R, k,
|
|
241
|
+
onMouseenter: K(E.value.onMouseenter),
|
|
242
|
+
onMouseleave: z(E.value.onMouseleave)
|
|
243
|
+
}), [R, k, U]);
|
|
228
244
|
};
|
|
229
245
|
}
|
|
230
246
|
});
|
|
231
247
|
export {
|
|
232
|
-
|
|
248
|
+
_e as default
|
|
233
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"}
|