@adapttable/unstyled 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +13 -0
- package/dist/index.cjs +2395 -805
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2395 -805
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "react-compiler-runtime";
|
|
1
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, 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";
|
|
@@ -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;
|
|
141
|
+
}
|
|
142
|
+
function SelectField(t0) {
|
|
143
|
+
const $ = c(22);
|
|
144
|
+
const { def, source, classNames } = t0;
|
|
145
|
+
const { options, loading } = useFilterOptions(def);
|
|
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;
|
|
61
226
|
}
|
|
62
|
-
function
|
|
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]);
|
|
63
237
|
const { options, loading } = useFilterOptions(def);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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,310 @@ 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(38);
|
|
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
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
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
|
+
let t4;
|
|
1470
|
+
if ($[9] !== labels || $[10] !== safePage || $[11] !== totalPages) {
|
|
1471
|
+
t4 = labels.pageOf({
|
|
1472
|
+
page: safePage,
|
|
1473
|
+
total: totalPages
|
|
1474
|
+
});
|
|
1475
|
+
$[9] = labels;
|
|
1476
|
+
$[10] = safePage;
|
|
1477
|
+
$[11] = totalPages;
|
|
1478
|
+
$[12] = t4;
|
|
1479
|
+
} else t4 = $[12];
|
|
1480
|
+
let t5;
|
|
1481
|
+
if ($[13] !== t4) {
|
|
1482
|
+
t5 = /* @__PURE__ */ jsx("span", { children: t4 });
|
|
1483
|
+
$[13] = t4;
|
|
1484
|
+
$[14] = t5;
|
|
1485
|
+
} else t5 = $[14];
|
|
1486
|
+
const t6 = safePage <= 1;
|
|
1487
|
+
let t7;
|
|
1488
|
+
if ($[15] !== safePage || $[16] !== source) {
|
|
1489
|
+
t7 = () => source.setPage(safePage - 1);
|
|
1490
|
+
$[15] = safePage;
|
|
1491
|
+
$[16] = source;
|
|
1492
|
+
$[17] = t7;
|
|
1493
|
+
} else t7 = $[17];
|
|
1494
|
+
let t8;
|
|
1495
|
+
if ($[18] !== classNames.pageButton || $[19] !== labels.previousPage || $[20] !== t6 || $[21] !== t7) {
|
|
1496
|
+
t8 = /* @__PURE__ */ jsx("button", {
|
|
1497
|
+
type: "button",
|
|
1498
|
+
"aria-label": labels.previousPage,
|
|
1499
|
+
"data-adapttable-part": "page-prev",
|
|
1500
|
+
className: classNames.pageButton,
|
|
1501
|
+
disabled: t6,
|
|
1502
|
+
onClick: t7,
|
|
1503
|
+
children: "‹"
|
|
1504
|
+
});
|
|
1505
|
+
$[18] = classNames.pageButton;
|
|
1506
|
+
$[19] = labels.previousPage;
|
|
1507
|
+
$[20] = t6;
|
|
1508
|
+
$[21] = t7;
|
|
1509
|
+
$[22] = t8;
|
|
1510
|
+
} else t8 = $[22];
|
|
1511
|
+
const t9 = safePage >= totalPages;
|
|
1512
|
+
let t10;
|
|
1513
|
+
if ($[23] !== safePage || $[24] !== source) {
|
|
1514
|
+
t10 = () => source.setPage(safePage + 1);
|
|
1515
|
+
$[23] = safePage;
|
|
1516
|
+
$[24] = source;
|
|
1517
|
+
$[25] = t10;
|
|
1518
|
+
} else t10 = $[25];
|
|
1519
|
+
let t11;
|
|
1520
|
+
if ($[26] !== classNames.pageButton || $[27] !== labels.nextPage || $[28] !== t10 || $[29] !== t9) {
|
|
1521
|
+
t11 = /* @__PURE__ */ jsx("button", {
|
|
1522
|
+
type: "button",
|
|
1523
|
+
"aria-label": labels.nextPage,
|
|
1524
|
+
"data-adapttable-part": "page-next",
|
|
1525
|
+
className: classNames.pageButton,
|
|
1526
|
+
disabled: t9,
|
|
1527
|
+
onClick: t10,
|
|
1528
|
+
children: "›"
|
|
1529
|
+
});
|
|
1530
|
+
$[26] = classNames.pageButton;
|
|
1531
|
+
$[27] = labels.nextPage;
|
|
1532
|
+
$[28] = t10;
|
|
1533
|
+
$[29] = t9;
|
|
1534
|
+
$[30] = t11;
|
|
1535
|
+
} else t11 = $[30];
|
|
1536
|
+
let t12;
|
|
1537
|
+
if ($[31] !== classNames.footer || $[32] !== t11 || $[33] !== t2 || $[34] !== t3 || $[35] !== t5 || $[36] !== t8) {
|
|
1538
|
+
t12 = /* @__PURE__ */ jsxs("div", {
|
|
1539
|
+
"data-adapttable-part": "footer",
|
|
1540
|
+
className: t1,
|
|
1541
|
+
children: [
|
|
1542
|
+
t2,
|
|
1543
|
+
t3,
|
|
1544
|
+
t5,
|
|
1545
|
+
t8,
|
|
1546
|
+
t11
|
|
1547
|
+
]
|
|
1548
|
+
});
|
|
1549
|
+
$[31] = classNames.footer;
|
|
1550
|
+
$[32] = t11;
|
|
1551
|
+
$[33] = t2;
|
|
1552
|
+
$[34] = t3;
|
|
1553
|
+
$[35] = t5;
|
|
1554
|
+
$[36] = t8;
|
|
1555
|
+
$[37] = t12;
|
|
1556
|
+
} else t12 = $[37];
|
|
1557
|
+
return t12;
|
|
770
1558
|
}
|
|
771
1559
|
/** 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
|
-
|
|
1560
|
+
function ErrorState(t0) {
|
|
1561
|
+
const $ = c(16);
|
|
1562
|
+
const { error, labels, onRetry, classNames } = t0;
|
|
1563
|
+
let t1;
|
|
1564
|
+
if ($[0] !== labels.errorTitle) {
|
|
1565
|
+
t1 = /* @__PURE__ */ jsx("strong", { children: labels.errorTitle });
|
|
1566
|
+
$[0] = labels.errorTitle;
|
|
1567
|
+
$[1] = t1;
|
|
1568
|
+
} else t1 = $[1];
|
|
1569
|
+
let t2;
|
|
1570
|
+
if ($[2] !== labels.errorMessage) {
|
|
1571
|
+
t2 = /* @__PURE__ */ jsx("p", { children: labels.errorMessage });
|
|
1572
|
+
$[2] = labels.errorMessage;
|
|
1573
|
+
$[3] = t2;
|
|
1574
|
+
} else t2 = $[3];
|
|
1575
|
+
let t3;
|
|
1576
|
+
if ($[4] !== error.message) {
|
|
1577
|
+
t3 = /* @__PURE__ */ jsx("small", { children: error.message });
|
|
1578
|
+
$[4] = error.message;
|
|
1579
|
+
$[5] = t3;
|
|
1580
|
+
} else t3 = $[5];
|
|
1581
|
+
let t4;
|
|
1582
|
+
if ($[6] !== classNames.retryButton || $[7] !== labels.retry || $[8] !== onRetry) {
|
|
1583
|
+
t4 = onRetry && /* @__PURE__ */ jsx("button", {
|
|
1584
|
+
type: "button",
|
|
1585
|
+
onClick: onRetry,
|
|
1586
|
+
"data-adapttable-part": "retry",
|
|
1587
|
+
className: classNames.retryButton,
|
|
1588
|
+
children: labels.retry
|
|
1589
|
+
});
|
|
1590
|
+
$[6] = classNames.retryButton;
|
|
1591
|
+
$[7] = labels.retry;
|
|
1592
|
+
$[8] = onRetry;
|
|
1593
|
+
$[9] = t4;
|
|
1594
|
+
} else t4 = $[9];
|
|
1595
|
+
let t5;
|
|
1596
|
+
if ($[10] !== classNames.error || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
|
|
1597
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
1598
|
+
role: "alert",
|
|
1599
|
+
"data-adapttable-part": "error",
|
|
1600
|
+
className: classNames.error,
|
|
1601
|
+
children: [
|
|
1602
|
+
t1,
|
|
1603
|
+
t2,
|
|
1604
|
+
t3,
|
|
1605
|
+
t4
|
|
1606
|
+
]
|
|
1607
|
+
});
|
|
1608
|
+
$[10] = classNames.error;
|
|
1609
|
+
$[11] = t1;
|
|
1610
|
+
$[12] = t2;
|
|
1611
|
+
$[13] = t3;
|
|
1612
|
+
$[14] = t4;
|
|
1613
|
+
$[15] = t5;
|
|
1614
|
+
} else t5 = $[15];
|
|
1615
|
+
return t5;
|
|
790
1616
|
}
|
|
791
1617
|
function loadingLineWidth(column, total) {
|
|
792
1618
|
if (column === 0) return "70%";
|
|
@@ -794,17 +1620,36 @@ function loadingLineWidth(column, total) {
|
|
|
794
1620
|
return "55%";
|
|
795
1621
|
}
|
|
796
1622
|
/** Skeleton-ish loading placeholder (semantic, unstyled). */
|
|
797
|
-
function LoadingState(
|
|
798
|
-
const
|
|
1623
|
+
function LoadingState(t0) {
|
|
1624
|
+
const $ = c(24);
|
|
1625
|
+
const { rows, columns, variant, labels, classNames, hasActions: t1 } = t0;
|
|
1626
|
+
const hasActions = t1 === void 0 ? false : t1;
|
|
1627
|
+
let t2;
|
|
1628
|
+
if ($[0] !== rows) {
|
|
1629
|
+
t2 = Array.from({ length: rows }, _temp2);
|
|
1630
|
+
$[0] = rows;
|
|
1631
|
+
$[1] = t2;
|
|
1632
|
+
} else t2 = $[1];
|
|
1633
|
+
const rowKeys = t2;
|
|
799
1634
|
const columnCount = Math.max(columns, 1) + (hasActions ? 1 : 0);
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1635
|
+
let t3;
|
|
1636
|
+
let t4;
|
|
1637
|
+
let t5;
|
|
1638
|
+
let t6;
|
|
1639
|
+
let t7;
|
|
1640
|
+
let t8;
|
|
1641
|
+
if ($[2] !== classNames.loading || $[3] !== columnCount || $[4] !== rowKeys || $[5] !== variant) {
|
|
1642
|
+
const columnKeys = Array.from({ length: columnCount }, _temp3);
|
|
1643
|
+
t3 = "status";
|
|
1644
|
+
t4 = "true";
|
|
1645
|
+
t5 = "polite";
|
|
1646
|
+
t6 = "loading";
|
|
1647
|
+
if ($[12] !== classNames.loading) {
|
|
1648
|
+
t7 = cx(classNames.loading);
|
|
1649
|
+
$[12] = classNames.loading;
|
|
1650
|
+
$[13] = t7;
|
|
1651
|
+
} else t7 = $[13];
|
|
1652
|
+
t8 = variant === "table" ? /* @__PURE__ */ jsxs("table", {
|
|
808
1653
|
"data-adapttable-part": "loading-table",
|
|
809
1654
|
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", {
|
|
810
1655
|
"data-adapttable-part": "loading-header-row",
|
|
@@ -817,141 +1662,426 @@ function LoadingState({ rows, columns, variant, labels, classNames, hasActions =
|
|
|
817
1662
|
}, column))
|
|
818
1663
|
}) }), /* @__PURE__ */ jsx("tbody", { children: rowKeys.map((row) => /* @__PURE__ */ jsx("tr", {
|
|
819
1664
|
"data-adapttable-part": "loading-row",
|
|
820
|
-
children: columnKeys.map((
|
|
1665
|
+
children: columnKeys.map((column_0) => /* @__PURE__ */ jsx("td", {
|
|
821
1666
|
"data-adapttable-part": "loading-cell",
|
|
822
1667
|
children: /* @__PURE__ */ jsx("span", {
|
|
823
1668
|
"data-adapttable-part": "loading-line",
|
|
824
|
-
style: { width: loadingLineWidth(
|
|
1669
|
+
style: { width: loadingLineWidth(column_0, columnCount) }
|
|
825
1670
|
})
|
|
826
|
-
},
|
|
1671
|
+
}, column_0))
|
|
827
1672
|
}, row)) })]
|
|
828
1673
|
}) : /* @__PURE__ */ jsx("div", {
|
|
829
1674
|
"data-adapttable-part": "loading-cards",
|
|
830
|
-
children: rowKeys.map((
|
|
1675
|
+
children: rowKeys.map((row_0) => /* @__PURE__ */ jsx("div", {
|
|
831
1676
|
"data-adapttable-part": "loading-card",
|
|
832
|
-
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((
|
|
1677
|
+
children: columnKeys.slice(0, Math.min(4, columnKeys.length)).map((column_1) => /* @__PURE__ */ jsx("span", {
|
|
833
1678
|
"data-adapttable-part": "loading-line",
|
|
834
|
-
style: { width: loadingLineWidth(
|
|
835
|
-
},
|
|
836
|
-
},
|
|
837
|
-
})
|
|
1679
|
+
style: { width: loadingLineWidth(column_1, columnKeys.length) }
|
|
1680
|
+
}, column_1))
|
|
1681
|
+
}, row_0))
|
|
1682
|
+
});
|
|
1683
|
+
$[2] = classNames.loading;
|
|
1684
|
+
$[3] = columnCount;
|
|
1685
|
+
$[4] = rowKeys;
|
|
1686
|
+
$[5] = variant;
|
|
1687
|
+
$[6] = t3;
|
|
1688
|
+
$[7] = t4;
|
|
1689
|
+
$[8] = t5;
|
|
1690
|
+
$[9] = t6;
|
|
1691
|
+
$[10] = t7;
|
|
1692
|
+
$[11] = t8;
|
|
1693
|
+
} else {
|
|
1694
|
+
t3 = $[6];
|
|
1695
|
+
t4 = $[7];
|
|
1696
|
+
t5 = $[8];
|
|
1697
|
+
t6 = $[9];
|
|
1698
|
+
t7 = $[10];
|
|
1699
|
+
t8 = $[11];
|
|
1700
|
+
}
|
|
1701
|
+
let t9;
|
|
1702
|
+
if ($[14] !== labels.loading) {
|
|
1703
|
+
t9 = /* @__PURE__ */ jsx("span", {
|
|
838
1704
|
className: "adapttable-sr-only",
|
|
839
1705
|
children: labels.loading
|
|
840
|
-
})
|
|
841
|
-
|
|
1706
|
+
});
|
|
1707
|
+
$[14] = labels.loading;
|
|
1708
|
+
$[15] = t9;
|
|
1709
|
+
} else t9 = $[15];
|
|
1710
|
+
let t10;
|
|
1711
|
+
if ($[16] !== t3 || $[17] !== t4 || $[18] !== t5 || $[19] !== t6 || $[20] !== t7 || $[21] !== t8 || $[22] !== t9) {
|
|
1712
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
1713
|
+
role: t3,
|
|
1714
|
+
"aria-busy": t4,
|
|
1715
|
+
"aria-live": t5,
|
|
1716
|
+
"data-adapttable-part": t6,
|
|
1717
|
+
className: t7,
|
|
1718
|
+
children: [t8, t9]
|
|
1719
|
+
});
|
|
1720
|
+
$[16] = t3;
|
|
1721
|
+
$[17] = t4;
|
|
1722
|
+
$[18] = t5;
|
|
1723
|
+
$[19] = t6;
|
|
1724
|
+
$[20] = t7;
|
|
1725
|
+
$[21] = t8;
|
|
1726
|
+
$[22] = t9;
|
|
1727
|
+
$[23] = t10;
|
|
1728
|
+
} else t10 = $[23];
|
|
1729
|
+
return t10;
|
|
1730
|
+
}
|
|
1731
|
+
function _temp3(__0, i_0) {
|
|
1732
|
+
return i_0;
|
|
1733
|
+
}
|
|
1734
|
+
function _temp2(_, i) {
|
|
1735
|
+
return i;
|
|
842
1736
|
}
|
|
843
1737
|
//#endregion
|
|
844
1738
|
//#region src/components/ColumnMenu.tsx
|
|
1739
|
+
/** Menu labels: the shared chrome contract plus the actions row's name. */
|
|
845
1740
|
/** 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
|
-
|
|
1741
|
+
function VisibilityToggle(t0) {
|
|
1742
|
+
const $ = c(9);
|
|
1743
|
+
const { hidden, name, labels, classNames, onToggle } = t0;
|
|
1744
|
+
const t1 = !hidden || void 0;
|
|
1745
|
+
const t2 = !hidden;
|
|
1746
|
+
const t3 = `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`;
|
|
1747
|
+
let t4;
|
|
1748
|
+
if ($[0] !== hidden) {
|
|
1749
|
+
t4 = /* @__PURE__ */ jsx(EyeIcon, { off: hidden });
|
|
1750
|
+
$[0] = hidden;
|
|
1751
|
+
$[1] = t4;
|
|
1752
|
+
} else t4 = $[1];
|
|
1753
|
+
let t5;
|
|
1754
|
+
if ($[2] !== classNames.columnMenuVisibility || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
1755
|
+
t5 = /* @__PURE__ */ jsx("button", {
|
|
1756
|
+
type: "button",
|
|
1757
|
+
"data-adapttable-part": "column-menu-visibility",
|
|
1758
|
+
"data-active": t1,
|
|
1759
|
+
"aria-pressed": t2,
|
|
1760
|
+
"aria-label": t3,
|
|
1761
|
+
className: classNames.columnMenuVisibility,
|
|
1762
|
+
onClick: onToggle,
|
|
1763
|
+
children: t4
|
|
1764
|
+
});
|
|
1765
|
+
$[2] = classNames.columnMenuVisibility;
|
|
1766
|
+
$[3] = onToggle;
|
|
1767
|
+
$[4] = t1;
|
|
1768
|
+
$[5] = t2;
|
|
1769
|
+
$[6] = t3;
|
|
1770
|
+
$[7] = t4;
|
|
1771
|
+
$[8] = t5;
|
|
1772
|
+
} else t5 = $[8];
|
|
1773
|
+
return t5;
|
|
857
1774
|
}
|
|
858
1775
|
/** The row's name caption, shared by data-column rows and the actions row. */
|
|
859
|
-
function RowName(
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1776
|
+
function RowName(t0) {
|
|
1777
|
+
const $ = c(4);
|
|
1778
|
+
const { hidden, name, classNames } = t0;
|
|
1779
|
+
const t1 = hidden || void 0;
|
|
1780
|
+
let t2;
|
|
1781
|
+
if ($[0] !== classNames.columnMenuLabel || $[1] !== name || $[2] !== t1) {
|
|
1782
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
1783
|
+
"data-adapttable-part": "column-menu-label",
|
|
1784
|
+
"data-hidden": t1,
|
|
1785
|
+
className: classNames.columnMenuLabel,
|
|
1786
|
+
children: name
|
|
1787
|
+
});
|
|
1788
|
+
$[0] = classNames.columnMenuLabel;
|
|
1789
|
+
$[1] = name;
|
|
1790
|
+
$[2] = t1;
|
|
1791
|
+
$[3] = t2;
|
|
1792
|
+
} else t2 = $[3];
|
|
1793
|
+
return t2;
|
|
866
1794
|
}
|
|
867
1795
|
/** 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
|
-
|
|
1796
|
+
function PinToggle(t0) {
|
|
1797
|
+
const $ = c(7);
|
|
1798
|
+
const { active, actionLabel, classNames, onClick } = t0;
|
|
1799
|
+
const t1 = active || void 0;
|
|
1800
|
+
let t2;
|
|
1801
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1802
|
+
t2 = /* @__PURE__ */ jsx(PinIcon, {});
|
|
1803
|
+
$[0] = t2;
|
|
1804
|
+
} else t2 = $[0];
|
|
1805
|
+
let t3;
|
|
1806
|
+
if ($[1] !== actionLabel || $[2] !== active || $[3] !== classNames.columnMenuPin || $[4] !== onClick || $[5] !== t1) {
|
|
1807
|
+
t3 = /* @__PURE__ */ jsx("button", {
|
|
1808
|
+
type: "button",
|
|
1809
|
+
"data-adapttable-part": "column-menu-pin",
|
|
1810
|
+
"data-active": t1,
|
|
1811
|
+
"aria-pressed": active,
|
|
1812
|
+
"aria-label": actionLabel,
|
|
1813
|
+
className: classNames.columnMenuPin,
|
|
1814
|
+
onClick,
|
|
1815
|
+
children: t2
|
|
1816
|
+
});
|
|
1817
|
+
$[1] = actionLabel;
|
|
1818
|
+
$[2] = active;
|
|
1819
|
+
$[3] = classNames.columnMenuPin;
|
|
1820
|
+
$[4] = onClick;
|
|
1821
|
+
$[5] = t1;
|
|
1822
|
+
$[6] = t3;
|
|
1823
|
+
} else t3 = $[6];
|
|
1824
|
+
return t3;
|
|
879
1825
|
}
|
|
880
|
-
function ColumnMenuRowItem(
|
|
1826
|
+
function ColumnMenuRowItem(t0) {
|
|
1827
|
+
const $ = c(58);
|
|
1828
|
+
const { row, layout, labels, classNames, drag } = t0;
|
|
881
1829
|
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
|
-
|
|
1830
|
+
const t1 = hidden || void 0;
|
|
1831
|
+
const t2 = classNames.columnMenuItem;
|
|
1832
|
+
let t3;
|
|
1833
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1834
|
+
t3 = { cursor: "grab" };
|
|
1835
|
+
$[0] = t3;
|
|
1836
|
+
} else t3 = $[0];
|
|
1837
|
+
let t4;
|
|
1838
|
+
if ($[1] !== drag || $[2] !== index || $[3] !== key) {
|
|
1839
|
+
t4 = drag.rowDragProps(key, index);
|
|
1840
|
+
$[1] = drag;
|
|
1841
|
+
$[2] = index;
|
|
1842
|
+
$[3] = key;
|
|
1843
|
+
$[4] = t4;
|
|
1844
|
+
} else t4 = $[4];
|
|
1845
|
+
let t5;
|
|
1846
|
+
if ($[5] !== drag || $[6] !== index || $[7] !== layout.move) {
|
|
1847
|
+
t5 = drag.dropProps(index, layout.move);
|
|
1848
|
+
$[5] = drag;
|
|
1849
|
+
$[6] = index;
|
|
1850
|
+
$[7] = layout.move;
|
|
1851
|
+
$[8] = t5;
|
|
1852
|
+
} else t5 = $[8];
|
|
1853
|
+
let t6;
|
|
1854
|
+
if ($[9] !== drag || $[10] !== index || $[11] !== key) {
|
|
1855
|
+
t6 = drag.rowAttrs(key, index);
|
|
1856
|
+
$[9] = drag;
|
|
1857
|
+
$[10] = index;
|
|
1858
|
+
$[11] = key;
|
|
1859
|
+
$[12] = t6;
|
|
1860
|
+
} else t6 = $[12];
|
|
1861
|
+
const t7 = classNames.columnMenuGrip;
|
|
1862
|
+
const t8 = `${labels.moveLeft} / ${labels.moveRight}: ${name}`;
|
|
1863
|
+
let t9;
|
|
1864
|
+
if ($[13] !== index || $[14] !== key || $[15] !== layout.move || $[16] !== t8) {
|
|
1865
|
+
t9 = columnReorderKeyProps(key, index, layout.move, t8);
|
|
1866
|
+
$[13] = index;
|
|
1867
|
+
$[14] = key;
|
|
1868
|
+
$[15] = layout.move;
|
|
1869
|
+
$[16] = t8;
|
|
1870
|
+
$[17] = t9;
|
|
1871
|
+
} else t9 = $[17];
|
|
1872
|
+
let t10;
|
|
1873
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1874
|
+
t10 = /* @__PURE__ */ jsx(GripIcon, {});
|
|
1875
|
+
$[18] = t10;
|
|
1876
|
+
} else t10 = $[18];
|
|
1877
|
+
let t11;
|
|
1878
|
+
if ($[19] !== classNames.columnMenuGrip || $[20] !== t9) {
|
|
1879
|
+
t11 = /* @__PURE__ */ jsx("span", {
|
|
1880
|
+
"data-adapttable-part": "column-menu-grip",
|
|
1881
|
+
className: t7,
|
|
1882
|
+
...t9,
|
|
1883
|
+
children: t10
|
|
1884
|
+
});
|
|
1885
|
+
$[19] = classNames.columnMenuGrip;
|
|
1886
|
+
$[20] = t9;
|
|
1887
|
+
$[21] = t11;
|
|
1888
|
+
} else t11 = $[21];
|
|
1889
|
+
let t12;
|
|
1890
|
+
if ($[22] !== key || $[23] !== layout) {
|
|
1891
|
+
t12 = () => layout.toggleVisible(key);
|
|
1892
|
+
$[22] = key;
|
|
1893
|
+
$[23] = layout;
|
|
1894
|
+
$[24] = t12;
|
|
1895
|
+
} else t12 = $[24];
|
|
1896
|
+
let t13;
|
|
1897
|
+
if ($[25] !== classNames || $[26] !== hidden || $[27] !== labels || $[28] !== name || $[29] !== t12) {
|
|
1898
|
+
t13 = /* @__PURE__ */ jsx(VisibilityToggle, {
|
|
1899
|
+
hidden,
|
|
1900
|
+
name,
|
|
1901
|
+
labels,
|
|
1902
|
+
classNames,
|
|
1903
|
+
onToggle: t12
|
|
1904
|
+
});
|
|
1905
|
+
$[25] = classNames;
|
|
1906
|
+
$[26] = hidden;
|
|
1907
|
+
$[27] = labels;
|
|
1908
|
+
$[28] = name;
|
|
1909
|
+
$[29] = t12;
|
|
1910
|
+
$[30] = t13;
|
|
1911
|
+
} else t13 = $[30];
|
|
1912
|
+
let t14;
|
|
1913
|
+
if ($[31] !== classNames || $[32] !== hidden || $[33] !== name) {
|
|
1914
|
+
t14 = /* @__PURE__ */ jsx(RowName, {
|
|
1915
|
+
hidden,
|
|
1916
|
+
name,
|
|
1917
|
+
classNames
|
|
1918
|
+
});
|
|
1919
|
+
$[31] = classNames;
|
|
1920
|
+
$[32] = hidden;
|
|
1921
|
+
$[33] = name;
|
|
1922
|
+
$[34] = t14;
|
|
1923
|
+
} else t14 = $[34];
|
|
1924
|
+
const t15 = pinned !== void 0;
|
|
1925
|
+
let t16;
|
|
1926
|
+
if ($[35] !== labels || $[36] !== pinned) {
|
|
1927
|
+
t16 = pinActionLabel(pinned, labels);
|
|
1928
|
+
$[35] = labels;
|
|
1929
|
+
$[36] = pinned;
|
|
1930
|
+
$[37] = t16;
|
|
1931
|
+
} else t16 = $[37];
|
|
1932
|
+
const t17 = `${t16}: ${name}`;
|
|
1933
|
+
let t18;
|
|
1934
|
+
if ($[38] !== key || $[39] !== layout || $[40] !== pinned) {
|
|
1935
|
+
t18 = () => layout.setPinned(key, nextPinSide(pinned));
|
|
1936
|
+
$[38] = key;
|
|
1937
|
+
$[39] = layout;
|
|
1938
|
+
$[40] = pinned;
|
|
1939
|
+
$[41] = t18;
|
|
1940
|
+
} else t18 = $[41];
|
|
1941
|
+
let t19;
|
|
1942
|
+
if ($[42] !== classNames || $[43] !== t15 || $[44] !== t17 || $[45] !== t18) {
|
|
1943
|
+
t19 = /* @__PURE__ */ jsx(PinToggle, {
|
|
1944
|
+
active: t15,
|
|
1945
|
+
actionLabel: t17,
|
|
1946
|
+
classNames,
|
|
1947
|
+
onClick: t18
|
|
1948
|
+
});
|
|
1949
|
+
$[42] = classNames;
|
|
1950
|
+
$[43] = t15;
|
|
1951
|
+
$[44] = t17;
|
|
1952
|
+
$[45] = t18;
|
|
1953
|
+
$[46] = t19;
|
|
1954
|
+
} else t19 = $[46];
|
|
1955
|
+
let t20;
|
|
1956
|
+
if ($[47] !== classNames.columnMenuItem || $[48] !== pinned || $[49] !== t1 || $[50] !== t11 || $[51] !== t13 || $[52] !== t14 || $[53] !== t19 || $[54] !== t4 || $[55] !== t5 || $[56] !== t6) {
|
|
1957
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
1958
|
+
"data-adapttable-part": "column-menu-item",
|
|
1959
|
+
"data-hidden": t1,
|
|
1960
|
+
"data-pinned": pinned,
|
|
1961
|
+
className: t2,
|
|
1962
|
+
style: t3,
|
|
1963
|
+
...t4,
|
|
1964
|
+
...t5,
|
|
1965
|
+
...t6,
|
|
1966
|
+
children: [
|
|
1967
|
+
t11,
|
|
1968
|
+
t13,
|
|
1969
|
+
t14,
|
|
1970
|
+
t19
|
|
1971
|
+
]
|
|
1972
|
+
});
|
|
1973
|
+
$[47] = classNames.columnMenuItem;
|
|
1974
|
+
$[48] = pinned;
|
|
1975
|
+
$[49] = t1;
|
|
1976
|
+
$[50] = t11;
|
|
1977
|
+
$[51] = t13;
|
|
1978
|
+
$[52] = t14;
|
|
1979
|
+
$[53] = t19;
|
|
1980
|
+
$[54] = t4;
|
|
1981
|
+
$[55] = t5;
|
|
1982
|
+
$[56] = t6;
|
|
1983
|
+
$[57] = t20;
|
|
1984
|
+
} else t20 = $[57];
|
|
1985
|
+
return t20;
|
|
918
1986
|
}
|
|
919
1987
|
/**
|
|
920
1988
|
* The injected row-actions column as a first-class menu row: the same eye
|
|
921
1989
|
* toggle as a data column plus a ONE-CLICK end-pin toggle (right ↔ unpinned).
|
|
922
1990
|
* The column always trails, so there is no left pin and no reorder grip.
|
|
923
1991
|
*/
|
|
924
|
-
function ActionsMenuRowItem(
|
|
925
|
-
const
|
|
1992
|
+
function ActionsMenuRowItem(t0) {
|
|
1993
|
+
const $ = c(29);
|
|
1994
|
+
const { layout, labels, classNames } = t0;
|
|
1995
|
+
let t1;
|
|
1996
|
+
if ($[0] !== layout) {
|
|
1997
|
+
t1 = layout.isHidden(ACTIONS_COLUMN_KEY);
|
|
1998
|
+
$[0] = layout;
|
|
1999
|
+
$[1] = t1;
|
|
2000
|
+
} else t1 = $[1];
|
|
2001
|
+
const hidden = t1;
|
|
926
2002
|
const pinned = layout.state.pinned[ACTIONS_COLUMN_KEY] !== void 0;
|
|
927
2003
|
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
|
-
|
|
2004
|
+
const t2 = hidden || void 0;
|
|
2005
|
+
const t3 = pinned ? "right" : void 0;
|
|
2006
|
+
let t4;
|
|
2007
|
+
if ($[2] !== layout) {
|
|
2008
|
+
t4 = () => layout.toggleVisible(ACTIONS_COLUMN_KEY);
|
|
2009
|
+
$[2] = layout;
|
|
2010
|
+
$[3] = t4;
|
|
2011
|
+
} else t4 = $[3];
|
|
2012
|
+
let t5;
|
|
2013
|
+
if ($[4] !== classNames || $[5] !== hidden || $[6] !== labels || $[7] !== name || $[8] !== t4) {
|
|
2014
|
+
t5 = /* @__PURE__ */ jsx(VisibilityToggle, {
|
|
2015
|
+
hidden,
|
|
2016
|
+
name,
|
|
2017
|
+
labels,
|
|
2018
|
+
classNames,
|
|
2019
|
+
onToggle: t4
|
|
2020
|
+
});
|
|
2021
|
+
$[4] = classNames;
|
|
2022
|
+
$[5] = hidden;
|
|
2023
|
+
$[6] = labels;
|
|
2024
|
+
$[7] = name;
|
|
2025
|
+
$[8] = t4;
|
|
2026
|
+
$[9] = t5;
|
|
2027
|
+
} else t5 = $[9];
|
|
2028
|
+
let t6;
|
|
2029
|
+
if ($[10] !== classNames || $[11] !== hidden || $[12] !== name) {
|
|
2030
|
+
t6 = /* @__PURE__ */ jsx(RowName, {
|
|
2031
|
+
hidden,
|
|
2032
|
+
name,
|
|
2033
|
+
classNames
|
|
2034
|
+
});
|
|
2035
|
+
$[10] = classNames;
|
|
2036
|
+
$[11] = hidden;
|
|
2037
|
+
$[12] = name;
|
|
2038
|
+
$[13] = t6;
|
|
2039
|
+
} else t6 = $[13];
|
|
2040
|
+
const t7 = `${pinned ? labels.unpin : labels.pinRight}: ${name}`;
|
|
2041
|
+
let t8;
|
|
2042
|
+
if ($[14] !== layout || $[15] !== pinned) {
|
|
2043
|
+
t8 = () => layout.setPinned(ACTIONS_COLUMN_KEY, pinned ? void 0 : "right");
|
|
2044
|
+
$[14] = layout;
|
|
2045
|
+
$[15] = pinned;
|
|
2046
|
+
$[16] = t8;
|
|
2047
|
+
} else t8 = $[16];
|
|
2048
|
+
let t9;
|
|
2049
|
+
if ($[17] !== classNames || $[18] !== pinned || $[19] !== t7 || $[20] !== t8) {
|
|
2050
|
+
t9 = /* @__PURE__ */ jsx(PinToggle, {
|
|
2051
|
+
active: pinned,
|
|
2052
|
+
actionLabel: t7,
|
|
2053
|
+
classNames,
|
|
2054
|
+
onClick: t8
|
|
2055
|
+
});
|
|
2056
|
+
$[17] = classNames;
|
|
2057
|
+
$[18] = pinned;
|
|
2058
|
+
$[19] = t7;
|
|
2059
|
+
$[20] = t8;
|
|
2060
|
+
$[21] = t9;
|
|
2061
|
+
} else t9 = $[21];
|
|
2062
|
+
let t10;
|
|
2063
|
+
if ($[22] !== classNames.columnMenuItem || $[23] !== t2 || $[24] !== t3 || $[25] !== t5 || $[26] !== t6 || $[27] !== t9) {
|
|
2064
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
2065
|
+
"data-adapttable-part": "column-menu-item",
|
|
2066
|
+
"data-actions": "",
|
|
2067
|
+
"data-hidden": t2,
|
|
2068
|
+
"data-pinned": t3,
|
|
2069
|
+
className: classNames.columnMenuItem,
|
|
2070
|
+
children: [
|
|
2071
|
+
t5,
|
|
2072
|
+
t6,
|
|
2073
|
+
t9
|
|
2074
|
+
]
|
|
2075
|
+
});
|
|
2076
|
+
$[22] = classNames.columnMenuItem;
|
|
2077
|
+
$[23] = t2;
|
|
2078
|
+
$[24] = t3;
|
|
2079
|
+
$[25] = t5;
|
|
2080
|
+
$[26] = t6;
|
|
2081
|
+
$[27] = t9;
|
|
2082
|
+
$[28] = t10;
|
|
2083
|
+
} else t10 = $[28];
|
|
2084
|
+
return t10;
|
|
955
2085
|
}
|
|
956
2086
|
/**
|
|
957
2087
|
* Column-management popover: a disclosure button + a panel where each column
|
|
@@ -959,29 +2089,56 @@ function ActionsMenuRowItem({ layout, labels, classNames }) {
|
|
|
959
2089
|
* Closes on outside-click or Escape. Ships no styles — target the
|
|
960
2090
|
* `data-adapttable-part` hooks or the `columnMenu*` className slots.
|
|
961
2091
|
*/
|
|
962
|
-
function ColumnMenu(
|
|
2092
|
+
function ColumnMenu(t0) {
|
|
2093
|
+
const $ = c(24);
|
|
2094
|
+
const { allColumns, layout, labels, classNames, hasRowActions } = t0;
|
|
963
2095
|
const drag = useColumnDragState();
|
|
964
2096
|
const { open, setOpen, rootRef, triggerRef } = useMenuPopover();
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
2097
|
+
let t1;
|
|
2098
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2099
|
+
t1 = { position: "relative" };
|
|
2100
|
+
$[0] = t1;
|
|
2101
|
+
} else t1 = $[0];
|
|
2102
|
+
const t2 = open || void 0;
|
|
2103
|
+
let t3;
|
|
2104
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2105
|
+
t3 = {
|
|
2106
|
+
flexShrink: 0,
|
|
2107
|
+
whiteSpace: "nowrap"
|
|
2108
|
+
};
|
|
2109
|
+
$[1] = t3;
|
|
2110
|
+
} else t3 = $[1];
|
|
2111
|
+
let t4;
|
|
2112
|
+
if ($[2] !== setOpen) {
|
|
2113
|
+
t4 = () => setOpen(_temp);
|
|
2114
|
+
$[2] = setOpen;
|
|
2115
|
+
$[3] = t4;
|
|
2116
|
+
} else t4 = $[3];
|
|
2117
|
+
let t5;
|
|
2118
|
+
if ($[4] !== classNames.columnMenuButton || $[5] !== labels.columns || $[6] !== open || $[7] !== t2 || $[8] !== t4 || $[9] !== triggerRef) {
|
|
2119
|
+
t5 = /* @__PURE__ */ jsx("button", {
|
|
971
2120
|
ref: triggerRef,
|
|
972
2121
|
type: "button",
|
|
973
2122
|
"aria-expanded": open,
|
|
974
2123
|
"aria-haspopup": "true",
|
|
975
2124
|
"data-adapttable-part": "column-menu-button",
|
|
976
|
-
"data-active":
|
|
2125
|
+
"data-active": t2,
|
|
977
2126
|
className: classNames.columnMenuButton,
|
|
978
|
-
style:
|
|
979
|
-
|
|
980
|
-
whiteSpace: "nowrap"
|
|
981
|
-
},
|
|
982
|
-
onClick: () => setOpen((v) => !v),
|
|
2127
|
+
style: t3,
|
|
2128
|
+
onClick: t4,
|
|
983
2129
|
children: labels.columns
|
|
984
|
-
})
|
|
2130
|
+
});
|
|
2131
|
+
$[4] = classNames.columnMenuButton;
|
|
2132
|
+
$[5] = labels.columns;
|
|
2133
|
+
$[6] = open;
|
|
2134
|
+
$[7] = t2;
|
|
2135
|
+
$[8] = t4;
|
|
2136
|
+
$[9] = triggerRef;
|
|
2137
|
+
$[10] = t5;
|
|
2138
|
+
} else t5 = $[10];
|
|
2139
|
+
let t6;
|
|
2140
|
+
if ($[11] !== allColumns || $[12] !== classNames || $[13] !== drag || $[14] !== hasRowActions || $[15] !== labels || $[16] !== layout || $[17] !== open) {
|
|
2141
|
+
t6 = open && /* @__PURE__ */ jsxs("fieldset", {
|
|
985
2142
|
"aria-label": labels.columns,
|
|
986
2143
|
"data-adapttable-part": "column-menu-panel",
|
|
987
2144
|
className: classNames.columnMenuPanel,
|
|
@@ -1019,8 +2176,35 @@ function ColumnMenu({ allColumns, layout, labels, classNames, hasRowActions }) {
|
|
|
1019
2176
|
children: labels.resetColumns
|
|
1020
2177
|
})
|
|
1021
2178
|
]
|
|
1022
|
-
})
|
|
1023
|
-
|
|
2179
|
+
});
|
|
2180
|
+
$[11] = allColumns;
|
|
2181
|
+
$[12] = classNames;
|
|
2182
|
+
$[13] = drag;
|
|
2183
|
+
$[14] = hasRowActions;
|
|
2184
|
+
$[15] = labels;
|
|
2185
|
+
$[16] = layout;
|
|
2186
|
+
$[17] = open;
|
|
2187
|
+
$[18] = t6;
|
|
2188
|
+
} else t6 = $[18];
|
|
2189
|
+
let t7;
|
|
2190
|
+
if ($[19] !== classNames.columnMenu || $[20] !== rootRef || $[21] !== t5 || $[22] !== t6) {
|
|
2191
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
2192
|
+
ref: rootRef,
|
|
2193
|
+
"data-adapttable-part": "column-menu",
|
|
2194
|
+
className: classNames.columnMenu,
|
|
2195
|
+
style: t1,
|
|
2196
|
+
children: [t5, t6]
|
|
2197
|
+
});
|
|
2198
|
+
$[19] = classNames.columnMenu;
|
|
2199
|
+
$[20] = rootRef;
|
|
2200
|
+
$[21] = t5;
|
|
2201
|
+
$[22] = t6;
|
|
2202
|
+
$[23] = t7;
|
|
2203
|
+
} else t7 = $[23];
|
|
2204
|
+
return t7;
|
|
2205
|
+
}
|
|
2206
|
+
function _temp(v) {
|
|
2207
|
+
return !v;
|
|
1024
2208
|
}
|
|
1025
2209
|
//#endregion
|
|
1026
2210
|
//#region src/components/tables.tsx
|
|
@@ -1052,46 +2236,100 @@ function scrollBoxStyle(maxHeight, scrollX) {
|
|
|
1052
2236
|
};
|
|
1053
2237
|
return scrollX ? { overflowX: "auto" } : void 0;
|
|
1054
2238
|
}
|
|
1055
|
-
function RowActionButtons(
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
2239
|
+
function RowActionButtons(t0) {
|
|
2240
|
+
const $ = c(13);
|
|
2241
|
+
const { row, actions, confirm, cancelLabel, classNames } = t0;
|
|
2242
|
+
let t1;
|
|
2243
|
+
if ($[0] !== actions || $[1] !== cancelLabel || $[2] !== classNames || $[3] !== confirm || $[4] !== row) {
|
|
2244
|
+
let t2;
|
|
2245
|
+
if ($[6] !== cancelLabel || $[7] !== classNames || $[8] !== confirm || $[9] !== row) {
|
|
2246
|
+
t2 = (action) => {
|
|
2247
|
+
if (action.isHidden?.(row)) return null;
|
|
2248
|
+
const reason = resolveDisabledReason(action.disabledReason?.(row));
|
|
2249
|
+
const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
|
|
2250
|
+
const handleClick = disabled ? void 0 : (e) => {
|
|
2251
|
+
e.stopPropagation();
|
|
2252
|
+
runRowAction(action, row, confirm, cancelLabel);
|
|
2253
|
+
};
|
|
2254
|
+
return /* @__PURE__ */ jsx("button", {
|
|
2255
|
+
type: "button",
|
|
2256
|
+
disabled,
|
|
2257
|
+
title: reason,
|
|
2258
|
+
"aria-label": action.label,
|
|
2259
|
+
"data-adapttable-part": "action-button",
|
|
2260
|
+
"data-color": action.color,
|
|
2261
|
+
className: classNames.actionButton,
|
|
2262
|
+
onClick: handleClick,
|
|
2263
|
+
children: action.icon ?? action.label
|
|
2264
|
+
}, action.key);
|
|
2265
|
+
};
|
|
2266
|
+
$[6] = cancelLabel;
|
|
2267
|
+
$[7] = classNames;
|
|
2268
|
+
$[8] = confirm;
|
|
2269
|
+
$[9] = row;
|
|
2270
|
+
$[10] = t2;
|
|
2271
|
+
} else t2 = $[10];
|
|
2272
|
+
t1 = actions.map(t2);
|
|
2273
|
+
$[0] = actions;
|
|
2274
|
+
$[1] = cancelLabel;
|
|
2275
|
+
$[2] = classNames;
|
|
2276
|
+
$[3] = confirm;
|
|
2277
|
+
$[4] = row;
|
|
2278
|
+
$[5] = t1;
|
|
2279
|
+
} else t1 = $[5];
|
|
2280
|
+
let t2;
|
|
2281
|
+
if ($[11] !== t1) {
|
|
2282
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
2283
|
+
$[11] = t1;
|
|
2284
|
+
$[12] = t2;
|
|
2285
|
+
} else t2 = $[12];
|
|
2286
|
+
return t2;
|
|
1076
2287
|
}
|
|
1077
2288
|
/**
|
|
1078
2289
|
* The expand/collapse chevron, shared by desktop rows and mobile cards. The
|
|
1079
2290
|
* `data-expanded` attribute is the styling hook for rotating the glyph
|
|
1080
2291
|
* (`rowClickProps`' interactive-child guard keeps the click off the row).
|
|
1081
2292
|
*/
|
|
1082
|
-
function ExpandButton(
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
2293
|
+
function ExpandButton(t0) {
|
|
2294
|
+
const $ = c(7);
|
|
2295
|
+
const { expanded, labels, classNames, onToggle } = t0;
|
|
2296
|
+
const t1 = expanded ? "" : void 0;
|
|
2297
|
+
const t2 = expanded ? labels.collapseRow : labels.expandRow;
|
|
2298
|
+
let t3;
|
|
2299
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2300
|
+
t3 = /* @__PURE__ */ jsx(ChevronIcon, { size: 14 });
|
|
2301
|
+
$[0] = t3;
|
|
2302
|
+
} else t3 = $[0];
|
|
2303
|
+
let t4;
|
|
2304
|
+
if ($[1] !== classNames.expandButton || $[2] !== expanded || $[3] !== onToggle || $[4] !== t1 || $[5] !== t2) {
|
|
2305
|
+
t4 = /* @__PURE__ */ jsx("button", {
|
|
2306
|
+
type: "button",
|
|
2307
|
+
"data-adapttable-part": "expand-button",
|
|
2308
|
+
"data-expanded": t1,
|
|
2309
|
+
className: classNames.expandButton,
|
|
2310
|
+
"aria-expanded": expanded,
|
|
2311
|
+
"aria-label": t2,
|
|
2312
|
+
onClick: onToggle,
|
|
2313
|
+
children: t3
|
|
2314
|
+
});
|
|
2315
|
+
$[1] = classNames.expandButton;
|
|
2316
|
+
$[2] = expanded;
|
|
2317
|
+
$[3] = onToggle;
|
|
2318
|
+
$[4] = t1;
|
|
2319
|
+
$[5] = t2;
|
|
2320
|
+
$[6] = t4;
|
|
2321
|
+
} else t4 = $[6];
|
|
2322
|
+
return t4;
|
|
1093
2323
|
}
|
|
1094
2324
|
/**
|
|
2325
|
+
* Props for the memoized desktop row. The comparator below checks ONLY the
|
|
2326
|
+
* visual inputs (row data, selected/expanded state, column + width + class
|
|
2327
|
+
* identities, the pin signature); everything else — `table`, the latest-ref
|
|
2328
|
+
* callback wrappers, `confirm`, `pinOffset`, `measureElement` — is either
|
|
2329
|
+
* stable or only consulted when one of the compared inputs re-renders the
|
|
2330
|
+
* row, so a fresh identity there must not (and does not) defeat the memo.
|
|
2331
|
+
*/
|
|
2332
|
+
/**
|
|
1095
2333
|
* `React.memo` comparator: re-render a row only when one of its VISUAL
|
|
1096
2334
|
* inputs changes. A search keystroke or another row's checkbox re-renders
|
|
1097
2335
|
* the table shell, but every unchanged row bails out here (accessors and
|
|
@@ -1101,26 +2339,70 @@ function desktopRowPropsEqual(prev, next) {
|
|
|
1101
2339
|
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.hasLeftPin === next.hasLeftPin && prev.hasRightPin === next.hasRightPin && prev.actionsPinned === next.actionsPinned && prev.rowClass === next.rowClass && prev.clickable === next.clickable && prev.hasPrefetch === next.hasPrefetch;
|
|
1102
2340
|
}
|
|
1103
2341
|
function DesktopRowBase(props) {
|
|
2342
|
+
const $ = c(98);
|
|
1104
2343
|
const { row, index, id, table, columns, labels, classNames, selected, expanded, showActions, rowActions, confirm, columnSpan, pinOffset, hasLeftPin, hasRightPin, actionsPinned, rowClass, clickable, hasPrefetch, onRowClick, onPrefetch, onToggleSelect, onToggleExpand, renderDetail, measureElement } = props;
|
|
1105
2344
|
const expandable = expanded !== void 0;
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
2345
|
+
const t0 = selected === void 0 ? 0 : SELECTION_WIDTH;
|
|
2346
|
+
const t1 = showActions ? ACTIONS_WIDTH : 0;
|
|
2347
|
+
let t10;
|
|
2348
|
+
let t11;
|
|
2349
|
+
let t12;
|
|
2350
|
+
let t2;
|
|
2351
|
+
let t3;
|
|
2352
|
+
let t4;
|
|
2353
|
+
let t5;
|
|
2354
|
+
let t6;
|
|
2355
|
+
let t7;
|
|
2356
|
+
let t8;
|
|
2357
|
+
let t9;
|
|
2358
|
+
if ($[0] !== classNames || $[1] !== clickable || $[2] !== columns || $[3] !== expandable || $[4] !== expanded || $[5] !== hasLeftPin || $[6] !== hasPrefetch || $[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) {
|
|
2359
|
+
const leads = {
|
|
2360
|
+
left: t0,
|
|
2361
|
+
right: t1
|
|
2362
|
+
};
|
|
2363
|
+
const bodyPinStyle = (key) => pinnedCellStyle(pinOffset?.(key), PIN_Z.body, leads);
|
|
2364
|
+
let t13;
|
|
2365
|
+
if ($[33] !== index || $[34] !== row || $[35] !== table) {
|
|
2366
|
+
t13 = table.getRowProps(row, index);
|
|
2367
|
+
$[33] = index;
|
|
2368
|
+
$[34] = row;
|
|
2369
|
+
$[35] = table;
|
|
2370
|
+
$[36] = t13;
|
|
2371
|
+
} else t13 = $[36];
|
|
2372
|
+
let rowProps;
|
|
2373
|
+
if ($[37] !== t13) {
|
|
2374
|
+
rowProps = { ...t13 };
|
|
2375
|
+
delete rowProps.key;
|
|
2376
|
+
$[37] = t13;
|
|
2377
|
+
$[38] = rowProps;
|
|
2378
|
+
} else rowProps = $[38];
|
|
2379
|
+
t2 = rowProps;
|
|
2380
|
+
const t14 = clickable ? onRowClick : void 0;
|
|
2381
|
+
if ($[39] !== row || $[40] !== t14) {
|
|
2382
|
+
t3 = rowClickProps(row, t14);
|
|
2383
|
+
$[39] = row;
|
|
2384
|
+
$[40] = t14;
|
|
2385
|
+
$[41] = t3;
|
|
2386
|
+
} else t3 = $[41];
|
|
2387
|
+
t4 = measureElement;
|
|
2388
|
+
t5 = "row";
|
|
2389
|
+
t6 = selected ? "" : void 0;
|
|
2390
|
+
t7 = clickable ? "" : void 0;
|
|
2391
|
+
if ($[42] !== classNames.row || $[43] !== rowClass) {
|
|
2392
|
+
t8 = cx(classNames.row, rowClass);
|
|
2393
|
+
$[42] = classNames.row;
|
|
2394
|
+
$[43] = rowClass;
|
|
2395
|
+
$[44] = t8;
|
|
2396
|
+
} else t8 = $[44];
|
|
2397
|
+
if ($[45] !== hasPrefetch || $[46] !== onPrefetch || $[47] !== row) {
|
|
2398
|
+
t9 = hasPrefetch ? () => onPrefetch(row) : void 0;
|
|
2399
|
+
$[45] = hasPrefetch;
|
|
2400
|
+
$[46] = onPrefetch;
|
|
2401
|
+
$[47] = row;
|
|
2402
|
+
$[48] = t9;
|
|
2403
|
+
} else t9 = $[48];
|
|
2404
|
+
if ($[49] !== classNames || $[50] !== expandable || $[51] !== expanded || $[52] !== id || $[53] !== labels || $[54] !== onToggleExpand) {
|
|
2405
|
+
t10 = expandable && /* @__PURE__ */ jsx("td", {
|
|
1124
2406
|
"data-adapttable-part": "expand-cell",
|
|
1125
2407
|
className: classNames.expandCell,
|
|
1126
2408
|
children: /* @__PURE__ */ jsx(ExpandButton, {
|
|
@@ -1129,8 +2411,17 @@ function DesktopRowBase(props) {
|
|
|
1129
2411
|
classNames,
|
|
1130
2412
|
onToggle: () => onToggleExpand(id)
|
|
1131
2413
|
})
|
|
1132
|
-
})
|
|
1133
|
-
|
|
2414
|
+
});
|
|
2415
|
+
$[49] = classNames;
|
|
2416
|
+
$[50] = expandable;
|
|
2417
|
+
$[51] = expanded;
|
|
2418
|
+
$[52] = id;
|
|
2419
|
+
$[53] = labels;
|
|
2420
|
+
$[54] = onToggleExpand;
|
|
2421
|
+
$[55] = t10;
|
|
2422
|
+
} else t10 = $[55];
|
|
2423
|
+
if ($[56] !== classNames.cell || $[57] !== classNames.checkbox || $[58] !== classNames.selectionCell || $[59] !== hasLeftPin || $[60] !== id || $[61] !== labels || $[62] !== onToggleSelect || $[63] !== selected) {
|
|
2424
|
+
t11 = selected !== void 0 && /* @__PURE__ */ jsx("td", {
|
|
1134
2425
|
"data-adapttable-part": "selection-cell",
|
|
1135
2426
|
"data-pinned": hasLeftPin ? "left" : void 0,
|
|
1136
2427
|
style: edgePinStyle("left", hasLeftPin, PIN_Z.body),
|
|
@@ -1142,44 +2433,162 @@ function DesktopRowBase(props) {
|
|
|
1142
2433
|
onChange: () => onToggleSelect(id),
|
|
1143
2434
|
className: classNames.checkbox
|
|
1144
2435
|
})
|
|
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, {
|
|
2436
|
+
});
|
|
2437
|
+
$[56] = classNames.cell;
|
|
2438
|
+
$[57] = classNames.checkbox;
|
|
2439
|
+
$[58] = classNames.selectionCell;
|
|
2440
|
+
$[59] = hasLeftPin;
|
|
2441
|
+
$[60] = id;
|
|
2442
|
+
$[61] = labels;
|
|
2443
|
+
$[62] = onToggleSelect;
|
|
2444
|
+
$[63] = selected;
|
|
2445
|
+
$[64] = t11;
|
|
2446
|
+
} else t11 = $[64];
|
|
2447
|
+
t12 = columns.map((column) => {
|
|
2448
|
+
const pinStyle = bodyPinStyle(column.key);
|
|
2449
|
+
return /* @__PURE__ */ jsx("td", {
|
|
2450
|
+
...table.getCellProps(column, pinStyle && { style: pinStyle }),
|
|
2451
|
+
"data-adapttable-part": "cell",
|
|
2452
|
+
"data-pinned": pinOffset?.(column.key)?.side,
|
|
2453
|
+
className: classNames.cell,
|
|
2454
|
+
children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
|
|
1165
2455
|
row,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
2456
|
+
rowIndex: index
|
|
2457
|
+
}) : column.accessor?.(row)
|
|
2458
|
+
}, column.key);
|
|
2459
|
+
});
|
|
2460
|
+
$[0] = classNames;
|
|
2461
|
+
$[1] = clickable;
|
|
2462
|
+
$[2] = columns;
|
|
2463
|
+
$[3] = expandable;
|
|
2464
|
+
$[4] = expanded;
|
|
2465
|
+
$[5] = hasLeftPin;
|
|
2466
|
+
$[6] = hasPrefetch;
|
|
2467
|
+
$[7] = id;
|
|
2468
|
+
$[8] = index;
|
|
2469
|
+
$[9] = labels;
|
|
2470
|
+
$[10] = measureElement;
|
|
2471
|
+
$[11] = onPrefetch;
|
|
2472
|
+
$[12] = onRowClick;
|
|
2473
|
+
$[13] = onToggleExpand;
|
|
2474
|
+
$[14] = onToggleSelect;
|
|
2475
|
+
$[15] = pinOffset;
|
|
2476
|
+
$[16] = row;
|
|
2477
|
+
$[17] = rowClass;
|
|
2478
|
+
$[18] = selected;
|
|
2479
|
+
$[19] = t0;
|
|
2480
|
+
$[20] = t1;
|
|
2481
|
+
$[21] = table;
|
|
2482
|
+
$[22] = t10;
|
|
2483
|
+
$[23] = t11;
|
|
2484
|
+
$[24] = t12;
|
|
2485
|
+
$[25] = t2;
|
|
2486
|
+
$[26] = t3;
|
|
2487
|
+
$[27] = t4;
|
|
2488
|
+
$[28] = t5;
|
|
2489
|
+
$[29] = t6;
|
|
2490
|
+
$[30] = t7;
|
|
2491
|
+
$[31] = t8;
|
|
2492
|
+
$[32] = t9;
|
|
2493
|
+
} else {
|
|
2494
|
+
t10 = $[22];
|
|
2495
|
+
t11 = $[23];
|
|
2496
|
+
t12 = $[24];
|
|
2497
|
+
t2 = $[25];
|
|
2498
|
+
t3 = $[26];
|
|
2499
|
+
t4 = $[27];
|
|
2500
|
+
t5 = $[28];
|
|
2501
|
+
t6 = $[29];
|
|
2502
|
+
t7 = $[30];
|
|
2503
|
+
t8 = $[31];
|
|
2504
|
+
t9 = $[32];
|
|
2505
|
+
}
|
|
2506
|
+
let t13;
|
|
2507
|
+
if ($[65] !== actionsPinned || $[66] !== classNames || $[67] !== confirm || $[68] !== hasRightPin || $[69] !== labels || $[70] !== row || $[71] !== rowActions || $[72] !== showActions) {
|
|
2508
|
+
t13 = showActions && /* @__PURE__ */ jsx("td", {
|
|
2509
|
+
"data-adapttable-part": "actions-cell",
|
|
2510
|
+
"data-pinned": hasRightPin || actionsPinned ? "right" : void 0,
|
|
2511
|
+
style: edgePinStyle("right", hasRightPin || actionsPinned, PIN_Z.body),
|
|
2512
|
+
className: cx(classNames.cell, classNames.actionsCell),
|
|
2513
|
+
children: /* @__PURE__ */ jsx(RowActionButtons, {
|
|
2514
|
+
row,
|
|
2515
|
+
actions: rowActions,
|
|
2516
|
+
confirm,
|
|
2517
|
+
cancelLabel: labels.cancel,
|
|
2518
|
+
classNames
|
|
1171
2519
|
})
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
}
|
|
2520
|
+
});
|
|
2521
|
+
$[65] = actionsPinned;
|
|
2522
|
+
$[66] = classNames;
|
|
2523
|
+
$[67] = confirm;
|
|
2524
|
+
$[68] = hasRightPin;
|
|
2525
|
+
$[69] = labels;
|
|
2526
|
+
$[70] = row;
|
|
2527
|
+
$[71] = rowActions;
|
|
2528
|
+
$[72] = showActions;
|
|
2529
|
+
$[73] = t13;
|
|
2530
|
+
} else t13 = $[73];
|
|
2531
|
+
let t14;
|
|
2532
|
+
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) {
|
|
2533
|
+
t14 = /* @__PURE__ */ jsxs("tr", {
|
|
2534
|
+
...t2,
|
|
2535
|
+
...t3,
|
|
2536
|
+
ref: t4,
|
|
2537
|
+
"data-adapttable-part": t5,
|
|
2538
|
+
"data-selected": t6,
|
|
2539
|
+
"data-clickable": t7,
|
|
2540
|
+
className: t8,
|
|
2541
|
+
onMouseEnter: t9,
|
|
2542
|
+
children: [
|
|
2543
|
+
t10,
|
|
2544
|
+
t11,
|
|
2545
|
+
t12,
|
|
2546
|
+
t13
|
|
2547
|
+
]
|
|
2548
|
+
});
|
|
2549
|
+
$[74] = t10;
|
|
2550
|
+
$[75] = t11;
|
|
2551
|
+
$[76] = t12;
|
|
2552
|
+
$[77] = t13;
|
|
2553
|
+
$[78] = t2;
|
|
2554
|
+
$[79] = t3;
|
|
2555
|
+
$[80] = t4;
|
|
2556
|
+
$[81] = t5;
|
|
2557
|
+
$[82] = t6;
|
|
2558
|
+
$[83] = t7;
|
|
2559
|
+
$[84] = t8;
|
|
2560
|
+
$[85] = t9;
|
|
2561
|
+
$[86] = t14;
|
|
2562
|
+
} else t14 = $[86];
|
|
2563
|
+
let t15;
|
|
2564
|
+
if ($[87] !== classNames.detailCell || $[88] !== classNames.detailRow || $[89] !== columnSpan || $[90] !== expandable || $[91] !== expanded || $[92] !== renderDetail || $[93] !== row) {
|
|
2565
|
+
t15 = expandable && expanded && /* @__PURE__ */ jsx("tr", {
|
|
2566
|
+
"data-adapttable-part": "detail-row",
|
|
2567
|
+
className: classNames.detailRow,
|
|
2568
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
2569
|
+
colSpan: columnSpan,
|
|
2570
|
+
"data-adapttable-part": "detail-cell",
|
|
2571
|
+
className: classNames.detailCell,
|
|
2572
|
+
children: renderDetail(row)
|
|
2573
|
+
})
|
|
2574
|
+
});
|
|
2575
|
+
$[87] = classNames.detailCell;
|
|
2576
|
+
$[88] = classNames.detailRow;
|
|
2577
|
+
$[89] = columnSpan;
|
|
2578
|
+
$[90] = expandable;
|
|
2579
|
+
$[91] = expanded;
|
|
2580
|
+
$[92] = renderDetail;
|
|
2581
|
+
$[93] = row;
|
|
2582
|
+
$[94] = t15;
|
|
2583
|
+
} else t15 = $[94];
|
|
2584
|
+
let t16;
|
|
2585
|
+
if ($[95] !== t14 || $[96] !== t15) {
|
|
2586
|
+
t16 = /* @__PURE__ */ jsxs(Fragment, { children: [t14, t15] });
|
|
2587
|
+
$[95] = t14;
|
|
2588
|
+
$[96] = t15;
|
|
2589
|
+
$[97] = t16;
|
|
2590
|
+
} else t16 = $[97];
|
|
2591
|
+
return t16;
|
|
1183
2592
|
}
|
|
1184
2593
|
/**
|
|
1185
2594
|
* One memoized row component per `DesktopTable` instantiation. A factory
|
|
@@ -1219,10 +2628,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1219
2628
|
renderRowDetail
|
|
1220
2629
|
};
|
|
1221
2630
|
const onToggleSelect = useCallback((id) => live.current.selection?.toggle(id), []);
|
|
1222
|
-
const onToggleExpand = useCallback((
|
|
2631
|
+
const onToggleExpand = useCallback((id_0) => live.current.expansion?.toggle(id_0), []);
|
|
1223
2632
|
const handleRowClick = useCallback((row) => live.current.onRowClick?.(row), []);
|
|
1224
|
-
const handlePrefetch = useCallback((
|
|
1225
|
-
const renderDetail = useCallback((
|
|
2633
|
+
const handlePrefetch = useCallback((row_0) => live.current.prefetch?.(row_0), []);
|
|
2634
|
+
const renderDetail = useCallback((row_1) => live.current.renderRowDetail?.(row_1), []);
|
|
1226
2635
|
const Row = useMemo(() => createDesktopRow(), []);
|
|
1227
2636
|
const { ref: overflowRef, overflowing } = useHorizontalOverflow();
|
|
1228
2637
|
const hasPinned = columns.some((c) => pinOffset?.(c.key) != null) || stickActions;
|
|
@@ -1236,21 +2645,21 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1236
2645
|
left: selection ? SELECTION_WIDTH : 0,
|
|
1237
2646
|
right: showActions ? ACTIONS_WIDTH : 0
|
|
1238
2647
|
};
|
|
1239
|
-
const hasLeftPin = columns.some((
|
|
1240
|
-
const hasRightPin = columns.some((
|
|
1241
|
-
const pinSignature = columns.map((
|
|
1242
|
-
const pin = pinOffset?.(
|
|
1243
|
-
return pin ? `${
|
|
2648
|
+
const hasLeftPin = columns.some((c_0) => pinOffset?.(c_0.key)?.side === "left");
|
|
2649
|
+
const hasRightPin = columns.some((c_1) => pinOffset?.(c_1.key)?.side === "right");
|
|
2650
|
+
const pinSignature = columns.map((c_2) => {
|
|
2651
|
+
const pin = pinOffset?.(c_2.key);
|
|
2652
|
+
return pin ? `${c_2.key}:${pin.side}:${pin.inset}` : "";
|
|
1244
2653
|
}).join("|");
|
|
1245
2654
|
const headPinStyle = (key) => pinnedCellStyle(pinOffset?.(key), PIN_Z.headerPinned, leads);
|
|
1246
2655
|
const headStyle = (column) => {
|
|
1247
|
-
const
|
|
1248
|
-
const
|
|
1249
|
-
const width =
|
|
1250
|
-
if (!stickyStyle && !
|
|
2656
|
+
const key_0 = column.key;
|
|
2657
|
+
const pin_0 = headPinStyle(key_0);
|
|
2658
|
+
const width = pin_0 ? pinnedColumnWidth(column, columnWidths) : columnWidths?.[key_0];
|
|
2659
|
+
if (!stickyStyle && !pin_0 && width == null && !setWidth) return void 0;
|
|
1251
2660
|
const merged = {
|
|
1252
2661
|
...stickyStyle,
|
|
1253
|
-
...
|
|
2662
|
+
...pin_0,
|
|
1254
2663
|
...width != null && { width }
|
|
1255
2664
|
};
|
|
1256
2665
|
if (setWidth && !merged.position) merged.position = "relative";
|
|
@@ -1264,7 +2673,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1264
2673
|
...edge
|
|
1265
2674
|
};
|
|
1266
2675
|
};
|
|
1267
|
-
const columnName = (
|
|
2676
|
+
const columnName = (column_0) => typeof column_0.header === "string" ? column_0.header : column_0.key;
|
|
1268
2677
|
const minWidth = tableMinWidth(columns, {
|
|
1269
2678
|
widths: columnWidths,
|
|
1270
2679
|
extra: (selection ? SELECTION_WIDTH : 0) + (showActions ? ACTIONS_WIDTH : 0)
|
|
@@ -1331,25 +2740,25 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1331
2740
|
className: classNames.checkbox
|
|
1332
2741
|
})
|
|
1333
2742
|
}),
|
|
1334
|
-
columns.map((
|
|
1335
|
-
const localStyle = headStyle(
|
|
1336
|
-
const headerProps = table.getHeaderCellProps(
|
|
1337
|
-
const
|
|
1338
|
-
const sortButtonProps = table.getSortButtonProps(
|
|
2743
|
+
columns.map((column_1) => {
|
|
2744
|
+
const localStyle = headStyle(column_1);
|
|
2745
|
+
const headerProps = table.getHeaderCellProps(column_1, localStyle && { style: localStyle });
|
|
2746
|
+
const active_0 = table.sortBy === column_1.key;
|
|
2747
|
+
const sortButtonProps = table.getSortButtonProps(column_1);
|
|
1339
2748
|
const sortIndex = sortButtonProps["data-sort-index"];
|
|
1340
2749
|
return /* @__PURE__ */ jsxs("th", {
|
|
1341
2750
|
...headerProps,
|
|
1342
2751
|
"data-adapttable-part": "header-cell",
|
|
1343
|
-
"data-sorted":
|
|
2752
|
+
"data-sorted": active_0 ? table.sortDir : void 0,
|
|
1344
2753
|
"data-sticky": stickyAttr,
|
|
1345
|
-
"data-pinned": pinOffset?.(
|
|
2754
|
+
"data-pinned": pinOffset?.(column_1.key)?.side,
|
|
1346
2755
|
className: classNames.headerCell,
|
|
1347
|
-
children: [
|
|
2756
|
+
children: [column_1.sortable ? /* @__PURE__ */ jsxs("button", {
|
|
1348
2757
|
...sortButtonProps,
|
|
1349
2758
|
"data-adapttable-part": "sort-button",
|
|
1350
2759
|
className: classNames.sortButton,
|
|
1351
2760
|
children: [
|
|
1352
|
-
|
|
2761
|
+
column_1.header,
|
|
1353
2762
|
typeof sortIndex === "number" && /* @__PURE__ */ jsx("span", {
|
|
1354
2763
|
"data-adapttable-part": "sort-index",
|
|
1355
2764
|
className: classNames.sortIndex,
|
|
@@ -1357,16 +2766,16 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1357
2766
|
}),
|
|
1358
2767
|
/* @__PURE__ */ jsxs("span", {
|
|
1359
2768
|
"aria-hidden": true,
|
|
1360
|
-
children: [" ", sortGlyph(
|
|
2769
|
+
children: [" ", sortGlyph(active_0, table.sortDir)]
|
|
1361
2770
|
})
|
|
1362
2771
|
]
|
|
1363
|
-
}) :
|
|
1364
|
-
...columnResizeHandleProps(
|
|
2772
|
+
}) : column_1.header, setWidth && /* @__PURE__ */ jsx("span", {
|
|
2773
|
+
...columnResizeHandleProps(column_1.key, setWidth, `${resizeLabel}: ${columnName(column_1)}`),
|
|
1365
2774
|
"data-adapttable-part": "resize-handle",
|
|
1366
2775
|
className: classNames.resizeHandle,
|
|
1367
2776
|
style: RESIZE_HANDLE_STYLE
|
|
1368
2777
|
})]
|
|
1369
|
-
},
|
|
2778
|
+
}, column_1.key);
|
|
1370
2779
|
}),
|
|
1371
2780
|
showActions && /* @__PURE__ */ jsx("th", {
|
|
1372
2781
|
"data-adapttable-part": "actions-header",
|
|
@@ -1390,18 +2799,18 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1390
2799
|
padding: 0
|
|
1391
2800
|
}
|
|
1392
2801
|
}) }),
|
|
1393
|
-
entries.map(({ row, index, key }) => {
|
|
1394
|
-
const
|
|
2802
|
+
entries.map(({ row: row_2, index, key: key_1 }) => {
|
|
2803
|
+
const id_1 = getRowId(row_2);
|
|
1395
2804
|
return /* @__PURE__ */ jsx(Row, {
|
|
1396
|
-
row,
|
|
2805
|
+
row: row_2,
|
|
1397
2806
|
index,
|
|
1398
|
-
id,
|
|
2807
|
+
id: id_1,
|
|
1399
2808
|
table,
|
|
1400
2809
|
columns,
|
|
1401
2810
|
labels,
|
|
1402
2811
|
classNames,
|
|
1403
|
-
selected: selection ? selection.isSelected(
|
|
1404
|
-
expanded: expansionState ? expansionState.isExpanded(
|
|
2812
|
+
selected: selection ? selection.isSelected(id_1) : void 0,
|
|
2813
|
+
expanded: expansionState ? expansionState.isExpanded(id_1) : void 0,
|
|
1405
2814
|
showActions,
|
|
1406
2815
|
rowActions,
|
|
1407
2816
|
confirm,
|
|
@@ -1412,7 +2821,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1412
2821
|
hasLeftPin,
|
|
1413
2822
|
hasRightPin,
|
|
1414
2823
|
actionsPinned: stickActions,
|
|
1415
|
-
rowClass: rowClassName?.(
|
|
2824
|
+
rowClass: rowClassName?.(row_2, index),
|
|
1416
2825
|
clickable: Boolean(onRowClick),
|
|
1417
2826
|
hasPrefetch: Boolean(prefetch),
|
|
1418
2827
|
onRowClick: handleRowClick,
|
|
@@ -1421,7 +2830,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1421
2830
|
onToggleExpand,
|
|
1422
2831
|
renderDetail,
|
|
1423
2832
|
measureElement
|
|
1424
|
-
},
|
|
2833
|
+
}, key_1);
|
|
1425
2834
|
}),
|
|
1426
2835
|
paddingBottom > 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
1427
2836
|
colSpan: columnSpan,
|
|
@@ -1441,11 +2850,11 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1441
2850
|
children: [
|
|
1442
2851
|
expandable && summaryPad,
|
|
1443
2852
|
selection && summaryPad,
|
|
1444
|
-
columns.map((
|
|
2853
|
+
columns.map((column_2) => /* @__PURE__ */ jsx("td", {
|
|
1445
2854
|
"data-adapttable-part": "summary-cell",
|
|
1446
2855
|
className: classNames.summaryCell,
|
|
1447
|
-
children: summary[
|
|
1448
|
-
},
|
|
2856
|
+
children: summary[column_2.key]
|
|
2857
|
+
}, column_2.key)),
|
|
1449
2858
|
showActions && summaryPad
|
|
1450
2859
|
]
|
|
1451
2860
|
})
|
|
@@ -1463,110 +2872,210 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, classNames,
|
|
|
1463
2872
|
});
|
|
1464
2873
|
}
|
|
1465
2874
|
/** Mobile card-list rendering. */
|
|
1466
|
-
function MobileCards(
|
|
2875
|
+
function MobileCards(t0) {
|
|
2876
|
+
const $ = c(50);
|
|
2877
|
+
const { table, rows, rowActions, confirm, getRowId, classNames, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, rowEntries, paddingTop: t1, paddingBottom: t2, measureElement } = t0;
|
|
2878
|
+
const paddingTop = t1 === void 0 ? 0 : t1;
|
|
2879
|
+
const paddingBottom = t2 === void 0 ? 0 : t2;
|
|
1467
2880
|
const { columns, selection, labels } = table;
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
2881
|
+
let summary;
|
|
2882
|
+
let t3;
|
|
2883
|
+
let t4;
|
|
2884
|
+
let t5;
|
|
2885
|
+
let t6;
|
|
2886
|
+
let t7;
|
|
2887
|
+
let t8;
|
|
2888
|
+
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) {
|
|
2889
|
+
const entries = resolveVirtualRows(rows, getRowId, rowEntries);
|
|
2890
|
+
const expansionState = renderRowDetail ? expansion : void 0;
|
|
2891
|
+
let t9;
|
|
2892
|
+
if ($[24] !== rows || $[25] !== summaryRow) {
|
|
2893
|
+
t9 = summaryRow?.(rows);
|
|
2894
|
+
$[24] = rows;
|
|
2895
|
+
$[25] = summaryRow;
|
|
2896
|
+
$[26] = t9;
|
|
2897
|
+
} else t9 = $[26];
|
|
2898
|
+
summary = t9;
|
|
2899
|
+
if ($[27] !== table) {
|
|
2900
|
+
t3 = table.getTableProps({ role: void 0 });
|
|
2901
|
+
$[27] = table;
|
|
2902
|
+
$[28] = t3;
|
|
2903
|
+
} else t3 = $[28];
|
|
2904
|
+
t4 = "cards";
|
|
2905
|
+
t5 = classNames.cards;
|
|
2906
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2907
|
+
t6 = {
|
|
2908
|
+
listStyle: "none",
|
|
2909
|
+
margin: 0,
|
|
2910
|
+
padding: 0
|
|
2911
|
+
};
|
|
2912
|
+
$[29] = t6;
|
|
2913
|
+
} else t6 = $[29];
|
|
2914
|
+
if ($[30] !== paddingTop) {
|
|
2915
|
+
t7 = paddingTop > 0 && /* @__PURE__ */ jsx("li", {
|
|
1482
2916
|
"aria-hidden": true,
|
|
1483
2917
|
"data-adapttable-part": "virtual-spacer",
|
|
1484
2918
|
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, {
|
|
2919
|
+
});
|
|
2920
|
+
$[30] = paddingTop;
|
|
2921
|
+
$[31] = t7;
|
|
2922
|
+
} else t7 = $[31];
|
|
2923
|
+
t8 = entries.map((t10) => {
|
|
2924
|
+
const { row, index, key } = t10;
|
|
2925
|
+
const id = getRowId(row);
|
|
2926
|
+
const expanded = expansionState?.isExpanded(id) ?? false;
|
|
2927
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
2928
|
+
...rowClickProps(row, onRowClick),
|
|
2929
|
+
ref: measureElement,
|
|
2930
|
+
"data-index": index,
|
|
2931
|
+
"data-adapttable-part": "card",
|
|
2932
|
+
"data-selected": selection?.isSelected(id) ? "" : void 0,
|
|
2933
|
+
"data-clickable": onRowClick ? "" : void 0,
|
|
2934
|
+
className: cx(classNames.card, rowClassName?.(row, index)),
|
|
2935
|
+
children: [
|
|
2936
|
+
selection && /* @__PURE__ */ jsx("input", {
|
|
2937
|
+
type: "checkbox",
|
|
2938
|
+
"aria-label": labels.selectRow,
|
|
2939
|
+
checked: selection.isSelected(id),
|
|
2940
|
+
onChange: () => selection.toggle(id),
|
|
2941
|
+
className: classNames.checkbox
|
|
2942
|
+
}),
|
|
2943
|
+
expansionState && /* @__PURE__ */ jsx(ExpandButton, {
|
|
2944
|
+
expanded,
|
|
2945
|
+
labels,
|
|
2946
|
+
classNames,
|
|
2947
|
+
onToggle: () => expansionState.toggle(id)
|
|
2948
|
+
}),
|
|
2949
|
+
columns.map((column) => /* @__PURE__ */ jsxs("div", {
|
|
2950
|
+
"data-adapttable-part": "card-row",
|
|
2951
|
+
className: classNames.cardRow,
|
|
2952
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2953
|
+
"data-adapttable-part": "card-label",
|
|
2954
|
+
className: classNames.cardLabel,
|
|
2955
|
+
children: cardLabel(column)
|
|
2956
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2957
|
+
"data-adapttable-part": "card-value",
|
|
2958
|
+
className: classNames.cardValue,
|
|
2959
|
+
children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
|
|
1531
2960
|
row,
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
2961
|
+
rowIndex: index
|
|
2962
|
+
}) : column.accessor?.(row)
|
|
2963
|
+
})]
|
|
2964
|
+
}, column.key)),
|
|
2965
|
+
rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
2966
|
+
"data-adapttable-part": "card-actions",
|
|
2967
|
+
className: classNames.actionsCell,
|
|
2968
|
+
children: /* @__PURE__ */ jsx(RowActionButtons, {
|
|
2969
|
+
row,
|
|
2970
|
+
actions: rowActions,
|
|
2971
|
+
confirm,
|
|
2972
|
+
cancelLabel: labels.cancel,
|
|
2973
|
+
classNames
|
|
1542
2974
|
})
|
|
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
|
-
|
|
2975
|
+
}),
|
|
2976
|
+
expanded && /* @__PURE__ */ jsx("div", {
|
|
2977
|
+
"data-adapttable-part": "card-detail",
|
|
2978
|
+
className: classNames.cardDetail,
|
|
2979
|
+
children: renderRowDetail(row)
|
|
2980
|
+
})
|
|
2981
|
+
]
|
|
2982
|
+
}, key);
|
|
2983
|
+
});
|
|
2984
|
+
$[0] = classNames;
|
|
2985
|
+
$[1] = columns;
|
|
2986
|
+
$[2] = confirm;
|
|
2987
|
+
$[3] = expansion;
|
|
2988
|
+
$[4] = getRowId;
|
|
2989
|
+
$[5] = labels;
|
|
2990
|
+
$[6] = measureElement;
|
|
2991
|
+
$[7] = onRowClick;
|
|
2992
|
+
$[8] = paddingTop;
|
|
2993
|
+
$[9] = renderRowDetail;
|
|
2994
|
+
$[10] = rowActions;
|
|
2995
|
+
$[11] = rowClassName;
|
|
2996
|
+
$[12] = rowEntries;
|
|
2997
|
+
$[13] = rows;
|
|
2998
|
+
$[14] = selection;
|
|
2999
|
+
$[15] = summaryRow;
|
|
3000
|
+
$[16] = table;
|
|
3001
|
+
$[17] = summary;
|
|
3002
|
+
$[18] = t3;
|
|
3003
|
+
$[19] = t4;
|
|
3004
|
+
$[20] = t5;
|
|
3005
|
+
$[21] = t6;
|
|
3006
|
+
$[22] = t7;
|
|
3007
|
+
$[23] = t8;
|
|
3008
|
+
} else {
|
|
3009
|
+
summary = $[17];
|
|
3010
|
+
t3 = $[18];
|
|
3011
|
+
t4 = $[19];
|
|
3012
|
+
t5 = $[20];
|
|
3013
|
+
t6 = $[21];
|
|
3014
|
+
t7 = $[22];
|
|
3015
|
+
t8 = $[23];
|
|
3016
|
+
}
|
|
3017
|
+
let t9;
|
|
3018
|
+
if ($[32] !== paddingBottom) {
|
|
3019
|
+
t9 = paddingBottom > 0 && /* @__PURE__ */ jsx("li", {
|
|
3020
|
+
"aria-hidden": true,
|
|
3021
|
+
"data-adapttable-part": "virtual-spacer",
|
|
3022
|
+
style: { height: paddingBottom }
|
|
3023
|
+
});
|
|
3024
|
+
$[32] = paddingBottom;
|
|
3025
|
+
$[33] = t9;
|
|
3026
|
+
} else t9 = $[33];
|
|
3027
|
+
let t10;
|
|
3028
|
+
if ($[34] !== classNames.cardLabel || $[35] !== classNames.cardRow || $[36] !== classNames.cardValue || $[37] !== classNames.summaryCard || $[38] !== columns || $[39] !== summary) {
|
|
3029
|
+
t10 = summary && /* @__PURE__ */ jsx("li", {
|
|
3030
|
+
"data-adapttable-part": "summary-card",
|
|
3031
|
+
className: classNames.summaryCard,
|
|
3032
|
+
children: columns.filter((column_0) => summary[column_0.key] !== void 0).map((column_1) => /* @__PURE__ */ jsxs("div", {
|
|
3033
|
+
"data-adapttable-part": "card-row",
|
|
3034
|
+
className: classNames.cardRow,
|
|
3035
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
3036
|
+
"data-adapttable-part": "card-label",
|
|
3037
|
+
className: classNames.cardLabel,
|
|
3038
|
+
children: cardLabel(column_1)
|
|
3039
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
3040
|
+
"data-adapttable-part": "card-value",
|
|
3041
|
+
className: classNames.cardValue,
|
|
3042
|
+
children: summary[column_1.key]
|
|
3043
|
+
})]
|
|
3044
|
+
}, column_1.key))
|
|
3045
|
+
});
|
|
3046
|
+
$[34] = classNames.cardLabel;
|
|
3047
|
+
$[35] = classNames.cardRow;
|
|
3048
|
+
$[36] = classNames.cardValue;
|
|
3049
|
+
$[37] = classNames.summaryCard;
|
|
3050
|
+
$[38] = columns;
|
|
3051
|
+
$[39] = summary;
|
|
3052
|
+
$[40] = t10;
|
|
3053
|
+
} else t10 = $[40];
|
|
3054
|
+
let t11;
|
|
3055
|
+
if ($[41] !== t10 || $[42] !== t3 || $[43] !== t4 || $[44] !== t5 || $[45] !== t6 || $[46] !== t7 || $[47] !== t8 || $[48] !== t9) {
|
|
3056
|
+
t11 = /* @__PURE__ */ jsxs("ul", {
|
|
3057
|
+
...t3,
|
|
3058
|
+
"data-adapttable-part": t4,
|
|
3059
|
+
className: t5,
|
|
3060
|
+
style: t6,
|
|
3061
|
+
children: [
|
|
3062
|
+
t7,
|
|
3063
|
+
t8,
|
|
3064
|
+
t9,
|
|
3065
|
+
t10
|
|
3066
|
+
]
|
|
3067
|
+
});
|
|
3068
|
+
$[41] = t10;
|
|
3069
|
+
$[42] = t3;
|
|
3070
|
+
$[43] = t4;
|
|
3071
|
+
$[44] = t5;
|
|
3072
|
+
$[45] = t6;
|
|
3073
|
+
$[46] = t7;
|
|
3074
|
+
$[47] = t8;
|
|
3075
|
+
$[48] = t9;
|
|
3076
|
+
$[49] = t11;
|
|
3077
|
+
} else t11 = $[49];
|
|
3078
|
+
return t11;
|
|
1570
3079
|
}
|
|
1571
3080
|
function sortGlyph(active, dir) {
|
|
1572
3081
|
if (!active) return "↕";
|
|
@@ -1578,58 +3087,139 @@ function cardLabel(column) {
|
|
|
1578
3087
|
//#endregion
|
|
1579
3088
|
//#region src/DataTable.tsx
|
|
1580
3089
|
const NO_CLASSNAMES = {};
|
|
1581
|
-
|
|
3090
|
+
/**
|
|
3091
|
+
* `DataTableProps` after tier resolution: the source is definite (whichever
|
|
3092
|
+
* tier provided it) and `filters` is plain JSX (the auto-built form when the
|
|
3093
|
+
* caller passed the declarative array).
|
|
3094
|
+
*/
|
|
3095
|
+
function DataTableBody(t0) {
|
|
3096
|
+
const $ = c(48);
|
|
3097
|
+
const { chrome, props, classNames, confirm, getRowId, virtualization, virtualScrollRef, labels } = t0;
|
|
1582
3098
|
const rowActions = chrome.columnLayout.isHidden(ACTIONS_COLUMN_KEY) ? void 0 : props.rowActions;
|
|
1583
3099
|
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
|
-
|
|
3100
|
+
if (chrome.body === "skeleton") {
|
|
3101
|
+
let t1;
|
|
3102
|
+
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) {
|
|
3103
|
+
t1 = props.slots?.skeleton ?? props.loadingState ?? /* @__PURE__ */ jsx(LoadingState, {
|
|
3104
|
+
rows: props.skeletonRows ?? props.source.limit,
|
|
3105
|
+
columns: chrome.table.columns.length,
|
|
3106
|
+
variant: chrome.isMobile ? "cards" : "table",
|
|
3107
|
+
labels,
|
|
3108
|
+
classNames,
|
|
3109
|
+
hasActions: (rowActions?.length ?? 0) > 0
|
|
3110
|
+
});
|
|
3111
|
+
$[0] = chrome.isMobile;
|
|
3112
|
+
$[1] = chrome.table;
|
|
3113
|
+
$[2] = classNames;
|
|
3114
|
+
$[3] = labels;
|
|
3115
|
+
$[4] = props.loadingState;
|
|
3116
|
+
$[5] = props.skeletonRows;
|
|
3117
|
+
$[6] = props.slots?.skeleton;
|
|
3118
|
+
$[7] = props.source;
|
|
3119
|
+
$[8] = rowActions?.length;
|
|
3120
|
+
$[9] = t1;
|
|
3121
|
+
} else t1 = $[9];
|
|
3122
|
+
let t2;
|
|
3123
|
+
if ($[10] !== t1) {
|
|
3124
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
3125
|
+
$[10] = t1;
|
|
3126
|
+
$[11] = t2;
|
|
3127
|
+
} else t2 = $[11];
|
|
3128
|
+
return t2;
|
|
3129
|
+
}
|
|
1592
3130
|
if (chrome.body === "empty") {
|
|
1593
3131
|
const noResults = chrome.emptyVariant === "noResults";
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
3132
|
+
let t1;
|
|
3133
|
+
if ($[12] !== chrome.clearFilters || $[13] !== classNames || $[14] !== labels || $[15] !== noResults || $[16] !== props.emptyState || $[17] !== props.slots?.empty) {
|
|
3134
|
+
t1 = props.slots?.empty ?? props.emptyState ?? /* @__PURE__ */ jsxs("output", {
|
|
3135
|
+
"data-adapttable-part": "empty",
|
|
3136
|
+
className: classNames.empty,
|
|
3137
|
+
children: [noResults ? labels.noResults : labels.noData, noResults && /* @__PURE__ */ jsx("button", {
|
|
3138
|
+
type: "button",
|
|
3139
|
+
"data-adapttable-part": "empty-clear",
|
|
3140
|
+
className: classNames.emptyClear,
|
|
3141
|
+
onClick: chrome.clearFilters,
|
|
3142
|
+
children: labels.clearAll
|
|
3143
|
+
})]
|
|
3144
|
+
});
|
|
3145
|
+
$[12] = chrome.clearFilters;
|
|
3146
|
+
$[13] = classNames;
|
|
3147
|
+
$[14] = labels;
|
|
3148
|
+
$[15] = noResults;
|
|
3149
|
+
$[16] = props.emptyState;
|
|
3150
|
+
$[17] = props.slots?.empty;
|
|
3151
|
+
$[18] = t1;
|
|
3152
|
+
} else t1 = $[18];
|
|
3153
|
+
let t2;
|
|
3154
|
+
if ($[19] !== t1) {
|
|
3155
|
+
t2 = /* @__PURE__ */ jsx(Fragment, { children: t1 });
|
|
3156
|
+
$[19] = t1;
|
|
3157
|
+
$[20] = t2;
|
|
3158
|
+
} else t2 = $[20];
|
|
3159
|
+
return t2;
|
|
1605
3160
|
}
|
|
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
|
-
|
|
3161
|
+
const Renderer = chrome.isMobile ? MobileCards : DesktopTable;
|
|
3162
|
+
const t1 = chrome.detail?.expansion;
|
|
3163
|
+
const t2 = virtualization.enabled ? virtualization.rows : void 0;
|
|
3164
|
+
const t3 = props.resizableColumns ? chrome.columnLayout.setWidth : void 0;
|
|
3165
|
+
let t4;
|
|
3166
|
+
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) {
|
|
3167
|
+
t4 = /* @__PURE__ */ jsx(Renderer, {
|
|
3168
|
+
table: chrome.table,
|
|
3169
|
+
rows: props.source.rows,
|
|
3170
|
+
rowActions,
|
|
3171
|
+
actionsPinned,
|
|
3172
|
+
confirm,
|
|
3173
|
+
getRowId,
|
|
3174
|
+
classNames,
|
|
3175
|
+
prefetch: props.prefetch,
|
|
3176
|
+
onRowClick: props.onRowClick,
|
|
3177
|
+
rowClassName: props.rowClassName,
|
|
3178
|
+
renderRowDetail: props.renderRowDetail,
|
|
3179
|
+
summaryRow: props.summaryRow,
|
|
3180
|
+
expansion: t1,
|
|
3181
|
+
rowEntries: t2,
|
|
3182
|
+
paddingTop: virtualization.paddingTop,
|
|
3183
|
+
paddingBottom: virtualization.paddingBottom,
|
|
3184
|
+
measureElement: virtualization.measureElement,
|
|
3185
|
+
stickyHeader: props.stickyHeader,
|
|
3186
|
+
stickyTop: props.stickyTop,
|
|
3187
|
+
pinOffset: chrome.columnLayout.pinOffset,
|
|
3188
|
+
maxHeight: props.maxHeight,
|
|
3189
|
+
virtualScrollRef,
|
|
3190
|
+
setWidth: t3,
|
|
3191
|
+
columnWidths: chrome.columnLayout.state.widths,
|
|
3192
|
+
resizeLabel: labels.resizeColumn
|
|
3193
|
+
});
|
|
3194
|
+
$[21] = Renderer;
|
|
3195
|
+
$[22] = actionsPinned;
|
|
3196
|
+
$[23] = chrome.columnLayout.pinOffset;
|
|
3197
|
+
$[24] = chrome.columnLayout.state.widths;
|
|
3198
|
+
$[25] = chrome.table;
|
|
3199
|
+
$[26] = classNames;
|
|
3200
|
+
$[27] = confirm;
|
|
3201
|
+
$[28] = getRowId;
|
|
3202
|
+
$[29] = labels.resizeColumn;
|
|
3203
|
+
$[30] = props.maxHeight;
|
|
3204
|
+
$[31] = props.onRowClick;
|
|
3205
|
+
$[32] = props.prefetch;
|
|
3206
|
+
$[33] = props.renderRowDetail;
|
|
3207
|
+
$[34] = props.rowClassName;
|
|
3208
|
+
$[35] = props.source.rows;
|
|
3209
|
+
$[36] = props.stickyHeader;
|
|
3210
|
+
$[37] = props.stickyTop;
|
|
3211
|
+
$[38] = props.summaryRow;
|
|
3212
|
+
$[39] = rowActions;
|
|
3213
|
+
$[40] = t1;
|
|
3214
|
+
$[41] = t2;
|
|
3215
|
+
$[42] = t3;
|
|
3216
|
+
$[43] = virtualScrollRef;
|
|
3217
|
+
$[44] = virtualization.measureElement;
|
|
3218
|
+
$[45] = virtualization.paddingBottom;
|
|
3219
|
+
$[46] = virtualization.paddingTop;
|
|
3220
|
+
$[47] = t4;
|
|
3221
|
+
} else t4 = $[47];
|
|
3222
|
+
return t4;
|
|
1633
3223
|
}
|
|
1634
3224
|
/**
|
|
1635
3225
|
* Headless, unstyled AdaptTable for Tailwind / shadcn / custom CSS. Renders
|