@vtable-guild/vtable-guild 2.9.0-alpha.1 → 2.9.0-alpha.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.
Files changed (135) hide show
  1. package/css/presets/antdv.css +10 -0
  2. package/css/presets/element-plus.css +10 -0
  3. package/css/style.css +138 -0
  4. package/css/tailwind3-utilities.css +118 -0
  5. package/css/tailwind3.css +20 -0
  6. package/css/tailwind4.css +20 -0
  7. package/dist/core/src/components/Button.d.ts +9 -0
  8. package/dist/core/src/components/Button.d.ts.map +1 -1
  9. package/dist/core/src/components/Button.mjs +11 -6
  10. package/dist/css/presets/antdv.css +10 -0
  11. package/dist/css/presets/element-plus.css +10 -0
  12. package/dist/css/style.css +138 -0
  13. package/dist/css/tailwind3-utilities.css +118 -0
  14. package/dist/css/tailwind3.css +20 -0
  15. package/dist/css/tailwind4.css +20 -0
  16. package/dist/icons/src/CheckCircleFilledIcon.d.ts +3 -0
  17. package/dist/icons/src/CheckCircleFilledIcon.d.ts.map +1 -0
  18. package/dist/icons/src/CheckCircleFilledIcon.mjs +9 -0
  19. package/dist/icons/src/CloseCircleFilledIcon.d.ts +3 -0
  20. package/dist/icons/src/CloseCircleFilledIcon.d.ts.map +1 -0
  21. package/dist/icons/src/CloseCircleFilledIcon.mjs +9 -0
  22. package/dist/icons/src/index.d.ts +2 -0
  23. package/dist/icons/src/index.d.ts.map +1 -1
  24. package/dist/index.full.mjs +6479 -5272
  25. package/dist/index.mjs +118 -98
  26. package/dist/table/src/components/Table.d.ts +3 -3
  27. package/dist/table/src/components/Table.d.ts.map +1 -1
  28. package/dist/table/src/components/Table.mjs +153 -149
  29. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  30. package/dist/table/src/components/TableCell.mjs +109 -86
  31. package/dist/table/src/components/TableEditableCell.d.ts +29 -0
  32. package/dist/table/src/components/TableEditableCell.d.ts.map +1 -0
  33. package/dist/table/src/components/TableEditableCell.mjs +39 -0
  34. package/dist/table/src/components/TableEditableCell.test.d.ts +2 -0
  35. package/dist/table/src/components/TableEditableCell.test.d.ts.map +1 -0
  36. package/dist/table/src/components/TableQuery.d.ts +108 -0
  37. package/dist/table/src/components/TableQuery.d.ts.map +1 -0
  38. package/dist/table/src/components/TableQuery.mjs +244 -0
  39. package/dist/table/src/components/TableQuery.test.d.ts +2 -0
  40. package/dist/table/src/components/TableQuery.test.d.ts.map +1 -0
  41. package/dist/table/src/components/VTableEditCell.vue.d.ts +19 -0
  42. package/dist/table/src/components/VTableEditCell.vue.d.ts.map +1 -0
  43. package/dist/table/src/components/VTableEditCell.vue.mjs +21 -0
  44. package/dist/table/src/components/VTableEditCell.vue2.mjs +4 -0
  45. package/dist/table/src/components/VTableQuery.vue.d.ts +18 -0
  46. package/dist/table/src/components/VTableQuery.vue.d.ts.map +1 -0
  47. package/dist/table/src/components/VTableQuery.vue.mjs +64 -0
  48. package/dist/table/src/components/VTableQuery.vue2.mjs +4 -0
  49. package/dist/table/src/composables/useTableDictionary.d.ts +5 -0
  50. package/dist/table/src/composables/useTableDictionary.d.ts.map +1 -0
  51. package/dist/table/src/composables/useTableDictionary.mjs +168 -0
  52. package/dist/table/src/composables/useTableDictionary.test.d.ts +2 -0
  53. package/dist/table/src/composables/useTableDictionary.test.d.ts.map +1 -0
  54. package/dist/table/src/composables/useTableEdit.d.ts.map +1 -1
  55. package/dist/table/src/composables/useTableEdit.mjs +352 -135
  56. package/dist/table/src/composables/useTableEditable.d.ts +4 -0
  57. package/dist/table/src/composables/useTableEditable.d.ts.map +1 -0
  58. package/dist/table/src/composables/useTableEditable.mjs +125 -0
  59. package/dist/table/src/composables/useTableEditable.test.d.ts +2 -0
  60. package/dist/table/src/composables/useTableEditable.test.d.ts.map +1 -0
  61. package/dist/table/src/composables/useTableQuery.d.ts.map +1 -1
  62. package/dist/table/src/composables/useTableQuery.mjs +33 -33
  63. package/dist/table/src/composables/useTableRequest.d.ts.map +1 -1
  64. package/dist/table/src/composables/useTableRequest.mjs +138 -97
  65. package/dist/table/src/composables/useTableRequest.polling.test.d.ts +2 -0
  66. package/dist/table/src/composables/useTableRequest.polling.test.d.ts.map +1 -0
  67. package/dist/table/src/context.d.ts +4 -0
  68. package/dist/table/src/context.d.ts.map +1 -1
  69. package/dist/table/src/controls.d.ts +4 -0
  70. package/dist/table/src/controls.d.ts.map +1 -0
  71. package/dist/table/src/controls.mjs +97 -0
  72. package/dist/table/src/controls.test.d.ts +2 -0
  73. package/dist/table/src/controls.test.d.ts.map +1 -0
  74. package/dist/table/src/index.d.ts +10 -0
  75. package/dist/table/src/index.d.ts.map +1 -1
  76. package/dist/table/src/renderers.d.ts.map +1 -1
  77. package/dist/table/src/renderers.mjs +88 -23
  78. package/dist/table/src/review-current.repro.test.d.ts +2 -0
  79. package/dist/table/src/review-current.repro.test.d.ts.map +1 -0
  80. package/dist/table/src/types/column.d.ts +4 -1
  81. package/dist/table/src/types/column.d.ts.map +1 -1
  82. package/dist/table/src/types/controls.d.ts +31 -0
  83. package/dist/table/src/types/controls.d.ts.map +1 -0
  84. package/dist/table/src/types/dictionary.d.ts +71 -0
  85. package/dist/table/src/types/dictionary.d.ts.map +1 -0
  86. package/dist/table/src/types/dictionary.typecheck.d.ts +6 -0
  87. package/dist/table/src/types/dictionary.typecheck.d.ts.map +1 -0
  88. package/dist/table/src/types/editable.d.ts +49 -0
  89. package/dist/table/src/types/editable.d.ts.map +1 -0
  90. package/dist/table/src/types/editable.typecheck.d.ts +15 -0
  91. package/dist/table/src/types/editable.typecheck.d.ts.map +1 -0
  92. package/dist/table/src/types/editing.d.ts +41 -4
  93. package/dist/table/src/types/editing.d.ts.map +1 -1
  94. package/dist/table/src/types/editing.typecheck.d.ts.map +1 -1
  95. package/dist/table/src/types/index.d.ts +4 -0
  96. package/dist/table/src/types/index.d.ts.map +1 -1
  97. package/dist/table/src/types/query-form.d.ts +90 -0
  98. package/dist/table/src/types/query-form.d.ts.map +1 -0
  99. package/dist/table/src/types/query-form.typecheck.d.ts +10 -0
  100. package/dist/table/src/types/query-form.typecheck.d.ts.map +1 -0
  101. package/dist/table/src/types/query.d.ts +6 -2
  102. package/dist/table/src/types/query.d.ts.map +1 -1
  103. package/dist/table/src/types/renderers.d.ts +15 -3
  104. package/dist/table/src/types/renderers.d.ts.map +1 -1
  105. package/dist/table/src/types/request.d.ts +20 -2
  106. package/dist/table/src/types/request.d.ts.map +1 -1
  107. package/dist/table/src/types/request.typecheck.d.ts.map +1 -1
  108. package/dist/table/src/utils/cell.d.ts +3 -2
  109. package/dist/table/src/utils/cell.d.ts.map +1 -1
  110. package/dist/table/src/utils/cell.mjs +45 -44
  111. package/dist/table/src/utils/fieldPath.d.ts +6 -0
  112. package/dist/table/src/utils/fieldPath.d.ts.map +1 -0
  113. package/dist/table/src/utils/fieldPath.mjs +29 -0
  114. package/dist/table/src/utils/queryFields.d.ts +4 -0
  115. package/dist/table/src/utils/queryFields.d.ts.map +1 -0
  116. package/dist/table/src/utils/queryFields.mjs +31 -0
  117. package/dist/table/src/utils/queryFields.test.d.ts +2 -0
  118. package/dist/table/src/utils/queryFields.test.d.ts.map +1 -0
  119. package/dist/table/src/utils/stateEqual.d.ts +3 -0
  120. package/dist/table/src/utils/stateEqual.d.ts.map +1 -0
  121. package/dist/table/src/utils/stateEqual.mjs +15 -0
  122. package/dist/theme/src/index.d.ts +4 -0
  123. package/dist/theme/src/index.d.ts.map +1 -1
  124. package/dist/theme/src/presets/antdv/table.d.ts +7 -0
  125. package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
  126. package/dist/theme/src/presets/antdv/table.mjs +7 -0
  127. package/dist/theme/src/presets/element-plus/table.d.ts +7 -0
  128. package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
  129. package/dist/theme/src/presets/element-plus/table.mjs +7 -0
  130. package/dist/theme/src/query.d.ts +128 -0
  131. package/dist/theme/src/query.d.ts.map +1 -0
  132. package/dist/theme/src/query.mjs +56 -0
  133. package/dist/vtable-guild/src/augment.d.ts +2 -1
  134. package/dist/vtable-guild/src/augment.d.ts.map +1 -1
  135. package/package.json +1 -1
