@adapttable/mantine 0.2.1 → 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 +8 -0
- package/dist/index.cjs +3399 -1213
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3399 -1213
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let react_compiler_runtime = require("react-compiler-runtime");
|
|
2
3
|
let _adapttable_core = require("@adapttable/core");
|
|
3
4
|
let _mantine_core = require("@mantine/core");
|
|
4
5
|
let _mantine_hooks = require("@mantine/hooks");
|
|
5
6
|
let react = require("react");
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
8
|
//#region src/animation/useMountStagger.ts
|
|
9
|
+
/** Tuning for the mount stagger. */
|
|
8
10
|
/**
|
|
9
11
|
* Dependency-free entrance stagger using the Web Animations API. Animates
|
|
10
12
|
* descendants marked with `data-stagger` once on mount (and whenever
|
|
@@ -16,68 +18,136 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
16
18
|
* @param options - See {@link MountStaggerOptions}.
|
|
17
19
|
*/
|
|
18
20
|
function useMountStagger(ref, deps, options) {
|
|
21
|
+
const $ = (0, react_compiler_runtime.c)(15);
|
|
19
22
|
const reduced = (0, _adapttable_core.usePrefersReducedMotion)();
|
|
20
|
-
const { enabled, step
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
const { enabled, step: t0, duration: t1 } = options;
|
|
24
|
+
const step = t0 === void 0 ? 40 : t0;
|
|
25
|
+
const duration = t1 === void 0 ? 320 : t1;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[0] !== deps) {
|
|
28
|
+
t2 = deps.map(String).join("|");
|
|
29
|
+
$[0] = deps;
|
|
30
|
+
$[1] = t2;
|
|
31
|
+
} else t2 = $[1];
|
|
32
|
+
const depsKey = t2;
|
|
33
|
+
let t3;
|
|
34
|
+
if ($[2] !== duration || $[3] !== enabled || $[4] !== reduced || $[5] !== ref || $[6] !== step) {
|
|
35
|
+
t3 = () => {
|
|
36
|
+
if (!enabled || reduced) return;
|
|
37
|
+
const root = ref.current;
|
|
38
|
+
if (!root) return;
|
|
39
|
+
root.querySelectorAll("[data-stagger]").forEach((el, index) => {
|
|
40
|
+
if (typeof el.animate !== "function") return;
|
|
41
|
+
el.animate([{
|
|
42
|
+
opacity: 0,
|
|
43
|
+
transform: "translateY(8px)"
|
|
44
|
+
}, {
|
|
45
|
+
opacity: 1,
|
|
46
|
+
transform: "translateY(0)"
|
|
47
|
+
}], {
|
|
48
|
+
duration,
|
|
49
|
+
delay: index * step,
|
|
50
|
+
easing: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
51
|
+
fill: "both"
|
|
52
|
+
});
|
|
38
53
|
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
enabled
|
|
42
|
-
reduced
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
};
|
|
55
|
+
$[2] = duration;
|
|
56
|
+
$[3] = enabled;
|
|
57
|
+
$[4] = reduced;
|
|
58
|
+
$[5] = ref;
|
|
59
|
+
$[6] = step;
|
|
60
|
+
$[7] = t3;
|
|
61
|
+
} else t3 = $[7];
|
|
62
|
+
let t4;
|
|
63
|
+
if ($[8] !== depsKey || $[9] !== duration || $[10] !== enabled || $[11] !== reduced || $[12] !== ref || $[13] !== step) {
|
|
64
|
+
t4 = [
|
|
65
|
+
enabled,
|
|
66
|
+
reduced,
|
|
67
|
+
step,
|
|
68
|
+
duration,
|
|
69
|
+
ref,
|
|
70
|
+
depsKey
|
|
71
|
+
];
|
|
72
|
+
$[8] = depsKey;
|
|
73
|
+
$[9] = duration;
|
|
74
|
+
$[10] = enabled;
|
|
75
|
+
$[11] = reduced;
|
|
76
|
+
$[12] = ref;
|
|
77
|
+
$[13] = step;
|
|
78
|
+
$[14] = t4;
|
|
79
|
+
} else t4 = $[14];
|
|
80
|
+
(0, react.useEffect)(t3, t4);
|
|
48
81
|
}
|
|
49
82
|
//#endregion
|
|
50
83
|
//#region src/components/ActiveFilterChips.tsx
|
|
84
|
+
/** Props for {@link ActiveFilterChips}. */
|
|
51
85
|
/** A wrapping strip of removable filter chips. Renders nothing when empty. */
|
|
52
|
-
function ActiveFilterChips(
|
|
86
|
+
function ActiveFilterChips(t0) {
|
|
87
|
+
const $ = (0, react_compiler_runtime.c)(13);
|
|
88
|
+
const { chips, onClearAll, label, clearAllLabel } = t0;
|
|
53
89
|
if (chips.length === 0) return null;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
component: "ul",
|
|
58
|
-
style: {
|
|
90
|
+
let t1;
|
|
91
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
92
|
+
t1 = {
|
|
59
93
|
listStyle: "none",
|
|
60
94
|
padding: 0,
|
|
61
95
|
margin: 0
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
96
|
+
};
|
|
97
|
+
$[0] = t1;
|
|
98
|
+
} else t1 = $[0];
|
|
99
|
+
let t2;
|
|
100
|
+
if ($[1] !== chips || $[2] !== clearAllLabel) {
|
|
101
|
+
let t3;
|
|
102
|
+
if ($[4] !== clearAllLabel) {
|
|
103
|
+
t3 = (chip) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Pill, {
|
|
104
|
+
component: "li",
|
|
105
|
+
withRemoveButton: true,
|
|
106
|
+
onRemove: chip.onRemove,
|
|
107
|
+
removeButtonProps: { "aria-label": `${clearAllLabel}: ${chip.label}` },
|
|
108
|
+
children: chip.label
|
|
109
|
+
}, chip.key);
|
|
110
|
+
$[4] = clearAllLabel;
|
|
111
|
+
$[5] = t3;
|
|
112
|
+
} else t3 = $[5];
|
|
113
|
+
t2 = chips.map(t3);
|
|
114
|
+
$[1] = chips;
|
|
115
|
+
$[2] = clearAllLabel;
|
|
116
|
+
$[3] = t2;
|
|
117
|
+
} else t2 = $[3];
|
|
118
|
+
let t3;
|
|
119
|
+
if ($[6] !== clearAllLabel || $[7] !== onClearAll) {
|
|
120
|
+
t3 = onClearAll && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Anchor, {
|
|
70
121
|
component: "button",
|
|
71
122
|
type: "button",
|
|
72
123
|
fz: "xs",
|
|
73
124
|
fw: 600,
|
|
74
125
|
onClick: onClearAll,
|
|
75
126
|
children: clearAllLabel
|
|
76
|
-
})
|
|
77
|
-
|
|
127
|
+
});
|
|
128
|
+
$[6] = clearAllLabel;
|
|
129
|
+
$[7] = onClearAll;
|
|
130
|
+
$[8] = t3;
|
|
131
|
+
} else t3 = $[8];
|
|
132
|
+
let t4;
|
|
133
|
+
if ($[9] !== label || $[10] !== t2 || $[11] !== t3) {
|
|
134
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
135
|
+
gap: 6,
|
|
136
|
+
"aria-label": label,
|
|
137
|
+
component: "ul",
|
|
138
|
+
style: t1,
|
|
139
|
+
children: [t2, t3]
|
|
140
|
+
});
|
|
141
|
+
$[9] = label;
|
|
142
|
+
$[10] = t2;
|
|
143
|
+
$[11] = t3;
|
|
144
|
+
$[12] = t4;
|
|
145
|
+
} else t4 = $[12];
|
|
146
|
+
return t4;
|
|
78
147
|
}
|
|
79
148
|
//#endregion
|
|
80
149
|
//#region src/components/AutoFilterForm.tsx
|
|
150
|
+
/** Props for {@link AutoFilterForm}. */
|
|
81
151
|
/** A scalar filter value as input text (`""` when unset). */
|
|
82
152
|
const asText = (value) => value == null ? "" : String(value);
|
|
83
153
|
/** A multi-select value as an array, tolerating a scalar from the URL. */
|
|
@@ -99,151 +169,405 @@ const RANGE_FLAVOUR = {
|
|
|
99
169
|
* `Min`/`Max` (`From`/`To`) pair via {@link readRangeWidget} /
|
|
100
170
|
* {@link writeRangeWidget}, so URLs, chips and predicates are unchanged.
|
|
101
171
|
*/
|
|
102
|
-
function RangeField(
|
|
103
|
-
const
|
|
172
|
+
function RangeField(t0) {
|
|
173
|
+
const $ = (0, react_compiler_runtime.c)(45);
|
|
174
|
+
const { def, source, kind, labels } = t0;
|
|
175
|
+
let t1;
|
|
176
|
+
if ($[0] !== def) {
|
|
177
|
+
t1 = (0, _adapttable_core.filterLabel)(def);
|
|
178
|
+
$[0] = def;
|
|
179
|
+
$[1] = t1;
|
|
180
|
+
} else t1 = $[1];
|
|
181
|
+
const label = t1;
|
|
104
182
|
const lowKey = def.key + _adapttable_core.RANGE_SUFFIXES[kind].start;
|
|
105
183
|
const highKey = def.key + _adapttable_core.RANGE_SUFFIXES[kind].end;
|
|
106
|
-
|
|
184
|
+
let t2;
|
|
185
|
+
if ($[2] !== highKey || $[3] !== lowKey || $[4] !== source.extra) {
|
|
186
|
+
t2 = (0, _adapttable_core.readRangeWidget)(source.extra, lowKey, highKey);
|
|
187
|
+
$[2] = highKey;
|
|
188
|
+
$[3] = lowKey;
|
|
189
|
+
$[4] = source.extra;
|
|
190
|
+
$[5] = t2;
|
|
191
|
+
} else t2 = $[5];
|
|
192
|
+
const derived = t2;
|
|
107
193
|
const [chosen, setChosen] = (0, react.useState)(null);
|
|
108
194
|
const op = chosen ?? derived.op ?? null;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
195
|
+
let data;
|
|
196
|
+
let handleOp;
|
|
197
|
+
let values;
|
|
198
|
+
if ($[6] !== highKey || $[7] !== kind || $[8] !== label || $[9] !== labels || $[10] !== lowKey || $[11] !== op || $[12] !== source) {
|
|
199
|
+
const low = asText(source.extra[lowKey]);
|
|
200
|
+
const high = asText(source.extra[highKey]);
|
|
201
|
+
const single = op === "lte" ? high : low;
|
|
202
|
+
let t3;
|
|
203
|
+
if ($[16] !== highKey || $[17] !== lowKey || $[18] !== source) {
|
|
204
|
+
t3 = (nextOp, a, b) => source.setExtras((0, _adapttable_core.writeRangeWidget)(nextOp, a, b, lowKey, highKey));
|
|
205
|
+
$[16] = highKey;
|
|
206
|
+
$[17] = lowKey;
|
|
207
|
+
$[18] = source;
|
|
208
|
+
$[19] = t3;
|
|
209
|
+
} else t3 = $[19];
|
|
210
|
+
const write = t3;
|
|
211
|
+
handleOp = (value) => {
|
|
212
|
+
const next = asOp(value);
|
|
213
|
+
setChosen(next ?? null);
|
|
214
|
+
write(next, single, "");
|
|
215
|
+
};
|
|
216
|
+
const flavour = RANGE_FLAVOUR[kind];
|
|
217
|
+
const opLabelKeys = _adapttable_core.RANGE_OP_LABEL_KEYS[flavour];
|
|
218
|
+
let t4;
|
|
219
|
+
if ($[20] !== labels || $[21] !== opLabelKeys) {
|
|
220
|
+
t4 = _adapttable_core.RANGE_OPS.map((value_0) => ({
|
|
221
|
+
value: value_0,
|
|
222
|
+
label: labels[opLabelKeys[value_0]]
|
|
223
|
+
}));
|
|
224
|
+
$[20] = labels;
|
|
225
|
+
$[21] = opLabelKeys;
|
|
226
|
+
$[22] = t4;
|
|
227
|
+
} else t4 = $[22];
|
|
228
|
+
data = t4;
|
|
229
|
+
let t5;
|
|
230
|
+
if ($[23] !== flavour || $[24] !== label) {
|
|
231
|
+
t5 = (text, value_1, commit) => flavour === "number" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.NumberInput, {
|
|
232
|
+
size: "sm",
|
|
233
|
+
hideControls: true,
|
|
234
|
+
style: {
|
|
235
|
+
flex: "1 1 6rem",
|
|
236
|
+
minWidth: "6rem"
|
|
237
|
+
},
|
|
238
|
+
"aria-label": `${label} ${text}`,
|
|
239
|
+
placeholder: text,
|
|
240
|
+
value: value_1,
|
|
241
|
+
onChange: (next_0) => commit(String(next_0))
|
|
242
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.TextInput, {
|
|
243
|
+
type: "date",
|
|
244
|
+
size: "sm",
|
|
245
|
+
style: {
|
|
246
|
+
flex: "1 1 8.5rem",
|
|
247
|
+
minWidth: "8.5rem"
|
|
248
|
+
},
|
|
249
|
+
"aria-label": `${label} ${text}`,
|
|
250
|
+
placeholder: text,
|
|
251
|
+
value: value_1,
|
|
252
|
+
onChange: (e) => commit(e.currentTarget.value)
|
|
253
|
+
});
|
|
254
|
+
$[23] = flavour;
|
|
255
|
+
$[24] = label;
|
|
256
|
+
$[25] = t5;
|
|
257
|
+
} else t5 = $[25];
|
|
258
|
+
const valueInput = t5;
|
|
259
|
+
values = null;
|
|
260
|
+
if (op === "between") values = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [valueInput(labels.from, low, (next_1) => write("between", next_1, high)), valueInput(labels.to, high, (next_2) => write("between", low, next_2))] });
|
|
261
|
+
else if (op) {
|
|
262
|
+
let t6;
|
|
263
|
+
if ($[26] !== op || $[27] !== write) {
|
|
264
|
+
t6 = (next_3) => write(op, next_3, "");
|
|
265
|
+
$[26] = op;
|
|
266
|
+
$[27] = write;
|
|
267
|
+
$[28] = t6;
|
|
268
|
+
} else t6 = $[28];
|
|
269
|
+
values = valueInput(labels.value, single, t6);
|
|
270
|
+
}
|
|
271
|
+
$[6] = highKey;
|
|
272
|
+
$[7] = kind;
|
|
273
|
+
$[8] = label;
|
|
274
|
+
$[9] = labels;
|
|
275
|
+
$[10] = lowKey;
|
|
276
|
+
$[11] = op;
|
|
277
|
+
$[12] = source;
|
|
278
|
+
$[13] = data;
|
|
279
|
+
$[14] = handleOp;
|
|
280
|
+
$[15] = values;
|
|
281
|
+
} else {
|
|
282
|
+
data = $[13];
|
|
283
|
+
handleOp = $[14];
|
|
284
|
+
values = $[15];
|
|
285
|
+
}
|
|
286
|
+
let t3;
|
|
287
|
+
if ($[29] !== label) {
|
|
288
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Input.Label, {
|
|
154
289
|
size: "sm",
|
|
155
290
|
children: label
|
|
156
|
-
})
|
|
291
|
+
});
|
|
292
|
+
$[29] = label;
|
|
293
|
+
$[30] = t3;
|
|
294
|
+
} else t3 = $[30];
|
|
295
|
+
let t4;
|
|
296
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
297
|
+
t4 = {
|
|
298
|
+
flex: "0 0 8.5rem",
|
|
299
|
+
width: "8.5rem"
|
|
300
|
+
};
|
|
301
|
+
$[31] = t4;
|
|
302
|
+
} else t4 = $[31];
|
|
303
|
+
const t5 = `${label} ${labels.operator}`;
|
|
304
|
+
let t6;
|
|
305
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
306
|
+
t6 = { withinPortal: false };
|
|
307
|
+
$[32] = t6;
|
|
308
|
+
} else t6 = $[32];
|
|
309
|
+
let t7;
|
|
310
|
+
if ($[33] !== data || $[34] !== handleOp || $[35] !== labels.operator || $[36] !== op || $[37] !== t5) {
|
|
311
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Select, {
|
|
312
|
+
size: "sm",
|
|
313
|
+
clearable: true,
|
|
314
|
+
style: t4,
|
|
315
|
+
"aria-label": t5,
|
|
316
|
+
placeholder: labels.operator,
|
|
317
|
+
data,
|
|
318
|
+
value: op,
|
|
319
|
+
onChange: handleOp,
|
|
320
|
+
comboboxProps: t6
|
|
321
|
+
});
|
|
322
|
+
$[33] = data;
|
|
323
|
+
$[34] = handleOp;
|
|
324
|
+
$[35] = labels.operator;
|
|
325
|
+
$[36] = op;
|
|
326
|
+
$[37] = t5;
|
|
327
|
+
$[38] = t7;
|
|
328
|
+
} else t7 = $[38];
|
|
329
|
+
let t8;
|
|
330
|
+
if ($[39] !== t7 || $[40] !== values) {
|
|
331
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
157
332
|
gap: "xs",
|
|
158
333
|
align: "flex-start",
|
|
159
|
-
children: [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
334
|
+
children: [t7, values]
|
|
335
|
+
});
|
|
336
|
+
$[39] = t7;
|
|
337
|
+
$[40] = values;
|
|
338
|
+
$[41] = t8;
|
|
339
|
+
} else t8 = $[41];
|
|
340
|
+
let t9;
|
|
341
|
+
if ($[42] !== t3 || $[43] !== t8) {
|
|
342
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
343
|
+
gap: 4,
|
|
344
|
+
children: [t3, t8]
|
|
345
|
+
});
|
|
346
|
+
$[42] = t3;
|
|
347
|
+
$[43] = t8;
|
|
348
|
+
$[44] = t9;
|
|
349
|
+
} else t9 = $[44];
|
|
350
|
+
return t9;
|
|
175
351
|
}
|
|
176
352
|
/**
|
|
177
353
|
* Single-choice control. Options resolve through {@link useFilterOptions}
|
|
178
354
|
* (static array, async loader, or none); while a loader is in flight the
|
|
179
355
|
* select shows one disabled placeholder option.
|
|
180
356
|
*/
|
|
181
|
-
function SelectControl(
|
|
182
|
-
const
|
|
357
|
+
function SelectControl(t0) {
|
|
358
|
+
const $ = (0, react_compiler_runtime.c)(15);
|
|
359
|
+
const { def, source } = t0;
|
|
360
|
+
let t1;
|
|
361
|
+
if ($[0] !== def) {
|
|
362
|
+
t1 = (0, _adapttable_core.filterLabel)(def);
|
|
363
|
+
$[0] = def;
|
|
364
|
+
$[1] = t1;
|
|
365
|
+
} else t1 = $[1];
|
|
366
|
+
const label = t1;
|
|
183
367
|
const { options, loading } = (0, _adapttable_core.useFilterOptions)(def);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
data: loading ? [{
|
|
368
|
+
let t2;
|
|
369
|
+
if ($[2] !== loading || $[3] !== options) {
|
|
370
|
+
t2 = loading ? [{
|
|
188
371
|
value: "",
|
|
189
372
|
label: "…",
|
|
190
373
|
disabled: true
|
|
191
374
|
}] : [{
|
|
192
375
|
value: "",
|
|
193
376
|
label: "All"
|
|
194
|
-
}, ...options]
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
377
|
+
}, ...options];
|
|
378
|
+
$[2] = loading;
|
|
379
|
+
$[3] = options;
|
|
380
|
+
$[4] = t2;
|
|
381
|
+
} else t2 = $[4];
|
|
382
|
+
const data = t2;
|
|
383
|
+
const t3 = source.extra[def.key];
|
|
384
|
+
let t4;
|
|
385
|
+
if ($[5] !== t3) {
|
|
386
|
+
t4 = asText(t3);
|
|
387
|
+
$[5] = t3;
|
|
388
|
+
$[6] = t4;
|
|
389
|
+
} else t4 = $[6];
|
|
390
|
+
let t5;
|
|
391
|
+
if ($[7] !== def.key || $[8] !== source) {
|
|
392
|
+
t5 = (e) => source.setExtra(def.key, e.currentTarget.value);
|
|
393
|
+
$[7] = def.key;
|
|
394
|
+
$[8] = source;
|
|
395
|
+
$[9] = t5;
|
|
396
|
+
} else t5 = $[9];
|
|
397
|
+
let t6;
|
|
398
|
+
if ($[10] !== data || $[11] !== label || $[12] !== t4 || $[13] !== t5) {
|
|
399
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.NativeSelect, {
|
|
400
|
+
size: "sm",
|
|
401
|
+
label,
|
|
402
|
+
data,
|
|
403
|
+
value: t4,
|
|
404
|
+
onChange: t5
|
|
405
|
+
});
|
|
406
|
+
$[10] = data;
|
|
407
|
+
$[11] = label;
|
|
408
|
+
$[12] = t4;
|
|
409
|
+
$[13] = t5;
|
|
410
|
+
$[14] = t6;
|
|
411
|
+
} else t6 = $[14];
|
|
412
|
+
return t6;
|
|
198
413
|
}
|
|
199
414
|
/**
|
|
200
415
|
* Multi-choice control. Options resolve through {@link useFilterOptions};
|
|
201
416
|
* while a loader is in flight the group shows a small spinner instead of
|
|
202
417
|
* checkboxes.
|
|
203
418
|
*/
|
|
204
|
-
function MultiSelectControl(
|
|
205
|
-
const
|
|
419
|
+
function MultiSelectControl(t0) {
|
|
420
|
+
const $ = (0, react_compiler_runtime.c)(17);
|
|
421
|
+
const { def, source } = t0;
|
|
422
|
+
let t1;
|
|
423
|
+
if ($[0] !== def) {
|
|
424
|
+
t1 = (0, _adapttable_core.filterLabel)(def);
|
|
425
|
+
$[0] = def;
|
|
426
|
+
$[1] = t1;
|
|
427
|
+
} else t1 = $[1];
|
|
428
|
+
const label = t1;
|
|
206
429
|
const { options, loading } = (0, _adapttable_core.useFilterOptions)(def);
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
430
|
+
const t2 = source.extra[def.key];
|
|
431
|
+
let t3;
|
|
432
|
+
if ($[2] !== t2) {
|
|
433
|
+
t3 = asList(t2);
|
|
434
|
+
$[2] = t2;
|
|
435
|
+
$[3] = t3;
|
|
436
|
+
} else t3 = $[3];
|
|
437
|
+
let t4;
|
|
438
|
+
if ($[4] !== def.key || $[5] !== source) {
|
|
439
|
+
t4 = (values) => source.setExtra(def.key, values);
|
|
440
|
+
$[4] = def.key;
|
|
441
|
+
$[5] = source;
|
|
442
|
+
$[6] = t4;
|
|
443
|
+
} else t4 = $[6];
|
|
444
|
+
let t5;
|
|
445
|
+
if ($[7] !== loading || $[8] !== options) {
|
|
446
|
+
t5 = loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Loader, { size: "xs" }) : options.map(_temp$3);
|
|
447
|
+
$[7] = loading;
|
|
448
|
+
$[8] = options;
|
|
449
|
+
$[9] = t5;
|
|
450
|
+
} else t5 = $[9];
|
|
451
|
+
let t6;
|
|
452
|
+
if ($[10] !== t5) {
|
|
453
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
212
454
|
gap: "sm",
|
|
213
455
|
mt: 4,
|
|
214
|
-
children:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
456
|
+
children: t5
|
|
457
|
+
});
|
|
458
|
+
$[10] = t5;
|
|
459
|
+
$[11] = t6;
|
|
460
|
+
} else t6 = $[11];
|
|
461
|
+
let t7;
|
|
462
|
+
if ($[12] !== label || $[13] !== t3 || $[14] !== t4 || $[15] !== t6) {
|
|
463
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Checkbox.Group, {
|
|
464
|
+
label,
|
|
465
|
+
value: t3,
|
|
466
|
+
onChange: t4,
|
|
467
|
+
children: t6
|
|
468
|
+
});
|
|
469
|
+
$[12] = label;
|
|
470
|
+
$[13] = t3;
|
|
471
|
+
$[14] = t4;
|
|
472
|
+
$[15] = t6;
|
|
473
|
+
$[16] = t7;
|
|
474
|
+
} else t7 = $[16];
|
|
475
|
+
return t7;
|
|
221
476
|
}
|
|
222
477
|
/** One labeled, kit-native control for a single filter definition. */
|
|
223
|
-
function
|
|
478
|
+
function _temp$3(option) {
|
|
479
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Checkbox, {
|
|
480
|
+
size: "sm",
|
|
481
|
+
value: option.value,
|
|
482
|
+
label: option.label
|
|
483
|
+
}, option.value);
|
|
484
|
+
}
|
|
485
|
+
function FilterControl(t0) {
|
|
486
|
+
const $ = (0, react_compiler_runtime.c)(22);
|
|
487
|
+
const { def, source, labels } = t0;
|
|
224
488
|
switch (def.type) {
|
|
225
|
-
case "text":
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
def
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
489
|
+
case "text": {
|
|
490
|
+
let t1;
|
|
491
|
+
if ($[0] !== def) {
|
|
492
|
+
t1 = (0, _adapttable_core.filterLabel)(def);
|
|
493
|
+
$[0] = def;
|
|
494
|
+
$[1] = t1;
|
|
495
|
+
} else t1 = $[1];
|
|
496
|
+
const t2 = def.placeholder;
|
|
497
|
+
const t3 = source.extra[def.key];
|
|
498
|
+
let t4;
|
|
499
|
+
if ($[2] !== t3) {
|
|
500
|
+
t4 = asText(t3);
|
|
501
|
+
$[2] = t3;
|
|
502
|
+
$[3] = t4;
|
|
503
|
+
} else t4 = $[3];
|
|
504
|
+
let t5;
|
|
505
|
+
if ($[4] !== def.key || $[5] !== source) {
|
|
506
|
+
t5 = (e) => source.setExtra(def.key, e.currentTarget.value);
|
|
507
|
+
$[4] = def.key;
|
|
508
|
+
$[5] = source;
|
|
509
|
+
$[6] = t5;
|
|
510
|
+
} else t5 = $[6];
|
|
511
|
+
let t6;
|
|
512
|
+
if ($[7] !== def.placeholder || $[8] !== t1 || $[9] !== t4 || $[10] !== t5) {
|
|
513
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.TextInput, {
|
|
514
|
+
size: "sm",
|
|
515
|
+
label: t1,
|
|
516
|
+
placeholder: t2,
|
|
517
|
+
value: t4,
|
|
518
|
+
onChange: t5
|
|
519
|
+
});
|
|
520
|
+
$[7] = def.placeholder;
|
|
521
|
+
$[8] = t1;
|
|
522
|
+
$[9] = t4;
|
|
523
|
+
$[10] = t5;
|
|
524
|
+
$[11] = t6;
|
|
525
|
+
} else t6 = $[11];
|
|
526
|
+
return t6;
|
|
527
|
+
}
|
|
528
|
+
case "select": {
|
|
529
|
+
let t1;
|
|
530
|
+
if ($[12] !== def || $[13] !== source) {
|
|
531
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectControl, {
|
|
532
|
+
def,
|
|
533
|
+
source
|
|
534
|
+
});
|
|
535
|
+
$[12] = def;
|
|
536
|
+
$[13] = source;
|
|
537
|
+
$[14] = t1;
|
|
538
|
+
} else t1 = $[14];
|
|
539
|
+
return t1;
|
|
540
|
+
}
|
|
541
|
+
case "multiSelect": {
|
|
542
|
+
let t1;
|
|
543
|
+
if ($[15] !== def || $[16] !== source) {
|
|
544
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MultiSelectControl, {
|
|
545
|
+
def,
|
|
546
|
+
source
|
|
547
|
+
});
|
|
548
|
+
$[15] = def;
|
|
549
|
+
$[16] = source;
|
|
550
|
+
$[17] = t1;
|
|
551
|
+
} else t1 = $[17];
|
|
552
|
+
return t1;
|
|
553
|
+
}
|
|
240
554
|
case "dateRange":
|
|
241
|
-
case "numberRange":
|
|
242
|
-
|
|
243
|
-
source
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
555
|
+
case "numberRange": {
|
|
556
|
+
let t1;
|
|
557
|
+
if ($[18] !== def || $[19] !== labels || $[20] !== source) {
|
|
558
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RangeField, {
|
|
559
|
+
def,
|
|
560
|
+
source,
|
|
561
|
+
kind: def.type,
|
|
562
|
+
labels
|
|
563
|
+
});
|
|
564
|
+
$[18] = def;
|
|
565
|
+
$[19] = labels;
|
|
566
|
+
$[20] = source;
|
|
567
|
+
$[21] = t1;
|
|
568
|
+
} else t1 = $[21];
|
|
569
|
+
return t1;
|
|
570
|
+
}
|
|
247
571
|
}
|
|
248
572
|
}
|
|
249
573
|
/**
|
|
@@ -256,264 +580,664 @@ function FilterControl({ def, source, labels }) {
|
|
|
256
580
|
*
|
|
257
581
|
* @typeParam TRow - The row type.
|
|
258
582
|
*/
|
|
259
|
-
function AutoFilterForm(
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
583
|
+
function AutoFilterForm(t0) {
|
|
584
|
+
const $ = (0, react_compiler_runtime.c)(9);
|
|
585
|
+
const { defs, source, labels } = t0;
|
|
586
|
+
let t1;
|
|
587
|
+
if ($[0] !== defs || $[1] !== labels || $[2] !== source) {
|
|
588
|
+
let t2;
|
|
589
|
+
if ($[4] !== labels || $[5] !== source) {
|
|
590
|
+
t2 = (def) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterControl, {
|
|
591
|
+
def,
|
|
592
|
+
source,
|
|
593
|
+
labels
|
|
594
|
+
}, def.key);
|
|
595
|
+
$[4] = labels;
|
|
596
|
+
$[5] = source;
|
|
597
|
+
$[6] = t2;
|
|
598
|
+
} else t2 = $[6];
|
|
599
|
+
t1 = defs.map(t2);
|
|
600
|
+
$[0] = defs;
|
|
601
|
+
$[1] = labels;
|
|
602
|
+
$[2] = source;
|
|
603
|
+
$[3] = t1;
|
|
604
|
+
} else t1 = $[3];
|
|
605
|
+
let t2;
|
|
606
|
+
if ($[7] !== t1) {
|
|
607
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
|
|
608
|
+
gap: "sm",
|
|
609
|
+
children: t1
|
|
610
|
+
});
|
|
611
|
+
$[7] = t1;
|
|
612
|
+
$[8] = t2;
|
|
613
|
+
} else t2 = $[8];
|
|
614
|
+
return t2;
|
|
268
615
|
}
|
|
269
616
|
//#endregion
|
|
270
617
|
//#region src/components/BulkActionBar.tsx
|
|
271
618
|
/** Selection toolbar: count, clear, and the configured bulk-action buttons. */
|
|
272
|
-
function BulkActionBar(
|
|
619
|
+
function BulkActionBar(t0) {
|
|
620
|
+
const $ = (0, react_compiler_runtime.c)(56);
|
|
621
|
+
const { selection, total, bulkActions, confirm, labels } = t0;
|
|
273
622
|
const { selectedIds, selectedCount, clear, allMatching } = selection;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
623
|
+
let t1;
|
|
624
|
+
if ($[0] !== clear || $[1] !== confirm || $[2] !== labels.cancel) {
|
|
625
|
+
t1 = {
|
|
626
|
+
confirm,
|
|
627
|
+
cancelLabel: labels.cancel,
|
|
628
|
+
onComplete: clear
|
|
629
|
+
};
|
|
630
|
+
$[0] = clear;
|
|
631
|
+
$[1] = confirm;
|
|
632
|
+
$[2] = labels.cancel;
|
|
633
|
+
$[3] = t1;
|
|
634
|
+
} else t1 = $[3];
|
|
635
|
+
const { pending, run } = (0, _adapttable_core.useBulkActionRunner)(t1);
|
|
279
636
|
if (selectedCount === 0) return null;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
637
|
+
let T0;
|
|
638
|
+
let T1;
|
|
639
|
+
let T2;
|
|
640
|
+
let t10;
|
|
641
|
+
let t2;
|
|
642
|
+
let t3;
|
|
643
|
+
let t4;
|
|
644
|
+
let t5;
|
|
645
|
+
let t6;
|
|
646
|
+
let t7;
|
|
647
|
+
let t8;
|
|
648
|
+
let t9;
|
|
649
|
+
if ($[4] !== allMatching || $[5] !== bulkActions || $[6] !== clear || $[7] !== labels || $[8] !== pending || $[9] !== run || $[10] !== selectedCount || $[11] !== selectedIds || $[12] !== total) {
|
|
650
|
+
const ids = [...selectedIds];
|
|
651
|
+
T2 = _mantine_core.Stack;
|
|
652
|
+
t10 = "xs";
|
|
653
|
+
T1 = _mantine_core.Group;
|
|
654
|
+
t6 = "space-between";
|
|
655
|
+
t7 = "wrap";
|
|
656
|
+
t8 = "sm";
|
|
657
|
+
let t11;
|
|
658
|
+
if ($[25] !== labels || $[26] !== selectedCount) {
|
|
659
|
+
t11 = labels.selectedCount(selectedCount);
|
|
660
|
+
$[25] = labels;
|
|
661
|
+
$[26] = selectedCount;
|
|
662
|
+
$[27] = t11;
|
|
663
|
+
} else t11 = $[27];
|
|
664
|
+
if ($[28] !== t11) {
|
|
665
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
288
666
|
fz: "sm",
|
|
289
|
-
children:
|
|
290
|
-
})
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
667
|
+
children: t11
|
|
668
|
+
});
|
|
669
|
+
$[28] = t11;
|
|
670
|
+
$[29] = t9;
|
|
671
|
+
} else t9 = $[29];
|
|
672
|
+
T0 = _mantine_core.Group;
|
|
673
|
+
t2 = "xs";
|
|
674
|
+
t3 = "wrap";
|
|
675
|
+
const t12 = pending !== null;
|
|
676
|
+
if ($[30] !== clear || $[31] !== labels.clearAll || $[32] !== t12) {
|
|
677
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
678
|
+
size: "xs",
|
|
679
|
+
variant: "subtle",
|
|
680
|
+
onClick: clear,
|
|
681
|
+
disabled: t12,
|
|
682
|
+
children: labels.clearAll
|
|
683
|
+
});
|
|
684
|
+
$[30] = clear;
|
|
685
|
+
$[31] = labels.clearAll;
|
|
686
|
+
$[32] = t12;
|
|
687
|
+
$[33] = t4;
|
|
688
|
+
} else t4 = $[33];
|
|
689
|
+
t5 = bulkActions.map((action) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BulkButton, {
|
|
690
|
+
action,
|
|
691
|
+
ids,
|
|
692
|
+
pending,
|
|
693
|
+
onRun: (a) => {
|
|
694
|
+
if (allMatching) run(a, ids, {
|
|
695
|
+
allMatching: true,
|
|
696
|
+
total
|
|
697
|
+
});
|
|
698
|
+
else run(a, ids);
|
|
699
|
+
}
|
|
700
|
+
}, action.key));
|
|
701
|
+
$[4] = allMatching;
|
|
702
|
+
$[5] = bulkActions;
|
|
703
|
+
$[6] = clear;
|
|
704
|
+
$[7] = labels;
|
|
705
|
+
$[8] = pending;
|
|
706
|
+
$[9] = run;
|
|
707
|
+
$[10] = selectedCount;
|
|
708
|
+
$[11] = selectedIds;
|
|
709
|
+
$[12] = total;
|
|
710
|
+
$[13] = T0;
|
|
711
|
+
$[14] = T1;
|
|
712
|
+
$[15] = T2;
|
|
713
|
+
$[16] = t10;
|
|
714
|
+
$[17] = t2;
|
|
715
|
+
$[18] = t3;
|
|
716
|
+
$[19] = t4;
|
|
717
|
+
$[20] = t5;
|
|
718
|
+
$[21] = t6;
|
|
719
|
+
$[22] = t7;
|
|
720
|
+
$[23] = t8;
|
|
721
|
+
$[24] = t9;
|
|
722
|
+
} else {
|
|
723
|
+
T0 = $[13];
|
|
724
|
+
T1 = $[14];
|
|
725
|
+
T2 = $[15];
|
|
726
|
+
t10 = $[16];
|
|
727
|
+
t2 = $[17];
|
|
728
|
+
t3 = $[18];
|
|
729
|
+
t4 = $[19];
|
|
730
|
+
t5 = $[20];
|
|
731
|
+
t6 = $[21];
|
|
732
|
+
t7 = $[22];
|
|
733
|
+
t8 = $[23];
|
|
734
|
+
t9 = $[24];
|
|
735
|
+
}
|
|
736
|
+
let t11;
|
|
737
|
+
if ($[34] !== T0 || $[35] !== t2 || $[36] !== t3 || $[37] !== t4 || $[38] !== t5) {
|
|
738
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(T0, {
|
|
739
|
+
gap: t2,
|
|
740
|
+
wrap: t3,
|
|
741
|
+
children: [t4, t5]
|
|
742
|
+
});
|
|
743
|
+
$[34] = T0;
|
|
744
|
+
$[35] = t2;
|
|
745
|
+
$[36] = t3;
|
|
746
|
+
$[37] = t4;
|
|
747
|
+
$[38] = t5;
|
|
748
|
+
$[39] = t11;
|
|
749
|
+
} else t11 = $[39];
|
|
750
|
+
let t12;
|
|
751
|
+
if ($[40] !== T1 || $[41] !== t11 || $[42] !== t6 || $[43] !== t7 || $[44] !== t8 || $[45] !== t9) {
|
|
752
|
+
t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(T1, {
|
|
753
|
+
justify: t6,
|
|
754
|
+
wrap: t7,
|
|
755
|
+
gap: t8,
|
|
756
|
+
children: [t9, t11]
|
|
757
|
+
});
|
|
758
|
+
$[40] = T1;
|
|
759
|
+
$[41] = t11;
|
|
760
|
+
$[42] = t6;
|
|
761
|
+
$[43] = t7;
|
|
762
|
+
$[44] = t8;
|
|
763
|
+
$[45] = t9;
|
|
764
|
+
$[46] = t12;
|
|
765
|
+
} else t12 = $[46];
|
|
766
|
+
let t13;
|
|
767
|
+
if ($[47] !== labels || $[48] !== selection || $[49] !== total) {
|
|
768
|
+
t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScopeBanner, {
|
|
313
769
|
selection,
|
|
314
770
|
total,
|
|
315
771
|
labels
|
|
316
|
-
})
|
|
317
|
-
|
|
772
|
+
});
|
|
773
|
+
$[47] = labels;
|
|
774
|
+
$[48] = selection;
|
|
775
|
+
$[49] = total;
|
|
776
|
+
$[50] = t13;
|
|
777
|
+
} else t13 = $[50];
|
|
778
|
+
let t14;
|
|
779
|
+
if ($[51] !== T2 || $[52] !== t10 || $[53] !== t12 || $[54] !== t13) {
|
|
780
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(T2, {
|
|
781
|
+
gap: t10,
|
|
782
|
+
children: [t12, t13]
|
|
783
|
+
});
|
|
784
|
+
$[51] = T2;
|
|
785
|
+
$[52] = t10;
|
|
786
|
+
$[53] = t12;
|
|
787
|
+
$[54] = t13;
|
|
788
|
+
$[55] = t14;
|
|
789
|
+
} else t14 = $[55];
|
|
790
|
+
return t14;
|
|
318
791
|
}
|
|
319
792
|
/**
|
|
320
793
|
* Gmail-style scope banner. When every row on the page is selected but more
|
|
321
794
|
* rows match elsewhere, offer to widen the selection to all matching rows;
|
|
322
795
|
* once widened, announce the scope and offer to clear it.
|
|
323
796
|
*/
|
|
324
|
-
function ScopeBanner(
|
|
797
|
+
function ScopeBanner(t0) {
|
|
798
|
+
const $ = (0, react_compiler_runtime.c)(7);
|
|
799
|
+
const { selection, total, labels } = t0;
|
|
325
800
|
if (selection.headerState !== "all" || total <= selection.visibleIds.length) return null;
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
children:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
children:
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
801
|
+
let t1;
|
|
802
|
+
if ($[0] !== labels || $[1] !== selection.allMatching || $[2] !== selection.clear || $[3] !== selection.selectAllMatching || $[4] !== selection.selectedCount || $[5] !== total) {
|
|
803
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
804
|
+
role: "status",
|
|
805
|
+
gap: "xs",
|
|
806
|
+
wrap: "wrap",
|
|
807
|
+
children: selection.allMatching ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
808
|
+
fz: "sm",
|
|
809
|
+
children: labels.allMatchingSelected(total)
|
|
810
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
811
|
+
size: "xs",
|
|
812
|
+
variant: "subtle",
|
|
813
|
+
onClick: selection.clear,
|
|
814
|
+
children: labels.clearAll
|
|
815
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
816
|
+
fz: "sm",
|
|
817
|
+
children: labels.pageSelected(selection.selectedCount)
|
|
818
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
819
|
+
size: "xs",
|
|
820
|
+
variant: "light",
|
|
821
|
+
onClick: selection.selectAllMatching,
|
|
822
|
+
children: labels.selectAllMatching(total)
|
|
823
|
+
})] })
|
|
824
|
+
});
|
|
825
|
+
$[0] = labels;
|
|
826
|
+
$[1] = selection.allMatching;
|
|
827
|
+
$[2] = selection.clear;
|
|
828
|
+
$[3] = selection.selectAllMatching;
|
|
829
|
+
$[4] = selection.selectedCount;
|
|
830
|
+
$[5] = total;
|
|
831
|
+
$[6] = t1;
|
|
832
|
+
} else t1 = $[6];
|
|
833
|
+
return t1;
|
|
348
834
|
}
|
|
349
|
-
function BulkButton(
|
|
350
|
-
const
|
|
835
|
+
function BulkButton(t0) {
|
|
836
|
+
const $ = (0, react_compiler_runtime.c)(18);
|
|
837
|
+
const { action, ids, pending, onRun } = t0;
|
|
838
|
+
let t1;
|
|
839
|
+
if ($[0] !== action || $[1] !== ids) {
|
|
840
|
+
t1 = (0, _adapttable_core.resolveDisabledReason)(action.disabledReason?.(ids));
|
|
841
|
+
$[0] = action;
|
|
842
|
+
$[1] = ids;
|
|
843
|
+
$[2] = t1;
|
|
844
|
+
} else t1 = $[2];
|
|
845
|
+
const reason = t1;
|
|
351
846
|
const ineligible = reason !== void 0;
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
847
|
+
let t2;
|
|
848
|
+
if ($[3] !== action || $[4] !== onRun) {
|
|
849
|
+
t2 = () => onRun(action);
|
|
850
|
+
$[3] = action;
|
|
851
|
+
$[4] = onRun;
|
|
852
|
+
$[5] = t2;
|
|
853
|
+
} else t2 = $[5];
|
|
854
|
+
const t3 = pending === action.key;
|
|
855
|
+
const t4 = ineligible || pending !== null && pending !== action.key;
|
|
856
|
+
let t5;
|
|
857
|
+
if ($[6] !== action.color || $[7] !== action.icon || $[8] !== action.label || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
|
|
858
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
859
|
+
size: "xs",
|
|
860
|
+
color: action.color,
|
|
861
|
+
leftSection: action.icon,
|
|
862
|
+
onClick: t2,
|
|
863
|
+
loading: t3,
|
|
864
|
+
disabled: t4,
|
|
865
|
+
children: action.label
|
|
866
|
+
});
|
|
867
|
+
$[6] = action.color;
|
|
868
|
+
$[7] = action.icon;
|
|
869
|
+
$[8] = action.label;
|
|
870
|
+
$[9] = t2;
|
|
871
|
+
$[10] = t3;
|
|
872
|
+
$[11] = t4;
|
|
873
|
+
$[12] = t5;
|
|
874
|
+
} else t5 = $[12];
|
|
875
|
+
const button = t5;
|
|
876
|
+
if (reason !== void 0) {
|
|
877
|
+
let t6;
|
|
878
|
+
if ($[13] !== button) {
|
|
879
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: button });
|
|
880
|
+
$[13] = button;
|
|
881
|
+
$[14] = t6;
|
|
882
|
+
} else t6 = $[14];
|
|
883
|
+
let t7;
|
|
884
|
+
if ($[15] !== reason || $[16] !== t6) {
|
|
885
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Tooltip, {
|
|
886
|
+
label: reason,
|
|
887
|
+
withArrow: true,
|
|
888
|
+
openDelay: 150,
|
|
889
|
+
children: t6
|
|
890
|
+
});
|
|
891
|
+
$[15] = reason;
|
|
892
|
+
$[16] = t6;
|
|
893
|
+
$[17] = t7;
|
|
894
|
+
} else t7 = $[17];
|
|
895
|
+
return t7;
|
|
896
|
+
}
|
|
367
897
|
return button;
|
|
368
898
|
}
|
|
369
899
|
//#endregion
|
|
370
900
|
//#region src/components/ColumnMenu.tsx
|
|
901
|
+
/**
|
|
902
|
+
* Props for the column menu — the shared core contract, plus the injected
|
|
903
|
+
* actions column: when the table has row actions, the menu lists it too
|
|
904
|
+
* (named by `labels.actions`) with an eye toggle and a one-click end-pin.
|
|
905
|
+
*/
|
|
371
906
|
/** The eye toggle + struck-through name shared by data and actions rows. */
|
|
372
|
-
function RowVisibility(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
907
|
+
function RowVisibility(t0) {
|
|
908
|
+
const $ = (0, react_compiler_runtime.c)(17);
|
|
909
|
+
const { hidden, name, labels, onToggle } = t0;
|
|
910
|
+
const t1 = hidden ? "subtle" : "light";
|
|
911
|
+
const t2 = hidden ? "gray" : "blue";
|
|
912
|
+
const t3 = `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`;
|
|
913
|
+
const t4 = !hidden;
|
|
914
|
+
let t5;
|
|
915
|
+
if ($[0] !== hidden) {
|
|
916
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.EyeIcon, { off: hidden });
|
|
917
|
+
$[0] = hidden;
|
|
918
|
+
$[1] = t5;
|
|
919
|
+
} else t5 = $[1];
|
|
920
|
+
let t6;
|
|
921
|
+
if ($[2] !== onToggle || $[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4 || $[7] !== t5) {
|
|
922
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
923
|
+
variant: t1,
|
|
924
|
+
color: t2,
|
|
925
|
+
size: "sm",
|
|
926
|
+
"aria-label": t3,
|
|
927
|
+
"aria-pressed": t4,
|
|
928
|
+
onClick: onToggle,
|
|
929
|
+
children: t5
|
|
930
|
+
});
|
|
931
|
+
$[2] = onToggle;
|
|
932
|
+
$[3] = t1;
|
|
933
|
+
$[4] = t2;
|
|
934
|
+
$[5] = t3;
|
|
935
|
+
$[6] = t4;
|
|
936
|
+
$[7] = t5;
|
|
937
|
+
$[8] = t6;
|
|
938
|
+
} else t6 = $[8];
|
|
939
|
+
let t7;
|
|
940
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
941
|
+
t7 = { flex: 1 };
|
|
942
|
+
$[9] = t7;
|
|
943
|
+
} else t7 = $[9];
|
|
944
|
+
const t8 = hidden ? "dimmed" : void 0;
|
|
945
|
+
const t9 = hidden ? "line-through" : void 0;
|
|
946
|
+
let t10;
|
|
947
|
+
if ($[10] !== name || $[11] !== t8 || $[12] !== t9) {
|
|
948
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
949
|
+
size: "sm",
|
|
950
|
+
style: t7,
|
|
951
|
+
c: t8,
|
|
952
|
+
td: t9,
|
|
953
|
+
children: name
|
|
954
|
+
});
|
|
955
|
+
$[10] = name;
|
|
956
|
+
$[11] = t8;
|
|
957
|
+
$[12] = t9;
|
|
958
|
+
$[13] = t10;
|
|
959
|
+
} else t10 = $[13];
|
|
960
|
+
let t11;
|
|
961
|
+
if ($[14] !== t10 || $[15] !== t6) {
|
|
962
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t6, t10] });
|
|
963
|
+
$[14] = t10;
|
|
964
|
+
$[15] = t6;
|
|
965
|
+
$[16] = t11;
|
|
966
|
+
} else t11 = $[16];
|
|
967
|
+
return t11;
|
|
388
968
|
}
|
|
389
969
|
/** The pin control shared by data and actions rows. */
|
|
390
|
-
function PinToggle(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
970
|
+
function PinToggle(t0) {
|
|
971
|
+
const $ = (0, react_compiler_runtime.c)(6);
|
|
972
|
+
const { pinned, label, onClick } = t0;
|
|
973
|
+
const t1 = pinned ? "filled" : "subtle";
|
|
974
|
+
const t2 = pinned ? "blue" : "gray";
|
|
975
|
+
let t3;
|
|
976
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
977
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.PinIcon, {});
|
|
978
|
+
$[0] = t3;
|
|
979
|
+
} else t3 = $[0];
|
|
980
|
+
let t4;
|
|
981
|
+
if ($[1] !== label || $[2] !== onClick || $[3] !== t1 || $[4] !== t2) {
|
|
982
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
983
|
+
variant: t1,
|
|
984
|
+
color: t2,
|
|
985
|
+
size: "sm",
|
|
986
|
+
"aria-label": label,
|
|
987
|
+
onClick,
|
|
988
|
+
children: t3
|
|
989
|
+
});
|
|
990
|
+
$[1] = label;
|
|
991
|
+
$[2] = onClick;
|
|
992
|
+
$[3] = t1;
|
|
993
|
+
$[4] = t2;
|
|
994
|
+
$[5] = t4;
|
|
995
|
+
} else t4 = $[5];
|
|
996
|
+
return t4;
|
|
399
997
|
}
|
|
400
998
|
/**
|
|
401
999
|
* The injected actions column's menu row: the same eye toggle as data
|
|
402
1000
|
* columns plus a pin toggle that flips right ↔ unpinned in one click. No
|
|
403
1001
|
* drag grip (the column always trails) and no left pin.
|
|
404
1002
|
*/
|
|
405
|
-
function ActionsRow(
|
|
406
|
-
const
|
|
1003
|
+
function ActionsRow(t0) {
|
|
1004
|
+
const $ = (0, react_compiler_runtime.c)(19);
|
|
1005
|
+
const { layout, labels } = t0;
|
|
1006
|
+
let t1;
|
|
1007
|
+
if ($[0] !== layout) {
|
|
1008
|
+
t1 = layout.isHidden(_adapttable_core.ACTIONS_COLUMN_KEY);
|
|
1009
|
+
$[0] = layout;
|
|
1010
|
+
$[1] = t1;
|
|
1011
|
+
} else t1 = $[1];
|
|
1012
|
+
const hidden = t1;
|
|
407
1013
|
const pinned = layout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] === "right";
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
]
|
|
428
|
-
|
|
1014
|
+
let t2;
|
|
1015
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1016
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, { w: 22 });
|
|
1017
|
+
$[2] = t2;
|
|
1018
|
+
} else t2 = $[2];
|
|
1019
|
+
let t3;
|
|
1020
|
+
if ($[3] !== layout) {
|
|
1021
|
+
t3 = () => layout.toggleVisible(_adapttable_core.ACTIONS_COLUMN_KEY);
|
|
1022
|
+
$[3] = layout;
|
|
1023
|
+
$[4] = t3;
|
|
1024
|
+
} else t3 = $[4];
|
|
1025
|
+
let t4;
|
|
1026
|
+
if ($[5] !== hidden || $[6] !== labels || $[7] !== t3) {
|
|
1027
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowVisibility, {
|
|
1028
|
+
hidden,
|
|
1029
|
+
name: labels.actions,
|
|
1030
|
+
labels,
|
|
1031
|
+
onToggle: t3
|
|
1032
|
+
});
|
|
1033
|
+
$[5] = hidden;
|
|
1034
|
+
$[6] = labels;
|
|
1035
|
+
$[7] = t3;
|
|
1036
|
+
$[8] = t4;
|
|
1037
|
+
} else t4 = $[8];
|
|
1038
|
+
const t5 = `${pinned ? labels.unpin : labels.pinRight}: ${labels.actions}`;
|
|
1039
|
+
let t6;
|
|
1040
|
+
if ($[9] !== layout || $[10] !== pinned) {
|
|
1041
|
+
t6 = () => layout.setPinned(_adapttable_core.ACTIONS_COLUMN_KEY, pinned ? void 0 : "right");
|
|
1042
|
+
$[9] = layout;
|
|
1043
|
+
$[10] = pinned;
|
|
1044
|
+
$[11] = t6;
|
|
1045
|
+
} else t6 = $[11];
|
|
1046
|
+
let t7;
|
|
1047
|
+
if ($[12] !== pinned || $[13] !== t5 || $[14] !== t6) {
|
|
1048
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinToggle, {
|
|
1049
|
+
pinned,
|
|
1050
|
+
label: t5,
|
|
1051
|
+
onClick: t6
|
|
1052
|
+
});
|
|
1053
|
+
$[12] = pinned;
|
|
1054
|
+
$[13] = t5;
|
|
1055
|
+
$[14] = t6;
|
|
1056
|
+
$[15] = t7;
|
|
1057
|
+
} else t7 = $[15];
|
|
1058
|
+
let t8;
|
|
1059
|
+
if ($[16] !== t4 || $[17] !== t7) {
|
|
1060
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1061
|
+
justify: "flex-start",
|
|
1062
|
+
wrap: "nowrap",
|
|
1063
|
+
gap: 6,
|
|
1064
|
+
px: 4,
|
|
1065
|
+
py: 2,
|
|
1066
|
+
children: [
|
|
1067
|
+
t2,
|
|
1068
|
+
t4,
|
|
1069
|
+
t7
|
|
1070
|
+
]
|
|
1071
|
+
});
|
|
1072
|
+
$[16] = t4;
|
|
1073
|
+
$[17] = t7;
|
|
1074
|
+
$[18] = t8;
|
|
1075
|
+
} else t8 = $[18];
|
|
1076
|
+
return t8;
|
|
429
1077
|
}
|
|
430
1078
|
/**
|
|
431
1079
|
* Column-management popover: per-column drag grip (reorder), eye (show/hide),
|
|
432
1080
|
* and pin toggle. Keyboard users focus a grip and use arrow keys.
|
|
433
1081
|
*/
|
|
434
|
-
function ColumnMenu(
|
|
1082
|
+
function ColumnMenu(t0) {
|
|
1083
|
+
const $ = (0, react_compiler_runtime.c)(31);
|
|
1084
|
+
const { allColumns, layout, labels, hasRowActions: t1 } = t0;
|
|
1085
|
+
const hasRowActions = t1 === void 0 ? false : t1;
|
|
435
1086
|
const drag = (0, _adapttable_core.useColumnDragState)();
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
withinPortal: true,
|
|
440
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Target, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
1087
|
+
let t2;
|
|
1088
|
+
if ($[0] !== labels.columns) {
|
|
1089
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Target, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
441
1090
|
variant: "default",
|
|
442
1091
|
size: "sm",
|
|
443
1092
|
children: labels.columns
|
|
444
|
-
}) })
|
|
1093
|
+
}) });
|
|
1094
|
+
$[0] = labels.columns;
|
|
1095
|
+
$[1] = t2;
|
|
1096
|
+
} else t2 = $[1];
|
|
1097
|
+
let t3;
|
|
1098
|
+
if ($[2] !== labels.columns) {
|
|
1099
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
1100
|
+
size: "xs",
|
|
1101
|
+
c: "dimmed",
|
|
1102
|
+
fw: 600,
|
|
1103
|
+
tt: "uppercase",
|
|
1104
|
+
px: 4,
|
|
1105
|
+
pb: 6,
|
|
1106
|
+
children: labels.columns
|
|
1107
|
+
});
|
|
1108
|
+
$[2] = labels.columns;
|
|
1109
|
+
$[3] = t3;
|
|
1110
|
+
} else t3 = $[3];
|
|
1111
|
+
let t4;
|
|
1112
|
+
if ($[4] !== allColumns || $[5] !== drag || $[6] !== labels || $[7] !== layout) {
|
|
1113
|
+
let t5;
|
|
1114
|
+
if ($[9] !== drag || $[10] !== labels || $[11] !== layout) {
|
|
1115
|
+
t5 = (r) => {
|
|
1116
|
+
const indicator = drag.rowAttrs(r.key, r.index);
|
|
1117
|
+
const edge = indicator["data-drop"];
|
|
1118
|
+
const edgeOffset = edge === "before" ? "2px" : "-2px";
|
|
1119
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1120
|
+
justify: "flex-start",
|
|
1121
|
+
wrap: "nowrap",
|
|
1122
|
+
gap: 6,
|
|
1123
|
+
px: 4,
|
|
1124
|
+
py: 2,
|
|
1125
|
+
style: {
|
|
1126
|
+
cursor: "grab",
|
|
1127
|
+
opacity: "data-dragging" in indicator ? .4 : void 0,
|
|
1128
|
+
boxShadow: edge ? `inset 0 ${edgeOffset} 0 0 var(--mantine-primary-color-filled)` : void 0
|
|
1129
|
+
},
|
|
1130
|
+
...drag.rowDragProps(r.key, r.index),
|
|
1131
|
+
...drag.dropProps(r.index, layout.move),
|
|
1132
|
+
...indicator,
|
|
1133
|
+
children: [
|
|
1134
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
1135
|
+
variant: "subtle",
|
|
1136
|
+
color: "gray",
|
|
1137
|
+
size: "sm",
|
|
1138
|
+
style: { cursor: "grab" },
|
|
1139
|
+
...(0, _adapttable_core.columnReorderKeyProps)(r.key, r.index, layout.move, `${labels.moveLeft} / ${labels.moveRight}: ${r.name}`),
|
|
1140
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.GripIcon, {})
|
|
1141
|
+
}),
|
|
1142
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowVisibility, {
|
|
1143
|
+
hidden: r.hidden,
|
|
1144
|
+
name: r.name,
|
|
1145
|
+
labels,
|
|
1146
|
+
onToggle: () => layout.toggleVisible(r.key)
|
|
1147
|
+
}),
|
|
1148
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinToggle, {
|
|
1149
|
+
pinned: r.pinned !== void 0,
|
|
1150
|
+
label: `${(0, _adapttable_core.pinActionLabel)(r.pinned, labels)}: ${r.name}`,
|
|
1151
|
+
onClick: () => layout.setPinned(r.key, (0, _adapttable_core.nextPinSide)(r.pinned))
|
|
1152
|
+
})
|
|
1153
|
+
]
|
|
1154
|
+
}, r.key);
|
|
1155
|
+
};
|
|
1156
|
+
$[9] = drag;
|
|
1157
|
+
$[10] = labels;
|
|
1158
|
+
$[11] = layout;
|
|
1159
|
+
$[12] = t5;
|
|
1160
|
+
} else t5 = $[12];
|
|
1161
|
+
t4 = (0, _adapttable_core.columnMenuRows)(allColumns, layout).map(t5);
|
|
1162
|
+
$[4] = allColumns;
|
|
1163
|
+
$[5] = drag;
|
|
1164
|
+
$[6] = labels;
|
|
1165
|
+
$[7] = layout;
|
|
1166
|
+
$[8] = t4;
|
|
1167
|
+
} else t4 = $[8];
|
|
1168
|
+
let t5;
|
|
1169
|
+
if ($[13] !== hasRowActions || $[14] !== labels || $[15] !== layout) {
|
|
1170
|
+
t5 = hasRowActions && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Divider, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionsRow, {
|
|
1171
|
+
layout,
|
|
1172
|
+
labels
|
|
1173
|
+
})] });
|
|
1174
|
+
$[13] = hasRowActions;
|
|
1175
|
+
$[14] = labels;
|
|
1176
|
+
$[15] = layout;
|
|
1177
|
+
$[16] = t5;
|
|
1178
|
+
} else t5 = $[16];
|
|
1179
|
+
let t6;
|
|
1180
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1181
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Divider, {});
|
|
1182
|
+
$[17] = t6;
|
|
1183
|
+
} else t6 = $[17];
|
|
1184
|
+
let t7;
|
|
1185
|
+
if ($[18] !== layout) {
|
|
1186
|
+
t7 = () => layout.reset();
|
|
1187
|
+
$[18] = layout;
|
|
1188
|
+
$[19] = t7;
|
|
1189
|
+
} else t7 = $[19];
|
|
1190
|
+
let t8;
|
|
1191
|
+
if ($[20] !== labels.resetColumns || $[21] !== t7) {
|
|
1192
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
1193
|
+
variant: "subtle",
|
|
1194
|
+
size: "xs",
|
|
1195
|
+
fullWidth: true,
|
|
1196
|
+
justify: "flex-start",
|
|
1197
|
+
onClick: t7,
|
|
1198
|
+
children: labels.resetColumns
|
|
1199
|
+
});
|
|
1200
|
+
$[20] = labels.resetColumns;
|
|
1201
|
+
$[21] = t7;
|
|
1202
|
+
$[22] = t8;
|
|
1203
|
+
} else t8 = $[22];
|
|
1204
|
+
let t9;
|
|
1205
|
+
if ($[23] !== t3 || $[24] !== t4 || $[25] !== t5 || $[26] !== t8) {
|
|
1206
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Dropdown, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
|
|
445
1207
|
p: 4,
|
|
446
1208
|
miw: 250,
|
|
447
1209
|
children: [
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
px: 4,
|
|
454
|
-
pb: 6,
|
|
455
|
-
children: labels.columns
|
|
456
|
-
}),
|
|
457
|
-
(0, _adapttable_core.columnMenuRows)(allColumns, layout).map((r) => {
|
|
458
|
-
const indicator = drag.rowAttrs(r.key, r.index);
|
|
459
|
-
const edge = indicator["data-drop"];
|
|
460
|
-
const edgeOffset = edge === "before" ? "2px" : "-2px";
|
|
461
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
462
|
-
justify: "flex-start",
|
|
463
|
-
wrap: "nowrap",
|
|
464
|
-
gap: 6,
|
|
465
|
-
px: 4,
|
|
466
|
-
py: 2,
|
|
467
|
-
style: {
|
|
468
|
-
cursor: "grab",
|
|
469
|
-
opacity: "data-dragging" in indicator ? .4 : void 0,
|
|
470
|
-
boxShadow: edge ? `inset 0 ${edgeOffset} 0 0 var(--mantine-primary-color-filled)` : void 0
|
|
471
|
-
},
|
|
472
|
-
...drag.rowDragProps(r.key, r.index),
|
|
473
|
-
...drag.dropProps(r.index, layout.move),
|
|
474
|
-
...indicator,
|
|
475
|
-
children: [
|
|
476
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
477
|
-
variant: "subtle",
|
|
478
|
-
color: "gray",
|
|
479
|
-
size: "sm",
|
|
480
|
-
style: { cursor: "grab" },
|
|
481
|
-
...(0, _adapttable_core.columnReorderKeyProps)(r.key, r.index, layout.move, `${labels.moveLeft} / ${labels.moveRight}: ${r.name}`),
|
|
482
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_adapttable_core.GripIcon, {})
|
|
483
|
-
}),
|
|
484
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowVisibility, {
|
|
485
|
-
hidden: r.hidden,
|
|
486
|
-
name: r.name,
|
|
487
|
-
labels,
|
|
488
|
-
onToggle: () => layout.toggleVisible(r.key)
|
|
489
|
-
}),
|
|
490
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PinToggle, {
|
|
491
|
-
pinned: r.pinned !== void 0,
|
|
492
|
-
label: `${(0, _adapttable_core.pinActionLabel)(r.pinned, labels)}: ${r.name}`,
|
|
493
|
-
onClick: () => layout.setPinned(r.key, (0, _adapttable_core.nextPinSide)(r.pinned))
|
|
494
|
-
})
|
|
495
|
-
]
|
|
496
|
-
}, r.key);
|
|
497
|
-
}),
|
|
498
|
-
hasRowActions && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Divider, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActionsRow, {
|
|
499
|
-
layout,
|
|
500
|
-
labels
|
|
501
|
-
})] }),
|
|
502
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Divider, {}),
|
|
503
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
504
|
-
variant: "subtle",
|
|
505
|
-
size: "xs",
|
|
506
|
-
fullWidth: true,
|
|
507
|
-
justify: "flex-start",
|
|
508
|
-
onClick: () => layout.reset(),
|
|
509
|
-
children: labels.resetColumns
|
|
510
|
-
})
|
|
1210
|
+
t3,
|
|
1211
|
+
t4,
|
|
1212
|
+
t5,
|
|
1213
|
+
t6,
|
|
1214
|
+
t8
|
|
511
1215
|
]
|
|
512
|
-
}) })
|
|
513
|
-
|
|
1216
|
+
}) });
|
|
1217
|
+
$[23] = t3;
|
|
1218
|
+
$[24] = t4;
|
|
1219
|
+
$[25] = t5;
|
|
1220
|
+
$[26] = t8;
|
|
1221
|
+
$[27] = t9;
|
|
1222
|
+
} else t9 = $[27];
|
|
1223
|
+
let t10;
|
|
1224
|
+
if ($[28] !== t2 || $[29] !== t9) {
|
|
1225
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Menu, {
|
|
1226
|
+
closeOnItemClick: false,
|
|
1227
|
+
position: "bottom-end",
|
|
1228
|
+
withinPortal: true,
|
|
1229
|
+
children: [t2, t9]
|
|
1230
|
+
});
|
|
1231
|
+
$[28] = t2;
|
|
1232
|
+
$[29] = t9;
|
|
1233
|
+
$[30] = t10;
|
|
1234
|
+
} else t10 = $[30];
|
|
1235
|
+
return t10;
|
|
514
1236
|
}
|
|
515
1237
|
//#endregion
|
|
516
1238
|
//#region src/density.ts
|
|
1239
|
+
/** Row density — independent of column pinning. */
|
|
1240
|
+
/** Mantine `<Table>` spacing props for a given density. */
|
|
517
1241
|
/**
|
|
518
1242
|
* Maps each {@link Density} to the Mantine `<Table>` spacing props.
|
|
519
1243
|
* `comfortable` keeps the original `sm`/`md` rhythm; `compact` tightens
|
|
@@ -531,101 +1255,297 @@ const DENSITY_SPACING = {
|
|
|
531
1255
|
};
|
|
532
1256
|
//#endregion
|
|
533
1257
|
//#region src/icons.tsx
|
|
534
|
-
function Svg(
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
1258
|
+
function Svg(t0) {
|
|
1259
|
+
const $ = (0, react_compiler_runtime.c)(5);
|
|
1260
|
+
const { size: t1, className, style, children } = t0;
|
|
1261
|
+
const size = t1 === void 0 ? 16 : t1;
|
|
1262
|
+
let t2;
|
|
1263
|
+
if ($[0] !== children || $[1] !== className || $[2] !== size || $[3] !== style) {
|
|
1264
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
1265
|
+
width: size,
|
|
1266
|
+
height: size,
|
|
1267
|
+
viewBox: "0 0 24 24",
|
|
1268
|
+
fill: "none",
|
|
1269
|
+
stroke: "currentColor",
|
|
1270
|
+
strokeWidth: 2,
|
|
1271
|
+
strokeLinecap: "round",
|
|
1272
|
+
strokeLinejoin: "round",
|
|
1273
|
+
className,
|
|
1274
|
+
style,
|
|
1275
|
+
"aria-hidden": "true",
|
|
1276
|
+
focusable: "false",
|
|
1277
|
+
children
|
|
1278
|
+
});
|
|
1279
|
+
$[0] = children;
|
|
1280
|
+
$[1] = className;
|
|
1281
|
+
$[2] = size;
|
|
1282
|
+
$[3] = style;
|
|
1283
|
+
$[4] = t2;
|
|
1284
|
+
} else t2 = $[4];
|
|
1285
|
+
return t2;
|
|
550
1286
|
}
|
|
551
1287
|
/** Magnifying-glass search icon. */
|
|
552
|
-
const SearchIcon = (p) =>
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
1288
|
+
const SearchIcon = (p) => {
|
|
1289
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
1290
|
+
let t0;
|
|
1291
|
+
let t1;
|
|
1292
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1293
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
|
|
1294
|
+
cx: "11",
|
|
1295
|
+
cy: "11",
|
|
1296
|
+
r: "7"
|
|
1297
|
+
});
|
|
1298
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m21 21-4.3-4.3" });
|
|
1299
|
+
$[0] = t0;
|
|
1300
|
+
$[1] = t1;
|
|
1301
|
+
} else {
|
|
1302
|
+
t0 = $[0];
|
|
1303
|
+
t1 = $[1];
|
|
1304
|
+
}
|
|
1305
|
+
let t2;
|
|
1306
|
+
if ($[2] !== p) {
|
|
1307
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Svg, {
|
|
1308
|
+
...p,
|
|
1309
|
+
children: [t0, t1]
|
|
1310
|
+
});
|
|
1311
|
+
$[2] = p;
|
|
1312
|
+
$[3] = t2;
|
|
1313
|
+
} else t2 = $[3];
|
|
1314
|
+
return t2;
|
|
1315
|
+
};
|
|
560
1316
|
/** Up chevron (active ascending sort). */
|
|
561
|
-
const ChevronUpIcon = (p) =>
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
1317
|
+
const ChevronUpIcon = (p) => {
|
|
1318
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
1319
|
+
let t0;
|
|
1320
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1321
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 15 6-6 6 6" });
|
|
1322
|
+
$[0] = t0;
|
|
1323
|
+
} else t0 = $[0];
|
|
1324
|
+
let t1;
|
|
1325
|
+
if ($[1] !== p) {
|
|
1326
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
1327
|
+
...p,
|
|
1328
|
+
children: t0
|
|
1329
|
+
});
|
|
1330
|
+
$[1] = p;
|
|
1331
|
+
$[2] = t1;
|
|
1332
|
+
} else t1 = $[2];
|
|
1333
|
+
return t1;
|
|
1334
|
+
};
|
|
565
1335
|
/** Down chevron (active descending sort). */
|
|
566
|
-
const ChevronDownIcon = (p) =>
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
1336
|
+
const ChevronDownIcon = (p) => {
|
|
1337
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
1338
|
+
let t0;
|
|
1339
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1340
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m6 9 6 6 6-6" });
|
|
1341
|
+
$[0] = t0;
|
|
1342
|
+
} else t0 = $[0];
|
|
1343
|
+
let t1;
|
|
1344
|
+
if ($[1] !== p) {
|
|
1345
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
1346
|
+
...p,
|
|
1347
|
+
children: t0
|
|
1348
|
+
});
|
|
1349
|
+
$[1] = p;
|
|
1350
|
+
$[2] = t1;
|
|
1351
|
+
} else t1 = $[2];
|
|
1352
|
+
return t1;
|
|
1353
|
+
};
|
|
570
1354
|
/** Right chevron (collapsed row-detail toggle; rotates 90° when expanded). */
|
|
571
|
-
const ChevronRightIcon = (p) =>
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
1355
|
+
const ChevronRightIcon = (p) => {
|
|
1356
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
1357
|
+
let t0;
|
|
1358
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1359
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m9 6 6 6-6 6" });
|
|
1360
|
+
$[0] = t0;
|
|
1361
|
+
} else t0 = $[0];
|
|
1362
|
+
let t1;
|
|
1363
|
+
if ($[1] !== p) {
|
|
1364
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
1365
|
+
...p,
|
|
1366
|
+
children: t0
|
|
1367
|
+
});
|
|
1368
|
+
$[1] = p;
|
|
1369
|
+
$[2] = t1;
|
|
1370
|
+
} else t1 = $[2];
|
|
1371
|
+
return t1;
|
|
1372
|
+
};
|
|
575
1373
|
/** Up/down selector (inactive sortable column). */
|
|
576
|
-
const SelectorIcon = (p) =>
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
1374
|
+
const SelectorIcon = (p) => {
|
|
1375
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
1376
|
+
let t0;
|
|
1377
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1378
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m8 9 4-4 4 4M8 15l4 4 4-4" });
|
|
1379
|
+
$[0] = t0;
|
|
1380
|
+
} else t0 = $[0];
|
|
1381
|
+
let t1;
|
|
1382
|
+
if ($[1] !== p) {
|
|
1383
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
1384
|
+
...p,
|
|
1385
|
+
children: t0
|
|
1386
|
+
});
|
|
1387
|
+
$[1] = p;
|
|
1388
|
+
$[2] = t1;
|
|
1389
|
+
} else t1 = $[2];
|
|
1390
|
+
return t1;
|
|
1391
|
+
};
|
|
580
1392
|
/** Small ✕ used on chips. */
|
|
581
|
-
const CloseIcon = (p) =>
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
1393
|
+
const CloseIcon = (p) => {
|
|
1394
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
1395
|
+
let t0;
|
|
1396
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1397
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M18 6 6 18M6 6l12 12" });
|
|
1398
|
+
$[0] = t0;
|
|
1399
|
+
} else t0 = $[0];
|
|
1400
|
+
let t1;
|
|
1401
|
+
if ($[1] !== p) {
|
|
1402
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
1403
|
+
...p,
|
|
1404
|
+
children: t0
|
|
1405
|
+
});
|
|
1406
|
+
$[1] = p;
|
|
1407
|
+
$[2] = t1;
|
|
1408
|
+
} else t1 = $[2];
|
|
1409
|
+
return t1;
|
|
1410
|
+
};
|
|
585
1411
|
/** Sliders icon for the Filters button. */
|
|
586
|
-
const FiltersIcon = (p) =>
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
1412
|
+
const FiltersIcon = (p) => {
|
|
1413
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
1414
|
+
let t0;
|
|
1415
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1416
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 6h16M7 12h10M10 18h4" });
|
|
1417
|
+
$[0] = t0;
|
|
1418
|
+
} else t0 = $[0];
|
|
1419
|
+
let t1;
|
|
1420
|
+
if ($[1] !== p) {
|
|
1421
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Svg, {
|
|
1422
|
+
...p,
|
|
1423
|
+
children: t0
|
|
1424
|
+
});
|
|
1425
|
+
$[1] = p;
|
|
1426
|
+
$[2] = t1;
|
|
1427
|
+
} else t1 = $[2];
|
|
1428
|
+
return t1;
|
|
1429
|
+
};
|
|
590
1430
|
/** Triangle alert icon for the error state. */
|
|
591
|
-
const AlertIcon = (p) =>
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
1431
|
+
const AlertIcon = (p) => {
|
|
1432
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
1433
|
+
let t0;
|
|
1434
|
+
let t1;
|
|
1435
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1436
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z" });
|
|
1437
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 9v4M12 17h.01" });
|
|
1438
|
+
$[0] = t0;
|
|
1439
|
+
$[1] = t1;
|
|
1440
|
+
} else {
|
|
1441
|
+
t0 = $[0];
|
|
1442
|
+
t1 = $[1];
|
|
1443
|
+
}
|
|
1444
|
+
let t2;
|
|
1445
|
+
if ($[2] !== p) {
|
|
1446
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Svg, {
|
|
1447
|
+
...p,
|
|
1448
|
+
children: [t0, t1]
|
|
1449
|
+
});
|
|
1450
|
+
$[2] = p;
|
|
1451
|
+
$[3] = t2;
|
|
1452
|
+
} else t2 = $[3];
|
|
1453
|
+
return t2;
|
|
1454
|
+
};
|
|
595
1455
|
/** Refresh icon for retry. */
|
|
596
|
-
const RefreshIcon = (p) =>
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
1456
|
+
const RefreshIcon = (p) => {
|
|
1457
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
1458
|
+
let t0;
|
|
1459
|
+
let t1;
|
|
1460
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1461
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 12a9 9 0 1 1-3-6.7L21 8" });
|
|
1462
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 3v5h-5" });
|
|
1463
|
+
$[0] = t0;
|
|
1464
|
+
$[1] = t1;
|
|
1465
|
+
} else {
|
|
1466
|
+
t0 = $[0];
|
|
1467
|
+
t1 = $[1];
|
|
1468
|
+
}
|
|
1469
|
+
let t2;
|
|
1470
|
+
if ($[2] !== p) {
|
|
1471
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Svg, {
|
|
1472
|
+
...p,
|
|
1473
|
+
children: [t0, t1]
|
|
1474
|
+
});
|
|
1475
|
+
$[2] = p;
|
|
1476
|
+
$[3] = t2;
|
|
1477
|
+
} else t2 = $[3];
|
|
1478
|
+
return t2;
|
|
1479
|
+
};
|
|
600
1480
|
/** Inbox icon for the empty state. */
|
|
601
|
-
const InboxIcon = (p) =>
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
1481
|
+
const InboxIcon = (p) => {
|
|
1482
|
+
const $ = (0, react_compiler_runtime.c)(4);
|
|
1483
|
+
let t0;
|
|
1484
|
+
let t1;
|
|
1485
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1486
|
+
t0 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M22 12h-6l-2 3h-4l-2-3H2" });
|
|
1487
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5.5 5.1 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.5-6.9A2 2 0 0 0 16.8 4H7.2a2 2 0 0 0-1.7 1.1Z" });
|
|
1488
|
+
$[0] = t0;
|
|
1489
|
+
$[1] = t1;
|
|
1490
|
+
} else {
|
|
1491
|
+
t0 = $[0];
|
|
1492
|
+
t1 = $[1];
|
|
1493
|
+
}
|
|
1494
|
+
let t2;
|
|
1495
|
+
if ($[2] !== p) {
|
|
1496
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Svg, {
|
|
1497
|
+
...p,
|
|
1498
|
+
children: [t0, t1]
|
|
1499
|
+
});
|
|
1500
|
+
$[2] = p;
|
|
1501
|
+
$[3] = t2;
|
|
1502
|
+
} else t2 = $[3];
|
|
1503
|
+
return t2;
|
|
1504
|
+
};
|
|
605
1505
|
//#endregion
|
|
606
1506
|
//#region src/components/ExpandToggle.tsx
|
|
1507
|
+
/** Props for {@link ExpandToggle}. */
|
|
607
1508
|
/**
|
|
608
1509
|
* The chevron that toggles a row's detail panel — shared by the desktop
|
|
609
1510
|
* table's leading cell and the mobile card. It is a real button, so the
|
|
610
1511
|
* row-click interactive-child guard already keeps it from activating
|
|
611
1512
|
* `onRowClick`.
|
|
612
1513
|
*/
|
|
613
|
-
function ExpandToggle(
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronRightIcon, {
|
|
1514
|
+
function ExpandToggle(t0) {
|
|
1515
|
+
const $ = (0, react_compiler_runtime.c)(7);
|
|
1516
|
+
const { expanded, expandLabel, collapseLabel, onToggle } = t0;
|
|
1517
|
+
const t1 = expanded ? collapseLabel : expandLabel;
|
|
1518
|
+
const t2 = expanded ? "rotate(90deg)" : "rotate(0deg)";
|
|
1519
|
+
let t3;
|
|
1520
|
+
if ($[0] !== t2) {
|
|
1521
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronRightIcon, {
|
|
622
1522
|
size: 14,
|
|
623
1523
|
style: {
|
|
624
|
-
transform:
|
|
1524
|
+
transform: t2,
|
|
625
1525
|
transition: "transform 150ms ease"
|
|
626
1526
|
}
|
|
627
|
-
})
|
|
628
|
-
|
|
1527
|
+
});
|
|
1528
|
+
$[0] = t2;
|
|
1529
|
+
$[1] = t3;
|
|
1530
|
+
} else t3 = $[1];
|
|
1531
|
+
let t4;
|
|
1532
|
+
if ($[2] !== expanded || $[3] !== onToggle || $[4] !== t1 || $[5] !== t3) {
|
|
1533
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
1534
|
+
variant: "subtle",
|
|
1535
|
+
color: "gray",
|
|
1536
|
+
size: "sm",
|
|
1537
|
+
"aria-expanded": expanded,
|
|
1538
|
+
"aria-label": t1,
|
|
1539
|
+
onClick: onToggle,
|
|
1540
|
+
children: t3
|
|
1541
|
+
});
|
|
1542
|
+
$[2] = expanded;
|
|
1543
|
+
$[3] = onToggle;
|
|
1544
|
+
$[4] = t1;
|
|
1545
|
+
$[5] = t3;
|
|
1546
|
+
$[6] = t4;
|
|
1547
|
+
} else t4 = $[6];
|
|
1548
|
+
return t4;
|
|
629
1549
|
}
|
|
630
1550
|
//#endregion
|
|
631
1551
|
//#region src/components/DesktopTable.tsx
|
|
@@ -640,95 +1560,246 @@ const RESIZE_HANDLE_STYLE = {
|
|
|
640
1560
|
touchAction: "none",
|
|
641
1561
|
userSelect: "none"
|
|
642
1562
|
};
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
1563
|
+
/**
|
|
1564
|
+
* Props for {@link DesktopTable}: the shared render contract from core
|
|
1565
|
+
* (minus `stickyTop` — the resolved `stickyHeaderOffset` replaces it) plus
|
|
1566
|
+
* the Mantine-specific extras.
|
|
1567
|
+
*/
|
|
1568
|
+
function SortIcon(t0) {
|
|
1569
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
1570
|
+
const { active, dir } = t0;
|
|
1571
|
+
if (!active) {
|
|
1572
|
+
let t1;
|
|
1573
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1574
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectorIcon, { size: 12 });
|
|
1575
|
+
$[0] = t1;
|
|
1576
|
+
} else t1 = $[0];
|
|
1577
|
+
return t1;
|
|
1578
|
+
}
|
|
1579
|
+
let t1;
|
|
1580
|
+
if ($[1] !== dir) {
|
|
1581
|
+
t1 = dir === "asc" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronUpIcon, { size: 12 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronDownIcon, { size: 12 });
|
|
1582
|
+
$[1] = dir;
|
|
1583
|
+
$[2] = t1;
|
|
1584
|
+
} else t1 = $[2];
|
|
1585
|
+
return t1;
|
|
646
1586
|
}
|
|
647
|
-
function HeaderCell(
|
|
648
|
-
const
|
|
649
|
-
const
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
1587
|
+
function HeaderCell(t0) {
|
|
1588
|
+
const $ = (0, react_compiler_runtime.c)(39);
|
|
1589
|
+
const { table, column, stickyStyle, resizeHandle } = t0;
|
|
1590
|
+
let t1;
|
|
1591
|
+
if ($[0] !== column || $[1] !== table) {
|
|
1592
|
+
t1 = table.getHeaderCellProps(column);
|
|
1593
|
+
$[0] = column;
|
|
1594
|
+
$[1] = table;
|
|
1595
|
+
$[2] = t1;
|
|
1596
|
+
} else t1 = $[2];
|
|
1597
|
+
const cellProps = t1;
|
|
1598
|
+
let t2;
|
|
1599
|
+
if ($[3] !== cellProps.style || $[4] !== stickyStyle) {
|
|
1600
|
+
t2 = {
|
|
1601
|
+
...cellProps.style,
|
|
1602
|
+
...stickyStyle
|
|
1603
|
+
};
|
|
1604
|
+
$[3] = cellProps.style;
|
|
1605
|
+
$[4] = stickyStyle;
|
|
1606
|
+
$[5] = t2;
|
|
1607
|
+
} else t2 = $[5];
|
|
1608
|
+
const headerStyle = t2;
|
|
1609
|
+
if (!column.sortable) {
|
|
1610
|
+
let t3;
|
|
1611
|
+
if ($[6] !== cellProps || $[7] !== column.header || $[8] !== headerStyle || $[9] !== resizeHandle) {
|
|
1612
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Table.Th, {
|
|
1613
|
+
...cellProps,
|
|
1614
|
+
style: headerStyle,
|
|
1615
|
+
children: [column.header, resizeHandle]
|
|
1616
|
+
});
|
|
1617
|
+
$[6] = cellProps;
|
|
1618
|
+
$[7] = column.header;
|
|
1619
|
+
$[8] = headerStyle;
|
|
1620
|
+
$[9] = resizeHandle;
|
|
1621
|
+
$[10] = t3;
|
|
1622
|
+
} else t3 = $[10];
|
|
1623
|
+
return t3;
|
|
1624
|
+
}
|
|
1625
|
+
let t3;
|
|
1626
|
+
if ($[11] !== column || $[12] !== table) {
|
|
1627
|
+
t3 = table.getSortButtonProps(column);
|
|
1628
|
+
$[11] = column;
|
|
1629
|
+
$[12] = table;
|
|
1630
|
+
$[13] = t3;
|
|
1631
|
+
} else t3 = $[13];
|
|
1632
|
+
const buttonProps = t3;
|
|
659
1633
|
const sortIndex = buttonProps["data-sort-index"];
|
|
660
|
-
|
|
1634
|
+
let t4;
|
|
1635
|
+
if ($[14] !== column.key || $[15] !== table.source.sortLevels) {
|
|
1636
|
+
let t5;
|
|
1637
|
+
if ($[17] !== column.key) {
|
|
1638
|
+
t5 = (l) => l.key === column.key;
|
|
1639
|
+
$[17] = column.key;
|
|
1640
|
+
$[18] = t5;
|
|
1641
|
+
} else t5 = $[18];
|
|
1642
|
+
t4 = table.source.sortLevels.find(t5);
|
|
1643
|
+
$[14] = column.key;
|
|
1644
|
+
$[15] = table.source.sortLevels;
|
|
1645
|
+
$[16] = t4;
|
|
1646
|
+
} else t4 = $[16];
|
|
1647
|
+
const level = t4;
|
|
661
1648
|
const active = level !== void 0 || table.sortBy === column.key;
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
1649
|
+
const t5 = active ? "var(--mantine-primary-color-filled)" : "inherit";
|
|
1650
|
+
let t6;
|
|
1651
|
+
if ($[19] !== t5) {
|
|
1652
|
+
t6 = {
|
|
1653
|
+
background: "none",
|
|
1654
|
+
border: 0,
|
|
1655
|
+
cursor: "pointer",
|
|
1656
|
+
font: "inherit",
|
|
1657
|
+
padding: 0,
|
|
1658
|
+
color: t5
|
|
1659
|
+
};
|
|
1660
|
+
$[19] = t5;
|
|
1661
|
+
$[20] = t6;
|
|
1662
|
+
} else t6 = $[20];
|
|
1663
|
+
let t7;
|
|
1664
|
+
if ($[21] !== column.header) {
|
|
1665
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: column.header });
|
|
1666
|
+
$[21] = column.header;
|
|
1667
|
+
$[22] = t7;
|
|
1668
|
+
} else t7 = $[22];
|
|
1669
|
+
const t8 = level?.dir ?? table.sortDir;
|
|
1670
|
+
let t9;
|
|
1671
|
+
if ($[23] !== active || $[24] !== t8) {
|
|
1672
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SortIcon, {
|
|
1673
|
+
active,
|
|
1674
|
+
dir: t8
|
|
1675
|
+
});
|
|
1676
|
+
$[23] = active;
|
|
1677
|
+
$[24] = t8;
|
|
1678
|
+
$[25] = t9;
|
|
1679
|
+
} else t9 = $[25];
|
|
1680
|
+
let t10;
|
|
1681
|
+
if ($[26] !== sortIndex) {
|
|
1682
|
+
t10 = typeof sortIndex === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Badge, {
|
|
1683
|
+
component: "span",
|
|
1684
|
+
size: "xs",
|
|
1685
|
+
variant: "light",
|
|
1686
|
+
children: sortIndex
|
|
1687
|
+
});
|
|
1688
|
+
$[26] = sortIndex;
|
|
1689
|
+
$[27] = t10;
|
|
1690
|
+
} else t10 = $[27];
|
|
1691
|
+
let t11;
|
|
1692
|
+
if ($[28] !== buttonProps || $[29] !== t10 || $[30] !== t6 || $[31] !== t7 || $[32] !== t9) {
|
|
1693
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
666
1694
|
component: "button",
|
|
667
1695
|
gap: 6,
|
|
668
1696
|
wrap: "nowrap",
|
|
669
1697
|
display: "inline-flex",
|
|
670
|
-
style:
|
|
671
|
-
background: "none",
|
|
672
|
-
border: 0,
|
|
673
|
-
cursor: "pointer",
|
|
674
|
-
font: "inherit",
|
|
675
|
-
padding: 0,
|
|
676
|
-
color: active ? "var(--mantine-primary-color-filled)" : "inherit"
|
|
677
|
-
},
|
|
1698
|
+
style: t6,
|
|
678
1699
|
...buttonProps,
|
|
679
1700
|
children: [
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
dir: level?.dir ?? table.sortDir
|
|
684
|
-
}),
|
|
685
|
-
typeof sortIndex === "number" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Badge, {
|
|
686
|
-
component: "span",
|
|
687
|
-
size: "xs",
|
|
688
|
-
variant: "light",
|
|
689
|
-
children: sortIndex
|
|
690
|
-
})
|
|
1701
|
+
t7,
|
|
1702
|
+
t9,
|
|
1703
|
+
t10
|
|
691
1704
|
]
|
|
692
|
-
})
|
|
693
|
-
|
|
1705
|
+
});
|
|
1706
|
+
$[28] = buttonProps;
|
|
1707
|
+
$[29] = t10;
|
|
1708
|
+
$[30] = t6;
|
|
1709
|
+
$[31] = t7;
|
|
1710
|
+
$[32] = t9;
|
|
1711
|
+
$[33] = t11;
|
|
1712
|
+
} else t11 = $[33];
|
|
1713
|
+
let t12;
|
|
1714
|
+
if ($[34] !== cellProps || $[35] !== headerStyle || $[36] !== resizeHandle || $[37] !== t11) {
|
|
1715
|
+
t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Table.Th, {
|
|
1716
|
+
...cellProps,
|
|
1717
|
+
style: headerStyle,
|
|
1718
|
+
children: [t11, resizeHandle]
|
|
1719
|
+
});
|
|
1720
|
+
$[34] = cellProps;
|
|
1721
|
+
$[35] = headerStyle;
|
|
1722
|
+
$[36] = resizeHandle;
|
|
1723
|
+
$[37] = t11;
|
|
1724
|
+
$[38] = t12;
|
|
1725
|
+
} else t12 = $[38];
|
|
1726
|
+
return t12;
|
|
694
1727
|
}
|
|
695
|
-
function RowActions(
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
1728
|
+
function RowActions(t0) {
|
|
1729
|
+
const $ = (0, react_compiler_runtime.c)(11);
|
|
1730
|
+
const { row, actions, confirm, cancelLabel } = t0;
|
|
1731
|
+
let t1;
|
|
1732
|
+
if ($[0] !== actions || $[1] !== cancelLabel || $[2] !== confirm || $[3] !== row) {
|
|
1733
|
+
let t2;
|
|
1734
|
+
if ($[5] !== cancelLabel || $[6] !== confirm || $[7] !== row) {
|
|
1735
|
+
t2 = (action) => {
|
|
1736
|
+
if (action.isHidden?.(row)) return null;
|
|
1737
|
+
const reason = (0, _adapttable_core.resolveDisabledReason)(action.disabledReason?.(row));
|
|
1738
|
+
const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
|
|
1739
|
+
const handleClick = disabled ? void 0 : (e) => {
|
|
1740
|
+
e.stopPropagation();
|
|
1741
|
+
(0, _adapttable_core.runRowAction)(action, row, confirm, cancelLabel);
|
|
1742
|
+
};
|
|
1743
|
+
return action.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Tooltip, {
|
|
1744
|
+
label: reason ?? action.label,
|
|
1745
|
+
withArrow: true,
|
|
1746
|
+
openDelay: 200,
|
|
1747
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
1748
|
+
variant: "subtle",
|
|
1749
|
+
color: action.color,
|
|
1750
|
+
size: "sm",
|
|
1751
|
+
disabled,
|
|
1752
|
+
"aria-label": action.label,
|
|
1753
|
+
onClick: handleClick,
|
|
1754
|
+
children: action.icon
|
|
1755
|
+
})
|
|
1756
|
+
}, action.key) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
713
1757
|
variant: "subtle",
|
|
714
1758
|
color: action.color,
|
|
715
|
-
size: "sm",
|
|
1759
|
+
size: "compact-sm",
|
|
716
1760
|
disabled,
|
|
717
|
-
"aria-label": action.label,
|
|
718
1761
|
onClick: handleClick,
|
|
719
|
-
children: action.
|
|
720
|
-
})
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
1762
|
+
children: action.label
|
|
1763
|
+
}, action.key);
|
|
1764
|
+
};
|
|
1765
|
+
$[5] = cancelLabel;
|
|
1766
|
+
$[6] = confirm;
|
|
1767
|
+
$[7] = row;
|
|
1768
|
+
$[8] = t2;
|
|
1769
|
+
} else t2 = $[8];
|
|
1770
|
+
t1 = actions.map(t2);
|
|
1771
|
+
$[0] = actions;
|
|
1772
|
+
$[1] = cancelLabel;
|
|
1773
|
+
$[2] = confirm;
|
|
1774
|
+
$[3] = row;
|
|
1775
|
+
$[4] = t1;
|
|
1776
|
+
} else t1 = $[4];
|
|
1777
|
+
let t2;
|
|
1778
|
+
if ($[9] !== t1) {
|
|
1779
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
1780
|
+
gap: 4,
|
|
1781
|
+
justify: "flex-end",
|
|
1782
|
+
wrap: "nowrap",
|
|
1783
|
+
children: t1
|
|
1784
|
+
});
|
|
1785
|
+
$[9] = t1;
|
|
1786
|
+
$[10] = t2;
|
|
1787
|
+
} else t2 = $[10];
|
|
1788
|
+
return t2;
|
|
731
1789
|
}
|
|
1790
|
+
/**
|
|
1791
|
+
* Props for the memoized {@link DesktopRowBase}. Everything the row's visual
|
|
1792
|
+
* output depends on is a primitive, a stable identity, or is fingerprinted
|
|
1793
|
+
* by `pinSignature` — so {@link desktopRowPropsEqual} can hold the row
|
|
1794
|
+
* across unrelated table re-renders (search keystrokes, other rows'
|
|
1795
|
+
* selection) without ever capturing a stale event handler.
|
|
1796
|
+
*/
|
|
1797
|
+
/**
|
|
1798
|
+
* The style-ish props the comparator deliberately skips: they are rebuilt
|
|
1799
|
+
* every parent render, and their visual output is exactly determined by
|
|
1800
|
+
* `pinSignature` (plus the compared inputs) — comparing their identities
|
|
1801
|
+
* would only defeat the memo.
|
|
1802
|
+
*/
|
|
732
1803
|
/** Every row prop the memo comparator checks with `Object.is`. */
|
|
733
1804
|
const COMPARED_ROW_PROPS = [
|
|
734
1805
|
"row",
|
|
@@ -797,60 +1868,158 @@ function pinLayoutSignature(columns, pinOffset, hasLeftPin, actionsEdgePinned) {
|
|
|
797
1868
|
* be memoized: typing in the search box or toggling another row's checkbox
|
|
798
1869
|
* re-renders the table chrome but leaves untouched rows alone.
|
|
799
1870
|
*/
|
|
800
|
-
function DesktopRowBase(
|
|
1871
|
+
function DesktopRowBase(t0) {
|
|
1872
|
+
const $ = (0, react_compiler_runtime.c)(56);
|
|
1873
|
+
const { row, index, id, columns, getCellProps, selected, selectLabel, onToggleSelect, expanded, expandLabel, collapseLabel, onToggleExpand, renderRowDetail, columnSpan, rowActions, confirm, cancelLabel, onRowClick, prefetch, className, measureElement, pinStyleFor, selectionCellStyle, expansionCellStyle, actionsCellStyle } = t0;
|
|
801
1874
|
const showActions = (rowActions?.length ?? 0) > 0;
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
1875
|
+
let t1;
|
|
1876
|
+
if ($[0] !== onRowClick || $[1] !== row) {
|
|
1877
|
+
t1 = (0, _adapttable_core.rowClickProps)(row, onRowClick);
|
|
1878
|
+
$[0] = onRowClick;
|
|
1879
|
+
$[1] = row;
|
|
1880
|
+
$[2] = t1;
|
|
1881
|
+
} else t1 = $[2];
|
|
1882
|
+
let t2;
|
|
1883
|
+
if ($[3] !== prefetch || $[4] !== row) {
|
|
1884
|
+
t2 = prefetch ? () => prefetch(row) : void 0;
|
|
1885
|
+
$[3] = prefetch;
|
|
1886
|
+
$[4] = row;
|
|
1887
|
+
$[5] = t2;
|
|
1888
|
+
} else t2 = $[5];
|
|
1889
|
+
let t3;
|
|
1890
|
+
if ($[6] !== collapseLabel || $[7] !== expandLabel || $[8] !== expanded || $[9] !== expansionCellStyle || $[10] !== id || $[11] !== onToggleExpand) {
|
|
1891
|
+
t3 = expanded !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
1892
|
+
ta: "center",
|
|
1893
|
+
style: expansionCellStyle,
|
|
1894
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandToggle, {
|
|
1895
|
+
expanded,
|
|
1896
|
+
expandLabel,
|
|
1897
|
+
collapseLabel,
|
|
1898
|
+
onToggle: () => onToggleExpand(id)
|
|
1899
|
+
})
|
|
1900
|
+
});
|
|
1901
|
+
$[6] = collapseLabel;
|
|
1902
|
+
$[7] = expandLabel;
|
|
1903
|
+
$[8] = expanded;
|
|
1904
|
+
$[9] = expansionCellStyle;
|
|
1905
|
+
$[10] = id;
|
|
1906
|
+
$[11] = onToggleExpand;
|
|
1907
|
+
$[12] = t3;
|
|
1908
|
+
} else t3 = $[12];
|
|
1909
|
+
let t4;
|
|
1910
|
+
if ($[13] !== id || $[14] !== onToggleSelect || $[15] !== selectLabel || $[16] !== selected || $[17] !== selectionCellStyle) {
|
|
1911
|
+
t4 = selected !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
1912
|
+
ta: "center",
|
|
1913
|
+
style: selectionCellStyle,
|
|
1914
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Checkbox, {
|
|
1915
|
+
"aria-label": selectLabel,
|
|
1916
|
+
checked: selected,
|
|
1917
|
+
onChange: () => onToggleSelect(id)
|
|
1918
|
+
})
|
|
1919
|
+
});
|
|
1920
|
+
$[13] = id;
|
|
1921
|
+
$[14] = onToggleSelect;
|
|
1922
|
+
$[15] = selectLabel;
|
|
1923
|
+
$[16] = selected;
|
|
1924
|
+
$[17] = selectionCellStyle;
|
|
1925
|
+
$[18] = t4;
|
|
1926
|
+
} else t4 = $[18];
|
|
1927
|
+
let t5;
|
|
1928
|
+
if ($[19] !== columns || $[20] !== getCellProps || $[21] !== index || $[22] !== pinStyleFor || $[23] !== row) {
|
|
1929
|
+
let t6;
|
|
1930
|
+
if ($[25] !== getCellProps || $[26] !== index || $[27] !== pinStyleFor || $[28] !== row) {
|
|
1931
|
+
t6 = (column) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
832
1932
|
...getCellProps(column),
|
|
833
1933
|
style: pinStyleFor(column.key),
|
|
834
1934
|
children: column.Cell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(column.Cell, {
|
|
835
1935
|
row,
|
|
836
1936
|
rowIndex: index
|
|
837
1937
|
}) : column.accessor?.(row)
|
|
838
|
-
}, column.key)
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1938
|
+
}, column.key);
|
|
1939
|
+
$[25] = getCellProps;
|
|
1940
|
+
$[26] = index;
|
|
1941
|
+
$[27] = pinStyleFor;
|
|
1942
|
+
$[28] = row;
|
|
1943
|
+
$[29] = t6;
|
|
1944
|
+
} else t6 = $[29];
|
|
1945
|
+
t5 = columns.map(t6);
|
|
1946
|
+
$[19] = columns;
|
|
1947
|
+
$[20] = getCellProps;
|
|
1948
|
+
$[21] = index;
|
|
1949
|
+
$[22] = pinStyleFor;
|
|
1950
|
+
$[23] = row;
|
|
1951
|
+
$[24] = t5;
|
|
1952
|
+
} else t5 = $[24];
|
|
1953
|
+
let t6;
|
|
1954
|
+
if ($[30] !== actionsCellStyle || $[31] !== cancelLabel || $[32] !== confirm || $[33] !== row || $[34] !== rowActions || $[35] !== showActions) {
|
|
1955
|
+
t6 = showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
1956
|
+
ta: "end",
|
|
1957
|
+
style: actionsCellStyle,
|
|
1958
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowActions, {
|
|
1959
|
+
row,
|
|
1960
|
+
actions: rowActions,
|
|
1961
|
+
confirm,
|
|
1962
|
+
cancelLabel
|
|
848
1963
|
})
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
1964
|
+
});
|
|
1965
|
+
$[30] = actionsCellStyle;
|
|
1966
|
+
$[31] = cancelLabel;
|
|
1967
|
+
$[32] = confirm;
|
|
1968
|
+
$[33] = row;
|
|
1969
|
+
$[34] = rowActions;
|
|
1970
|
+
$[35] = showActions;
|
|
1971
|
+
$[36] = t6;
|
|
1972
|
+
} else t6 = $[36];
|
|
1973
|
+
let t7;
|
|
1974
|
+
if ($[37] !== className || $[38] !== index || $[39] !== measureElement || $[40] !== selected || $[41] !== t1 || $[42] !== t2 || $[43] !== t3 || $[44] !== t4 || $[45] !== t5 || $[46] !== t6) {
|
|
1975
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Table.Tr, {
|
|
1976
|
+
role: "row",
|
|
1977
|
+
"data-index": index,
|
|
1978
|
+
"aria-selected": selected,
|
|
1979
|
+
...t1,
|
|
1980
|
+
className,
|
|
1981
|
+
ref: measureElement,
|
|
1982
|
+
"data-stagger": "",
|
|
1983
|
+
onMouseEnter: t2,
|
|
1984
|
+
children: [
|
|
1985
|
+
t3,
|
|
1986
|
+
t4,
|
|
1987
|
+
t5,
|
|
1988
|
+
t6
|
|
1989
|
+
]
|
|
1990
|
+
});
|
|
1991
|
+
$[37] = className;
|
|
1992
|
+
$[38] = index;
|
|
1993
|
+
$[39] = measureElement;
|
|
1994
|
+
$[40] = selected;
|
|
1995
|
+
$[41] = t1;
|
|
1996
|
+
$[42] = t2;
|
|
1997
|
+
$[43] = t3;
|
|
1998
|
+
$[44] = t4;
|
|
1999
|
+
$[45] = t5;
|
|
2000
|
+
$[46] = t6;
|
|
2001
|
+
$[47] = t7;
|
|
2002
|
+
} else t7 = $[47];
|
|
2003
|
+
let t8;
|
|
2004
|
+
if ($[48] !== columnSpan || $[49] !== expanded || $[50] !== renderRowDetail || $[51] !== row) {
|
|
2005
|
+
t8 = expanded === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Tr, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
2006
|
+
colSpan: columnSpan,
|
|
2007
|
+
children: renderRowDetail(row)
|
|
2008
|
+
}) });
|
|
2009
|
+
$[48] = columnSpan;
|
|
2010
|
+
$[49] = expanded;
|
|
2011
|
+
$[50] = renderRowDetail;
|
|
2012
|
+
$[51] = row;
|
|
2013
|
+
$[52] = t8;
|
|
2014
|
+
} else t8 = $[52];
|
|
2015
|
+
let t9;
|
|
2016
|
+
if ($[53] !== t7 || $[54] !== t8) {
|
|
2017
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t7, t8] });
|
|
2018
|
+
$[53] = t7;
|
|
2019
|
+
$[54] = t8;
|
|
2020
|
+
$[55] = t9;
|
|
2021
|
+
} else t9 = $[55];
|
|
2022
|
+
return t9;
|
|
854
2023
|
}
|
|
855
2024
|
/** Desktop table rendering driven by core prop-getters. */
|
|
856
2025
|
function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, getRowId, bodyRef, className, rowEntries, paddingTop = 0, paddingBottom = 0, measureElement, stickyHeaderOffset = 0, stickyHeader = false, pinOffset, maxHeight, virtualScrollRef, setWidth, columnWidths, resizeLabel = "Resize column", actionsPinned = false, density = "comfortable" }) {
|
|
@@ -868,7 +2037,7 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
868
2037
|
const summaryCells = summaryRow?.(rows);
|
|
869
2038
|
const hasRightPin = table.columns.some((c) => pinOffset?.(c.key)?.side === "right");
|
|
870
2039
|
const actionsEdgePinned = showActions && (hasRightPin || actionsPinned);
|
|
871
|
-
const hasPinned = table.columns.some((
|
|
2040
|
+
const hasPinned = table.columns.some((c_0) => pinOffset?.(c_0.key) != null) || actionsEdgePinned;
|
|
872
2041
|
const { ref: wrapperRef, overflowing } = (0, _adapttable_core.useHorizontalOverflow)();
|
|
873
2042
|
const headerCellStyle = stickyHeader ? {
|
|
874
2043
|
position: "sticky",
|
|
@@ -885,7 +2054,7 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
885
2054
|
left: expansionLead + (selection ? selectionWidth : 0),
|
|
886
2055
|
right: showActions ? actionsWidth : 0
|
|
887
2056
|
};
|
|
888
|
-
const hasLeftPin = table.columns.some((
|
|
2057
|
+
const hasLeftPin = table.columns.some((c_1) => pinOffset?.(c_1.key)?.side === "left");
|
|
889
2058
|
const pinBg = "var(--mantine-color-body)";
|
|
890
2059
|
const headerStyleFor = (column) => {
|
|
891
2060
|
const key = column.key;
|
|
@@ -911,24 +2080,24 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
911
2080
|
...(0, _adapttable_core.edgePinStyle)("right", actionsEdgePinned, _adapttable_core.PIN_Z.headerPinned)
|
|
912
2081
|
};
|
|
913
2082
|
const edgeBodyStyle = (side, active) => {
|
|
914
|
-
const
|
|
915
|
-
return
|
|
916
|
-
...
|
|
2083
|
+
const pin_0 = (0, _adapttable_core.edgePinStyle)(side, active, _adapttable_core.PIN_Z.body);
|
|
2084
|
+
return pin_0 ? {
|
|
2085
|
+
...pin_0,
|
|
917
2086
|
background: pinBg
|
|
918
2087
|
} : void 0;
|
|
919
2088
|
};
|
|
920
2089
|
const expansionCellStyle = leadingPinStyle(hasLeftPin, 0, _adapttable_core.PIN_Z.body, pinBg);
|
|
921
2090
|
const selectionCellStyle = leadingPinStyle(hasLeftPin, expansionLead, _adapttable_core.PIN_Z.body, pinBg);
|
|
922
2091
|
const actionsCellStyle = edgeBodyStyle("right", actionsEdgePinned);
|
|
923
|
-
const columnName = (
|
|
924
|
-
const resizeHandleFor = (
|
|
925
|
-
...(0, _adapttable_core.columnResizeHandleProps)(
|
|
2092
|
+
const columnName = (column_0) => typeof column_0.header === "string" ? column_0.header : column_0.key;
|
|
2093
|
+
const resizeHandleFor = (column_1) => setWidth ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2094
|
+
...(0, _adapttable_core.columnResizeHandleProps)(column_1.key, setWidth, `${resizeLabel}: ${columnName(column_1)}`),
|
|
926
2095
|
style: RESIZE_HANDLE_STYLE
|
|
927
2096
|
}) : void 0;
|
|
928
|
-
const bodyPinStyle = (
|
|
929
|
-
const
|
|
930
|
-
return
|
|
931
|
-
...
|
|
2097
|
+
const bodyPinStyle = (key_0) => {
|
|
2098
|
+
const pin_1 = (0, _adapttable_core.pinnedCellStyle)(pinOffset?.(key_0), _adapttable_core.PIN_Z.body, leads);
|
|
2099
|
+
return pin_1 ? {
|
|
2100
|
+
...pin_1,
|
|
932
2101
|
background: pinBg
|
|
933
2102
|
} : void 0;
|
|
934
2103
|
};
|
|
@@ -1000,12 +2169,12 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
1000
2169
|
onChange: selection.toggleAll
|
|
1001
2170
|
})
|
|
1002
2171
|
}),
|
|
1003
|
-
columns.map((
|
|
2172
|
+
columns.map((column_2) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HeaderCell, {
|
|
1004
2173
|
table,
|
|
1005
|
-
column,
|
|
1006
|
-
stickyStyle: headerStyleFor(
|
|
1007
|
-
resizeHandle: resizeHandleFor(
|
|
1008
|
-
},
|
|
2174
|
+
column: column_2,
|
|
2175
|
+
stickyStyle: headerStyleFor(column_2),
|
|
2176
|
+
resizeHandle: resizeHandleFor(column_2)
|
|
2177
|
+
}, column_2.key)),
|
|
1009
2178
|
showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Th, {
|
|
1010
2179
|
ta: "end",
|
|
1011
2180
|
w: actionsWidth,
|
|
@@ -1028,18 +2197,18 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
1028
2197
|
}
|
|
1029
2198
|
})
|
|
1030
2199
|
}),
|
|
1031
|
-
entries.map(({ row, index, key }) => {
|
|
1032
|
-
const
|
|
2200
|
+
entries.map(({ row, index, key: key_1 }) => {
|
|
2201
|
+
const id_0 = getRowId(row);
|
|
1033
2202
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
|
|
1034
2203
|
row,
|
|
1035
2204
|
index,
|
|
1036
|
-
id,
|
|
2205
|
+
id: id_0,
|
|
1037
2206
|
columns,
|
|
1038
2207
|
getCellProps: table.getCellProps,
|
|
1039
|
-
selected: selection?.isSelected(
|
|
2208
|
+
selected: selection?.isSelected(id_0),
|
|
1040
2209
|
selectLabel: labels.selectRow,
|
|
1041
2210
|
onToggleSelect: toggleSelect,
|
|
1042
|
-
expanded: expansion?.isExpanded(
|
|
2211
|
+
expanded: expansion?.isExpanded(id_0),
|
|
1043
2212
|
expandLabel: labels.expandRow,
|
|
1044
2213
|
collapseLabel: labels.collapseRow,
|
|
1045
2214
|
onToggleExpand: expansion?.toggle,
|
|
@@ -1057,7 +2226,7 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
1057
2226
|
expansionCellStyle,
|
|
1058
2227
|
actionsCellStyle,
|
|
1059
2228
|
pinSignature
|
|
1060
|
-
},
|
|
2229
|
+
}, key_1);
|
|
1061
2230
|
}),
|
|
1062
2231
|
paddingBottom > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Tr, {
|
|
1063
2232
|
"aria-hidden": true,
|
|
@@ -1074,12 +2243,12 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
1074
2243
|
summaryCells && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Tfoot, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Table.Tr, { children: [
|
|
1075
2244
|
expandable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {}),
|
|
1076
2245
|
selection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {}),
|
|
1077
|
-
columns.map((
|
|
1078
|
-
...table.getCellProps(
|
|
2246
|
+
columns.map((column_3) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {
|
|
2247
|
+
...table.getCellProps(column_3),
|
|
1079
2248
|
fw: 600,
|
|
1080
2249
|
c: "dimmed",
|
|
1081
|
-
children: summaryCells[
|
|
1082
|
-
},
|
|
2250
|
+
children: summaryCells[column_3.key]
|
|
2251
|
+
}, column_3.key)),
|
|
1083
2252
|
showActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, {})
|
|
1084
2253
|
] }) })
|
|
1085
2254
|
]
|
|
@@ -1088,315 +2257,674 @@ function DesktopTable({ table, rows, rowActions, confirm, prefetch, onRowClick,
|
|
|
1088
2257
|
}
|
|
1089
2258
|
//#endregion
|
|
1090
2259
|
//#region src/components/EmptyState.tsx
|
|
2260
|
+
/** Props for {@link EmptyState}. */
|
|
1091
2261
|
/** Centred "nothing to show" placeholder. */
|
|
1092
|
-
function EmptyState(
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
]
|
|
1120
|
-
}
|
|
2262
|
+
function EmptyState(t0) {
|
|
2263
|
+
const $ = (0, react_compiler_runtime.c)(13);
|
|
2264
|
+
const { title, description, icon, action } = t0;
|
|
2265
|
+
let t1;
|
|
2266
|
+
if ($[0] !== icon) {
|
|
2267
|
+
t1 = icon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InboxIcon, { size: 40 });
|
|
2268
|
+
$[0] = icon;
|
|
2269
|
+
$[1] = t1;
|
|
2270
|
+
} else t1 = $[1];
|
|
2271
|
+
let t2;
|
|
2272
|
+
if ($[2] !== t1) {
|
|
2273
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2274
|
+
c: "dimmed",
|
|
2275
|
+
"aria-hidden": true,
|
|
2276
|
+
children: t1
|
|
2277
|
+
});
|
|
2278
|
+
$[2] = t1;
|
|
2279
|
+
$[3] = t2;
|
|
2280
|
+
} else t2 = $[3];
|
|
2281
|
+
let t3;
|
|
2282
|
+
if ($[4] !== title) {
|
|
2283
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2284
|
+
fw: 600,
|
|
2285
|
+
fz: "md",
|
|
2286
|
+
children: title
|
|
2287
|
+
});
|
|
2288
|
+
$[4] = title;
|
|
2289
|
+
$[5] = t3;
|
|
2290
|
+
} else t3 = $[5];
|
|
2291
|
+
let t4;
|
|
2292
|
+
if ($[6] !== description) {
|
|
2293
|
+
t4 = description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2294
|
+
c: "dimmed",
|
|
2295
|
+
fz: "sm",
|
|
2296
|
+
ta: "center",
|
|
2297
|
+
maw: 360,
|
|
2298
|
+
children: description
|
|
2299
|
+
});
|
|
2300
|
+
$[6] = description;
|
|
2301
|
+
$[7] = t4;
|
|
2302
|
+
} else t4 = $[7];
|
|
2303
|
+
let t5;
|
|
2304
|
+
if ($[8] !== action || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
|
|
2305
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
2306
|
+
role: "status",
|
|
2307
|
+
align: "center",
|
|
2308
|
+
justify: "center",
|
|
2309
|
+
gap: 6,
|
|
2310
|
+
py: 48,
|
|
2311
|
+
px: 16,
|
|
2312
|
+
children: [
|
|
2313
|
+
t2,
|
|
2314
|
+
t3,
|
|
2315
|
+
t4,
|
|
2316
|
+
action
|
|
2317
|
+
]
|
|
2318
|
+
});
|
|
2319
|
+
$[8] = action;
|
|
2320
|
+
$[9] = t2;
|
|
2321
|
+
$[10] = t3;
|
|
2322
|
+
$[11] = t4;
|
|
2323
|
+
$[12] = t5;
|
|
2324
|
+
} else t5 = $[12];
|
|
2325
|
+
return t5;
|
|
1121
2326
|
}
|
|
1122
2327
|
//#endregion
|
|
1123
2328
|
//#region src/components/ErrorState.tsx
|
|
2329
|
+
/** Props for {@link ErrorState}. */
|
|
1124
2330
|
/** Inline error alert with an optional retry button. */
|
|
1125
|
-
function ErrorState(
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
2331
|
+
function ErrorState(t0) {
|
|
2332
|
+
const $ = (0, react_compiler_runtime.c)(18);
|
|
2333
|
+
const { error, title, message, retryLabel, onRetry, isRetrying } = t0;
|
|
2334
|
+
let t1;
|
|
2335
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2336
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertIcon, { size: 16 });
|
|
2337
|
+
$[0] = t1;
|
|
2338
|
+
} else t1 = $[0];
|
|
2339
|
+
let t2;
|
|
2340
|
+
if ($[1] !== message) {
|
|
2341
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2342
|
+
fz: "sm",
|
|
2343
|
+
children: message
|
|
2344
|
+
});
|
|
2345
|
+
$[1] = message;
|
|
2346
|
+
$[2] = t2;
|
|
2347
|
+
} else t2 = $[2];
|
|
2348
|
+
let t3;
|
|
2349
|
+
if ($[3] !== error.message) {
|
|
2350
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2351
|
+
fz: "xs",
|
|
2352
|
+
c: "dimmed",
|
|
2353
|
+
mt: 2,
|
|
2354
|
+
children: error.message
|
|
2355
|
+
});
|
|
2356
|
+
$[3] = error.message;
|
|
2357
|
+
$[4] = t3;
|
|
2358
|
+
} else t3 = $[4];
|
|
2359
|
+
let t4;
|
|
2360
|
+
if ($[5] !== t2 || $[6] !== t3) {
|
|
2361
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [t2, t3] });
|
|
2362
|
+
$[5] = t2;
|
|
2363
|
+
$[6] = t3;
|
|
2364
|
+
$[7] = t4;
|
|
2365
|
+
} else t4 = $[7];
|
|
2366
|
+
let t5;
|
|
2367
|
+
if ($[8] !== isRetrying || $[9] !== onRetry || $[10] !== retryLabel) {
|
|
2368
|
+
t5 = onRetry && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
2369
|
+
size: "xs",
|
|
2370
|
+
variant: "light",
|
|
2371
|
+
color: "red",
|
|
2372
|
+
leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RefreshIcon, { size: 14 }),
|
|
2373
|
+
onClick: onRetry,
|
|
2374
|
+
loading: isRetrying,
|
|
2375
|
+
children: retryLabel
|
|
2376
|
+
});
|
|
2377
|
+
$[8] = isRetrying;
|
|
2378
|
+
$[9] = onRetry;
|
|
2379
|
+
$[10] = retryLabel;
|
|
2380
|
+
$[11] = t5;
|
|
2381
|
+
} else t5 = $[11];
|
|
2382
|
+
let t6;
|
|
2383
|
+
if ($[12] !== t4 || $[13] !== t5) {
|
|
2384
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1132
2385
|
justify: "space-between",
|
|
1133
2386
|
align: "center",
|
|
1134
2387
|
wrap: "nowrap",
|
|
1135
2388
|
gap: "md",
|
|
1136
|
-
children: [
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
}
|
|
2389
|
+
children: [t4, t5]
|
|
2390
|
+
});
|
|
2391
|
+
$[12] = t4;
|
|
2392
|
+
$[13] = t5;
|
|
2393
|
+
$[14] = t6;
|
|
2394
|
+
} else t6 = $[14];
|
|
2395
|
+
let t7;
|
|
2396
|
+
if ($[15] !== t6 || $[16] !== title) {
|
|
2397
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Alert, {
|
|
2398
|
+
icon: t1,
|
|
2399
|
+
color: "red",
|
|
2400
|
+
variant: "light",
|
|
2401
|
+
title,
|
|
2402
|
+
children: t6
|
|
2403
|
+
});
|
|
2404
|
+
$[15] = t6;
|
|
2405
|
+
$[16] = title;
|
|
2406
|
+
$[17] = t7;
|
|
2407
|
+
} else t7 = $[17];
|
|
2408
|
+
return t7;
|
|
1155
2409
|
}
|
|
1156
2410
|
//#endregion
|
|
1157
2411
|
//#region src/components/FilterDrawer.tsx
|
|
2412
|
+
/** Props for {@link FilterDrawer}. */
|
|
1158
2413
|
/** Right-side drawer holding the caller's filter widgets + apply/clear. */
|
|
1159
|
-
function FilterDrawer(
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
overlayProps: {
|
|
2414
|
+
function FilterDrawer(t0) {
|
|
2415
|
+
const $ = (0, react_compiler_runtime.c)(25);
|
|
2416
|
+
const { opened, onClose, filters, activeFilterCount, onClearFilters, labels, dir: t1 } = t0;
|
|
2417
|
+
const t2 = (t1 === void 0 ? "ltr" : t1) === "rtl" ? "left" : "right";
|
|
2418
|
+
let t3;
|
|
2419
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2420
|
+
t3 = {
|
|
1167
2421
|
opacity: .4,
|
|
1168
2422
|
blur: 2
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
|
|
2423
|
+
};
|
|
2424
|
+
$[0] = t3;
|
|
2425
|
+
} else t3 = $[0];
|
|
2426
|
+
let t4;
|
|
2427
|
+
if ($[1] !== labels.cancel) {
|
|
2428
|
+
t4 = { "aria-label": labels.cancel };
|
|
2429
|
+
$[1] = labels.cancel;
|
|
2430
|
+
$[2] = t4;
|
|
2431
|
+
} else t4 = $[2];
|
|
2432
|
+
let t5;
|
|
2433
|
+
if ($[3] !== filters) {
|
|
2434
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
|
|
2435
|
+
gap: "md",
|
|
2436
|
+
children: filters
|
|
2437
|
+
});
|
|
2438
|
+
$[3] = filters;
|
|
2439
|
+
$[4] = t5;
|
|
2440
|
+
} else t5 = $[4];
|
|
2441
|
+
const t6 = activeFilterCount === 0;
|
|
2442
|
+
let t7;
|
|
2443
|
+
if ($[5] !== labels.clearAll || $[6] !== onClearFilters || $[7] !== t6) {
|
|
2444
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
2445
|
+
variant: "subtle",
|
|
2446
|
+
onClick: onClearFilters,
|
|
2447
|
+
disabled: t6,
|
|
2448
|
+
children: labels.clearAll
|
|
2449
|
+
});
|
|
2450
|
+
$[5] = labels.clearAll;
|
|
2451
|
+
$[6] = onClearFilters;
|
|
2452
|
+
$[7] = t6;
|
|
2453
|
+
$[8] = t7;
|
|
2454
|
+
} else t7 = $[8];
|
|
2455
|
+
let t8;
|
|
2456
|
+
if ($[9] !== labels.applyFilters || $[10] !== onClose) {
|
|
2457
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
2458
|
+
onClick: onClose,
|
|
2459
|
+
children: labels.applyFilters
|
|
2460
|
+
});
|
|
2461
|
+
$[9] = labels.applyFilters;
|
|
2462
|
+
$[10] = onClose;
|
|
2463
|
+
$[11] = t8;
|
|
2464
|
+
} else t8 = $[11];
|
|
2465
|
+
let t9;
|
|
2466
|
+
if ($[12] !== t7 || $[13] !== t8) {
|
|
2467
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
2468
|
+
justify: "space-between",
|
|
2469
|
+
pt: "md",
|
|
2470
|
+
children: [t7, t8]
|
|
2471
|
+
});
|
|
2472
|
+
$[12] = t7;
|
|
2473
|
+
$[13] = t8;
|
|
2474
|
+
$[14] = t9;
|
|
2475
|
+
} else t9 = $[14];
|
|
2476
|
+
let t10;
|
|
2477
|
+
if ($[15] !== t5 || $[16] !== t9) {
|
|
2478
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
1172
2479
|
gap: "md",
|
|
1173
2480
|
mih: "60vh",
|
|
1174
2481
|
justify: "space-between",
|
|
1175
|
-
children: [
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
2482
|
+
children: [t5, t9]
|
|
2483
|
+
});
|
|
2484
|
+
$[15] = t5;
|
|
2485
|
+
$[16] = t9;
|
|
2486
|
+
$[17] = t10;
|
|
2487
|
+
} else t10 = $[17];
|
|
2488
|
+
let t11;
|
|
2489
|
+
if ($[18] !== labels.filters || $[19] !== onClose || $[20] !== opened || $[21] !== t10 || $[22] !== t2 || $[23] !== t4) {
|
|
2490
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Drawer, {
|
|
2491
|
+
opened,
|
|
2492
|
+
onClose,
|
|
2493
|
+
position: t2,
|
|
2494
|
+
size: 380,
|
|
2495
|
+
title: labels.filters,
|
|
2496
|
+
overlayProps: t3,
|
|
2497
|
+
closeButtonProps: t4,
|
|
2498
|
+
children: t10
|
|
2499
|
+
});
|
|
2500
|
+
$[18] = labels.filters;
|
|
2501
|
+
$[19] = onClose;
|
|
2502
|
+
$[20] = opened;
|
|
2503
|
+
$[21] = t10;
|
|
2504
|
+
$[22] = t2;
|
|
2505
|
+
$[23] = t4;
|
|
2506
|
+
$[24] = t11;
|
|
2507
|
+
} else t11 = $[24];
|
|
2508
|
+
return t11;
|
|
1193
2509
|
}
|
|
1194
2510
|
//#endregion
|
|
1195
2511
|
//#region src/components/MobileCards.tsx
|
|
2512
|
+
/**
|
|
2513
|
+
* Props for {@link MobileCards}: the card-relevant slice of core's shared
|
|
2514
|
+
* render contract (no header/pinning/resize concerns on mobile) plus the
|
|
2515
|
+
* Mantine-specific extras.
|
|
2516
|
+
*/
|
|
1196
2517
|
function mobileLabel(column) {
|
|
1197
2518
|
return column.mobileLabel ?? (typeof column.header === "string" ? column.header : column.key);
|
|
1198
2519
|
}
|
|
1199
2520
|
/** Mobile rendering: one Mantine Card per row with labelled key/value rows. */
|
|
1200
|
-
function MobileCards(
|
|
2521
|
+
function MobileCards(t0) {
|
|
2522
|
+
const $ = (0, react_compiler_runtime.c)(53);
|
|
2523
|
+
const { table, rows, rowActions, confirm, getRowId, bodyRef, className, rowEntries, paddingTop: t1, paddingBottom: t2, measureElement, density: t3, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion } = t0;
|
|
2524
|
+
const paddingTop = t1 === void 0 ? 0 : t1;
|
|
2525
|
+
const paddingBottom = t2 === void 0 ? 0 : t2;
|
|
2526
|
+
const density = t3 === void 0 ? "comfortable" : t3;
|
|
1201
2527
|
const { columns, selection, labels } = table;
|
|
1202
2528
|
const compact = density === "compact";
|
|
1203
2529
|
const cardPadding = compact ? "sm" : "md";
|
|
1204
2530
|
const cardGap = compact ? 4 : "xs";
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
2531
|
+
let T0;
|
|
2532
|
+
let summaryCells;
|
|
2533
|
+
let t4;
|
|
2534
|
+
let t5;
|
|
2535
|
+
let t6;
|
|
2536
|
+
let t7;
|
|
2537
|
+
let t8;
|
|
2538
|
+
let t9;
|
|
2539
|
+
if ($[0] !== bodyRef || $[1] !== cardGap || $[2] !== cardPadding || $[3] !== className || $[4] !== columns || $[5] !== compact || $[6] !== confirm || $[7] !== expansion || $[8] !== getRowId || $[9] !== labels || $[10] !== measureElement || $[11] !== onRowClick || $[12] !== paddingTop || $[13] !== renderRowDetail || $[14] !== rowActions || $[15] !== rowClassName || $[16] !== rowEntries || $[17] !== rows || $[18] !== selection || $[19] !== summaryRow || $[20] !== table) {
|
|
2540
|
+
const entries = rowEntries ?? rows.map((row, index) => ({
|
|
2541
|
+
row,
|
|
2542
|
+
index,
|
|
2543
|
+
key: getRowId(row)
|
|
2544
|
+
}));
|
|
2545
|
+
let t10;
|
|
2546
|
+
if ($[29] !== rows || $[30] !== summaryRow) {
|
|
2547
|
+
t10 = summaryRow?.(rows);
|
|
2548
|
+
$[29] = rows;
|
|
2549
|
+
$[30] = summaryRow;
|
|
2550
|
+
$[31] = t10;
|
|
2551
|
+
} else t10 = $[31];
|
|
2552
|
+
summaryCells = t10;
|
|
2553
|
+
T0 = _mantine_core.Stack;
|
|
2554
|
+
t4 = compact ? "xs" : "sm";
|
|
2555
|
+
t5 = bodyRef;
|
|
2556
|
+
t6 = className;
|
|
2557
|
+
if ($[32] !== table) {
|
|
2558
|
+
t7 = table.getTableProps({ role: "list" });
|
|
2559
|
+
$[32] = table;
|
|
2560
|
+
$[33] = t7;
|
|
2561
|
+
} else t7 = $[33];
|
|
2562
|
+
if ($[34] !== paddingTop) {
|
|
2563
|
+
t8 = paddingTop > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1218
2564
|
"aria-hidden": true,
|
|
1219
2565
|
style: { height: paddingTop }
|
|
1220
|
-
})
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
"data-stagger": "",
|
|
1233
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
1234
|
-
gap: cardGap,
|
|
1235
|
-
children: [
|
|
1236
|
-
selection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Checkbox, {
|
|
1237
|
-
"aria-label": labels.selectRow,
|
|
1238
|
-
checked: selection.isSelected(id),
|
|
1239
|
-
onChange: () => selection.toggle(id)
|
|
1240
|
-
}),
|
|
1241
|
-
expansion && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
1242
|
-
justify: "flex-end",
|
|
1243
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandToggle, {
|
|
1244
|
-
expanded: expansion.isExpanded(id),
|
|
1245
|
-
expandLabel: labels.expandRow,
|
|
1246
|
-
collapseLabel: labels.collapseRow,
|
|
1247
|
-
onToggle: () => expansion.toggle(id)
|
|
1248
|
-
})
|
|
1249
|
-
}),
|
|
1250
|
-
columns.map((column) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
1251
|
-
fz: "xs",
|
|
1252
|
-
c: "dimmed",
|
|
1253
|
-
tt: "uppercase",
|
|
1254
|
-
fw: 500,
|
|
1255
|
-
children: mobileLabel(column)
|
|
1256
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
1257
|
-
component: "div",
|
|
1258
|
-
fz: "sm",
|
|
1259
|
-
children: column.Cell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(column.Cell, {
|
|
1260
|
-
row,
|
|
1261
|
-
rowIndex: index
|
|
1262
|
-
}) : column.accessor?.(row)
|
|
1263
|
-
})] }, column.key)),
|
|
1264
|
-
expansion?.isExpanded(id) === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: renderRowDetail(row) }),
|
|
1265
|
-
rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
1266
|
-
gap: 4,
|
|
1267
|
-
justify: "flex-end",
|
|
1268
|
-
pt: 4,
|
|
1269
|
-
children: rowActions.map((action) => {
|
|
1270
|
-
if (action.isHidden?.(row)) return null;
|
|
1271
|
-
const reason = (0, _adapttable_core.resolveDisabledReason)(action.disabledReason?.(row));
|
|
1272
|
-
const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
|
|
1273
|
-
const run = disabled ? void 0 : () => (0, _adapttable_core.runRowAction)(action, row, confirm, labels.cancel);
|
|
1274
|
-
return action.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Tooltip, {
|
|
1275
|
-
label: reason ?? action.label,
|
|
1276
|
-
withArrow: true,
|
|
1277
|
-
openDelay: 200,
|
|
1278
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
1279
|
-
variant: "subtle",
|
|
1280
|
-
color: action.color,
|
|
1281
|
-
size: "sm",
|
|
1282
|
-
disabled,
|
|
1283
|
-
"aria-label": action.label,
|
|
1284
|
-
onClick: run,
|
|
1285
|
-
children: action.icon
|
|
1286
|
-
})
|
|
1287
|
-
}, action.key) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
1288
|
-
variant: "subtle",
|
|
1289
|
-
color: action.color,
|
|
1290
|
-
size: "compact-sm",
|
|
1291
|
-
disabled,
|
|
1292
|
-
onClick: run,
|
|
1293
|
-
children: action.label
|
|
1294
|
-
}, action.key);
|
|
1295
|
-
})
|
|
1296
|
-
})
|
|
1297
|
-
]
|
|
1298
|
-
})
|
|
1299
|
-
}, key);
|
|
1300
|
-
}),
|
|
1301
|
-
paddingBottom > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1302
|
-
"aria-hidden": true,
|
|
1303
|
-
style: { height: paddingBottom }
|
|
1304
|
-
}),
|
|
1305
|
-
summaryCells && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Card, {
|
|
2566
|
+
});
|
|
2567
|
+
$[34] = paddingTop;
|
|
2568
|
+
$[35] = t8;
|
|
2569
|
+
} else t8 = $[35];
|
|
2570
|
+
t9 = entries.map((t11) => {
|
|
2571
|
+
const { row: row_0, index: index_0, key } = t11;
|
|
2572
|
+
const id = getRowId(row_0);
|
|
2573
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Card, {
|
|
2574
|
+
...(0, _adapttable_core.rowClickProps)(row_0, onRowClick),
|
|
2575
|
+
className: rowClassName?.(row_0, index_0),
|
|
2576
|
+
ref: measureElement,
|
|
2577
|
+
"data-index": index_0,
|
|
1306
2578
|
withBorder: true,
|
|
1307
2579
|
radius: "md",
|
|
1308
2580
|
padding: cardPadding,
|
|
1309
2581
|
role: "listitem",
|
|
1310
|
-
|
|
2582
|
+
"data-stagger": "",
|
|
2583
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
1311
2584
|
gap: cardGap,
|
|
1312
|
-
children:
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
2585
|
+
children: [
|
|
2586
|
+
selection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Checkbox, {
|
|
2587
|
+
"aria-label": labels.selectRow,
|
|
2588
|
+
checked: selection.isSelected(id),
|
|
2589
|
+
onChange: () => selection.toggle(id)
|
|
2590
|
+
}),
|
|
2591
|
+
expansion && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
2592
|
+
justify: "flex-end",
|
|
2593
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ExpandToggle, {
|
|
2594
|
+
expanded: expansion.isExpanded(id),
|
|
2595
|
+
expandLabel: labels.expandRow,
|
|
2596
|
+
collapseLabel: labels.collapseRow,
|
|
2597
|
+
onToggle: () => expansion.toggle(id)
|
|
2598
|
+
})
|
|
2599
|
+
}),
|
|
2600
|
+
columns.map((column) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2601
|
+
fz: "xs",
|
|
2602
|
+
c: "dimmed",
|
|
2603
|
+
tt: "uppercase",
|
|
2604
|
+
fw: 500,
|
|
2605
|
+
children: mobileLabel(column)
|
|
2606
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2607
|
+
component: "div",
|
|
2608
|
+
fz: "sm",
|
|
2609
|
+
children: column.Cell ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(column.Cell, {
|
|
2610
|
+
row: row_0,
|
|
2611
|
+
rowIndex: index_0
|
|
2612
|
+
}) : column.accessor?.(row_0)
|
|
2613
|
+
})] }, column.key)),
|
|
2614
|
+
expansion?.isExpanded(id) === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: renderRowDetail(row_0) }),
|
|
2615
|
+
rowActions && rowActions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
2616
|
+
gap: 4,
|
|
2617
|
+
justify: "flex-end",
|
|
2618
|
+
pt: 4,
|
|
2619
|
+
children: rowActions.map((action) => {
|
|
2620
|
+
if (action.isHidden?.(row_0)) return null;
|
|
2621
|
+
const reason = (0, _adapttable_core.resolveDisabledReason)(action.disabledReason?.(row_0));
|
|
2622
|
+
const disabled = reason !== void 0 || (action.isDisabled?.(row_0) ?? false);
|
|
2623
|
+
const run = disabled ? void 0 : () => (0, _adapttable_core.runRowAction)(action, row_0, confirm, labels.cancel);
|
|
2624
|
+
return action.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Tooltip, {
|
|
2625
|
+
label: reason ?? action.label,
|
|
2626
|
+
withArrow: true,
|
|
2627
|
+
openDelay: 200,
|
|
2628
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
2629
|
+
variant: "subtle",
|
|
2630
|
+
color: action.color,
|
|
2631
|
+
size: "sm",
|
|
2632
|
+
disabled,
|
|
2633
|
+
"aria-label": action.label,
|
|
2634
|
+
onClick: run,
|
|
2635
|
+
children: action.icon
|
|
2636
|
+
})
|
|
2637
|
+
}, action.key) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
2638
|
+
variant: "subtle",
|
|
2639
|
+
color: action.color,
|
|
2640
|
+
size: "compact-sm",
|
|
2641
|
+
disabled,
|
|
2642
|
+
onClick: run,
|
|
2643
|
+
children: action.label
|
|
2644
|
+
}, action.key);
|
|
2645
|
+
})
|
|
2646
|
+
})
|
|
2647
|
+
]
|
|
1324
2648
|
})
|
|
2649
|
+
}, key);
|
|
2650
|
+
});
|
|
2651
|
+
$[0] = bodyRef;
|
|
2652
|
+
$[1] = cardGap;
|
|
2653
|
+
$[2] = cardPadding;
|
|
2654
|
+
$[3] = className;
|
|
2655
|
+
$[4] = columns;
|
|
2656
|
+
$[5] = compact;
|
|
2657
|
+
$[6] = confirm;
|
|
2658
|
+
$[7] = expansion;
|
|
2659
|
+
$[8] = getRowId;
|
|
2660
|
+
$[9] = labels;
|
|
2661
|
+
$[10] = measureElement;
|
|
2662
|
+
$[11] = onRowClick;
|
|
2663
|
+
$[12] = paddingTop;
|
|
2664
|
+
$[13] = renderRowDetail;
|
|
2665
|
+
$[14] = rowActions;
|
|
2666
|
+
$[15] = rowClassName;
|
|
2667
|
+
$[16] = rowEntries;
|
|
2668
|
+
$[17] = rows;
|
|
2669
|
+
$[18] = selection;
|
|
2670
|
+
$[19] = summaryRow;
|
|
2671
|
+
$[20] = table;
|
|
2672
|
+
$[21] = T0;
|
|
2673
|
+
$[22] = summaryCells;
|
|
2674
|
+
$[23] = t4;
|
|
2675
|
+
$[24] = t5;
|
|
2676
|
+
$[25] = t6;
|
|
2677
|
+
$[26] = t7;
|
|
2678
|
+
$[27] = t8;
|
|
2679
|
+
$[28] = t9;
|
|
2680
|
+
} else {
|
|
2681
|
+
T0 = $[21];
|
|
2682
|
+
summaryCells = $[22];
|
|
2683
|
+
t4 = $[23];
|
|
2684
|
+
t5 = $[24];
|
|
2685
|
+
t6 = $[25];
|
|
2686
|
+
t7 = $[26];
|
|
2687
|
+
t8 = $[27];
|
|
2688
|
+
t9 = $[28];
|
|
2689
|
+
}
|
|
2690
|
+
let t10;
|
|
2691
|
+
if ($[36] !== paddingBottom) {
|
|
2692
|
+
t10 = paddingBottom > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2693
|
+
"aria-hidden": true,
|
|
2694
|
+
style: { height: paddingBottom }
|
|
2695
|
+
});
|
|
2696
|
+
$[36] = paddingBottom;
|
|
2697
|
+
$[37] = t10;
|
|
2698
|
+
} else t10 = $[37];
|
|
2699
|
+
let t11;
|
|
2700
|
+
if ($[38] !== cardGap || $[39] !== cardPadding || $[40] !== columns || $[41] !== summaryCells) {
|
|
2701
|
+
t11 = summaryCells && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Card, {
|
|
2702
|
+
withBorder: true,
|
|
2703
|
+
radius: "md",
|
|
2704
|
+
padding: cardPadding,
|
|
2705
|
+
role: "listitem",
|
|
2706
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
|
|
2707
|
+
gap: cardGap,
|
|
2708
|
+
children: columns.filter((column_0) => summaryCells[column_0.key] !== void 0).map((column_1) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2709
|
+
fz: "xs",
|
|
2710
|
+
c: "dimmed",
|
|
2711
|
+
tt: "uppercase",
|
|
2712
|
+
fw: 500,
|
|
2713
|
+
children: mobileLabel(column_1)
|
|
2714
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2715
|
+
component: "div",
|
|
2716
|
+
fz: "sm",
|
|
2717
|
+
fw: 600,
|
|
2718
|
+
children: summaryCells[column_1.key]
|
|
2719
|
+
})] }, column_1.key))
|
|
1325
2720
|
})
|
|
1326
|
-
|
|
1327
|
-
|
|
2721
|
+
});
|
|
2722
|
+
$[38] = cardGap;
|
|
2723
|
+
$[39] = cardPadding;
|
|
2724
|
+
$[40] = columns;
|
|
2725
|
+
$[41] = summaryCells;
|
|
2726
|
+
$[42] = t11;
|
|
2727
|
+
} else t11 = $[42];
|
|
2728
|
+
let t12;
|
|
2729
|
+
if ($[43] !== T0 || $[44] !== t10 || $[45] !== t11 || $[46] !== t4 || $[47] !== t5 || $[48] !== t6 || $[49] !== t7 || $[50] !== t8 || $[51] !== t9) {
|
|
2730
|
+
t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(T0, {
|
|
2731
|
+
gap: t4,
|
|
2732
|
+
ref: t5,
|
|
2733
|
+
className: t6,
|
|
2734
|
+
...t7,
|
|
2735
|
+
children: [
|
|
2736
|
+
t8,
|
|
2737
|
+
t9,
|
|
2738
|
+
t10,
|
|
2739
|
+
t11
|
|
2740
|
+
]
|
|
2741
|
+
});
|
|
2742
|
+
$[43] = T0;
|
|
2743
|
+
$[44] = t10;
|
|
2744
|
+
$[45] = t11;
|
|
2745
|
+
$[46] = t4;
|
|
2746
|
+
$[47] = t5;
|
|
2747
|
+
$[48] = t6;
|
|
2748
|
+
$[49] = t7;
|
|
2749
|
+
$[50] = t8;
|
|
2750
|
+
$[51] = t9;
|
|
2751
|
+
$[52] = t12;
|
|
2752
|
+
} else t12 = $[52];
|
|
2753
|
+
return t12;
|
|
1328
2754
|
}
|
|
1329
2755
|
//#endregion
|
|
1330
2756
|
//#region src/components/PaginationFooter.tsx
|
|
2757
|
+
/** Props for {@link PaginationFooter}. */
|
|
1331
2758
|
/** Desktop pagination bar: page-size + range on the left, pager on the right. */
|
|
1332
|
-
function PaginationFooter(
|
|
2759
|
+
function PaginationFooter(t0) {
|
|
2760
|
+
const $ = (0, react_compiler_runtime.c)(41);
|
|
2761
|
+
const { page, totalPages, limit, total, fromIndex, toIndex, onPageChange, onLimitChange, labels } = t0;
|
|
1333
2762
|
const safeTotalPages = Math.max(totalPages, 1);
|
|
1334
2763
|
const safePage = Math.min(Math.max(page, 1), safeTotalPages);
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
2764
|
+
let t1;
|
|
2765
|
+
if ($[0] !== limit) {
|
|
2766
|
+
t1 = (0, _adapttable_core.pageSizeOptions)(limit).map(_temp$2);
|
|
2767
|
+
$[0] = limit;
|
|
2768
|
+
$[1] = t1;
|
|
2769
|
+
} else t1 = $[1];
|
|
2770
|
+
const options = t1;
|
|
2771
|
+
let t2;
|
|
2772
|
+
if ($[2] !== labels.rowsPerPage) {
|
|
2773
|
+
t2 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2774
|
+
fz: "xs",
|
|
2775
|
+
c: "dimmed",
|
|
2776
|
+
children: labels.rowsPerPage
|
|
2777
|
+
});
|
|
2778
|
+
$[2] = labels.rowsPerPage;
|
|
2779
|
+
$[3] = t2;
|
|
2780
|
+
} else t2 = $[3];
|
|
2781
|
+
const t3 = labels.rowsPerPage;
|
|
2782
|
+
const t4 = String(limit);
|
|
2783
|
+
let t5;
|
|
2784
|
+
if ($[4] !== onLimitChange) {
|
|
2785
|
+
t5 = (v) => onLimitChange(Number(v));
|
|
2786
|
+
$[4] = onLimitChange;
|
|
2787
|
+
$[5] = t5;
|
|
2788
|
+
} else t5 = $[5];
|
|
2789
|
+
let t6;
|
|
2790
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2791
|
+
t6 = { withinPortal: false };
|
|
2792
|
+
$[6] = t6;
|
|
2793
|
+
} else t6 = $[6];
|
|
2794
|
+
let t7;
|
|
2795
|
+
if ($[7] !== labels.rowsPerPage || $[8] !== options || $[9] !== t4 || $[10] !== t5) {
|
|
2796
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Select, {
|
|
2797
|
+
"aria-label": t3,
|
|
2798
|
+
data: options,
|
|
2799
|
+
value: t4,
|
|
2800
|
+
onChange: t5,
|
|
2801
|
+
size: "xs",
|
|
2802
|
+
w: 76,
|
|
2803
|
+
allowDeselect: false,
|
|
2804
|
+
comboboxProps: t6
|
|
2805
|
+
});
|
|
2806
|
+
$[7] = labels.rowsPerPage;
|
|
2807
|
+
$[8] = options;
|
|
2808
|
+
$[9] = t4;
|
|
2809
|
+
$[10] = t5;
|
|
2810
|
+
$[11] = t7;
|
|
2811
|
+
} else t7 = $[11];
|
|
2812
|
+
let t8;
|
|
2813
|
+
if ($[12] !== fromIndex || $[13] !== labels || $[14] !== toIndex || $[15] !== total) {
|
|
2814
|
+
t8 = total > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2815
|
+
fz: "xs",
|
|
2816
|
+
c: "dimmed",
|
|
2817
|
+
children: labels.showing({
|
|
2818
|
+
from: fromIndex,
|
|
2819
|
+
to: toIndex,
|
|
2820
|
+
total
|
|
2821
|
+
})
|
|
2822
|
+
});
|
|
2823
|
+
$[12] = fromIndex;
|
|
2824
|
+
$[13] = labels;
|
|
2825
|
+
$[14] = toIndex;
|
|
2826
|
+
$[15] = total;
|
|
2827
|
+
$[16] = t8;
|
|
2828
|
+
} else t8 = $[16];
|
|
2829
|
+
let t9;
|
|
2830
|
+
if ($[17] !== t2 || $[18] !== t7 || $[19] !== t8) {
|
|
2831
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1346
2832
|
gap: "xs",
|
|
1347
2833
|
align: "center",
|
|
1348
2834
|
wrap: "nowrap",
|
|
1349
2835
|
children: [
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
children: labels.rowsPerPage
|
|
1354
|
-
}),
|
|
1355
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Select, {
|
|
1356
|
-
"aria-label": labels.rowsPerPage,
|
|
1357
|
-
data: options,
|
|
1358
|
-
value: String(limit),
|
|
1359
|
-
onChange: (v) => onLimitChange(Number(v)),
|
|
1360
|
-
size: "xs",
|
|
1361
|
-
w: 76,
|
|
1362
|
-
allowDeselect: false,
|
|
1363
|
-
comboboxProps: { withinPortal: false }
|
|
1364
|
-
}),
|
|
1365
|
-
total > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
1366
|
-
fz: "xs",
|
|
1367
|
-
c: "dimmed",
|
|
1368
|
-
children: labels.showing({
|
|
1369
|
-
from: fromIndex,
|
|
1370
|
-
to: toIndex,
|
|
1371
|
-
total
|
|
1372
|
-
})
|
|
1373
|
-
})
|
|
2836
|
+
t2,
|
|
2837
|
+
t7,
|
|
2838
|
+
t8
|
|
1374
2839
|
]
|
|
1375
|
-
})
|
|
2840
|
+
});
|
|
2841
|
+
$[17] = t2;
|
|
2842
|
+
$[18] = t7;
|
|
2843
|
+
$[19] = t8;
|
|
2844
|
+
$[20] = t9;
|
|
2845
|
+
} else t9 = $[20];
|
|
2846
|
+
let t10;
|
|
2847
|
+
if ($[21] !== labels || $[22] !== safePage || $[23] !== safeTotalPages) {
|
|
2848
|
+
t10 = labels.pageOf({
|
|
2849
|
+
page: safePage,
|
|
2850
|
+
total: safeTotalPages
|
|
2851
|
+
});
|
|
2852
|
+
$[21] = labels;
|
|
2853
|
+
$[22] = safePage;
|
|
2854
|
+
$[23] = safeTotalPages;
|
|
2855
|
+
$[24] = t10;
|
|
2856
|
+
} else t10 = $[24];
|
|
2857
|
+
let t11;
|
|
2858
|
+
if ($[25] !== t10) {
|
|
2859
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2860
|
+
fz: "xs",
|
|
2861
|
+
c: "dimmed",
|
|
2862
|
+
children: t10
|
|
2863
|
+
});
|
|
2864
|
+
$[25] = t10;
|
|
2865
|
+
$[26] = t11;
|
|
2866
|
+
} else t11 = $[26];
|
|
2867
|
+
let t12;
|
|
2868
|
+
if ($[27] !== labels.nextPage || $[28] !== labels.previousPage) {
|
|
2869
|
+
t12 = (control) => ({ "aria-label": control === "previous" ? labels.previousPage : labels.nextPage });
|
|
2870
|
+
$[27] = labels.nextPage;
|
|
2871
|
+
$[28] = labels.previousPage;
|
|
2872
|
+
$[29] = t12;
|
|
2873
|
+
} else t12 = $[29];
|
|
2874
|
+
let t13;
|
|
2875
|
+
if ($[30] !== onPageChange || $[31] !== safePage || $[32] !== safeTotalPages || $[33] !== t12) {
|
|
2876
|
+
t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Pagination, {
|
|
2877
|
+
total: safeTotalPages,
|
|
2878
|
+
value: safePage,
|
|
2879
|
+
onChange: onPageChange,
|
|
2880
|
+
size: "sm",
|
|
2881
|
+
siblings: 1,
|
|
2882
|
+
boundaries: 1,
|
|
2883
|
+
getControlProps: t12
|
|
2884
|
+
});
|
|
2885
|
+
$[30] = onPageChange;
|
|
2886
|
+
$[31] = safePage;
|
|
2887
|
+
$[32] = safeTotalPages;
|
|
2888
|
+
$[33] = t12;
|
|
2889
|
+
$[34] = t13;
|
|
2890
|
+
} else t13 = $[34];
|
|
2891
|
+
let t14;
|
|
2892
|
+
if ($[35] !== t11 || $[36] !== t13) {
|
|
2893
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1376
2894
|
gap: "sm",
|
|
1377
2895
|
align: "center",
|
|
1378
2896
|
wrap: "nowrap",
|
|
1379
|
-
children: [
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
2897
|
+
children: [t11, t13]
|
|
2898
|
+
});
|
|
2899
|
+
$[35] = t11;
|
|
2900
|
+
$[36] = t13;
|
|
2901
|
+
$[37] = t14;
|
|
2902
|
+
} else t14 = $[37];
|
|
2903
|
+
let t15;
|
|
2904
|
+
if ($[38] !== t14 || $[39] !== t9) {
|
|
2905
|
+
t15 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
2906
|
+
justify: "space-between",
|
|
2907
|
+
align: "center",
|
|
2908
|
+
wrap: "wrap",
|
|
2909
|
+
gap: "md",
|
|
2910
|
+
pt: "xs",
|
|
2911
|
+
children: [t9, t14]
|
|
2912
|
+
});
|
|
2913
|
+
$[38] = t14;
|
|
2914
|
+
$[39] = t9;
|
|
2915
|
+
$[40] = t15;
|
|
2916
|
+
} else t15 = $[40];
|
|
2917
|
+
return t15;
|
|
2918
|
+
}
|
|
2919
|
+
function _temp$2(n) {
|
|
2920
|
+
return {
|
|
2921
|
+
value: String(n),
|
|
2922
|
+
label: String(n)
|
|
2923
|
+
};
|
|
1397
2924
|
}
|
|
1398
2925
|
//#endregion
|
|
1399
2926
|
//#region src/components/SavedViewsMenu.tsx
|
|
2927
|
+
/** Props for {@link SavedViewsMenu}. */
|
|
1400
2928
|
/**
|
|
1401
2929
|
* Saved-views menu: lists every captured view (click a name to apply it, the
|
|
1402
2930
|
* trailing ✕ to delete it) above a save row that captures the table's
|
|
@@ -1404,164 +2932,401 @@ function PaginationFooter({ page, totalPages, limit, total, fromIndex, toIndex,
|
|
|
1404
2932
|
* and composes into the `toolbar` slot — or let `<DataTable savedViews>`
|
|
1405
2933
|
* mount it for you next to the Columns menu.
|
|
1406
2934
|
*/
|
|
1407
|
-
function SavedViewsMenu(
|
|
2935
|
+
function SavedViewsMenu(t0) {
|
|
2936
|
+
const $ = (0, react_compiler_runtime.c)(32);
|
|
2937
|
+
const { views, labels } = t0;
|
|
1408
2938
|
const [name, setName] = (0, react.useState)("");
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
2939
|
+
let t1;
|
|
2940
|
+
if ($[0] !== name) {
|
|
2941
|
+
t1 = name.trim();
|
|
2942
|
+
$[0] = name;
|
|
2943
|
+
$[1] = t1;
|
|
2944
|
+
} else t1 = $[1];
|
|
2945
|
+
const trimmed = t1;
|
|
2946
|
+
let t2;
|
|
2947
|
+
if ($[2] !== trimmed || $[3] !== views) {
|
|
2948
|
+
t2 = () => {
|
|
2949
|
+
views.save(trimmed);
|
|
2950
|
+
setName("");
|
|
2951
|
+
};
|
|
2952
|
+
$[2] = trimmed;
|
|
2953
|
+
$[3] = views;
|
|
2954
|
+
$[4] = t2;
|
|
2955
|
+
} else t2 = $[4];
|
|
2956
|
+
const handleSave = t2;
|
|
2957
|
+
let t3;
|
|
2958
|
+
if ($[5] !== labels.savedViews) {
|
|
2959
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Target, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
1419
2960
|
variant: "default",
|
|
1420
2961
|
size: "sm",
|
|
1421
2962
|
children: labels.savedViews
|
|
1422
|
-
}) })
|
|
2963
|
+
}) });
|
|
2964
|
+
$[5] = labels.savedViews;
|
|
2965
|
+
$[6] = t3;
|
|
2966
|
+
} else t3 = $[6];
|
|
2967
|
+
let t4;
|
|
2968
|
+
if ($[7] !== labels.savedViews) {
|
|
2969
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
2970
|
+
size: "xs",
|
|
2971
|
+
c: "dimmed",
|
|
2972
|
+
fw: 600,
|
|
2973
|
+
tt: "uppercase",
|
|
2974
|
+
px: 4,
|
|
2975
|
+
pb: 6,
|
|
2976
|
+
children: labels.savedViews
|
|
2977
|
+
});
|
|
2978
|
+
$[7] = labels.savedViews;
|
|
2979
|
+
$[8] = t4;
|
|
2980
|
+
} else t4 = $[8];
|
|
2981
|
+
let t5;
|
|
2982
|
+
if ($[9] !== labels.deleteView || $[10] !== views) {
|
|
2983
|
+
t5 = views.views.map((view) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
2984
|
+
gap: 6,
|
|
2985
|
+
px: 4,
|
|
2986
|
+
py: 2,
|
|
2987
|
+
wrap: "nowrap",
|
|
2988
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
2989
|
+
variant: "subtle",
|
|
2990
|
+
size: "compact-sm",
|
|
2991
|
+
justify: "flex-start",
|
|
2992
|
+
style: { flex: 1 },
|
|
2993
|
+
onClick: () => views.apply(view.name),
|
|
2994
|
+
children: view.name
|
|
2995
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
2996
|
+
variant: "subtle",
|
|
2997
|
+
color: "gray",
|
|
2998
|
+
size: "sm",
|
|
2999
|
+
"aria-label": `${labels.deleteView}: ${view.name}`,
|
|
3000
|
+
onClick: () => views.remove(view.name),
|
|
3001
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CloseIcon, { size: 12 })
|
|
3002
|
+
})]
|
|
3003
|
+
}, view.name));
|
|
3004
|
+
$[9] = labels.deleteView;
|
|
3005
|
+
$[10] = views;
|
|
3006
|
+
$[11] = t5;
|
|
3007
|
+
} else t5 = $[11];
|
|
3008
|
+
let t6;
|
|
3009
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3010
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Divider, {});
|
|
3011
|
+
$[12] = t6;
|
|
3012
|
+
} else t6 = $[12];
|
|
3013
|
+
let t7;
|
|
3014
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3015
|
+
t7 = { flex: 1 };
|
|
3016
|
+
$[13] = t7;
|
|
3017
|
+
} else t7 = $[13];
|
|
3018
|
+
let t8;
|
|
3019
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3020
|
+
t8 = (e) => setName(e.currentTarget.value);
|
|
3021
|
+
$[14] = t8;
|
|
3022
|
+
} else t8 = $[14];
|
|
3023
|
+
let t9;
|
|
3024
|
+
if ($[15] !== labels.viewName || $[16] !== name) {
|
|
3025
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.TextInput, {
|
|
3026
|
+
size: "xs",
|
|
3027
|
+
style: t7,
|
|
3028
|
+
placeholder: labels.viewName,
|
|
3029
|
+
value: name,
|
|
3030
|
+
onChange: t8
|
|
3031
|
+
});
|
|
3032
|
+
$[15] = labels.viewName;
|
|
3033
|
+
$[16] = name;
|
|
3034
|
+
$[17] = t9;
|
|
3035
|
+
} else t9 = $[17];
|
|
3036
|
+
const t10 = trimmed === "";
|
|
3037
|
+
let t11;
|
|
3038
|
+
if ($[18] !== handleSave || $[19] !== labels.saveView || $[20] !== t10) {
|
|
3039
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
3040
|
+
size: "xs",
|
|
3041
|
+
disabled: t10,
|
|
3042
|
+
onClick: handleSave,
|
|
3043
|
+
children: labels.saveView
|
|
3044
|
+
});
|
|
3045
|
+
$[18] = handleSave;
|
|
3046
|
+
$[19] = labels.saveView;
|
|
3047
|
+
$[20] = t10;
|
|
3048
|
+
$[21] = t11;
|
|
3049
|
+
} else t11 = $[21];
|
|
3050
|
+
let t12;
|
|
3051
|
+
if ($[22] !== t11 || $[23] !== t9) {
|
|
3052
|
+
t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
3053
|
+
gap: 6,
|
|
3054
|
+
p: 4,
|
|
3055
|
+
wrap: "nowrap",
|
|
3056
|
+
children: [t9, t11]
|
|
3057
|
+
});
|
|
3058
|
+
$[22] = t11;
|
|
3059
|
+
$[23] = t9;
|
|
3060
|
+
$[24] = t12;
|
|
3061
|
+
} else t12 = $[24];
|
|
3062
|
+
let t13;
|
|
3063
|
+
if ($[25] !== t12 || $[26] !== t4 || $[27] !== t5) {
|
|
3064
|
+
t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Dropdown, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Box, {
|
|
1423
3065
|
p: 4,
|
|
1424
3066
|
miw: 220,
|
|
1425
3067
|
children: [
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
tt: "uppercase",
|
|
1431
|
-
px: 4,
|
|
1432
|
-
pb: 6,
|
|
1433
|
-
children: labels.savedViews
|
|
1434
|
-
}),
|
|
1435
|
-
views.views.map((view) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1436
|
-
gap: 6,
|
|
1437
|
-
px: 4,
|
|
1438
|
-
py: 2,
|
|
1439
|
-
wrap: "nowrap",
|
|
1440
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
1441
|
-
variant: "subtle",
|
|
1442
|
-
size: "compact-sm",
|
|
1443
|
-
justify: "flex-start",
|
|
1444
|
-
style: { flex: 1 },
|
|
1445
|
-
onClick: () => views.apply(view.name),
|
|
1446
|
-
children: view.name
|
|
1447
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.ActionIcon, {
|
|
1448
|
-
variant: "subtle",
|
|
1449
|
-
color: "gray",
|
|
1450
|
-
size: "sm",
|
|
1451
|
-
"aria-label": `${labels.deleteView}: ${view.name}`,
|
|
1452
|
-
onClick: () => views.remove(view.name),
|
|
1453
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CloseIcon, { size: 12 })
|
|
1454
|
-
})]
|
|
1455
|
-
}, view.name)),
|
|
1456
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Menu.Divider, {}),
|
|
1457
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1458
|
-
gap: 6,
|
|
1459
|
-
p: 4,
|
|
1460
|
-
wrap: "nowrap",
|
|
1461
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.TextInput, {
|
|
1462
|
-
size: "xs",
|
|
1463
|
-
style: { flex: 1 },
|
|
1464
|
-
placeholder: labels.viewName,
|
|
1465
|
-
value: name,
|
|
1466
|
-
onChange: (e) => setName(e.currentTarget.value)
|
|
1467
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
1468
|
-
size: "xs",
|
|
1469
|
-
disabled: trimmed === "",
|
|
1470
|
-
onClick: handleSave,
|
|
1471
|
-
children: labels.saveView
|
|
1472
|
-
})]
|
|
1473
|
-
})
|
|
3068
|
+
t4,
|
|
3069
|
+
t5,
|
|
3070
|
+
t6,
|
|
3071
|
+
t12
|
|
1474
3072
|
]
|
|
1475
|
-
}) })
|
|
1476
|
-
|
|
3073
|
+
}) });
|
|
3074
|
+
$[25] = t12;
|
|
3075
|
+
$[26] = t4;
|
|
3076
|
+
$[27] = t5;
|
|
3077
|
+
$[28] = t13;
|
|
3078
|
+
} else t13 = $[28];
|
|
3079
|
+
let t14;
|
|
3080
|
+
if ($[29] !== t13 || $[30] !== t3) {
|
|
3081
|
+
t14 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Menu, {
|
|
3082
|
+
closeOnItemClick: false,
|
|
3083
|
+
position: "bottom-end",
|
|
3084
|
+
withinPortal: true,
|
|
3085
|
+
children: [t3, t13]
|
|
3086
|
+
});
|
|
3087
|
+
$[29] = t13;
|
|
3088
|
+
$[30] = t3;
|
|
3089
|
+
$[31] = t14;
|
|
3090
|
+
} else t14 = $[31];
|
|
3091
|
+
return t14;
|
|
1477
3092
|
}
|
|
1478
3093
|
//#endregion
|
|
1479
3094
|
//#region src/components/TableSkeleton.tsx
|
|
3095
|
+
/** Props for {@link TableSkeleton}. */
|
|
1480
3096
|
/** Loading placeholder that mirrors the table shape to avoid layout shift. */
|
|
1481
|
-
function TableSkeleton(
|
|
1482
|
-
const
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
}
|
|
3097
|
+
function TableSkeleton(t0) {
|
|
3098
|
+
const $ = (0, react_compiler_runtime.c)(17);
|
|
3099
|
+
const { columns, rows: t1, loadingLabel } = t0;
|
|
3100
|
+
const rows = t1 === void 0 ? 5 : t1;
|
|
3101
|
+
let t2;
|
|
3102
|
+
if ($[0] !== columns) {
|
|
3103
|
+
t2 = Array.from({ length: Math.max(columns, 1) }, _temp$1);
|
|
3104
|
+
$[0] = columns;
|
|
3105
|
+
$[1] = t2;
|
|
3106
|
+
} else t2 = $[1];
|
|
3107
|
+
const colKeys = t2;
|
|
3108
|
+
let t3;
|
|
3109
|
+
if ($[2] !== rows) {
|
|
3110
|
+
t3 = Array.from({ length: rows }, _temp2);
|
|
3111
|
+
$[2] = rows;
|
|
3112
|
+
$[3] = t3;
|
|
3113
|
+
} else t3 = $[3];
|
|
3114
|
+
const rowKeys = t3;
|
|
3115
|
+
let t4;
|
|
3116
|
+
if ($[4] !== colKeys) {
|
|
3117
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Thead, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Tr, { children: colKeys.map(_temp3) }) });
|
|
3118
|
+
$[4] = colKeys;
|
|
3119
|
+
$[5] = t4;
|
|
3120
|
+
} else t4 = $[5];
|
|
3121
|
+
let t5;
|
|
3122
|
+
if ($[6] !== colKeys || $[7] !== rowKeys) {
|
|
3123
|
+
t5 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Tbody, { children: rowKeys.map((r) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Tr, { children: colKeys.map(_temp4) }, r)) });
|
|
3124
|
+
$[6] = colKeys;
|
|
3125
|
+
$[7] = rowKeys;
|
|
3126
|
+
$[8] = t5;
|
|
3127
|
+
} else t5 = $[8];
|
|
3128
|
+
let t6;
|
|
3129
|
+
if ($[9] !== t4 || $[10] !== t5) {
|
|
3130
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Table, { children: [t4, t5] });
|
|
3131
|
+
$[9] = t4;
|
|
3132
|
+
$[10] = t5;
|
|
3133
|
+
$[11] = t6;
|
|
3134
|
+
} else t6 = $[11];
|
|
3135
|
+
let t7;
|
|
3136
|
+
if ($[12] !== loadingLabel) {
|
|
3137
|
+
t7 = loadingLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.VisuallyHidden, { children: loadingLabel }) : null;
|
|
3138
|
+
$[12] = loadingLabel;
|
|
3139
|
+
$[13] = t7;
|
|
3140
|
+
} else t7 = $[13];
|
|
3141
|
+
let t8;
|
|
3142
|
+
if ($[14] !== t6 || $[15] !== t7) {
|
|
3143
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3144
|
+
role: "status",
|
|
3145
|
+
"aria-busy": "true",
|
|
3146
|
+
"aria-live": "polite",
|
|
3147
|
+
children: [t6, t7]
|
|
3148
|
+
});
|
|
3149
|
+
$[14] = t6;
|
|
3150
|
+
$[15] = t7;
|
|
3151
|
+
$[16] = t8;
|
|
3152
|
+
} else t8 = $[16];
|
|
3153
|
+
return t8;
|
|
3154
|
+
}
|
|
3155
|
+
function _temp4(c_0) {
|
|
3156
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Td, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Skeleton, {
|
|
3157
|
+
height: 14,
|
|
3158
|
+
radius: "sm",
|
|
3159
|
+
width: c_0 === 0 ? "70%" : "55%"
|
|
3160
|
+
}) }, c_0);
|
|
3161
|
+
}
|
|
3162
|
+
function _temp3(c) {
|
|
3163
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Table.Th, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Skeleton, {
|
|
3164
|
+
height: 12,
|
|
3165
|
+
radius: "sm",
|
|
3166
|
+
width: c === 0 ? "55%" : "40%"
|
|
3167
|
+
}) }, c);
|
|
3168
|
+
}
|
|
3169
|
+
function _temp2(__0, i_0) {
|
|
3170
|
+
return i_0;
|
|
3171
|
+
}
|
|
3172
|
+
function _temp$1(_, i) {
|
|
3173
|
+
return i;
|
|
1498
3174
|
}
|
|
1499
3175
|
//#endregion
|
|
1500
3176
|
//#region src/components/FilterPopover.tsx
|
|
3177
|
+
/** Props for {@link FilterPopover}. */
|
|
1501
3178
|
/**
|
|
1502
3179
|
* Anchored filter card (the default filter container). Opens under the Filters
|
|
1503
3180
|
* button and tracks it on scroll. No backdrop — the background stays visible
|
|
1504
3181
|
* and interactive; clicking outside or pressing Escape closes it. Pair with
|
|
1505
3182
|
* `filtersMode="drawer"` for the slide-in panel instead.
|
|
1506
3183
|
*/
|
|
1507
|
-
function FilterPopover(
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
3184
|
+
function FilterPopover(t0) {
|
|
3185
|
+
const $ = (0, react_compiler_runtime.c)(22);
|
|
3186
|
+
const { open, onClose, filters, activeFilterCount, onClearFilters, labels, dir: t1, children } = t0;
|
|
3187
|
+
const t2 = (t1 === void 0 ? "ltr" : t1) === "rtl" ? "bottom-start" : "bottom-end";
|
|
3188
|
+
let t3;
|
|
3189
|
+
if ($[0] !== children) {
|
|
3190
|
+
t3 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Popover.Target, { children });
|
|
3191
|
+
$[0] = children;
|
|
3192
|
+
$[1] = t3;
|
|
3193
|
+
} else t3 = $[1];
|
|
3194
|
+
let t4;
|
|
3195
|
+
if ($[2] !== labels.filters) {
|
|
3196
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
3197
|
+
fw: 600,
|
|
3198
|
+
fz: "sm",
|
|
3199
|
+
children: labels.filters
|
|
3200
|
+
});
|
|
3201
|
+
$[2] = labels.filters;
|
|
3202
|
+
$[3] = t4;
|
|
3203
|
+
} else t4 = $[3];
|
|
3204
|
+
const t5 = activeFilterCount === 0;
|
|
3205
|
+
let t6;
|
|
3206
|
+
if ($[4] !== labels.clearAll || $[5] !== onClearFilters || $[6] !== t5) {
|
|
3207
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
3208
|
+
variant: "subtle",
|
|
3209
|
+
size: "compact-xs",
|
|
3210
|
+
onClick: onClearFilters,
|
|
3211
|
+
disabled: t5,
|
|
3212
|
+
children: labels.clearAll
|
|
3213
|
+
});
|
|
3214
|
+
$[4] = labels.clearAll;
|
|
3215
|
+
$[5] = onClearFilters;
|
|
3216
|
+
$[6] = t5;
|
|
3217
|
+
$[7] = t6;
|
|
3218
|
+
} else t6 = $[7];
|
|
3219
|
+
let t7;
|
|
3220
|
+
if ($[8] !== t4 || $[9] !== t6) {
|
|
3221
|
+
t7 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1517
3222
|
justify: "space-between",
|
|
1518
3223
|
align: "center",
|
|
1519
3224
|
mb: "sm",
|
|
1520
|
-
children: [
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
children: labels.clearAll
|
|
1530
|
-
})]
|
|
1531
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
|
|
3225
|
+
children: [t4, t6]
|
|
3226
|
+
});
|
|
3227
|
+
$[8] = t4;
|
|
3228
|
+
$[9] = t6;
|
|
3229
|
+
$[10] = t7;
|
|
3230
|
+
} else t7 = $[10];
|
|
3231
|
+
let t8;
|
|
3232
|
+
if ($[11] !== filters) {
|
|
3233
|
+
t8 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Stack, {
|
|
1532
3234
|
gap: "md",
|
|
1533
3235
|
children: filters
|
|
1534
|
-
})
|
|
1535
|
-
|
|
3236
|
+
});
|
|
3237
|
+
$[11] = filters;
|
|
3238
|
+
$[12] = t8;
|
|
3239
|
+
} else t8 = $[12];
|
|
3240
|
+
let t9;
|
|
3241
|
+
if ($[13] !== t7 || $[14] !== t8) {
|
|
3242
|
+
t9 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Popover.Dropdown, { children: [t7, t8] });
|
|
3243
|
+
$[13] = t7;
|
|
3244
|
+
$[14] = t8;
|
|
3245
|
+
$[15] = t9;
|
|
3246
|
+
} else t9 = $[15];
|
|
3247
|
+
let t10;
|
|
3248
|
+
if ($[16] !== onClose || $[17] !== open || $[18] !== t2 || $[19] !== t3 || $[20] !== t9) {
|
|
3249
|
+
t10 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Popover, {
|
|
3250
|
+
opened: open,
|
|
3251
|
+
onDismiss: onClose,
|
|
3252
|
+
position: t2,
|
|
3253
|
+
withinPortal: true,
|
|
3254
|
+
shadow: "md",
|
|
3255
|
+
radius: "md",
|
|
3256
|
+
width: 340,
|
|
3257
|
+
children: [t3, t9]
|
|
3258
|
+
});
|
|
3259
|
+
$[16] = onClose;
|
|
3260
|
+
$[17] = open;
|
|
3261
|
+
$[18] = t2;
|
|
3262
|
+
$[19] = t3;
|
|
3263
|
+
$[20] = t9;
|
|
3264
|
+
$[21] = t10;
|
|
3265
|
+
} else t10 = $[21];
|
|
3266
|
+
return t10;
|
|
1536
3267
|
}
|
|
1537
3268
|
//#endregion
|
|
1538
3269
|
//#region src/components/Toolbar.tsx
|
|
3270
|
+
/**
|
|
3271
|
+
* Props for {@link Toolbar}: the shared chrome surface from core plus the
|
|
3272
|
+
* Mantine-specific filter-container wiring.
|
|
3273
|
+
*/
|
|
1539
3274
|
/** Sticky toolbar: search, optional sort select, custom slot, filters, size. */
|
|
1540
|
-
function Toolbar(
|
|
3275
|
+
function Toolbar(t0) {
|
|
3276
|
+
const $ = (0, react_compiler_runtime.c)(45);
|
|
3277
|
+
const { table, hideSearch, searchPlaceholder, sortByOptions, customToolbar, hasFilters, activeFilterCount, onToggleFilters, onFiltersTriggerPointerDown, onCloseFilters, filtersOpen, filtersMode, filters, onClearFilters, dir, columnMenu, showRowsPerPage, className } = t0;
|
|
1541
3278
|
const { labels, source } = table;
|
|
1542
|
-
|
|
3279
|
+
let t1;
|
|
3280
|
+
if ($[0] !== searchPlaceholder || $[1] !== table) {
|
|
3281
|
+
t1 = table.getSearchInputProps(searchPlaceholder ? { placeholder: searchPlaceholder } : void 0);
|
|
3282
|
+
$[0] = searchPlaceholder;
|
|
3283
|
+
$[1] = table;
|
|
3284
|
+
$[2] = t1;
|
|
3285
|
+
} else t1 = $[2];
|
|
3286
|
+
const searchProps = t1;
|
|
1543
3287
|
const sortOptions = sortByOptions ?? (table.isMobile ? table.sortByOptions : void 0);
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
3288
|
+
const t2 = filtersMode === "popover" ? filtersOpen : void 0;
|
|
3289
|
+
const t3 = filtersOpen || void 0;
|
|
3290
|
+
let t4;
|
|
3291
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3292
|
+
t4 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FiltersIcon, { size: 16 });
|
|
3293
|
+
$[3] = t4;
|
|
3294
|
+
} else t4 = $[3];
|
|
3295
|
+
let t5;
|
|
3296
|
+
if ($[4] !== activeFilterCount) {
|
|
3297
|
+
t5 = activeFilterCount > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Badge, {
|
|
1551
3298
|
size: "sm",
|
|
1552
3299
|
circle: true,
|
|
1553
3300
|
children: activeFilterCount
|
|
1554
|
-
}) : void 0
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
3301
|
+
}) : void 0;
|
|
3302
|
+
$[4] = activeFilterCount;
|
|
3303
|
+
$[5] = t5;
|
|
3304
|
+
} else t5 = $[5];
|
|
3305
|
+
let t6;
|
|
3306
|
+
if ($[6] !== labels.filters || $[7] !== onFiltersTriggerPointerDown || $[8] !== onToggleFilters || $[9] !== t2 || $[10] !== t3 || $[11] !== t5) {
|
|
3307
|
+
t6 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
3308
|
+
variant: "default",
|
|
3309
|
+
size: "sm",
|
|
3310
|
+
"aria-expanded": t2,
|
|
3311
|
+
"data-active": t3,
|
|
3312
|
+
leftSection: t4,
|
|
3313
|
+
rightSection: t5,
|
|
3314
|
+
onPointerDown: onFiltersTriggerPointerDown,
|
|
3315
|
+
onClick: onToggleFilters,
|
|
3316
|
+
children: labels.filters
|
|
3317
|
+
});
|
|
3318
|
+
$[6] = labels.filters;
|
|
3319
|
+
$[7] = onFiltersTriggerPointerDown;
|
|
3320
|
+
$[8] = onToggleFilters;
|
|
3321
|
+
$[9] = t2;
|
|
3322
|
+
$[10] = t3;
|
|
3323
|
+
$[11] = t5;
|
|
3324
|
+
$[12] = t6;
|
|
3325
|
+
} else t6 = $[12];
|
|
3326
|
+
const filtersButton = t6;
|
|
3327
|
+
let t7;
|
|
3328
|
+
if ($[13] !== hideSearch || $[14] !== searchProps) {
|
|
3329
|
+
t7 = !hideSearch && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.TextInput, {
|
|
1565
3330
|
...searchProps,
|
|
1566
3331
|
leftSection: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchIcon, { size: 14 }),
|
|
1567
3332
|
size: "sm",
|
|
@@ -1570,57 +3335,119 @@ function Toolbar({ table, hideSearch, searchPlaceholder, sortByOptions, customTo
|
|
|
1570
3335
|
minWidth: 160,
|
|
1571
3336
|
maxWidth: 360
|
|
1572
3337
|
}
|
|
1573
|
-
})
|
|
3338
|
+
});
|
|
3339
|
+
$[13] = hideSearch;
|
|
3340
|
+
$[14] = searchProps;
|
|
3341
|
+
$[15] = t7;
|
|
3342
|
+
} else t7 = $[15];
|
|
3343
|
+
let t8;
|
|
3344
|
+
if ($[16] !== labels.sortBy || $[17] !== sortOptions || $[18] !== source) {
|
|
3345
|
+
t8 = sortOptions && sortOptions.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Select, {
|
|
3346
|
+
"aria-label": labels.sortBy,
|
|
3347
|
+
placeholder: labels.sortBy,
|
|
3348
|
+
data: sortOptions,
|
|
3349
|
+
value: source.sortBy ?? null,
|
|
3350
|
+
onChange: (v) => source.setSort(v ?? void 0, source.sortDir ?? "asc"),
|
|
3351
|
+
clearable: true,
|
|
3352
|
+
size: "sm",
|
|
3353
|
+
w: 160,
|
|
3354
|
+
comboboxProps: { withinPortal: false }
|
|
3355
|
+
});
|
|
3356
|
+
$[16] = labels.sortBy;
|
|
3357
|
+
$[17] = sortOptions;
|
|
3358
|
+
$[18] = source;
|
|
3359
|
+
$[19] = t8;
|
|
3360
|
+
} else t8 = $[19];
|
|
3361
|
+
let t9;
|
|
3362
|
+
if ($[20] !== activeFilterCount || $[21] !== dir || $[22] !== filters || $[23] !== filtersButton || $[24] !== filtersMode || $[25] !== filtersOpen || $[26] !== hasFilters || $[27] !== labels || $[28] !== onClearFilters || $[29] !== onCloseFilters) {
|
|
3363
|
+
t9 = hasFilters && (filtersMode === "popover" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterPopover, {
|
|
3364
|
+
open: filtersOpen,
|
|
3365
|
+
onClose: onCloseFilters,
|
|
3366
|
+
filters,
|
|
3367
|
+
activeFilterCount,
|
|
3368
|
+
onClearFilters,
|
|
3369
|
+
labels,
|
|
3370
|
+
dir,
|
|
3371
|
+
children: filtersButton
|
|
3372
|
+
}) : filtersButton);
|
|
3373
|
+
$[20] = activeFilterCount;
|
|
3374
|
+
$[21] = dir;
|
|
3375
|
+
$[22] = filters;
|
|
3376
|
+
$[23] = filtersButton;
|
|
3377
|
+
$[24] = filtersMode;
|
|
3378
|
+
$[25] = filtersOpen;
|
|
3379
|
+
$[26] = hasFilters;
|
|
3380
|
+
$[27] = labels;
|
|
3381
|
+
$[28] = onClearFilters;
|
|
3382
|
+
$[29] = onCloseFilters;
|
|
3383
|
+
$[30] = t9;
|
|
3384
|
+
} else t9 = $[30];
|
|
3385
|
+
let t10;
|
|
3386
|
+
if ($[31] !== labels.rowsPerPage || $[32] !== showRowsPerPage || $[33] !== source) {
|
|
3387
|
+
t10 = showRowsPerPage && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
3388
|
+
gap: "xs",
|
|
3389
|
+
align: "center",
|
|
3390
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
3391
|
+
fz: "xs",
|
|
3392
|
+
c: "dimmed",
|
|
3393
|
+
children: labels.rowsPerPage
|
|
3394
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Select, {
|
|
3395
|
+
"aria-label": labels.rowsPerPage,
|
|
3396
|
+
data: (0, _adapttable_core.pageSizeOptions)(source.limit).map(_temp),
|
|
3397
|
+
value: String(source.limit),
|
|
3398
|
+
onChange: (v_0) => source.setLimit(Number(v_0)),
|
|
3399
|
+
size: "sm",
|
|
3400
|
+
w: 80,
|
|
3401
|
+
allowDeselect: false,
|
|
3402
|
+
comboboxProps: { withinPortal: false }
|
|
3403
|
+
})]
|
|
3404
|
+
});
|
|
3405
|
+
$[31] = labels.rowsPerPage;
|
|
3406
|
+
$[32] = showRowsPerPage;
|
|
3407
|
+
$[33] = source;
|
|
3408
|
+
$[34] = t10;
|
|
3409
|
+
} else t10 = $[34];
|
|
3410
|
+
let t11;
|
|
3411
|
+
if ($[35] !== columnMenu || $[36] !== customToolbar || $[37] !== t10 || $[38] !== t8 || $[39] !== t9) {
|
|
3412
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
1574
3413
|
gap: "xs",
|
|
1575
3414
|
align: "center",
|
|
1576
3415
|
children: [
|
|
1577
|
-
|
|
1578
|
-
"aria-label": labels.sortBy,
|
|
1579
|
-
placeholder: labels.sortBy,
|
|
1580
|
-
data: sortOptions,
|
|
1581
|
-
value: source.sortBy ?? null,
|
|
1582
|
-
onChange: (v) => source.setSort(v ?? void 0, source.sortDir ?? "asc"),
|
|
1583
|
-
clearable: true,
|
|
1584
|
-
size: "sm",
|
|
1585
|
-
w: 160,
|
|
1586
|
-
comboboxProps: { withinPortal: false }
|
|
1587
|
-
}),
|
|
3416
|
+
t8,
|
|
1588
3417
|
customToolbar,
|
|
1589
|
-
|
|
1590
|
-
open: filtersOpen,
|
|
1591
|
-
onClose: onCloseFilters,
|
|
1592
|
-
filters,
|
|
1593
|
-
activeFilterCount,
|
|
1594
|
-
onClearFilters,
|
|
1595
|
-
labels,
|
|
1596
|
-
dir,
|
|
1597
|
-
children: filtersButton
|
|
1598
|
-
}) : filtersButton),
|
|
3418
|
+
t9,
|
|
1599
3419
|
columnMenu,
|
|
1600
|
-
|
|
1601
|
-
gap: "xs",
|
|
1602
|
-
align: "center",
|
|
1603
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Text, {
|
|
1604
|
-
fz: "xs",
|
|
1605
|
-
c: "dimmed",
|
|
1606
|
-
children: labels.rowsPerPage
|
|
1607
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Select, {
|
|
1608
|
-
"aria-label": labels.rowsPerPage,
|
|
1609
|
-
data: (0, _adapttable_core.pageSizeOptions)(source.limit).map((n) => ({
|
|
1610
|
-
value: String(n),
|
|
1611
|
-
label: String(n)
|
|
1612
|
-
})),
|
|
1613
|
-
value: String(source.limit),
|
|
1614
|
-
onChange: (v) => source.setLimit(Number(v)),
|
|
1615
|
-
size: "sm",
|
|
1616
|
-
w: 80,
|
|
1617
|
-
allowDeselect: false,
|
|
1618
|
-
comboboxProps: { withinPortal: false }
|
|
1619
|
-
})]
|
|
1620
|
-
})
|
|
3420
|
+
t10
|
|
1621
3421
|
]
|
|
1622
|
-
})
|
|
1623
|
-
|
|
3422
|
+
});
|
|
3423
|
+
$[35] = columnMenu;
|
|
3424
|
+
$[36] = customToolbar;
|
|
3425
|
+
$[37] = t10;
|
|
3426
|
+
$[38] = t8;
|
|
3427
|
+
$[39] = t9;
|
|
3428
|
+
$[40] = t11;
|
|
3429
|
+
} else t11 = $[40];
|
|
3430
|
+
let t12;
|
|
3431
|
+
if ($[41] !== className || $[42] !== t11 || $[43] !== t7) {
|
|
3432
|
+
t12 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Group, {
|
|
3433
|
+
gap: "sm",
|
|
3434
|
+
justify: "space-between",
|
|
3435
|
+
align: "center",
|
|
3436
|
+
className,
|
|
3437
|
+
children: [t7, t11]
|
|
3438
|
+
});
|
|
3439
|
+
$[41] = className;
|
|
3440
|
+
$[42] = t11;
|
|
3441
|
+
$[43] = t7;
|
|
3442
|
+
$[44] = t12;
|
|
3443
|
+
} else t12 = $[44];
|
|
3444
|
+
return t12;
|
|
3445
|
+
}
|
|
3446
|
+
function _temp(n) {
|
|
3447
|
+
return {
|
|
3448
|
+
value: String(n),
|
|
3449
|
+
label: String(n)
|
|
3450
|
+
};
|
|
1624
3451
|
}
|
|
1625
3452
|
//#endregion
|
|
1626
3453
|
//#region src/DataTable.tsx
|
|
@@ -1632,19 +3459,47 @@ const stickyToolbarStyle = (top) => ({
|
|
|
1632
3459
|
paddingBottom: "var(--mantine-spacing-xs)"
|
|
1633
3460
|
});
|
|
1634
3461
|
/** The Columns menu, rendered inline in the toolbar — or nothing when off. */
|
|
1635
|
-
function ColumnMenuSlot(
|
|
3462
|
+
function ColumnMenuSlot(t0) {
|
|
3463
|
+
const $ = (0, react_compiler_runtime.c)(5);
|
|
3464
|
+
let enabled;
|
|
3465
|
+
let props;
|
|
3466
|
+
if ($[0] !== t0) {
|
|
3467
|
+
({enabled, ...props} = t0);
|
|
3468
|
+
$[0] = t0;
|
|
3469
|
+
$[1] = enabled;
|
|
3470
|
+
$[2] = props;
|
|
3471
|
+
} else {
|
|
3472
|
+
enabled = $[1];
|
|
3473
|
+
props = $[2];
|
|
3474
|
+
}
|
|
1636
3475
|
if (!enabled) return null;
|
|
1637
|
-
|
|
3476
|
+
let t1;
|
|
3477
|
+
if ($[3] !== props) {
|
|
3478
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ColumnMenu, { ...props });
|
|
3479
|
+
$[3] = props;
|
|
3480
|
+
$[4] = t1;
|
|
3481
|
+
} else t1 = $[4];
|
|
3482
|
+
return t1;
|
|
1638
3483
|
}
|
|
1639
3484
|
/**
|
|
1640
3485
|
* The Saved-views menu in the toolbar. A component (not inline JSX) so
|
|
1641
3486
|
* `useSavedViews` only runs when the `savedViews` prop is set.
|
|
1642
3487
|
*/
|
|
1643
|
-
function SavedViewsSlot(
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
3488
|
+
function SavedViewsSlot(t0) {
|
|
3489
|
+
const $ = (0, react_compiler_runtime.c)(3);
|
|
3490
|
+
const { options, labels } = t0;
|
|
3491
|
+
const views = (0, _adapttable_core.useSavedViews)(options);
|
|
3492
|
+
let t1;
|
|
3493
|
+
if ($[0] !== labels || $[1] !== views) {
|
|
3494
|
+
t1 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SavedViewsMenu, {
|
|
3495
|
+
views,
|
|
3496
|
+
labels
|
|
3497
|
+
});
|
|
3498
|
+
$[0] = labels;
|
|
3499
|
+
$[1] = views;
|
|
3500
|
+
$[2] = t1;
|
|
3501
|
+
} else t1 = $[2];
|
|
3502
|
+
return t1;
|
|
1648
3503
|
}
|
|
1649
3504
|
/**
|
|
1650
3505
|
* Resolve the data tier (source ▸ server ▸ frontend) and the declarative
|
|
@@ -1654,37 +3509,86 @@ function SavedViewsSlot({ options, labels }) {
|
|
|
1654
3509
|
* per key). Everything downstream consumes these.
|
|
1655
3510
|
*/
|
|
1656
3511
|
function useResolvedTableProps(props) {
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
3512
|
+
const $ = (0, react_compiler_runtime.c)(26);
|
|
3513
|
+
const t0 = props.urlSync === false ? void 0 : props.urlAdapter;
|
|
3514
|
+
let t1;
|
|
3515
|
+
if ($[0] !== props.columns || $[1] !== props.data || $[2] !== props.filters || $[3] !== props.loading || $[4] !== props.locale || $[5] !== props.onQueryChange || $[6] !== props.source || $[7] !== props.total || $[8] !== props.urlKey || $[9] !== props.urlSync || $[10] !== t0) {
|
|
3516
|
+
t1 = {
|
|
3517
|
+
locale: props.locale,
|
|
3518
|
+
source: props.source,
|
|
3519
|
+
data: props.data,
|
|
3520
|
+
total: props.total,
|
|
3521
|
+
loading: props.loading,
|
|
3522
|
+
onQueryChange: props.onQueryChange,
|
|
3523
|
+
columns: props.columns,
|
|
3524
|
+
filters: props.filters,
|
|
3525
|
+
urlKey: props.urlKey,
|
|
3526
|
+
adapter: t0,
|
|
3527
|
+
enabled: props.urlSync
|
|
3528
|
+
};
|
|
3529
|
+
$[0] = props.columns;
|
|
3530
|
+
$[1] = props.data;
|
|
3531
|
+
$[2] = props.filters;
|
|
3532
|
+
$[3] = props.loading;
|
|
3533
|
+
$[4] = props.locale;
|
|
3534
|
+
$[5] = props.onQueryChange;
|
|
3535
|
+
$[6] = props.source;
|
|
3536
|
+
$[7] = props.total;
|
|
3537
|
+
$[8] = props.urlKey;
|
|
3538
|
+
$[9] = props.urlSync;
|
|
3539
|
+
$[10] = t0;
|
|
3540
|
+
$[11] = t1;
|
|
3541
|
+
} else t1 = $[11];
|
|
3542
|
+
const { source, runtime } = (0, _adapttable_core.useTableData)(t1);
|
|
3543
|
+
let t2;
|
|
3544
|
+
if ($[12] !== props.labels) {
|
|
3545
|
+
t2 = (0, _adapttable_core.resolveLabels)(props.labels);
|
|
3546
|
+
$[12] = props.labels;
|
|
3547
|
+
$[13] = t2;
|
|
3548
|
+
} else t2 = $[13];
|
|
3549
|
+
const labels = t2;
|
|
1671
3550
|
let filters;
|
|
1672
|
-
if ((0, _adapttable_core.isDeclarativeFilters)(props.filters) || props.filters === void 0)
|
|
1673
|
-
|
|
1674
|
-
source
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
filters
|
|
1686
|
-
|
|
1687
|
-
|
|
3551
|
+
if ((0, _adapttable_core.isDeclarativeFilters)(props.filters) || props.filters === void 0) {
|
|
3552
|
+
let t3;
|
|
3553
|
+
if ($[14] !== labels || $[15] !== runtime.defs || $[16] !== source) {
|
|
3554
|
+
t3 = runtime.defs.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AutoFilterForm, {
|
|
3555
|
+
defs: runtime.defs,
|
|
3556
|
+
source,
|
|
3557
|
+
labels
|
|
3558
|
+
}) : void 0;
|
|
3559
|
+
$[14] = labels;
|
|
3560
|
+
$[15] = runtime.defs;
|
|
3561
|
+
$[16] = source;
|
|
3562
|
+
$[17] = t3;
|
|
3563
|
+
} else t3 = $[17];
|
|
3564
|
+
filters = t3;
|
|
3565
|
+
} else filters = props.filters;
|
|
3566
|
+
let t3;
|
|
3567
|
+
if ($[18] !== props.filterLabels || $[19] !== runtime.filterLabels) {
|
|
3568
|
+
t3 = {
|
|
3569
|
+
...runtime.filterLabels,
|
|
3570
|
+
...props.filterLabels
|
|
3571
|
+
};
|
|
3572
|
+
$[18] = props.filterLabels;
|
|
3573
|
+
$[19] = runtime.filterLabels;
|
|
3574
|
+
$[20] = t3;
|
|
3575
|
+
} else t3 = $[20];
|
|
3576
|
+
const filterLabels = t3;
|
|
3577
|
+
let t4;
|
|
3578
|
+
if ($[21] !== filterLabels || $[22] !== filters || $[23] !== props || $[24] !== source) {
|
|
3579
|
+
t4 = {
|
|
3580
|
+
...props,
|
|
3581
|
+
source,
|
|
3582
|
+
filters,
|
|
3583
|
+
filterLabels
|
|
3584
|
+
};
|
|
3585
|
+
$[21] = filterLabels;
|
|
3586
|
+
$[22] = filters;
|
|
3587
|
+
$[23] = props;
|
|
3588
|
+
$[24] = source;
|
|
3589
|
+
$[25] = t4;
|
|
3590
|
+
} else t4 = $[25];
|
|
3591
|
+
return t4;
|
|
1688
3592
|
}
|
|
1689
3593
|
/**
|
|
1690
3594
|
* Batteries-included Mantine data table. Drop in `columns`, a `rowKey`,
|
|
@@ -1696,13 +3600,26 @@ function useResolvedTableProps(props) {
|
|
|
1696
3600
|
* @typeParam TRow - The row type.
|
|
1697
3601
|
*/
|
|
1698
3602
|
function DataTable(props) {
|
|
3603
|
+
const $ = (0, react_compiler_runtime.c)(161);
|
|
1699
3604
|
const chromeProps = useResolvedTableProps(props);
|
|
1700
|
-
const { source, rowActions, searchPlaceholder, sortByOptions, dir, prefetch, hideSearch, filters, filtersMode
|
|
3605
|
+
const { source, rowActions, searchPlaceholder, sortByOptions, dir, prefetch, hideSearch, filters, filtersMode: t0, bulkActions, slots, classNames, toolbar: customToolbar, skeletonRows, stickyTop: t1, animate: t2, stickyHeader: t3, enableColumnMenu: t4, savedViews } = chromeProps;
|
|
3606
|
+
const filtersMode = t0 === void 0 ? "popover" : t0;
|
|
3607
|
+
const stickyTop = t1 === void 0 ? 0 : t1;
|
|
3608
|
+
const animate = t2 === void 0 ? false : t2;
|
|
3609
|
+
const stickyHeader = t3 === void 0 ? false : t3;
|
|
3610
|
+
const enableColumnMenu = t4 === void 0 ? false : t4;
|
|
1701
3611
|
const density = chromeProps.density ?? "comfortable";
|
|
1702
3612
|
const chrome = (0, _adapttable_core.useTableChrome)(chromeProps);
|
|
1703
3613
|
const { table, isMobile, confirm, getRowId } = chrome;
|
|
1704
3614
|
const hasRowActions = (rowActions?.length ?? 0) > 0;
|
|
1705
|
-
|
|
3615
|
+
let t5;
|
|
3616
|
+
if ($[0] !== chrome.columnLayout || $[1] !== rowActions) {
|
|
3617
|
+
t5 = chrome.columnLayout.isHidden(_adapttable_core.ACTIONS_COLUMN_KEY) ? void 0 : rowActions;
|
|
3618
|
+
$[0] = chrome.columnLayout;
|
|
3619
|
+
$[1] = rowActions;
|
|
3620
|
+
$[2] = t5;
|
|
3621
|
+
} else t5 = $[2];
|
|
3622
|
+
const visibleRowActions = t5;
|
|
1706
3623
|
const actionsPinned = chrome.columnLayout.state.pinned[_adapttable_core.ACTIONS_COLUMN_KEY] === "right";
|
|
1707
3624
|
const { virtualization, loadMoreRef, canLoadMore, virtualScrollRef } = (0, _adapttable_core.useChromeBodyData)(chrome, chromeProps);
|
|
1708
3625
|
const [drawerOpened, setDrawerOpened] = (0, react.useState)(false);
|
|
@@ -1712,179 +3629,420 @@ function DataTable(props) {
|
|
|
1712
3629
|
const desktopBodyRef = (0, react.useRef)(null);
|
|
1713
3630
|
const mobileBodyRef = (0, react.useRef)(null);
|
|
1714
3631
|
(0, _adapttable_core.useChromeScrollReset)(rootRef, chrome, chromeProps);
|
|
1715
|
-
|
|
3632
|
+
let t6;
|
|
3633
|
+
if ($[3] !== isMobile || $[4] !== virtualization.rows.length) {
|
|
3634
|
+
t6 = [virtualization.rows.length, isMobile];
|
|
3635
|
+
$[3] = isMobile;
|
|
3636
|
+
$[4] = virtualization.rows.length;
|
|
3637
|
+
$[5] = t6;
|
|
3638
|
+
} else t6 = $[5];
|
|
3639
|
+
let t7;
|
|
3640
|
+
if ($[6] !== animate) {
|
|
3641
|
+
t7 = { enabled: animate };
|
|
3642
|
+
$[6] = animate;
|
|
3643
|
+
$[7] = t7;
|
|
3644
|
+
} else t7 = $[7];
|
|
3645
|
+
useMountStagger(isMobile ? mobileBodyRef : desktopBodyRef, t6, t7);
|
|
1716
3646
|
let body;
|
|
1717
|
-
if (chrome.body === "skeleton")
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
3647
|
+
if (chrome.body === "skeleton") {
|
|
3648
|
+
let t8;
|
|
3649
|
+
if ($[8] !== skeletonRows || $[9] !== slots?.skeleton || $[10] !== source.limit || $[11] !== table.columns || $[12] !== table.labels.loading) {
|
|
3650
|
+
t8 = slots?.skeleton ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableSkeleton, {
|
|
3651
|
+
columns: table.columns.length || 1,
|
|
3652
|
+
rows: skeletonRows ?? source.limit,
|
|
3653
|
+
loadingLabel: table.labels.loading
|
|
3654
|
+
});
|
|
3655
|
+
$[8] = skeletonRows;
|
|
3656
|
+
$[9] = slots?.skeleton;
|
|
3657
|
+
$[10] = source.limit;
|
|
3658
|
+
$[11] = table.columns;
|
|
3659
|
+
$[12] = table.labels.loading;
|
|
3660
|
+
$[13] = t8;
|
|
3661
|
+
} else t8 = $[13];
|
|
3662
|
+
body = t8;
|
|
3663
|
+
} else if (chrome.body === "empty") {
|
|
3664
|
+
let t8;
|
|
3665
|
+
if ($[14] !== chrome.clearFilters || $[15] !== chrome.emptyVariant || $[16] !== slots?.empty || $[17] !== table.labels.clearAll || $[18] !== table.labels.noData || $[19] !== table.labels.noResults) {
|
|
3666
|
+
t8 = slots?.empty ?? (chrome.emptyVariant === "noResults" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyState, {
|
|
3667
|
+
title: table.labels.noResults,
|
|
3668
|
+
action: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
3669
|
+
variant: "light",
|
|
3670
|
+
size: "sm",
|
|
3671
|
+
onClick: chrome.clearFilters,
|
|
3672
|
+
children: table.labels.clearAll
|
|
3673
|
+
})
|
|
3674
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EmptyState, { title: table.labels.noData }));
|
|
3675
|
+
$[14] = chrome.clearFilters;
|
|
3676
|
+
$[15] = chrome.emptyVariant;
|
|
3677
|
+
$[16] = slots?.empty;
|
|
3678
|
+
$[17] = table.labels.clearAll;
|
|
3679
|
+
$[18] = table.labels.noData;
|
|
3680
|
+
$[19] = table.labels.noResults;
|
|
3681
|
+
$[20] = t8;
|
|
3682
|
+
} else t8 = $[20];
|
|
3683
|
+
body = t8;
|
|
3684
|
+
} else if (chrome.body === "mobile") {
|
|
3685
|
+
const t8 = chrome.detail?.expansion;
|
|
3686
|
+
const t9 = classNames?.card;
|
|
3687
|
+
const t10 = virtualization.enabled ? virtualization.rows : void 0;
|
|
3688
|
+
let t11;
|
|
3689
|
+
if ($[21] !== confirm || $[22] !== density || $[23] !== getRowId || $[24] !== props.onRowClick || $[25] !== props.renderRowDetail || $[26] !== props.rowClassName || $[27] !== props.summaryRow || $[28] !== source.rows || $[29] !== t10 || $[30] !== t8 || $[31] !== t9 || $[32] !== table || $[33] !== virtualization.measureElement || $[34] !== virtualization.paddingBottom || $[35] !== virtualization.paddingTop || $[36] !== visibleRowActions) {
|
|
3690
|
+
t11 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileCards, {
|
|
3691
|
+
table,
|
|
3692
|
+
rows: source.rows,
|
|
3693
|
+
rowActions: visibleRowActions,
|
|
3694
|
+
confirm,
|
|
3695
|
+
getRowId,
|
|
3696
|
+
onRowClick: props.onRowClick,
|
|
3697
|
+
rowClassName: props.rowClassName,
|
|
3698
|
+
renderRowDetail: props.renderRowDetail,
|
|
3699
|
+
summaryRow: props.summaryRow,
|
|
3700
|
+
expansion: t8,
|
|
3701
|
+
bodyRef: mobileBodyRef,
|
|
3702
|
+
className: t9,
|
|
3703
|
+
rowEntries: t10,
|
|
3704
|
+
paddingTop: virtualization.paddingTop,
|
|
3705
|
+
paddingBottom: virtualization.paddingBottom,
|
|
3706
|
+
measureElement: virtualization.measureElement,
|
|
3707
|
+
density
|
|
3708
|
+
});
|
|
3709
|
+
$[21] = confirm;
|
|
3710
|
+
$[22] = density;
|
|
3711
|
+
$[23] = getRowId;
|
|
3712
|
+
$[24] = props.onRowClick;
|
|
3713
|
+
$[25] = props.renderRowDetail;
|
|
3714
|
+
$[26] = props.rowClassName;
|
|
3715
|
+
$[27] = props.summaryRow;
|
|
3716
|
+
$[28] = source.rows;
|
|
3717
|
+
$[29] = t10;
|
|
3718
|
+
$[30] = t8;
|
|
3719
|
+
$[31] = t9;
|
|
3720
|
+
$[32] = table;
|
|
3721
|
+
$[33] = virtualization.measureElement;
|
|
3722
|
+
$[34] = virtualization.paddingBottom;
|
|
3723
|
+
$[35] = virtualization.paddingTop;
|
|
3724
|
+
$[36] = visibleRowActions;
|
|
3725
|
+
$[37] = t11;
|
|
3726
|
+
} else t11 = $[37];
|
|
3727
|
+
body = t11;
|
|
3728
|
+
} else {
|
|
3729
|
+
const t8 = chrome.detail?.expansion;
|
|
3730
|
+
const t9 = classNames?.table;
|
|
3731
|
+
const t10 = virtualization.enabled ? virtualization.rows : void 0;
|
|
3732
|
+
const t11 = stickyTop + toolbarHeight;
|
|
3733
|
+
const t12 = props.resizableColumns ? chrome.columnLayout.setWidth : void 0;
|
|
3734
|
+
let t13;
|
|
3735
|
+
if ($[38] !== actionsPinned || $[39] !== chrome.columnLayout.pinOffset || $[40] !== chrome.columnLayout.state.widths || $[41] !== confirm || $[42] !== density || $[43] !== getRowId || $[44] !== prefetch || $[45] !== props.maxHeight || $[46] !== props.onRowClick || $[47] !== props.renderRowDetail || $[48] !== props.rowClassName || $[49] !== props.summaryRow || $[50] !== source.rows || $[51] !== stickyHeader || $[52] !== t10 || $[53] !== t11 || $[54] !== t12 || $[55] !== t8 || $[56] !== t9 || $[57] !== table || $[58] !== virtualScrollRef || $[59] !== virtualization.measureElement || $[60] !== virtualization.paddingBottom || $[61] !== virtualization.paddingTop || $[62] !== visibleRowActions) {
|
|
3736
|
+
t13 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DesktopTable, {
|
|
3737
|
+
table,
|
|
3738
|
+
rows: source.rows,
|
|
3739
|
+
rowActions: visibleRowActions,
|
|
3740
|
+
confirm,
|
|
3741
|
+
prefetch,
|
|
3742
|
+
onRowClick: props.onRowClick,
|
|
3743
|
+
rowClassName: props.rowClassName,
|
|
3744
|
+
renderRowDetail: props.renderRowDetail,
|
|
3745
|
+
summaryRow: props.summaryRow,
|
|
3746
|
+
expansion: t8,
|
|
3747
|
+
getRowId,
|
|
3748
|
+
bodyRef: desktopBodyRef,
|
|
3749
|
+
className: t9,
|
|
3750
|
+
rowEntries: t10,
|
|
3751
|
+
paddingTop: virtualization.paddingTop,
|
|
3752
|
+
paddingBottom: virtualization.paddingBottom,
|
|
3753
|
+
measureElement: virtualization.measureElement,
|
|
3754
|
+
stickyHeaderOffset: t11,
|
|
3755
|
+
stickyHeader,
|
|
3756
|
+
pinOffset: chrome.columnLayout.pinOffset,
|
|
3757
|
+
actionsPinned,
|
|
3758
|
+
maxHeight: props.maxHeight,
|
|
3759
|
+
virtualScrollRef,
|
|
3760
|
+
setWidth: t12,
|
|
3761
|
+
columnWidths: chrome.columnLayout.state.widths,
|
|
3762
|
+
resizeLabel: table.labels.resizeColumn,
|
|
3763
|
+
density
|
|
3764
|
+
});
|
|
3765
|
+
$[38] = actionsPinned;
|
|
3766
|
+
$[39] = chrome.columnLayout.pinOffset;
|
|
3767
|
+
$[40] = chrome.columnLayout.state.widths;
|
|
3768
|
+
$[41] = confirm;
|
|
3769
|
+
$[42] = density;
|
|
3770
|
+
$[43] = getRowId;
|
|
3771
|
+
$[44] = prefetch;
|
|
3772
|
+
$[45] = props.maxHeight;
|
|
3773
|
+
$[46] = props.onRowClick;
|
|
3774
|
+
$[47] = props.renderRowDetail;
|
|
3775
|
+
$[48] = props.rowClassName;
|
|
3776
|
+
$[49] = props.summaryRow;
|
|
3777
|
+
$[50] = source.rows;
|
|
3778
|
+
$[51] = stickyHeader;
|
|
3779
|
+
$[52] = t10;
|
|
3780
|
+
$[53] = t11;
|
|
3781
|
+
$[54] = t12;
|
|
3782
|
+
$[55] = t8;
|
|
3783
|
+
$[56] = t9;
|
|
3784
|
+
$[57] = table;
|
|
3785
|
+
$[58] = virtualScrollRef;
|
|
3786
|
+
$[59] = virtualization.measureElement;
|
|
3787
|
+
$[60] = virtualization.paddingBottom;
|
|
3788
|
+
$[61] = virtualization.paddingTop;
|
|
3789
|
+
$[62] = visibleRowActions;
|
|
3790
|
+
$[63] = t13;
|
|
3791
|
+
} else t13 = $[63];
|
|
3792
|
+
body = t13;
|
|
3793
|
+
}
|
|
3794
|
+
const t8 = chrome.isRefreshing || void 0;
|
|
3795
|
+
const t9 = classNames?.root;
|
|
3796
|
+
let t10;
|
|
3797
|
+
if ($[64] !== stickyTop) {
|
|
3798
|
+
t10 = stickyToolbarStyle(stickyTop);
|
|
3799
|
+
$[64] = stickyTop;
|
|
3800
|
+
$[65] = t10;
|
|
3801
|
+
} else t10 = $[65];
|
|
3802
|
+
const t11 = classNames?.toolbar;
|
|
3803
|
+
const t12 = Boolean(filters);
|
|
3804
|
+
let t13;
|
|
3805
|
+
if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
|
|
3806
|
+
t13 = () => setDrawerOpened(false);
|
|
3807
|
+
$[66] = t13;
|
|
3808
|
+
} else t13 = $[66];
|
|
3809
|
+
let t14;
|
|
3810
|
+
if ($[67] !== chromeProps.urlAdapter || $[68] !== chromeProps.urlKey || $[69] !== savedViews || $[70] !== table.labels) {
|
|
3811
|
+
t14 = savedViews && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SavedViewsSlot, {
|
|
3812
|
+
options: {
|
|
3813
|
+
adapter: chromeProps.urlAdapter,
|
|
3814
|
+
urlKey: chromeProps.urlKey,
|
|
3815
|
+
...savedViews
|
|
3816
|
+
},
|
|
3817
|
+
labels: table.labels
|
|
3818
|
+
});
|
|
3819
|
+
$[67] = chromeProps.urlAdapter;
|
|
3820
|
+
$[68] = chromeProps.urlKey;
|
|
3821
|
+
$[69] = savedViews;
|
|
3822
|
+
$[70] = table.labels;
|
|
3823
|
+
$[71] = t14;
|
|
3824
|
+
} else t14 = $[71];
|
|
3825
|
+
const t15 = enableColumnMenu && !isMobile;
|
|
3826
|
+
let t16;
|
|
3827
|
+
if ($[72] !== chrome.allColumns || $[73] !== chrome.columnLayout || $[74] !== hasRowActions || $[75] !== t15 || $[76] !== table.labels) {
|
|
3828
|
+
t16 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ColumnMenuSlot, {
|
|
3829
|
+
enabled: t15,
|
|
3830
|
+
allColumns: chrome.allColumns,
|
|
3831
|
+
layout: chrome.columnLayout,
|
|
3832
|
+
labels: table.labels,
|
|
3833
|
+
hasRowActions
|
|
3834
|
+
});
|
|
3835
|
+
$[72] = chrome.allColumns;
|
|
3836
|
+
$[73] = chrome.columnLayout;
|
|
3837
|
+
$[74] = hasRowActions;
|
|
3838
|
+
$[75] = t15;
|
|
3839
|
+
$[76] = table.labels;
|
|
3840
|
+
$[77] = t16;
|
|
3841
|
+
} else t16 = $[77];
|
|
3842
|
+
let t17;
|
|
3843
|
+
if ($[78] !== t14 || $[79] !== t16) {
|
|
3844
|
+
t17 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [t14, t16] });
|
|
3845
|
+
$[78] = t14;
|
|
3846
|
+
$[79] = t16;
|
|
3847
|
+
$[80] = t17;
|
|
3848
|
+
} else t17 = $[80];
|
|
3849
|
+
let t18;
|
|
3850
|
+
if ($[81] !== canLoadMore || $[82] !== chrome.activeFilterCount || $[83] !== chrome.clearFilters || $[84] !== customToolbar || $[85] !== dir || $[86] !== drawerOpened || $[87] !== filters || $[88] !== filtersMode || $[89] !== filtersTrigger.onClick || $[90] !== filtersTrigger.onPointerDown || $[91] !== hideSearch || $[92] !== searchPlaceholder || $[93] !== sortByOptions || $[94] !== t12 || $[95] !== t17 || $[96] !== table) {
|
|
3851
|
+
t18 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Toolbar, {
|
|
3852
|
+
table,
|
|
3853
|
+
hideSearch,
|
|
3854
|
+
searchPlaceholder,
|
|
3855
|
+
sortByOptions,
|
|
3856
|
+
customToolbar,
|
|
3857
|
+
hasFilters: t12,
|
|
3858
|
+
activeFilterCount: chrome.activeFilterCount,
|
|
3859
|
+
filtersMode,
|
|
3860
|
+
filters,
|
|
3861
|
+
filtersOpen: drawerOpened,
|
|
3862
|
+
onToggleFilters: filtersTrigger.onClick,
|
|
3863
|
+
onFiltersTriggerPointerDown: filtersTrigger.onPointerDown,
|
|
3864
|
+
onCloseFilters: t13,
|
|
3865
|
+
onClearFilters: chrome.clearFilters,
|
|
3866
|
+
dir,
|
|
3867
|
+
columnMenu: t17,
|
|
3868
|
+
showRowsPerPage: canLoadMore
|
|
3869
|
+
});
|
|
3870
|
+
$[81] = canLoadMore;
|
|
3871
|
+
$[82] = chrome.activeFilterCount;
|
|
3872
|
+
$[83] = chrome.clearFilters;
|
|
3873
|
+
$[84] = customToolbar;
|
|
3874
|
+
$[85] = dir;
|
|
3875
|
+
$[86] = drawerOpened;
|
|
3876
|
+
$[87] = filters;
|
|
3877
|
+
$[88] = filtersMode;
|
|
3878
|
+
$[89] = filtersTrigger.onClick;
|
|
3879
|
+
$[90] = filtersTrigger.onPointerDown;
|
|
3880
|
+
$[91] = hideSearch;
|
|
3881
|
+
$[92] = searchPlaceholder;
|
|
3882
|
+
$[93] = sortByOptions;
|
|
3883
|
+
$[94] = t12;
|
|
3884
|
+
$[95] = t17;
|
|
3885
|
+
$[96] = table;
|
|
3886
|
+
$[97] = t18;
|
|
3887
|
+
} else t18 = $[97];
|
|
3888
|
+
let t19;
|
|
3889
|
+
if ($[98] !== chrome.clearFilters || $[99] !== chrome.mergedChips || $[100] !== table.labels.clearAll || $[101] !== table.labels.filters) {
|
|
3890
|
+
t19 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActiveFilterChips, {
|
|
3891
|
+
chips: chrome.mergedChips,
|
|
3892
|
+
onClearAll: chrome.clearFilters,
|
|
3893
|
+
label: table.labels.filters,
|
|
3894
|
+
clearAllLabel: table.labels.clearAll
|
|
3895
|
+
});
|
|
3896
|
+
$[98] = chrome.clearFilters;
|
|
3897
|
+
$[99] = chrome.mergedChips;
|
|
3898
|
+
$[100] = table.labels.clearAll;
|
|
3899
|
+
$[101] = table.labels.filters;
|
|
3900
|
+
$[102] = t19;
|
|
3901
|
+
} else t19 = $[102];
|
|
3902
|
+
let t20;
|
|
3903
|
+
if ($[103] !== bulkActions || $[104] !== confirm || $[105] !== source.total || $[106] !== table.labels || $[107] !== table.selection) {
|
|
3904
|
+
t20 = table.selection && bulkActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BulkActionBar, {
|
|
3905
|
+
selection: table.selection,
|
|
3906
|
+
total: source.total,
|
|
3907
|
+
bulkActions,
|
|
3908
|
+
confirm,
|
|
3909
|
+
labels: table.labels
|
|
3910
|
+
});
|
|
3911
|
+
$[103] = bulkActions;
|
|
3912
|
+
$[104] = confirm;
|
|
3913
|
+
$[105] = source.total;
|
|
3914
|
+
$[106] = table.labels;
|
|
3915
|
+
$[107] = table.selection;
|
|
3916
|
+
$[108] = t20;
|
|
3917
|
+
} else t20 = $[108];
|
|
3918
|
+
let t21;
|
|
3919
|
+
if ($[109] !== t18 || $[110] !== t19 || $[111] !== t20) {
|
|
3920
|
+
t21 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
1788
3921
|
gap: "xs",
|
|
1789
3922
|
children: [
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
className: classNames?.toolbar,
|
|
1794
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
1795
|
-
gap: "xs",
|
|
1796
|
-
children: [
|
|
1797
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Toolbar, {
|
|
1798
|
-
table,
|
|
1799
|
-
hideSearch,
|
|
1800
|
-
searchPlaceholder,
|
|
1801
|
-
sortByOptions,
|
|
1802
|
-
customToolbar,
|
|
1803
|
-
hasFilters: Boolean(filters),
|
|
1804
|
-
activeFilterCount: chrome.activeFilterCount,
|
|
1805
|
-
filtersMode,
|
|
1806
|
-
filters,
|
|
1807
|
-
filtersOpen: drawerOpened,
|
|
1808
|
-
onToggleFilters: filtersTrigger.onClick,
|
|
1809
|
-
onFiltersTriggerPointerDown: filtersTrigger.onPointerDown,
|
|
1810
|
-
onCloseFilters: () => setDrawerOpened(false),
|
|
1811
|
-
onClearFilters: chrome.clearFilters,
|
|
1812
|
-
dir,
|
|
1813
|
-
columnMenu: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [savedViews && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SavedViewsSlot, {
|
|
1814
|
-
options: {
|
|
1815
|
-
adapter: chromeProps.urlAdapter,
|
|
1816
|
-
urlKey: chromeProps.urlKey,
|
|
1817
|
-
...savedViews
|
|
1818
|
-
},
|
|
1819
|
-
labels: table.labels
|
|
1820
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ColumnMenuSlot, {
|
|
1821
|
-
enabled: enableColumnMenu && !isMobile,
|
|
1822
|
-
allColumns: chrome.allColumns,
|
|
1823
|
-
layout: chrome.columnLayout,
|
|
1824
|
-
labels: table.labels,
|
|
1825
|
-
hasRowActions
|
|
1826
|
-
})] }),
|
|
1827
|
-
showRowsPerPage: canLoadMore
|
|
1828
|
-
}),
|
|
1829
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ActiveFilterChips, {
|
|
1830
|
-
chips: chrome.mergedChips,
|
|
1831
|
-
onClearAll: chrome.clearFilters,
|
|
1832
|
-
label: table.labels.filters,
|
|
1833
|
-
clearAllLabel: table.labels.clearAll
|
|
1834
|
-
}),
|
|
1835
|
-
table.selection && bulkActions && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BulkActionBar, {
|
|
1836
|
-
selection: table.selection,
|
|
1837
|
-
total: source.total,
|
|
1838
|
-
bulkActions,
|
|
1839
|
-
confirm,
|
|
1840
|
-
labels: table.labels
|
|
1841
|
-
})
|
|
1842
|
-
]
|
|
1843
|
-
})
|
|
1844
|
-
}),
|
|
1845
|
-
chrome.isRefreshing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Progress, {
|
|
1846
|
-
size: "xs",
|
|
1847
|
-
animated: true,
|
|
1848
|
-
value: 100,
|
|
1849
|
-
"aria-label": table.labels.loading
|
|
1850
|
-
}),
|
|
1851
|
-
source.error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorState, {
|
|
1852
|
-
error: source.error,
|
|
1853
|
-
title: table.labels.errorTitle,
|
|
1854
|
-
message: table.labels.errorMessage,
|
|
1855
|
-
retryLabel: table.labels.retry,
|
|
1856
|
-
onRetry: source.refetch ? () => void source.refetch?.() : void 0,
|
|
1857
|
-
isRetrying: source.isFetching
|
|
1858
|
-
}),
|
|
1859
|
-
!source.error && body,
|
|
1860
|
-
canLoadMore && source.hasNextPage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
1861
|
-
ref: loadMoreRef,
|
|
1862
|
-
justify: "center",
|
|
1863
|
-
py: "xs",
|
|
1864
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
1865
|
-
variant: "default",
|
|
1866
|
-
size: "sm",
|
|
1867
|
-
loading: source.isFetchingNextPage,
|
|
1868
|
-
onClick: () => source.fetchNextPage(),
|
|
1869
|
-
children: table.labels.loadMore
|
|
1870
|
-
})
|
|
1871
|
-
}),
|
|
1872
|
-
chrome.showFooter && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
|
|
1873
|
-
className: classNames?.footer,
|
|
1874
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationFooter, {
|
|
1875
|
-
page: table.pagination.safePage,
|
|
1876
|
-
totalPages: table.pagination.totalPages,
|
|
1877
|
-
limit: source.limit,
|
|
1878
|
-
total: source.total,
|
|
1879
|
-
fromIndex: table.pagination.fromIndex,
|
|
1880
|
-
toIndex: table.pagination.toIndex,
|
|
1881
|
-
onPageChange: source.setPage,
|
|
1882
|
-
onLimitChange: source.setLimit,
|
|
1883
|
-
labels: table.labels
|
|
1884
|
-
})
|
|
1885
|
-
})
|
|
3923
|
+
t18,
|
|
3924
|
+
t19,
|
|
3925
|
+
t20
|
|
1886
3926
|
]
|
|
1887
|
-
})
|
|
3927
|
+
});
|
|
3928
|
+
$[109] = t18;
|
|
3929
|
+
$[110] = t19;
|
|
3930
|
+
$[111] = t20;
|
|
3931
|
+
$[112] = t21;
|
|
3932
|
+
} else t21 = $[112];
|
|
3933
|
+
let t22;
|
|
3934
|
+
if ($[113] !== t10 || $[114] !== t11 || $[115] !== t21 || $[116] !== toolbarRef) {
|
|
3935
|
+
t22 = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
|
|
3936
|
+
ref: toolbarRef,
|
|
3937
|
+
style: t10,
|
|
3938
|
+
className: t11,
|
|
3939
|
+
children: t21
|
|
3940
|
+
});
|
|
3941
|
+
$[113] = t10;
|
|
3942
|
+
$[114] = t11;
|
|
3943
|
+
$[115] = t21;
|
|
3944
|
+
$[116] = toolbarRef;
|
|
3945
|
+
$[117] = t22;
|
|
3946
|
+
} else t22 = $[117];
|
|
3947
|
+
let t23;
|
|
3948
|
+
if ($[118] !== chrome.isRefreshing || $[119] !== table.labels.loading) {
|
|
3949
|
+
t23 = chrome.isRefreshing && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Progress, {
|
|
3950
|
+
size: "xs",
|
|
3951
|
+
animated: true,
|
|
3952
|
+
value: 100,
|
|
3953
|
+
"aria-label": table.labels.loading
|
|
3954
|
+
});
|
|
3955
|
+
$[118] = chrome.isRefreshing;
|
|
3956
|
+
$[119] = table.labels.loading;
|
|
3957
|
+
$[120] = t23;
|
|
3958
|
+
} else t23 = $[120];
|
|
3959
|
+
let t24;
|
|
3960
|
+
if ($[121] !== source || $[122] !== table.labels.errorMessage || $[123] !== table.labels.errorTitle || $[124] !== table.labels.retry) {
|
|
3961
|
+
t24 = source.error && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ErrorState, {
|
|
3962
|
+
error: source.error,
|
|
3963
|
+
title: table.labels.errorTitle,
|
|
3964
|
+
message: table.labels.errorMessage,
|
|
3965
|
+
retryLabel: table.labels.retry,
|
|
3966
|
+
onRetry: source.refetch ? () => void source.refetch?.() : void 0,
|
|
3967
|
+
isRetrying: source.isFetching
|
|
3968
|
+
});
|
|
3969
|
+
$[121] = source;
|
|
3970
|
+
$[122] = table.labels.errorMessage;
|
|
3971
|
+
$[123] = table.labels.errorTitle;
|
|
3972
|
+
$[124] = table.labels.retry;
|
|
3973
|
+
$[125] = t24;
|
|
3974
|
+
} else t24 = $[125];
|
|
3975
|
+
const t25 = !source.error && body;
|
|
3976
|
+
let t26;
|
|
3977
|
+
if ($[126] !== canLoadMore || $[127] !== loadMoreRef || $[128] !== source || $[129] !== table.labels.loadMore) {
|
|
3978
|
+
t26 = canLoadMore && source.hasNextPage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Group, {
|
|
3979
|
+
ref: loadMoreRef,
|
|
3980
|
+
justify: "center",
|
|
3981
|
+
py: "xs",
|
|
3982
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Button, {
|
|
3983
|
+
variant: "default",
|
|
3984
|
+
size: "sm",
|
|
3985
|
+
loading: source.isFetchingNextPage,
|
|
3986
|
+
onClick: () => source.fetchNextPage(),
|
|
3987
|
+
children: table.labels.loadMore
|
|
3988
|
+
})
|
|
3989
|
+
});
|
|
3990
|
+
$[126] = canLoadMore;
|
|
3991
|
+
$[127] = loadMoreRef;
|
|
3992
|
+
$[128] = source;
|
|
3993
|
+
$[129] = table.labels.loadMore;
|
|
3994
|
+
$[130] = t26;
|
|
3995
|
+
} else t26 = $[130];
|
|
3996
|
+
let t27;
|
|
3997
|
+
if ($[131] !== chrome.showFooter || $[132] !== classNames?.footer || $[133] !== source.limit || $[134] !== source.setLimit || $[135] !== source.setPage || $[136] !== source.total || $[137] !== table.labels || $[138] !== table.pagination) {
|
|
3998
|
+
t27 = chrome.showFooter && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mantine_core.Box, {
|
|
3999
|
+
className: classNames?.footer,
|
|
4000
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PaginationFooter, {
|
|
4001
|
+
page: table.pagination.safePage,
|
|
4002
|
+
totalPages: table.pagination.totalPages,
|
|
4003
|
+
limit: source.limit,
|
|
4004
|
+
total: source.total,
|
|
4005
|
+
fromIndex: table.pagination.fromIndex,
|
|
4006
|
+
toIndex: table.pagination.toIndex,
|
|
4007
|
+
onPageChange: source.setPage,
|
|
4008
|
+
onLimitChange: source.setLimit,
|
|
4009
|
+
labels: table.labels
|
|
4010
|
+
})
|
|
4011
|
+
});
|
|
4012
|
+
$[131] = chrome.showFooter;
|
|
4013
|
+
$[132] = classNames?.footer;
|
|
4014
|
+
$[133] = source.limit;
|
|
4015
|
+
$[134] = source.setLimit;
|
|
4016
|
+
$[135] = source.setPage;
|
|
4017
|
+
$[136] = source.total;
|
|
4018
|
+
$[137] = table.labels;
|
|
4019
|
+
$[138] = table.pagination;
|
|
4020
|
+
$[139] = t27;
|
|
4021
|
+
} else t27 = $[139];
|
|
4022
|
+
let t28;
|
|
4023
|
+
if ($[140] !== t22 || $[141] !== t23 || $[142] !== t24 || $[143] !== t25 || $[144] !== t26 || $[145] !== t27) {
|
|
4024
|
+
t28 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Stack, {
|
|
4025
|
+
gap: "xs",
|
|
4026
|
+
children: [
|
|
4027
|
+
t22,
|
|
4028
|
+
t23,
|
|
4029
|
+
t24,
|
|
4030
|
+
t25,
|
|
4031
|
+
t26,
|
|
4032
|
+
t27
|
|
4033
|
+
]
|
|
4034
|
+
});
|
|
4035
|
+
$[140] = t22;
|
|
4036
|
+
$[141] = t23;
|
|
4037
|
+
$[142] = t24;
|
|
4038
|
+
$[143] = t25;
|
|
4039
|
+
$[144] = t26;
|
|
4040
|
+
$[145] = t27;
|
|
4041
|
+
$[146] = t28;
|
|
4042
|
+
} else t28 = $[146];
|
|
4043
|
+
let t29;
|
|
4044
|
+
if ($[147] !== chrome.activeFilterCount || $[148] !== chrome.clearFilters || $[149] !== dir || $[150] !== drawerOpened || $[151] !== filters || $[152] !== filtersMode || $[153] !== table.labels) {
|
|
4045
|
+
t29 = filters && filtersMode === "drawer" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterDrawer, {
|
|
1888
4046
|
opened: drawerOpened,
|
|
1889
4047
|
onClose: () => setDrawerOpened(false),
|
|
1890
4048
|
filters,
|
|
@@ -1892,8 +4050,36 @@ function DataTable(props) {
|
|
|
1892
4050
|
onClearFilters: chrome.clearFilters,
|
|
1893
4051
|
labels: table.labels,
|
|
1894
4052
|
dir
|
|
1895
|
-
})
|
|
1896
|
-
|
|
4053
|
+
});
|
|
4054
|
+
$[147] = chrome.activeFilterCount;
|
|
4055
|
+
$[148] = chrome.clearFilters;
|
|
4056
|
+
$[149] = dir;
|
|
4057
|
+
$[150] = drawerOpened;
|
|
4058
|
+
$[151] = filters;
|
|
4059
|
+
$[152] = filtersMode;
|
|
4060
|
+
$[153] = table.labels;
|
|
4061
|
+
$[154] = t29;
|
|
4062
|
+
} else t29 = $[154];
|
|
4063
|
+
let t30;
|
|
4064
|
+
if ($[155] !== dir || $[156] !== t28 || $[157] !== t29 || $[158] !== t8 || $[159] !== t9) {
|
|
4065
|
+
t30 = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_mantine_core.Paper, {
|
|
4066
|
+
ref: rootRef,
|
|
4067
|
+
p: "xs",
|
|
4068
|
+
radius: "md",
|
|
4069
|
+
withBorder: true,
|
|
4070
|
+
dir,
|
|
4071
|
+
"aria-busy": t8,
|
|
4072
|
+
className: t9,
|
|
4073
|
+
children: [t28, t29]
|
|
4074
|
+
});
|
|
4075
|
+
$[155] = dir;
|
|
4076
|
+
$[156] = t28;
|
|
4077
|
+
$[157] = t29;
|
|
4078
|
+
$[158] = t8;
|
|
4079
|
+
$[159] = t9;
|
|
4080
|
+
$[160] = t30;
|
|
4081
|
+
} else t30 = $[160];
|
|
4082
|
+
return t30;
|
|
1897
4083
|
}
|
|
1898
4084
|
//#endregion
|
|
1899
4085
|
exports.ActiveFilterChips = ActiveFilterChips;
|