@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.
Files changed (52) hide show
  1. package/css/style.css +3 -0
  2. package/css/tailwind3-utilities.css +3 -0
  3. package/dist/core/src/components/VTableGuildConfigProvider.d.ts.map +1 -1
  4. package/dist/core/src/components/VTableGuildConfigProvider.mjs +17 -12
  5. package/dist/core/src/composables/useTheme.d.ts +9 -1
  6. package/dist/core/src/composables/useTheme.d.ts.map +1 -1
  7. package/dist/core/src/composables/useTheme.mjs +83 -60
  8. package/dist/core/src/index.d.ts +4 -0
  9. package/dist/core/src/index.d.ts.map +1 -1
  10. package/dist/core/src/plugin/index.d.ts.map +1 -1
  11. package/dist/core/src/plugin/index.mjs +4 -3
  12. package/dist/core/src/utils/types.d.ts +3 -0
  13. package/dist/core/src/utils/types.d.ts.map +1 -1
  14. package/dist/css/style.css +3 -0
  15. package/dist/css/tailwind3-utilities.css +3 -0
  16. package/dist/index.full.mjs +3018 -2865
  17. package/dist/index.mjs +39 -37
  18. package/dist/table/src/components/ColGroup.d.ts.map +1 -1
  19. package/dist/table/src/components/ColGroup.mjs +11 -10
  20. package/dist/table/src/components/FilterIcon.d.ts.map +1 -1
  21. package/dist/table/src/components/FilterIcon.mjs +10 -10
  22. package/dist/table/src/components/ResizeHandle.d.ts.map +1 -1
  23. package/dist/table/src/components/ResizeHandle.mjs +14 -11
  24. package/dist/table/src/components/SortButton.d.ts.map +1 -1
  25. package/dist/table/src/components/SortButton.mjs +18 -13
  26. package/dist/table/src/components/Table.d.ts +6 -6
  27. package/dist/table/src/components/Table.d.ts.map +1 -1
  28. package/dist/table/src/components/Table.mjs +288 -274
  29. package/dist/table/src/components/TableBody.d.ts.map +1 -1
  30. package/dist/table/src/components/TableBody.mjs +53 -50
  31. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  32. package/dist/table/src/components/TableCell.mjs +107 -91
  33. package/dist/table/src/components/TableEmpty.mjs +10 -8
  34. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  35. package/dist/table/src/components/TableHeaderCell.mjs +93 -93
  36. package/dist/table/src/components/VTableCompatClass.test.d.ts +2 -0
  37. package/dist/table/src/components/VTableCompatClass.test.d.ts.map +1 -0
  38. package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
  39. package/dist/table/src/components/VirtualTableBody.mjs +63 -60
  40. package/dist/table/src/composables/useFixedColumnStyle.d.ts.map +1 -1
  41. package/dist/table/src/composables/useFixedColumnStyle.mjs +12 -11
  42. package/dist/table/src/context.d.ts +7 -0
  43. package/dist/table/src/context.d.ts.map +1 -1
  44. package/dist/table/src/utils/compat.d.ts +17 -0
  45. package/dist/table/src/utils/compat.d.ts.map +1 -0
  46. package/dist/table/src/utils/compat.mjs +32 -0
  47. package/dist/theme/src/compat/antdv-table.d.ts +4 -0
  48. package/dist/theme/src/compat/antdv-table.d.ts.map +1 -0
  49. package/dist/theme/src/compat/antdv-table.mjs +57 -0
  50. package/dist/theme/src/index.d.ts +2 -0
  51. package/dist/theme/src/index.d.ts.map +1 -1
  52. 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;;;cAkBd,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,wBA2JE"}
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 b, inject as x, computed as h, createVNode as u } from "vue";
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 { getByDataIndex as N } from "../composables/useColumns.mjs";
9
- import { cn as R } from "tailwind-variants";
10
- function p(e) {
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 j = /* @__PURE__ */ b({
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 = x(k, {});
51
- function g(t, n) {
52
- return typeof e.rowKey == "function" ? e.rowKey(t) : typeof e.rowKey == "string" && e.rowKey in t ? t[e.rowKey] : n;
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 S = h(() => {
55
+ const x = h(() => {
55
56
  const t = /* @__PURE__ */ new Set();
56
- return e.dataSource.map((n, o) => {
57
- const s = [];
58
- return e.columns.forEach((m, r) => {
59
- const c = `${o}:${r}`;
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: N(n, m.dataIndex),
63
- record: n,
64
- rowIndex: o,
65
- column: m,
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
- }), C = p(y.colSpan), d = p(y.rowSpan);
69
- if (C === 0 || d === 0) return;
70
- const f = Math.min(e.dataSource.length, o + d), w = Math.min(e.columns.length, r + C);
71
- for (let i = o; i < f; i += 1)
72
- for (let l = r; l < w; l += 1)
73
- i === o && l === r || t.add(`${i}:${l}`);
74
- s.push({
75
- column: m,
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: C,
80
- rowSpan: d
80
+ colSpan: d,
81
+ rowSpan: u
81
82
  }
82
83
  });
83
- }), s;
84
+ }), o;
84
85
  });
85
86
  });
86
- return () => u("tbody", {
87
+ return () => i("tbody", {
87
88
  class: e.tbodyClass
88
- }, [e.dataSource.length > 0 ? e.dataSource.map((t, n) => {
89
- const o = g(t, n), s = a.expandable?.(), m = a.isExpanded?.(o) ?? !1, r = s?.expandRowByClick ?? !1, c = a.isRowExpandable?.(t) ?? !1, C = (a.isTreeData?.value ? a.getFlattenRow?.(t) : void 0)?.level ?? 0, d = a.getRowClassName?.(t, n), f = a.getRowProps?.(t, n), w = typeof s?.expandedRowClassName == "function" ? s.expandedRowClassName(t, n, C) : s?.expandedRowClassName, i = r ? () => {
90
- c && a.toggleExpand?.(t, n);
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 [u(E, {
93
- key: o,
94
- rowClass: R(e.rowClass, d) ?? "",
93
+ return [i(E, {
94
+ key: s,
95
+ rowClass: p(e.rowClass, u, N(a, t, l, d)) ?? "",
95
96
  rowProps: f,
96
- onClick: i
97
+ onClick: m
97
98
  }, {
98
- default: () => [S.value[n]?.map((l) => u(T, {
99
- key: l.column.key ?? String(l.column.dataIndex ?? l.colIndex),
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: n,
102
- column: l.column,
103
- colIndex: l.colIndex,
104
- resolvedCell: l.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
- }), m && s?.expandedRowRender && u("tr", {
109
- key: `${o}-expanded`,
110
- class: R(e.rowClass, d, a.subThemeSlots?.expandedRow(), w)
111
- }, [u("td", {
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: R(e.tdClass, a.subThemeSlots?.expandedRowCell())
114
- }, [s.expandedRowRender(t, n, 0, !0)])])];
115
- }) : u(v, {
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
- j as default
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,wBAgaE"}
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 J, inject as Q, ref as q, computed as d, createVNode as r, mergeProps as B } from "vue";
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 U from "../../../core/src/components/Tooltip.mjs";
4
- import { TABLE_CONTEXT_KEY as Z } from "../context.mjs";
5
- import { getByDataIndex as ee, getColumnKey as L } from "../composables/useColumns.mjs";
6
- import { useFixedColumnStyle as le } from "../composables/useFixedColumnStyle.mjs";
7
- import { resolveBodyCell as ne, omitCellProps as N, isRenderedCell as te, getEllipsisConfig as oe } from "../utils/cell.mjs";
8
- import ae from "./SelectionCheckbox.mjs";
9
- import se from "./SelectionRadio.mjs";
10
- import P from "./ExpandIcon.mjs";
11
- import { isInHoverRange as re } from "../composables/useHoverState.mjs";
12
- import { TABLE_ALIGN_CLASSES as de } from "../../../theme/src/presets/antdv/table.mjs";
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 Ie = /* @__PURE__ */ J({
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 = Q(Z, {}), H = q(null), I = q(!1), o = d(() => e.resolvedCell ?? ne({
59
- text: ee(e.record, e.column.dataIndex),
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
- })), D = d(() => {
65
+ })), j = r(() => {
66
66
  if (!e.column.fixed) return null;
67
- const n = L(e.column) ?? e.colIndex;
67
+ const n = A(e.column) ?? e.colIndex;
68
68
  return l.fixedOffsets?.value?.get(n) ?? null;
69
69
  }), {
70
- fixedStyle: j,
71
- fixedClass: T
72
- } = le({
73
- fixedInfo: () => D.value
74
- }), i = d(() => l.getSelectionState?.(e.record, e.rowIndex) ?? {
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 = d(() => i.value.checked), _ = d(() => re(e.rowIndex, o.value.rowSpan ?? 1, l.hoverRange?.value ?? null));
79
- function S() {
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 h() {
84
+ function S() {
85
85
  l.hoverable?.value && l.clearHoverRange?.();
86
86
  }
87
- function A(n) {
87
+ function K(n) {
88
88
  return (t) => {
89
- S(), typeof n == "function" && n(t);
89
+ w(), typeof n == "function" && n(t);
90
90
  };
91
91
  }
92
- function W(n) {
92
+ function z(n) {
93
93
  return (t) => {
94
- h(), typeof n == "function" && n(t);
94
+ S(), typeof n == "function" && n(t);
95
95
  };
96
96
  }
97
- const E = d(() => ({
98
- ...N(o.value.renderCellProps),
99
- ...N(o.value.customCellProps)
100
- })), K = d(() => {
101
- const n = e.column.align ? de[e.column.align] : "", t = l.subThemeSlots, a = _.value && l.hoverable?.value, x = 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(e.tdClass, n, e.column.className, o.value.customCellProps?.class, o.value.customCellProps?.className, o.value.renderCellProps?.class, o.value.renderCellProps?.className, x, R, k, T.value);
103
- }), w = d(() => {
104
- const n = {}, t = l.columnWidths?.[String(L(e.column) ?? e.colIndex)], a = e.widthOverride ?? t ?? e.column.width;
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
- ...j.value ?? {},
122
+ ...W.value ?? {},
108
123
  ...o.value.customCellProps?.style ?? {},
109
124
  ...o.value.renderCellProps?.style ?? {}
110
125
  };
111
- }), z = d(() => l.isTreeData?.value ? l.getFlattenRow?.(e.record) ?? null : null), F = d(() => l.isTreeData?.value && e.column.key !== "__vtg_selection__" && e.column.key !== "__vtg_expand__" && e.colIndex <= 2 ? (() => {
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 $(n) {
131
+ function X(n) {
117
132
  return {
118
- ...w.value,
133
+ ...b.value,
119
134
  ...n ?? {}
120
135
  };
121
136
  }
122
- function G() {
123
- const n = H.value, t = o.value.tooltipText;
124
- I.value = !!(n && t && (n.scrollWidth > n.clientWidth || n.scrollHeight > n.clientHeight));
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 V() {
127
- I.value = !1;
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?.(), C = v?.type === "radio" ? r(se, {
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: (c) => l.toggleRow?.(e.record, e.rowIndex, c)
138
- }, null) : r(ae, {
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: (c, y) => l.toggleRow?.(e.record, e.rowIndex, y)
157
+ onChange: (d, I) => l.toggleRow?.(e.record, e.rowIndex, I)
143
158
  }, null);
144
- let u = C, s;
159
+ let u = x, s;
145
160
  if (v?.renderCell) {
146
- const c = v.renderCell(i.value.checked, e.record, e.rowIndex, C);
147
- te(c) ? (u = c.children, s = c.props) : u = c;
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 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);
150
- return r("td", B(N(s), {
151
- class: M,
152
- style: $(s?.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: S,
156
- onMouseleave: h
170
+ onMouseenter: w,
171
+ onMouseleave: S
157
172
  }), [u]);
158
173
  }
159
174
  if (e.column.key === "__vtg_expand__") {
160
- const v = l.expandable?.(), p = l.getRowKey?.(e.record, e.rowIndex), C = p !== void 0 && (l.isExpanded?.(p) ?? !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() : "") : "", c = b && s && !f.value ? s.tdRowHover() : "", y = m(e.tdClass, l.vtgClass?.("text-center"), e.column.className, g, M, c, T.value);
161
- return v?.expandIcon ? r("td", {
162
- class: y,
163
- style: w.value,
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: S,
167
- onMouseleave: h
181
+ onMouseenter: w,
182
+ onMouseleave: S
168
183
  }, [v.expandIcon({
169
- expanded: C,
184
+ expanded: x,
170
185
  record: e.record,
171
186
  expandable: u,
172
- onExpand: (ce, Y) => {
173
- Y.stopPropagation(), u && l.toggleExpand?.(e.record, e.rowIndex);
187
+ onExpand: (ve, Z) => {
188
+ Z.stopPropagation(), u && l.toggleExpand?.(e.record, e.rowIndex);
174
189
  }
175
- })]) : r("td", {
176
- class: y,
177
- style: w.value,
190
+ })]) : c("td", {
191
+ class: I,
192
+ style: b.value,
178
193
  colspan: n,
179
194
  rowspan: t,
180
- onMouseenter: S,
181
- onMouseleave: h
182
- }, [r(P, {
183
- expanded: C,
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 = z.value, x = F.value && a, R = x ? r("span", {
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 = x && a.hasChildren ? r(P, {
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) : x ? r(P, {
217
+ }, null) : C ? c(H, {
202
218
  expanded: !1,
203
219
  expandable: !1,
204
220
  variant: "tree"
205
- }, null) : null, O = oe(e.column), X = O.enabled ? O.showTitle ? r(U, {
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: I.value
225
+ open: T.value
210
226
  }, {
211
- default: () => [r("div", {
212
- ref: H,
227
+ default: () => [c("div", {
228
+ ref: O,
213
229
  class: e.bodyCellEllipsisClass,
214
- onMouseenter: G,
215
- onMouseleave: V
230
+ onMouseenter: Y,
231
+ onMouseleave: J
216
232
  }, [o.value.content])]
217
- }) : r("div", {
233
+ }) : c("div", {
218
234
  class: e.bodyCellEllipsisClass
219
235
  }, [o.value.content]) : o.value.content;
220
- return r("td", B(E.value, {
221
- class: K.value,
222
- style: w.value,
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: A(E.value.onMouseenter),
226
- onMouseleave: W(E.value.onMouseleave)
227
- }), [R, k, X]);
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
- Ie as default
248
+ _e as default
233
249
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as n, inject as o, createVNode as t, h as l, resolveDynamicComponent as a } from "vue";
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 y = /* @__PURE__ */ n({
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 = o(m, {});
20
+ const e = a(m, {});
21
21
  return () => {
22
- const p = e.subThemeSlots, r = e.presetConfig?.value;
23
- return t("tr", null, [t("td", {
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
- }, [r?.emptyIcon && t("div", {
30
+ }, [o?.emptyIcon && t("div", {
29
31
  class: p?.emptyIcon()
30
- }, [l(a(r.emptyIcon))]), t("p", {
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
- y as default
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,wBA0uBE"}
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"}