@vtable-guild/vtable-guild 2.2.2 → 2.4.0

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 (155) hide show
  1. package/dist/core/src/components/Button.mjs +108 -0
  2. package/dist/core/src/components/Checkbox.mjs +84 -0
  3. package/dist/core/src/components/Input.mjs +82 -0
  4. package/dist/core/src/components/Radio.mjs +69 -0
  5. package/dist/core/src/components/Scrollbar.mjs +179 -0
  6. package/dist/core/src/components/ScrollbarBar.mjs +103 -0
  7. package/dist/core/src/components/Tooltip.mjs +321 -0
  8. package/dist/core/src/components/VTableGuildConfigProvider.mjs +77 -0
  9. package/dist/core/src/components/VirtualList/Filler.mjs +55 -0
  10. package/dist/core/src/components/VirtualList/Item.mjs +29 -0
  11. package/dist/core/src/components/VirtualList/VirtualList.mjs +373 -0
  12. package/dist/core/src/components/VirtualList/VirtualScrollBar.mjs +216 -0
  13. package/dist/core/src/components/VirtualList/hooks/useChildren.mjs +21 -0
  14. package/dist/core/src/components/VirtualList/hooks/useDiffItem.mjs +16 -0
  15. package/dist/core/src/components/VirtualList/hooks/useFrameWheel.mjs +48 -0
  16. package/dist/core/src/components/VirtualList/hooks/useGetSize.mjs +25 -0
  17. package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +56 -0
  18. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.mjs +40 -0
  19. package/dist/core/src/components/VirtualList/hooks/useOriginScroll.mjs +17 -0
  20. package/dist/core/src/components/VirtualList/hooks/useScrollDrag.mjs +41 -0
  21. package/dist/core/src/components/VirtualList/hooks/useScrollTo.mjs +88 -0
  22. package/dist/core/src/components/VirtualList/utils/CacheMap.mjs +24 -0
  23. package/dist/core/src/components/VirtualList/utils/algorithmUtil.mjs +22 -0
  24. package/dist/core/src/components/VirtualList/utils/isFirefox.mjs +4 -0
  25. package/dist/core/src/components/VirtualList/utils/scrollbarUtil.mjs +7 -0
  26. package/dist/core/src/composables/useScrollbar.mjs +55 -0
  27. package/dist/core/src/composables/useTheme.mjs +92 -0
  28. package/dist/core/src/index.d.ts +1 -0
  29. package/dist/core/src/index.d.ts.map +1 -1
  30. package/dist/core/src/plugin/index.mjs +27 -0
  31. package/dist/core/src/utils/classPrefix.mjs +100 -0
  32. package/dist/core/src/utils/devWarn.d.ts +4 -0
  33. package/dist/core/src/utils/devWarn.d.ts.map +1 -0
  34. package/dist/core/src/utils/devWarn.mjs +5 -0
  35. package/dist/core/src/utils/mergeDeep.mjs +20 -0
  36. package/dist/core/src/utils/props.mjs +33 -0
  37. package/dist/core/src/utils/tv.mjs +19 -0
  38. package/dist/icons/src/AntdvEmptyIcon.mjs +37 -0
  39. package/dist/icons/src/AntdvSpinIndicator.mjs +23 -0
  40. package/dist/icons/src/CaretDownIcon.d.ts.map +1 -1
  41. package/dist/icons/src/CaretDownIcon.mjs +9 -0
  42. package/dist/icons/src/CaretRightIcon.d.ts.map +1 -1
  43. package/dist/icons/src/CaretUpIcon.d.ts.map +1 -1
  44. package/dist/icons/src/CaretUpIcon.mjs +9 -0
  45. package/dist/icons/src/DownOutlinedIcon.d.ts.map +1 -1
  46. package/dist/icons/src/DownOutlinedIcon.mjs +9 -0
  47. package/dist/icons/src/ElArrowDownIcon.d.ts.map +1 -1
  48. package/dist/icons/src/ElArrowDownIcon.mjs +9 -0
  49. package/dist/icons/src/ElCaretBottomIcon.d.ts.map +1 -1
  50. package/dist/icons/src/ElCaretBottomIcon.mjs +9 -0
  51. package/dist/icons/src/ElCaretTopIcon.d.ts.map +1 -1
  52. package/dist/icons/src/ElCaretTopIcon.mjs +9 -0
  53. package/dist/icons/src/ElFilterIcon.d.ts.map +1 -1
  54. package/dist/icons/src/ElLoadingIcon.mjs +28 -0
  55. package/dist/icons/src/FilterFilledIcon.d.ts.map +1 -1
  56. package/dist/icons/src/FilterFilledIcon.mjs +9 -0
  57. package/dist/icons/src/SearchIcon.d.ts.map +1 -1
  58. package/dist/icons/src/SearchIcon.mjs +9 -0
  59. package/dist/icons/src/createSvgIcon.d.ts +13 -0
  60. package/dist/icons/src/createSvgIcon.d.ts.map +1 -0
  61. package/dist/icons/src/createSvgIcon.mjs +23 -0
  62. package/dist/index.full.mjs +10127 -0
  63. package/dist/index.mjs +82 -10196
  64. package/dist/table/src/components/ColGroup.mjs +25 -0
  65. package/dist/table/src/components/ExpandIcon.mjs +60 -0
  66. package/dist/table/src/components/FilterDropdown.d.ts.map +1 -1
  67. package/dist/table/src/components/FilterDropdown.mjs +324 -0
  68. package/dist/table/src/components/FilterIcon.mjs +30 -0
  69. package/dist/table/src/components/ResizeHandle.mjs +28 -0
  70. package/dist/table/src/components/SelectionCheckbox.mjs +33 -0
  71. package/dist/table/src/components/SelectionDropdown.d.ts.map +1 -1
  72. package/dist/table/src/components/SelectionDropdown.mjs +73 -0
  73. package/dist/table/src/components/SelectionRadio.mjs +28 -0
  74. package/dist/table/src/components/SortButton.mjs +30 -0
  75. package/dist/table/src/components/Table.d.ts.map +1 -1
  76. package/dist/table/src/components/Table.mjs +781 -0
  77. package/dist/table/src/components/TableBody.mjs +124 -0
  78. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  79. package/dist/table/src/components/TableCell.mjs +222 -0
  80. package/dist/table/src/components/TableEmpty.mjs +38 -0
  81. package/dist/table/src/components/TableHeader.mjs +51 -0
  82. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  83. package/dist/table/src/components/TableHeaderCell.mjs +391 -0
  84. package/dist/table/src/components/TableLoading.mjs +46 -0
  85. package/dist/table/src/components/TableRow.mjs +34 -0
  86. package/dist/table/src/components/VTable.vue.d.ts.map +1 -1
  87. package/dist/table/src/components/VTable.vue.mjs +155 -0
  88. package/dist/table/src/components/VTable.vue2.mjs +4 -0
  89. package/dist/table/src/components/VTableSummary.mjs +29 -0
  90. package/dist/table/src/components/VTableSummaryCell.d.ts.map +1 -1
  91. package/dist/table/src/components/VTableSummaryCell.mjs +68 -0
  92. package/dist/table/src/components/VTableSummaryRow.mjs +19 -0
  93. package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
  94. package/dist/table/src/components/VirtualTableBody.mjs +172 -0
  95. package/dist/table/src/composables/index.d.ts +2 -1
  96. package/dist/table/src/composables/index.d.ts.map +1 -1
  97. package/dist/table/src/composables/useColumns.d.ts +6 -1
  98. package/dist/table/src/composables/useColumns.d.ts.map +1 -1
  99. package/dist/table/src/composables/useColumns.mjs +81 -0
  100. package/dist/table/src/composables/useControlledColumnState.d.ts +24 -0
  101. package/dist/table/src/composables/useControlledColumnState.d.ts.map +1 -0
  102. package/dist/table/src/composables/useControlledColumnState.mjs +23 -0
  103. package/dist/table/src/composables/useExpand.mjs +37 -0
  104. package/dist/table/src/composables/useFilter.d.ts.map +1 -1
  105. package/dist/table/src/composables/useFilter.mjs +68 -0
  106. package/dist/table/src/composables/useFixedColumnStyle.d.ts +18 -0
  107. package/dist/table/src/composables/useFixedColumnStyle.d.ts.map +1 -0
  108. package/dist/table/src/composables/useFixedColumnStyle.mjs +21 -0
  109. package/dist/table/src/composables/useHoverState.mjs +26 -0
  110. package/dist/table/src/composables/useResize.mjs +42 -0
  111. package/dist/table/src/composables/useScroll.d.ts +5 -4
  112. package/dist/table/src/composables/useScroll.d.ts.map +1 -1
  113. package/dist/table/src/composables/useScroll.mjs +68 -0
  114. package/dist/table/src/composables/useSelection.d.ts.map +1 -1
  115. package/dist/table/src/composables/useSelection.mjs +246 -0
  116. package/dist/table/src/composables/useSorter.d.ts +1 -5
  117. package/dist/table/src/composables/useSorter.d.ts.map +1 -1
  118. package/dist/table/src/composables/useSorter.mjs +161 -0
  119. package/dist/table/src/composables/useTreeData.d.ts +2 -0
  120. package/dist/table/src/composables/useTreeData.d.ts.map +1 -1
  121. package/dist/table/src/composables/useTreeData.mjs +92 -0
  122. package/dist/table/src/composables/useVirtual.mjs +19 -0
  123. package/dist/table/src/constants.mjs +8 -0
  124. package/dist/table/src/context.d.ts +90 -85
  125. package/dist/table/src/context.d.ts.map +1 -1
  126. package/dist/table/src/context.mjs +4 -0
  127. package/dist/table/src/index.d.ts.map +1 -1
  128. package/dist/table/src/index.mjs +23 -0
  129. package/dist/table/src/preset-config.mjs +35 -0
  130. package/dist/table/src/utils/cell.mjs +79 -0
  131. package/dist/table/src/utils/popupPosition.d.ts +20 -0
  132. package/dist/table/src/utils/popupPosition.d.ts.map +1 -0
  133. package/dist/table/src/utils/popupPosition.mjs +24 -0
  134. package/dist/table/src/utils/popupPosition.test.d.ts +2 -0
  135. package/dist/table/src/utils/popupPosition.test.d.ts.map +1 -0
  136. package/dist/table/src/utils/vnode.mjs +10 -0
  137. package/dist/theme/src/presets/antdv/button.mjs +70 -0
  138. package/dist/theme/src/presets/antdv/checkbox.mjs +51 -0
  139. package/dist/theme/src/presets/antdv/input.mjs +40 -0
  140. package/dist/theme/src/presets/antdv/radio.mjs +34 -0
  141. package/dist/theme/src/presets/antdv/scrollbar.mjs +22 -0
  142. package/dist/theme/src/presets/antdv/table-locale.mjs +55 -0
  143. package/dist/theme/src/presets/antdv/table.mjs +285 -0
  144. package/dist/theme/src/presets/antdv/tooltip.mjs +20 -0
  145. package/dist/theme/src/presets/element-plus/button.mjs +70 -0
  146. package/dist/theme/src/presets/element-plus/checkbox.mjs +65 -0
  147. package/dist/theme/src/presets/element-plus/input.mjs +39 -0
  148. package/dist/theme/src/presets/element-plus/radio.mjs +34 -0
  149. package/dist/theme/src/presets/element-plus/scrollbar.mjs +22 -0
  150. package/dist/theme/src/presets/element-plus/table-locale.mjs +56 -0
  151. package/dist/theme/src/presets/element-plus/table.mjs +235 -0
  152. package/dist/theme/src/presets/element-plus/tooltip.mjs +21 -0
  153. package/dist/theme/src/presets/index.mjs +92 -0
  154. package/package.json +10 -2
  155. package/dist/index.cjs +0 -1
