@adapttable/unstyled 0.2.1 → 0.3.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.
- package/CHANGELOG.md +36 -0
- package/README.md +1 -1
- package/dist/index.cjs +2452 -815
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2453 -816
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c } from "react-compiler-runtime";
|
|
2
|
+
import { ACTIONS_COLUMN_KEY, EyeIcon, FILTER_TYPES, GripIcon, PIN_Z, PinIcon, RANGE_OPS, RANGE_OP_LABEL_KEYS, RANGE_SUFFIXES, columnMenuRows, columnReorderKeyProps, columnResizeHandleProps, createHistoryAdapter, createMemoryAdapter, defaultConfirm, defaultLabels, deriveSortByOptions, edgePinStyle, filterLabel, filterLabel as filterLabel$1, filterStateKeys, getHistoryAdapter, headerGroupRow, isDeclarativeFilters, nextPinSide, pageSizeOptions, paginationItems, pinActionLabel, pinnedCellStyle, pinnedColumnWidth, readRangeWidget, resolveDisabledReason, resolveLabels, resolveVirtualRows, rowClickProps, runRowAction, tableMinWidth, tableRenderModel, useBackendData, useBulkActionRunner, useChromeBodyData, useChromeScrollReset, useColumnDragState, useDataTable, useFilterOptions, useFilterTriggerToggle, useFrontendData, useHorizontalOverflow, useSavedViews, useSavedViews as useSavedViews$1, useServerData, useTableChrome, useTableData, useTableData as useTableData$1, useTableUrlState, writeRangeWidget } from "@adapttable/core";
|
|
2
3
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { createPortal } from "react-dom";
|
|
@@ -15,126 +16,314 @@ function selectedValues(value) {
|
|
|
15
16
|
if (value == null || value === "") return [];
|
|
16
17
|
return [String(value)];
|
|
17
18
|
}
|
|
19
|
+
/** Props shared by every per-definition field component. */
|
|
18
20
|
/** `<fieldset>` + `<legend>` wrapper for multi-control fields. */
|
|
19
|
-
function GroupField(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
function GroupField(t0) {
|
|
22
|
+
const $ = c(7);
|
|
23
|
+
const { caption, classNames, children } = t0;
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[0] !== caption || $[1] !== classNames.filterLabel) {
|
|
26
|
+
t1 = /* @__PURE__ */ jsx("legend", {
|
|
24
27
|
"data-adapttable-part": LABEL_PART,
|
|
25
28
|
className: classNames.filterLabel,
|
|
26
29
|
children: caption
|
|
27
|
-
})
|
|
28
|
-
|
|
30
|
+
});
|
|
31
|
+
$[0] = caption;
|
|
32
|
+
$[1] = classNames.filterLabel;
|
|
33
|
+
$[2] = t1;
|
|
34
|
+
} else t1 = $[2];
|
|
35
|
+
let t2;
|
|
36
|
+
if ($[3] !== children || $[4] !== classNames.filterField || $[5] !== t1) {
|
|
37
|
+
t2 = /* @__PURE__ */ jsxs("fieldset", {
|
|
38
|
+
"data-adapttable-part": FIELD_PART,
|
|
39
|
+
className: classNames.filterField,
|
|
40
|
+
children: [t1, children]
|
|
41
|
+
});
|
|
42
|
+
$[3] = children;
|
|
43
|
+
$[4] = classNames.filterField;
|
|
44
|
+
$[5] = t1;
|
|
45
|
+
$[6] = t2;
|
|
46
|
+
} else t2 = $[6];
|
|
47
|
+
return t2;
|
|
29
48
|
}
|
|
30
49
|
/** One input bound to a filter-bag state key (empty text clears it). */
|
|
31
|
-
function BagInput(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
function BagInput(t0) {
|
|
51
|
+
const $ = c(11);
|
|
52
|
+
const { source, stateKey, type, placeholder, classNames } = t0;
|
|
53
|
+
const t1 = classNames.filterInput;
|
|
54
|
+
const t2 = source.extra[stateKey];
|
|
55
|
+
let t3;
|
|
56
|
+
if ($[0] !== t2) {
|
|
57
|
+
t3 = asText(t2);
|
|
58
|
+
$[0] = t2;
|
|
59
|
+
$[1] = t3;
|
|
60
|
+
} else t3 = $[1];
|
|
61
|
+
let t4;
|
|
62
|
+
if ($[2] !== source || $[3] !== stateKey) {
|
|
63
|
+
t4 = (e) => source.setExtra(stateKey, e.currentTarget.value);
|
|
64
|
+
$[2] = source;
|
|
65
|
+
$[3] = stateKey;
|
|
66
|
+
$[4] = t4;
|
|
67
|
+
} else t4 = $[4];
|
|
68
|
+
let t5;
|
|
69
|
+
if ($[5] !== classNames.filterInput || $[6] !== placeholder || $[7] !== t3 || $[8] !== t4 || $[9] !== type) {
|
|
70
|
+
t5 = /* @__PURE__ */ jsx("input", {
|
|
71
|
+
type,
|
|
72
|
+
placeholder,
|
|
73
|
+
"data-adapttable-part": "filter-input",
|
|
74
|
+
className: t1,
|
|
75
|
+
value: t3,
|
|
76
|
+
onChange: t4
|
|
77
|
+
});
|
|
78
|
+
$[5] = classNames.filterInput;
|
|
79
|
+
$[6] = placeholder;
|
|
80
|
+
$[7] = t3;
|
|
81
|
+
$[8] = t4;
|
|
82
|
+
$[9] = type;
|
|
83
|
+
$[10] = t5;
|
|
84
|
+
} else t5 = $[10];
|
|
85
|
+
return t5;
|
|
40
86
|
}
|
|
41
|
-
function TextField(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]
|
|
60
|
-
|
|
87
|
+
function TextField(t0) {
|
|
88
|
+
const $ = c(14);
|
|
89
|
+
const { def, source, classNames } = t0;
|
|
90
|
+
const t1 = classNames.filterField;
|
|
91
|
+
const t2 = classNames.filterLabel;
|
|
92
|
+
let t3;
|
|
93
|
+
if ($[0] !== def) {
|
|
94
|
+
t3 = filterLabel$1(def);
|
|
95
|
+
$[0] = def;
|
|
96
|
+
$[1] = t3;
|
|
97
|
+
} else t3 = $[1];
|
|
98
|
+
let t4;
|
|
99
|
+
if ($[2] !== classNames.filterLabel || $[3] !== t3) {
|
|
100
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
101
|
+
"data-adapttable-part": LABEL_PART,
|
|
102
|
+
className: t2,
|
|
103
|
+
children: t3
|
|
104
|
+
});
|
|
105
|
+
$[2] = classNames.filterLabel;
|
|
106
|
+
$[3] = t3;
|
|
107
|
+
$[4] = t4;
|
|
108
|
+
} else t4 = $[4];
|
|
109
|
+
let t5;
|
|
110
|
+
if ($[5] !== classNames || $[6] !== def.key || $[7] !== def.placeholder || $[8] !== source) {
|
|
111
|
+
t5 = /* @__PURE__ */ jsx(BagInput, {
|
|
112
|
+
source,
|
|
113
|
+
stateKey: def.key,
|
|
114
|
+
type: "text",
|
|
115
|
+
placeholder: def.placeholder,
|
|
116
|
+
classNames
|
|
117
|
+
});
|
|
118
|
+
$[5] = classNames;
|
|
119
|
+
$[6] = def.key;
|
|
120
|
+
$[7] = def.placeholder;
|
|
121
|
+
$[8] = source;
|
|
122
|
+
$[9] = t5;
|
|
123
|
+
} else t5 = $[9];
|
|
124
|
+
let t6;
|
|
125
|
+
if ($[10] !== classNames.filterField || $[11] !== t4 || $[12] !== t5) {
|
|
126
|
+
t6 = /* @__PURE__ */ jsxs("label", {
|
|
127
|
+
"data-adapttable-part": FIELD_PART,
|
|
128
|
+
className: t1,
|
|
129
|
+
children: [
|
|
130
|
+
t4,
|
|
131
|
+
" ",
|
|
132
|
+
t5
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
$[10] = classNames.filterField;
|
|
136
|
+
$[11] = t4;
|
|
137
|
+
$[12] = t5;
|
|
138
|
+
$[13] = t6;
|
|
139
|
+
} else t6 = $[13];
|
|
140
|
+
return t6;
|
|
61
141
|
}
|
|
62
|
-
function SelectField(
|
|
142
|
+
function SelectField(t0) {
|
|
143
|
+
const $ = c(22);
|
|
144
|
+
const { def, source, classNames } = t0;
|
|
63
145
|
const { options, loading } = useFilterOptions(def);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
146
|
+
const t1 = classNames.filterField;
|
|
147
|
+
const t2 = classNames.filterLabel;
|
|
148
|
+
let t3;
|
|
149
|
+
if ($[0] !== def) {
|
|
150
|
+
t3 = filterLabel$1(def);
|
|
151
|
+
$[0] = def;
|
|
152
|
+
$[1] = t3;
|
|
153
|
+
} else t3 = $[1];
|
|
154
|
+
let t4;
|
|
155
|
+
if ($[2] !== classNames.filterLabel || $[3] !== t3) {
|
|
156
|
+
t4 = /* @__PURE__ */ jsx("span", {
|
|
157
|
+
"data-adapttable-part": LABEL_PART,
|
|
158
|
+
className: t2,
|
|
159
|
+
children: t3
|
|
160
|
+
});
|
|
161
|
+
$[2] = classNames.filterLabel;
|
|
162
|
+
$[3] = t3;
|
|
163
|
+
$[4] = t4;
|
|
164
|
+
} else t4 = $[4];
|
|
165
|
+
const t5 = classNames.filterSelect;
|
|
166
|
+
const t6 = source.extra[def.key];
|
|
167
|
+
let t7;
|
|
168
|
+
if ($[5] !== t6) {
|
|
169
|
+
t7 = asText(t6);
|
|
170
|
+
$[5] = t6;
|
|
171
|
+
$[6] = t7;
|
|
172
|
+
} else t7 = $[6];
|
|
173
|
+
let t8;
|
|
174
|
+
if ($[7] !== def.key || $[8] !== source) {
|
|
175
|
+
t8 = (e) => source.setExtra(def.key, e.currentTarget.value);
|
|
176
|
+
$[7] = def.key;
|
|
177
|
+
$[8] = source;
|
|
178
|
+
$[9] = t8;
|
|
179
|
+
} else t8 = $[9];
|
|
180
|
+
let t9;
|
|
181
|
+
if ($[10] !== loading || $[11] !== options) {
|
|
182
|
+
t9 = loading ? /* @__PURE__ */ jsx("option", {
|
|
183
|
+
value: "",
|
|
184
|
+
disabled: true,
|
|
185
|
+
children: "…"
|
|
186
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("option", {
|
|
187
|
+
value: "",
|
|
188
|
+
children: "All"
|
|
189
|
+
}), options.map(_temp$3)] });
|
|
190
|
+
$[10] = loading;
|
|
191
|
+
$[11] = options;
|
|
192
|
+
$[12] = t9;
|
|
193
|
+
} else t9 = $[12];
|
|
194
|
+
let t10;
|
|
195
|
+
if ($[13] !== classNames.filterSelect || $[14] !== t7 || $[15] !== t8 || $[16] !== t9) {
|
|
196
|
+
t10 = /* @__PURE__ */ jsx("select", {
|
|
197
|
+
"data-adapttable-part": "filter-select",
|
|
198
|
+
className: t5,
|
|
199
|
+
value: t7,
|
|
200
|
+
onChange: t8,
|
|
201
|
+
children: t9
|
|
202
|
+
});
|
|
203
|
+
$[13] = classNames.filterSelect;
|
|
204
|
+
$[14] = t7;
|
|
205
|
+
$[15] = t8;
|
|
206
|
+
$[16] = t9;
|
|
207
|
+
$[17] = t10;
|
|
208
|
+
} else t10 = $[17];
|
|
209
|
+
let t11;
|
|
210
|
+
if ($[18] !== classNames.filterField || $[19] !== t10 || $[20] !== t4) {
|
|
211
|
+
t11 = /* @__PURE__ */ jsxs("label", {
|
|
212
|
+
"data-adapttable-part": FIELD_PART,
|
|
213
|
+
className: t1,
|
|
214
|
+
children: [
|
|
215
|
+
t4,
|
|
216
|
+
" ",
|
|
217
|
+
t10
|
|
218
|
+
]
|
|
219
|
+
});
|
|
220
|
+
$[18] = classNames.filterField;
|
|
221
|
+
$[19] = t10;
|
|
222
|
+
$[20] = t4;
|
|
223
|
+
$[21] = t11;
|
|
224
|
+
} else t11 = $[21];
|
|
225
|
+
return t11;
|
|
226
|
+
}
|
|
227
|
+
function _temp$3(option) {
|
|
228
|
+
return /* @__PURE__ */ jsx("option", {
|
|
229
|
+
value: option.value,
|
|
230
|
+
children: option.label
|
|
231
|
+
}, option.value);
|
|
232
|
+
}
|
|
233
|
+
function MultiSelectField(t0) {
|
|
234
|
+
const $ = c(10);
|
|
235
|
+
const { def, source, classNames } = t0;
|
|
236
|
+
const selected = selectedValues(source.extra[def.key]);
|
|
237
|
+
const { options, loading } = useFilterOptions(def);
|
|
238
|
+
const T0 = GroupField;
|
|
239
|
+
let t1;
|
|
240
|
+
if ($[0] !== def) {
|
|
241
|
+
t1 = filterLabel$1(def);
|
|
242
|
+
$[0] = def;
|
|
243
|
+
$[1] = t1;
|
|
244
|
+
} else t1 = $[1];
|
|
245
|
+
const t2 = "filter-checkbox-group";
|
|
246
|
+
const t3 = loading ? /* @__PURE__ */ jsx("span", {
|
|
247
|
+
"data-adapttable-part": "filter-options-loading",
|
|
248
|
+
className: classNames.filterOptionsLoading,
|
|
249
|
+
children: "…"
|
|
250
|
+
}) : options.map((option) => /* @__PURE__ */ jsxs("label", {
|
|
251
|
+
"data-adapttable-part": "filter-checkbox",
|
|
252
|
+
className: classNames.filterCheckbox,
|
|
67
253
|
children: [
|
|
68
|
-
/* @__PURE__ */ jsx("
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
254
|
+
/* @__PURE__ */ jsx("input", {
|
|
255
|
+
type: "checkbox",
|
|
256
|
+
checked: selected.includes(option.value),
|
|
257
|
+
onChange: (e) => source.setExtra(def.key, e.currentTarget.checked ? [...selected, option.value] : selected.filter((v) => v !== option.value))
|
|
72
258
|
}),
|
|
73
259
|
" ",
|
|
74
|
-
|
|
75
|
-
"data-adapttable-part": "filter-select",
|
|
76
|
-
className: classNames.filterSelect,
|
|
77
|
-
value: asText(source.extra[def.key]),
|
|
78
|
-
onChange: (e) => source.setExtra(def.key, e.currentTarget.value),
|
|
79
|
-
children: loading ? /* @__PURE__ */ jsx("option", {
|
|
80
|
-
value: "",
|
|
81
|
-
disabled: true,
|
|
82
|
-
children: "…"
|
|
83
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("option", {
|
|
84
|
-
value: "",
|
|
85
|
-
children: "All"
|
|
86
|
-
}), options.map((option) => /* @__PURE__ */ jsx("option", {
|
|
87
|
-
value: option.value,
|
|
88
|
-
children: option.label
|
|
89
|
-
}, option.value))] })
|
|
90
|
-
})
|
|
260
|
+
option.label
|
|
91
261
|
]
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return /* @__PURE__ */ jsx(GroupField, {
|
|
98
|
-
caption: filterLabel$1(def),
|
|
99
|
-
classNames,
|
|
100
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
101
|
-
"data-adapttable-part": "filter-checkbox-group",
|
|
262
|
+
}, option.value));
|
|
263
|
+
let t4;
|
|
264
|
+
if ($[2] !== classNames.filterCheckboxGroup || $[3] !== t3) {
|
|
265
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
266
|
+
"data-adapttable-part": t2,
|
|
102
267
|
className: classNames.filterCheckboxGroup,
|
|
103
|
-
children:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
268
|
+
children: t3
|
|
269
|
+
});
|
|
270
|
+
$[2] = classNames.filterCheckboxGroup;
|
|
271
|
+
$[3] = t3;
|
|
272
|
+
$[4] = t4;
|
|
273
|
+
} else t4 = $[4];
|
|
274
|
+
let t5;
|
|
275
|
+
if ($[5] !== T0 || $[6] !== classNames || $[7] !== t1 || $[8] !== t4) {
|
|
276
|
+
t5 = /* @__PURE__ */ jsx(T0, {
|
|
277
|
+
caption: t1,
|
|
278
|
+
classNames,
|
|
279
|
+
children: t4
|
|
280
|
+
});
|
|
281
|
+
$[5] = T0;
|
|
282
|
+
$[6] = classNames;
|
|
283
|
+
$[7] = t1;
|
|
284
|
+
$[8] = t4;
|
|
285
|
+
$[9] = t5;
|
|
286
|
+
} else t5 = $[9];
|
|
287
|
+
return t5;
|
|
122
288
|
}
|
|
123
289
|
/** One bound of a range widget; the parent owns the write-through. */
|
|
124
|
-
function RangeValueInput(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
290
|
+
function RangeValueInput(t0) {
|
|
291
|
+
const $ = c(9);
|
|
292
|
+
const { type, label, value, onValue, classNames } = t0;
|
|
293
|
+
let t1;
|
|
294
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295
|
+
t1 = {
|
|
128
296
|
flex: "1 1 7rem",
|
|
129
297
|
minWidth: "7rem"
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
value
|
|
136
|
-
|
|
137
|
-
|
|
298
|
+
};
|
|
299
|
+
$[0] = t1;
|
|
300
|
+
} else t1 = $[0];
|
|
301
|
+
let t2;
|
|
302
|
+
if ($[1] !== onValue) {
|
|
303
|
+
t2 = (e) => onValue(e.currentTarget.value);
|
|
304
|
+
$[1] = onValue;
|
|
305
|
+
$[2] = t2;
|
|
306
|
+
} else t2 = $[2];
|
|
307
|
+
let t3;
|
|
308
|
+
if ($[3] !== classNames.filterInput || $[4] !== label || $[5] !== t2 || $[6] !== type || $[7] !== value) {
|
|
309
|
+
t3 = /* @__PURE__ */ jsx("input", {
|
|
310
|
+
type,
|
|
311
|
+
style: t1,
|
|
312
|
+
placeholder: label,
|
|
313
|
+
"aria-label": label,
|
|
314
|
+
"data-adapttable-part": "filter-input",
|
|
315
|
+
className: classNames.filterInput,
|
|
316
|
+
value,
|
|
317
|
+
onChange: t2
|
|
318
|
+
});
|
|
319
|
+
$[3] = classNames.filterInput;
|
|
320
|
+
$[4] = label;
|
|
321
|
+
$[5] = t2;
|
|
322
|
+
$[6] = type;
|
|
323
|
+
$[7] = value;
|
|
324
|
+
$[8] = t3;
|
|
325
|
+
} else t3 = $[8];
|
|
326
|
+
return t3;
|
|
138
327
|
}
|
|
139
328
|
/**
|
|
140
329
|
* Operator-first range field: a comparison `<select>` (its placeholder
|
|
@@ -142,105 +331,284 @@ function RangeValueInput({ type, label, value, onValue, classNames }) {
|
|
|
142
331
|
* pair for `between`. The persisted state stays the inclusive
|
|
143
332
|
* `<key><start>` / `<key><end>` pair, written through `setExtras`.
|
|
144
333
|
*/
|
|
145
|
-
function RangeField(
|
|
334
|
+
function RangeField(t0) {
|
|
335
|
+
const $ = c(56);
|
|
336
|
+
const { def, source, classNames, inputType, suffixes, labels } = t0;
|
|
146
337
|
const lowKey = def.key + suffixes.start;
|
|
147
338
|
const highKey = def.key + suffixes.end;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
339
|
+
let t1;
|
|
340
|
+
if ($[0] !== highKey || $[1] !== lowKey || $[2] !== source.extra) {
|
|
341
|
+
t1 = () => readRangeWidget(source.extra, lowKey, highKey).op;
|
|
342
|
+
$[0] = highKey;
|
|
343
|
+
$[1] = lowKey;
|
|
344
|
+
$[2] = source.extra;
|
|
345
|
+
$[3] = t1;
|
|
346
|
+
} else t1 = $[3];
|
|
347
|
+
const [op, setOp] = useState(t1);
|
|
348
|
+
const t2 = source.extra[op === "lte" ? highKey : lowKey];
|
|
349
|
+
let t3;
|
|
350
|
+
if ($[4] !== t2) {
|
|
351
|
+
t3 = asText(t2);
|
|
352
|
+
$[4] = t2;
|
|
353
|
+
$[5] = t3;
|
|
354
|
+
} else t3 = $[5];
|
|
355
|
+
const a = t3;
|
|
356
|
+
const t4 = source.extra[highKey];
|
|
357
|
+
let t5;
|
|
358
|
+
if ($[6] !== t4) {
|
|
359
|
+
t5 = asText(t4);
|
|
360
|
+
$[6] = t4;
|
|
361
|
+
$[7] = t5;
|
|
362
|
+
} else t5 = $[7];
|
|
363
|
+
const b = t5;
|
|
364
|
+
let t6;
|
|
365
|
+
if ($[8] !== highKey || $[9] !== lowKey || $[10] !== source) {
|
|
366
|
+
t6 = (nextOp, nextA, nextB) => source.setExtras(writeRangeWidget(nextOp, nextA, nextB, lowKey, highKey));
|
|
367
|
+
$[8] = highKey;
|
|
368
|
+
$[9] = lowKey;
|
|
369
|
+
$[10] = source;
|
|
370
|
+
$[11] = t6;
|
|
371
|
+
} else t6 = $[11];
|
|
372
|
+
const write = t6;
|
|
152
373
|
const opLabelKeys = RANGE_OP_LABEL_KEYS[inputType];
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
})] }),
|
|
198
|
-
op !== void 0 && op !== "between" && /* @__PURE__ */ jsx(RangeValueInput, {
|
|
199
|
-
type: inputType,
|
|
200
|
-
label: labels.value,
|
|
201
|
-
value: a,
|
|
202
|
-
onValue: (next) => write(op, next, ""),
|
|
203
|
-
classNames
|
|
204
|
-
})
|
|
205
|
-
]
|
|
206
|
-
})
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
function FilterField({ def, source, classNames, labels }) {
|
|
210
|
-
switch (def.type) {
|
|
211
|
-
case "text": return /* @__PURE__ */ jsx(TextField, {
|
|
212
|
-
def,
|
|
213
|
-
source,
|
|
214
|
-
classNames
|
|
374
|
+
let t7;
|
|
375
|
+
if ($[12] !== def) {
|
|
376
|
+
t7 = filterLabel$1(def);
|
|
377
|
+
$[12] = def;
|
|
378
|
+
$[13] = t7;
|
|
379
|
+
} else t7 = $[13];
|
|
380
|
+
let t8;
|
|
381
|
+
let t9;
|
|
382
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
383
|
+
t8 = {
|
|
384
|
+
display: "flex",
|
|
385
|
+
flexWrap: "wrap",
|
|
386
|
+
gap: 8
|
|
387
|
+
};
|
|
388
|
+
t9 = {
|
|
389
|
+
flex: "0 0 8.5rem",
|
|
390
|
+
width: "8.5rem"
|
|
391
|
+
};
|
|
392
|
+
$[14] = t8;
|
|
393
|
+
$[15] = t9;
|
|
394
|
+
} else {
|
|
395
|
+
t8 = $[14];
|
|
396
|
+
t9 = $[15];
|
|
397
|
+
}
|
|
398
|
+
const t10 = labels.operator;
|
|
399
|
+
const t11 = classNames.filterOperator;
|
|
400
|
+
const t12 = op ?? "";
|
|
401
|
+
let t13;
|
|
402
|
+
if ($[16] !== a || $[17] !== b || $[18] !== write) {
|
|
403
|
+
t13 = (e) => {
|
|
404
|
+
const next = RANGE_OPS.find((o) => o === e.currentTarget.value);
|
|
405
|
+
setOp(next);
|
|
406
|
+
write(next, a, b);
|
|
407
|
+
};
|
|
408
|
+
$[16] = a;
|
|
409
|
+
$[17] = b;
|
|
410
|
+
$[18] = write;
|
|
411
|
+
$[19] = t13;
|
|
412
|
+
} else t13 = $[19];
|
|
413
|
+
let t14;
|
|
414
|
+
if ($[20] !== labels.operator) {
|
|
415
|
+
t14 = /* @__PURE__ */ jsx("option", {
|
|
416
|
+
value: "",
|
|
417
|
+
children: labels.operator
|
|
215
418
|
});
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
419
|
+
$[20] = labels.operator;
|
|
420
|
+
$[21] = t14;
|
|
421
|
+
} else t14 = $[21];
|
|
422
|
+
let t15;
|
|
423
|
+
if ($[22] !== labels || $[23] !== opLabelKeys) {
|
|
424
|
+
t15 = RANGE_OPS.map((o_0) => /* @__PURE__ */ jsx("option", {
|
|
425
|
+
value: o_0,
|
|
426
|
+
children: labels[opLabelKeys[o_0]]
|
|
427
|
+
}, o_0));
|
|
428
|
+
$[22] = labels;
|
|
429
|
+
$[23] = opLabelKeys;
|
|
430
|
+
$[24] = t15;
|
|
431
|
+
} else t15 = $[24];
|
|
432
|
+
let t16;
|
|
433
|
+
if ($[25] !== classNames.filterOperator || $[26] !== labels.operator || $[27] !== t12 || $[28] !== t13 || $[29] !== t14 || $[30] !== t15) {
|
|
434
|
+
t16 = /* @__PURE__ */ jsxs("select", {
|
|
435
|
+
style: t9,
|
|
436
|
+
"aria-label": t10,
|
|
437
|
+
"data-adapttable-part": "filter-operator",
|
|
438
|
+
className: t11,
|
|
439
|
+
value: t12,
|
|
440
|
+
onChange: t13,
|
|
441
|
+
children: [t14, t15]
|
|
220
442
|
});
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
443
|
+
$[25] = classNames.filterOperator;
|
|
444
|
+
$[26] = labels.operator;
|
|
445
|
+
$[27] = t12;
|
|
446
|
+
$[28] = t13;
|
|
447
|
+
$[29] = t14;
|
|
448
|
+
$[30] = t15;
|
|
449
|
+
$[31] = t16;
|
|
450
|
+
} else t16 = $[31];
|
|
451
|
+
let t17;
|
|
452
|
+
if ($[32] !== a || $[33] !== b || $[34] !== classNames || $[35] !== inputType || $[36] !== labels.from || $[37] !== labels.to || $[38] !== op || $[39] !== write) {
|
|
453
|
+
t17 = op === "between" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RangeValueInput, {
|
|
454
|
+
type: inputType,
|
|
455
|
+
label: labels.from,
|
|
456
|
+
value: a,
|
|
457
|
+
onValue: (next_0) => write(op, next_0, b),
|
|
458
|
+
classNames
|
|
459
|
+
}), /* @__PURE__ */ jsx(RangeValueInput, {
|
|
460
|
+
type: inputType,
|
|
461
|
+
label: labels.to,
|
|
462
|
+
value: b,
|
|
463
|
+
onValue: (next_1) => write(op, a, next_1),
|
|
464
|
+
classNames
|
|
465
|
+
})] });
|
|
466
|
+
$[32] = a;
|
|
467
|
+
$[33] = b;
|
|
468
|
+
$[34] = classNames;
|
|
469
|
+
$[35] = inputType;
|
|
470
|
+
$[36] = labels.from;
|
|
471
|
+
$[37] = labels.to;
|
|
472
|
+
$[38] = op;
|
|
473
|
+
$[39] = write;
|
|
474
|
+
$[40] = t17;
|
|
475
|
+
} else t17 = $[40];
|
|
476
|
+
let t18;
|
|
477
|
+
if ($[41] !== a || $[42] !== classNames || $[43] !== inputType || $[44] !== labels.value || $[45] !== op || $[46] !== write) {
|
|
478
|
+
t18 = op !== void 0 && op !== "between" && /* @__PURE__ */ jsx(RangeValueInput, {
|
|
479
|
+
type: inputType,
|
|
480
|
+
label: labels.value,
|
|
481
|
+
value: a,
|
|
482
|
+
onValue: (next_2) => write(op, next_2, ""),
|
|
224
483
|
classNames
|
|
225
484
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
485
|
+
$[41] = a;
|
|
486
|
+
$[42] = classNames;
|
|
487
|
+
$[43] = inputType;
|
|
488
|
+
$[44] = labels.value;
|
|
489
|
+
$[45] = op;
|
|
490
|
+
$[46] = write;
|
|
491
|
+
$[47] = t18;
|
|
492
|
+
} else t18 = $[47];
|
|
493
|
+
let t19;
|
|
494
|
+
if ($[48] !== t16 || $[49] !== t17 || $[50] !== t18) {
|
|
495
|
+
t19 = /* @__PURE__ */ jsxs("div", {
|
|
496
|
+
style: t8,
|
|
497
|
+
children: [
|
|
498
|
+
t16,
|
|
499
|
+
t17,
|
|
500
|
+
t18
|
|
501
|
+
]
|
|
233
502
|
});
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
503
|
+
$[48] = t16;
|
|
504
|
+
$[49] = t17;
|
|
505
|
+
$[50] = t18;
|
|
506
|
+
$[51] = t19;
|
|
507
|
+
} else t19 = $[51];
|
|
508
|
+
let t20;
|
|
509
|
+
if ($[52] !== classNames || $[53] !== t19 || $[54] !== t7) {
|
|
510
|
+
t20 = /* @__PURE__ */ jsx(GroupField, {
|
|
511
|
+
caption: t7,
|
|
237
512
|
classNames,
|
|
238
|
-
|
|
239
|
-
suffixes: RANGE_SUFFIXES.numberRange,
|
|
240
|
-
labels
|
|
513
|
+
children: t19
|
|
241
514
|
});
|
|
515
|
+
$[52] = classNames;
|
|
516
|
+
$[53] = t19;
|
|
517
|
+
$[54] = t7;
|
|
518
|
+
$[55] = t20;
|
|
519
|
+
} else t20 = $[55];
|
|
520
|
+
return t20;
|
|
521
|
+
}
|
|
522
|
+
function FilterField(t0) {
|
|
523
|
+
const $ = c(22);
|
|
524
|
+
const { def, source, classNames, labels } = t0;
|
|
525
|
+
switch (def.type) {
|
|
526
|
+
case "text": {
|
|
527
|
+
let t1;
|
|
528
|
+
if ($[0] !== classNames || $[1] !== def || $[2] !== source) {
|
|
529
|
+
t1 = /* @__PURE__ */ jsx(TextField, {
|
|
530
|
+
def,
|
|
531
|
+
source,
|
|
532
|
+
classNames
|
|
533
|
+
});
|
|
534
|
+
$[0] = classNames;
|
|
535
|
+
$[1] = def;
|
|
536
|
+
$[2] = source;
|
|
537
|
+
$[3] = t1;
|
|
538
|
+
} else t1 = $[3];
|
|
539
|
+
return t1;
|
|
540
|
+
}
|
|
541
|
+
case "select": {
|
|
542
|
+
let t1;
|
|
543
|
+
if ($[4] !== classNames || $[5] !== def || $[6] !== source) {
|
|
544
|
+
t1 = /* @__PURE__ */ jsx(SelectField, {
|
|
545
|
+
def,
|
|
546
|
+
source,
|
|
547
|
+
classNames
|
|
548
|
+
});
|
|
549
|
+
$[4] = classNames;
|
|
550
|
+
$[5] = def;
|
|
551
|
+
$[6] = source;
|
|
552
|
+
$[7] = t1;
|
|
553
|
+
} else t1 = $[7];
|
|
554
|
+
return t1;
|
|
555
|
+
}
|
|
556
|
+
case "multiSelect": {
|
|
557
|
+
let t1;
|
|
558
|
+
if ($[8] !== classNames || $[9] !== def || $[10] !== source) {
|
|
559
|
+
t1 = /* @__PURE__ */ jsx(MultiSelectField, {
|
|
560
|
+
def,
|
|
561
|
+
source,
|
|
562
|
+
classNames
|
|
563
|
+
});
|
|
564
|
+
$[8] = classNames;
|
|
565
|
+
$[9] = def;
|
|
566
|
+
$[10] = source;
|
|
567
|
+
$[11] = t1;
|
|
568
|
+
} else t1 = $[11];
|
|
569
|
+
return t1;
|
|
570
|
+
}
|
|
571
|
+
case "dateRange": {
|
|
572
|
+
let t1;
|
|
573
|
+
if ($[12] !== classNames || $[13] !== def || $[14] !== labels || $[15] !== source) {
|
|
574
|
+
t1 = /* @__PURE__ */ jsx(RangeField, {
|
|
575
|
+
def,
|
|
576
|
+
source,
|
|
577
|
+
classNames,
|
|
578
|
+
inputType: "date",
|
|
579
|
+
suffixes: RANGE_SUFFIXES.dateRange,
|
|
580
|
+
labels
|
|
581
|
+
});
|
|
582
|
+
$[12] = classNames;
|
|
583
|
+
$[13] = def;
|
|
584
|
+
$[14] = labels;
|
|
585
|
+
$[15] = source;
|
|
586
|
+
$[16] = t1;
|
|
587
|
+
} else t1 = $[16];
|
|
588
|
+
return t1;
|
|
589
|
+
}
|
|
590
|
+
case "numberRange": {
|
|
591
|
+
let t1;
|
|
592
|
+
if ($[17] !== classNames || $[18] !== def || $[19] !== labels || $[20] !== source) {
|
|
593
|
+
t1 = /* @__PURE__ */ jsx(RangeField, {
|
|
594
|
+
def,
|
|
595
|
+
source,
|
|
596
|
+
classNames,
|
|
597
|
+
inputType: "number",
|
|
598
|
+
suffixes: RANGE_SUFFIXES.numberRange,
|
|
599
|
+
labels
|
|
600
|
+
});
|
|
601
|
+
$[17] = classNames;
|
|
602
|
+
$[18] = def;
|
|
603
|
+
$[19] = labels;
|
|
604
|
+
$[20] = source;
|
|
605
|
+
$[21] = t1;
|
|
606
|
+
} else t1 = $[21];
|
|
607
|
+
return t1;
|
|
608
|
+
}
|
|
242
609
|
}
|
|
243
610
|
}
|
|
611
|
+
/** Props for {@link AutoFilterForm}. */
|
|
244
612
|
/**
|
|
245
613
|
* The auto-built filter form for the declarative `filters` array: one
|
|
246
614
|
* semantic field per definition (`text` input, `select` with an "All"
|
|
@@ -251,14 +619,52 @@ function FilterField({ def, source, classNames, labels }) {
|
|
|
251
619
|
*
|
|
252
620
|
* @typeParam TRow - The row type.
|
|
253
621
|
*/
|
|
254
|
-
function AutoFilterForm(
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
622
|
+
function AutoFilterForm(t0) {
|
|
623
|
+
const $ = c(15);
|
|
624
|
+
const { defs, source, classNames: t1, labels } = t0;
|
|
625
|
+
let t2;
|
|
626
|
+
if ($[0] !== t1) {
|
|
627
|
+
t2 = t1 === void 0 ? {} : t1;
|
|
628
|
+
$[0] = t1;
|
|
629
|
+
$[1] = t2;
|
|
630
|
+
} else t2 = $[1];
|
|
631
|
+
const classNames = t2;
|
|
632
|
+
let t3;
|
|
633
|
+
if ($[2] !== labels) {
|
|
634
|
+
t3 = resolveLabels(labels);
|
|
635
|
+
$[2] = labels;
|
|
636
|
+
$[3] = t3;
|
|
637
|
+
} else t3 = $[3];
|
|
638
|
+
const resolvedLabels = t3;
|
|
639
|
+
let t4;
|
|
640
|
+
if ($[4] !== classNames || $[5] !== defs || $[6] !== resolvedLabels || $[7] !== source) {
|
|
641
|
+
let t5;
|
|
642
|
+
if ($[9] !== classNames || $[10] !== resolvedLabels || $[11] !== source) {
|
|
643
|
+
t5 = (def) => /* @__PURE__ */ jsx(FilterField, {
|
|
644
|
+
def,
|
|
645
|
+
source,
|
|
646
|
+
classNames,
|
|
647
|
+
labels: resolvedLabels
|
|
648
|
+
}, def.key);
|
|
649
|
+
$[9] = classNames;
|
|
650
|
+
$[10] = resolvedLabels;
|
|
651
|
+
$[11] = source;
|
|
652
|
+
$[12] = t5;
|
|
653
|
+
} else t5 = $[12];
|
|
654
|
+
t4 = defs.map(t5);
|
|
655
|
+
$[4] = classNames;
|
|
656
|
+
$[5] = defs;
|
|
657
|
+
$[6] = resolvedLabels;
|
|
658
|
+
$[7] = source;
|
|
659
|
+
$[8] = t4;
|
|
660
|
+
} else t4 = $[8];
|
|
661
|
+
let t5;
|
|
662
|
+
if ($[13] !== t4) {
|
|
663
|
+
t5 = /* @__PURE__ */ jsx(Fragment, { children: t4 });
|
|
664
|
+
$[13] = t4;
|
|
665
|
+
$[14] = t5;
|
|
666
|
+
} else t5 = $[14];
|
|
667
|
+
return t5;
|
|
262
668
|
}
|
|
263
669
|
//#endregion
|
|
264
670
|
//#region src/cx.ts
|
|
@@ -274,6 +680,7 @@ function cx(...parts) {
|
|
|
274
680
|
}
|
|
275
681
|
//#endregion
|
|
276
682
|
//#region src/components/FilterPanel.tsx
|
|
683
|
+
/** Props for {@link FilterPanel}. */
|
|
277
684
|
/** Backdrop + side drawer for caller-provided filter widgets. */
|
|
278
685
|
function FilterPanel({ open, onClose, filters, activeFilterCount, onClearFilters, labels, dir = "ltr", classNames }) {
|
|
279
686
|
const panelRef = useRef(null);
|
|
@@ -365,6 +772,7 @@ function FilterPanel({ open, onClose, filters, activeFilterCount, onClearFilters
|
|
|
365
772
|
}
|
|
366
773
|
//#endregion
|
|
367
774
|
//#region src/components/FilterPopover.tsx
|
|
775
|
+
/** Props for {@link FilterPopover}. */
|
|
368
776
|
/**
|
|
369
777
|
* Anchored filter card (the default filter container). Opens beneath the
|
|
370
778
|
* Filters button with NO backdrop — the background stays visible and
|
|
@@ -384,8 +792,8 @@ function FilterPopover({ open, onClose, filters, activeFilterCount, onClearFilte
|
|
|
384
792
|
if (cardRef.current?.contains(document.activeElement)) return;
|
|
385
793
|
onCloseRef.current();
|
|
386
794
|
};
|
|
387
|
-
const onKeyDown = (
|
|
388
|
-
if (
|
|
795
|
+
const onKeyDown = (event_0) => {
|
|
796
|
+
if (event_0.key !== "Escape") return;
|
|
389
797
|
onCloseRef.current();
|
|
390
798
|
rootRef.current?.querySelector("button")?.focus();
|
|
391
799
|
};
|
|
@@ -441,45 +849,104 @@ function FilterPopover({ open, onClose, filters, activeFilterCount, onClearFilte
|
|
|
441
849
|
}
|
|
442
850
|
//#endregion
|
|
443
851
|
//#region src/components/icons.tsx
|
|
444
|
-
function Svg(
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
852
|
+
function Svg(t0) {
|
|
853
|
+
const $ = c(4);
|
|
854
|
+
const { size: t1, className, children } = t0;
|
|
855
|
+
const size = t1 === void 0 ? 16 : t1;
|
|
856
|
+
let t2;
|
|
857
|
+
if ($[0] !== children || $[1] !== className || $[2] !== size) {
|
|
858
|
+
t2 = /* @__PURE__ */ jsx("svg", {
|
|
859
|
+
width: size,
|
|
860
|
+
height: size,
|
|
861
|
+
viewBox: "0 0 24 24",
|
|
862
|
+
fill: "none",
|
|
863
|
+
stroke: "currentColor",
|
|
864
|
+
strokeWidth: 2,
|
|
865
|
+
strokeLinecap: "round",
|
|
866
|
+
strokeLinejoin: "round",
|
|
867
|
+
className,
|
|
868
|
+
"aria-hidden": "true",
|
|
869
|
+
focusable: "false",
|
|
870
|
+
children
|
|
871
|
+
});
|
|
872
|
+
$[0] = children;
|
|
873
|
+
$[1] = className;
|
|
874
|
+
$[2] = size;
|
|
875
|
+
$[3] = t2;
|
|
876
|
+
} else t2 = $[3];
|
|
877
|
+
return t2;
|
|
459
878
|
}
|
|
460
879
|
/** Magnifying-glass search glyph (inline SVG, `currentColor`). */
|
|
461
|
-
const SearchIcon = (p) =>
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
880
|
+
const SearchIcon = (p) => {
|
|
881
|
+
const $ = c(4);
|
|
882
|
+
let t0;
|
|
883
|
+
let t1;
|
|
884
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
885
|
+
t0 = /* @__PURE__ */ jsx("circle", {
|
|
886
|
+
cx: "11",
|
|
887
|
+
cy: "11",
|
|
888
|
+
r: "7"
|
|
889
|
+
});
|
|
890
|
+
t1 = /* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" });
|
|
891
|
+
$[0] = t0;
|
|
892
|
+
$[1] = t1;
|
|
893
|
+
} else {
|
|
894
|
+
t0 = $[0];
|
|
895
|
+
t1 = $[1];
|
|
896
|
+
}
|
|
897
|
+
let t2;
|
|
898
|
+
if ($[2] !== p) {
|
|
899
|
+
t2 = /* @__PURE__ */ jsxs(Svg, {
|
|
900
|
+
...p,
|
|
901
|
+
children: [t0, t1]
|
|
902
|
+
});
|
|
903
|
+
$[2] = p;
|
|
904
|
+
$[3] = t2;
|
|
905
|
+
} else t2 = $[3];
|
|
906
|
+
return t2;
|
|
907
|
+
};
|
|
469
908
|
/** Funnel glyph for the Filters button (inline SVG, `currentColor`). */
|
|
470
|
-
const FiltersIcon = (p) =>
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
909
|
+
const FiltersIcon = (p) => {
|
|
910
|
+
const $ = c(3);
|
|
911
|
+
let t0;
|
|
912
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
913
|
+
t0 = /* @__PURE__ */ jsx("path", { d: "M3 4h18l-7 8v6l-4 2v-8L3 4Z" });
|
|
914
|
+
$[0] = t0;
|
|
915
|
+
} else t0 = $[0];
|
|
916
|
+
let t1;
|
|
917
|
+
if ($[1] !== p) {
|
|
918
|
+
t1 = /* @__PURE__ */ jsx(Svg, {
|
|
919
|
+
...p,
|
|
920
|
+
children: t0
|
|
921
|
+
});
|
|
922
|
+
$[1] = p;
|
|
923
|
+
$[2] = t1;
|
|
924
|
+
} else t1 = $[2];
|
|
925
|
+
return t1;
|
|
926
|
+
};
|
|
474
927
|
/**
|
|
475
928
|
* Right-pointing chevron (▸) for the expand-row button. The button carries a
|
|
476
929
|
* `data-expanded` attribute so consumers rotate the glyph with their own CSS
|
|
477
930
|
* (e.g. `[data-expanded] svg { transform: rotate(90deg) }`).
|
|
478
931
|
*/
|
|
479
|
-
const ChevronIcon = (p) =>
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
932
|
+
const ChevronIcon = (p) => {
|
|
933
|
+
const $ = c(3);
|
|
934
|
+
let t0;
|
|
935
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
936
|
+
t0 = /* @__PURE__ */ jsx("path", { d: "m9 6 6 6-6 6" });
|
|
937
|
+
$[0] = t0;
|
|
938
|
+
} else t0 = $[0];
|
|
939
|
+
let t1;
|
|
940
|
+
if ($[1] !== p) {
|
|
941
|
+
t1 = /* @__PURE__ */ jsx(Svg, {
|
|
942
|
+
...p,
|
|
943
|
+
children: t0
|
|
944
|
+
});
|
|
945
|
+
$[1] = p;
|
|
946
|
+
$[2] = t1;
|
|
947
|
+
} else t1 = $[2];
|
|
948
|
+
return t1;
|
|
949
|
+
};
|
|
483
950
|
//#endregion
|
|
484
951
|
//#region src/components/menuPopover.ts
|
|
485
952
|
/**
|
|
@@ -496,41 +963,62 @@ const MENU_PANEL_STYLE = {
|
|
|
496
963
|
padding: 0,
|
|
497
964
|
minInlineSize: 0
|
|
498
965
|
};
|
|
966
|
+
/** Disclosure state shared by the toolbar menu popovers. */
|
|
499
967
|
/**
|
|
500
968
|
* Disclosure behaviour for the toolbar menus (ColumnMenu, SavedViewsMenu):
|
|
501
969
|
* open/close state that also closes on outside mousedown or Escape, with
|
|
502
970
|
* Escape restoring focus to the trigger.
|
|
503
971
|
*/
|
|
504
972
|
function useMenuPopover() {
|
|
973
|
+
const $ = c(5);
|
|
505
974
|
const [open, setOpen] = useState(false);
|
|
506
975
|
const rootRef = useRef(null);
|
|
507
976
|
const triggerRef = useRef(null);
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
977
|
+
let t0;
|
|
978
|
+
let t1;
|
|
979
|
+
if ($[0] !== open) {
|
|
980
|
+
t0 = () => {
|
|
981
|
+
if (!open) return;
|
|
982
|
+
const onDown = (event) => {
|
|
983
|
+
if (!rootRef.current?.contains(event.target)) setOpen(false);
|
|
984
|
+
};
|
|
985
|
+
const onKey = (event_0) => {
|
|
986
|
+
if (event_0.key !== "Escape") return;
|
|
987
|
+
setOpen(false);
|
|
988
|
+
triggerRef.current?.focus();
|
|
989
|
+
};
|
|
990
|
+
document.addEventListener("mousedown", onDown);
|
|
991
|
+
document.addEventListener("keydown", onKey);
|
|
992
|
+
return () => {
|
|
993
|
+
document.removeEventListener("mousedown", onDown);
|
|
994
|
+
document.removeEventListener("keydown", onKey);
|
|
995
|
+
};
|
|
512
996
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
997
|
+
t1 = [open];
|
|
998
|
+
$[0] = open;
|
|
999
|
+
$[1] = t0;
|
|
1000
|
+
$[2] = t1;
|
|
1001
|
+
} else {
|
|
1002
|
+
t0 = $[1];
|
|
1003
|
+
t1 = $[2];
|
|
1004
|
+
}
|
|
1005
|
+
useEffect(t0, t1);
|
|
1006
|
+
let t2;
|
|
1007
|
+
if ($[3] !== open) {
|
|
1008
|
+
t2 = {
|
|
1009
|
+
open,
|
|
1010
|
+
setOpen,
|
|
1011
|
+
rootRef,
|
|
1012
|
+
triggerRef
|
|
523
1013
|
};
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
rootRef,
|
|
529
|
-
triggerRef
|
|
530
|
-
};
|
|
1014
|
+
$[3] = open;
|
|
1015
|
+
$[4] = t2;
|
|
1016
|
+
} else t2 = $[4];
|
|
1017
|
+
return t2;
|
|
531
1018
|
}
|
|
532
1019
|
//#endregion
|
|
533
1020
|
//#region src/components/SavedViewsMenu.tsx
|
|
1021
|
+
/** The label strings the saved-views menu renders. */
|
|
534
1022
|
/**
|
|
535
1023
|
* Saved-views popover: a disclosure button + a panel listing the saved views
|
|
536
1024
|
* (click applies one; each has a delete button) above a save row that
|
|
@@ -538,30 +1026,64 @@ function useMenuPopover() {
|
|
|
538
1026
|
* `useSavedViews`; closes on outside-click or Escape. Ships no styles —
|
|
539
1027
|
* target the `data-adapttable-part` hooks or the `views*` className slots.
|
|
540
1028
|
*/
|
|
541
|
-
function SavedViewsMenu(
|
|
1029
|
+
function SavedViewsMenu(t0) {
|
|
1030
|
+
const $ = c(34);
|
|
1031
|
+
const { options, labels, classNames } = t0;
|
|
542
1032
|
const { views, save, apply, remove } = useSavedViews$1(options);
|
|
543
1033
|
const { open, setOpen, rootRef, triggerRef } = useMenuPopover();
|
|
544
1034
|
const [name, setName] = useState("");
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1035
|
+
let t1;
|
|
1036
|
+
if ($[0] !== name) {
|
|
1037
|
+
t1 = name.trim();
|
|
1038
|
+
$[0] = name;
|
|
1039
|
+
$[1] = t1;
|
|
1040
|
+
} else t1 = $[1];
|
|
1041
|
+
const trimmed = t1;
|
|
1042
|
+
let t2;
|
|
1043
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1044
|
+
t2 = { position: "relative" };
|
|
1045
|
+
$[2] = t2;
|
|
1046
|
+
} else t2 = $[2];
|
|
1047
|
+
const t3 = open || void 0;
|
|
1048
|
+
let t4;
|
|
1049
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1050
|
+
t4 = {
|
|
1051
|
+
flexShrink: 0,
|
|
1052
|
+
whiteSpace: "nowrap"
|
|
1053
|
+
};
|
|
1054
|
+
$[3] = t4;
|
|
1055
|
+
} else t4 = $[3];
|
|
1056
|
+
let t5;
|
|
1057
|
+
if ($[4] !== setOpen) {
|
|
1058
|
+
t5 = () => setOpen(_temp$2);
|
|
1059
|
+
$[4] = setOpen;
|
|
1060
|
+
$[5] = t5;
|
|
1061
|
+
} else t5 = $[5];
|
|
1062
|
+
let t6;
|
|
1063
|
+
if ($[6] !== classNames.viewsButton || $[7] !== labels.savedViews || $[8] !== open || $[9] !== t3 || $[10] !== t5 || $[11] !== triggerRef) {
|
|
1064
|
+
t6 = /* @__PURE__ */ jsx("button", {
|
|
551
1065
|
ref: triggerRef,
|
|
552
1066
|
type: "button",
|
|
553
1067
|
"aria-expanded": open,
|
|
554
1068
|
"aria-haspopup": "true",
|
|
555
1069
|
"data-adapttable-part": "views-button",
|
|
556
|
-
"data-active":
|
|
1070
|
+
"data-active": t3,
|
|
557
1071
|
className: classNames.viewsButton,
|
|
558
|
-
style:
|
|
559
|
-
|
|
560
|
-
whiteSpace: "nowrap"
|
|
561
|
-
},
|
|
562
|
-
onClick: () => setOpen((v) => !v),
|
|
1072
|
+
style: t4,
|
|
1073
|
+
onClick: t5,
|
|
563
1074
|
children: labels.savedViews
|
|
564
|
-
})
|
|
1075
|
+
});
|
|
1076
|
+
$[6] = classNames.viewsButton;
|
|
1077
|
+
$[7] = labels.savedViews;
|
|
1078
|
+
$[8] = open;
|
|
1079
|
+
$[9] = t3;
|
|
1080
|
+
$[10] = t5;
|
|
1081
|
+
$[11] = triggerRef;
|
|
1082
|
+
$[12] = t6;
|
|
1083
|
+
} else t6 = $[12];
|
|
1084
|
+
let t7;
|
|
1085
|
+
if ($[13] !== apply || $[14] !== classNames.viewsDelete || $[15] !== classNames.viewsInput || $[16] !== classNames.viewsItem || $[17] !== classNames.viewsPanel || $[18] !== classNames.viewsSave || $[19] !== labels.deleteView || $[20] !== labels.saveView || $[21] !== labels.viewName || $[22] !== name || $[23] !== open || $[24] !== remove || $[25] !== save || $[26] !== setOpen || $[27] !== trimmed || $[28] !== views) {
|
|
1086
|
+
t7 = open && /* @__PURE__ */ jsxs("div", {
|
|
565
1087
|
"data-adapttable-part": "views-panel",
|
|
566
1088
|
className: classNames.viewsPanel,
|
|
567
1089
|
style: MENU_PANEL_STYLE,
|
|
@@ -615,63 +1137,165 @@ function SavedViewsMenu({ options, labels, classNames }) {
|
|
|
615
1137
|
})]
|
|
616
1138
|
})
|
|
617
1139
|
]
|
|
618
|
-
})
|
|
619
|
-
|
|
1140
|
+
});
|
|
1141
|
+
$[13] = apply;
|
|
1142
|
+
$[14] = classNames.viewsDelete;
|
|
1143
|
+
$[15] = classNames.viewsInput;
|
|
1144
|
+
$[16] = classNames.viewsItem;
|
|
1145
|
+
$[17] = classNames.viewsPanel;
|
|
1146
|
+
$[18] = classNames.viewsSave;
|
|
1147
|
+
$[19] = labels.deleteView;
|
|
1148
|
+
$[20] = labels.saveView;
|
|
1149
|
+
$[21] = labels.viewName;
|
|
1150
|
+
$[22] = name;
|
|
1151
|
+
$[23] = open;
|
|
1152
|
+
$[24] = remove;
|
|
1153
|
+
$[25] = save;
|
|
1154
|
+
$[26] = setOpen;
|
|
1155
|
+
$[27] = trimmed;
|
|
1156
|
+
$[28] = views;
|
|
1157
|
+
$[29] = t7;
|
|
1158
|
+
} else t7 = $[29];
|
|
1159
|
+
let t8;
|
|
1160
|
+
if ($[30] !== rootRef || $[31] !== t6 || $[32] !== t7) {
|
|
1161
|
+
t8 = /* @__PURE__ */ jsxs("div", {
|
|
1162
|
+
ref: rootRef,
|
|
1163
|
+
"data-adapttable-part": "views-menu",
|
|
1164
|
+
style: t2,
|
|
1165
|
+
children: [t6, t7]
|
|
1166
|
+
});
|
|
1167
|
+
$[30] = rootRef;
|
|
1168
|
+
$[31] = t6;
|
|
1169
|
+
$[32] = t7;
|
|
1170
|
+
$[33] = t8;
|
|
1171
|
+
} else t8 = $[33];
|
|
1172
|
+
return t8;
|
|
1173
|
+
}
|
|
1174
|
+
function _temp$2(v) {
|
|
1175
|
+
return !v;
|
|
620
1176
|
}
|
|
621
1177
|
//#endregion
|
|
622
1178
|
//#region src/components/chrome.tsx
|
|
623
1179
|
/** Removable filter-chip strip. Renders nothing when empty. */
|
|
624
|
-
function Chips(
|
|
1180
|
+
function Chips(t0) {
|
|
1181
|
+
const $ = c(21);
|
|
1182
|
+
const { chips, onClearAll, labels, classNames } = t0;
|
|
625
1183
|
if (chips.length === 0) return null;
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
1184
|
+
const t1 = labels.filters;
|
|
1185
|
+
const t2 = classNames.chips;
|
|
1186
|
+
let t3;
|
|
1187
|
+
if ($[0] !== chips || $[1] !== classNames.chip || $[2] !== classNames.chipRemove || $[3] !== labels.clearAll) {
|
|
1188
|
+
let t4;
|
|
1189
|
+
if ($[5] !== classNames.chip || $[6] !== classNames.chipRemove || $[7] !== labels.clearAll) {
|
|
1190
|
+
t4 = (chip) => /* @__PURE__ */ jsxs("li", {
|
|
1191
|
+
"data-adapttable-part": "chip",
|
|
1192
|
+
className: classNames.chip,
|
|
1193
|
+
children: [chip.label, /* @__PURE__ */ jsx("button", {
|
|
1194
|
+
type: "button",
|
|
1195
|
+
"aria-label": `${labels.clearAll}: ${chip.label}`,
|
|
1196
|
+
"data-adapttable-part": "chip-remove",
|
|
1197
|
+
className: classNames.chipRemove,
|
|
1198
|
+
onClick: chip.onRemove,
|
|
1199
|
+
children: "×"
|
|
1200
|
+
})]
|
|
1201
|
+
}, chip.key);
|
|
1202
|
+
$[5] = classNames.chip;
|
|
1203
|
+
$[6] = classNames.chipRemove;
|
|
1204
|
+
$[7] = labels.clearAll;
|
|
1205
|
+
$[8] = t4;
|
|
1206
|
+
} else t4 = $[8];
|
|
1207
|
+
t3 = chips.map(t4);
|
|
1208
|
+
$[0] = chips;
|
|
1209
|
+
$[1] = classNames.chip;
|
|
1210
|
+
$[2] = classNames.chipRemove;
|
|
1211
|
+
$[3] = labels.clearAll;
|
|
1212
|
+
$[4] = t3;
|
|
1213
|
+
} else t3 = $[4];
|
|
1214
|
+
let t4;
|
|
1215
|
+
if ($[9] !== classNames.chipRemove || $[10] !== labels.clearAll || $[11] !== onClearAll) {
|
|
1216
|
+
t4 = /* @__PURE__ */ jsx("button", {
|
|
1217
|
+
type: "button",
|
|
1218
|
+
"data-adapttable-part": "chip-remove",
|
|
1219
|
+
className: classNames.chipRemove,
|
|
1220
|
+
onClick: onClearAll,
|
|
1221
|
+
children: labels.clearAll
|
|
1222
|
+
});
|
|
1223
|
+
$[9] = classNames.chipRemove;
|
|
1224
|
+
$[10] = labels.clearAll;
|
|
1225
|
+
$[11] = onClearAll;
|
|
1226
|
+
$[12] = t4;
|
|
1227
|
+
} else t4 = $[12];
|
|
1228
|
+
let t5;
|
|
1229
|
+
if ($[13] !== classNames.chip || $[14] !== t4) {
|
|
1230
|
+
t5 = /* @__PURE__ */ jsx("li", {
|
|
642
1231
|
"data-adapttable-part": "chip",
|
|
643
1232
|
className: classNames.chip,
|
|
644
|
-
children:
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
1233
|
+
children: t4
|
|
1234
|
+
});
|
|
1235
|
+
$[13] = classNames.chip;
|
|
1236
|
+
$[14] = t4;
|
|
1237
|
+
$[15] = t5;
|
|
1238
|
+
} else t5 = $[15];
|
|
1239
|
+
let t6;
|
|
1240
|
+
if ($[16] !== classNames.chips || $[17] !== labels.filters || $[18] !== t3 || $[19] !== t5) {
|
|
1241
|
+
t6 = /* @__PURE__ */ jsxs("ul", {
|
|
1242
|
+
"aria-label": t1,
|
|
1243
|
+
"data-adapttable-part": "chips",
|
|
1244
|
+
className: t2,
|
|
1245
|
+
children: [t3, t5]
|
|
1246
|
+
});
|
|
1247
|
+
$[16] = classNames.chips;
|
|
1248
|
+
$[17] = labels.filters;
|
|
1249
|
+
$[18] = t3;
|
|
1250
|
+
$[19] = t5;
|
|
1251
|
+
$[20] = t6;
|
|
1252
|
+
} else t6 = $[20];
|
|
1253
|
+
return t6;
|
|
653
1254
|
}
|
|
654
1255
|
/** Selection toolbar with bulk-action buttons. */
|
|
655
|
-
function BulkBar(
|
|
1256
|
+
function BulkBar(t0) {
|
|
1257
|
+
const $ = c(42);
|
|
1258
|
+
const { selection, total, bulkActions, confirm, labels, classNames } = t0;
|
|
656
1259
|
const { selectedIds, selectedCount, clear, headerState, visibleIds, allMatching, selectAllMatching } = selection;
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
1260
|
+
let t1;
|
|
1261
|
+
if ($[0] !== clear || $[1] !== confirm || $[2] !== labels.cancel) {
|
|
1262
|
+
t1 = {
|
|
1263
|
+
confirm,
|
|
1264
|
+
cancelLabel: labels.cancel,
|
|
1265
|
+
onComplete: clear
|
|
1266
|
+
};
|
|
1267
|
+
$[0] = clear;
|
|
1268
|
+
$[1] = confirm;
|
|
1269
|
+
$[2] = labels.cancel;
|
|
1270
|
+
$[3] = t1;
|
|
1271
|
+
} else t1 = $[3];
|
|
1272
|
+
const { pending, run } = useBulkActionRunner(t1);
|
|
662
1273
|
if (selectedCount === 0) return null;
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
1274
|
+
let t2;
|
|
1275
|
+
if ($[4] !== allMatching || $[5] !== bulkActions || $[6] !== classNames.bulkBar || $[7] !== classNames.bulkButton || $[8] !== classNames.selectAllBanner || $[9] !== classNames.selectAllButton || $[10] !== classNames.selectAllText || $[11] !== clear || $[12] !== headerState || $[13] !== labels || $[14] !== pending || $[15] !== run || $[16] !== selectAllMatching || $[17] !== selectedCount || $[18] !== selectedIds || $[19] !== total || $[20] !== visibleIds) {
|
|
1276
|
+
const ids = [...selectedIds];
|
|
1277
|
+
const showBanner = headerState === "all" && total > visibleIds.length;
|
|
1278
|
+
const scope = allMatching ? {
|
|
1279
|
+
allMatching: true,
|
|
1280
|
+
total
|
|
1281
|
+
} : void 0;
|
|
1282
|
+
const t3 = classNames.bulkBar;
|
|
1283
|
+
let t4;
|
|
1284
|
+
if ($[22] !== labels || $[23] !== selectedCount) {
|
|
1285
|
+
t4 = labels.selectedCount(selectedCount);
|
|
1286
|
+
$[22] = labels;
|
|
1287
|
+
$[23] = selectedCount;
|
|
1288
|
+
$[24] = t4;
|
|
1289
|
+
} else t4 = $[24];
|
|
1290
|
+
let t5;
|
|
1291
|
+
if ($[25] !== t4) {
|
|
1292
|
+
t5 = /* @__PURE__ */ jsx("span", { children: t4 });
|
|
1293
|
+
$[25] = t4;
|
|
1294
|
+
$[26] = t5;
|
|
1295
|
+
} else t5 = $[26];
|
|
1296
|
+
let t6;
|
|
1297
|
+
if ($[27] !== allMatching || $[28] !== classNames.selectAllBanner || $[29] !== classNames.selectAllButton || $[30] !== classNames.selectAllText || $[31] !== clear || $[32] !== labels || $[33] !== selectAllMatching || $[34] !== showBanner || $[35] !== total || $[36] !== visibleIds) {
|
|
1298
|
+
t6 = showBanner && /* @__PURE__ */ jsxs("div", {
|
|
675
1299
|
"data-adapttable-part": "select-all-banner",
|
|
676
1300
|
className: classNames.selectAllBanner,
|
|
677
1301
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -685,108 +1309,357 @@ function BulkBar({ selection, total, bulkActions, confirm, labels, classNames })
|
|
|
685
1309
|
onClick: allMatching ? clear : selectAllMatching,
|
|
686
1310
|
children: allMatching ? labels.clearAll : labels.selectAllMatching(total)
|
|
687
1311
|
})]
|
|
688
|
-
})
|
|
689
|
-
|
|
1312
|
+
});
|
|
1313
|
+
$[27] = allMatching;
|
|
1314
|
+
$[28] = classNames.selectAllBanner;
|
|
1315
|
+
$[29] = classNames.selectAllButton;
|
|
1316
|
+
$[30] = classNames.selectAllText;
|
|
1317
|
+
$[31] = clear;
|
|
1318
|
+
$[32] = labels;
|
|
1319
|
+
$[33] = selectAllMatching;
|
|
1320
|
+
$[34] = showBanner;
|
|
1321
|
+
$[35] = total;
|
|
1322
|
+
$[36] = visibleIds;
|
|
1323
|
+
$[37] = t6;
|
|
1324
|
+
} else t6 = $[37];
|
|
1325
|
+
const t7 = pending !== null;
|
|
1326
|
+
let t8;
|
|
1327
|
+
if ($[38] !== clear || $[39] !== labels.clearAll || $[40] !== t7) {
|
|
1328
|
+
t8 = /* @__PURE__ */ jsx("button", {
|
|
690
1329
|
type: "button",
|
|
691
1330
|
onClick: clear,
|
|
692
|
-
disabled:
|
|
1331
|
+
disabled: t7,
|
|
693
1332
|
children: labels.clearAll
|
|
694
|
-
})
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
1333
|
+
});
|
|
1334
|
+
$[38] = clear;
|
|
1335
|
+
$[39] = labels.clearAll;
|
|
1336
|
+
$[40] = t7;
|
|
1337
|
+
$[41] = t8;
|
|
1338
|
+
} else t8 = $[41];
|
|
1339
|
+
t2 = /* @__PURE__ */ jsxs("div", {
|
|
1340
|
+
"data-adapttable-part": "bulk-bar",
|
|
1341
|
+
className: t3,
|
|
1342
|
+
children: [
|
|
1343
|
+
t5,
|
|
1344
|
+
t6,
|
|
1345
|
+
t8,
|
|
1346
|
+
bulkActions.map((action) => {
|
|
1347
|
+
const reason = resolveDisabledReason(action.disabledReason?.(ids));
|
|
1348
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
1349
|
+
type: "button",
|
|
1350
|
+
title: reason,
|
|
1351
|
+
disabled: reason !== void 0 || pending !== null,
|
|
1352
|
+
"data-adapttable-part": "bulk-button",
|
|
1353
|
+
"data-color": action.color,
|
|
1354
|
+
className: classNames.bulkButton,
|
|
1355
|
+
onClick: () => run(action, ids, scope),
|
|
1356
|
+
children: [action.icon, action.label]
|
|
1357
|
+
}, action.key);
|
|
1358
|
+
})
|
|
1359
|
+
]
|
|
1360
|
+
});
|
|
1361
|
+
$[4] = allMatching;
|
|
1362
|
+
$[5] = bulkActions;
|
|
1363
|
+
$[6] = classNames.bulkBar;
|
|
1364
|
+
$[7] = classNames.bulkButton;
|
|
1365
|
+
$[8] = classNames.selectAllBanner;
|
|
1366
|
+
$[9] = classNames.selectAllButton;
|
|
1367
|
+
$[10] = classNames.selectAllText;
|
|
1368
|
+
$[11] = clear;
|
|
1369
|
+
$[12] = headerState;
|
|
1370
|
+
$[13] = labels;
|
|
1371
|
+
$[14] = pending;
|
|
1372
|
+
$[15] = run;
|
|
1373
|
+
$[16] = selectAllMatching;
|
|
1374
|
+
$[17] = selectedCount;
|
|
1375
|
+
$[18] = selectedIds;
|
|
1376
|
+
$[19] = total;
|
|
1377
|
+
$[20] = visibleIds;
|
|
1378
|
+
$[21] = t2;
|
|
1379
|
+
} else t2 = $[21];
|
|
1380
|
+
return t2;
|
|
710
1381
|
}
|
|
711
1382
|
/** The rows-per-page selector shared by the toolbar (infinite) and footer. */
|
|
712
|
-
function RowsPerPageSelect(
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
1383
|
+
function RowsPerPageSelect(t0) {
|
|
1384
|
+
const $ = c(13);
|
|
1385
|
+
const { source, labels, classNames } = t0;
|
|
1386
|
+
const t1 = labels.rowsPerPage;
|
|
1387
|
+
const t2 = labels.rowsPerPage;
|
|
1388
|
+
const t3 = classNames.rowsPerPageSelect;
|
|
1389
|
+
const t4 = source.limit;
|
|
1390
|
+
let t5;
|
|
1391
|
+
if ($[0] !== source) {
|
|
1392
|
+
t5 = (e) => source.setLimit(Number(e.currentTarget.value));
|
|
1393
|
+
$[0] = source;
|
|
1394
|
+
$[1] = t5;
|
|
1395
|
+
} else t5 = $[1];
|
|
1396
|
+
let t6;
|
|
1397
|
+
if ($[2] !== source.limit) {
|
|
1398
|
+
t6 = pageSizeOptions(source.limit).map(_temp$1);
|
|
1399
|
+
$[2] = source.limit;
|
|
1400
|
+
$[3] = t6;
|
|
1401
|
+
} else t6 = $[3];
|
|
1402
|
+
let t7;
|
|
1403
|
+
if ($[4] !== classNames.rowsPerPageSelect || $[5] !== labels.rowsPerPage || $[6] !== source.limit || $[7] !== t5 || $[8] !== t6) {
|
|
1404
|
+
t7 = /* @__PURE__ */ jsx("select", {
|
|
1405
|
+
"aria-label": t2,
|
|
718
1406
|
"data-adapttable-part": "rows-per-page",
|
|
719
|
-
className:
|
|
720
|
-
value:
|
|
721
|
-
onChange:
|
|
722
|
-
children:
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
1407
|
+
className: t3,
|
|
1408
|
+
value: t4,
|
|
1409
|
+
onChange: t5,
|
|
1410
|
+
children: t6
|
|
1411
|
+
});
|
|
1412
|
+
$[4] = classNames.rowsPerPageSelect;
|
|
1413
|
+
$[5] = labels.rowsPerPage;
|
|
1414
|
+
$[6] = source.limit;
|
|
1415
|
+
$[7] = t5;
|
|
1416
|
+
$[8] = t6;
|
|
1417
|
+
$[9] = t7;
|
|
1418
|
+
} else t7 = $[9];
|
|
1419
|
+
let t8;
|
|
1420
|
+
if ($[10] !== labels.rowsPerPage || $[11] !== t7) {
|
|
1421
|
+
t8 = /* @__PURE__ */ jsxs("label", { children: [
|
|
1422
|
+
t1,
|
|
1423
|
+
" ",
|
|
1424
|
+
t7
|
|
1425
|
+
] });
|
|
1426
|
+
$[10] = labels.rowsPerPage;
|
|
1427
|
+
$[11] = t7;
|
|
1428
|
+
$[12] = t8;
|
|
1429
|
+
} else t8 = $[12];
|
|
1430
|
+
return t8;
|
|
728
1431
|
}
|
|
729
1432
|
/** Prev/next pager with a rows-per-page select. */
|
|
730
|
-
function
|
|
1433
|
+
function _temp$1(n) {
|
|
1434
|
+
return /* @__PURE__ */ jsx("option", {
|
|
1435
|
+
value: n,
|
|
1436
|
+
children: n
|
|
1437
|
+
}, n);
|
|
1438
|
+
}
|
|
1439
|
+
function Footer(t0) {
|
|
1440
|
+
const $ = c(53);
|
|
1441
|
+
const { pagination, source, labels, classNames } = t0;
|
|
731
1442
|
const { safePage, totalPages, fromIndex, toIndex } = pagination;
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
1443
|
+
const t1 = classNames.footer;
|
|
1444
|
+
let t2;
|
|
1445
|
+
if ($[0] !== classNames || $[1] !== labels || $[2] !== source) {
|
|
1446
|
+
t2 = /* @__PURE__ */ jsx(RowsPerPageSelect, {
|
|
1447
|
+
source,
|
|
1448
|
+
labels,
|
|
1449
|
+
classNames
|
|
1450
|
+
});
|
|
1451
|
+
$[0] = classNames;
|
|
1452
|
+
$[1] = labels;
|
|
1453
|
+
$[2] = source;
|
|
1454
|
+
$[3] = t2;
|
|
1455
|
+
} else t2 = $[3];
|
|
1456
|
+
let t3;
|
|
1457
|
+
if ($[4] !== fromIndex || $[5] !== labels || $[6] !== source.total || $[7] !== toIndex) {
|
|
1458
|
+
t3 = source.total > 0 && /* @__PURE__ */ jsx("span", { children: labels.showing({
|
|
1459
|
+
from: fromIndex,
|
|
1460
|
+
to: toIndex,
|
|
1461
|
+
total: source.total
|
|
1462
|
+
}) });
|
|
1463
|
+
$[4] = fromIndex;
|
|
1464
|
+
$[5] = labels;
|
|
1465
|
+
$[6] = source.total;
|
|
1466
|
+
$[7] = toIndex;
|
|
1467
|
+
$[8] = t3;
|
|
1468
|
+
} else t3 = $[8];
|
|
1469
|
+
const t4 = classNames.pager;
|
|
1470
|
+
let t5;
|
|
1471
|
+
if ($[9] !== labels || $[10] !== safePage || $[11] !== totalPages) {
|
|
1472
|
+
t5 = labels.pageOf({
|
|
1473
|
+
page: safePage,
|
|
1474
|
+
total: totalPages
|
|
1475
|
+
});
|
|
1476
|
+
$[9] = labels;
|
|
1477
|
+
$[10] = safePage;
|
|
1478
|
+
$[11] = totalPages;
|
|
1479
|
+
$[12] = t5;
|
|
1480
|
+
} else t5 = $[12];
|
|
1481
|
+
let t6;
|
|
1482
|
+
if ($[13] !== t5) {
|
|
1483
|
+
t6 = /* @__PURE__ */ jsx("span", { children: t5 });
|
|
1484
|
+
$[13] = t5;
|
|
1485
|
+
$[14] = t6;
|
|
1486
|
+
} else t6 = $[14];
|
|
1487
|
+
const t7 = safePage <= 1;
|
|
1488
|
+
let t8;
|
|
1489
|
+
if ($[15] !== safePage || $[16] !== source) {
|
|
1490
|
+
t8 = () => source.setPage(safePage - 1);
|
|
1491
|
+
$[15] = safePage;
|
|
1492
|
+
$[16] = source;
|
|
1493
|
+
$[17] = t8;
|
|
1494
|
+
} else t8 = $[17];
|
|
1495
|
+
let t9;
|
|
1496
|
+
if ($[18] !== classNames.pageButton || $[19] !== labels.previousPage || $[20] !== t7 || $[21] !== t8) {
|
|
1497
|
+
t9 = /* @__PURE__ */ jsx("button", {
|
|
1498
|
+
type: "button",
|
|
1499
|
+
"aria-label": labels.previousPage,
|
|
1500
|
+
"data-adapttable-part": "page-prev",
|
|
1501
|
+
className: classNames.pageButton,
|
|
1502
|
+
disabled: t7,
|
|
1503
|
+
onClick: t8,
|
|
1504
|
+
children: "‹"
|
|
1505
|
+
});
|
|
1506
|
+
$[18] = classNames.pageButton;
|
|
1507
|
+
$[19] = labels.previousPage;
|
|
1508
|
+
$[20] = t7;
|
|
1509
|
+
$[21] = t8;
|
|
1510
|
+
$[22] = t9;
|
|
1511
|
+
} else t9 = $[22];
|
|
1512
|
+
let t10;
|
|
1513
|
+
if ($[23] !== classNames.pageButton || $[24] !== classNames.pageEllipsis || $[25] !== safePage || $[26] !== source || $[27] !== totalPages) {
|
|
1514
|
+
let t11;
|
|
1515
|
+
if ($[29] !== classNames.pageButton || $[30] !== classNames.pageEllipsis || $[31] !== safePage || $[32] !== source) {
|
|
1516
|
+
t11 = (item, i) => item === "ellipsis" ? /* @__PURE__ */ jsx("span", {
|
|
1517
|
+
"data-adapttable-part": "page-ellipsis",
|
|
1518
|
+
"aria-hidden": "true",
|
|
1519
|
+
className: classNames.pageEllipsis,
|
|
1520
|
+
children: "…"
|
|
1521
|
+
}, `ellipsis-${i}`) : /* @__PURE__ */ jsx("button", {
|
|
760
1522
|
type: "button",
|
|
761
|
-
"
|
|
762
|
-
"
|
|
1523
|
+
"data-adapttable-part": "page-number",
|
|
1524
|
+
"aria-current": item === safePage ? "page" : void 0,
|
|
763
1525
|
className: classNames.pageButton,
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
1526
|
+
onClick: () => source.setPage(item),
|
|
1527
|
+
children: item
|
|
1528
|
+
}, item);
|
|
1529
|
+
$[29] = classNames.pageButton;
|
|
1530
|
+
$[30] = classNames.pageEllipsis;
|
|
1531
|
+
$[31] = safePage;
|
|
1532
|
+
$[32] = source;
|
|
1533
|
+
$[33] = t11;
|
|
1534
|
+
} else t11 = $[33];
|
|
1535
|
+
t10 = paginationItems(safePage, totalPages).map(t11);
|
|
1536
|
+
$[23] = classNames.pageButton;
|
|
1537
|
+
$[24] = classNames.pageEllipsis;
|
|
1538
|
+
$[25] = safePage;
|
|
1539
|
+
$[26] = source;
|
|
1540
|
+
$[27] = totalPages;
|
|
1541
|
+
$[28] = t10;
|
|
1542
|
+
} else t10 = $[28];
|
|
1543
|
+
const t11 = safePage >= totalPages;
|
|
1544
|
+
let t12;
|
|
1545
|
+
if ($[34] !== safePage || $[35] !== source) {
|
|
1546
|
+
t12 = () => source.setPage(safePage + 1);
|
|
1547
|
+
$[34] = safePage;
|
|
1548
|
+
$[35] = source;
|
|
1549
|
+
$[36] = t12;
|
|
1550
|
+
} else t12 = $[36];
|
|
1551
|
+
let t13;
|
|
1552
|
+
if ($[37] !== classNames.pageButton || $[38] !== labels.nextPage || $[39] !== t11 || $[40] !== t12) {
|
|
1553
|
+
t13 = /* @__PURE__ */ jsx("button", {
|
|
1554
|
+
type: "button",
|
|
1555
|
+
"aria-label": labels.nextPage,
|
|
1556
|
+
"data-adapttable-part": "page-next",
|
|
1557
|
+
className: classNames.pageButton,
|
|
1558
|
+
disabled: t11,
|
|
1559
|
+
onClick: t12,
|
|
1560
|
+
children: "›"
|
|
1561
|
+
});
|
|
1562
|
+
$[37] = classNames.pageButton;
|
|
1563
|
+
$[38] = labels.nextPage;
|
|
1564
|
+
$[39] = t11;
|
|
1565
|
+
$[40] = t12;
|
|
1566
|
+
$[41] = t13;
|
|
1567
|
+
} else t13 = $[41];
|
|
1568
|
+
let t14;
|
|
1569
|
+
if ($[42] !== classNames.pager || $[43] !== t10 || $[44] !== t13 || $[45] !== t6 || $[46] !== t9) {
|
|
1570
|
+
t14 = /* @__PURE__ */ jsxs("div", {
|
|
1571
|
+
"data-adapttable-part": "pager",
|
|
1572
|
+
className: t4,
|
|
1573
|
+
children: [
|
|
1574
|
+
t6,
|
|
1575
|
+
t9,
|
|
1576
|
+
t10,
|
|
1577
|
+
t13
|
|
1578
|
+
]
|
|
1579
|
+
});
|
|
1580
|
+
$[42] = classNames.pager;
|
|
1581
|
+
$[43] = t10;
|
|
1582
|
+
$[44] = t13;
|
|
1583
|
+
$[45] = t6;
|
|
1584
|
+
$[46] = t9;
|
|
1585
|
+
$[47] = t14;
|
|
1586
|
+
} else t14 = $[47];
|
|
1587
|
+
let t15;
|
|
1588
|
+
if ($[48] !== classNames.footer || $[49] !== t14 || $[50] !== t2 || $[51] !== t3) {
|
|
1589
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
1590
|
+
"data-adapttable-part": "footer",
|
|
1591
|
+
className: t1,
|
|
1592
|
+
children: [
|
|
1593
|
+
t2,
|
|
1594
|
+
t3,
|
|
1595
|
+
t14
|
|
1596
|
+
]
|
|
1597
|
+
});
|
|
1598
|
+
$[48] = classNames.footer;
|
|
1599
|
+
$[49] = t14;
|
|
1600
|
+
$[50] = t2;
|
|
1601
|
+
$[51] = t3;
|
|
1602
|
+
$[52] = t15;
|
|
1603
|
+
} else t15 = $[52];
|
|
1604
|
+
return t15;
|
|
770
1605
|
}
|
|
771
1606
|
/** Inline error with optional retry. */
|
|
772
|
-
function ErrorState(
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
children:
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
1607
|
+
function ErrorState(t0) {
|
|
1608
|
+
const $ = c(16);
|
|
1609
|
+
const { error, labels, onRetry, classNames } = t0;
|
|
1610
|
+
let t1;
|
|
1611
|
+
if ($[0] !== labels.errorTitle) {
|
|
1612
|
+
t1 = /* @__PURE__ */ jsx("strong", { children: labels.errorTitle });
|
|
1613
|
+
$[0] = labels.errorTitle;
|
|
1614
|
+
$[1] = t1;
|
|
1615
|
+
} else t1 = $[1];
|
|
1616
|
+
let t2;
|
|
1617
|
+
if ($[2] !== labels.errorMessage) {
|
|
1618
|
+
t2 = /* @__PURE__ */ jsx("p", { children: labels.errorMessage });
|
|
1619
|
+
$[2] = labels.errorMessage;
|
|
1620
|
+
$[3] = t2;
|
|
1621
|
+
} else t2 = $[3];
|
|
1622
|
+
let t3;
|
|
1623
|
+
if ($[4] !== error.message) {
|
|
1624
|
+
t3 = /* @__PURE__ */ jsx("small", { children: error.message });
|
|
1625
|
+
$[4] = error.message;
|
|
1626
|
+
$[5] = t3;
|
|
1627
|
+
} else t3 = $[5];
|
|
1628
|
+
let t4;
|
|
1629
|
+
if ($[6] !== classNames.retryButton || $[7] !== labels.retry || $[8] !== onRetry) {
|
|
1630
|
+
t4 = onRetry && /* @__PURE__ */ jsx("button", {
|
|
1631
|
+
type: "button",
|
|
1632
|
+
onClick: onRetry,
|
|
1633
|
+
"data-adapttable-part": "retry",
|
|
1634
|
+
className: classNames.retryButton,
|
|
1635
|
+
children: labels.retry
|
|
1636
|
+
});
|
|
1637
|
+
$[6] = classNames.retryButton;
|
|
1638
|
+
$[7] = labels.retry;
|
|
1639
|
+
$[8] = onRetry;
|
|
1640
|
+
$[9] = t4;
|
|
1641
|
+
} else t4 = $[9];
|
|
1642
|
+
let t5;
|
|
1643
|
+
if ($[10] !== classNames.error || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
|
|
1644
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
1645
|
+
role: "alert",
|
|
1646
|
+
"data-adapttable-part": "error",
|
|
1647
|
+
className: classNames.error,
|
|
1648
|
+
children: [
|
|
1649
|
+
t1,
|
|
1650
|
+
t2,
|
|
1651
|
+
t3,
|
|
1652
|
+
t4
|
|
1653
|
+
]
|
|
1654
|
+
});
|
|
1655
|
+
$[10] = classNames.error;
|
|
1656
|
+
$[11] = t1;
|
|
1657
|
+
$[12] = t2;
|
|
1658
|
+
$[13] = t3;
|
|
1659
|
+
$[14] = t4;
|
|
1660
|
+
$[15] = t5;
|
|
1661
|
+
} else t5 = $[15];
|
|
1662
|
+
return t5;
|
|
790
1663
|
}
|
|
791
1664
|
function loadingLineWidth(column, total) {
|
|
792
1665
|
if (column === 0) return "70%";
|
|
@@ -794,17 +1667,36 @@ function loadingLineWidth(column, total) {
|
|
|
794
1667
|
return "55%";
|
|
795
1668
|
}
|
|
796
1669
|
/** Skeleton-ish loading placeholder (semantic, unstyled). */
|
|
797
|
-
function LoadingState(
|
|
798
|
-
const
|
|
1670
|
+
function LoadingState(t0) {
|
|
1671
|
+
const $ = c(24);
|
|
1672
|
+
const { rows, columns, variant, labels, classNames, hasActions: t1 } = t0;
|
|
1673
|
+
const hasActions = t1 === void 0 ? false : t1;
|
|
1674
|
+
let t2;
|
|
1675
|
+
if ($[0] !== rows) {
|
|
1676
|
+
t2 = Array.from({ length: rows }, _temp2);
|
|
1677
|
+
$[0] = rows;
|
|
1678
|
+
$[1] = t2;
|
|
1679
|
+
} else t2 = $[1];
|
|
1680
|
+
const rowKeys = t2;
|
|
799
1681
|
const columnCount = Math.max(columns, 1) + (hasActions ? 1 : 0);
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1682
|
+
let t3;
|
|
1683
|
+
let t4;
|
|
1684
|
+
let t5;
|
|
1685
|
+
let t6;
|
|
1686
|
+
let t7;
|
|
1687
|
+
let t8;
|
|
1688
|
+
if ($[2] !== classNames.loading || $[3] !== columnCount || $[4] !== rowKeys || $[5] !== variant) {
|
|
1689
|
+
const columnKeys = Array.from({ length: columnCount }, _temp3);
|
|
1690
|
+
t3 = "status";
|
|
1691
|
+
t4 = "true";
|
|
1692
|
+
t5 = "polite";
|
|
1693
|
+
t6 = "loading";
|
|
1694
|
+
if ($[12] !== classNames.loading) {
|
|
1695
|
+
t7 = cx(classNames.loading);
|
|
1696
|
+
$[12] = classNames.loading;
|
|
1697
|
+
$[13] = t7;
|
|
1698
|
+
} else t7 = $[13];
|
|
1699
|
+
t8 = variant === "table" ? /* @__PURE__ */ jsxs("table", {
|
|
808
1700
|
"data-adapttable-part": "loading-table",
|
|
809
1701
|
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", {
|
|
810
1702
|
"data-adapttable-part": "loading-header-row",
|
|
@@ -817,141 +1709,426 @@ function LoadingState({ rows, columns, variant, labels, classNames, hasActions =
|
|
|
817
1709
|
}, column))
|
|
818
1710
|
}) }), /* @__PURE__ */ jsx("tbody", { children: rowKeys.map((row) => /* @__PURE__ */ jsx("tr", {
|
|
819
1711
|
"data-adapttable-part": "loading-row",
|
|
820
|
-
children: columnKeys.map((
|
|
1712
|
+
children: columnKeys.map((column_0) => /* @__PURE__ */ jsx("td", {
|
|
821
1713
|
"data-adapttable-part": "loading-cell",
|
|
822
1714
|
children: /* @__PURE__ */ jsx("span", {
|
|
823
1715
|
"data-adapttable-part": "loading-line",
|
|
824
|
-
style: { width: loadingLineWidth(
|
|
1716
|
+
style: { width: loadingLineWidth(column_0, columnCount) }
|
|
825
1717
|
})
|
|
826
|
-
},
|
|
1718
|
+
}, column_0))
|
|
827
1719
|
}, row)) })]
|
|
828
1720
|
}) : /* @__PURE__ */ jsx("div", {
|
|
829
1721
|
"data-adapttable-part": "loading-cards",
|
|
830
|
-
children: rowKeys.map((
|
|
1722
|
+
children: rowKeys.map((row_0) => /* @__PURE__ */ jsx("div", {
|
|
831
1723
|
"data-adapttable-part": "loading-card",
|
|
832
|
-
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((
|
|
1724
|
+
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((column_1) => /* @__PURE__ */ jsx("span", {
|
|
833
1725
|
"data-adapttable-part": "loading-line",
|
|
834
|
-
style: { width: loadingLineWidth(
|
|
835
|
-
},
|
|
836
|
-
},
|
|
837
|
-
})
|
|
1726
|
+
style: { width: loadingLineWidth(column_1, columnKeys.length) }
|
|
1727
|
+
}, column_1))
|
|
1728
|
+
}, row_0))
|
|
1729
|
+
});
|
|
1730
|
+
$[2] = classNames.loading;
|
|
1731
|
+
$[3] = columnCount;
|
|
1732
|
+
$[4] = rowKeys;
|
|
1733
|
+
$[5] = variant;
|
|
1734
|
+
$[6] = t3;
|
|
1735
|
+
$[7] = t4;
|
|
1736
|
+
$[8] = t5;
|
|
1737
|
+
$[9] = t6;
|
|
1738
|
+
$[10] = t7;
|
|
1739
|
+
$[11] = t8;
|
|
1740
|
+
} else {
|
|
1741
|
+
t3 = $[6];
|
|
1742
|
+
t4 = $[7];
|
|
1743
|
+
t5 = $[8];
|
|
1744
|
+
t6 = $[9];
|
|
1745
|
+
t7 = $[10];
|
|
1746
|
+
t8 = $[11];
|
|
1747
|
+
}
|
|
1748
|
+
let t9;
|
|
1749
|
+
if ($[14] !== labels.loading) {
|
|
1750
|
+
t9 = /* @__PURE__ */ jsx("span", {
|
|
838
1751
|
className: "adapttable-sr-only",
|
|
839
1752
|
children: labels.loading
|
|
840
|
-
})
|
|
841
|
-
|
|
1753
|
+
});
|
|
1754
|
+
$[14] = labels.loading;
|
|
1755
|
+
$[15] = t9;
|
|
1756
|
+
} else t9 = $[15];
|
|
1757
|
+
let t10;
|
|
1758
|
+
if ($[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6 || $[20] !== t7 || $[21] !== t8 || $[22] !== t9) {
|
|
1759
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
1760
|
+
role: t3,
|
|
1761
|
+
"aria-busy": t4,
|
|
1762
|
+
"aria-live": t5,
|
|
1763
|
+
"data-adapttable-part": t6,
|
|
1764
|
+
className: t7,
|
|
1765
|
+
children: [t8, t9]
|
|
1766
|
+
});
|
|
1767
|
+
$[16] = t3;
|
|
1768
|
+
$[17] = t4;
|
|
1769
|
+
$[18] = t5;
|
|
1770
|
+
$[19] = t6;
|
|
1771
|
+
$[20] = t7;
|
|
1772
|
+
$[21] = t8;
|
|
1773
|
+
$[22] = t9;
|
|
1774
|
+
$[23] = t10;
|
|
1775
|
+
} else t10 = $[23];
|
|
1776
|
+
return t10;
|
|
1777
|
+
}
|
|
1778
|
+
function _temp3(__0, i_0) {
|
|
1779
|
+
return i_0;
|
|
1780
|
+
}
|
|
1781
|
+
function _temp2(_, i) {
|
|
1782
|
+
return i;
|
|
842
1783
|
}
|
|
843
1784
|
//#endregion
|
|
844
1785
|
//#region src/components/ColumnMenu.tsx
|
|
1786
|
+
/** Menu labels: the shared chrome contract plus the actions row's name. */
|
|
845
1787
|
/** The eye toggle shared by data-column rows and the actions row. */
|
|
846
|
-
function VisibilityToggle(
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1788
|
+
function VisibilityToggle(t0) {
|
|
1789
|
+
const $ = c(9);
|
|
1790
|
+
const { hidden, name, labels, classNames, onToggle } = t0;
|
|
1791
|
+
const t1 = !hidden || void 0;
|
|
1792
|
+
const t2 = !hidden;
|
|
1793
|
+
const t3 = `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`;
|
|
1794
|
+
let t4;
|
|
1795
|
+
if ($[0] !== hidden) {
|
|
1796
|
+
t4 = /* @__PURE__ */ jsx(EyeIcon, { off: hidden });
|
|
1797
|
+
$[0] = hidden;
|
|
1798
|
+
$[1] = t4;
|
|
1799
|
+
} else t4 = $[1];
|
|
1800
|
+
let t5;
|
|
1801
|
+
if ($[2] !== classNames.columnMenuVisibility || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
1802
|
+
t5 = /* @__PURE__ */ jsx("button", {
|
|
1803
|
+
type: "button",
|
|
1804
|
+
"data-adapttable-part": "column-menu-visibility",
|
|
1805
|
+
"data-active": t1,
|
|
1806
|
+
"aria-pressed": t2,
|
|
1807
|
+
"aria-label": t3,
|
|
1808
|
+
className: classNames.columnMenuVisibility,
|
|
1809
|
+
onClick: onToggle,
|
|
1810
|
+
children: t4
|
|
1811
|
+
});
|
|
1812
|
+
$[2] = classNames.columnMenuVisibility;
|
|
1813
|
+
$[3] = onToggle;
|
|
1814
|
+
$[4] = t1;
|
|
1815
|
+
$[5] = t2;
|
|
1816
|
+
$[6] = t3;
|
|
1817
|
+
$[7] = t4;
|
|
1818
|
+
$[8] = t5;
|
|
1819
|
+
} else t5 = $[8];
|
|
1820
|
+
return t5;
|
|
857
1821
|
}
|
|
858
1822
|
/** The row's name caption, shared by data-column rows and the actions row. */
|
|
859
|
-
function RowName(
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1823
|
+
function RowName(t0) {
|
|
1824
|
+
const $ = c(4);
|
|
1825
|
+
const { hidden, name, classNames } = t0;
|
|
1826
|
+
const t1 = hidden || void 0;
|
|
1827
|
+
let t2;
|
|
1828
|
+
if ($[0] !== classNames.columnMenuLabel || $[1] !== name || $[2] !== t1) {
|
|
1829
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
1830
|
+
"data-adapttable-part": "column-menu-label",
|
|
1831
|
+
"data-hidden": t1,
|
|
1832
|
+
className: classNames.columnMenuLabel,
|
|
1833
|
+
children: name
|
|
1834
|
+
});
|
|
1835
|
+
$[0] = classNames.columnMenuLabel;
|
|
1836
|
+
$[1] = name;
|
|
1837
|
+
$[2] = t1;
|
|
1838
|
+
$[3] = t2;
|
|
1839
|
+
} else t2 = $[3];
|
|
1840
|
+
return t2;
|
|
866
1841
|
}
|
|
867
1842
|
/** The pin toggle shared by data-column rows and the actions row. */
|
|
868
|
-
function PinToggle(
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
1843
|
+
function PinToggle(t0) {
|
|
1844
|
+
const $ = c(7);
|
|
1845
|
+
const { active, actionLabel, classNames, onClick } = t0;
|
|
1846
|
+
const t1 = active || void 0;
|
|
1847
|
+
let t2;
|
|
1848
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1849
|
+
t2 = /* @__PURE__ */ jsx(PinIcon, {});
|
|
1850
|
+
$[0] = t2;
|
|
1851
|
+
} else t2 = $[0];
|
|
1852
|
+
let t3;
|
|
1853
|
+
if ($[1] !== actionLabel || $[2] !== active || $[3] !== classNames.columnMenuPin || $[4] !== onClick || $[5] !== t1) {
|
|
1854
|
+
t3 = /* @__PURE__ */ jsx("button", {
|
|
1855
|
+
type: "button",
|
|
1856
|
+
"data-adapttable-part": "column-menu-pin",
|
|
1857
|
+
"data-active": t1,
|
|
1858
|
+
"aria-pressed": active,
|
|
1859
|
+
"aria-label": actionLabel,
|
|
1860
|
+
className: classNames.columnMenuPin,
|
|
1861
|
+
onClick,
|
|
1862
|
+
children: t2
|
|
1863
|
+
});
|
|
1864
|
+
$[1] = actionLabel;
|
|
1865
|
+
$[2] = active;
|
|
1866
|
+
$[3] = classNames.columnMenuPin;
|
|
1867
|
+
$[4] = onClick;
|
|
1868
|
+
$[5] = t1;
|
|
1869
|
+
$[6] = t3;
|
|
1870
|
+
} else t3 = $[6];
|
|
1871
|
+
return t3;
|
|
879
1872
|
}
|
|
880
|
-
function ColumnMenuRowItem(
|
|
1873
|
+
function ColumnMenuRowItem(t0) {
|
|
1874
|
+
const $ = c(58);
|
|
1875
|
+
const { row, layout, labels, classNames, drag } = t0;
|
|
881
1876
|
const { key, name, hidden, pinned, index } = row;
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
1877
|
+
const t1 = hidden || void 0;
|
|
1878
|
+
const t2 = classNames.columnMenuItem;
|
|
1879
|
+
let t3;
|
|
1880
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1881
|
+
t3 = { cursor: "grab" };
|
|
1882
|
+
$[0] = t3;
|
|
1883
|
+
} else t3 = $[0];
|
|
1884
|
+
let t4;
|
|
1885
|
+
if ($[1] !== drag || $[2] !== index || $[3] !== key) {
|
|
1886
|
+
t4 = drag.rowDragProps(key, index);
|
|
1887
|
+
$[1] = drag;
|
|
1888
|
+
$[2] = index;
|
|
1889
|
+
$[3] = key;
|
|
1890
|
+
$[4] = t4;
|
|
1891
|
+
} else t4 = $[4];
|
|
1892
|
+
let t5;
|
|
1893
|
+
if ($[5] !== drag || $[6] !== index || $[7] !== layout.move) {
|
|
1894
|
+
t5 = drag.dropProps(index, layout.move);
|
|
1895
|
+
$[5] = drag;
|
|
1896
|
+
$[6] = index;
|
|
1897
|
+
$[7] = layout.move;
|
|
1898
|
+
$[8] = t5;
|
|
1899
|
+
} else t5 = $[8];
|
|
1900
|
+
let t6;
|
|
1901
|
+
if ($[9] !== drag || $[10] !== index || $[11] !== key) {
|
|
1902
|
+
t6 = drag.rowAttrs(key, index);
|
|
1903
|
+
$[9] = drag;
|
|
1904
|
+
$[10] = index;
|
|
1905
|
+
$[11] = key;
|
|
1906
|
+
$[12] = t6;
|
|
1907
|
+
} else t6 = $[12];
|
|
1908
|
+
const t7 = classNames.columnMenuGrip;
|
|
1909
|
+
const t8 = `${labels.moveStart} / ${labels.moveEnd}: ${name}`;
|
|
1910
|
+
let t9;
|
|
1911
|
+
if ($[13] !== index || $[14] !== key || $[15] !== layout.move || $[16] !== t8) {
|
|
1912
|
+
t9 = columnReorderKeyProps(key, index, layout.move, t8);
|
|
1913
|
+
$[13] = index;
|
|
1914
|
+
$[14] = key;
|
|
1915
|
+
$[15] = layout.move;
|
|
1916
|
+
$[16] = t8;
|
|
1917
|
+
$[17] = t9;
|
|
1918
|
+
} else t9 = $[17];
|
|
1919
|
+
let t10;
|
|
1920
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1921
|
+
t10 = /* @__PURE__ */ jsx(GripIcon, {});
|
|
1922
|
+
$[18] = t10;
|
|
1923
|
+
} else t10 = $[18];
|
|
1924
|
+
let t11;
|
|
1925
|
+
if ($[19] !== classNames.columnMenuGrip || $[20] !== t9) {
|
|
1926
|
+
t11 = /* @__PURE__ */ jsx("span", {
|
|
1927
|
+
"data-adapttable-part": "column-menu-grip",
|
|
1928
|
+
className: t7,
|
|
1929
|
+
...t9,
|
|
1930
|
+
children: t10
|
|
1931
|
+
});
|
|
1932
|
+
$[19] = classNames.columnMenuGrip;
|
|
1933
|
+
$[20] = t9;
|
|
1934
|
+
$[21] = t11;
|
|
1935
|
+
} else t11 = $[21];
|
|
1936
|
+
let t12;
|
|
1937
|
+
if ($[22] !== key || $[23] !== layout) {
|
|
1938
|
+
t12 = () => layout.toggleVisible(key);
|
|
1939
|
+
$[22] = key;
|
|
1940
|
+
$[23] = layout;
|
|
1941
|
+
$[24] = t12;
|
|
1942
|
+
} else t12 = $[24];
|
|
1943
|
+
let t13;
|
|
1944
|
+
if ($[25] !== classNames || $[26] !== hidden || $[27] !== labels || $[28] !== name || $[29] !== t12) {
|
|
1945
|
+
t13 = /* @__PURE__ */ jsx(VisibilityToggle, {
|
|
1946
|
+
hidden,
|
|
1947
|
+
name,
|
|
1948
|
+
labels,
|
|
1949
|
+
classNames,
|
|
1950
|
+
onToggle: t12
|
|
1951
|
+
});
|
|
1952
|
+
$[25] = classNames;
|
|
1953
|
+
$[26] = hidden;
|
|
1954
|
+
$[27] = labels;
|
|
1955
|
+
$[28] = name;
|
|
1956
|
+
$[29] = t12;
|
|
1957
|
+
$[30] = t13;
|
|
1958
|
+
} else t13 = $[30];
|
|
1959
|
+
let t14;
|
|
1960
|
+
if ($[31] !== classNames || $[32] !== hidden || $[33] !== name) {
|
|
1961
|
+
t14 = /* @__PURE__ */ jsx(RowName, {
|
|
1962
|
+
hidden,
|
|
1963
|
+
name,
|
|
1964
|
+
classNames
|
|
1965
|
+
});
|
|
1966
|
+
$[31] = classNames;
|
|
1967
|
+
$[32] = hidden;
|
|
1968
|
+
$[33] = name;
|
|
1969
|
+
$[34] = t14;
|
|
1970
|
+
} else t14 = $[34];
|
|
1971
|
+
const t15 = pinned !== void 0;
|
|
1972
|
+
let t16;
|
|
1973
|
+
if ($[35] !== labels || $[36] !== pinned) {
|
|
1974
|
+
t16 = pinActionLabel(pinned, labels);
|
|
1975
|
+
$[35] = labels;
|
|
1976
|
+
$[36] = pinned;
|
|
1977
|
+
$[37] = t16;
|
|
1978
|
+
} else t16 = $[37];
|
|
1979
|
+
const t17 = `${t16}: ${name}`;
|
|
1980
|
+
let t18;
|
|
1981
|
+
if ($[38] !== key || $[39] !== layout || $[40] !== pinned) {
|
|
1982
|
+
t18 = () => layout.setPinned(key, nextPinSide(pinned));
|
|
1983
|
+
$[38] = key;
|
|
1984
|
+
$[39] = layout;
|
|
1985
|
+
$[40] = pinned;
|
|
1986
|
+
$[41] = t18;
|
|
1987
|
+
} else t18 = $[41];
|
|
1988
|
+
let t19;
|
|
1989
|
+
if ($[42] !== classNames || $[43] !== t15 || $[44] !== t17 || $[45] !== t18) {
|
|
1990
|
+
t19 = /* @__PURE__ */ jsx(PinToggle, {
|
|
1991
|
+
active: t15,
|
|
1992
|
+
actionLabel: t17,
|
|
1993
|
+
classNames,
|
|
1994
|
+
onClick: t18
|
|
1995
|
+
});
|
|
1996
|
+
$[42] = classNames;
|
|
1997
|
+
$[43] = t15;
|
|
1998
|
+
$[44] = t17;
|
|
1999
|
+
$[45] = t18;
|
|
2000
|
+
$[46] = t19;
|
|
2001
|
+
} else t19 = $[46];
|
|
2002
|
+
let t20;
|
|
2003
|
+
if ($[47] !== classNames.columnMenuItem || $[48] !== pinned || $[49] !== t1 || $[50] !== t11 || $[51] !== t13 || $[52] !== t14 || $[53] !== t19 || $[54] !== t4 || $[55] !== t5 || $[56] !== t6) {
|
|
2004
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
2005
|
+
"data-adapttable-part": "column-menu-item",
|
|
2006
|
+
"data-hidden": t1,
|
|
2007
|
+
"data-pinned": pinned,
|
|
2008
|
+
className: t2,
|
|
2009
|
+
style: t3,
|
|
2010
|
+
...t4,
|
|
2011
|
+
...t5,
|
|
2012
|
+
...t6,
|
|
2013
|
+
children: [
|
|
2014
|
+
t11,
|
|
2015
|
+
t13,
|
|
2016
|
+
t14,
|
|
2017
|
+
t19
|
|
2018
|
+
]
|
|
2019
|
+
});
|
|
2020
|
+
$[47] = classNames.columnMenuItem;
|
|
2021
|
+
$[48] = pinned;
|
|
2022
|
+
$[49] = t1;
|
|
2023
|
+
$[50] = t11;
|
|
2024
|
+
$[51] = t13;
|
|
2025
|
+
$[52] = t14;
|
|
2026
|
+
$[53] = t19;
|
|
2027
|
+
$[54] = t4;
|
|
2028
|
+
$[55] = t5;
|
|
2029
|
+
$[56] = t6;
|
|
2030
|
+
$[57] = t20;
|
|
2031
|
+
} else t20 = $[57];
|
|
2032
|
+
return t20;
|
|
918
2033
|
}
|
|
919
2034
|
/**
|
|
920
2035
|
* The injected row-actions column as a first-class menu row: the same eye
|
|
921
2036
|
* toggle as a data column plus a ONE-CLICK end-pin toggle (right ↔ unpinned).
|
|
922
2037
|
* The column always trails, so there is no left pin and no reorder grip.
|
|
923
2038
|
*/
|
|
924
|
-
function ActionsMenuRowItem(
|
|
925
|
-
const
|
|
2039
|
+
function ActionsMenuRowItem(t0) {
|
|
2040
|
+
const $ = c(29);
|
|
2041
|
+
const { layout, labels, classNames } = t0;
|
|
2042
|
+
let t1;
|
|
2043
|
+
if ($[0] !== layout) {
|
|
2044
|
+
t1 = layout.isHidden(ACTIONS_COLUMN_KEY);
|
|
2045
|
+
$[0] = layout;
|
|
2046
|
+
$[1] = t1;
|
|
2047
|
+
} else t1 = $[1];
|
|
2048
|
+
const hidden = t1;
|
|
926
2049
|
const pinned = layout.state.pinned[ACTIONS_COLUMN_KEY] !== void 0;
|
|
927
2050
|
const name = labels.actions;
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
2051
|
+
const t2 = hidden || void 0;
|
|
2052
|
+
const t3 = pinned ? "end" : void 0;
|
|
2053
|
+
let t4;
|
|
2054
|
+
if ($[2] !== layout) {
|
|
2055
|
+
t4 = () => layout.toggleVisible(ACTIONS_COLUMN_KEY);
|
|
2056
|
+
$[2] = layout;
|
|
2057
|
+
$[3] = t4;
|
|
2058
|
+
} else t4 = $[3];
|
|
2059
|
+
let t5;
|
|
2060
|
+
if ($[4] !== classNames || $[5] !== hidden || $[6] !== labels || $[7] !== name || $[8] !== t4) {
|
|
2061
|
+
t5 = /* @__PURE__ */ jsx(VisibilityToggle, {
|
|
2062
|
+
hidden,
|
|
2063
|
+
name,
|
|
2064
|
+
labels,
|
|
2065
|
+
classNames,
|
|
2066
|
+
onToggle: t4
|
|
2067
|
+
});
|
|
2068
|
+
$[4] = classNames;
|
|
2069
|
+
$[5] = hidden;
|
|
2070
|
+
$[6] = labels;
|
|
2071
|
+
$[7] = name;
|
|
2072
|
+
$[8] = t4;
|
|
2073
|
+
$[9] = t5;
|
|
2074
|
+
} else t5 = $[9];
|
|
2075
|
+
let t6;
|
|
2076
|
+
if ($[10] !== classNames || $[11] !== hidden || $[12] !== name) {
|
|
2077
|
+
t6 = /* @__PURE__ */ jsx(RowName, {
|
|
2078
|
+
hidden,
|
|
2079
|
+
name,
|
|
2080
|
+
classNames
|
|
2081
|
+
});
|
|
2082
|
+
$[10] = classNames;
|
|
2083
|
+
$[11] = hidden;
|
|
2084
|
+
$[12] = name;
|
|
2085
|
+
$[13] = t6;
|
|
2086
|
+
} else t6 = $[13];
|
|
2087
|
+
const t7 = `${pinned ? labels.unpin : labels.pinEnd}: ${name}`;
|
|
2088
|
+
let t8;
|
|
2089
|
+
if ($[14] !== layout || $[15] !== pinned) {
|
|
2090
|
+
t8 = () => layout.setPinned(ACTIONS_COLUMN_KEY, pinned ? void 0 : "end");
|
|
2091
|
+
$[14] = layout;
|
|
2092
|
+
$[15] = pinned;
|
|
2093
|
+
$[16] = t8;
|
|
2094
|
+
} else t8 = $[16];
|
|
2095
|
+
let t9;
|
|
2096
|
+
if ($[17] !== classNames || $[18] !== pinned || $[19] !== t7 || $[20] !== t8) {
|
|
2097
|
+
t9 = /* @__PURE__ */ jsx(PinToggle, {
|
|
2098
|
+
active: pinned,
|
|
2099
|
+
actionLabel: t7,
|
|
2100
|
+
classNames,
|
|
2101
|
+
onClick: t8
|
|
2102
|
+
});
|
|
2103
|
+
$[17] = classNames;
|
|
2104
|
+
$[18] = pinned;
|
|
2105
|
+
$[19] = t7;
|
|
2106
|
+
$[20] = t8;
|
|
2107
|
+
$[21] = t9;
|
|
2108
|
+
} else t9 = $[21];
|
|
2109
|
+
let t10;
|
|
2110
|
+
if ($[22] !== classNames.columnMenuItem || $[23] !== t2 || $[24] !== t3 || $[25] !== t5 || $[26] !== t6 || $[27] !== t9) {
|
|
2111
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
2112
|
+
"data-adapttable-part": "column-menu-item",
|
|
2113
|
+
"data-actions": "",
|
|
2114
|
+
"data-hidden": t2,
|
|
2115
|
+
"data-pinned": t3,
|
|
2116
|
+
className: classNames.columnMenuItem,
|
|
2117
|
+
children: [
|
|
2118
|
+
t5,
|
|
2119
|
+
t6,
|
|
2120
|
+
t9
|
|
2121
|
+
]
|
|
2122
|
+
});
|
|
2123
|
+
$[22] = classNames.columnMenuItem;
|
|
2124
|
+
$[23] = t2;
|
|
2125
|
+
$[24] = t3;
|
|
2126
|
+
$[25] = t5;
|
|
2127
|
+
$[26] = t6;
|
|
2128
|
+
$[27] = t9;
|
|
2129
|
+
$[28] = t10;
|
|
2130
|
+
} else t10 = $[28];
|
|
2131
|
+
return t10;
|
|
955
2132
|
}
|
|
956
2133
|
/**
|
|
957
2134
|
* Column-management popover: a disclosure button + a panel where each column
|
|
@@ -959,29 +2136,56 @@ function ActionsMenuRowItem({ layout, labels, classNames }) {
|
|
|
959
2136
|
* Closes on outside-click or Escape. Ships no styles — target the
|
|
960
2137
|
* `data-adapttable-part` hooks or the `columnMenu*` className slots.
|
|
961
2138
|
*/
|
|
962
|
-
function ColumnMenu(
|
|
2139
|
+
function ColumnMenu(t0) {
|
|
2140
|
+
const $ = c(24);
|
|
2141
|
+
const { allColumns, layout, labels, classNames, hasRowActions } = t0;
|
|
963
2142
|
const drag = useColumnDragState();
|
|
964
2143
|
const { open, setOpen, rootRef, triggerRef } = useMenuPopover();
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
2144
|
+
let t1;
|
|
2145
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2146
|
+
t1 = { position: "relative" };
|
|
2147
|
+
$[0] = t1;
|
|
2148
|
+
} else t1 = $[0];
|
|
2149
|
+
const t2 = open || void 0;
|
|
2150
|
+
let t3;
|
|
2151
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2152
|
+
t3 = {
|
|
2153
|
+
flexShrink: 0,
|
|
2154
|
+
whiteSpace: "nowrap"
|
|
2155
|
+
};
|
|
2156
|
+
$[1] = t3;
|
|
2157
|
+
} else t3 = $[1];
|
|
2158
|
+
let t4;
|
|
2159
|
+
if ($[2] !== setOpen) {
|
|
2160
|
+
t4 = () => setOpen(_temp);
|
|
2161
|
+
$[2] = setOpen;
|
|
2162
|
+
$[3] = t4;
|
|
2163
|
+
} else t4 = $[3];
|
|
2164
|
+
let t5;
|
|
2165
|
+
if ($[4] !== classNames.columnMenuButton || $[5] !== labels.columns || $[6] !== open || $[7] !== t2 || $[8] !== t4 || $[9] !== triggerRef) {
|
|
2166
|
+
t5 = /* @__PURE__ */ jsx("button", {
|
|
971
2167
|
ref: triggerRef,
|
|
972
2168
|
type: "button",
|
|
973
2169
|
"aria-expanded": open,
|
|
974
2170
|
"aria-haspopup": "true",
|
|
975
2171
|
"data-adapttable-part": "column-menu-button",
|
|
976
|
-
"data-active":
|
|
2172
|
+
"data-active": t2,
|
|
977
2173
|
className: classNames.columnMenuButton,
|
|
978
|
-
style:
|
|
979
|
-
|
|
980
|
-
whiteSpace: "nowrap"
|
|
981
|
-
},
|
|
982
|
-
onClick: () => setOpen((v) => !v),
|
|
2174
|
+
style: t3,
|
|
2175
|
+
onClick: t4,
|
|
983
2176
|
children: labels.columns
|
|
984
|
-
})
|
|
2177
|
+
});
|
|
2178
|
+
$[4] = classNames.columnMenuButton;
|
|
2179
|
+
$[5] = labels.columns;
|
|
2180
|
+
$[6] = open;
|
|
2181
|
+
$[7] = t2;
|
|
2182
|
+
$[8] = t4;
|
|
2183
|
+
$[9] = triggerRef;
|
|
2184
|
+
$[10] = t5;
|
|
2185
|
+
} else t5 = $[10];
|
|
2186
|
+
let t6;
|
|
2187
|
+
if ($[11] !== allColumns || $[12] !== classNames || $[13] !== drag || $[14] !== hasRowActions || $[15] !== labels || $[16] !== layout || $[17] !== open) {
|
|
2188
|
+
t6 = open && /* @__PURE__ */ jsxs("fieldset", {
|
|
985
2189
|
"aria-label": labels.columns,
|
|
986
2190
|
"data-adapttable-part": "column-menu-panel",
|
|
987
2191
|
className: classNames.columnMenuPanel,
|
|
@@ -1019,8 +2223,35 @@ function ColumnMenu({ allColumns, layout, labels, classNames, hasRowActions }) {
|
|
|
1019
2223
|
children: labels.resetColumns
|
|
1020
2224
|
})
|
|
1021
2225
|
]
|
|
1022
|
-
})
|
|
1023
|
-
|
|
2226
|
+
});
|
|
2227
|
+
$[11] = allColumns;
|
|
2228
|
+
$[12] = classNames;
|
|
2229
|
+
$[13] = drag;
|
|
2230
|
+
$[14] = hasRowActions;
|
|
2231
|
+
$[15] = labels;
|
|
2232
|
+
$[16] = layout;
|
|
2233
|
+
$[17] = open;
|
|
2234
|
+
$[18] = t6;
|
|
2235
|
+
} else t6 = $[18];
|
|
2236
|
+
let t7;
|
|
2237
|
+
if ($[19] !== classNames.columnMenu || $[20] !== rootRef || $[21] !== t5 || $[22] !== t6) {
|
|
2238
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
2239
|
+
ref: rootRef,
|
|
2240
|
+
"data-adapttable-part": "column-menu",
|
|
2241
|
+
className: classNames.columnMenu,
|
|
2242
|
+
style: t1,
|
|
2243
|
+
children: [t5, t6]
|
|
2244
|
+
});
|
|
2245
|
+
$[19] = classNames.columnMenu;
|
|
2246
|
+
$[20] = rootRef;
|
|
2247
|
+
$[21] = t5;
|
|
2248
|
+
$[22] = t6;
|
|
2249
|
+
$[23] = t7;
|
|
2250
|
+
} else t7 = $[23];
|
|
2251
|
+
return t7;
|
|
2252
|
+
}
|
|
2253
|
+
function _temp(v) {
|
|
2254
|
+
return !v;
|
|
1024
2255
|
}
|
|
1025
2256
|
//#endregion
|
|
1026
2257
|
//#region src/components/tables.tsx
|
|
@@ -1052,75 +2283,173 @@ function scrollBoxStyle(maxHeight, scrollX) {
|
|
|
1052
2283
|
};
|
|
1053
2284
|
return scrollX ? { overflowX: "auto" } : void 0;
|
|
1054
2285
|
}
|
|
1055
|
-
function RowActionButtons(
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
2286
|
+
function RowActionButtons(t0) {
|
|
2287
|
+
const $ = c(13);
|
|
2288
|
+
const { row, actions, confirm, cancelLabel, classNames } = t0;
|
|
2289
|
+
let t1;
|
|
2290
|
+
if ($[0] !== actions || $[1] !== cancelLabel || $[2] !== classNames || $[3] !== confirm || $[4] !== row) {
|
|
2291
|
+
let t2;
|
|
2292
|
+
if ($[6] !== cancelLabel || $[7] !== classNames || $[8] !== confirm || $[9] !== row) {
|
|
2293
|
+
t2 = (action) => {
|
|
2294
|
+
if (action.isHidden?.(row)) return null;
|
|
2295
|
+
const reason = resolveDisabledReason(action.disabledReason?.(row));
|
|
2296
|
+
const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
|
|
2297
|
+
const handleClick = disabled ? void 0 : (e) => {
|
|
2298
|
+
e.stopPropagation();
|
|
2299
|
+
runRowAction(action, row, confirm, cancelLabel);
|
|
2300
|
+
};
|
|
2301
|
+
return /* @__PURE__ */ jsx("button", {
|
|
2302
|
+
type: "button",
|
|
2303
|
+
disabled,
|
|
2304
|
+
title: reason,
|
|
2305
|
+
"aria-label": action.label,
|
|
2306
|
+
"data-adapttable-part": "action-button",
|
|
2307
|
+
"data-color": action.color,
|
|
2308
|
+
className: classNames.actionButton,
|
|
2309
|
+
onClick: handleClick,
|
|
2310
|
+
children: action.icon ?? action.label
|
|
2311
|
+
}, action.key);
|
|
2312
|
+
};
|
|
2313
|
+
$[6] = cancelLabel;
|
|
2314
|
+
$[7] = classNames;
|
|
2315
|
+
$[8] = confirm;
|
|
2316
|
+
$[9] = row;
|
|
2317
|
+
$[10] = t2;
|
|
2318
|
+
} else t2 = $[10];
|
|
2319
|
+
t1 = actions.map(t2);
|
|
2320
|
+
$[0] = actions;
|
|
2321
|
+
$[1] = cancelLabel;
|
|
2322
|
+
$[2] = classNames;
|
|
2323
|
+
$[3] = confirm;
|
|
2324
|
+
$[4] = row;
|
|
2325
|
+
$[5] = t1;
|
|
2326
|
+
} else t1 = $[5];
|
|
2327
|
+
let t2;
|
|
2328
|
+
if ($[11] !== t1) {
|
|
2329
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
2330
|
+
$[11] = t1;
|
|
2331
|
+
$[12] = t2;
|
|
2332
|
+
} else t2 = $[12];
|
|
2333
|
+
return t2;
|
|
1076
2334
|
}
|
|
1077
2335
|
/**
|
|
1078
2336
|
* The expand/collapse chevron, shared by desktop rows and mobile cards. The
|
|
1079
2337
|
* `data-expanded` attribute is the styling hook for rotating the glyph
|
|
1080
2338
|
* (`rowClickProps`' interactive-child guard keeps the click off the row).
|
|
1081
2339
|
*/
|
|
1082
|
-
function ExpandButton(
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
2340
|
+
function ExpandButton(t0) {
|
|
2341
|
+
const $ = c(7);
|
|
2342
|
+
const { expanded, labels, classNames, onToggle } = t0;
|
|
2343
|
+
const t1 = expanded ? "" : void 0;
|
|
2344
|
+
const t2 = expanded ? labels.collapseRow : labels.expandRow;
|
|
2345
|
+
let t3;
|
|
2346
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2347
|
+
t3 = /* @__PURE__ */ jsx(ChevronIcon, { size: 14 });
|
|
2348
|
+
$[0] = t3;
|
|
2349
|
+
} else t3 = $[0];
|
|
2350
|
+
let t4;
|
|
2351
|
+
if ($[1] !== classNames.expandButton || $[2] !== expanded || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2) {
|
|
2352
|
+
t4 = /* @__PURE__ */ jsx("button", {
|
|
2353
|
+
type: "button",
|
|
2354
|
+
"data-adapttable-part": "expand-button",
|
|
2355
|
+
"data-expanded": t1,
|
|
2356
|
+
className: classNames.expandButton,
|
|
2357
|
+
"aria-expanded": expanded,
|
|
2358
|
+
"aria-label": t2,
|
|
2359
|
+
onClick: onToggle,
|
|
2360
|
+
children: t3
|
|
2361
|
+
});
|
|
2362
|
+
$[1] = classNames.expandButton;
|
|
2363
|
+
$[2] = expanded;
|
|
2364
|
+
$[3] = onToggle;
|
|
2365
|
+
$[4] = t1;
|
|
2366
|
+
$[5] = t2;
|
|
2367
|
+
$[6] = t4;
|
|
2368
|
+
} else t4 = $[6];
|
|
2369
|
+
return t4;
|
|
1093
2370
|
}
|
|
1094
2371
|
/**
|
|
2372
|
+
* Props for the memoized desktop row. The comparator below checks ONLY the
|
|
2373
|
+
* visual inputs (row data, selected/expanded state, column + width + class
|
|
2374
|
+
* identities, the pin signature); everything else — `table`, the latest-ref
|
|
2375
|
+
* callback wrappers, `confirm`, `pinOffset`, `measureElement` — is either
|
|
2376
|
+
* stable or only consulted when one of the compared inputs re-renders the
|
|
2377
|
+
* row, so a fresh identity there must not (and does not) defeat the memo.
|
|
2378
|
+
*/
|
|
2379
|
+
/**
|
|
1095
2380
|
* `React.memo` comparator: re-render a row only when one of its VISUAL
|
|
1096
2381
|
* inputs changes. A search keystroke or another row's checkbox re-renders
|
|
1097
2382
|
* the table shell, but every unchanged row bails out here (accessors and
|
|
1098
2383
|
* Cell render-props are not re-invoked).
|
|
1099
2384
|
*/
|
|
1100
2385
|
function desktopRowPropsEqual(prev, next) {
|
|
1101
|
-
return prev.row === next.row && prev.index === next.index && prev.id === next.id && prev.selected === next.selected && prev.expanded === next.expanded && prev.columns === next.columns && prev.labels === next.labels && prev.classNames === next.classNames && prev.showActions === next.showActions && prev.rowActions === next.rowActions && prev.columnSpan === next.columnSpan && prev.columnWidths === next.columnWidths && prev.pinSignature === next.pinSignature && prev.
|
|
2386
|
+
return prev.row === next.row && prev.index === next.index && prev.id === next.id && prev.selected === next.selected && prev.expanded === next.expanded && prev.columns === next.columns && prev.labels === next.labels && prev.classNames === next.classNames && prev.showActions === next.showActions && prev.rowActions === next.rowActions && prev.columnSpan === next.columnSpan && prev.columnWidths === next.columnWidths && prev.pinSignature === next.pinSignature && prev.hasStartPin === next.hasStartPin && prev.hasEndPin === next.hasEndPin && prev.actionsPinned === next.actionsPinned && prev.rowClass === next.rowClass && prev.clickable === next.clickable && prev.hasPrefetch === next.hasPrefetch;
|
|
1102
2387
|
}
|
|
1103
2388
|
function DesktopRowBase(props) {
|
|
1104
|
-
const
|
|
2389
|
+
const $ = c(98);
|
|
2390
|
+
const { row, index, id, table, columns, labels, classNames, selected, expanded, showActions, rowActions, confirm, columnSpan, pinOffset, hasStartPin, hasEndPin, actionsPinned, rowClass, clickable, hasPrefetch, onRowClick, onPrefetch, onToggleSelect, onToggleExpand, renderDetail, measureElement } = props;
|
|
1105
2391
|
const expandable = expanded !== void 0;
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
2392
|
+
const t0 = selected === void 0 ? 0 : SELECTION_WIDTH;
|
|
2393
|
+
const t1 = showActions ? ACTIONS_WIDTH : 0;
|
|
2394
|
+
let t10;
|
|
2395
|
+
let t11;
|
|
2396
|
+
let t12;
|
|
2397
|
+
let t2;
|
|
2398
|
+
let t3;
|
|
2399
|
+
let t4;
|
|
2400
|
+
let t5;
|
|
2401
|
+
let t6;
|
|
2402
|
+
let t7;
|
|
2403
|
+
let t8;
|
|
2404
|
+
let t9;
|
|
2405
|
+
if ($[0] !== classNames || $[1] !== clickable || $[2] !== columns || $[3] !== expandable || $[4] !== expanded || $[5] !== hasPrefetch || $[6] !== hasStartPin || $[7] !== id || $[8] !== index || $[9] !== labels || $[10] !== measureElement || $[11] !== onPrefetch || $[12] !== onRowClick || $[13] !== onToggleExpand || $[14] !== onToggleSelect || $[15] !== pinOffset || $[16] !== row || $[17] !== rowClass || $[18] !== selected || $[19] !== t0 || $[20] !== t1 || $[21] !== table) {
|
|
2406
|
+
const leads = {
|
|
2407
|
+
start: t0,
|
|
2408
|
+
end: t1
|
|
2409
|
+
};
|
|
2410
|
+
const bodyPinStyle = (key) => pinnedCellStyle(pinOffset?.(key), PIN_Z.body, leads);
|
|
2411
|
+
let t13;
|
|
2412
|
+
if ($[33] !== index || $[34] !== row || $[35] !== table) {
|
|
2413
|
+
t13 = table.getRowProps(row, index);
|
|
2414
|
+
$[33] = index;
|
|
2415
|
+
$[34] = row;
|
|
2416
|
+
$[35] = table;
|
|
2417
|
+
$[36] = t13;
|
|
2418
|
+
} else t13 = $[36];
|
|
2419
|
+
let rowProps;
|
|
2420
|
+
if ($[37] !== t13) {
|
|
2421
|
+
rowProps = { ...t13 };
|
|
2422
|
+
delete rowProps.key;
|
|
2423
|
+
$[37] = t13;
|
|
2424
|
+
$[38] = rowProps;
|
|
2425
|
+
} else rowProps = $[38];
|
|
2426
|
+
t2 = rowProps;
|
|
2427
|
+
const t14 = clickable ? onRowClick : void 0;
|
|
2428
|
+
if ($[39] !== row || $[40] !== t14) {
|
|
2429
|
+
t3 = rowClickProps(row, t14);
|
|
2430
|
+
$[39] = row;
|
|
2431
|
+
$[40] = t14;
|
|
2432
|
+
$[41] = t3;
|
|
2433
|
+
} else t3 = $[41];
|
|
2434
|
+
t4 = measureElement;
|
|
2435
|
+
t5 = "row";
|
|
2436
|
+
t6 = selected ? "" : void 0;
|
|
2437
|
+
t7 = clickable ? "" : void 0;
|
|
2438
|
+
if ($[42] !== classNames.row || $[43] !== rowClass) {
|
|
2439
|
+
t8 = cx(classNames.row, rowClass);
|
|
2440
|
+
$[42] = classNames.row;
|
|
2441
|
+
$[43] = rowClass;
|
|
2442
|
+
$[44] = t8;
|
|
2443
|
+
} else t8 = $[44];
|
|
2444
|
+
if ($[45] !== hasPrefetch || $[46] !== onPrefetch || $[47] !== row) {
|
|
2445
|
+
t9 = hasPrefetch ? () => onPrefetch(row) : void 0;
|
|
2446
|
+
$[45] = hasPrefetch;
|
|
2447
|
+
$[46] = onPrefetch;
|
|
2448
|
+
$[47] = row;
|
|
2449
|
+
$[48] = t9;
|
|
2450
|
+
} else t9 = $[48];
|
|
2451
|
+
if ($[49] !== classNames || $[50] !== expandable || $[51] !== expanded || $[52] !== id || $[53] !== labels || $[54] !== onToggleExpand) {
|
|
2452
|
+
t10 = expandable && /* @__PURE__ */ jsx("td", {
|
|
1124
2453
|
"data-adapttable-part": "expand-cell",
|
|
1125
2454
|
className: classNames.expandCell,
|
|
1126
2455
|
children: /* @__PURE__ */ jsx(ExpandButton, {
|
|
@@ -1129,11 +2458,20 @@ function DesktopRowBase(props) {
|
|
|
1129
2458
|
classNames,
|
|
1130
2459
|
onToggle: () => onToggleExpand(id)
|
|
1131
2460
|
})
|
|
1132
|
-
})
|
|
1133
|
-
|
|
2461
|
+
});
|
|
2462
|
+
$[49] = classNames;
|
|
2463
|
+
$[50] = expandable;
|
|
2464
|
+
$[51] = expanded;
|
|
2465
|
+
$[52] = id;
|
|
2466
|
+
$[53] = labels;
|
|
2467
|
+
$[54] = onToggleExpand;
|
|
2468
|
+
$[55] = t10;
|
|
2469
|
+
} else t10 = $[55];
|
|
2470
|
+
if ($[56] !== classNames.cell || $[57] !== classNames.checkbox || $[58] !== classNames.selectionCell || $[59] !== hasStartPin || $[60] !== id || $[61] !== labels || $[62] !== onToggleSelect || $[63] !== selected) {
|
|
2471
|
+
t11 = selected !== void 0 && /* @__PURE__ */ jsx("td", {
|
|
1134
2472
|
"data-adapttable-part": "selection-cell",
|
|
1135
|
-
"data-pinned":
|
|
1136
|
-
style: edgePinStyle("
|
|
2473
|
+
"data-pinned": hasStartPin ? "start" : void 0,
|
|
2474
|
+
style: edgePinStyle("start", hasStartPin, PIN_Z.body),
|
|
1137
2475
|
className: cx(classNames.cell, classNames.selectionCell),
|
|
1138
2476
|
children: /* @__PURE__ */ jsx("input", {
|
|
1139
2477
|
type: "checkbox",
|
|
@@ -1142,44 +2480,162 @@ function DesktopRowBase(props) {
|
|
|
1142
2480
|
onChange: () => onToggleSelect(id),
|
|
1143
2481
|
className: classNames.checkbox
|
|
1144
2482
|
})
|
|
1145
|
-
})
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
"data-adapttable-part": "
|
|
1161
|
-
"data-pinned":
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
children: /* @__PURE__ */ jsx(RowActionButtons, {
|
|
2483
|
+
});
|
|
2484
|
+
$[56] = classNames.cell;
|
|
2485
|
+
$[57] = classNames.checkbox;
|
|
2486
|
+
$[58] = classNames.selectionCell;
|
|
2487
|
+
$[59] = hasStartPin;
|
|
2488
|
+
$[60] = id;
|
|
2489
|
+
$[61] = labels;
|
|
2490
|
+
$[62] = onToggleSelect;
|
|
2491
|
+
$[63] = selected;
|
|
2492
|
+
$[64] = t11;
|
|
2493
|
+
} else t11 = $[64];
|
|
2494
|
+
t12 = columns.map((column) => {
|
|
2495
|
+
const pinStyle = bodyPinStyle(column.key);
|
|
2496
|
+
return /* @__PURE__ */ jsx("td", {
|
|
2497
|
+
...table.getCellProps(column, pinStyle && { style: pinStyle }),
|
|
2498
|
+
"data-adapttable-part": "cell",
|
|
2499
|
+
"data-pinned": pinOffset?.(column.key)?.side,
|
|
2500
|
+
className: classNames.cell,
|
|
2501
|
+
children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
|
|
1165
2502
|
row,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
2503
|
+
rowIndex: index
|
|
2504
|
+
}) : column.accessor?.(row)
|
|
2505
|
+
}, column.key);
|
|
2506
|
+
});
|
|
2507
|
+
$[0] = classNames;
|
|
2508
|
+
$[1] = clickable;
|
|
2509
|
+
$[2] = columns;
|
|
2510
|
+
$[3] = expandable;
|
|
2511
|
+
$[4] = expanded;
|
|
2512
|
+
$[5] = hasPrefetch;
|
|
2513
|
+
$[6] = hasStartPin;
|
|
2514
|
+
$[7] = id;
|
|
2515
|
+
$[8] = index;
|
|
2516
|
+
$[9] = labels;
|
|
2517
|
+
$[10] = measureElement;
|
|
2518
|
+
$[11] = onPrefetch;
|
|
2519
|
+
$[12] = onRowClick;
|
|
2520
|
+
$[13] = onToggleExpand;
|
|
2521
|
+
$[14] = onToggleSelect;
|
|
2522
|
+
$[15] = pinOffset;
|
|
2523
|
+
$[16] = row;
|
|
2524
|
+
$[17] = rowClass;
|
|
2525
|
+
$[18] = selected;
|
|
2526
|
+
$[19] = t0;
|
|
2527
|
+
$[20] = t1;
|
|
2528
|
+
$[21] = table;
|
|
2529
|
+
$[22] = t10;
|
|
2530
|
+
$[23] = t11;
|
|
2531
|
+
$[24] = t12;
|
|
2532
|
+
$[25] = t2;
|
|
2533
|
+
$[26] = t3;
|
|
2534
|
+
$[27] = t4;
|
|
2535
|
+
$[28] = t5;
|
|
2536
|
+
$[29] = t6;
|
|
2537
|
+
$[30] = t7;
|
|
2538
|
+
$[31] = t8;
|
|
2539
|
+
$[32] = t9;
|
|
2540
|
+
} else {
|
|
2541
|
+
t10 = $[22];
|
|
2542
|
+
t11 = $[23];
|
|
2543
|
+
t12 = $[24];
|
|
2544
|
+
t2 = $[25];
|
|
2545
|
+
t3 = $[26];
|
|
2546
|
+
t4 = $[27];
|
|
2547
|
+
t5 = $[28];
|
|
2548
|
+
t6 = $[29];
|
|
2549
|
+
t7 = $[30];
|
|
2550
|
+
t8 = $[31];
|
|
2551
|
+
t9 = $[32];
|
|
2552
|
+
}
|
|
2553
|
+
let t13;
|
|
2554
|
+
if ($[65] !== actionsPinned || $[66] !== classNames || $[67] !== confirm || $[68] !== hasEndPin || $[69] !== labels || $[70] !== row || $[71] !== rowActions || $[72] !== showActions) {
|
|
2555
|
+
t13 = showActions && /* @__PURE__ */ jsx("td", {
|
|
2556
|
+
"data-adapttable-part": "actions-cell",
|
|
2557
|
+
"data-pinned": hasEndPin || actionsPinned ? "end" : void 0,
|
|
2558
|
+
style: edgePinStyle("end", hasEndPin || actionsPinned, PIN_Z.body),
|
|
2559
|
+
className: cx(classNames.cell, classNames.actionsCell),
|
|
2560
|
+
children: /* @__PURE__ */ jsx(RowActionButtons, {
|
|
2561
|
+
row,
|
|
2562
|
+
actions: rowActions,
|
|
2563
|
+
confirm,
|
|
2564
|
+
cancelLabel: labels.cancel,
|
|
2565
|
+
classNames
|
|
1171
2566
|
})
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
}
|
|
2567
|
+
});
|
|
2568
|
+
$[65] = actionsPinned;
|
|
2569
|
+
$[66] = classNames;
|
|
2570
|
+
$[67] = confirm;
|
|
2571
|
+
$[68] = hasEndPin;
|
|
2572
|
+
$[69] = labels;
|
|
2573
|
+
$[70] = row;
|
|
2574
|
+
$[71] = rowActions;
|
|
2575
|
+
$[72] = showActions;
|
|
2576
|
+
$[73] = t13;
|
|
2577
|
+
} else t13 = $[73];
|
|
2578
|
+
let t14;
|
|
2579
|
+
if ($[74] !== t10 || $[75] !== t11 || $[76] !== t12 || $[77] !== t13 || $[78] !== t2 || $[79] !== t3 || $[80] !== t4 || $[81] !== t5 || $[82] !== t6 || $[83] !== t7 || $[84] !== t8 || $[85] !== t9) {
|
|
2580
|
+
t14 = /* @__PURE__ */ jsxs("tr", {
|
|
2581
|
+
...t2,
|
|
2582
|
+
...t3,
|
|
2583
|
+
ref: t4,
|
|
2584
|
+
"data-adapttable-part": t5,
|
|
2585
|
+
"data-selected": t6,
|
|
2586
|
+
"data-clickable": t7,
|
|
2587
|
+
className: t8,
|
|
2588
|
+
onMouseEnter: t9,
|
|
2589
|
+
children: [
|
|
2590
|
+
t10,
|
|
2591
|
+
t11,
|
|
2592
|
+
t12,
|
|
2593
|
+
t13
|
|
2594
|
+
]
|
|
2595
|
+
});
|
|
2596
|
+
$[74] = t10;
|
|
2597
|
+
$[75] = t11;
|
|
2598
|
+
$[76] = t12;
|
|
2599
|
+
$[77] = t13;
|
|
2600
|
+
$[78] = t2;
|
|
2601
|
+
$[79] = t3;
|
|
2602
|
+
$[80] = t4;
|
|
2603
|
+
$[81] = t5;
|
|
2604
|
+
$[82] = t6;
|
|
2605
|
+
$[83] = t7;
|
|
2606
|
+
$[84] = t8;
|
|
2607
|
+
$[85] = t9;
|
|
2608
|
+
$[86] = t14;
|
|
2609
|
+
} else t14 = $[86];
|
|
2610
|
+
let t15;
|
|
2611
|
+
if ($[87] !== classNames.detailCell || $[88] !== classNames.detailRow || $[89] !== columnSpan || $[90] !== expandable || $[91] !== expanded || $[92] !== renderDetail || $[93] !== row) {
|
|
2612
|
+
t15 = expandable && expanded && /* @__PURE__ */ jsx("tr", {
|
|
2613
|
+
"data-adapttable-part": "detail-row",
|
|
2614
|
+
className: classNames.detailRow,
|
|
2615
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
2616
|
+
colSpan: columnSpan,
|
|
2617
|
+
"data-adapttable-part": "detail-cell",
|
|
2618
|
+
className: classNames.detailCell,
|
|
2619
|
+
children: renderDetail(row)
|
|
2620
|
+
})
|
|
2621
|
+
});
|
|
2622
|
+
$[87] = classNames.detailCell;
|
|
2623
|
+
$[88] = classNames.detailRow;
|
|
2624
|
+
$[89] = columnSpan;
|
|
2625
|
+
$[90] = expandable;
|
|
2626
|
+
$[91] = expanded;
|
|
2627
|
+
$[92] = renderDetail;
|
|
2628
|
+
$[93] = row;
|
|
2629
|
+
$[94] = t15;
|
|
2630
|
+
} else t15 = $[94];
|
|
2631
|
+
let t16;
|
|
2632
|
+
if ($[95] !== t14 || $[96] !== t15) {
|
|
2633
|
+
t16 = /* @__PURE__ */ jsxs(Fragment, { children: [t14, t15] });
|
|
2634
|
+
$[95] = t14;
|
|
2635
|
+
$[96] = t15;
|
|
2636
|
+
$[97] = t16;
|
|
2637
|
+
} else t16 = $[97];
|
|
2638
|
+
return t16;
|
|
1183
2639
|
}
|
|
1184
2640
|
/**
|
|
1185
2641
|
* One memoized row component per `DesktopTable` instantiation. A factory
|
|
@@ -1219,10 +2675,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1219
2675
|
renderRowDetail
|
|
1220
2676
|
};
|
|
1221
2677
|
const onToggleSelect = useCallback((id) => live.current.selection?.toggle(id), []);
|
|
1222
|
-
const onToggleExpand = useCallback((
|
|
2678
|
+
const onToggleExpand = useCallback((id_0) => live.current.expansion?.toggle(id_0), []);
|
|
1223
2679
|
const handleRowClick = useCallback((row) => live.current.onRowClick?.(row), []);
|
|
1224
|
-
const handlePrefetch = useCallback((
|
|
1225
|
-
const renderDetail = useCallback((
|
|
2680
|
+
const handlePrefetch = useCallback((row_0) => live.current.prefetch?.(row_0), []);
|
|
2681
|
+
const renderDetail = useCallback((row_1) => live.current.renderRowDetail?.(row_1), []);
|
|
1226
2682
|
const Row = useMemo(() => createDesktopRow(), []);
|
|
1227
2683
|
const { ref: overflowRef, overflowing } = useHorizontalOverflow();
|
|
1228
2684
|
const hasPinned = columns.some((c) => pinOffset?.(c.key) != null) || stickActions;
|
|
@@ -1233,24 +2689,24 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1233
2689
|
} : void 0;
|
|
1234
2690
|
const stickyAttr = stickyHeader || void 0;
|
|
1235
2691
|
const leads = {
|
|
1236
|
-
|
|
1237
|
-
|
|
2692
|
+
start: selection ? SELECTION_WIDTH : 0,
|
|
2693
|
+
end: showActions ? ACTIONS_WIDTH : 0
|
|
1238
2694
|
};
|
|
1239
|
-
const
|
|
1240
|
-
const
|
|
1241
|
-
const pinSignature = columns.map((
|
|
1242
|
-
const pin = pinOffset?.(
|
|
1243
|
-
return pin ? `${
|
|
2695
|
+
const hasStartPin = columns.some((c_0) => pinOffset?.(c_0.key)?.side === "start");
|
|
2696
|
+
const hasEndPin = columns.some((c_1) => pinOffset?.(c_1.key)?.side === "end");
|
|
2697
|
+
const pinSignature = columns.map((c_2) => {
|
|
2698
|
+
const pin = pinOffset?.(c_2.key);
|
|
2699
|
+
return pin ? `${c_2.key}:${pin.side}:${pin.inset}` : "";
|
|
1244
2700
|
}).join("|");
|
|
1245
2701
|
const headPinStyle = (key) => pinnedCellStyle(pinOffset?.(key), PIN_Z.headerPinned, leads);
|
|
1246
2702
|
const headStyle = (column) => {
|
|
1247
|
-
const
|
|
1248
|
-
const
|
|
1249
|
-
const width =
|
|
1250
|
-
if (!stickyStyle && !
|
|
2703
|
+
const key_0 = column.key;
|
|
2704
|
+
const pin_0 = headPinStyle(key_0);
|
|
2705
|
+
const width = pin_0 ? pinnedColumnWidth(column, columnWidths) : columnWidths?.[key_0];
|
|
2706
|
+
if (!stickyStyle && !pin_0 && width == null && !setWidth) return void 0;
|
|
1251
2707
|
const merged = {
|
|
1252
2708
|
...stickyStyle,
|
|
1253
|
-
...
|
|
2709
|
+
...pin_0,
|
|
1254
2710
|
...width != null && { width }
|
|
1255
2711
|
};
|
|
1256
2712
|
if (setWidth && !merged.position) merged.position = "relative";
|
|
@@ -1264,7 +2720,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1264
2720
|
...edge
|
|
1265
2721
|
};
|
|
1266
2722
|
};
|
|
1267
|
-
const columnName = (
|
|
2723
|
+
const columnName = (column_0) => typeof column_0.header === "string" ? column_0.header : column_0.key;
|
|
1268
2724
|
const minWidth = tableMinWidth(columns, {
|
|
1269
2725
|
widths: columnWidths,
|
|
1270
2726
|
extra: (selection ? SELECTION_WIDTH : 0) + (showActions ? ACTIONS_WIDTH : 0)
|
|
@@ -1317,8 +2773,8 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1317
2773
|
selection && /* @__PURE__ */ jsx("th", {
|
|
1318
2774
|
"data-adapttable-part": "selection-header",
|
|
1319
2775
|
"data-sticky": stickyAttr,
|
|
1320
|
-
"data-pinned":
|
|
1321
|
-
style: edgeHeadStyle("
|
|
2776
|
+
"data-pinned": hasStartPin ? "start" : void 0,
|
|
2777
|
+
style: edgeHeadStyle("start", hasStartPin),
|
|
1322
2778
|
className: cx(classNames.headerCell, classNames.selectionCell),
|
|
1323
2779
|
children: /* @__PURE__ */ jsx("input", {
|
|
1324
2780
|
type: "checkbox",
|
|
@@ -1331,25 +2787,25 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1331
2787
|
className: classNames.checkbox
|
|
1332
2788
|
})
|
|
1333
2789
|
}),
|
|
1334
|
-
columns.map((
|
|
1335
|
-
const localStyle = headStyle(
|
|
1336
|
-
const headerProps = table.getHeaderCellProps(
|
|
1337
|
-
const
|
|
1338
|
-
const sortButtonProps = table.getSortButtonProps(
|
|
2790
|
+
columns.map((column_1) => {
|
|
2791
|
+
const localStyle = headStyle(column_1);
|
|
2792
|
+
const headerProps = table.getHeaderCellProps(column_1, localStyle && { style: localStyle });
|
|
2793
|
+
const active_0 = table.sortBy === column_1.key;
|
|
2794
|
+
const sortButtonProps = table.getSortButtonProps(column_1);
|
|
1339
2795
|
const sortIndex = sortButtonProps["data-sort-index"];
|
|
1340
2796
|
return /* @__PURE__ */ jsxs("th", {
|
|
1341
2797
|
...headerProps,
|
|
1342
2798
|
"data-adapttable-part": "header-cell",
|
|
1343
|
-
"data-sorted":
|
|
2799
|
+
"data-sorted": active_0 ? table.sortDir : void 0,
|
|
1344
2800
|
"data-sticky": stickyAttr,
|
|
1345
|
-
"data-pinned": pinOffset?.(
|
|
2801
|
+
"data-pinned": pinOffset?.(column_1.key)?.side,
|
|
1346
2802
|
className: classNames.headerCell,
|
|
1347
|
-
children: [
|
|
2803
|
+
children: [column_1.sortable ? /* @__PURE__ */ jsxs("button", {
|
|
1348
2804
|
...sortButtonProps,
|
|
1349
2805
|
"data-adapttable-part": "sort-button",
|
|
1350
2806
|
className: classNames.sortButton,
|
|
1351
2807
|
children: [
|
|
1352
|
-
|
|
2808
|
+
column_1.header,
|
|
1353
2809
|
typeof sortIndex === "number" && /* @__PURE__ */ jsx("span", {
|
|
1354
2810
|
"data-adapttable-part": "sort-index",
|
|
1355
2811
|
className: classNames.sortIndex,
|
|
@@ -1357,22 +2813,22 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1357
2813
|
}),
|
|
1358
2814
|
/* @__PURE__ */ jsxs("span", {
|
|
1359
2815
|
"aria-hidden": true,
|
|
1360
|
-
children: [" ", sortGlyph(
|
|
2816
|
+
children: [" ", sortGlyph(active_0, table.sortDir)]
|
|
1361
2817
|
})
|
|
1362
2818
|
]
|
|
1363
|
-
}) :
|
|
1364
|
-
...columnResizeHandleProps(
|
|
2819
|
+
}) : column_1.header, setWidth && /* @__PURE__ */ jsx("span", {
|
|
2820
|
+
...columnResizeHandleProps(column_1.key, setWidth, `${resizeLabel}: ${columnName(column_1)}`),
|
|
1365
2821
|
"data-adapttable-part": "resize-handle",
|
|
1366
2822
|
className: classNames.resizeHandle,
|
|
1367
2823
|
style: RESIZE_HANDLE_STYLE
|
|
1368
2824
|
})]
|
|
1369
|
-
},
|
|
2825
|
+
}, column_1.key);
|
|
1370
2826
|
}),
|
|
1371
2827
|
showActions && /* @__PURE__ */ jsx("th", {
|
|
1372
2828
|
"data-adapttable-part": "actions-header",
|
|
1373
2829
|
"data-sticky": stickyAttr,
|
|
1374
|
-
"data-pinned":
|
|
1375
|
-
style: edgeHeadStyle("
|
|
2830
|
+
"data-pinned": hasEndPin || stickActions ? "end" : void 0,
|
|
2831
|
+
style: edgeHeadStyle("end", hasEndPin || stickActions),
|
|
1376
2832
|
className: cx(classNames.headerCell, classNames.actionsCell),
|
|
1377
2833
|
children: labels.actions
|
|
1378
2834
|
})
|
|
@@ -1390,18 +2846,18 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1390
2846
|
padding: 0
|
|
1391
2847
|
}
|
|
1392
2848
|
}) }),
|
|
1393
|
-
entries.map(({ row, index, key }) => {
|
|
1394
|
-
const
|
|
2849
|
+
entries.map(({ row: row_2, index, key: key_1 }) => {
|
|
2850
|
+
const id_1 = getRowId(row_2);
|
|
1395
2851
|
return /* @__PURE__ */ jsx(Row, {
|
|
1396
|
-
row,
|
|
2852
|
+
row: row_2,
|
|
1397
2853
|
index,
|
|
1398
|
-
id,
|
|
2854
|
+
id: id_1,
|
|
1399
2855
|
table,
|
|
1400
2856
|
columns,
|
|
1401
2857
|
labels,
|
|
1402
2858
|
classNames,
|
|
1403
|
-
selected: selection ? selection.isSelected(
|
|
1404
|
-
expanded: expansionState ? expansionState.isExpanded(
|
|
2859
|
+
selected: selection ? selection.isSelected(id_1) : void 0,
|
|
2860
|
+
expanded: expansionState ? expansionState.isExpanded(id_1) : void 0,
|
|
1405
2861
|
showActions,
|
|
1406
2862
|
rowActions,
|
|
1407
2863
|
confirm,
|
|
@@ -1409,10 +2865,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1409
2865
|
columnWidths,
|
|
1410
2866
|
pinOffset,
|
|
1411
2867
|
pinSignature,
|
|
1412
|
-
|
|
1413
|
-
|
|
2868
|
+
hasStartPin,
|
|
2869
|
+
hasEndPin,
|
|
1414
2870
|
actionsPinned: stickActions,
|
|
1415
|
-
rowClass: rowClassName?.(
|
|
2871
|
+
rowClass: rowClassName?.(row_2, index),
|
|
1416
2872
|
clickable: Boolean(onRowClick),
|
|
1417
2873
|
hasPrefetch: Boolean(prefetch),
|
|
1418
2874
|
onRowClick: handleRowClick,
|
|
@@ -1421,7 +2877,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1421
2877
|
onToggleExpand,
|
|
1422
2878
|
renderDetail,
|
|
1423
2879
|
measureElement
|
|
1424
|
-
},
|
|
2880
|
+
}, key_1);
|
|
1425
2881
|
}),
|
|
1426
2882
|
paddingBottom > 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
1427
2883
|
colSpan: columnSpan,
|
|
@@ -1441,11 +2897,11 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1441
2897
|
children: [
|
|
1442
2898
|
expandable && summaryPad,
|
|
1443
2899
|
selection && summaryPad,
|
|
1444
|
-
columns.map((
|
|
2900
|
+
columns.map((column_2) => /* @__PURE__ */ jsx("td", {
|
|
1445
2901
|
"data-adapttable-part": "summary-cell",
|
|
1446
2902
|
className: classNames.summaryCell,
|
|
1447
|
-
children: summary[
|
|
1448
|
-
},
|
|
2903
|
+
children: summary[column_2.key]
|
|
2904
|
+
}, column_2.key)),
|
|
1449
2905
|
showActions && summaryPad
|
|
1450
2906
|
]
|
|
1451
2907
|
})
|
|
@@ -1463,110 +2919,210 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1463
2919
|
});
|
|
1464
2920
|
}
|
|
1465
2921
|
/** Mobile card-list rendering. */
|
|
1466
|
-
function MobileCards(
|
|
2922
|
+
function MobileCards(t0) {
|
|
2923
|
+
const $ = c(50);
|
|
2924
|
+
const { table, rows, rowActions, confirm, getRowId, classNames, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, rowEntries, paddingTop: t1, paddingBottom: t2, measureElement } = t0;
|
|
2925
|
+
const paddingTop = t1 === void 0 ? 0 : t1;
|
|
2926
|
+
const paddingBottom = t2 === void 0 ? 0 : t2;
|
|
1467
2927
|
const { columns, selection, labels } = table;
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
2928
|
+
let summary;
|
|
2929
|
+
let t3;
|
|
2930
|
+
let t4;
|
|
2931
|
+
let t5;
|
|
2932
|
+
let t6;
|
|
2933
|
+
let t7;
|
|
2934
|
+
let t8;
|
|
2935
|
+
if ($[0] !== classNames || $[1] !== columns || $[2] !== confirm || $[3] !== expansion || $[4] !== getRowId || $[5] !== labels || $[6] !== measureElement || $[7] !== onRowClick || $[8] !== paddingTop || $[9] !== renderRowDetail || $[10] !== rowActions || $[11] !== rowClassName || $[12] !== rowEntries || $[13] !== rows || $[14] !== selection || $[15] !== summaryRow || $[16] !== table) {
|
|
2936
|
+
const entries = resolveVirtualRows(rows, getRowId, rowEntries);
|
|
2937
|
+
const expansionState = renderRowDetail ? expansion : void 0;
|
|
2938
|
+
let t9;
|
|
2939
|
+
if ($[24] !== rows || $[25] !== summaryRow) {
|
|
2940
|
+
t9 = summaryRow?.(rows);
|
|
2941
|
+
$[24] = rows;
|
|
2942
|
+
$[25] = summaryRow;
|
|
2943
|
+
$[26] = t9;
|
|
2944
|
+
} else t9 = $[26];
|
|
2945
|
+
summary = t9;
|
|
2946
|
+
if ($[27] !== table) {
|
|
2947
|
+
t3 = table.getTableProps({ role: void 0 });
|
|
2948
|
+
$[27] = table;
|
|
2949
|
+
$[28] = t3;
|
|
2950
|
+
} else t3 = $[28];
|
|
2951
|
+
t4 = "cards";
|
|
2952
|
+
t5 = classNames.cards;
|
|
2953
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2954
|
+
t6 = {
|
|
2955
|
+
listStyle: "none",
|
|
2956
|
+
margin: 0,
|
|
2957
|
+
padding: 0
|
|
2958
|
+
};
|
|
2959
|
+
$[29] = t6;
|
|
2960
|
+
} else t6 = $[29];
|
|
2961
|
+
if ($[30] !== paddingTop) {
|
|
2962
|
+
t7 = paddingTop > 0 && /* @__PURE__ */ jsx("li", {
|
|
1482
2963
|
"aria-hidden": true,
|
|
1483
2964
|
"data-adapttable-part": "virtual-spacer",
|
|
1484
2965
|
style: { height: paddingTop }
|
|
1485
|
-
})
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
}, column.key)),
|
|
1527
|
-
rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
1528
|
-
"data-adapttable-part": "card-actions",
|
|
1529
|
-
className: classNames.actionsCell,
|
|
1530
|
-
children: /* @__PURE__ */ jsx(RowActionButtons, {
|
|
2966
|
+
});
|
|
2967
|
+
$[30] = paddingTop;
|
|
2968
|
+
$[31] = t7;
|
|
2969
|
+
} else t7 = $[31];
|
|
2970
|
+
t8 = entries.map((t10) => {
|
|
2971
|
+
const { row, index, key } = t10;
|
|
2972
|
+
const id = getRowId(row);
|
|
2973
|
+
const expanded = expansionState?.isExpanded(id) ?? false;
|
|
2974
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
2975
|
+
...rowClickProps(row, onRowClick),
|
|
2976
|
+
ref: measureElement,
|
|
2977
|
+
"data-index": index,
|
|
2978
|
+
"data-adapttable-part": "card",
|
|
2979
|
+
"data-selected": selection?.isSelected(id) ? "" : void 0,
|
|
2980
|
+
"data-clickable": onRowClick ? "" : void 0,
|
|
2981
|
+
className: cx(classNames.card, rowClassName?.(row, index)),
|
|
2982
|
+
children: [
|
|
2983
|
+
selection && /* @__PURE__ */ jsx("input", {
|
|
2984
|
+
type: "checkbox",
|
|
2985
|
+
"aria-label": labels.selectRow,
|
|
2986
|
+
checked: selection.isSelected(id),
|
|
2987
|
+
onChange: () => selection.toggle(id),
|
|
2988
|
+
className: classNames.checkbox
|
|
2989
|
+
}),
|
|
2990
|
+
expansionState && /* @__PURE__ */ jsx(ExpandButton, {
|
|
2991
|
+
expanded,
|
|
2992
|
+
labels,
|
|
2993
|
+
classNames,
|
|
2994
|
+
onToggle: () => expansionState.toggle(id)
|
|
2995
|
+
}),
|
|
2996
|
+
columns.map((column) => /* @__PURE__ */ jsxs("div", {
|
|
2997
|
+
"data-adapttable-part": "card-row",
|
|
2998
|
+
className: classNames.cardRow,
|
|
2999
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
3000
|
+
"data-adapttable-part": "card-label",
|
|
3001
|
+
className: classNames.cardLabel,
|
|
3002
|
+
children: cardLabel(column)
|
|
3003
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
3004
|
+
"data-adapttable-part": "card-value",
|
|
3005
|
+
className: classNames.cardValue,
|
|
3006
|
+
children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
|
|
1531
3007
|
row,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
3008
|
+
rowIndex: index
|
|
3009
|
+
}) : column.accessor?.(row)
|
|
3010
|
+
})]
|
|
3011
|
+
}, column.key)),
|
|
3012
|
+
rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
3013
|
+
"data-adapttable-part": "card-actions",
|
|
3014
|
+
className: classNames.actionsCell,
|
|
3015
|
+
children: /* @__PURE__ */ jsx(RowActionButtons, {
|
|
3016
|
+
row,
|
|
3017
|
+
actions: rowActions,
|
|
3018
|
+
confirm,
|
|
3019
|
+
cancelLabel: labels.cancel,
|
|
3020
|
+
classNames
|
|
1542
3021
|
})
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
})
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
]
|
|
1569
|
-
|
|
3022
|
+
}),
|
|
3023
|
+
expanded && /* @__PURE__ */ jsx("div", {
|
|
3024
|
+
"data-adapttable-part": "card-detail",
|
|
3025
|
+
className: classNames.cardDetail,
|
|
3026
|
+
children: renderRowDetail(row)
|
|
3027
|
+
})
|
|
3028
|
+
]
|
|
3029
|
+
}, key);
|
|
3030
|
+
});
|
|
3031
|
+
$[0] = classNames;
|
|
3032
|
+
$[1] = columns;
|
|
3033
|
+
$[2] = confirm;
|
|
3034
|
+
$[3] = expansion;
|
|
3035
|
+
$[4] = getRowId;
|
|
3036
|
+
$[5] = labels;
|
|
3037
|
+
$[6] = measureElement;
|
|
3038
|
+
$[7] = onRowClick;
|
|
3039
|
+
$[8] = paddingTop;
|
|
3040
|
+
$[9] = renderRowDetail;
|
|
3041
|
+
$[10] = rowActions;
|
|
3042
|
+
$[11] = rowClassName;
|
|
3043
|
+
$[12] = rowEntries;
|
|
3044
|
+
$[13] = rows;
|
|
3045
|
+
$[14] = selection;
|
|
3046
|
+
$[15] = summaryRow;
|
|
3047
|
+
$[16] = table;
|
|
3048
|
+
$[17] = summary;
|
|
3049
|
+
$[18] = t3;
|
|
3050
|
+
$[19] = t4;
|
|
3051
|
+
$[20] = t5;
|
|
3052
|
+
$[21] = t6;
|
|
3053
|
+
$[22] = t7;
|
|
3054
|
+
$[23] = t8;
|
|
3055
|
+
} else {
|
|
3056
|
+
summary = $[17];
|
|
3057
|
+
t3 = $[18];
|
|
3058
|
+
t4 = $[19];
|
|
3059
|
+
t5 = $[20];
|
|
3060
|
+
t6 = $[21];
|
|
3061
|
+
t7 = $[22];
|
|
3062
|
+
t8 = $[23];
|
|
3063
|
+
}
|
|
3064
|
+
let t9;
|
|
3065
|
+
if ($[32] !== paddingBottom) {
|
|
3066
|
+
t9 = paddingBottom > 0 && /* @__PURE__ */ jsx("li", {
|
|
3067
|
+
"aria-hidden": true,
|
|
3068
|
+
"data-adapttable-part": "virtual-spacer",
|
|
3069
|
+
style: { height: paddingBottom }
|
|
3070
|
+
});
|
|
3071
|
+
$[32] = paddingBottom;
|
|
3072
|
+
$[33] = t9;
|
|
3073
|
+
} else t9 = $[33];
|
|
3074
|
+
let t10;
|
|
3075
|
+
if ($[34] !== classNames.cardLabel || $[35] !== classNames.cardRow || $[36] !== classNames.cardValue || $[37] !== classNames.summaryCard || $[38] !== columns || $[39] !== summary) {
|
|
3076
|
+
t10 = summary && /* @__PURE__ */ jsx("li", {
|
|
3077
|
+
"data-adapttable-part": "summary-card",
|
|
3078
|
+
className: classNames.summaryCard,
|
|
3079
|
+
children: columns.filter((column_0) => summary[column_0.key] !== void 0).map((column_1) => /* @__PURE__ */ jsxs("div", {
|
|
3080
|
+
"data-adapttable-part": "card-row",
|
|
3081
|
+
className: classNames.cardRow,
|
|
3082
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
3083
|
+
"data-adapttable-part": "card-label",
|
|
3084
|
+
className: classNames.cardLabel,
|
|
3085
|
+
children: cardLabel(column_1)
|
|
3086
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
3087
|
+
"data-adapttable-part": "card-value",
|
|
3088
|
+
className: classNames.cardValue,
|
|
3089
|
+
children: summary[column_1.key]
|
|
3090
|
+
})]
|
|
3091
|
+
}, column_1.key))
|
|
3092
|
+
});
|
|
3093
|
+
$[34] = classNames.cardLabel;
|
|
3094
|
+
$[35] = classNames.cardRow;
|
|
3095
|
+
$[36] = classNames.cardValue;
|
|
3096
|
+
$[37] = classNames.summaryCard;
|
|
3097
|
+
$[38] = columns;
|
|
3098
|
+
$[39] = summary;
|
|
3099
|
+
$[40] = t10;
|
|
3100
|
+
} else t10 = $[40];
|
|
3101
|
+
let t11;
|
|
3102
|
+
if ($[41] !== t10 || $[42] !== t3 || $[43] !== t4 || $[44] !== t5 || $[45] !== t6 || $[46] !== t7 || $[47] !== t8 || $[48] !== t9) {
|
|
3103
|
+
t11 = /* @__PURE__ */ jsxs("ul", {
|
|
3104
|
+
...t3,
|
|
3105
|
+
"data-adapttable-part": t4,
|
|
3106
|
+
className: t5,
|
|
3107
|
+
style: t6,
|
|
3108
|
+
children: [
|
|
3109
|
+
t7,
|
|
3110
|
+
t8,
|
|
3111
|
+
t9,
|
|
3112
|
+
t10
|
|
3113
|
+
]
|
|
3114
|
+
});
|
|
3115
|
+
$[41] = t10;
|
|
3116
|
+
$[42] = t3;
|
|
3117
|
+
$[43] = t4;
|
|
3118
|
+
$[44] = t5;
|
|
3119
|
+
$[45] = t6;
|
|
3120
|
+
$[46] = t7;
|
|
3121
|
+
$[47] = t8;
|
|
3122
|
+
$[48] = t9;
|
|
3123
|
+
$[49] = t11;
|
|
3124
|
+
} else t11 = $[49];
|
|
3125
|
+
return t11;
|
|
1570
3126
|
}
|
|
1571
3127
|
function sortGlyph(active, dir) {
|
|
1572
3128
|
if (!active) return "↕";
|
|
@@ -1578,58 +3134,139 @@ function cardLabel(column) {
|
|
|
1578
3134
|
//#endregion
|
|
1579
3135
|
//#region src/DataTable.tsx
|
|
1580
3136
|
const NO_CLASSNAMES = {};
|
|
1581
|
-
|
|
3137
|
+
/**
|
|
3138
|
+
* `DataTableProps` after tier resolution: the source is definite (whichever
|
|
3139
|
+
* tier provided it) and `filters` is plain JSX (the auto-built form when the
|
|
3140
|
+
* caller passed the declarative array).
|
|
3141
|
+
*/
|
|
3142
|
+
function DataTableBody(t0) {
|
|
3143
|
+
const $ = c(48);
|
|
3144
|
+
const { chrome, props, classNames, confirm, getRowId, virtualization, virtualScrollRef, labels } = t0;
|
|
1582
3145
|
const rowActions = chrome.columnLayout.isHidden(ACTIONS_COLUMN_KEY) ? void 0 : props.rowActions;
|
|
1583
3146
|
const actionsPinned = (rowActions?.length ?? 0) > 0 && chrome.columnLayout.state.pinned[ACTIONS_COLUMN_KEY] !== void 0;
|
|
1584
|
-
if (chrome.body === "skeleton")
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
3147
|
+
if (chrome.body === "skeleton") {
|
|
3148
|
+
let t1;
|
|
3149
|
+
if ($[0] !== chrome.isMobile || $[1] !== chrome.table || $[2] !== classNames || $[3] !== labels || $[4] !== props.loadingState || $[5] !== props.skeletonRows || $[6] !== props.slots?.skeleton || $[7] !== props.source || $[8] !== rowActions?.length) {
|
|
3150
|
+
t1 = props.slots?.skeleton ?? props.loadingState ?? /* @__PURE__ */ jsx(LoadingState, {
|
|
3151
|
+
rows: props.skeletonRows ?? props.source.limit,
|
|
3152
|
+
columns: chrome.table.columns.length,
|
|
3153
|
+
variant: chrome.isMobile ? "cards" : "table",
|
|
3154
|
+
labels,
|
|
3155
|
+
classNames,
|
|
3156
|
+
hasActions: (rowActions?.length ?? 0) > 0
|
|
3157
|
+
});
|
|
3158
|
+
$[0] = chrome.isMobile;
|
|
3159
|
+
$[1] = chrome.table;
|
|
3160
|
+
$[2] = classNames;
|
|
3161
|
+
$[3] = labels;
|
|
3162
|
+
$[4] = props.loadingState;
|
|
3163
|
+
$[5] = props.skeletonRows;
|
|
3164
|
+
$[6] = props.slots?.skeleton;
|
|
3165
|
+
$[7] = props.source;
|
|
3166
|
+
$[8] = rowActions?.length;
|
|
3167
|
+
$[9] = t1;
|
|
3168
|
+
} else t1 = $[9];
|
|
3169
|
+
let t2;
|
|
3170
|
+
if ($[10] !== t1) {
|
|
3171
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
3172
|
+
$[10] = t1;
|
|
3173
|
+
$[11] = t2;
|
|
3174
|
+
} else t2 = $[11];
|
|
3175
|
+
return t2;
|
|
3176
|
+
}
|
|
1592
3177
|
if (chrome.body === "empty") {
|
|
1593
3178
|
const noResults = chrome.emptyVariant === "noResults";
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
3179
|
+
let t1;
|
|
3180
|
+
if ($[12] !== chrome.clearFilters || $[13] !== classNames || $[14] !== labels || $[15] !== noResults || $[16] !== props.emptyState || $[17] !== props.slots?.empty) {
|
|
3181
|
+
t1 = props.slots?.empty ?? props.emptyState ?? /* @__PURE__ */ jsxs("output", {
|
|
3182
|
+
"data-adapttable-part": "empty",
|
|
3183
|
+
className: classNames.empty,
|
|
3184
|
+
children: [noResults ? labels.noResults : labels.noData, noResults && /* @__PURE__ */ jsx("button", {
|
|
3185
|
+
type: "button",
|
|
3186
|
+
"data-adapttable-part": "empty-clear",
|
|
3187
|
+
className: classNames.emptyClear,
|
|
3188
|
+
onClick: chrome.clearFilters,
|
|
3189
|
+
children: labels.clearAll
|
|
3190
|
+
})]
|
|
3191
|
+
});
|
|
3192
|
+
$[12] = chrome.clearFilters;
|
|
3193
|
+
$[13] = classNames;
|
|
3194
|
+
$[14] = labels;
|
|
3195
|
+
$[15] = noResults;
|
|
3196
|
+
$[16] = props.emptyState;
|
|
3197
|
+
$[17] = props.slots?.empty;
|
|
3198
|
+
$[18] = t1;
|
|
3199
|
+
} else t1 = $[18];
|
|
3200
|
+
let t2;
|
|
3201
|
+
if ($[19] !== t1) {
|
|
3202
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
3203
|
+
$[19] = t1;
|
|
3204
|
+
$[20] = t2;
|
|
3205
|
+
} else t2 = $[20];
|
|
3206
|
+
return t2;
|
|
1605
3207
|
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
3208
|
+
const Renderer = chrome.isMobile ? MobileCards : DesktopTable;
|
|
3209
|
+
const t1 = chrome.detail?.expansion;
|
|
3210
|
+
const t2 = virtualization.enabled ? virtualization.rows : void 0;
|
|
3211
|
+
const t3 = props.resizableColumns ? chrome.columnLayout.setWidth : void 0;
|
|
3212
|
+
let t4;
|
|
3213
|
+
if ($[21] !== Renderer || $[22] !== actionsPinned || $[23] !== chrome.columnLayout.pinOffset || $[24] !== chrome.columnLayout.state.widths || $[25] !== chrome.table || $[26] !== classNames || $[27] !== confirm || $[28] !== getRowId || $[29] !== labels.resizeColumn || $[30] !== props.maxHeight || $[31] !== props.onRowClick || $[32] !== props.prefetch || $[33] !== props.renderRowDetail || $[34] !== props.rowClassName || $[35] !== props.source.rows || $[36] !== props.stickyHeader || $[37] !== props.stickyTop || $[38] !== props.summaryRow || $[39] !== rowActions || $[40] !== t1 || $[41] !== t2 || $[42] !== t3 || $[43] !== virtualScrollRef || $[44] !== virtualization.measureElement || $[45] !== virtualization.paddingBottom || $[46] !== virtualization.paddingTop) {
|
|
3214
|
+
t4 = /* @__PURE__ */ jsx(Renderer, {
|
|
3215
|
+
table: chrome.table,
|
|
3216
|
+
rows: props.source.rows,
|
|
3217
|
+
rowActions,
|
|
3218
|
+
actionsPinned,
|
|
3219
|
+
confirm,
|
|
3220
|
+
getRowId,
|
|
3221
|
+
classNames,
|
|
3222
|
+
prefetch: props.prefetch,
|
|
3223
|
+
onRowClick: props.onRowClick,
|
|
3224
|
+
rowClassName: props.rowClassName,
|
|
3225
|
+
renderRowDetail: props.renderRowDetail,
|
|
3226
|
+
summaryRow: props.summaryRow,
|
|
3227
|
+
expansion: t1,
|
|
3228
|
+
rowEntries: t2,
|
|
3229
|
+
paddingTop: virtualization.paddingTop,
|
|
3230
|
+
paddingBottom: virtualization.paddingBottom,
|
|
3231
|
+
measureElement: virtualization.measureElement,
|
|
3232
|
+
stickyHeader: props.stickyHeader,
|
|
3233
|
+
stickyTop: props.stickyTop,
|
|
3234
|
+
pinOffset: chrome.columnLayout.pinOffset,
|
|
3235
|
+
maxHeight: props.maxHeight,
|
|
3236
|
+
virtualScrollRef,
|
|
3237
|
+
setWidth: t3,
|
|
3238
|
+
columnWidths: chrome.columnLayout.state.widths,
|
|
3239
|
+
resizeLabel: labels.resizeColumn
|
|
3240
|
+
});
|
|
3241
|
+
$[21] = Renderer;
|
|
3242
|
+
$[22] = actionsPinned;
|
|
3243
|
+
$[23] = chrome.columnLayout.pinOffset;
|
|
3244
|
+
$[24] = chrome.columnLayout.state.widths;
|
|
3245
|
+
$[25] = chrome.table;
|
|
3246
|
+
$[26] = classNames;
|
|
3247
|
+
$[27] = confirm;
|
|
3248
|
+
$[28] = getRowId;
|
|
3249
|
+
$[29] = labels.resizeColumn;
|
|
3250
|
+
$[30] = props.maxHeight;
|
|
3251
|
+
$[31] = props.onRowClick;
|
|
3252
|
+
$[32] = props.prefetch;
|
|
3253
|
+
$[33] = props.renderRowDetail;
|
|
3254
|
+
$[34] = props.rowClassName;
|
|
3255
|
+
$[35] = props.source.rows;
|
|
3256
|
+
$[36] = props.stickyHeader;
|
|
3257
|
+
$[37] = props.stickyTop;
|
|
3258
|
+
$[38] = props.summaryRow;
|
|
3259
|
+
$[39] = rowActions;
|
|
3260
|
+
$[40] = t1;
|
|
3261
|
+
$[41] = t2;
|
|
3262
|
+
$[42] = t3;
|
|
3263
|
+
$[43] = virtualScrollRef;
|
|
3264
|
+
$[44] = virtualization.measureElement;
|
|
3265
|
+
$[45] = virtualization.paddingBottom;
|
|
3266
|
+
$[46] = virtualization.paddingTop;
|
|
3267
|
+
$[47] = t4;
|
|
3268
|
+
} else t4 = $[47];
|
|
3269
|
+
return t4;
|
|
1633
3270
|
}
|
|
1634
3271
|
/**
|
|
1635
3272
|
* Headless, unstyled AdaptTable for Tailwind / shadcn / custom CSS. Renders
|