@rockshin/tao-ui 0.0.43 → 0.0.45

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 (77) hide show
  1. package/README.md +7 -1
  2. package/component-manifest.json +10 -3
  3. package/dist/components/auto-complete/auto-complete.js +12 -3
  4. package/dist/components/breadcrumb/breadcrumb.css +4 -0
  5. package/dist/components/breadcrumb/breadcrumb.js +1 -0
  6. package/dist/components/calendar/calendar.d.ts +1 -0
  7. package/dist/components/calendar/calendar.js +10 -3
  8. package/dist/components/card/card-tabs.js +204 -182
  9. package/dist/components/card/card.js +1 -1
  10. package/dist/components/carousel/carousel.js +11 -5
  11. package/dist/components/cascader/cascader.js +16 -4
  12. package/dist/components/collapse/collapse.css +8 -0
  13. package/dist/components/context-menu/context-menu.d.ts +2 -1
  14. package/dist/components/context-menu/context-menu.js +57 -44
  15. package/dist/components/date-picker/calendar/calendar-grid.js +3 -2
  16. package/dist/components/date-picker/date-picker.css +4 -0
  17. package/dist/components/date-picker/date-picker.d.ts +1 -0
  18. package/dist/components/date-picker/date-picker.js +13 -3
  19. package/dist/components/date-picker/range-picker.d.ts +1 -0
  20. package/dist/components/date-picker/range-picker.js +13 -3
  21. package/dist/components/drawer/drawer.d.ts +2 -1
  22. package/dist/components/drawer/drawer.js +32 -20
  23. package/dist/components/dropdown/dropdown.d.ts +1 -0
  24. package/dist/components/dropdown/dropdown.js +139 -123
  25. package/dist/components/form/field-control.d.ts +6 -0
  26. package/dist/components/form/field-control.js +42 -0
  27. package/dist/components/form/form-context.d.ts +3 -0
  28. package/dist/components/form/form-item.d.ts +2 -1
  29. package/dist/components/form/form-item.js +55 -42
  30. package/dist/components/form/form.d.ts +5 -5
  31. package/dist/components/form/form.js +86 -68
  32. package/dist/components/form/index.d.ts +1 -0
  33. package/dist/components/form/use-form.d.ts +16 -0
  34. package/dist/components/form/use-form.js +69 -0
  35. package/dist/components/form-field/form-field-view.d.ts +4 -2
  36. package/dist/components/form-field/form-field-view.js +42 -35
  37. package/dist/components/mentions/mentions.js +6 -2
  38. package/dist/components/modal/modal.d.ts +2 -1
  39. package/dist/components/modal/modal.js +14 -4
  40. package/dist/components/pagination/pagination.css +4 -0
  41. package/dist/components/popover/popover.d.ts +2 -1
  42. package/dist/components/popover/popover.js +185 -176
  43. package/dist/components/rate/rate.js +114 -88
  44. package/dist/components/scroll-area/scroll-area.js +127 -118
  45. package/dist/components/segmented/segmented.js +52 -29
  46. package/dist/components/select/mobile-select.d.ts +2 -1
  47. package/dist/components/select/mobile-select.js +52 -47
  48. package/dist/components/select/select-types.d.ts +1 -0
  49. package/dist/components/select/select.js +19 -6
  50. package/dist/components/slider/slider.js +136 -133
  51. package/dist/components/splitter/splitter.css +4 -0
  52. package/dist/components/splitter/splitter.js +5 -3
  53. package/dist/components/table/table.css +29 -11
  54. package/dist/components/table/table.js +383 -547
  55. package/dist/components/tabs/tabs.js +3 -2
  56. package/dist/components/time-picker/time-picker.js +21 -7
  57. package/dist/components/tooltip/tooltip.d.ts +2 -1
  58. package/dist/components/tooltip/tooltip.js +82 -71
  59. package/dist/components/transfer/transfer-parts.js +12 -2
  60. package/dist/components/transfer/transfer.js +10 -4
  61. package/dist/components/tree/tree-keyboard.d.ts +6 -0
  62. package/dist/components/tree/tree-keyboard.js +27 -0
  63. package/dist/components/tree/tree.js +14 -3
  64. package/dist/components/tree-select/select-engine.d.ts +2 -1
  65. package/dist/components/tree-select/select-engine.js +23 -15
  66. package/dist/components/tree-select/tree-select.js +20 -10
  67. package/dist/docs/components/form.doc.js +3 -1
  68. package/dist/docs/components/tao-provider.doc.js +6 -1
  69. package/dist/entries/form.d.ts +2 -2
  70. package/dist/entries/provider.d.ts +1 -1
  71. package/dist/index.d.ts +3 -3
  72. package/dist/provider/tao-provider.d.ts +10 -3
  73. package/dist/provider/tao-provider.js +198 -88
  74. package/dist/utils/scroll-left.d.ts +3 -0
  75. package/dist/utils/scroll-left.js +7 -0
  76. package/llms.txt +3 -3
  77. package/package.json +4 -2
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { Fragment, createElement, isValidElement, useEffect, useRef, useState } from "react";
3
- import { c } from "react-compiler-runtime";
4
- import { useTaoConfig } from "../../provider/tao-provider.js";
2
+ import { Fragment, createElement, isValidElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
3
+ import { useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
5
4
  import { useBreakpoint } from "../../utils/breakpoint.js";
5
+ import { getScrollLeft } from "../../utils/scroll-left.js";
6
6
  import { cx } from "../../utils/semantic.js";
7
7
  import { Checkbox } from "../checkbox/checkbox.js";
8
8
  import { Pagination } from "../pagination/pagination.js";
@@ -20,26 +20,16 @@ function stickyStyle(pos, zIndex) {
20
20
  zIndex
21
21
  } : void 0;
22
22
  }
23
- function Table(t0) {
24
- const $ = c(89);
25
- const { columns: columnsProp, dataSource, rowKey, loading: t1, pagination: paginationProp, onChange, scroll, rowSelection, expandable, summary, size, variant, headerBackground: t2, emptyText: t3, bordered: t4, className, style, classNames, styles, rowClassName, rowStyle, onRow, onHeaderRow } = t0;
26
- const loading = void 0 === t1 ? false : t1;
27
- const headerBackground = void 0 === t2 ? true : t2;
28
- const emptyText = void 0 === t3 ? "No Data" : t3;
29
- const bordered = void 0 === t4 ? false : t4;
23
+ function Table({ columns: columnsProp, dataSource, rowKey, loading = false, pagination: paginationProp, onChange, scroll, rowSelection, expandable, summary, size, variant, headerBackground = true, emptyText = 'No Data', bordered = false, className, style, classNames, styles, rowClassName, rowStyle, onRow, onHeaderRow }) {
30
24
  const ctx = useTaoConfig();
31
25
  const resolvedSize = size ?? ctx.size;
32
26
  const screens = useBreakpoint();
33
- let t5;
34
- if ($[0] !== columnsProp || $[1] !== screens) {
35
- t5 = columnsProp.some(_temp) ? columnsProp.filter((col)=>!col.responsive || col.responsive.some((bp)=>screens[bp])) : columnsProp;
36
- $[0] = columnsProp;
37
- $[1] = screens;
38
- $[2] = t5;
39
- } else t5 = $[2];
40
- const columns = t5;
41
- const resolvedVariant = variant ?? ("outlined" === ctx.variant ? "modern" : ctx.variant);
42
- const showBorder = "outlined" === resolvedVariant || "modern" === resolvedVariant || bordered && "borderless" !== resolvedVariant;
27
+ const columns = useMemo(()=>columnsProp.some((col_0)=>col_0.responsive) ? columnsProp.filter((col)=>!col.responsive || col.responsive.some((bp)=>screens[bp])) : columnsProp, [
28
+ columnsProp,
29
+ screens
30
+ ]);
31
+ const resolvedVariant = variant ?? ('outlined' === ctx.variant ? 'modern' : ctx.variant);
32
+ const showBorder = 'outlined' === resolvedVariant || 'modern' === resolvedVariant || bordered && 'borderless' !== resolvedVariant;
43
33
  const semanticProps = {
44
34
  columns,
45
35
  dataSource,
@@ -67,201 +57,126 @@ function Table(t0) {
67
57
  };
68
58
  const resolvedClassNames = resolveSemanticClassNames(classNames, semanticProps);
69
59
  const resolvedStyles = resolveSemanticStyles(styles, semanticProps);
70
- let t6;
71
- if ($[3] !== columns || $[4] !== dataSource || $[5] !== onChange || $[6] !== paginationProp) {
72
- t6 = {
73
- columns,
74
- dataSource,
75
- pagination: paginationProp,
76
- onChange
77
- };
78
- $[3] = columns;
79
- $[4] = dataSource;
80
- $[5] = onChange;
81
- $[6] = paginationProp;
82
- $[7] = t6;
83
- } else t6 = $[7];
84
- const tableData = useTableData(t6);
60
+ const tableData = useTableData({
61
+ columns,
62
+ dataSource,
63
+ pagination: paginationProp,
64
+ onChange
65
+ });
85
66
  const paginatedData = tableData.rows;
86
67
  const selectionColWidth = rowSelection?.columnWidth ?? 48;
87
- const selectionType = rowSelection?.type ?? "checkbox";
68
+ const selectionType = rowSelection?.type ?? 'checkbox';
88
69
  const isSelectionControlled = rowSelection?.selectedRowKeys !== void 0;
89
- let t7;
90
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
91
- t7 = [];
92
- $[8] = t7;
93
- } else t7 = $[8];
94
- const [internalSelectedKeys, setInternalSelectedKeys] = useState(t7);
70
+ const [internalSelectedKeys, setInternalSelectedKeys] = useState([]);
95
71
  const selectedKeys = rowSelection?.selectedRowKeys ?? internalSelectedKeys;
96
- let t8;
97
- if ($[9] !== selectedKeys) {
98
- t8 = new Set(selectedKeys);
99
- $[9] = selectedKeys;
100
- $[10] = t8;
101
- } else t8 = $[10];
102
- const selectedKeySet = t8;
103
- let t9;
104
- if ($[11] !== paginatedData || $[12] !== rowKey || $[13] !== rowSelection) {
105
- let t10;
106
- if ($[15] !== rowSelection) {
107
- t10 = (record)=>!rowSelection?.getCheckboxProps?.(record)?.disabled;
108
- $[15] = rowSelection;
109
- $[16] = t10;
110
- } else t10 = $[16];
111
- let t11;
112
- if ($[17] !== rowKey) {
113
- t11 = (record_0)=>getRowKey(record_0, rowKey);
114
- $[17] = rowKey;
115
- $[18] = t11;
116
- } else t11 = $[18];
117
- t9 = paginatedData.filter(t10).map(t11);
118
- $[11] = paginatedData;
119
- $[12] = rowKey;
120
- $[13] = rowSelection;
121
- $[14] = t9;
122
- } else t9 = $[14];
123
- const selectablePageKeys = t9;
124
- let t10;
125
- if ($[19] !== dataSource || $[20] !== isSelectionControlled || $[21] !== rowKey || $[22] !== rowSelection || $[23] !== selectedKeySet || $[24] !== selectedKeys || $[25] !== selectionType) {
126
- t10 = (key)=>{
127
- let nextKeys;
128
- nextKeys = "radio" === selectionType ? [
129
- key
130
- ] : selectedKeySet.has(key) ? selectedKeys.filter((k)=>k !== key) : [
131
- ...selectedKeys,
132
- key
133
- ];
134
- if (!isSelectionControlled) setInternalSelectedKeys(nextKeys);
135
- if (!rowSelection?.onChange) return;
136
- const nextKeySet = new Set(nextKeys);
137
- const nextRows = dataSource.filter((r)=>nextKeySet.has(getRowKey(r, rowKey)));
138
- rowSelection.onChange(nextKeys, nextRows);
139
- };
140
- $[19] = dataSource;
141
- $[20] = isSelectionControlled;
142
- $[21] = rowKey;
143
- $[22] = rowSelection;
144
- $[23] = selectedKeySet;
145
- $[24] = selectedKeys;
146
- $[25] = selectionType;
147
- $[26] = t10;
148
- } else t10 = $[26];
149
- const handleSelectRow = t10;
150
- let t11;
151
- if ($[27] !== dataSource || $[28] !== isSelectionControlled || $[29] !== rowKey || $[30] !== rowSelection || $[31] !== selectablePageKeys || $[32] !== selectedKeys) {
152
- t11 = (checked)=>{
153
- const nextKeySet_0 = new Set(selectedKeys);
154
- for (const key_0 of selectablePageKeys)if (checked) nextKeySet_0.add(key_0);
155
- else nextKeySet_0.delete(key_0);
156
- const nextKeys_0 = [
157
- ...nextKeySet_0
158
- ];
159
- if (!isSelectionControlled) setInternalSelectedKeys(nextKeys_0);
160
- if (!rowSelection?.onChange) return;
161
- const nextRows_0 = dataSource.filter((record_1)=>nextKeySet_0.has(getRowKey(record_1, rowKey)));
162
- rowSelection.onChange(nextKeys_0, nextRows_0);
163
- };
164
- $[27] = dataSource;
165
- $[28] = isSelectionControlled;
166
- $[29] = rowKey;
167
- $[30] = rowSelection;
168
- $[31] = selectablePageKeys;
169
- $[32] = selectedKeys;
170
- $[33] = t11;
171
- } else t11 = $[33];
172
- const handleSelectAll = t11;
72
+ const selectedKeySet = useMemo(()=>new Set(selectedKeys), [
73
+ selectedKeys
74
+ ]);
75
+ const selectablePageKeys = useMemo(()=>paginatedData.filter((record)=>!rowSelection?.getCheckboxProps?.(record)?.disabled).map((record_0)=>getRowKey(record_0, rowKey)), [
76
+ paginatedData,
77
+ rowSelection,
78
+ rowKey
79
+ ]);
80
+ const handleSelectRow = useCallback((key)=>{
81
+ let nextKeys;
82
+ nextKeys = 'radio' === selectionType ? [
83
+ key
84
+ ] : selectedKeySet.has(key) ? selectedKeys.filter((k)=>k !== key) : [
85
+ ...selectedKeys,
86
+ key
87
+ ];
88
+ if (!isSelectionControlled) setInternalSelectedKeys(nextKeys);
89
+ if (!rowSelection?.onChange) return;
90
+ const nextKeySet = new Set(nextKeys);
91
+ const nextRows = dataSource.filter((r)=>nextKeySet.has(getRowKey(r, rowKey)));
92
+ rowSelection.onChange(nextKeys, nextRows);
93
+ }, [
94
+ rowSelection,
95
+ selectionType,
96
+ isSelectionControlled,
97
+ selectedKeys,
98
+ selectedKeySet,
99
+ dataSource,
100
+ rowKey
101
+ ]);
102
+ const handleSelectAll = useCallback((checked)=>{
103
+ const nextKeySet_0 = new Set(selectedKeys);
104
+ for (const key_0 of selectablePageKeys)if (checked) nextKeySet_0.add(key_0);
105
+ else nextKeySet_0.delete(key_0);
106
+ const nextKeys_0 = [
107
+ ...nextKeySet_0
108
+ ];
109
+ if (!isSelectionControlled) setInternalSelectedKeys(nextKeys_0);
110
+ if (!rowSelection?.onChange) return;
111
+ const nextRows_0 = dataSource.filter((record_1)=>nextKeySet_0.has(getRowKey(record_1, rowKey)));
112
+ rowSelection.onChange(nextKeys_0, nextRows_0);
113
+ }, [
114
+ rowSelection,
115
+ selectedKeys,
116
+ selectablePageKeys,
117
+ dataSource,
118
+ rowKey,
119
+ isSelectionControlled
120
+ ]);
173
121
  const expandColWidth = expandable?.columnWidth ?? 48;
174
- let t12;
175
- if ($[34] !== expandable?.defaultExpandedRowKeys) {
176
- t12 = ()=>expandable?.defaultExpandedRowKeys ?? [];
177
- $[34] = expandable?.defaultExpandedRowKeys;
178
- $[35] = t12;
179
- } else t12 = $[35];
180
- const [internalExpandedKeys, setInternalExpandedKeys] = useState(t12);
122
+ const [internalExpandedKeys, setInternalExpandedKeys] = useState(()=>expandable?.defaultExpandedRowKeys ?? []);
181
123
  const expandedKeys = expandable?.expandedRowKeys ?? internalExpandedKeys;
182
- let t13;
183
- if ($[36] !== expandedKeys) {
184
- t13 = new Set(expandedKeys);
185
- $[36] = expandedKeys;
186
- $[37] = t13;
187
- } else t13 = $[37];
188
- const expandedKeySet = t13;
189
- let t14;
190
- if ($[38] !== expandable || $[39] !== expandedKeySet || $[40] !== expandedKeys) {
191
- t14 = (record_2, key_1)=>{
192
- const expanded = !expandedKeySet.has(key_1);
193
- const nextKeys_1 = expanded ? [
194
- ...expandedKeys,
195
- key_1
196
- ] : expandedKeys.filter((k_0)=>k_0 !== key_1);
197
- if (expandable?.expandedRowKeys === void 0) setInternalExpandedKeys(nextKeys_1);
198
- expandable?.onExpand?.(expanded, record_2);
199
- expandable?.onExpandedRowsChange?.(nextKeys_1);
200
- };
201
- $[38] = expandable;
202
- $[39] = expandedKeySet;
203
- $[40] = expandedKeys;
204
- $[41] = t14;
205
- } else t14 = $[41];
206
- const toggleExpand = t14;
124
+ const expandedKeySet = useMemo(()=>new Set(expandedKeys), [
125
+ expandedKeys
126
+ ]);
127
+ const toggleExpand = (record_2, key_1)=>{
128
+ const expanded = !expandedKeySet.has(key_1);
129
+ const nextKeys_1 = expanded ? [
130
+ ...expandedKeys,
131
+ key_1
132
+ ] : expandedKeys.filter((k_0)=>k_0 !== key_1);
133
+ if (expandable?.expandedRowKeys === void 0) setInternalExpandedKeys(nextKeys_1);
134
+ expandable?.onExpand?.(expanded, record_2);
135
+ expandable?.onExpandedRowsChange?.(nextKeys_1);
136
+ };
207
137
  const scrollRef = useRef(null);
138
+ const [direction, directionRef] = useTaoDirection(void 0, 'self');
208
139
  const [viewportWidth, setViewportWidth] = useState();
209
- const [scrollState, setScrollState] = useState("left");
210
- let t15;
211
- if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
212
- t15 = ()=>{
213
- const el = scrollRef.current;
214
- if (!el) return;
215
- const { scrollLeft, scrollWidth, clientWidth } = el;
216
- const atLeft = scrollLeft <= 1;
217
- const atRight = scrollLeft + clientWidth >= scrollWidth - 1;
218
- setViewportWidth(clientWidth);
219
- if (atLeft && atRight) setScrollState("both");
220
- else if (atLeft) setScrollState("left");
221
- else atRight ? setScrollState("right") : setScrollState("middle");
222
- };
223
- $[42] = t15;
224
- } else t15 = $[42];
225
- const handleScroll = t15;
226
- let t16;
227
- if ($[43] !== scroll?.x) {
228
- t16 = ()=>{
229
- const el_0 = scrollRef.current;
230
- if (!scroll?.x || !el_0) return;
231
- handleScroll();
232
- const observer = new ResizeObserver(handleScroll);
233
- observer.observe(el_0);
234
- if (el_0.firstElementChild) observer.observe(el_0.firstElementChild);
235
- return ()=>observer.disconnect();
236
- };
237
- $[43] = scroll?.x;
238
- $[44] = t16;
239
- } else t16 = $[44];
240
- const t17 = scroll?.x;
241
- let t18;
242
- if ($[45] !== t17) {
243
- t18 = [
244
- t17,
245
- handleScroll
246
- ];
247
- $[45] = t17;
248
- $[46] = t18;
249
- } else t18 = $[46];
250
- useEffect(t16, t18);
251
- let cols;
252
- if ($[47] !== columns || $[48] !== expandColWidth || $[49] !== expandable || $[50] !== rowSelection || $[51] !== selectionColWidth) {
253
- cols = [];
140
+ const [scrollState, setScrollState] = useState('left');
141
+ const handleScroll = useCallback(()=>{
142
+ const el = scrollRef.current;
143
+ if (!el) return;
144
+ const { scrollWidth, clientWidth } = el;
145
+ const scrollLeft = getScrollLeft(el);
146
+ const atLeft = scrollLeft <= 1;
147
+ const atRight = scrollLeft + clientWidth >= scrollWidth - 1;
148
+ setViewportWidth(clientWidth);
149
+ if (atLeft && atRight) setScrollState('both');
150
+ else if (atLeft) setScrollState('rtl' === direction ? 'right' : 'left');
151
+ else atRight ? setScrollState('rtl' === direction ? 'left' : 'right') : setScrollState('middle');
152
+ }, [
153
+ direction
154
+ ]);
155
+ useEffect(()=>{
156
+ const el_0 = scrollRef.current;
157
+ if (!scroll?.x || !el_0) return;
158
+ handleScroll();
159
+ const observer = new ResizeObserver(handleScroll);
160
+ observer.observe(el_0);
161
+ if (el_0.firstElementChild) observer.observe(el_0.firstElementChild);
162
+ return ()=>observer.disconnect();
163
+ }, [
164
+ scroll?.x,
165
+ handleScroll
166
+ ]);
167
+ const allColumns = useMemo(()=>{
168
+ const cols = [];
254
169
  if (expandable) cols.push({
255
- _key: "__expand__",
170
+ _key: '__expand__',
256
171
  _index: -2,
257
172
  width: expandColWidth,
258
- fixed: expandable.fixed ? "left" : void 0
173
+ fixed: expandable.fixed ? 'left' : void 0
259
174
  });
260
175
  if (rowSelection) cols.push({
261
- _key: "__selection__",
176
+ _key: '__selection__',
262
177
  _index: -1,
263
178
  width: selectionColWidth,
264
- fixed: rowSelection.fixed ? "left" : void 0
179
+ fixed: rowSelection.fixed ? 'left' : void 0
265
180
  });
266
181
  columns.forEach((col_1, i)=>{
267
182
  cols.push({
@@ -270,279 +185,62 @@ function Table(t0) {
270
185
  _index: i
271
186
  });
272
187
  });
273
- $[47] = columns;
274
- $[48] = expandColWidth;
275
- $[49] = expandable;
276
- $[50] = rowSelection;
277
- $[51] = selectionColWidth;
278
- $[52] = cols;
279
- } else cols = $[52];
280
- const allColumns = cols;
281
- let t19;
282
- if ($[53] !== allColumns || $[54] !== scroll?.x) {
283
- t19 = ()=>{
284
- if (!scroll?.x) return {};
285
- const positions = {};
286
- let leftOffset = 0;
287
- for (const col_2 of allColumns)if ("left" === col_2.fixed) {
288
- positions[col_2._key] = {
289
- left: leftOffset
188
+ return cols;
189
+ }, [
190
+ columns,
191
+ rowSelection,
192
+ selectionColWidth,
193
+ expandable,
194
+ expandColWidth
195
+ ]);
196
+ const stickyPositions = useMemo(()=>{
197
+ if (!scroll?.x) return {};
198
+ const positions = {};
199
+ let leftOffset = 0;
200
+ for (const col_2 of allColumns)if ('left' === col_2.fixed) {
201
+ positions[col_2._key] = {
202
+ ['rtl' === direction ? 'right' : 'left']: leftOffset
203
+ };
204
+ leftOffset += 'number' == typeof col_2.width ? col_2.width : 0;
205
+ }
206
+ let rightOffset = 0;
207
+ for(let i_0 = allColumns.length - 1; i_0 >= 0; i_0--){
208
+ const col_3 = allColumns[i_0];
209
+ if ('right' === col_3.fixed) {
210
+ positions[col_3._key] = {
211
+ ['rtl' === direction ? 'left' : 'right']: rightOffset
290
212
  };
291
- leftOffset += "number" == typeof col_2.width ? col_2.width : 0;
213
+ rightOffset += 'number' == typeof col_3.width ? col_3.width : 0;
292
214
  }
293
- let rightOffset = 0;
294
- for(let i_0 = allColumns.length - 1; i_0 >= 0; i_0--){
295
- const col_3 = allColumns[i_0];
296
- if ("right" === col_3.fixed) {
297
- positions[col_3._key] = {
298
- right: rightOffset
299
- };
300
- rightOffset += "number" == typeof col_3.width ? col_3.width : 0;
301
- }
302
- }
303
- return positions;
304
- };
305
- $[53] = allColumns;
306
- $[54] = scroll?.x;
307
- $[55] = t19;
308
- } else t19 = $[55];
309
- scroll?.x;
310
- let t20;
311
- if ($[56] !== t19) {
312
- t20 = t19();
313
- $[56] = t19;
314
- $[57] = t20;
315
- } else t20 = $[57];
316
- const stickyPositions = t20;
317
- let t21;
318
- if ($[58] !== allColumns || $[59] !== stickyPositions) {
319
- t21 = allColumns.map((col_4)=>({
215
+ }
216
+ return positions;
217
+ }, [
218
+ allColumns,
219
+ scroll?.x,
220
+ direction
221
+ ]);
222
+ const summaryColumns = useMemo(()=>allColumns.map((col_4)=>({
320
223
  fixed: col_4.fixed,
321
224
  sticky: stickyPositions[col_4._key]
322
- }));
323
- $[58] = allColumns;
324
- $[59] = stickyPositions;
325
- $[60] = t21;
326
- } else t21 = $[60];
327
- const summaryColumns = t21;
328
- let summaryNode;
329
- let t22;
330
- if ($[61] !== paginatedData || $[62] !== summary) {
331
- summaryNode = summary?.(paginatedData);
332
- t22 = /*#__PURE__*/ isValidElement(summaryNode) && summaryNode.type === TableSummary && !!summaryNode.props.fixed;
333
- $[61] = paginatedData;
334
- $[62] = summary;
335
- $[63] = summaryNode;
336
- $[64] = t22;
337
- } else {
338
- summaryNode = $[63];
339
- t22 = $[64];
340
- }
341
- const summaryFixed = t22;
225
+ })), [
226
+ allColumns,
227
+ stickyPositions
228
+ ]);
229
+ const summaryNode = summary?.(paginatedData);
230
+ const summaryFixed = /*#__PURE__*/ isValidElement(summaryNode) && summaryNode.type === TableSummary && !!summaryNode.props.fixed;
342
231
  const tableStyle = scroll?.x ? {
343
- minWidth: "number" == typeof scroll.x ? `${scroll.x}px` : scroll.x
232
+ minWidth: 'number' == typeof scroll.x ? `${scroll.x}px` : scroll.x
344
233
  } : {};
345
- let t23;
346
- if ($[65] !== selectablePageKeys || $[66] !== selectedKeySet) {
347
- let t24;
348
- if ($[68] !== selectedKeySet) {
349
- t24 = (key_2)=>selectedKeySet.has(key_2);
350
- $[68] = selectedKeySet;
351
- $[69] = t24;
352
- } else t24 = $[69];
353
- t23 = selectablePageKeys.filter(t24);
354
- $[65] = selectablePageKeys;
355
- $[66] = selectedKeySet;
356
- $[67] = t23;
357
- } else t23 = $[67];
358
- const selectedPageCount = t23.length;
234
+ const selectedPageCount = selectablePageKeys.filter((key_2)=>selectedKeySet.has(key_2)).length;
359
235
  const isAllSelected = selectablePageKeys.length > 0 && selectedPageCount === selectablePageKeys.length;
360
236
  const isIndeterminate = selectedPageCount > 0 && !isAllSelected;
361
- let t24;
362
- if ($[70] !== loading) {
363
- t24 = loading && /*#__PURE__*/ jsx(TableLoadingSpinner, {});
364
- $[70] = loading;
365
- $[71] = t24;
366
- } else t24 = $[71];
367
- const headerRowProps = onHeaderRow?.(columns, 0) ?? {};
368
- let t25;
369
- if ($[72] !== expandColWidth || $[73] !== expandable || $[74] !== stickyPositions) {
370
- t25 = expandable && /*#__PURE__*/ jsx("th", {
371
- "data-tao-table-cell": "",
372
- "data-tao-table-expand-cell": "",
373
- "data-tao-fixed": stickyPositions.__expand__ ? "left" : void 0,
374
- style: {
375
- width: expandColWidth,
376
- ...stickyStyle(stickyPositions.__expand__, 3)
377
- }
378
- });
379
- $[72] = expandColWidth;
380
- $[73] = expandable;
381
- $[74] = stickyPositions;
382
- $[75] = t25;
383
- } else t25 = $[75];
384
- const t26 = "";
385
- const t27 = 0 === paginatedData.length ? /*#__PURE__*/ jsx("tr", {
386
- children: /*#__PURE__*/ jsx("td", {
387
- "data-tao-table-cell": "",
388
- "data-tao-table-empty": "",
389
- colSpan: allColumns.length,
390
- className: resolvedClassNames.empty,
391
- style: resolvedStyles.empty,
392
- children: emptyText
393
- })
394
- }) : paginatedData.map((record_3, rowIdx)=>{
395
- const key_3 = getRowKey(record_3, rowKey);
396
- const isSelected = selectedKeySet.has(key_3);
397
- const checkboxProps = rowSelection?.getCheckboxProps?.(record_3);
398
- const rowProps = onRow?.(record_3, rowIdx) ?? {};
399
- const rowExpandable = !!expandable && (expandable.rowExpandable?.(record_3) ?? true);
400
- const isExpanded = rowExpandable && expandedKeySet.has(key_3);
401
- return /*#__PURE__*/ jsxs(Fragment, {
402
- children: [
403
- /*#__PURE__*/ jsxs("tr", {
404
- ...rowProps,
405
- "data-tao-table-row": "",
406
- "data-tao-selected": isSelected || void 0,
407
- onClick: (event)=>{
408
- const selectionCell = event.target.closest("[data-tao-table-selection-cell]");
409
- if (selectionCell && event.target !== selectionCell) return void event.stopPropagation();
410
- rowProps.onClick?.(event);
411
- if (rowExpandable && expandable?.expandRowByClick) toggleExpand(record_3, key_3);
412
- },
413
- className: cx(resolvedClassNames["body.row"], resolveRowClassName(rowClassName, record_3, rowIdx), rowProps.className),
414
- style: {
415
- ...resolvedStyles["body.row"],
416
- ...resolveRowStyle(rowStyle, record_3, rowIdx),
417
- ...rowProps.style
418
- },
419
- children: [
420
- expandable && /*#__PURE__*/ jsx("td", {
421
- "data-tao-table-cell": "",
422
- "data-tao-table-expand-cell": "",
423
- "data-tao-fixed": stickyPositions.__expand__ ? "left" : void 0,
424
- style: stickyStyle(stickyPositions.__expand__, 1),
425
- children: rowExpandable && /*#__PURE__*/ jsx(ExpandIcon, {
426
- expanded: isExpanded,
427
- onClick: (e_0)=>{
428
- e_0.stopPropagation();
429
- toggleExpand(record_3, key_3);
430
- }
431
- })
432
- }),
433
- rowSelection && /*#__PURE__*/ jsx("td", {
434
- "data-tao-table-cell": "",
435
- "data-tao-table-selection-cell": "",
436
- "data-tao-fixed": stickyPositions.__selection__ ? "left" : void 0,
437
- className: resolvedClassNames["selection.cell"],
438
- style: {
439
- ...stickyStyle(stickyPositions.__selection__, 1),
440
- ...resolvedStyles["selection.cell"]
441
- },
442
- children: "radio" === selectionType ? /*#__PURE__*/ jsx(Radio, {
443
- checked: isSelected,
444
- "aria-label": `Select row ${String(key_3)}`,
445
- disabled: checkboxProps?.disabled ?? false,
446
- onChange: ()=>handleSelectRow(key_3)
447
- }) : /*#__PURE__*/ jsx(Checkbox, {
448
- checked: isSelected,
449
- "aria-label": `Select row ${String(key_3)}`,
450
- disabled: checkboxProps?.disabled ?? false,
451
- onChange: ()=>handleSelectRow(key_3)
452
- })
453
- }),
454
- columns.map((col_6, colIdx)=>{
455
- const colKey_0 = getColKey(col_6, colIdx);
456
- const value = getCellValue(record_3, col_6.dataIndex);
457
- const stickyPos_0 = stickyPositions[colKey_0];
458
- const isFixed_0 = !!col_6.fixed && !!scroll?.x;
459
- const cellProps = col_6.onCell?.(record_3, rowIdx) ?? {};
460
- return /*#__PURE__*/ createElement("td", {
461
- ...cellProps,
462
- key: colKey_0,
463
- "data-tao-table-cell": "",
464
- "data-tao-align": col_6.align,
465
- "data-tao-ellipsis": col_6.ellipsis || void 0,
466
- "data-tao-fixed": isFixed_0 ? col_6.fixed : void 0,
467
- className: cx(resolvedClassNames["body.cell"], cellProps.className),
468
- style: {
469
- ...resolvedStyles["body.cell"],
470
- ...stickyStyle(isFixed_0 ? stickyPos_0 : void 0, 1),
471
- ...cellProps.style
472
- }
473
- }, col_6.render ? col_6.render(value, record_3, rowIdx) : value);
474
- })
475
- ]
476
- }),
477
- isExpanded && /*#__PURE__*/ jsx("tr", {
478
- "data-tao-table-expanded-row": "",
479
- className: resolvedClassNames.expandedRow,
480
- style: resolvedStyles.expandedRow,
481
- children: /*#__PURE__*/ jsx("td", {
482
- "data-tao-table-cell": "",
483
- colSpan: allColumns.length,
484
- children: /*#__PURE__*/ jsx("div", {
485
- "data-tao-table-expanded-content": "",
486
- style: scroll?.x ? {
487
- width: viewportWidth
488
- } : void 0,
489
- children: expandable.expandedRowRender(record_3, rowIdx)
490
- })
491
- })
492
- })
493
- ]
494
- }, key_3);
495
- });
496
- let t28;
497
- if ($[76] !== t27) {
498
- t28 = /*#__PURE__*/ jsx("tbody", {
499
- "data-tao-table-tbody": t26,
500
- children: t27
501
- });
502
- $[76] = t27;
503
- $[77] = t28;
504
- } else t28 = $[77];
505
- let t29;
506
- if ($[78] !== resolvedClassNames || $[79] !== resolvedStyles || $[80] !== summaryColumns || $[81] !== summaryFixed || $[82] !== summaryNode) {
507
- t29 = null != summaryNode && /*#__PURE__*/ jsx("tfoot", {
508
- "data-tao-table-summary": "",
509
- "data-tao-summary-fixed": summaryFixed || void 0,
510
- className: resolvedClassNames.summary,
511
- style: resolvedStyles.summary,
512
- children: /*#__PURE__*/ jsx(TableSummaryContext.Provider, {
513
- value: summaryColumns,
514
- children: summaryNode
515
- })
516
- });
517
- $[78] = resolvedClassNames;
518
- $[79] = resolvedStyles;
519
- $[80] = summaryColumns;
520
- $[81] = summaryFixed;
521
- $[82] = summaryNode;
522
- $[83] = t29;
523
- } else t29 = $[83];
524
- let t30;
525
- if ($[84] !== resolvedClassNames || $[85] !== resolvedSize || $[86] !== resolvedStyles || $[87] !== tableData.pagination) {
526
- t30 = tableData.pagination && tableData.pagination.total > 0 && /*#__PURE__*/ jsx("div", {
527
- "data-tao-table-pagination": "",
528
- className: resolvedClassNames.pagination,
529
- style: resolvedStyles.pagination,
530
- children: /*#__PURE__*/ jsx(Pagination, {
531
- ...tableData.pagination,
532
- size: resolvedSize
533
- })
534
- });
535
- $[84] = resolvedClassNames;
536
- $[85] = resolvedSize;
537
- $[86] = resolvedStyles;
538
- $[87] = tableData.pagination;
539
- $[88] = t30;
540
- } else t30 = $[88];
541
237
  return /*#__PURE__*/ jsxs("div", {
238
+ ref: directionRef,
542
239
  "data-tao-table-wrapper": "",
240
+ "data-tao-direction": direction,
543
241
  "data-tao-size": resolvedSize,
544
242
  "data-tao-variant": resolvedVariant,
545
- "data-tao-header-bg": headerBackground ? void 0 : "off",
243
+ "data-tao-header-bg": headerBackground ? void 0 : 'off',
546
244
  "data-tao-bordered": showBorder || void 0,
547
245
  "data-tao-scroll-state": scroll?.x ? scrollState : void 0,
548
246
  className: cx(resolvedClassNames.root, className),
@@ -551,10 +249,10 @@ function Table(t0) {
551
249
  ...style
552
250
  },
553
251
  children: [
554
- t24,
252
+ loading && /*#__PURE__*/ jsx(TableLoadingSpinner, {}),
555
253
  /*#__PURE__*/ jsx("div", {
556
254
  "data-tao-table-scroll": "",
557
- "data-tao-scroll-y": scroll?.y ? "" : void 0,
255
+ "data-tao-scroll-y": scroll?.y ? '' : void 0,
558
256
  ref: scrollRef,
559
257
  onScroll: scroll?.x ? handleScroll : void 0,
560
258
  className: resolvedClassNames.scroll,
@@ -572,104 +270,242 @@ function Table(t0) {
572
270
  children: [
573
271
  /*#__PURE__*/ jsx("thead", {
574
272
  "data-tao-table-thead": "",
575
- className: resolvedClassNames["header.wrapper"],
576
- style: resolvedStyles["header.wrapper"],
577
- children: /*#__PURE__*/ jsxs("tr", {
578
- ...headerRowProps,
579
- className: cx(resolvedClassNames["header.row"], headerRowProps.className),
580
- style: {
581
- ...resolvedStyles["header.row"],
582
- ...headerRowProps.style
583
- },
584
- children: [
585
- t25,
586
- rowSelection && /*#__PURE__*/ jsx("th", {
587
- "data-tao-table-cell": "",
588
- "data-tao-table-selection-cell": "",
589
- "data-tao-fixed": stickyPositions.__selection__ ? "left" : void 0,
590
- className: resolvedClassNames["selection.cell"],
591
- style: {
592
- width: selectionColWidth,
593
- ...stickyStyle(stickyPositions.__selection__, 3),
594
- ...resolvedStyles["selection.cell"]
595
- },
596
- children: "checkbox" === selectionType && /*#__PURE__*/ jsx(Checkbox, {
597
- "aria-label": "Select all rows",
598
- checked: isAllSelected,
599
- disabled: 0 === selectablePageKeys.length,
600
- indeterminate: isIndeterminate,
601
- onChange: (e)=>handleSelectAll(e.target.checked)
602
- })
603
- }),
604
- columns.map((col_5, i_1)=>{
605
- const colKey = getColKey(col_5, i_1);
606
- const hasSorter = !!col_5.sorter;
607
- const hasFilter = !!(col_5.filters && col_5.filters.length > 0);
608
- const { sortOrder: resolvedOrder, filteredValue: activeFilterValues, onSort, onFilter } = tableData.getColumnState(i_1);
609
- const stickyPos = stickyPositions[colKey];
610
- const isFixed = !!col_5.fixed && !!scroll?.x;
611
- const headerCellProps = col_5.onHeaderCell?.(col_5) ?? {};
612
- return /*#__PURE__*/ createElement("th", {
613
- ...headerCellProps,
614
- key: colKey,
273
+ className: resolvedClassNames['header.wrapper'],
274
+ style: resolvedStyles['header.wrapper'],
275
+ children: (()=>{
276
+ const headerRowProps = onHeaderRow?.(columns, 0) ?? {};
277
+ return /*#__PURE__*/ jsxs("tr", {
278
+ ...headerRowProps,
279
+ className: cx(resolvedClassNames['header.row'], headerRowProps.className),
280
+ style: {
281
+ ...resolvedStyles['header.row'],
282
+ ...headerRowProps.style
283
+ },
284
+ children: [
285
+ expandable && /*#__PURE__*/ jsx("th", {
615
286
  "data-tao-table-cell": "",
616
- "data-tao-table-header": "",
617
- "data-tao-align": col_5.align,
618
- "data-tao-fixed": isFixed ? col_5.fixed : void 0,
619
- "aria-sort": hasSorter ? "ascend" === resolvedOrder ? "ascending" : "descend" === resolvedOrder ? "descending" : "none" : void 0,
620
- className: cx(resolvedClassNames["header.cell"], headerCellProps.className),
287
+ "data-tao-table-expand-cell": "",
288
+ "data-tao-fixed": stickyPositions.__expand__ ? 'left' : void 0,
621
289
  style: {
622
- ...resolvedStyles["header.cell"],
623
- width: col_5.width,
624
- ...stickyStyle(isFixed ? stickyPos : void 0, 3),
625
- ...headerCellProps.style
290
+ width: expandColWidth,
291
+ ...stickyStyle(stickyPositions.__expand__, 3)
626
292
  }
627
- }, /*#__PURE__*/ jsxs("div", {
628
- "data-tao-table-header-content": "",
629
- className: resolvedClassNames["header.content"],
630
- style: resolvedStyles["header.content"],
293
+ }),
294
+ rowSelection && /*#__PURE__*/ jsx("th", {
295
+ "data-tao-table-cell": "",
296
+ "data-tao-table-selection-cell": "",
297
+ "data-tao-fixed": stickyPositions.__selection__ ? 'left' : void 0,
298
+ className: resolvedClassNames['selection.cell'],
299
+ style: {
300
+ width: selectionColWidth,
301
+ ...stickyStyle(stickyPositions.__selection__, 3),
302
+ ...resolvedStyles['selection.cell']
303
+ },
304
+ children: 'checkbox' === selectionType && /*#__PURE__*/ jsx(Checkbox, {
305
+ "aria-label": "Select all rows",
306
+ checked: isAllSelected,
307
+ disabled: 0 === selectablePageKeys.length,
308
+ indeterminate: isIndeterminate,
309
+ onChange: (e)=>handleSelectAll(e.target.checked)
310
+ })
311
+ }),
312
+ columns.map((col_5, i_1)=>{
313
+ const colKey = getColKey(col_5, i_1);
314
+ const hasSorter = !!col_5.sorter;
315
+ const hasFilter = !!(col_5.filters && col_5.filters.length > 0);
316
+ const { sortOrder: resolvedOrder, filteredValue: activeFilterValues, onSort, onFilter } = tableData.getColumnState(i_1);
317
+ const stickyPos = stickyPositions[colKey];
318
+ const isFixed = !!col_5.fixed && !!scroll?.x;
319
+ const headerCellProps = col_5.onHeaderCell?.(col_5) ?? {};
320
+ return /*#__PURE__*/ createElement("th", {
321
+ ...headerCellProps,
322
+ key: colKey,
323
+ "data-tao-table-cell": "",
324
+ "data-tao-table-header": "",
325
+ "data-tao-align": col_5.align,
326
+ "data-tao-fixed": isFixed ? col_5.fixed : void 0,
327
+ "aria-sort": hasSorter ? 'ascend' === resolvedOrder ? 'ascending' : 'descend' === resolvedOrder ? 'descending' : 'none' : void 0,
328
+ className: cx(resolvedClassNames['header.cell'], headerCellProps.className),
329
+ style: {
330
+ ...resolvedStyles['header.cell'],
331
+ width: col_5.width,
332
+ ...stickyStyle(isFixed ? stickyPos : void 0, 3),
333
+ ...headerCellProps.style
334
+ }
335
+ }, /*#__PURE__*/ jsxs("div", {
336
+ "data-tao-table-header-content": "",
337
+ className: resolvedClassNames['header.content'],
338
+ style: resolvedStyles['header.content'],
339
+ children: [
340
+ hasSorter ? /*#__PURE__*/ jsxs("button", {
341
+ type: "button",
342
+ "data-tao-table-header-title": "",
343
+ "data-tao-sortable": "",
344
+ className: resolvedClassNames['header.title'],
345
+ style: resolvedStyles['header.title'],
346
+ onClick: onSort,
347
+ children: [
348
+ col_5.title,
349
+ /*#__PURE__*/ jsx(SortIcon, {
350
+ order: resolvedOrder
351
+ })
352
+ ]
353
+ }) : /*#__PURE__*/ jsx("span", {
354
+ "data-tao-table-header-title": "",
355
+ className: resolvedClassNames['header.title'],
356
+ style: resolvedStyles['header.title'],
357
+ children: col_5.title
358
+ }),
359
+ hasFilter && /*#__PURE__*/ jsx(TableFilterDropdown, {
360
+ filters: col_5.filters,
361
+ activeValues: activeFilterValues,
362
+ onSelect: onFilter
363
+ })
364
+ ]
365
+ }));
366
+ })
367
+ ]
368
+ });
369
+ })()
370
+ }),
371
+ /*#__PURE__*/ jsx("tbody", {
372
+ "data-tao-table-tbody": "",
373
+ children: 0 === paginatedData.length ? /*#__PURE__*/ jsx("tr", {
374
+ children: /*#__PURE__*/ jsx("td", {
375
+ "data-tao-table-cell": "",
376
+ "data-tao-table-empty": "",
377
+ colSpan: allColumns.length,
378
+ className: resolvedClassNames.empty,
379
+ style: resolvedStyles.empty,
380
+ children: emptyText
381
+ })
382
+ }) : paginatedData.map((record_3, rowIdx)=>{
383
+ const key_3 = getRowKey(record_3, rowKey);
384
+ const isSelected = selectedKeySet.has(key_3);
385
+ const checkboxProps = rowSelection?.getCheckboxProps?.(record_3);
386
+ const rowProps = onRow?.(record_3, rowIdx) ?? {};
387
+ const rowExpandable = !!expandable && (expandable.rowExpandable?.(record_3) ?? true);
388
+ const isExpanded = rowExpandable && expandedKeySet.has(key_3);
389
+ return /*#__PURE__*/ jsxs(Fragment, {
390
+ children: [
391
+ /*#__PURE__*/ jsxs("tr", {
392
+ ...rowProps,
393
+ "data-tao-table-row": "",
394
+ "data-tao-selected": isSelected || void 0,
395
+ onClick: (event)=>{
396
+ const selectionCell = event.target.closest('[data-tao-table-selection-cell]');
397
+ if (selectionCell && event.target !== selectionCell) return void event.stopPropagation();
398
+ rowProps.onClick?.(event);
399
+ if (rowExpandable && expandable?.expandRowByClick) toggleExpand(record_3, key_3);
400
+ },
401
+ className: cx(resolvedClassNames['body.row'], resolveRowClassName(rowClassName, record_3, rowIdx), rowProps.className),
402
+ style: {
403
+ ...resolvedStyles['body.row'],
404
+ ...resolveRowStyle(rowStyle, record_3, rowIdx),
405
+ ...rowProps.style
406
+ },
631
407
  children: [
632
- hasSorter ? /*#__PURE__*/ jsxs("button", {
633
- type: "button",
634
- "data-tao-table-header-title": "",
635
- "data-tao-sortable": "",
636
- className: resolvedClassNames["header.title"],
637
- style: resolvedStyles["header.title"],
638
- onClick: onSort,
639
- children: [
640
- col_5.title,
641
- /*#__PURE__*/ jsx(SortIcon, {
642
- order: resolvedOrder
643
- })
644
- ]
645
- }) : /*#__PURE__*/ jsx("span", {
646
- "data-tao-table-header-title": "",
647
- className: resolvedClassNames["header.title"],
648
- style: resolvedStyles["header.title"],
649
- children: col_5.title
408
+ expandable && /*#__PURE__*/ jsx("td", {
409
+ "data-tao-table-cell": "",
410
+ "data-tao-table-expand-cell": "",
411
+ "data-tao-fixed": stickyPositions.__expand__ ? 'left' : void 0,
412
+ style: stickyStyle(stickyPositions.__expand__, 1),
413
+ children: rowExpandable && /*#__PURE__*/ jsx(ExpandIcon, {
414
+ expanded: isExpanded,
415
+ onClick: (e_0)=>{
416
+ e_0.stopPropagation();
417
+ toggleExpand(record_3, key_3);
418
+ }
419
+ })
420
+ }),
421
+ rowSelection && /*#__PURE__*/ jsx("td", {
422
+ "data-tao-table-cell": "",
423
+ "data-tao-table-selection-cell": "",
424
+ "data-tao-fixed": stickyPositions.__selection__ ? 'left' : void 0,
425
+ className: resolvedClassNames['selection.cell'],
426
+ style: {
427
+ ...stickyStyle(stickyPositions.__selection__, 1),
428
+ ...resolvedStyles['selection.cell']
429
+ },
430
+ children: 'radio' === selectionType ? /*#__PURE__*/ jsx(Radio, {
431
+ checked: isSelected,
432
+ "aria-label": `Select row ${String(key_3)}`,
433
+ disabled: checkboxProps?.disabled ?? false,
434
+ onChange: ()=>handleSelectRow(key_3)
435
+ }) : /*#__PURE__*/ jsx(Checkbox, {
436
+ checked: isSelected,
437
+ "aria-label": `Select row ${String(key_3)}`,
438
+ disabled: checkboxProps?.disabled ?? false,
439
+ onChange: ()=>handleSelectRow(key_3)
440
+ })
650
441
  }),
651
- hasFilter && /*#__PURE__*/ jsx(TableFilterDropdown, {
652
- filters: col_5.filters,
653
- activeValues: activeFilterValues,
654
- onSelect: onFilter
442
+ columns.map((col_6, colIdx)=>{
443
+ const colKey_0 = getColKey(col_6, colIdx);
444
+ const value = getCellValue(record_3, col_6.dataIndex);
445
+ const stickyPos_0 = stickyPositions[colKey_0];
446
+ const isFixed_0 = !!col_6.fixed && !!scroll?.x;
447
+ const cellProps = col_6.onCell?.(record_3, rowIdx) ?? {};
448
+ return /*#__PURE__*/ createElement("td", {
449
+ ...cellProps,
450
+ key: colKey_0,
451
+ "data-tao-table-cell": "",
452
+ "data-tao-align": col_6.align,
453
+ "data-tao-ellipsis": col_6.ellipsis || void 0,
454
+ "data-tao-fixed": isFixed_0 ? col_6.fixed : void 0,
455
+ className: cx(resolvedClassNames['body.cell'], cellProps.className),
456
+ style: {
457
+ ...resolvedStyles['body.cell'],
458
+ ...stickyStyle(isFixed_0 ? stickyPos_0 : void 0, 1),
459
+ ...cellProps.style
460
+ }
461
+ }, col_6.render ? col_6.render(value, record_3, rowIdx) : value);
655
462
  })
656
463
  ]
657
- }));
658
- })
659
- ]
464
+ }),
465
+ isExpanded && /*#__PURE__*/ jsx("tr", {
466
+ "data-tao-table-expanded-row": "",
467
+ className: resolvedClassNames.expandedRow,
468
+ style: resolvedStyles.expandedRow,
469
+ children: /*#__PURE__*/ jsx("td", {
470
+ "data-tao-table-cell": "",
471
+ colSpan: allColumns.length,
472
+ children: /*#__PURE__*/ jsx("div", {
473
+ "data-tao-table-expanded-content": "",
474
+ style: scroll?.x ? {
475
+ width: viewportWidth
476
+ } : void 0,
477
+ children: expandable.expandedRowRender(record_3, rowIdx)
478
+ })
479
+ })
480
+ })
481
+ ]
482
+ }, key_3);
660
483
  })
661
484
  }),
662
- t28,
663
- t29
485
+ null != summaryNode && /*#__PURE__*/ jsx("tfoot", {
486
+ "data-tao-table-summary": "",
487
+ "data-tao-summary-fixed": summaryFixed || void 0,
488
+ className: resolvedClassNames.summary,
489
+ style: resolvedStyles.summary,
490
+ children: /*#__PURE__*/ jsx(TableSummaryContext.Provider, {
491
+ value: summaryColumns,
492
+ children: summaryNode
493
+ })
494
+ })
664
495
  ]
665
496
  })
666
497
  }),
667
- t30
498
+ tableData.pagination && tableData.pagination.total > 0 && /*#__PURE__*/ jsx("div", {
499
+ "data-tao-table-pagination": "",
500
+ className: resolvedClassNames.pagination,
501
+ style: resolvedStyles.pagination,
502
+ children: /*#__PURE__*/ jsx(Pagination, {
503
+ ...tableData.pagination,
504
+ size: resolvedSize
505
+ })
506
+ })
668
507
  ]
669
508
  });
670
509
  }
671
- function _temp(col_0) {
672
- return col_0.responsive;
673
- }
674
510
  Table.Summary = TableSummary;
675
511
  export { Table };