@@ -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;;;cASQ,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,wBA4eE"}
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;AAI5F,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,UAAU,CAAA;AAK/D,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;;;cASQ,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,wBA4gBE"}
@@ -1,18 +1,20 @@
1
- import { defineComponent as ne, inject as te, ref as A, computed as d, createVNode as s, mergeProps as D } from "vue";
1
+ import { defineComponent as te, inject as ne, ref as A, computed as c, createVNode as a, mergeProps as D } from "vue";
2
2
  import "../../../core/src/utils/tv.mjs";
3
3
  import oe from "../../../core/src/components/Tooltip.mjs";
4
- import { TABLE_CONTEXT_KEY as ae } from "../context.mjs";
5
- import { getByDataIndex as se, getColumnKey as K } from "../composables/useColumns.mjs";
6
- import { useFixedColumnStyle as ce } from "../composables/useFixedColumnStyle.mjs";
7
- import { resolveBodyCell as de, getEllipsisConfig as j, omitCellProps as H, isRenderedCell as ue } from "../utils/cell.mjs";
8
- import re from "./SelectionCheckbox.mjs";
9
- import ie from "./SelectionRadio.mjs";
4
+ import ae from "../../../icons/src/CheckCircleFilledIcon.mjs";
5
+ import se from "../../../icons/src/CloseCircleFilledIcon.mjs";
6
+ import { TABLE_CONTEXT_KEY as re } from "../context.mjs";
7
+ import { getByDataIndex as ce, getColumnKey as K } from "../composables/useColumns.mjs";
8
+ import { useFixedColumnStyle as ue } from "../composables/useFixedColumnStyle.mjs";
9
+ import { resolveBodyCell as de, getEllipsisConfig as $, omitCellProps as H, isRenderedCell as ie } from "../utils/cell.mjs";
10
+ import ve from "./SelectionCheckbox.mjs";
11
+ import me from "./SelectionRadio.mjs";
10
12
  import L from "./ExpandIcon.mjs";
