@vtable-guild/vtable-guild 2.6.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.
@@ -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,wBAiKE"}
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 b, inject as x, computed as h, createVNode as m } 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 { getRowCompatClass as N } from "../utils/compat.mjs";
9
- import { getByDataIndex as q } from "../composables/useColumns.mjs";
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__ */ b({
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 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;
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 S = h(() => {
55
+ const x = h(() => {
56
56
  const t = /* @__PURE__ */ new Set();
57
- return e.dataSource.map((a, o) => {
58
- const s = [];
57
+ return e.dataSource.map((l, s) => {
58
+ const o = [];
59
59
  return e.columns.forEach((C, r) => {
60
- const c = `${o}:${r}`;
60
+ const c = `${s}:${r}`;
61
61
  if (t.has(c)) return;
62
62
  const y = K({
63
- text: q(a, C.dataIndex),
64
- record: a,
65
- rowIndex: o,
63
+ text: B(l, C.dataIndex),
64
+ record: l,
65
+ rowIndex: s,
66
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)
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
- u === o && n === r || t.add(`${u}:${n}`);
75
- s.push({
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: i,
81
- rowSpan: d
80
+ colSpan: d,
81
+ rowSpan: u
82
82
  }
83
83
  });
84
- }), s;
84
+ }), o;
85
85
  });
86
86
  });
87
- return () => m("tbody", {
87
+ return () => i("tbody", {
88
88
  class: e.tbodyClass
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);
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 [m(E, {
94
- key: o,
95
- rowClass: p(e.rowClass, d, N(l, t, a, i)) ?? "",
93
+ return [i(E, {
94
+ key: s,
95
+ rowClass: p(e.rowClass, u, N(a, t, l, d)) ?? "",
96
96
  rowProps: f,
97
- onClick: u
97
+ onClick: m
98
98
  }, {
99
- default: () => [S.value[a]?.map((n) => m(T, {
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: a,
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 && s?.expandedRowRender && m("tr", {
110
- key: `${o}-expanded`,
111
- class: p(e.rowClass, d, l.subThemeSlots?.expandedRow(), w)
112
- }, [m("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", {
113
113
  colspan: e.columns.length,
114
- class: p(e.tdClass, l.subThemeSlots?.expandedRowCell())
115
- }, [s.expandedRowRender(t, a, 0, !0)])])];
116
- }) : m(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, {
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,wBA0aE"}
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 U, inject as Z, ref as q, computed as c, 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 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
- import P from "./ExpandIcon.mjs";
11
- import { isInHoverRange as ce } 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 Te = /* @__PURE__ */ U({
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 = Z(le, {}), H = q(null), I = q(!1), o = c(() => e.resolvedCell ?? oe({
59
- text: ne(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
- })), j = c(() => {
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: A,
71
- fixedClass: T
72
- } = te({
70
+ fixedStyle: W,
71
+ fixedClass: p
72
+ } = ae({
73
73
  fixedInfo: () => j.value
74
- }), W = c(() => D(e.column).enabled ? l.compatClass?.("cell-ellipsis") ?? "" : ""), i = c(() => l.getSelectionState?.(e.record, e.rowIndex) ?? {
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 = c(() => i.value.checked), _ = c(() => ce(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
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
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 = c(() => ({
98
- ...N(o.value.renderCellProps),
99
- ...N(o.value.customCellProps)
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() : "";
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
- p,
113
- T.value,
112
+ k,
113
+ p.value,
114
+ _.value,
114
115
  // antdv 把 ellipsis 类放在 td 上,我们的 slot 落在内层 span,故在此补
115
- W.value
116
+ $.value
116
117
  );
117
- }), w = c(() => {
118
- const n = {}, t = l.columnWidths?.[String(L(e.column) ?? e.colIndex)], a = e.widthOverride ?? t ?? e.column.width;
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
- ...A.value ?? {},
122
+ ...W.value ?? {},
122
123
  ...o.value.customCellProps?.style ?? {},
123
124
  ...o.value.renderCellProps?.style ?? {}
124
125
  };
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 ? (() => {
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 V(n) {
131
+ function X(n) {
131
132
  return {
132
- ...w.value,
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
- I.value = !1;
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" ? r(re, {
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) : r(se, {
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, y) => l.toggleRow?.(e.record, e.rowIndex, y)
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
- ae(d) ? (u = d.children, s = d.props) : u = d;
162
+ ce(d) ? (u = d.children, s = d.props) : u = d;
162
163
  }
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"));
164
- return r("td", B(N(s), {
165
- class: M,
166
- style: V(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),
167
168
  colspan: n,
168
169
  rowspan: t,
169
- onMouseenter: S,
170
- onMouseleave: h
170
+ onMouseenter: w,
171
+ onMouseleave: S
171
172
  }), [u]);
172
173
  }
173
174
  if (e.column.key === "__vtg_expand__") {
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"));
175
- return v?.expandIcon ? r("td", {
176
- class: y,
177
- 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,
178
179
  colspan: n,
179
180
  rowspan: t,
180
- onMouseenter: S,
181
- onMouseleave: h
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: (ue, Q) => {
187
- Q.stopPropagation(), u && l.toggleExpand?.(e.record, e.rowIndex);
187
+ onExpand: (ve, Z) => {
188
+ Z.stopPropagation(), u && l.toggleExpand?.(e.record, e.rowIndex);
188
189
  }
189
- })]) : r("td", {
190
- class: y,
191
- style: w.value,
190
+ })]) : c("td", {
191
+ class: I,
192
+ style: b.value,
192
193
  colspan: n,
193
194
  rowspan: t,
194
- onMouseenter: S,
195
- onMouseleave: h
196
- }, [r(P, {
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 = $.value, C = G.value && a, R = C ? 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,
206
208
  style: {
207
209
  display: "inline-block",
208
210
  width: `${a.level * (l.treeIndentSize?.value ?? 15)}px`
209
211
  }
210
- }, null) : null, p = C && a.hasChildren ? r(P, {
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 ? r(P, {
217
+ }, null) : C ? c(H, {
216
218
  expanded: !1,
217
219
  expandable: !1,
218
220
  variant: "tree"
219
- }, null) : null, O = D(e.column), J = O.enabled ? O.showTitle ? r(ee, {
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: I.value
225
+ open: T.value
224
226
  }, {
225
- default: () => [r("div", {
226
- ref: H,
227
+ default: () => [c("div", {
228
+ ref: O,
227
229
  class: e.bodyCellEllipsisClass,
228
- onMouseenter: X,
229
- onMouseleave: Y
230
+ onMouseenter: Y,
231
+ onMouseleave: J
230
232
  }, [o.value.content])]
231
- }) : r("div", {
233
+ }) : c("div", {
232
234
  class: e.bodyCellEllipsisClass
233
235
  }, [o.value.content]) : o.value.content;
234
- return r("td", B(E.value, {
235
- class: F.value,
236
- style: w.value,
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, p, J]);
243
+ }), [R, k, U]);
242
244
  };
243
245
  }
244
246
  });
245
247
  export {
246
- Te as default
248
+ _e as default
247
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,wBA4uBE"}
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"}