@rockshin/tao-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/components/button/button.css +1055 -0
- package/dist/components/button/button.d.ts +15 -0
- package/dist/components/button/button.js +93 -0
- package/dist/components/checkbox/checkbox.css +1035 -0
- package/dist/components/checkbox/checkbox.d.ts +33 -0
- package/dist/components/checkbox/checkbox.js +312 -0
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +18 -0
- package/dist/components/date-picker/calendar/calendar-grid.js +173 -0
- package/dist/components/date-picker/calendar/calendar-header.d.ts +10 -0
- package/dist/components/date-picker/calendar/calendar-header.js +336 -0
- package/dist/components/date-picker/calendar/month-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/month-grid.js +61 -0
- package/dist/components/date-picker/calendar/time-panel.d.ts +12 -0
- package/dist/components/date-picker/calendar/time-panel.js +233 -0
- package/dist/components/date-picker/calendar/use-calendar.d.ts +15 -0
- package/dist/components/date-picker/calendar/use-calendar.js +24 -0
- package/dist/components/date-picker/calendar/year-grid.d.ts +9 -0
- package/dist/components/date-picker/calendar/year-grid.js +60 -0
- package/dist/components/date-picker/date-picker.css +1799 -0
- package/dist/components/date-picker/date-picker.d.ts +29 -0
- package/dist/components/date-picker/date-picker.js +663 -0
- package/dist/components/date-picker/presets.d.ts +9 -0
- package/dist/components/date-picker/presets.js +36 -0
- package/dist/components/date-picker/range-picker.d.ts +30 -0
- package/dist/components/date-picker/range-picker.js +432 -0
- package/dist/components/date-picker/types.d.ts +39 -0
- package/dist/components/date-picker/types.js +7 -0
- package/dist/components/drawer/drawer.css +1112 -0
- package/dist/components/drawer/drawer.d.ts +17 -0
- package/dist/components/drawer/drawer.js +184 -0
- package/dist/components/form-actions/form-actions.d.ts +12 -0
- package/dist/components/form-actions/form-actions.js +42 -0
- package/dist/components/form-field/form-field.d.ts +17 -0
- package/dist/components/form-field/form-field.js +101 -0
- package/dist/components/form-field/form.css +1036 -0
- package/dist/components/form-section/form-section.d.ts +14 -0
- package/dist/components/form-section/form-section.js +92 -0
- package/dist/components/input/input.css +1185 -0
- package/dist/components/input/input.d.ts +15 -0
- package/dist/components/input/input.js +143 -0
- package/dist/components/pagination/pagination.css +1099 -0
- package/dist/components/pagination/pagination.d.ts +22 -0
- package/dist/components/pagination/pagination.js +310 -0
- package/dist/components/radio/radio.css +1045 -0
- package/dist/components/radio/radio.d.ts +34 -0
- package/dist/components/radio/radio.js +215 -0
- package/dist/components/scroll-area/scroll-area.css +1099 -0
- package/dist/components/scroll-area/scroll-area.d.ts +33 -0
- package/dist/components/scroll-area/scroll-area.js +375 -0
- package/dist/components/select/mobile-select.css +1044 -0
- package/dist/components/select/mobile-select.d.ts +19 -0
- package/dist/components/select/mobile-select.js +224 -0
- package/dist/components/select/select.css +1327 -0
- package/dist/components/select/select.d.ts +32 -0
- package/dist/components/select/select.js +532 -0
- package/dist/components/select/use-is-mobile.d.ts +1 -0
- package/dist/components/select/use-is-mobile.js +30 -0
- package/dist/components/splitter/splitter.css +1104 -0
- package/dist/components/splitter/splitter.d.ts +33 -0
- package/dist/components/splitter/splitter.js +451 -0
- package/dist/components/switch/switch.css +1170 -0
- package/dist/components/switch/switch.d.ts +19 -0
- package/dist/components/switch/switch.js +143 -0
- package/dist/components/table/table.css +1255 -0
- package/dist/components/table/table.d.ts +73 -0
- package/dist/components/table/table.js +1022 -0
- package/dist/components/tabs/tabs.css +1076 -0
- package/dist/components/tabs/tabs.d.ts +24 -0
- package/dist/components/tabs/tabs.js +256 -0
- package/dist/components/tag/tag.css +1124 -0
- package/dist/components/tag/tag.d.ts +33 -0
- package/dist/components/tag/tag.js +237 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +23 -0
- package/dist/layouts/form-layout/form-layout.d.ts +6 -0
- package/dist/layouts/form-layout/form-layout.js +18 -0
- package/dist/layouts/stack/layout.css +1003 -0
- package/dist/layouts/stack/stack.d.ts +9 -0
- package/dist/layouts/stack/stack.js +27 -0
- package/dist/number-input/cursor.d.ts +9 -0
- package/dist/number-input/cursor.js +44 -0
- package/dist/number-input/format.d.ts +5 -0
- package/dist/number-input/format.js +50 -0
- package/dist/number-input/index.d.ts +5 -0
- package/dist/number-input/index.js +2 -0
- package/dist/number-input/number-input.d.ts +9 -0
- package/dist/number-input/number-input.js +101 -0
- package/dist/number-input/percentage.d.ts +3 -0
- package/dist/number-input/percentage.js +28 -0
- package/dist/number-input/types.d.ts +5 -0
- package/dist/number-input/types.js +0 -0
- package/dist/number-input/use-number-input.d.ts +30 -0
- package/dist/number-input/use-number-input.js +211 -0
- package/dist/number-input/validate.d.ts +3 -0
- package/dist/number-input/validate.js +17 -0
- package/dist/provider/tao-provider.d.ts +42 -0
- package/dist/provider/tao-provider.js +67 -0
- package/dist/theme/control.css +1061 -0
- package/dist/theme/theme.css +957 -0
- package/dist/utils/semantic.d.ts +10 -0
- package/dist/utils/semantic.js +5 -0
- package/llms.txt +67 -0
- package/package.json +97 -0
|
@@ -0,0 +1,1022 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c as compiler_runtime_c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
|
+
import { cx } from "../../utils/semantic.js";
|
|
6
|
+
import { Pagination } from "../pagination/pagination.js";
|
|
7
|
+
import "./table.css";
|
|
8
|
+
function getRowKey(record, rowKey) {
|
|
9
|
+
if ('function' == typeof rowKey) return rowKey(record);
|
|
10
|
+
return record[rowKey];
|
|
11
|
+
}
|
|
12
|
+
function getColKey(col, index) {
|
|
13
|
+
return col.key ?? col.dataIndex ?? String(index);
|
|
14
|
+
}
|
|
15
|
+
function getCellValue(record, dataIndex) {
|
|
16
|
+
if (!dataIndex) return;
|
|
17
|
+
return record[dataIndex];
|
|
18
|
+
}
|
|
19
|
+
function SortIcon(t0) {
|
|
20
|
+
const $ = compiler_runtime_c(10);
|
|
21
|
+
const { order } = t0;
|
|
22
|
+
const t1 = order ?? void 0;
|
|
23
|
+
const t2 = "ascend" === order ? 1 : 0.3;
|
|
24
|
+
let t3;
|
|
25
|
+
if ($[0] !== t2) {
|
|
26
|
+
t3 = /*#__PURE__*/ jsx("path", {
|
|
27
|
+
d: "M7 2.5L10 6H4L7 2.5Z",
|
|
28
|
+
fill: "currentColor",
|
|
29
|
+
opacity: t2
|
|
30
|
+
});
|
|
31
|
+
$[0] = t2;
|
|
32
|
+
$[1] = t3;
|
|
33
|
+
} else t3 = $[1];
|
|
34
|
+
const t4 = "descend" === order ? 1 : 0.3;
|
|
35
|
+
let t5;
|
|
36
|
+
if ($[2] !== t4) {
|
|
37
|
+
t5 = /*#__PURE__*/ jsx("path", {
|
|
38
|
+
d: "M7 11.5L4 8H10L7 11.5Z",
|
|
39
|
+
fill: "currentColor",
|
|
40
|
+
opacity: t4
|
|
41
|
+
});
|
|
42
|
+
$[2] = t4;
|
|
43
|
+
$[3] = t5;
|
|
44
|
+
} else t5 = $[3];
|
|
45
|
+
let t6;
|
|
46
|
+
if ($[4] !== t3 || $[5] !== t5) {
|
|
47
|
+
t6 = /*#__PURE__*/ jsxs("svg", {
|
|
48
|
+
width: "14",
|
|
49
|
+
height: "14",
|
|
50
|
+
viewBox: "0 0 14 14",
|
|
51
|
+
fill: "none",
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
children: [
|
|
54
|
+
t3,
|
|
55
|
+
t5
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
$[4] = t3;
|
|
59
|
+
$[5] = t5;
|
|
60
|
+
$[6] = t6;
|
|
61
|
+
} else t6 = $[6];
|
|
62
|
+
let t7;
|
|
63
|
+
if ($[7] !== t1 || $[8] !== t6) {
|
|
64
|
+
t7 = /*#__PURE__*/ jsx("span", {
|
|
65
|
+
"data-tao-table-sort-icon": "",
|
|
66
|
+
"data-tao-sort-order": t1,
|
|
67
|
+
children: t6
|
|
68
|
+
});
|
|
69
|
+
$[7] = t1;
|
|
70
|
+
$[8] = t6;
|
|
71
|
+
$[9] = t7;
|
|
72
|
+
} else t7 = $[9];
|
|
73
|
+
return t7;
|
|
74
|
+
}
|
|
75
|
+
function FilterIcon(t0) {
|
|
76
|
+
const $ = compiler_runtime_c(5);
|
|
77
|
+
const { active } = t0;
|
|
78
|
+
const t1 = active || void 0;
|
|
79
|
+
const t2 = active ? "currentColor" : "none";
|
|
80
|
+
let t3;
|
|
81
|
+
if ($[0] !== t2) {
|
|
82
|
+
t3 = /*#__PURE__*/ jsx("svg", {
|
|
83
|
+
width: "14",
|
|
84
|
+
height: "14",
|
|
85
|
+
viewBox: "0 0 14 14",
|
|
86
|
+
fill: "none",
|
|
87
|
+
"aria-hidden": true,
|
|
88
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
89
|
+
d: "M2 3h10L8.5 7.5V11L5.5 12V7.5L2 3Z",
|
|
90
|
+
stroke: "currentColor",
|
|
91
|
+
fill: t2,
|
|
92
|
+
strokeWidth: "1.2",
|
|
93
|
+
strokeLinejoin: "round"
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
$[0] = t2;
|
|
97
|
+
$[1] = t3;
|
|
98
|
+
} else t3 = $[1];
|
|
99
|
+
let t4;
|
|
100
|
+
if ($[2] !== t1 || $[3] !== t3) {
|
|
101
|
+
t4 = /*#__PURE__*/ jsx("span", {
|
|
102
|
+
"data-tao-table-filter-icon": "",
|
|
103
|
+
"data-tao-active": t1,
|
|
104
|
+
children: t3
|
|
105
|
+
});
|
|
106
|
+
$[2] = t1;
|
|
107
|
+
$[3] = t3;
|
|
108
|
+
$[4] = t4;
|
|
109
|
+
} else t4 = $[4];
|
|
110
|
+
return t4;
|
|
111
|
+
}
|
|
112
|
+
function LoadingSpinner() {
|
|
113
|
+
const $ = compiler_runtime_c(1);
|
|
114
|
+
let t0;
|
|
115
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
116
|
+
t0 = /*#__PURE__*/ jsx("div", {
|
|
117
|
+
"data-tao-table-loading": "",
|
|
118
|
+
children: /*#__PURE__*/ jsxs("svg", {
|
|
119
|
+
"data-tao-table-spinner": "",
|
|
120
|
+
width: "24",
|
|
121
|
+
height: "24",
|
|
122
|
+
viewBox: "0 0 24 24",
|
|
123
|
+
fill: "none",
|
|
124
|
+
"aria-hidden": true,
|
|
125
|
+
children: [
|
|
126
|
+
/*#__PURE__*/ jsx("circle", {
|
|
127
|
+
cx: "12",
|
|
128
|
+
cy: "12",
|
|
129
|
+
r: "10",
|
|
130
|
+
stroke: "currentColor",
|
|
131
|
+
strokeWidth: "2.5",
|
|
132
|
+
opacity: "0.2"
|
|
133
|
+
}),
|
|
134
|
+
/*#__PURE__*/ jsx("path", {
|
|
135
|
+
d: "M12 2a10 10 0 019.8 8",
|
|
136
|
+
stroke: "currentColor",
|
|
137
|
+
strokeWidth: "2.5",
|
|
138
|
+
strokeLinecap: "round"
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
})
|
|
142
|
+
});
|
|
143
|
+
$[0] = t0;
|
|
144
|
+
} else t0 = $[0];
|
|
145
|
+
return t0;
|
|
146
|
+
}
|
|
147
|
+
function CheckIcon() {
|
|
148
|
+
const $ = compiler_runtime_c(1);
|
|
149
|
+
let t0;
|
|
150
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
151
|
+
t0 = /*#__PURE__*/ jsx("svg", {
|
|
152
|
+
width: "12",
|
|
153
|
+
height: "12",
|
|
154
|
+
viewBox: "0 0 12 12",
|
|
155
|
+
fill: "none",
|
|
156
|
+
"aria-hidden": true,
|
|
157
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
158
|
+
d: "M2.5 6L5 8.5L9.5 3.5",
|
|
159
|
+
stroke: "currentColor",
|
|
160
|
+
strokeWidth: "1.5",
|
|
161
|
+
strokeLinecap: "round",
|
|
162
|
+
strokeLinejoin: "round"
|
|
163
|
+
})
|
|
164
|
+
});
|
|
165
|
+
$[0] = t0;
|
|
166
|
+
} else t0 = $[0];
|
|
167
|
+
return t0;
|
|
168
|
+
}
|
|
169
|
+
function FilterDropdown(t0) {
|
|
170
|
+
const $ = compiler_runtime_c(22);
|
|
171
|
+
const { filters, activeValues, onSelect } = t0;
|
|
172
|
+
const [open, setOpen] = useState(false);
|
|
173
|
+
const ref = useRef(null);
|
|
174
|
+
let t1;
|
|
175
|
+
let t2;
|
|
176
|
+
if ($[0] !== open) {
|
|
177
|
+
t1 = ()=>{
|
|
178
|
+
if (!open) return;
|
|
179
|
+
const handleClick = (e)=>{
|
|
180
|
+
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
181
|
+
};
|
|
182
|
+
document.addEventListener("mousedown", handleClick);
|
|
183
|
+
return ()=>document.removeEventListener("mousedown", handleClick);
|
|
184
|
+
};
|
|
185
|
+
t2 = [
|
|
186
|
+
open
|
|
187
|
+
];
|
|
188
|
+
$[0] = open;
|
|
189
|
+
$[1] = t1;
|
|
190
|
+
$[2] = t2;
|
|
191
|
+
} else {
|
|
192
|
+
t1 = $[1];
|
|
193
|
+
t2 = $[2];
|
|
194
|
+
}
|
|
195
|
+
useEffect(t1, t2);
|
|
196
|
+
let t3;
|
|
197
|
+
if ($[3] !== activeValues || $[4] !== onSelect) {
|
|
198
|
+
t3 = (val)=>{
|
|
199
|
+
const next = activeValues.includes(val) ? activeValues.filter((v)=>v !== val) : [
|
|
200
|
+
...activeValues,
|
|
201
|
+
val
|
|
202
|
+
];
|
|
203
|
+
onSelect(next);
|
|
204
|
+
};
|
|
205
|
+
$[3] = activeValues;
|
|
206
|
+
$[4] = onSelect;
|
|
207
|
+
$[5] = t3;
|
|
208
|
+
} else t3 = $[5];
|
|
209
|
+
const toggle = t3;
|
|
210
|
+
let t4;
|
|
211
|
+
if ($[6] !== open) {
|
|
212
|
+
t4 = ()=>setOpen(!open);
|
|
213
|
+
$[6] = open;
|
|
214
|
+
$[7] = t4;
|
|
215
|
+
} else t4 = $[7];
|
|
216
|
+
const t5 = activeValues.length > 0;
|
|
217
|
+
let t6;
|
|
218
|
+
if ($[8] !== t5) {
|
|
219
|
+
t6 = /*#__PURE__*/ jsx(FilterIcon, {
|
|
220
|
+
active: t5
|
|
221
|
+
});
|
|
222
|
+
$[8] = t5;
|
|
223
|
+
$[9] = t6;
|
|
224
|
+
} else t6 = $[9];
|
|
225
|
+
let t7;
|
|
226
|
+
if ($[10] !== t4 || $[11] !== t6) {
|
|
227
|
+
t7 = /*#__PURE__*/ jsx("button", {
|
|
228
|
+
type: "button",
|
|
229
|
+
"data-tao-table-filter-trigger": "",
|
|
230
|
+
onClick: t4,
|
|
231
|
+
"aria-label": "Filter",
|
|
232
|
+
children: t6
|
|
233
|
+
});
|
|
234
|
+
$[10] = t4;
|
|
235
|
+
$[11] = t6;
|
|
236
|
+
$[12] = t7;
|
|
237
|
+
} else t7 = $[12];
|
|
238
|
+
let t8;
|
|
239
|
+
if ($[13] !== activeValues || $[14] !== filters || $[15] !== onSelect || $[16] !== open || $[17] !== toggle) {
|
|
240
|
+
t8 = open && /*#__PURE__*/ jsxs("div", {
|
|
241
|
+
"data-tao-table-filter-panel": "",
|
|
242
|
+
children: [
|
|
243
|
+
filters.map((f)=>{
|
|
244
|
+
const checked = activeValues.includes(f.value);
|
|
245
|
+
return /*#__PURE__*/ jsxs("label", {
|
|
246
|
+
"data-tao-table-filter-option": "",
|
|
247
|
+
onClick: ()=>toggle(f.value),
|
|
248
|
+
children: [
|
|
249
|
+
/*#__PURE__*/ jsx("span", {
|
|
250
|
+
"data-tao-table-filter-check": "",
|
|
251
|
+
"data-tao-checked": checked || void 0,
|
|
252
|
+
children: checked && /*#__PURE__*/ jsx(CheckIcon, {})
|
|
253
|
+
}),
|
|
254
|
+
/*#__PURE__*/ jsx("span", {
|
|
255
|
+
children: f.text
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
}, f.value);
|
|
259
|
+
}),
|
|
260
|
+
activeValues.length > 0 && /*#__PURE__*/ jsx("button", {
|
|
261
|
+
type: "button",
|
|
262
|
+
"data-tao-table-filter-reset": "",
|
|
263
|
+
onClick: ()=>onSelect([]),
|
|
264
|
+
children: "Reset"
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
});
|
|
268
|
+
$[13] = activeValues;
|
|
269
|
+
$[14] = filters;
|
|
270
|
+
$[15] = onSelect;
|
|
271
|
+
$[16] = open;
|
|
272
|
+
$[17] = toggle;
|
|
273
|
+
$[18] = t8;
|
|
274
|
+
} else t8 = $[18];
|
|
275
|
+
let t9;
|
|
276
|
+
if ($[19] !== t7 || $[20] !== t8) {
|
|
277
|
+
t9 = /*#__PURE__*/ jsxs("div", {
|
|
278
|
+
"data-tao-table-filter-dropdown": "",
|
|
279
|
+
ref: ref,
|
|
280
|
+
children: [
|
|
281
|
+
t7,
|
|
282
|
+
t8
|
|
283
|
+
]
|
|
284
|
+
});
|
|
285
|
+
$[19] = t7;
|
|
286
|
+
$[20] = t8;
|
|
287
|
+
$[21] = t9;
|
|
288
|
+
} else t9 = $[21];
|
|
289
|
+
return t9;
|
|
290
|
+
}
|
|
291
|
+
function Table(t0) {
|
|
292
|
+
const $ = compiler_runtime_c(160);
|
|
293
|
+
const { columns, dataSource, rowKey, loading: t1, pagination: paginationProp, onChange, scroll, rowSelection, size, emptyText: t2, bordered: t3, className, classNames, styles } = t0;
|
|
294
|
+
const loading = void 0 === t1 ? false : t1;
|
|
295
|
+
const emptyText = void 0 === t2 ? "No Data" : t2;
|
|
296
|
+
const bordered = void 0 === t3 ? false : t3;
|
|
297
|
+
const ctx = useTaoConfig();
|
|
298
|
+
const resolvedSize = size ?? ctx.size;
|
|
299
|
+
let defaultSortCol;
|
|
300
|
+
let t4;
|
|
301
|
+
let t5;
|
|
302
|
+
if ($[0] !== columns) {
|
|
303
|
+
defaultSortCol = columns.find(_temp);
|
|
304
|
+
t4 = useState;
|
|
305
|
+
t5 = defaultSortCol ? getColKey(defaultSortCol, columns.indexOf(defaultSortCol)) : null;
|
|
306
|
+
$[0] = columns;
|
|
307
|
+
$[1] = defaultSortCol;
|
|
308
|
+
$[2] = t4;
|
|
309
|
+
$[3] = t5;
|
|
310
|
+
} else {
|
|
311
|
+
defaultSortCol = $[1];
|
|
312
|
+
t4 = $[2];
|
|
313
|
+
t5 = $[3];
|
|
314
|
+
}
|
|
315
|
+
const [sortKey, setSortKey] = t4(t5);
|
|
316
|
+
const [sortOrder, setSortOrder] = useState(defaultSortCol?.defaultSortOrder ?? null);
|
|
317
|
+
let t6;
|
|
318
|
+
if ($[4] !== columns) {
|
|
319
|
+
t6 = ()=>{
|
|
320
|
+
const init = {};
|
|
321
|
+
for(let i = 0; i < columns.length; i++){
|
|
322
|
+
const col = columns[i];
|
|
323
|
+
if (col.filters) {
|
|
324
|
+
const key = getColKey(col, i);
|
|
325
|
+
init[key] = col.filteredValue ?? [];
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return init;
|
|
329
|
+
};
|
|
330
|
+
$[4] = columns;
|
|
331
|
+
$[5] = t6;
|
|
332
|
+
} else t6 = $[5];
|
|
333
|
+
const [filterValues, setFilterValues] = useState(t6);
|
|
334
|
+
const hasPagination = false !== paginationProp;
|
|
335
|
+
const paginationConfig = false === paginationProp ? void 0 : paginationProp;
|
|
336
|
+
const [internalPage, setInternalPage] = useState(paginationConfig?.defaultCurrent ?? 1);
|
|
337
|
+
const [internalPageSize, setInternalPageSize] = useState(paginationConfig?.defaultPageSize ?? paginationConfig?.pageSize ?? 10);
|
|
338
|
+
const currentPage = paginationConfig?.current ?? internalPage;
|
|
339
|
+
const pageSize = paginationConfig?.pageSize ?? internalPageSize;
|
|
340
|
+
let t7;
|
|
341
|
+
if ($[6] !== columns) {
|
|
342
|
+
t7 = (key_0, order)=>{
|
|
343
|
+
if (!key_0 || !order) return {
|
|
344
|
+
order: null
|
|
345
|
+
};
|
|
346
|
+
const colIdx = columns.findIndex((c_0, i_0)=>getColKey(c_0, i_0) === key_0);
|
|
347
|
+
const col_0 = columns[colIdx];
|
|
348
|
+
return {
|
|
349
|
+
column: col_0,
|
|
350
|
+
order,
|
|
351
|
+
field: col_0?.dataIndex
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
$[6] = columns;
|
|
355
|
+
$[7] = t7;
|
|
356
|
+
} else t7 = $[7];
|
|
357
|
+
const buildSorterResult = t7;
|
|
358
|
+
let t8;
|
|
359
|
+
if ($[8] !== columns) {
|
|
360
|
+
t8 = (fv)=>{
|
|
361
|
+
const result = {};
|
|
362
|
+
for(let i_1 = 0; i_1 < columns.length; i_1++){
|
|
363
|
+
const col_1 = columns[i_1];
|
|
364
|
+
if (col_1.filters) {
|
|
365
|
+
const key_1 = getColKey(col_1, i_1);
|
|
366
|
+
const vals = fv[key_1];
|
|
367
|
+
result[col_1.dataIndex ?? key_1] = vals && vals.length > 0 ? vals : null;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return result;
|
|
371
|
+
};
|
|
372
|
+
$[8] = columns;
|
|
373
|
+
$[9] = t8;
|
|
374
|
+
} else t8 = $[9];
|
|
375
|
+
const buildFiltersRecord = t8;
|
|
376
|
+
let t9;
|
|
377
|
+
if ($[10] !== buildFiltersRecord || $[11] !== buildSorterResult || $[12] !== onChange) {
|
|
378
|
+
t9 = (page, ps, sk, so, fv_0)=>{
|
|
379
|
+
onChange?.({
|
|
380
|
+
current: page,
|
|
381
|
+
pageSize: ps
|
|
382
|
+
}, buildFiltersRecord(fv_0), buildSorterResult(sk, so));
|
|
383
|
+
};
|
|
384
|
+
$[10] = buildFiltersRecord;
|
|
385
|
+
$[11] = buildSorterResult;
|
|
386
|
+
$[12] = onChange;
|
|
387
|
+
$[13] = t9;
|
|
388
|
+
} else t9 = $[13];
|
|
389
|
+
const triggerChange = t9;
|
|
390
|
+
let t10;
|
|
391
|
+
if ($[14] !== currentPage || $[15] !== filterValues || $[16] !== pageSize || $[17] !== sortKey || $[18] !== sortOrder || $[19] !== triggerChange) {
|
|
392
|
+
t10 = (colKey, col_2)=>{
|
|
393
|
+
if (void 0 !== col_2.sortOrder) return void triggerChange(currentPage, pageSize, colKey, nextSortOrder(col_2.sortOrder), filterValues);
|
|
394
|
+
const next = sortKey === colKey ? nextSortOrder(sortOrder) : "ascend";
|
|
395
|
+
const newKey = null === next ? null : colKey;
|
|
396
|
+
setSortKey(newKey);
|
|
397
|
+
setSortOrder(next);
|
|
398
|
+
triggerChange(currentPage, pageSize, newKey, next, filterValues);
|
|
399
|
+
};
|
|
400
|
+
$[14] = currentPage;
|
|
401
|
+
$[15] = filterValues;
|
|
402
|
+
$[16] = pageSize;
|
|
403
|
+
$[17] = sortKey;
|
|
404
|
+
$[18] = sortOrder;
|
|
405
|
+
$[19] = triggerChange;
|
|
406
|
+
$[20] = t10;
|
|
407
|
+
} else t10 = $[20];
|
|
408
|
+
const handleSort = t10;
|
|
409
|
+
let t11;
|
|
410
|
+
if ($[21] !== filterValues || $[22] !== pageSize || $[23] !== sortKey || $[24] !== sortOrder || $[25] !== triggerChange) {
|
|
411
|
+
t11 = (colKey_0, values)=>{
|
|
412
|
+
const next_0 = {
|
|
413
|
+
...filterValues,
|
|
414
|
+
[colKey_0]: values
|
|
415
|
+
};
|
|
416
|
+
setFilterValues(next_0);
|
|
417
|
+
setInternalPage(1);
|
|
418
|
+
triggerChange(1, pageSize, sortKey, sortOrder, next_0);
|
|
419
|
+
};
|
|
420
|
+
$[21] = filterValues;
|
|
421
|
+
$[22] = pageSize;
|
|
422
|
+
$[23] = sortKey;
|
|
423
|
+
$[24] = sortOrder;
|
|
424
|
+
$[25] = triggerChange;
|
|
425
|
+
$[26] = t11;
|
|
426
|
+
} else t11 = $[26];
|
|
427
|
+
const handleFilter = t11;
|
|
428
|
+
let t12;
|
|
429
|
+
if ($[27] !== filterValues || $[28] !== sortKey || $[29] !== sortOrder || $[30] !== triggerChange) {
|
|
430
|
+
t12 = (page_0, ps_0)=>{
|
|
431
|
+
setInternalPage(page_0);
|
|
432
|
+
setInternalPageSize(ps_0);
|
|
433
|
+
triggerChange(page_0, ps_0, sortKey, sortOrder, filterValues);
|
|
434
|
+
};
|
|
435
|
+
$[27] = filterValues;
|
|
436
|
+
$[28] = sortKey;
|
|
437
|
+
$[29] = sortOrder;
|
|
438
|
+
$[30] = triggerChange;
|
|
439
|
+
$[31] = t12;
|
|
440
|
+
} else t12 = $[31];
|
|
441
|
+
const handlePageChange = t12;
|
|
442
|
+
let data;
|
|
443
|
+
if ($[32] !== columns || $[33] !== dataSource || $[34] !== filterValues || $[35] !== sortKey || $[36] !== sortOrder) {
|
|
444
|
+
data = [
|
|
445
|
+
...dataSource
|
|
446
|
+
];
|
|
447
|
+
for(let i_2 = 0; i_2 < columns.length; i_2++){
|
|
448
|
+
const col_3 = columns[i_2];
|
|
449
|
+
if (!col_3.filters || !col_3.onFilter) continue;
|
|
450
|
+
const key_2 = getColKey(col_3, i_2);
|
|
451
|
+
const controlledValues = col_3.filteredValue;
|
|
452
|
+
const activeVals = controlledValues ?? filterValues[key_2];
|
|
453
|
+
if (activeVals && activeVals.length > 0) data = data.filter((record)=>activeVals.some((v)=>col_3.onFilter(v, record)));
|
|
454
|
+
}
|
|
455
|
+
let t13;
|
|
456
|
+
if ($[38] !== sortKey || $[39] !== sortOrder) {
|
|
457
|
+
t13 = (col_4, i_3)=>{
|
|
458
|
+
const key_3 = getColKey(col_4, i_3);
|
|
459
|
+
const order_0 = void 0 !== col_4.sortOrder ? col_4.sortOrder : sortKey === key_3 ? sortOrder : null;
|
|
460
|
+
return null !== order_0 && "function" == typeof col_4.sorter;
|
|
461
|
+
};
|
|
462
|
+
$[38] = sortKey;
|
|
463
|
+
$[39] = sortOrder;
|
|
464
|
+
$[40] = t13;
|
|
465
|
+
} else t13 = $[40];
|
|
466
|
+
const activeSortCol = columns.find(t13);
|
|
467
|
+
if (activeSortCol && "function" == typeof activeSortCol.sorter) {
|
|
468
|
+
const colIdx_0 = columns.indexOf(activeSortCol);
|
|
469
|
+
const key_4 = getColKey(activeSortCol, colIdx_0);
|
|
470
|
+
const order_1 = void 0 !== activeSortCol.sortOrder ? activeSortCol.sortOrder : sortKey === key_4 ? sortOrder : null;
|
|
471
|
+
const sorterFn = activeSortCol.sorter;
|
|
472
|
+
data.sort((a, b)=>{
|
|
473
|
+
const result_0 = sorterFn(a, b);
|
|
474
|
+
return "descend" === order_1 ? -result_0 : result_0;
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
$[32] = columns;
|
|
478
|
+
$[33] = dataSource;
|
|
479
|
+
$[34] = filterValues;
|
|
480
|
+
$[35] = sortKey;
|
|
481
|
+
$[36] = sortOrder;
|
|
482
|
+
$[37] = data;
|
|
483
|
+
} else data = $[37];
|
|
484
|
+
const processedData = data;
|
|
485
|
+
const totalForPagination = paginationConfig?.total ?? processedData.length;
|
|
486
|
+
let t13;
|
|
487
|
+
bb0: {
|
|
488
|
+
if (!hasPagination) {
|
|
489
|
+
t13 = processedData;
|
|
490
|
+
break bb0;
|
|
491
|
+
}
|
|
492
|
+
if (paginationConfig?.total !== void 0) {
|
|
493
|
+
t13 = processedData;
|
|
494
|
+
break bb0;
|
|
495
|
+
}
|
|
496
|
+
const start = (currentPage - 1) * pageSize;
|
|
497
|
+
let t14;
|
|
498
|
+
if ($[41] !== pageSize || $[42] !== processedData || $[43] !== start) {
|
|
499
|
+
t14 = processedData.slice(start, start + pageSize);
|
|
500
|
+
$[41] = pageSize;
|
|
501
|
+
$[42] = processedData;
|
|
502
|
+
$[43] = start;
|
|
503
|
+
$[44] = t14;
|
|
504
|
+
} else t14 = $[44];
|
|
505
|
+
t13 = t14;
|
|
506
|
+
}
|
|
507
|
+
const paginatedData = t13;
|
|
508
|
+
const selectionColWidth = rowSelection?.columnWidth ?? 48;
|
|
509
|
+
const selectionType = rowSelection?.type ?? "checkbox";
|
|
510
|
+
let t14;
|
|
511
|
+
if ($[45] !== rowSelection?.selectedRowKeys) {
|
|
512
|
+
t14 = rowSelection?.selectedRowKeys ?? [];
|
|
513
|
+
$[45] = rowSelection?.selectedRowKeys;
|
|
514
|
+
$[46] = t14;
|
|
515
|
+
} else t14 = $[46];
|
|
516
|
+
const selectedKeys = t14;
|
|
517
|
+
let t15;
|
|
518
|
+
if ($[47] !== dataSource || $[48] !== rowKey || $[49] !== rowSelection || $[50] !== selectedKeys || $[51] !== selectionType) {
|
|
519
|
+
t15 = (key_5, record_0)=>{
|
|
520
|
+
if (!rowSelection?.onChange) return;
|
|
521
|
+
let nextKeys;
|
|
522
|
+
nextKeys = "radio" === selectionType ? [
|
|
523
|
+
key_5
|
|
524
|
+
] : selectedKeys.includes(key_5) ? selectedKeys.filter((k)=>k !== key_5) : [
|
|
525
|
+
...selectedKeys,
|
|
526
|
+
key_5
|
|
527
|
+
];
|
|
528
|
+
const nextRows = dataSource.filter((r)=>nextKeys.includes(getRowKey(r, rowKey)));
|
|
529
|
+
rowSelection.onChange(nextKeys, nextRows);
|
|
530
|
+
};
|
|
531
|
+
$[47] = dataSource;
|
|
532
|
+
$[48] = rowKey;
|
|
533
|
+
$[49] = rowSelection;
|
|
534
|
+
$[50] = selectedKeys;
|
|
535
|
+
$[51] = selectionType;
|
|
536
|
+
$[52] = t15;
|
|
537
|
+
} else t15 = $[52];
|
|
538
|
+
const handleSelectRow = t15;
|
|
539
|
+
let t16;
|
|
540
|
+
if ($[53] !== dataSource || $[54] !== paginatedData || $[55] !== rowKey || $[56] !== rowSelection) {
|
|
541
|
+
t16 = (checked)=>{
|
|
542
|
+
if (!rowSelection?.onChange) return;
|
|
543
|
+
if (checked) {
|
|
544
|
+
const allKeys = paginatedData.filter((r_0)=>{
|
|
545
|
+
const props = rowSelection.getCheckboxProps?.(r_0);
|
|
546
|
+
return !props?.disabled;
|
|
547
|
+
}).map((r_1)=>getRowKey(r_1, rowKey));
|
|
548
|
+
const nextRows_0 = dataSource.filter((r_2)=>allKeys.includes(getRowKey(r_2, rowKey)));
|
|
549
|
+
rowSelection.onChange(allKeys, nextRows_0);
|
|
550
|
+
} else rowSelection.onChange([], []);
|
|
551
|
+
};
|
|
552
|
+
$[53] = dataSource;
|
|
553
|
+
$[54] = paginatedData;
|
|
554
|
+
$[55] = rowKey;
|
|
555
|
+
$[56] = rowSelection;
|
|
556
|
+
$[57] = t16;
|
|
557
|
+
} else t16 = $[57];
|
|
558
|
+
const handleSelectAll = t16;
|
|
559
|
+
const scrollRef = useRef(null);
|
|
560
|
+
const [scrollState, setScrollState] = useState("left");
|
|
561
|
+
let t17;
|
|
562
|
+
if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
|
|
563
|
+
t17 = ()=>{
|
|
564
|
+
const el = scrollRef.current;
|
|
565
|
+
if (!el) return;
|
|
566
|
+
const { scrollLeft, scrollWidth, clientWidth } = el;
|
|
567
|
+
const atLeft = scrollLeft <= 1;
|
|
568
|
+
const atRight = scrollLeft + clientWidth >= scrollWidth - 1;
|
|
569
|
+
if (atLeft && atRight) setScrollState("both");
|
|
570
|
+
else if (atLeft) setScrollState("left");
|
|
571
|
+
else atRight ? setScrollState("right") : setScrollState("middle");
|
|
572
|
+
};
|
|
573
|
+
$[58] = t17;
|
|
574
|
+
} else t17 = $[58];
|
|
575
|
+
const handleScroll = t17;
|
|
576
|
+
let t18;
|
|
577
|
+
if ($[59] !== scroll?.x) {
|
|
578
|
+
t18 = ()=>{
|
|
579
|
+
if (!scroll?.x) return;
|
|
580
|
+
handleScroll();
|
|
581
|
+
};
|
|
582
|
+
$[59] = scroll?.x;
|
|
583
|
+
$[60] = t18;
|
|
584
|
+
} else t18 = $[60];
|
|
585
|
+
const t19 = scroll?.x;
|
|
586
|
+
let t20;
|
|
587
|
+
if ($[61] !== t19) {
|
|
588
|
+
t20 = [
|
|
589
|
+
t19,
|
|
590
|
+
handleScroll
|
|
591
|
+
];
|
|
592
|
+
$[61] = t19;
|
|
593
|
+
$[62] = t20;
|
|
594
|
+
} else t20 = $[62];
|
|
595
|
+
useEffect(t18, t20);
|
|
596
|
+
let cols;
|
|
597
|
+
if ($[63] !== columns || $[64] !== rowSelection || $[65] !== selectionColWidth) {
|
|
598
|
+
cols = [];
|
|
599
|
+
if (rowSelection) cols.push({
|
|
600
|
+
_key: "__selection__",
|
|
601
|
+
_index: -1,
|
|
602
|
+
width: selectionColWidth,
|
|
603
|
+
fixed: rowSelection.fixed ? "left" : void 0
|
|
604
|
+
});
|
|
605
|
+
columns.forEach((col_5, i_4)=>{
|
|
606
|
+
cols.push({
|
|
607
|
+
...col_5,
|
|
608
|
+
_key: getColKey(col_5, i_4),
|
|
609
|
+
_index: i_4
|
|
610
|
+
});
|
|
611
|
+
});
|
|
612
|
+
$[63] = columns;
|
|
613
|
+
$[64] = rowSelection;
|
|
614
|
+
$[65] = selectionColWidth;
|
|
615
|
+
$[66] = cols;
|
|
616
|
+
} else cols = $[66];
|
|
617
|
+
const allColumns = cols;
|
|
618
|
+
let t21;
|
|
619
|
+
if ($[67] !== allColumns || $[68] !== scroll?.x) {
|
|
620
|
+
t21 = ()=>{
|
|
621
|
+
if (!scroll?.x) return {};
|
|
622
|
+
const positions = {};
|
|
623
|
+
let leftOffset = 0;
|
|
624
|
+
for (const col_6 of allColumns)if ("left" === col_6.fixed) {
|
|
625
|
+
positions[col_6._key] = {
|
|
626
|
+
left: leftOffset
|
|
627
|
+
};
|
|
628
|
+
leftOffset += "number" == typeof col_6.width ? col_6.width : 0;
|
|
629
|
+
}
|
|
630
|
+
let rightOffset = 0;
|
|
631
|
+
for(let i_5 = allColumns.length - 1; i_5 >= 0; i_5--){
|
|
632
|
+
const col_7 = allColumns[i_5];
|
|
633
|
+
if ("right" === col_7.fixed) {
|
|
634
|
+
positions[col_7._key] = {
|
|
635
|
+
right: rightOffset
|
|
636
|
+
};
|
|
637
|
+
rightOffset += "number" == typeof col_7.width ? col_7.width : 0;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return positions;
|
|
641
|
+
};
|
|
642
|
+
$[67] = allColumns;
|
|
643
|
+
$[68] = scroll?.x;
|
|
644
|
+
$[69] = t21;
|
|
645
|
+
} else t21 = $[69];
|
|
646
|
+
scroll?.x;
|
|
647
|
+
let t22;
|
|
648
|
+
if ($[70] !== t21) {
|
|
649
|
+
t22 = t21();
|
|
650
|
+
$[70] = t21;
|
|
651
|
+
$[71] = t22;
|
|
652
|
+
} else t22 = $[71];
|
|
653
|
+
const stickyPositions = t22;
|
|
654
|
+
let t23;
|
|
655
|
+
if ($[72] !== sortKey || $[73] !== sortOrder) {
|
|
656
|
+
t23 = (col_8, colKey_1)=>{
|
|
657
|
+
if (void 0 !== col_8.sortOrder) return col_8.sortOrder;
|
|
658
|
+
return sortKey === colKey_1 ? sortOrder : null;
|
|
659
|
+
};
|
|
660
|
+
$[72] = sortKey;
|
|
661
|
+
$[73] = sortOrder;
|
|
662
|
+
$[74] = t23;
|
|
663
|
+
} else t23 = $[74];
|
|
664
|
+
const getResolvedSortOrder = t23;
|
|
665
|
+
let t24;
|
|
666
|
+
if ($[75] !== scroll) {
|
|
667
|
+
t24 = scroll?.x ? {
|
|
668
|
+
minWidth: "number" == typeof scroll.x ? `${scroll.x}px` : scroll.x
|
|
669
|
+
} : {};
|
|
670
|
+
$[75] = scroll;
|
|
671
|
+
$[76] = t24;
|
|
672
|
+
} else t24 = $[76];
|
|
673
|
+
const tableStyle = t24;
|
|
674
|
+
let t25;
|
|
675
|
+
if ($[77] !== paginatedData || $[78] !== rowKey || $[79] !== rowSelection || $[80] !== selectedKeys) {
|
|
676
|
+
t25 = paginatedData.length > 0 && paginatedData.filter((r_3)=>!rowSelection?.getCheckboxProps?.(r_3)?.disabled).every((r_4)=>selectedKeys.includes(getRowKey(r_4, rowKey)));
|
|
677
|
+
$[77] = paginatedData;
|
|
678
|
+
$[78] = rowKey;
|
|
679
|
+
$[79] = rowSelection;
|
|
680
|
+
$[80] = selectedKeys;
|
|
681
|
+
$[81] = t25;
|
|
682
|
+
} else t25 = $[81];
|
|
683
|
+
const isAllSelected = t25;
|
|
684
|
+
const isIndeterminate = !isAllSelected && selectedKeys.length > 0;
|
|
685
|
+
const t26 = bordered || void 0;
|
|
686
|
+
const t27 = scroll?.x ? scrollState : void 0;
|
|
687
|
+
const t28 = classNames?.root;
|
|
688
|
+
let t29;
|
|
689
|
+
if ($[82] !== className || $[83] !== t28) {
|
|
690
|
+
t29 = cx(t28, className);
|
|
691
|
+
$[82] = className;
|
|
692
|
+
$[83] = t28;
|
|
693
|
+
$[84] = t29;
|
|
694
|
+
} else t29 = $[84];
|
|
695
|
+
const t30 = styles?.root;
|
|
696
|
+
const t31 = scroll?.x ? handleScroll : void 0;
|
|
697
|
+
let t32;
|
|
698
|
+
if ($[85] !== loading) {
|
|
699
|
+
t32 = loading && /*#__PURE__*/ jsx(LoadingSpinner, {});
|
|
700
|
+
$[85] = loading;
|
|
701
|
+
$[86] = t32;
|
|
702
|
+
} else t32 = $[86];
|
|
703
|
+
let t33;
|
|
704
|
+
if ($[87] !== handleSelectAll || $[88] !== isAllSelected || $[89] !== isIndeterminate || $[90] !== rowSelection || $[91] !== selectionColWidth || $[92] !== selectionType || $[93] !== stickyPositions) {
|
|
705
|
+
t33 = rowSelection && /*#__PURE__*/ jsx("th", {
|
|
706
|
+
"data-tao-table-cell": "",
|
|
707
|
+
"data-tao-table-selection-cell": "",
|
|
708
|
+
"data-tao-fixed": "left",
|
|
709
|
+
style: {
|
|
710
|
+
width: selectionColWidth,
|
|
711
|
+
...stickyPositions.__selection__ ? {
|
|
712
|
+
position: "sticky",
|
|
713
|
+
left: stickyPositions.__selection__.left,
|
|
714
|
+
zIndex: 2
|
|
715
|
+
} : {}
|
|
716
|
+
},
|
|
717
|
+
children: "checkbox" === selectionType && /*#__PURE__*/ jsx("input", {
|
|
718
|
+
type: "checkbox",
|
|
719
|
+
checked: isAllSelected,
|
|
720
|
+
ref: (el_0)=>{
|
|
721
|
+
if (el_0) el_0.indeterminate = isIndeterminate;
|
|
722
|
+
},
|
|
723
|
+
onChange: (e)=>handleSelectAll(e.target.checked),
|
|
724
|
+
"data-tao-table-checkbox": ""
|
|
725
|
+
})
|
|
726
|
+
});
|
|
727
|
+
$[87] = handleSelectAll;
|
|
728
|
+
$[88] = isAllSelected;
|
|
729
|
+
$[89] = isIndeterminate;
|
|
730
|
+
$[90] = rowSelection;
|
|
731
|
+
$[91] = selectionColWidth;
|
|
732
|
+
$[92] = selectionType;
|
|
733
|
+
$[93] = stickyPositions;
|
|
734
|
+
$[94] = t33;
|
|
735
|
+
} else t33 = $[94];
|
|
736
|
+
let t34;
|
|
737
|
+
if ($[95] !== classNames || $[96] !== columns || $[97] !== filterValues || $[98] !== getResolvedSortOrder || $[99] !== handleFilter || $[100] !== handleSort || $[101] !== scroll?.x || $[102] !== stickyPositions || $[103] !== styles) {
|
|
738
|
+
let t35;
|
|
739
|
+
if ($[105] !== classNames || $[106] !== filterValues || $[107] !== getResolvedSortOrder || $[108] !== handleFilter || $[109] !== handleSort || $[110] !== scroll?.x || $[111] !== stickyPositions || $[112] !== styles) {
|
|
740
|
+
t35 = (col_9, i_6)=>{
|
|
741
|
+
const colKey_2 = getColKey(col_9, i_6);
|
|
742
|
+
const hasSorter = !!col_9.sorter;
|
|
743
|
+
const hasFilter = !!(col_9.filters && col_9.filters.length > 0);
|
|
744
|
+
const resolvedOrder = getResolvedSortOrder(col_9, colKey_2);
|
|
745
|
+
const controlledFilterValues = col_9.filteredValue;
|
|
746
|
+
const activeFilterValues = controlledFilterValues ?? filterValues[colKey_2] ?? [];
|
|
747
|
+
const stickyPos = stickyPositions[colKey_2];
|
|
748
|
+
const isFixed = !!col_9.fixed && !!scroll?.x;
|
|
749
|
+
return /*#__PURE__*/ jsx("th", {
|
|
750
|
+
"data-tao-table-cell": "",
|
|
751
|
+
"data-tao-table-header": "",
|
|
752
|
+
"data-tao-align": col_9.align,
|
|
753
|
+
"data-tao-fixed": isFixed ? col_9.fixed : void 0,
|
|
754
|
+
className: classNames?.["header.cell"],
|
|
755
|
+
style: {
|
|
756
|
+
width: col_9.width,
|
|
757
|
+
...isFixed && stickyPos ? {
|
|
758
|
+
position: "sticky",
|
|
759
|
+
...void 0 !== stickyPos.left ? {
|
|
760
|
+
left: stickyPos.left
|
|
761
|
+
} : {},
|
|
762
|
+
...void 0 !== stickyPos.right ? {
|
|
763
|
+
right: stickyPos.right
|
|
764
|
+
} : {},
|
|
765
|
+
zIndex: 2
|
|
766
|
+
} : {},
|
|
767
|
+
...styles?.["header.cell"]
|
|
768
|
+
},
|
|
769
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
770
|
+
"data-tao-table-header-content": "",
|
|
771
|
+
children: [
|
|
772
|
+
/*#__PURE__*/ jsxs("span", {
|
|
773
|
+
"data-tao-table-header-title": "",
|
|
774
|
+
"data-tao-sortable": hasSorter || void 0,
|
|
775
|
+
onClick: hasSorter ? ()=>handleSort(colKey_2, col_9) : void 0,
|
|
776
|
+
role: hasSorter ? "button" : void 0,
|
|
777
|
+
tabIndex: hasSorter ? 0 : void 0,
|
|
778
|
+
onKeyDown: hasSorter ? (e_0)=>{
|
|
779
|
+
if ("Enter" === e_0.key || " " === e_0.key) {
|
|
780
|
+
e_0.preventDefault();
|
|
781
|
+
handleSort(colKey_2, col_9);
|
|
782
|
+
}
|
|
783
|
+
} : void 0,
|
|
784
|
+
children: [
|
|
785
|
+
col_9.title,
|
|
786
|
+
hasSorter && /*#__PURE__*/ jsx(SortIcon, {
|
|
787
|
+
order: resolvedOrder
|
|
788
|
+
})
|
|
789
|
+
]
|
|
790
|
+
}),
|
|
791
|
+
hasFilter && /*#__PURE__*/ jsx(FilterDropdown, {
|
|
792
|
+
filters: col_9.filters,
|
|
793
|
+
activeValues: activeFilterValues,
|
|
794
|
+
onSelect: (vals_0)=>handleFilter(colKey_2, vals_0)
|
|
795
|
+
})
|
|
796
|
+
]
|
|
797
|
+
})
|
|
798
|
+
}, colKey_2);
|
|
799
|
+
};
|
|
800
|
+
$[105] = classNames;
|
|
801
|
+
$[106] = filterValues;
|
|
802
|
+
$[107] = getResolvedSortOrder;
|
|
803
|
+
$[108] = handleFilter;
|
|
804
|
+
$[109] = handleSort;
|
|
805
|
+
$[110] = scroll?.x;
|
|
806
|
+
$[111] = stickyPositions;
|
|
807
|
+
$[112] = styles;
|
|
808
|
+
$[113] = t35;
|
|
809
|
+
} else t35 = $[113];
|
|
810
|
+
t34 = columns.map(t35);
|
|
811
|
+
$[95] = classNames;
|
|
812
|
+
$[96] = columns;
|
|
813
|
+
$[97] = filterValues;
|
|
814
|
+
$[98] = getResolvedSortOrder;
|
|
815
|
+
$[99] = handleFilter;
|
|
816
|
+
$[100] = handleSort;
|
|
817
|
+
$[101] = scroll?.x;
|
|
818
|
+
$[102] = stickyPositions;
|
|
819
|
+
$[103] = styles;
|
|
820
|
+
$[104] = t34;
|
|
821
|
+
} else t34 = $[104];
|
|
822
|
+
let t35;
|
|
823
|
+
if ($[114] !== t33 || $[115] !== t34) {
|
|
824
|
+
t35 = /*#__PURE__*/ jsx("thead", {
|
|
825
|
+
"data-tao-table-thead": "",
|
|
826
|
+
children: /*#__PURE__*/ jsxs("tr", {
|
|
827
|
+
children: [
|
|
828
|
+
t33,
|
|
829
|
+
t34
|
|
830
|
+
]
|
|
831
|
+
})
|
|
832
|
+
});
|
|
833
|
+
$[114] = t33;
|
|
834
|
+
$[115] = t34;
|
|
835
|
+
$[116] = t35;
|
|
836
|
+
} else t35 = $[116];
|
|
837
|
+
let t36;
|
|
838
|
+
if ($[117] !== classNames || $[118] !== columns || $[119] !== emptyText || $[120] !== handleSelectRow || $[121] !== paginatedData || $[122] !== rowKey || $[123] !== rowSelection || $[124] !== scroll?.x || $[125] !== selectedKeys || $[126] !== selectionType || $[127] !== stickyPositions || $[128] !== styles) {
|
|
839
|
+
t36 = 0 === paginatedData.length ? /*#__PURE__*/ jsx("tr", {
|
|
840
|
+
children: /*#__PURE__*/ jsx("td", {
|
|
841
|
+
"data-tao-table-cell": "",
|
|
842
|
+
"data-tao-table-empty": "",
|
|
843
|
+
colSpan: columns.length + (rowSelection ? 1 : 0),
|
|
844
|
+
children: emptyText
|
|
845
|
+
})
|
|
846
|
+
}) : paginatedData.map((record_1, rowIdx)=>{
|
|
847
|
+
const key_6 = getRowKey(record_1, rowKey);
|
|
848
|
+
const isSelected = selectedKeys.includes(key_6);
|
|
849
|
+
const checkboxProps = rowSelection?.getCheckboxProps?.(record_1);
|
|
850
|
+
return /*#__PURE__*/ jsxs("tr", {
|
|
851
|
+
"data-tao-table-row": "",
|
|
852
|
+
"data-tao-selected": isSelected || void 0,
|
|
853
|
+
className: classNames?.["body.row"],
|
|
854
|
+
style: styles?.["body.row"],
|
|
855
|
+
children: [
|
|
856
|
+
rowSelection && /*#__PURE__*/ jsx("td", {
|
|
857
|
+
"data-tao-table-cell": "",
|
|
858
|
+
"data-tao-table-selection-cell": "",
|
|
859
|
+
"data-tao-fixed": "left",
|
|
860
|
+
style: {
|
|
861
|
+
...stickyPositions.__selection__ ? {
|
|
862
|
+
position: "sticky",
|
|
863
|
+
left: stickyPositions.__selection__.left,
|
|
864
|
+
zIndex: 1
|
|
865
|
+
} : {}
|
|
866
|
+
},
|
|
867
|
+
children: /*#__PURE__*/ jsx("input", {
|
|
868
|
+
type: "radio" === selectionType ? "radio" : "checkbox",
|
|
869
|
+
checked: isSelected,
|
|
870
|
+
disabled: checkboxProps?.disabled,
|
|
871
|
+
onChange: ()=>handleSelectRow(key_6, record_1),
|
|
872
|
+
"data-tao-table-checkbox": ""
|
|
873
|
+
})
|
|
874
|
+
}),
|
|
875
|
+
columns.map((col_10, colIdx_1)=>{
|
|
876
|
+
const colKey_3 = getColKey(col_10, colIdx_1);
|
|
877
|
+
const value = getCellValue(record_1, col_10.dataIndex);
|
|
878
|
+
const stickyPos_0 = stickyPositions[colKey_3];
|
|
879
|
+
const isFixed_0 = !!col_10.fixed && !!scroll?.x;
|
|
880
|
+
return /*#__PURE__*/ jsx("td", {
|
|
881
|
+
"data-tao-table-cell": "",
|
|
882
|
+
"data-tao-align": col_10.align,
|
|
883
|
+
"data-tao-ellipsis": col_10.ellipsis || void 0,
|
|
884
|
+
"data-tao-fixed": isFixed_0 ? col_10.fixed : void 0,
|
|
885
|
+
className: classNames?.["body.cell"],
|
|
886
|
+
style: {
|
|
887
|
+
...isFixed_0 && stickyPos_0 ? {
|
|
888
|
+
position: "sticky",
|
|
889
|
+
...void 0 !== stickyPos_0.left ? {
|
|
890
|
+
left: stickyPos_0.left
|
|
891
|
+
} : {},
|
|
892
|
+
...void 0 !== stickyPos_0.right ? {
|
|
893
|
+
right: stickyPos_0.right
|
|
894
|
+
} : {},
|
|
895
|
+
zIndex: 1
|
|
896
|
+
} : {},
|
|
897
|
+
...styles?.["body.cell"]
|
|
898
|
+
},
|
|
899
|
+
children: col_10.render ? col_10.render(value, record_1, rowIdx) : value
|
|
900
|
+
}, colKey_3);
|
|
901
|
+
})
|
|
902
|
+
]
|
|
903
|
+
}, key_6);
|
|
904
|
+
});
|
|
905
|
+
$[117] = classNames;
|
|
906
|
+
$[118] = columns;
|
|
907
|
+
$[119] = emptyText;
|
|
908
|
+
$[120] = handleSelectRow;
|
|
909
|
+
$[121] = paginatedData;
|
|
910
|
+
$[122] = rowKey;
|
|
911
|
+
$[123] = rowSelection;
|
|
912
|
+
$[124] = scroll?.x;
|
|
913
|
+
$[125] = selectedKeys;
|
|
914
|
+
$[126] = selectionType;
|
|
915
|
+
$[127] = stickyPositions;
|
|
916
|
+
$[128] = styles;
|
|
917
|
+
$[129] = t36;
|
|
918
|
+
} else t36 = $[129];
|
|
919
|
+
let t37;
|
|
920
|
+
if ($[130] !== t36) {
|
|
921
|
+
t37 = /*#__PURE__*/ jsx("tbody", {
|
|
922
|
+
"data-tao-table-tbody": "",
|
|
923
|
+
children: t36
|
|
924
|
+
});
|
|
925
|
+
$[130] = t36;
|
|
926
|
+
$[131] = t37;
|
|
927
|
+
} else t37 = $[131];
|
|
928
|
+
let t38;
|
|
929
|
+
if ($[132] !== t35 || $[133] !== t37 || $[134] !== tableStyle) {
|
|
930
|
+
t38 = /*#__PURE__*/ jsxs("table", {
|
|
931
|
+
"data-tao-table": "",
|
|
932
|
+
style: tableStyle,
|
|
933
|
+
children: [
|
|
934
|
+
t35,
|
|
935
|
+
t37
|
|
936
|
+
]
|
|
937
|
+
});
|
|
938
|
+
$[132] = t35;
|
|
939
|
+
$[133] = t37;
|
|
940
|
+
$[134] = tableStyle;
|
|
941
|
+
$[135] = t38;
|
|
942
|
+
} else t38 = $[135];
|
|
943
|
+
let t39;
|
|
944
|
+
if ($[136] !== t31 || $[137] !== t32 || $[138] !== t38) {
|
|
945
|
+
t39 = /*#__PURE__*/ jsxs("div", {
|
|
946
|
+
"data-tao-table-scroll": "",
|
|
947
|
+
ref: scrollRef,
|
|
948
|
+
onScroll: t31,
|
|
949
|
+
children: [
|
|
950
|
+
t32,
|
|
951
|
+
t38
|
|
952
|
+
]
|
|
953
|
+
});
|
|
954
|
+
$[136] = t31;
|
|
955
|
+
$[137] = t32;
|
|
956
|
+
$[138] = t38;
|
|
957
|
+
$[139] = t39;
|
|
958
|
+
} else t39 = $[139];
|
|
959
|
+
let t40;
|
|
960
|
+
if ($[140] !== classNames?.pagination || $[141] !== currentPage || $[142] !== handlePageChange || $[143] !== hasPagination || $[144] !== pageSize || $[145] !== paginationConfig?.pageSizeOptions || $[146] !== paginationConfig?.showSizeChanger || $[147] !== paginationConfig?.showTotal || $[148] !== resolvedSize || $[149] !== styles?.pagination || $[150] !== totalForPagination) {
|
|
961
|
+
t40 = hasPagination && totalForPagination > 0 && /*#__PURE__*/ jsx("div", {
|
|
962
|
+
"data-tao-table-pagination": "",
|
|
963
|
+
className: classNames?.pagination,
|
|
964
|
+
style: styles?.pagination,
|
|
965
|
+
children: /*#__PURE__*/ jsx(Pagination, {
|
|
966
|
+
current: currentPage,
|
|
967
|
+
pageSize: pageSize,
|
|
968
|
+
total: totalForPagination,
|
|
969
|
+
onChange: handlePageChange,
|
|
970
|
+
size: resolvedSize,
|
|
971
|
+
showSizeChanger: paginationConfig?.showSizeChanger,
|
|
972
|
+
pageSizeOptions: paginationConfig?.pageSizeOptions,
|
|
973
|
+
showTotal: paginationConfig?.showTotal
|
|
974
|
+
})
|
|
975
|
+
});
|
|
976
|
+
$[140] = classNames?.pagination;
|
|
977
|
+
$[141] = currentPage;
|
|
978
|
+
$[142] = handlePageChange;
|
|
979
|
+
$[143] = hasPagination;
|
|
980
|
+
$[144] = pageSize;
|
|
981
|
+
$[145] = paginationConfig?.pageSizeOptions;
|
|
982
|
+
$[146] = paginationConfig?.showSizeChanger;
|
|
983
|
+
$[147] = paginationConfig?.showTotal;
|
|
984
|
+
$[148] = resolvedSize;
|
|
985
|
+
$[149] = styles?.pagination;
|
|
986
|
+
$[150] = totalForPagination;
|
|
987
|
+
$[151] = t40;
|
|
988
|
+
} else t40 = $[151];
|
|
989
|
+
let t41;
|
|
990
|
+
if ($[152] !== resolvedSize || $[153] !== t26 || $[154] !== t27 || $[155] !== t29 || $[156] !== t30 || $[157] !== t39 || $[158] !== t40) {
|
|
991
|
+
t41 = /*#__PURE__*/ jsxs("div", {
|
|
992
|
+
"data-tao-table-wrapper": "",
|
|
993
|
+
"data-tao-size": resolvedSize,
|
|
994
|
+
"data-tao-bordered": t26,
|
|
995
|
+
"data-tao-scroll-state": t27,
|
|
996
|
+
className: t29,
|
|
997
|
+
style: t30,
|
|
998
|
+
children: [
|
|
999
|
+
t39,
|
|
1000
|
+
t40
|
|
1001
|
+
]
|
|
1002
|
+
});
|
|
1003
|
+
$[152] = resolvedSize;
|
|
1004
|
+
$[153] = t26;
|
|
1005
|
+
$[154] = t27;
|
|
1006
|
+
$[155] = t29;
|
|
1007
|
+
$[156] = t30;
|
|
1008
|
+
$[157] = t39;
|
|
1009
|
+
$[158] = t40;
|
|
1010
|
+
$[159] = t41;
|
|
1011
|
+
} else t41 = $[159];
|
|
1012
|
+
return t41;
|
|
1013
|
+
}
|
|
1014
|
+
function _temp(c) {
|
|
1015
|
+
return c.defaultSortOrder;
|
|
1016
|
+
}
|
|
1017
|
+
function nextSortOrder(current) {
|
|
1018
|
+
if ('ascend' === current) return 'descend';
|
|
1019
|
+
if ('descend' === current) return null;
|
|
1020
|
+
return 'ascend';
|
|
1021
|
+
}
|
|
1022
|
+
export { Table };
|