11
- import ve from "./TableCopyButton.mjs";
12
- import { isInHoverRange as me } from "../composables/useHoverState.mjs";
13
- import { TABLE_ALIGN_CLASSES as Ce } from "../../../theme/src/presets/antdv/table.mjs";
13
+ import Ce from "./TableCopyButton.mjs";
14
+ import { isInHoverRange as fe } from "../composables/useHoverState.mjs";
15
+ import { TABLE_ALIGN_CLASSES as xe } from "../../../theme/src/presets/antdv/table.mjs";
14
16
  import { cn as C } from "tailwind-variants";
15
- const Ne = /* @__PURE__ */ ne({
17
+ const Le = /* @__PURE__ */ te({
16
18
  name: "TableCell",
17
19
  props: {
18
20
  record: {
@@ -56,8 +58,8 @@ const Ne = /* @__PURE__ */ ne({
56
58
  }
57
59
  },
58
60
  setup(e) {
59
- const l = te(ae, {}), O = A(null), E = A(!1), t = d(() => e.resolvedCell ?? de({
60
- text: se(e.record, e.column.dataIndex),
61
+ const l = ne(re, {}), B = A(null), p = A(!1), t = c(() => e.resolvedCell ?? de({
62
+ text: ce(e.record, e.column.dataIndex),
61
63
  record: e.record,
62
64
  rowIndex: e.rowIndex,
63
65
  column: e.column,
@@ -66,21 +68,21 @@ const Ne = /* @__PURE__ */ ne({
66
68
  columnEmptyText: l.columnEmptyText?.value,
67
69
  renderers: l.renderers?.value,
68
70
  locale: l.localeName?.value
69
- })), W = d(() => {
71
+ })), j = c(() => {
70
72
  if (!e.column.fixed) return null;
71
73
  const n = K(e.column) ?? e.colIndex;
72
74
  return l.fixedOffsets?.value?.get(n) ?? null;
73
75
  }), {
74
- fixedStyle: $,
75
- fixedClass: _
76
- } = ce({
77
- fixedInfo: () => W.value
78
- }), z = d(() => j(e.column).enabled ? l.compatClass?.("cell-ellipsis") ?? "" : ""), i = d(() => l.getSelectionState?.(e.record, e.rowIndex) ?? {
76
+ fixedStyle: F,
77
+ fixedClass: E
78
+ } = ue({
79
+ fixedInfo: () => j.value
80
+ }), W = c(() => $(e.column).enabled ? l.compatClass?.("cell-ellipsis") ?? "" : ""), i = c(() => l.getSelectionState?.(e.record, e.rowIndex) ?? {
79
81
  checked: !1,
80
82
  indeterminate: !1,
81
83
  disabled: !1
82
- }), x = d(() => i.value.checked), g = d(() => me(e.rowIndex, t.value.rowSpan ?? 1, l.hoverRange?.value ?? null)), R = d(() => g.value && l.hoverable?.value ? l.compatClass?.("cell-row-hover") ?? "" : "");
83
- function h() {
84
+ }), x = c(() => i.value.checked), h = c(() => fe(e.rowIndex, t.value.rowSpan ?? 1, l.hoverRange?.value ?? null)), _ = c(() => h.value && l.hoverable?.value ? l.compatClass?.("cell-row-hover") ?? "" : "");
85
+ function S() {
84
86
  if (!l.hoverable?.value) return;
85
87
  const n = Math.max(1, t.value.rowSpan ?? 1);
86
88
  l.setHoverRange?.(e.rowIndex, e.rowIndex + n - 1);
@@ -88,21 +90,21 @@ const Ne = /* @__PURE__ */ ne({
88
90
  function w() {
89
91
  l.hoverable?.value && l.clearHoverRange?.();
90
92
  }
91
- function F(n) {
93
+ function z(n) {
92
94
  return (o) => {
93
- h(), typeof n == "function" && n(o);
95
+ S(), typeof n == "function" && n(o);
94
96
  };
95
97
  }
96
- function G(n) {
98
+ function V(n) {
97
99
  return (o) => {
98
100
  w(), typeof n == "function" && n(o);
99
101
  };
100
102
  }
101
- const k = d(() => ({
103
+ const R = c(() => ({
102
104
  ...H(t.value.renderCellProps),
103
105
  ...H(t.value.customCellProps)
104
- })), V = d(() => {
105
- const n = e.column.align ? l.vtgClass?.(Ce[e.column.align]) ?? "" : "", o = l.subThemeSlots, a = g.value && l.hoverable?.value, v = l.isColumnSorted?.(e.column) && o ? o.tdSorted() : "", f = x.value && o ? C(o.tdSelected(), a ? o.tdRowSelectedHover() : "") : "", p = a && o && !x.value ? o.tdRowHover() : "";
106
+ })), G = c(() => {
107
+ const n = e.column.align ? l.vtgClass?.(xe[e.column.align]) ?? "" : "", o = l.subThemeSlots, s = h.value && l.hoverable?.value, v = l.isColumnSorted?.(e.column) && o ? o.tdSorted() : "", f = x.value && o ? C(o.tdSelected(), s ? o.tdRowSelectedHover() : "") : "", k = s && o && !x.value ? o.tdRowHover() : "";
106
108
  return C(
107
109
  e.tdClass,
108
110
  n,
@@ -113,25 +115,25 @@ const Ne = /* @__PURE__ */ ne({
113
115
  t.value.renderCellProps?.className,
114
116
  v,
115
117
  f,
116
- p,
118
+ k,
119
+ E.value,
117
120
  _.value,
118
- R.value,
119
121
  // antdv 把 ellipsis 类放在 td 上,我们的 slot 落在内层 span,故在此补
120
- z.value
122
+ W.value
121
123
  );
122
- }), b = d(() => {
123
- const n = {}, o = l.columnWidths?.[String(K(e.column) ?? e.colIndex)], a = e.widthOverride ?? o ?? e.column.width;
124
- return a && (n.width = typeof a == "number" ? `${a}px` : a), {
124
+ }), b = c(() => {
125
+ const n = {}, o = l.columnWidths?.[String(K(e.column) ?? e.colIndex)], s = e.widthOverride ?? o ?? e.column.width;
126
+ return s && (n.width = typeof s == "number" ? `${s}px` : s), {
125
127
  ...n,
126
- ...$.value ?? {},
128
+ ...F.value ?? {},
127
129
  ...t.value.customCellProps?.style ?? {},
128
130
  ...t.value.renderCellProps?.style ?? {},
129
131
  ...l.columnLayout?.columnStyle(e.colIndex, t.value.colSpan || 1)
130
132
  };
131
- }), X = d(() => l.isTreeData?.value ? l.getFlattenRow?.(e.record) ?? null : null), Y = d(() => l.isTreeData?.value ? l.treeIndentColumnIndex ? e.colIndex === l.treeIndentColumnIndex.value : e.column.key !== "__vtg_selection__" && e.column.key !== "__vtg_expand__" && e.colIndex <= 2 ? (() => {
133
+ }), X = c(() => l.isTreeData?.value ? l.getFlattenRow?.(e.record) ?? null : null), Y = c(() => l.isTreeData?.value ? l.treeIndentColumnIndex ? e.colIndex === l.treeIndentColumnIndex.value : e.column.key !== "__vtg_selection__" && e.column.key !== "__vtg_expand__" && e.colIndex <= 2 ? (() => {
132
134
  const n = l.rowSelection?.(), o = l.expandable?.();
133
- let a = 0;
134
- return n && (a += 1), o && o.showExpandColumn !== !1 && (a += 1), e.colIndex === a;
135
+ let s = 0;
136
+ return n && (s += 1), o && o.showExpandColumn !== !1 && (s += 1), e.colIndex === s;
135
137
  })() : !1 : !1);
136
138
  function J(n) {
137
139
  return {
@@ -141,127 +143,148 @@ const Ne = /* @__PURE__ */ ne({
141
143
  };
142
144
  }
143
145
  function Q() {
144
- const n = O.value, o = t.value.tooltipText;
145
- E.value = !!(n && o && (n.scrollWidth > n.clientWidth || n.scrollHeight > n.clientHeight));
146
+ const n = B.value, o = t.value.tooltipText;
147
+ p.value = !!(n && o && (n.scrollWidth > n.clientWidth || n.scrollHeight > n.clientHeight));
146
148
  }
147
149
  function U() {
148
- E.value = !1;
150
+ p.value = !1;
149
151
  }
150
152
  return () => {
151
153
  if (t.value.colSpan === 0 || t.value.rowSpan === 0)
152
154
  return null;
153
155
  const n = t.value.colSpan !== 1 ? t.value.colSpan : void 0, o = t.value.rowSpan !== 1 ? t.value.rowSpan : void 0;
154
156
  if (e.column.key === "__vtg_selection__") {
155
- const m = l.rowSelection?.(), S = m?.type === "radio" ? s(ie, {
157
+ const m = l.rowSelection?.(), g = m?.type === "radio" ? a(me, {
156
158
  checked: i.value.checked,
157
159
  disabled: i.value.disabled,
158
160
  onChange: (u) => l.toggleRow?.(e.record, e.rowIndex, u)
159
- }, null) : s(re, {
161
+ }, null) : a(ve, {
160
162
  checked: i.value.checked,
161
163
  indeterminate: i.value.indeterminate,
162
164
  disabled: i.value.disabled,
163
165
  onChange: (u, T) => l.toggleRow?.(e.record, e.rowIndex, T)
164
166
  }, null);
165
- let r = S, c;
167
+ let d = g, r;
166
168
  if (m?.renderCell) {
167
- const u = m.renderCell(i.value.checked, e.record, e.rowIndex, S);
168
- ue(u) ? (r = u.children, c = u.props) : r = u;
169
+ const u = m.renderCell(i.value.checked, e.record, e.rowIndex, g);
170
+ ie(u) ? (d = u.children, r = u.props) : d = u;
169
171
  }
170
- const y = !!m?.renderCell, I = g.value && l.hoverable?.value, P = C(e.tdClass, l.vtgClass?.(y ? "text-center" : "text-center leading-[0]"), e.column.className, c?.class, c?.className, x.value && l.subThemeSlots ? C(l.subThemeSlots.tdSelected(), I ? l.subThemeSlots.tdRowSelectedHover() : "") : I && l.subThemeSlots ? l.subThemeSlots.tdRowHover() : "", _.value, R.value, l.compatClass?.("selection-column"));
171
- return s("td", D(H(c), {
172
- class: P,
173
- style: J(c?.style),
172
+ const y = !!m?.renderCell, I = h.value && l.hoverable?.value, M = C(e.tdClass, l.vtgClass?.(y ? "text-center" : "text-center leading-[0]"), e.column.className, r?.class, r?.className, x.value && l.subThemeSlots ? C(l.subThemeSlots.tdSelected(), I ? l.subThemeSlots.tdRowSelectedHover() : "") : I && l.subThemeSlots ? l.subThemeSlots.tdRowHover() : "", E.value, _.value, l.compatClass?.("selection-column"));
173
+ return a("td", D(H(r), {
174
+ class: M,
175
+ style: J(r?.style),
174
176
  "data-vtg-col": e.colIndex,
175
177
  colspan: n,
176
178
  rowspan: o,
177
- onMouseenter: h,
179
+ onMouseenter: S,
178
180
  onMouseleave: w
179
- }), [r]);
181
+ }), [d]);
180
182
  }
181
183
  if (e.column.key === "__vtg_expand__") {
182
- const m = l.expandable?.(), M = l.getRowKey?.(e.record, e.rowIndex), S = M !== void 0 && (l.isExpanded?.(M) ?? !1), r = l.isRowExpandable?.(e.record) ?? !1, c = l.subThemeSlots, y = g.value && l.hoverable?.value, I = l.isColumnSorted?.(e.column) && c ? c.tdSorted() : "", P = x.value && c ? C(c.tdSelected(), y ? c.tdRowSelectedHover() : "") : "", u = y && c && !x.value ? c.tdRowHover() : "", T = C(e.tdClass, l.vtgClass?.("text-center"), e.column.className, I, P, u, _.value, R.value, l.compatClass?.("row-expand-icon-cell"));
183
- return m?.expandIcon ? s("td", {
184
+ const m = l.expandable?.(), N = l.getRowKey?.(e.record, e.rowIndex), g = N !== void 0 && (l.isExpanded?.(N) ?? !1), d = l.isRowExpandable?.(e.record) ?? !1, r = l.subThemeSlots, y = h.value && l.hoverable?.value, I = l.isColumnSorted?.(e.column) && r ? r.tdSorted() : "", M = x.value && r ? C(r.tdSelected(), y ? r.tdRowSelectedHover() : "") : "", u = y && r && !x.value ? r.tdRowHover() : "", T = C(e.tdClass, l.vtgClass?.("text-center"), e.column.className, I, M, u, E.value, _.value, l.compatClass?.("row-expand-icon-cell"));
185
+ return m?.expandIcon ? a("td", {
184
186
  class: T,
185
187
  style: b.value,
186
188
  "data-vtg-col": e.colIndex,
187
189
  colspan: n,
188
190
  rowspan: o,
189
- onMouseenter: h,
191
+ onMouseenter: S,
190
192
  onMouseleave: w
191
193
  }, [m.expandIcon({
192
- expanded: S,
194
+ expanded: g,
193
195
  record: e.record,
194
- expandable: r,
195
- onExpand: (fe, le) => {
196
- le.stopPropagation(), r && l.toggleExpand?.(e.record, e.rowIndex);
196
+ expandable: d,
197
+ onExpand: (ge, le) => {
198
+ le.stopPropagation(), d && l.toggleExpand?.(e.record, e.rowIndex);
197
199
  }
198
- })]) : s("td", {
200
+ })]) : a("td", {
199
201
  class: T,
200
202
  style: b.value,
201
203
  "data-vtg-col": e.colIndex,
202
204
  colspan: n,
203
205
  rowspan: o,
204
- onMouseenter: h,
206
+ onMouseenter: S,
205
207
  onMouseleave: w
206
- }, [s(L, {
207
- expanded: S,
208
- expandable: r,
208
+ }, [a(L, {
209
+ expanded: g,
210
+ expandable: d,
209
211
  variant: "row",
210
212
  onClick: () => {
211
- r && l.toggleExpand?.(e.record, e.rowIndex);
213
+ d && l.toggleExpand?.(e.record, e.rowIndex);
212
214
  }
213
215
  }, null)]);
214
216
  }
215
- const a = X.value, v = Y.value && a, f = v ? l.getRowKey?.(e.record, e.rowIndex) : void 0, p = v ? s("span", {
216
- class: l.compatClass ? `${l.compatClass("row-indent")} indent-level-${a.level}` : void 0,
217
+ const s = X.value, v = Y.value && s, f = v ? l.getRowKey?.(e.record, e.rowIndex) : void 0, k = v ? a("span", {
218
+ class: l.compatClass ? `${l.compatClass("row-indent")} indent-level-${s.level}` : void 0,
217
219
  style: {
218
220
  display: "inline-block",
219
- width: `${a.level * (l.treeIndentSize?.value ?? 15)}px`
221
+ width: `${s.level * (l.treeIndentSize?.value ?? 15)}px`
220
222
  }
221
- }, null) : null, Z = v && a.hasChildren ? s(L, {
222
- expanded: a.expanded,
223
+ }, null) : null, Z = v && s.hasChildren ? a(L, {
224
+ expanded: s.expanded,
223
225
  expandable: !0,
224
226
  variant: "tree",
225
227
  loading: f !== void 0 && l.isTreeLoading?.(f),
226
228
  error: f !== void 0 && !!l.getTreeLoadError?.(f),
227
229
  onClick: () => l.toggleTreeExpand?.(e.record, e.rowIndex)
228
- }, null) : v ? s(L, {
230
+ }, null) : v ? a(L, {
229
231
  expanded: !1,
230
232
  expandable: !1,
231
233
  variant: "tree"
232
- }, null) : null, B = j(e.column), ee = v ? l.compatClass?.("cell-with-append") ?? "" : "", N = t.value.presentation === "tag" ? s("span", {
234
+ }, null) : null, O = $(e.column), ee = v ? l.compatClass?.("cell-with-append") ?? "" : "", P = t.value.presentation === "progress" && t.value.progress ? a("span", {
235
+ class: l.subThemeSlots?.cellProgress(),
236
+ "data-vtg-field": "progress",
237
+ role: "progressbar",
238
+ "aria-label": t.value.tooltipText,
239
+ "aria-valuemin": 0,
240
+ "aria-valuemax": 100,
241
+ "aria-valuenow": t.value.progress.percent
242
+ }, [a("span", {
243
+ class: l.subThemeSlots?.cellProgressTrack()
244
+ }, [a("span", {
245
+ class: l.subThemeSlots?.cellProgressBar(),
246
+ "data-status": t.value.status ?? "processing",
247
+ style: {
248
+ width: `${t.value.progress.percent}%`
249
+ }
250
+ }, null)]), t.value.progress.showValue ? a("span", {
251
+ class: l.subThemeSlots?.cellProgressText(),
252
+ "data-status": t.value.status
253
+ }, [t.value.status === "success" ? a(ae, null, null) : t.value.status === "error" ? a(se, {
254
+ "fill-rule": "evenodd"
255
+ }, null) : t.value.content]) : null]) : t.value.presentation === "tag" ? a("span", {
233
256
  class: l.subThemeSlots?.cellTag(),
234
257
  "data-status": t.value.status ?? "default",
235
258
  "data-vtg-field": "tag"
236
- }, [t.value.content]) : t.value.status ? s("span", {
259
+ }, [t.value.content]) : t.value.status ? a("span", {
237
260
  class: l.subThemeSlots?.cellStatus(),
238
261
  "data-status": t.value.status
239
- }, [t.value.content]) : t.value.content, q = B.enabled ? B.showTitle ? s(oe, {
262
+ }, [t.value.content]) : t.value.content, q = O.enabled ? O.showTitle ? a(oe, {
240
263
  block: !0,
241
264
  title: t.value.tooltipText,
242
265
  placement: "top",
243
- open: E.value
266
+ open: p.value
244
267
  }, {
245
- default: () => [s("div", {
246
- ref: O,
268
+ default: () => [a("div", {
269
+ ref: B,
247
270
  class: e.bodyCellEllipsisClass,
248
271
  onMouseenter: Q,
249
272
  onMouseleave: U
250
- }, [N])]
251
- }) : s("div", {
273
+ }, [P])]
274
+ }) : a("div", {
252
275
  class: e.bodyCellEllipsisClass
253
- }, [N]) : N;
254
- return s("td", D(k.value, {
255
- class: C(V.value, ee),
276
+ }, [P]) : P;
277
+ return a("td", D(R.value, {
278
+ class: C(G.value, ee),
256
279
  style: b.value,
257
280
  "data-vtg-col": e.colIndex,
258
281
  colspan: n,
259
282
  rowspan: o,
260
- onMouseenter: F(k.value.onMouseenter),
261
- onMouseleave: G(k.value.onMouseleave)
262
- }), [p, Z, e.column.copyable ? s("span", {
283
+ onMouseenter: z(R.value.onMouseenter),
284
+ onMouseleave: V(R.value.onMouseleave)
285
+ }), [k, Z, e.column.copyable ? a("span", {
263
286
  class: l.subThemeSlots?.cellContent()
264
- }, [q, s(ve, {
287
+ }, [q, a(Ce, {
265
288
  column: e.column,
266
289
  record: e.record,
267
290
  rowIndex: e.rowIndex,
@@ -271,5 +294,5 @@ const Ne = /* @__PURE__ */ ne({
271
294
  }
272
295
  });
273
296
  export {
274
- Ne as default
297
+ Le as default
275
298
  };
@@ -0,0 +1,29 @@
1
+ import { PropType } from 'vue';
2
+ import { TableControls, TableControlContext } from '../types/controls';
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ context: {
5
+ type: PropType<TableControlContext & {
6
+ valueType: string;
7
+ }>;
8
+ required: true;
9
+ };
10
+ controls: {
11
+ type: PropType<TableControls>;
12
+ required: true;
13
+ };
14
+ ui: PropType<Record<string, string>>;
15
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
16
+ context: {
17
+ type: PropType<TableControlContext & {
18
+ valueType: string;
19
+ }>;
20
+ required: true;
21
+ };
22
+ controls: {
23
+ type: PropType<TableControls>;
24
+ required: true;
25
+ };
26
+ ui: PropType<Record<string, string>>;
27
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
28
+ export default _default;
29
+ //# sourceMappingURL=TableEditableCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableEditableCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableEditableCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAGtE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;;;cAMrD,QAAQ,CAAC,mBAAmB,GAAG;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;;;;cAG3C,QAAQ,CAAC,aAAa,CAAC;;;QACrC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;cAJ5B,QAAQ,CAAC,mBAAmB,GAAG;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;;;;cAG3C,QAAQ,CAAC,aAAa,CAAC;;;QACrC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;AARlD,wBAmCE"}
@@ -0,0 +1,39 @@
1
+ import { defineComponent as a, inject as i, computed as s, createVNode as o } from "vue";
2
+ import { useTheme as d } from "../../../core/src/composables/useTheme.mjs";
3
+ import { VTABLE_GUILD_INJECTION_KEY as c } from "../../../core/src/plugin/index.mjs";
4
+ import { resolveTableThemePreset as u } from "../../../theme/src/presets/index.mjs";
5
+ const T = /* @__PURE__ */ a({
6
+ name: "TableEditableCell",
7
+ props: {
8
+ context: {
9
+ type: Object,
10
+ required: !0
11
+ },
12
+ controls: {
13
+ type: Object,
14
+ required: !0
15
+ },
16
+ ui: Object
17
+ },
18
+ setup(t) {
19
+ const n = i(c, null), {
20
+ slots: r
21
+ } = d("table", s(() => u(n?.themePreset ?? "antdv")), t);
22
+ return () => {
23
+ const e = t.context, l = t.controls[e.valueType];
24
+ if (!l) throw new Error(`No table control registered for ${e.valueType}`);
25
+ return o("div", {
26
+ class: r.editCell()
27
+ }, [o("div", {
28
+ class: r.editControl(),
29
+ "data-invalid": e.error ? !0 : void 0
30
+ }, [l(e)]), e.error ? o("span", {
31
+ class: r.editError(),
32
+ role: "alert"
33
+ }, [e.error]) : null]);
34
+ };
35
+ }
36
+ });
37
+ export {
38
+ T as default
39
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TableEditableCell.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableEditableCell.test.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableEditableCell.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,108 @@
1
+ import { PropType, SlotsType } from 'vue';
2
+ import { TableQueryProps, TableQuerySlots } from '../types/query-form';
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ query: {
5
+ type: PropType<TableQueryProps["query"]>;
6
+ required: true;
7
+ };
8
+ rootTag: {
9
+ type: PropType<TableQueryProps["rootTag"]>;
10
+ default: string;
11
+ };
12
+ fields: {
13
+ type: PropType<TableQueryProps["fields"]>;
14
+ required: true;
15
+ };
16
+ controls: {
17
+ type: PropType<TableQueryProps["controls"]>;
18
+ required: true;
19
+ };
20
+ layout: {
21
+ type: PropType<TableQueryProps["layout"]>;
22
+ default: string;
23
+ };
24
+ autoSubmit: BooleanConstructor;
25
+ debounceTime: {
26
+ type: NumberConstructor;
27
+ default: number;
28
+ };
29
+ hiddenPolicy: {
30
+ type: PropType<TableQueryProps["hiddenPolicy"]>;
31
+ default: string;
32
+ };
33
+ collapsedCount: {
34
+ type: NumberConstructor;
35
+ default: number;
36
+ };
37
+ collapsible: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ disabled: BooleanConstructor;
42
+ validate: PropType<TableQueryProps["validate"]>;
43
+ errors: PropType<TableQueryProps["errors"]>;
44
+ locale: PropType<TableQueryProps["locale"]>;
45
+ ui: PropType<TableQueryProps["ui"]>;
46
+ class: StringConstructor;
47
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
48
+ submitted: (_success: boolean) => true;
49
+ reset: (_success: boolean) => true;
50
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
51
+ query: {
52
+ type: PropType<TableQueryProps["query"]>;
53
+ required: true;
54
+ };
55
+ rootTag: {
56
+ type: PropType<TableQueryProps["rootTag"]>;
57
+ default: string;
58
+ };
59
+ fields: {
60
+ type: PropType<TableQueryProps["fields"]>;
61
+ required: true;
62
+ };
63
+ controls: {
64
+ type: PropType<TableQueryProps["controls"]>;
65
+ required: true;
66
+ };
67
+ layout: {
68
+ type: PropType<TableQueryProps["layout"]>;
69
+ default: string;
70
+ };
71
+ autoSubmit: BooleanConstructor;
72
+ debounceTime: {
73
+ type: NumberConstructor;
74
+ default: number;
75
+ };
76
+ hiddenPolicy: {
77
+ type: PropType<TableQueryProps["hiddenPolicy"]>;
78
+ default: string;
79
+ };
80
+ collapsedCount: {
81
+ type: NumberConstructor;
82
+ default: number;
83
+ };
84
+ collapsible: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
88
+ disabled: BooleanConstructor;
89
+ validate: PropType<TableQueryProps["validate"]>;
90
+ errors: PropType<TableQueryProps["errors"]>;
91
+ locale: PropType<TableQueryProps["locale"]>;
92
+ ui: PropType<TableQueryProps["ui"]>;
93
+ class: StringConstructor;
94
+ }>> & Readonly<{
95
+ onReset?: ((_success: boolean) => any) | undefined;
96
+ onSubmitted?: ((_success: boolean) => any) | undefined;
97
+ }>, {
98
+ disabled: boolean;
99
+ layout: "form" | "light" | undefined;
100
+ rootTag: "form" | "div" | undefined;
101
+ hiddenPolicy: "preserve" | "omit" | undefined;
102
+ autoSubmit: boolean;
103
+ debounceTime: number;
104
+ collapsedCount: number;
105
+ collapsible: boolean;
106
+ }, SlotsType<TableQuerySlots<Record<string, unknown>>>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
107
+ export default _default;
108
+ //# sourceMappingURL=TableQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableQuery.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TableQuery.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,KAAK,CAAA;AAIZ,OAAO,KAAK,EAGV,eAAe,EACf,eAAe,EAChB,MAAM,qBAAqB,CAAA;;;cAQC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;;;;cACtC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;;;;cACvC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;cAI3C,QAAQ,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;;;;;;;;;;;;cAMrC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACzC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACnC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACvC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;;0BAIvB,OAAO;sBACX,OAAO;;;cAtBA,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;;;;cACtC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;cAChC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;;;;cACvC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;;;;;;;;;cAI3C,QAAQ,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;;;;;;;;;;;;cAMrC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;YACzC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACnC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACvC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;AArBjD,wBAmUE"}