@@ -0,0 +1,391 @@
1
+ import { defineComponent as Ne, inject as Re, computed as i, ref as f, watch as de, nextTick as Pe, onBeforeUnmount as He, createVNode as a, mergeProps as Y, Teleport as Ve, isVNode as Ke } from "vue";
2
+ import "../../../core/src/utils/tv.mjs";
3
+ import Be from "../../../core/src/components/Tooltip.mjs";
4
+ import We from "../../../icons/src/DownOutlinedIcon.mjs";
5
+ import { SELECTION_ALL as je, SELECTION_INVERT as qe, SELECTION_NONE as ze } from "../constants.mjs";
6
+ import { TABLE_CONTEXT_KEY as Ue } from "../context.mjs";
7
+ import { getColumnKey as $ } from "../composables/useColumns.mjs";
8
+ import { useFixedColumnStyle as Ge } from "../composables/useFixedColumnStyle.mjs";
9
+ import { getCellSpan as Xe, omitCellProps as Ye, getEllipsisConfig as $e } from "../utils/cell.mjs";
10
+ import { resolvePopupContainer as J, getPopupPositionStyle as Je } from "../utils/popupPosition.mjs";
11
+ import { ensureValidVNode as Qe } from "../utils/vnode.mjs";
12
+ import Ze from "./SortButton.mjs";
13
+ import el from "./FilterIcon.mjs";
14
+ import ll from "./FilterDropdown.mjs";
15
+ import tl from "./SelectionCheckbox.mjs";
16
+ import ol from "./SelectionDropdown.mjs";
17
+ import nl from "./ResizeHandle.mjs";
18
+ import { TABLE_ALIGN_CLASSES as rl } from "../../../theme/src/presets/antdv/table.mjs";
19
+ import { cn as g } from "tailwind-variants";
20
+ function sl(t) {
21
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Ke(t);
22
+ }
23
+ function al(t) {
24
+ if (t === "ascend") return "ascending";
25
+ if (t === "descend") return "descending";
26
+ }
27
+ const Al = /* @__PURE__ */ Ne({
28
+ name: "TableHeaderCell",
29
+ props: {
30
+ cell: {
31
+ type: Object,
32
+ required: !0
33
+ },
34
+ index: {
35
+ type: Number,
36
+ required: !0
37
+ },
38
+ thClass: {
39
+ type: String,
40
+ required: !0
41
+ },
42
+ headerCellInnerClass: {
43
+ type: String,
44
+ required: !0
45
+ }
46
+ },
47
+ setup(t) {
48
+ const e = Re(Ue, {}), o = i(() => t.cell.isLeaf ? t.cell.column : null), d = i(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), E = i(() => Xe(d.value, "colSpan") ?? t.cell.colSpan), k = i(() => t.cell.rowSpan), w = i(() => {
49
+ const {
50
+ onClick: l,
51
+ ...r
52
+ } = Ye(d.value);
53
+ return r;
54
+ }), _ = i(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null), I = i(() => !!o.value?.sorter), F = i(() => !o.value || !I.value ? !1 : o.value.showSorterTooltip ?? e.showSorterTooltip?.value ?? !0), O = i(() => {
55
+ const l = o.value;
56
+ return l ? (l.filters?.length ?? 0) > 0 || !!l.customFilterDropdown || !!l.filterDropdown : !1;
57
+ }), N = i(() => !o.value || !O.value ? [] : e.getFilteredValue?.(o.value) ?? []), R = i(() => {
58
+ const l = o.value;
59
+ return l ? l.filtered !== void 0 ? l.filtered : N.value.length > 0 : !1;
60
+ }), Q = i(() => o.value?.filterDropdownOpen !== void 0), Z = f(!1), y = i(() => Q.value ? o.value?.filterDropdownOpen ?? !1 : Z.value);
61
+ function v(l) {
62
+ Q.value || (Z.value = l), o.value?.onFilterDropdownOpenChange?.(l);
63
+ }
64
+ const m = f(null), P = f(null);
65
+ function H() {
66
+ v(!y.value);
67
+ }
68
+ function V(l) {
69
+ P.value && !P.value.contains(l.target) && !m.value?.contains(l.target) && v(!1);
70
+ }
71
+ const ve = i(() => {
72
+ const l = o.value;
73
+ return l ? !!l.filterDropdown || !!l.customFilterDropdown && !!e.customFilterDropdown : !1;
74
+ });
75
+ de(y, (l) => {
76
+ l && ve.value ? Pe(() => {
77
+ document.addEventListener("mousedown", V);
78
+ }) : document.removeEventListener("mousedown", V);
79
+ }), He(() => {
80
+ document.removeEventListener("mousedown", V);
81
+ });
82
+ function ee() {
83
+ return m.value ? m.value.getBoundingClientRect() : {
84
+ top: 0,
85
+ left: 0,
86
+ right: 0,
87
+ bottom: 0
88
+ };
89
+ }
90
+ const T = f([]), le = f(null);
91
+ de(() => N.value, (l) => {
92
+ T.value = [...l];
93
+ }, {
94
+ immediate: !0
95
+ });
96
+ function K(l) {
97
+ o.value && (e.confirmFilter?.(o.value, l), v(!1));
98
+ }
99
+ function me() {
100
+ o.value && (e.resetFilter?.(o.value), v(!1));
101
+ }
102
+ function pe() {
103
+ v(!1);
104
+ }
105
+ const ge = i(() => {
106
+ const l = t.cell.leafColumns;
107
+ if (!l.length) return null;
108
+ const r = l[0], u = l[l.length - 1], h = $(r) ?? t.cell.colStart, s = $(u) ?? t.cell.colEnd, x = e.fixedOffsets?.value?.get(h), D = e.fixedOffsets?.value?.get(s);
109
+ return l.every((p) => p.fixed === "left") && x?.left !== void 0 ? {
110
+ left: x.left,
111
+ isLastLeft: D?.isLastLeft
112
+ } : l.every((p) => p.fixed === "right") && D?.right !== void 0 ? {
113
+ right: D.right,
114
+ isFirstRight: x?.isFirstRight
115
+ } : null;
116
+ }), {
117
+ fixedStyle: he,
118
+ fixedClass: te
119
+ } = Ge({
120
+ fixedInfo: () => ge.value
121
+ }), Ce = i(() => {
122
+ const l = e.themePreset?.value === "antdv", r = e.bordered?.value ?? !1;
123
+ return !l || r || t.cell.isLeaf ? "" : e.vtgClass?.("before:hidden border-b-0") ?? "";
124
+ }), Se = i(() => {
125
+ const l = e.leafColumnCount?.value ?? 0;
126
+ return l > 0 && t.cell.colEnd < l - 1 ? e.bordered?.value ?? !1 ? e.vtgClass?.("last:border-r last:border-[color:var(--vtg-table-border-color)]") ?? "" : e.vtgClass?.("last:before:bg-[color:var(--vtg-table-header-split-color)]") ?? "" : "";
127
+ }), oe = i(() => e.getColumnTitle?.(t.cell.column) ?? t.cell.column.title ?? ""), be = i(() => {
128
+ if (!t.cell.isLeaf) return !1;
129
+ const l = o.value;
130
+ return !l || !$e(l).enabled ? !1 : e.headerEllipsis?.value === !0;
131
+ }), we = i(() => {
132
+ if (e.headerCell) {
133
+ const l = e.headerCell({
134
+ title: oe.value,
135
+ column: t.cell.column,
136
+ index: t.index
137
+ });
138
+ if (Qe(l) !== null)
139
+ return l;
140
+ }
141
+ return oe.value;
142
+ }), _e = i(() => {
143
+ const l = t.cell.column.align ? rl[t.cell.column.align] : "", r = I.value ? e.subThemeSlots?.thSortable() : "", u = _.value ? e.subThemeSlots?.thSorted() : "", h = o.value?.key === "__vtg_expand__";
144
+ return g(t.thClass, l, r, u, Ce.value, t.cell.column.className, h ? e.vtgClass?.("before:hidden") : "", d.value?.class, d.value?.className, te.value, Se.value);
145
+ }), ne = i(() => {
146
+ const l = {};
147
+ if (o.value) {
148
+ const s = e.columnWidths?.[String($(o.value) ?? t.cell.colStart)] ?? o.value.width;
149
+ s && (l.width = typeof s == "number" ? `${s}px` : s);
150
+ }
151
+ const r = d.value?.style, u = he.value;
152
+ return {
153
+ ...l,
154
+ ...u ?? {},
155
+ ...r ?? {}
156
+ };
157
+ }), L = f(!1), M = f(null);
158
+ function ye() {
159
+ return M.value ? M.value.getBoundingClientRect() : {
160
+ top: 0,
161
+ left: 0,
162
+ right: 0,
163
+ bottom: 0
164
+ };
165
+ }
166
+ let c = null;
167
+ function Te() {
168
+ c && clearTimeout(c), L.value = !0;
169
+ }
170
+ function re() {
171
+ c && clearTimeout(c), c = setTimeout(() => {
172
+ L.value = !1;
173
+ }, 100);
174
+ }
175
+ function xe() {
176
+ c && clearTimeout(c);
177
+ }
178
+ function De() {
179
+ c && clearTimeout(c), L.value = !1;
180
+ }
181
+ const B = f(!1), W = f(!1), Ae = i(() => F.value && B.value && !W.value);
182
+ function Ie(l) {
183
+ const r = w.value.onMouseenter;
184
+ typeof r == "function" && r(l), F.value && (B.value = !0);
185
+ }
186
+ function Fe(l) {
187
+ const r = w.value.onMouseleave;
188
+ typeof r == "function" && r(l), F.value && (B.value = !1);
189
+ }
190
+ function j() {
191
+ W.value = !0;
192
+ }
193
+ function q() {
194
+ W.value = !1;
195
+ }
196
+ function z(l) {
197
+ const r = d.value?.onClick;
198
+ typeof r == "function" && r(l), o.value && I.value && e.toggleSortOrder?.(o.value);
199
+ }
200
+ return () => {
201
+ if (E.value === 0 || k.value === 0)
202
+ return null;
203
+ const l = E.value !== 1 ? E.value : void 0, r = k.value !== 1 ? k.value : void 0;
204
+ if (o.value?.key === "__vtg_selection__") {
205
+ const n = e.rowSelection?.(), C = n?.type === "radio", ie = n?.hideSelectAll === !0, G = n?.selections !== void 0 && n.selections !== !1, S = e.locale?.value, A = n?.columnTitle, ke = A !== void 0, ue = g(t.thClass, e.vtgClass?.(ke ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, d.value?.class, d.value?.className, te.value), ce = ne.value;
206
+ let X = [];
207
+ if (G && (n?.selections === !0 ? X = [{
208
+ key: "__vtg_select_all__",
209
+ text: S?.selection?.selectAll ?? "全选当页",
210
+ onSelect: () => e.toggleAll?.(!0)
211
+ }, {
212
+ key: "__vtg_select_invert__",
213
+ text: S?.selection?.selectInvert ?? "反选当页",
214
+ onSelect: () => e.invertSelection?.()
215
+ }, {
216
+ key: "__vtg_select_none__",
217
+ text: S?.selection?.selectNone ?? "清空所有",
218
+ onSelect: () => e.clearSelection?.()
219
+ }] : Array.isArray(n?.selections) && (X = n.selections.map((b) => b === je ? {
220
+ key: "__vtg_select_all__",
221
+ text: S?.selection?.selectAll ?? "全选当页",
222
+ onSelect: () => e.toggleAll?.(!0)
223
+ } : b === qe ? {
224
+ key: "__vtg_select_invert__",
225
+ text: S?.selection?.selectInvert ?? "反选当页",
226
+ onSelect: () => e.invertSelection?.()
227
+ } : b === ze ? {
228
+ key: "__vtg_select_none__",
229
+ text: S?.selection?.selectNone ?? "清空所有",
230
+ onSelect: () => e.clearSelection?.()
231
+ } : b))), C)
232
+ return a("th", Y(w.value, {
233
+ class: ue,
234
+ style: ce,
235
+ colspan: l,
236
+ rowspan: r,
237
+ onClick: z
238
+ }), [A]);
239
+ const fe = e.allCheckedState?.() ?? "none", Oe = A ? a("span", {
240
+ class: e.vtgClass?.("ml-2")
241
+ }, [A]) : null;
242
+ return a("th", Y(w.value, {
243
+ class: ue,
244
+ style: ce,
245
+ colspan: l,
246
+ rowspan: r,
247
+ onClick: z
248
+ }), [ie ? A : a("span", {
249
+ class: e.vtgClass?.("inline-flex items-center justify-center relative")
250
+ }, [a(tl, {
251
+ checked: fe === "all",
252
+ indeterminate: fe === "partial",
253
+ onChange: (b) => e.toggleAll?.(b)
254
+ }, null), Oe, G && a("span", {
255
+ ref: M,
256
+ class: g(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
257
+ onMouseenter: Te,
258
+ onMouseleave: re,
259
+ role: "button",
260
+ "aria-label": "Selection options"
261
+ }, [a(We, null, null)])]), !ie && G && a(ol, {
262
+ items: X,
263
+ anchorRect: ye(),
264
+ popupContainer: J(e, M.value),
265
+ visible: L.value,
266
+ onClose: De,
267
+ onMouseenter: xe,
268
+ onMouseleave: re
269
+ }, null)]);
270
+ }
271
+ const u = e.locale?.value, h = _.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : _.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", s = o.value, x = e.subThemeSlots?.sortAreaWrapper(), D = e.subThemeSlots?.sortAreaTitle(), p = a("span", {
272
+ class: x
273
+ }, [a("span", {
274
+ class: g(D, be.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
275
+ }, [we.value]), I.value && a(Ze, {
276
+ sortOrder: _.value
277
+ }, null)]), se = e.subThemeSlots?.sortAreaOuter(), Le = F.value ? a("span", {
278
+ class: se
279
+ }, [a(Be, {
280
+ block: !0,
281
+ title: h,
282
+ placement: "top",
283
+ open: Ae.value
284
+ }, sl(p) ? p : {
285
+ default: () => [p]
286
+ })]) : a("span", {
287
+ class: se
288
+ }, [p]), Me = s && (s.filterIcon ? a("span", {
289
+ class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
290
+ ref: m,
291
+ onMouseenter: j,
292
+ onMouseleave: q,
293
+ onMousedown: (n) => n.stopPropagation(),
294
+ onClick: (n) => {
295
+ n.stopPropagation(), H();
296
+ },
297
+ role: "button",
298
+ "aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
299
+ }, [s.filterIcon({
300
+ filtered: R.value
301
+ })]) : e.customFilterIcon ? a("span", {
302
+ class: g(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon()),
303
+ ref: m,
304
+ onMouseenter: j,
305
+ onMouseleave: q,
306
+ onMousedown: (n) => n.stopPropagation(),
307
+ onClick: (n) => {
308
+ n.stopPropagation(), H();
309
+ },
310
+ role: "button",
311
+ "aria-label": u?.header.filterTriggerAriaLabel ?? "筛选"
312
+ }, [e.customFilterIcon({
313
+ column: s,
314
+ filtered: R.value
315
+ })]) : a("span", {
316
+ ref: m,
317
+ class: e.subThemeSlots?.filterIconWrapper(),
318
+ onMouseenter: j,
319
+ onMouseleave: q,
320
+ onMousedown: (n) => n.stopPropagation()
321
+ }, [a(el, {
322
+ active: R.value,
323
+ onClick: () => H()
324
+ }, null)])), U = s && {
325
+ column: s,
326
+ selectedKeys: T.value,
327
+ setSelectedKeys: (n) => {
328
+ T.value = [...n];
329
+ },
330
+ confirm: (n) => {
331
+ K(T.value), n?.closeDropdown === !1 && v(!0);
332
+ },
333
+ clearFilters: (n) => {
334
+ e.resetFilter?.(s), T.value = [], n?.confirm && K([]), n?.closeDropdown !== !1 && v(!1);
335
+ },
336
+ filters: s.filters ?? [],
337
+ visible: y.value,
338
+ close: () => v(!1)
339
+ }, ae = s?.customFilterDropdown ? e.customFilterDropdown : void 0, Ee = s && U && (() => {
340
+ const n = typeof s.filterDropdown == "function" ? s.filterDropdown(U) : s.filterDropdown ?? (ae ? ae(U) : null);
341
+ if (n) {
342
+ const C = J(e, m.value);
343
+ return a(Ve, {
344
+ to: C
345
+ }, {
346
+ default: () => [y.value && a("div", {
347
+ ref: P,
348
+ class: e.subThemeSlots?.filterDropdown(),
349
+ style: Je(ee(), C, 150)
350
+ }, [n])]
351
+ });
352
+ }
353
+ return a(ll, {
354
+ filters: s.filters ?? [],
355
+ selectedKeys: N.value,
356
+ multiple: s.filterMultiple !== !1,
357
+ anchorRect: ee(),
358
+ popupContainer: J(e, m.value),
359
+ filterSearch: s.filterSearch ?? !1,
360
+ filterMode: s.filterMode ?? "menu",
361
+ expandedKeys: le.value,
362
+ visible: y.value,
363
+ onConfirm: K,
364
+ onReset: me,
365
+ onClose: pe,
366
+ "onUpdate:expandedKeys": (C) => {
367
+ le.value = C;
368
+ }
369
+ }, null);
370
+ })();
371
+ return a("th", Y(w.value, {
372
+ class: _e.value,
373
+ style: ne.value,
374
+ colspan: l,
375
+ rowspan: r,
376
+ onClick: z,
377
+ onMouseenter: Ie,
378
+ onMouseleave: Fe,
379
+ "aria-sort": o.value ? al(_.value) : void 0
380
+ }), [a("span", {
381
+ class: g(e.vtgClass?.("flex items-center"), t.headerCellInnerClass)
382
+ }, [Le, O.value && Me]), O.value && Ee, o.value?.resizable && a(nl, {
383
+ column: o.value,
384
+ colIndex: t.cell.colStart
385
+ }, null)]);
386
+ };
387
+ }
388
+ });
389
+ export {
390
+ Al as default
391
+ };
@@ -0,0 +1,46 @@
1
+ import { defineComponent as s, inject as r, createVNode as e, h as c, resolveDynamicComponent as u } from "vue";
2
+ import { TABLE_CONTEXT_KEY as f } from "../context.mjs";
3
+ const C = /* @__PURE__ */ s({
4
+ name: "TableLoading",
5
+ props: {
6
+ loadingClass: {
7
+ type: String,
8
+ required: !0
9
+ },
10
+ /** 自定义指示器 (与 ant-design-vue loading.indicator 对齐) */
11
+ indicator: {
12
+ type: [Object, Function, String],
13
+ default: void 0
14
+ },
15
+ /** 加载提示文本 (与 ant-design-vue loading.tip 对齐) */
16
+ tip: {
17
+ type: String,
18
+ default: void 0
19
+ }
20
+ },
21
+ setup(n, {
22
+ slots: d
23
+ }) {
24
+ const t = r(f, {});
25
+ return () => {
26
+ const i = t.subThemeSlots, o = t.presetConfig?.value, a = d.default?.();
27
+ if (a)
28
+ return e("div", {
29
+ class: n.loadingClass
30
+ }, [a]);
31
+ const l = n.indicator !== void 0 && n.indicator !== null ? e("div", {
32
+ class: i?.loadingSpinner()
33
+ }, [n.indicator]) : o?.loadingIcon ? e("div", {
34
+ class: i?.loadingSpinner()
35
+ }, [c(u(o.loadingIcon))]) : null;
36
+ return e("div", {
37
+ class: n.loadingClass
38
+ }, [l, n.tip && e("div", {
39
+ class: t.vtgClass?.("mt-2 text-[color:var(--color-on-surface)] text-sm")
40
+ }, [n.tip])]);
41
+ };
42
+ }
43
+ });
44
+ export {
45
+ C as default
46
+ };
@@ -0,0 +1,34 @@
1
+ import { defineComponent as n, createVNode as c, mergeProps as a } from "vue";
2
+ const u = /* @__PURE__ */ n({
3
+ name: "TableRow",
4
+ props: {
5
+ rowClass: {
6
+ type: String,
7
+ required: !0
8
+ },
9
+ rowProps: {
10
+ type: Object,
11
+ default: void 0
12
+ }
13
+ },
14
+ emits: {
15
+ click: (e) => !0
16
+ },
17
+ setup(e, {
18
+ slots: t,
19
+ emit: s
20
+ }) {
21
+ function l(o) {
22
+ const r = e.rowProps?.onClick;
23
+ typeof r == "function" && r(o), s("click", o);
24
+ }
25
+ return () => c("tr", a(e.rowProps, {
26
+ class: [e.rowClass, e.rowProps?.class, e.rowProps?.className],
27
+ style: e.rowProps?.style,
28
+ onClick: l
29
+ }), [t.default?.()]);
30
+ }
31
+ });
32
+ export {
33
+ u as default
34
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"VTable.vue.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTable.vue"],"names":[],"mappings":"AA+HA,OAAO,KAAK,EACV,UAAU,EAEV,gBAAgB,EAGhB,gBAAgB,EAEhB,UAAU,EACV,cAAc,EACd,kBAAkB,EACnB,MAAM,UAAU,CAAA;yBAGA,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA2OO,mBAAmB,CAAC;;;uLAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;EAIP,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAtPzE,wBAsP4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"VTable.vue.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTable.vue"],"names":[],"mappings":"AAyIA,OAAO,KAAK,EACV,UAAU,EAEV,gBAAgB,EAGhB,gBAAgB,EAEhB,UAAU,EACV,cAAc,EACd,kBAAkB,EACnB,MAAM,UAAU,CAAA;yBAGA,OAAO,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAqPO,mBAAmB,CAAC;;;uLAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;EAIP,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhQzE,wBAgQ4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,155 @@
1
+ import { defineComponent as F, getCurrentInstance as g, createBlock as w, openBlock as $, unref as v, mergeProps as B, createSlots as b, withCtx as n, renderSlot as t, normalizeProps as s, guardReactiveProps as r } from "vue";
2
+ import k from "./Table.mjs";
3
+ const D = /* @__PURE__ */ F({
4
+ name: "VTable",
5
+ __name: "VTable",
6
+ props: {
7
+ dataSource: {},
8
+ columns: {},
9
+ rowKey: { type: [String, Function] },
10
+ loading: { type: [Boolean, Object] },
11
+ size: {},
12
+ bordered: { type: Boolean },
13
+ striped: { type: Boolean },
14
+ hoverable: { type: Boolean },
15
+ ui: {},
16
+ class: {},
17
+ tableLayout: {},
18
+ showHeader: { type: Boolean },
19
+ headerEllipsis: { type: Boolean },
20
+ rowClassName: { type: [String, Function] },
21
+ customRow: { type: Function },
22
+ customHeaderRow: { type: Function },
23
+ showSorterTooltip: { type: Boolean },
24
+ sortDirections: {},
25
+ locale: {},
26
+ locales: {},
27
+ localeOverrides: {},
28
+ sticky: { type: [Boolean, Object] },
29
+ getPopupContainer: { type: Function },
30
+ transformCellText: { type: Function },
31
+ rowSelection: {},
32
+ expandable: {},
33
+ title: { type: Function },
34
+ footer: { type: Function },
35
+ scroll: {},
36
+ virtual: { type: Boolean },
37
+ childrenColumnName: {},
38
+ indentSize: {},
39
+ expandedRowKeys: {},
40
+ defaultExpandedRowKeys: {},
41
+ defaultExpandAllRows: { type: Boolean },
42
+ onExpand: { type: Function },
43
+ onExpandedRowsChange: { type: Function }
44
+ },
45
+ emits: ["change", "resizeColumn"],
46
+ setup(S, { emit: u }) {
47
+ const a = u, p = g();
48
+ function d() {
49
+ const e = {};
50
+ for (const [l, o] of Object.entries(p?.vnode.props ?? {}))
51
+ l !== "onChange" && l !== "onResizeColumn" && (e[l] = o);
52
+ return e;
53
+ }
54
+ function R(e) {
55
+ return e;
56
+ }
57
+ function m(e, l, o) {
58
+ a(
59
+ "change",
60
+ e,
61
+ l,
62
+ o
63
+ );
64
+ }
65
+ function c(e, l) {
66
+ a("resizeColumn", e, l);
67
+ }
68
+ function y(e) {
69
+ return e;
70
+ }
71
+ function f(e) {
72
+ return e;
73
+ }
74
+ function C(e) {
75
+ return e;
76
+ }
77
+ function h(e) {
78
+ return e;
79
+ }
80
+ function i(e) {
81
+ return e;
82
+ }
83
+ return (e, l) => ($(), w(v(k), B(d(), {
84
+ onChange: m,
85
+ onResizeColumn: c
86
+ }), b({ _: 2 }, [
87
+ e.$slots.bodyCell ? {
88
+ name: "bodyCell",
89
+ fn: n((o) => [
90
+ t(e.$slots, "bodyCell", s(r(y(o))))
91
+ ]),
92
+ key: "0"
93
+ } : void 0,
94
+ e.$slots.headerCell ? {
95
+ name: "headerCell",
96
+ fn: n((o) => [
97
+ t(e.$slots, "headerCell", s(r(f(o))))
98
+ ]),
99
+ key: "1"
100
+ } : void 0,
101
+ e.$slots.empty ? {
102
+ name: "empty",
103
+ fn: n(() => [
104
+ t(e.$slots, "empty")
105
+ ]),
106
+ key: "2"
107
+ } : void 0,
108
+ e.$slots.loading ? {
109
+ name: "loading",
110
+ fn: n(() => [
111
+ t(e.$slots, "loading")
112
+ ]),
113
+ key: "3"
114
+ } : void 0,
115
+ e.$slots.customFilterDropdown ? {
116
+ name: "customFilterDropdown",
117
+ fn: n((o) => [
118
+ t(e.$slots, "customFilterDropdown", s(r(C(o))))
119
+ ]),
120
+ key: "4"
121
+ } : void 0,
122
+ e.$slots.customFilterIcon ? {
123
+ name: "customFilterIcon",
124
+ fn: n((o) => [
125
+ t(e.$slots, "customFilterIcon", s(r(h(o))))
126
+ ]),
127
+ key: "5"
128
+ } : void 0,
129
+ e.$slots.title ? {
130
+ name: "title",
131
+ fn: n((o) => [
132
+ t(e.$slots, "title", s(r(i(o))))
133
+ ]),
134
+ key: "6"
135
+ } : void 0,
136
+ e.$slots.footer ? {
137
+ name: "footer",
138
+ fn: n((o) => [
139
+ t(e.$slots, "footer", s(r(i(o))))
140
+ ]),
141
+ key: "7"
142
+ } : void 0,
143
+ e.$slots.summary ? {
144
+ name: "summary",
145
+ fn: n(() => [
146
+ t(e.$slots, "summary")
147
+ ]),
148
+ key: "8"
149
+ } : void 0
150
+ ]), 1040));
151
+ }
152
+ });
153
+ export {
154
+ D as default
155
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./VTable.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as r, inject as o, watch as i } from "vue";
2
+ import { TABLE_CONTEXT_KEY as l } from "../context.mjs";
3
+ import n from "./VTableSummaryRow.mjs";
4
+ import u from "./VTableSummaryCell.mjs";
5
+ const f = /* @__PURE__ */ r({
6
+ name: "VTableSummary",
7
+ props: {
8
+ fixed: {
9
+ type: [Boolean, String],
10
+ default: void 0
11
+ }
12
+ },
13
+ setup(e, {
14
+ slots: t
15
+ }) {
16
+ const m = o(l, {});
17
+ return i(() => e.fixed, (a) => {
18
+ m.registerSummaryFixed?.(a ?? !1);
19
+ }, {
20
+ immediate: !0
21
+ }), () => t.default?.();
22
+ }
23
+ }), b = Object.assign(f, {
24
+ Row: n,
25
+ Cell: u
26
+ });
27
+ export {
28
+ b as default
29
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"VTableSummaryCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableSummaryCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAGtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;cAUZ,QAAQ,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;cAAnB,QAAQ,CAAC,SAAS,CAAC;;;;;;;;AANhD,wBAsEE"}
1
+ {"version":3,"file":"VTableSummaryCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableSummaryCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAGtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;cAWZ,QAAQ,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;cAAnB,QAAQ,CAAC,SAAS,CAAC;;;;;;;;AANhD,wBAkDE"}