@adapttable/mui 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,88 +1,224 @@
1
+ import { c } from "react-compiler-runtime";
1
2
  import { ACTIONS_COLUMN_KEY, EyeIcon, GripIcon, PIN_Z, PinIcon, RANGE_OPS, RANGE_OP_LABEL_KEYS, RANGE_SUFFIXES, columnMenuRows, columnReorderKeyProps, columnResizeHandleProps, createHistoryAdapter, createMemoryAdapter, defaultConfirm, defaultLabels, deriveSortByOptions, edgePinStyle, filterLabel, getHistoryAdapter, headerGroupRow, isDeclarativeFilters, nextPinSide, pageSizeOptions, pinActionLabel, pinnedCellStyle, pinnedColumnWidth, readRangeWidget, resolveDisabledReason, resolveLabels, resolveVirtualRows, rowClickProps, runRowAction, tableMinWidth, tableRenderModel, useBackendData, useBulkActionRunner, useChromeBodyData, useChromeScrollReset, useColumnDragState, useDataTable, useFilterOptions, useFilterTriggerToggle, useFrontendData, useHorizontalOverflow, useSavedViews, useSavedViews as useSavedViews$1, useTableChrome, useTableData, useTableUrlState, writeRangeWidget } from "@adapttable/core";
2
3
  import { Alert, Badge, Box, Button, Card, CardContent, Checkbox, Chip, CircularProgress, ClickAwayListener, Divider, Drawer, FormControl, FormControlLabel, FormGroup, FormLabel, IconButton, InputAdornment, LinearProgress, MenuItem, Pagination, Paper, Popover, Popper, Skeleton, Stack, Table, TableBody, TableCell, TableFooter, TableHead, TableRow, TableSortLabel, TextField, Tooltip, Typography } from "@mui/material";
3
4
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
4
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
6
  //#region src/components/SavedViewsMenu.tsx
7
+ /** The label subset the saved-views menu renders. */
8
+ /** Props for the saved-views menu. */
6
9
  /**
7
10
  * MUI saved-views menu: a toolbar button opening a popover that lists the
8
11
  * saved views — click applies one to the table, the trailing × deletes it —
9
12
  * above a save row that captures the table's CURRENT URL state (search,
10
13
  * sort, page, filters, column layout) under a typed name.
11
14
  */
12
- function SavedViewsMenu({ options, labels }) {
15
+ function SavedViewsMenu(t0) {
16
+ const $ = c(47);
17
+ const { options, labels } = t0;
13
18
  const { views, save, apply, remove } = useSavedViews$1(options);
14
19
  const [anchor, setAnchor] = useState(null);
15
20
  const [name, setName] = useState("");
16
- const trimmed = name.trim();
17
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
18
- size: "small",
19
- variant: "outlined",
20
- "aria-expanded": anchor !== null,
21
- "aria-haspopup": "true",
22
- onClick: (e) => setAnchor(e.currentTarget),
23
- children: labels.savedViews
24
- }), /* @__PURE__ */ jsx(Popover, {
25
- anchorEl: anchor,
26
- open: anchor !== null,
27
- onClose: () => setAnchor(null),
28
- anchorOrigin: {
21
+ let t1;
22
+ if ($[0] !== name) {
23
+ t1 = name.trim();
24
+ $[0] = name;
25
+ $[1] = t1;
26
+ } else t1 = $[1];
27
+ const trimmed = t1;
28
+ const t2 = anchor !== null;
29
+ let t3;
30
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
31
+ t3 = (e) => setAnchor(e.currentTarget);
32
+ $[2] = t3;
33
+ } else t3 = $[2];
34
+ let t4;
35
+ if ($[3] !== labels.savedViews || $[4] !== t2) {
36
+ t4 = /* @__PURE__ */ jsx(Button, {
37
+ size: "small",
38
+ variant: "outlined",
39
+ "aria-expanded": t2,
40
+ "aria-haspopup": "true",
41
+ onClick: t3,
42
+ children: labels.savedViews
43
+ });
44
+ $[3] = labels.savedViews;
45
+ $[4] = t2;
46
+ $[5] = t4;
47
+ } else t4 = $[5];
48
+ const t5 = anchor !== null;
49
+ let t6;
50
+ let t7;
51
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
52
+ t6 = () => setAnchor(null);
53
+ t7 = {
29
54
  vertical: "bottom",
30
55
  horizontal: "left"
31
- },
32
- children: /* @__PURE__ */ jsxs(Box, {
33
- sx: {
34
- p: .75,
35
- minWidth: 250
36
- },
56
+ };
57
+ $[6] = t6;
58
+ $[7] = t7;
59
+ } else {
60
+ t6 = $[6];
61
+ t7 = $[7];
62
+ }
63
+ let t8;
64
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
65
+ t8 = {
66
+ p: .75,
67
+ minWidth: 250
68
+ };
69
+ $[8] = t8;
70
+ } else t8 = $[8];
71
+ let t9;
72
+ if ($[9] !== apply || $[10] !== labels.deleteView || $[11] !== remove || $[12] !== views) {
73
+ let t10;
74
+ if ($[14] !== apply || $[15] !== labels.deleteView || $[16] !== remove) {
75
+ t10 = (view) => /* @__PURE__ */ jsxs(Stack, {
76
+ direction: "row",
77
+ spacing: .5,
78
+ sx: { alignItems: "center" },
79
+ children: [/* @__PURE__ */ jsx(Button, {
80
+ size: "small",
81
+ fullWidth: true,
82
+ sx: { justifyContent: "flex-start" },
83
+ onClick: () => {
84
+ apply(view.name);
85
+ setAnchor(null);
86
+ },
87
+ children: view.name
88
+ }), /* @__PURE__ */ jsx(IconButton, {
89
+ size: "small",
90
+ "aria-label": `${labels.deleteView}: ${view.name}`,
91
+ onClick: () => remove(view.name),
92
+ children: "×"
93
+ })]
94
+ }, view.name);
95
+ $[14] = apply;
96
+ $[15] = labels.deleteView;
97
+ $[16] = remove;
98
+ $[17] = t10;
99
+ } else t10 = $[17];
100
+ t9 = views.map(t10);
101
+ $[9] = apply;
102
+ $[10] = labels.deleteView;
103
+ $[11] = remove;
104
+ $[12] = views;
105
+ $[13] = t9;
106
+ } else t9 = $[13];
107
+ let t10;
108
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
109
+ t10 = /* @__PURE__ */ jsx(Divider, { sx: { my: .5 } });
110
+ $[18] = t10;
111
+ } else t10 = $[18];
112
+ let t11;
113
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
114
+ t11 = { alignItems: "center" };
115
+ $[19] = t11;
116
+ } else t11 = $[19];
117
+ let t12;
118
+ if ($[20] !== labels.viewName) {
119
+ t12 = { htmlInput: { "aria-label": labels.viewName } };
120
+ $[20] = labels.viewName;
121
+ $[21] = t12;
122
+ } else t12 = $[21];
123
+ let t13;
124
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
125
+ t13 = (e_0) => setName(e_0.target.value);
126
+ $[22] = t13;
127
+ } else t13 = $[22];
128
+ let t14;
129
+ if ($[23] !== labels.viewName || $[24] !== name || $[25] !== t12) {
130
+ t14 = /* @__PURE__ */ jsx(TextField, {
131
+ size: "small",
132
+ value: name,
133
+ placeholder: labels.viewName,
134
+ slotProps: t12,
135
+ onChange: t13
136
+ });
137
+ $[23] = labels.viewName;
138
+ $[24] = name;
139
+ $[25] = t12;
140
+ $[26] = t14;
141
+ } else t14 = $[26];
142
+ const t15 = trimmed === "";
143
+ let t16;
144
+ if ($[27] !== save || $[28] !== trimmed) {
145
+ t16 = () => {
146
+ save(trimmed);
147
+ setName("");
148
+ };
149
+ $[27] = save;
150
+ $[28] = trimmed;
151
+ $[29] = t16;
152
+ } else t16 = $[29];
153
+ let t17;
154
+ if ($[30] !== labels.saveView || $[31] !== t15 || $[32] !== t16) {
155
+ t17 = /* @__PURE__ */ jsx(Button, {
156
+ size: "small",
157
+ variant: "contained",
158
+ disabled: t15,
159
+ onClick: t16,
160
+ children: labels.saveView
161
+ });
162
+ $[30] = labels.saveView;
163
+ $[31] = t15;
164
+ $[32] = t16;
165
+ $[33] = t17;
166
+ } else t17 = $[33];
167
+ let t18;
168
+ if ($[34] !== t14 || $[35] !== t17) {
169
+ t18 = /* @__PURE__ */ jsxs(Stack, {
170
+ direction: "row",
171
+ spacing: .5,
172
+ sx: t11,
173
+ children: [t14, t17]
174
+ });
175
+ $[34] = t14;
176
+ $[35] = t17;
177
+ $[36] = t18;
178
+ } else t18 = $[36];
179
+ let t19;
180
+ if ($[37] !== t18 || $[38] !== t9) {
181
+ t19 = /* @__PURE__ */ jsxs(Box, {
182
+ sx: t8,
37
183
  children: [
38
- views.map((view) => /* @__PURE__ */ jsxs(Stack, {
39
- direction: "row",
40
- spacing: .5,
41
- sx: { alignItems: "center" },
42
- children: [/* @__PURE__ */ jsx(Button, {
43
- size: "small",
44
- fullWidth: true,
45
- sx: { justifyContent: "flex-start" },
46
- onClick: () => {
47
- apply(view.name);
48
- setAnchor(null);
49
- },
50
- children: view.name
51
- }), /* @__PURE__ */ jsx(IconButton, {
52
- size: "small",
53
- "aria-label": `${labels.deleteView}: ${view.name}`,
54
- onClick: () => remove(view.name),
55
- children: "×"
56
- })]
57
- }, view.name)),
58
- /* @__PURE__ */ jsx(Divider, { sx: { my: .5 } }),
59
- /* @__PURE__ */ jsxs(Stack, {
60
- direction: "row",
61
- spacing: .5,
62
- sx: { alignItems: "center" },
63
- children: [/* @__PURE__ */ jsx(TextField, {
64
- size: "small",
65
- value: name,
66
- placeholder: labels.viewName,
67
- slotProps: { htmlInput: { "aria-label": labels.viewName } },
68
- onChange: (e) => setName(e.target.value)
69
- }), /* @__PURE__ */ jsx(Button, {
70
- size: "small",
71
- variant: "contained",
72
- disabled: trimmed === "",
73
- onClick: () => {
74
- save(trimmed);
75
- setName("");
76
- },
77
- children: labels.saveView
78
- })]
79
- })
184
+ t9,
185
+ t10,
186
+ t18
80
187
  ]
81
- })
82
- })] });
188
+ });
189
+ $[37] = t18;
190
+ $[38] = t9;
191
+ $[39] = t19;
192
+ } else t19 = $[39];
193
+ let t20;
194
+ if ($[40] !== anchor || $[41] !== t19 || $[42] !== t5) {
195
+ t20 = /* @__PURE__ */ jsx(Popover, {
196
+ anchorEl: anchor,
197
+ open: t5,
198
+ onClose: t6,
199
+ anchorOrigin: t7,
200
+ children: t19
201
+ });
202
+ $[40] = anchor;
203
+ $[41] = t19;
204
+ $[42] = t5;
205
+ $[43] = t20;
206
+ } else t20 = $[43];
207
+ let t21;
208
+ if ($[44] !== t20 || $[45] !== t4) {
209
+ t21 = /* @__PURE__ */ jsxs(Fragment, { children: [t4, t20] });
210
+ $[44] = t20;
211
+ $[45] = t4;
212
+ $[46] = t21;
213
+ } else t21 = $[46];
214
+ return t21;
83
215
  }
84
216
  //#endregion
85
217
  //#region src/components/AutoFilterForm.tsx
218
+ /** The slice of the source the auto-built form reads and writes. */
219
+ /** Props for {@link AutoFilterForm}. */
220
+ /** Props for one rendered filter widget. */
221
+ /** Field props for the widgets that also render resolved labels. */
86
222
  /** A scalar filter value as input text (arrays/blanks render empty). */
87
223
  function scalarText(value) {
88
224
  return typeof value === "string" || typeof value === "number" ? String(value) : "";
@@ -91,70 +227,233 @@ function scalarText(value) {
91
227
  function selectedList(value) {
92
228
  return Array.isArray(value) ? value : [];
93
229
  }
94
- function TextFilter({ def, source }) {
95
- return /* @__PURE__ */ jsx(TextField, {
96
- size: "small",
97
- label: filterLabel(def),
98
- placeholder: def.placeholder,
99
- value: scalarText(source.extra[def.key]),
100
- onChange: (e) => source.setExtra(def.key, e.target.value)
101
- });
230
+ function TextFilter(t0) {
231
+ const $ = c(12);
232
+ const { def, source } = t0;
233
+ let t1;
234
+ if ($[0] !== def) {
235
+ t1 = filterLabel(def);
236
+ $[0] = def;
237
+ $[1] = t1;
238
+ } else t1 = $[1];
239
+ const t2 = def.placeholder;
240
+ const t3 = source.extra[def.key];
241
+ let t4;
242
+ if ($[2] !== t3) {
243
+ t4 = scalarText(t3);
244
+ $[2] = t3;
245
+ $[3] = t4;
246
+ } else t4 = $[3];
247
+ let t5;
248
+ if ($[4] !== def.key || $[5] !== source) {
249
+ t5 = (e) => source.setExtra(def.key, e.target.value);
250
+ $[4] = def.key;
251
+ $[5] = source;
252
+ $[6] = t5;
253
+ } else t5 = $[6];
254
+ let t6;
255
+ if ($[7] !== def.placeholder || $[8] !== t1 || $[9] !== t4 || $[10] !== t5) {
256
+ t6 = /* @__PURE__ */ jsx(TextField, {
257
+ size: "small",
258
+ label: t1,
259
+ placeholder: t2,
260
+ value: t4,
261
+ onChange: t5
262
+ });
263
+ $[7] = def.placeholder;
264
+ $[8] = t1;
265
+ $[9] = t4;
266
+ $[10] = t5;
267
+ $[11] = t6;
268
+ } else t6 = $[11];
269
+ return t6;
102
270
  }
103
- function SelectFilter({ def, source }) {
271
+ function SelectFilter(t0) {
272
+ const $ = c(19);
273
+ const { def, source } = t0;
104
274
  const { options, loading } = useFilterOptions(def);
105
- return /* @__PURE__ */ jsxs(TextField, {
106
- select: true,
107
- size: "small",
108
- label: filterLabel(def),
109
- value: scalarText(source.extra[def.key]),
110
- onChange: (e) => source.setExtra(def.key, e.target.value),
111
- slotProps: {
275
+ let t1;
276
+ if ($[0] !== def) {
277
+ t1 = filterLabel(def);
278
+ $[0] = def;
279
+ $[1] = t1;
280
+ } else t1 = $[1];
281
+ const t2 = source.extra[def.key];
282
+ let t3;
283
+ if ($[2] !== t2) {
284
+ t3 = scalarText(t2);
285
+ $[2] = t2;
286
+ $[3] = t3;
287
+ } else t3 = $[3];
288
+ let t4;
289
+ if ($[4] !== def.key || $[5] !== source) {
290
+ t4 = (e) => source.setExtra(def.key, e.target.value);
291
+ $[4] = def.key;
292
+ $[5] = source;
293
+ $[6] = t4;
294
+ } else t4 = $[6];
295
+ let t5;
296
+ let t6;
297
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
298
+ t5 = {
112
299
  select: { native: true },
113
300
  inputLabel: { shrink: true }
114
- },
115
- children: [
116
- /* @__PURE__ */ jsx("option", {
117
- value: "",
118
- children: "All"
119
- }),
120
- loading && /* @__PURE__ */ jsx("option", {
121
- value: "",
122
- disabled: true,
123
- children: "…"
124
- }),
125
- options.map((option) => /* @__PURE__ */ jsx("option", {
126
- value: option.value,
127
- children: option.label
128
- }, option.value))
129
- ]
130
- });
301
+ };
302
+ t6 = /* @__PURE__ */ jsx("option", {
303
+ value: "",
304
+ children: "All"
305
+ });
306
+ $[7] = t5;
307
+ $[8] = t6;
308
+ } else {
309
+ t5 = $[7];
310
+ t6 = $[8];
311
+ }
312
+ let t7;
313
+ if ($[9] !== loading) {
314
+ t7 = loading && /* @__PURE__ */ jsx("option", {
315
+ value: "",
316
+ disabled: true,
317
+ children: "…"
318
+ });
319
+ $[9] = loading;
320
+ $[10] = t7;
321
+ } else t7 = $[10];
322
+ let t8;
323
+ if ($[11] !== options) {
324
+ t8 = options.map(_temp$1);
325
+ $[11] = options;
326
+ $[12] = t8;
327
+ } else t8 = $[12];
328
+ let t9;
329
+ if ($[13] !== t1 || $[14] !== t3 || $[15] !== t4 || $[16] !== t7 || $[17] !== t8) {
330
+ t9 = /* @__PURE__ */ jsxs(TextField, {
331
+ select: true,
332
+ size: "small",
333
+ label: t1,
334
+ value: t3,
335
+ onChange: t4,
336
+ slotProps: t5,
337
+ children: [
338
+ t6,
339
+ t7,
340
+ t8
341
+ ]
342
+ });
343
+ $[13] = t1;
344
+ $[14] = t3;
345
+ $[15] = t4;
346
+ $[16] = t7;
347
+ $[17] = t8;
348
+ $[18] = t9;
349
+ } else t9 = $[18];
350
+ return t9;
131
351
  }
132
- function MultiSelectFilter({ def, source }) {
352
+ function _temp$1(option) {
353
+ return /* @__PURE__ */ jsx("option", {
354
+ value: option.value,
355
+ children: option.label
356
+ }, option.value);
357
+ }
358
+ function MultiSelectFilter(t0) {
359
+ const $ = c(28);
360
+ const { def, source } = t0;
133
361
  const { options, loading } = useFilterOptions(def);
134
- const checked = selectedList(source.extra[def.key]);
135
- const toggle = (value, on) => {
136
- const next = on ? [...checked, value] : checked.filter((v) => v !== value);
137
- source.setExtra(def.key, next);
138
- };
139
- return /* @__PURE__ */ jsxs(FormControl, {
140
- component: "fieldset",
141
- variant: "standard",
142
- children: [/* @__PURE__ */ jsx(FormLabel, {
143
- component: "legend",
144
- children: filterLabel(def)
145
- }), /* @__PURE__ */ jsx(FormGroup, {
146
- row: true,
147
- sx: { columnGap: 1.5 },
148
- children: loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 16 }) : options.map((option) => /* @__PURE__ */ jsx(FormControlLabel, {
149
- label: option.label,
150
- control: /* @__PURE__ */ jsx(Checkbox, {
151
- size: "small",
152
- checked: checked.includes(option.value),
153
- onChange: (_, on) => toggle(option.value, on)
154
- })
155
- }, option.value))
156
- })]
157
- });
362
+ let T0;
363
+ let T1;
364
+ let t1;
365
+ let t2;
366
+ let t3;
367
+ let t4;
368
+ let t5;
369
+ let t6;
370
+ if ($[0] !== def || $[1] !== loading || $[2] !== options || $[3] !== source) {
371
+ const checked = selectedList(source.extra[def.key]);
372
+ const toggle = (value, on) => {
373
+ const next = on ? [...checked, value] : checked.filter((v) => v !== value);
374
+ source.setExtra(def.key, next);
375
+ };
376
+ T1 = FormControl;
377
+ t4 = "fieldset";
378
+ t5 = "standard";
379
+ let t7;
380
+ if ($[12] !== def) {
381
+ t7 = filterLabel(def);
382
+ $[12] = def;
383
+ $[13] = t7;
384
+ } else t7 = $[13];
385
+ if ($[14] !== t7) {
386
+ t6 = /* @__PURE__ */ jsx(FormLabel, {
387
+ component: "legend",
388
+ children: t7
389
+ });
390
+ $[14] = t7;
391
+ $[15] = t6;
392
+ } else t6 = $[15];
393
+ T0 = FormGroup;
394
+ t1 = true;
395
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
396
+ t2 = { columnGap: 1.5 };
397
+ $[16] = t2;
398
+ } else t2 = $[16];
399
+ t3 = loading ? /* @__PURE__ */ jsx(CircularProgress, { size: 16 }) : options.map((option) => /* @__PURE__ */ jsx(FormControlLabel, {
400
+ label: option.label,
401
+ control: /* @__PURE__ */ jsx(Checkbox, {
402
+ size: "small",
403
+ checked: checked.includes(option.value),
404
+ onChange: (_, on_0) => toggle(option.value, on_0)
405
+ })
406
+ }, option.value));
407
+ $[0] = def;
408
+ $[1] = loading;
409
+ $[2] = options;
410
+ $[3] = source;
411
+ $[4] = T0;
412
+ $[5] = T1;
413
+ $[6] = t1;
414
+ $[7] = t2;
415
+ $[8] = t3;
416
+ $[9] = t4;
417
+ $[10] = t5;
418
+ $[11] = t6;
419
+ } else {
420
+ T0 = $[4];
421
+ T1 = $[5];
422
+ t1 = $[6];
423
+ t2 = $[7];
424
+ t3 = $[8];
425
+ t4 = $[9];
426
+ t5 = $[10];
427
+ t6 = $[11];
428
+ }
429
+ let t7;
430
+ if ($[17] !== T0 || $[18] !== t1 || $[19] !== t2 || $[20] !== t3) {
431
+ t7 = /* @__PURE__ */ jsx(T0, {
432
+ row: t1,
433
+ sx: t2,
434
+ children: t3
435
+ });
436
+ $[17] = T0;
437
+ $[18] = t1;
438
+ $[19] = t2;
439
+ $[20] = t3;
440
+ $[21] = t7;
441
+ } else t7 = $[21];
442
+ let t8;
443
+ if ($[22] !== T1 || $[23] !== t4 || $[24] !== t5 || $[25] !== t6 || $[26] !== t7) {
444
+ t8 = /* @__PURE__ */ jsxs(T1, {
445
+ component: t4,
446
+ variant: t5,
447
+ children: [t6, t7]
448
+ });
449
+ $[22] = T1;
450
+ $[23] = t4;
451
+ $[24] = t5;
452
+ $[25] = t6;
453
+ $[26] = t7;
454
+ $[27] = t8;
455
+ } else t8 = $[27];
456
+ return t8;
158
457
  }
159
458
  /**
160
459
  * Operator-first range widget: a comparison select, then one value input —
@@ -162,7 +461,9 @@ function MultiSelectFilter({ def, source }) {
162
461
  * bounds always live in the source's `Min`/`Max` (`From`/`To`) pair, so
163
462
  * URLs, chips, and predicates are untouched by the operator presentation.
164
463
  */
165
- function RangeFilter({ def, type, source, labels }) {
464
+ function RangeFilter(t0) {
465
+ const $ = c(35);
466
+ const { def, type, source, labels } = t0;
166
467
  const suffixes = RANGE_SUFFIXES[type];
167
468
  const lowKey = def.key + suffixes.start;
168
469
  const highKey = def.key + suffixes.end;
@@ -170,83 +471,225 @@ function RangeFilter({ def, type, source, labels }) {
170
471
  const state = readRangeWidget(source.extra, lowKey, highKey);
171
472
  const [op, setOp] = useState(state.op);
172
473
  const single = op === "lte" ? state.b : state.a;
173
- const commit = (next, a, b) => source.setExtras(writeRangeWidget(next, a, b, lowKey, highKey));
474
+ let t1;
475
+ if ($[0] !== highKey || $[1] !== lowKey || $[2] !== source) {
476
+ t1 = (next, a, b) => source.setExtras(writeRangeWidget(next, a, b, lowKey, highKey));
477
+ $[0] = highKey;
478
+ $[1] = lowKey;
479
+ $[2] = source;
480
+ $[3] = t1;
481
+ } else t1 = $[3];
482
+ const commit = t1;
174
483
  const changeOp = (raw) => {
175
- const next = RANGE_OPS.find((candidate) => candidate === raw);
176
- setOp(next);
177
- commit(next, single, op === "between" ? state.b : "");
484
+ const next_0 = RANGE_OPS.find((candidate) => candidate === raw);
485
+ setOp(next_0);
486
+ commit(next_0, single, op === "between" ? state.b : "");
178
487
  };
179
- const input = (label, value, write) => /* @__PURE__ */ jsx(TextField, {
180
- size: "small",
181
- sx: {
182
- flex: "1 1 7rem",
183
- minWidth: "7rem"
184
- },
185
- type: type === "dateRange" ? "date" : "number",
186
- label,
187
- value,
188
- onChange: (e) => write(e.target.value),
189
- slotProps: { inputLabel: { shrink: true } }
190
- });
488
+ let t2;
489
+ if ($[4] !== type) {
490
+ t2 = (label, value, write) => /* @__PURE__ */ jsx(TextField, {
491
+ size: "small",
492
+ sx: {
493
+ flex: "1 1 7rem",
494
+ minWidth: "7rem"
495
+ },
496
+ type: type === "dateRange" ? "date" : "number",
497
+ label,
498
+ value,
499
+ onChange: (e) => write(e.target.value),
500
+ slotProps: { inputLabel: { shrink: true } }
501
+ });
502
+ $[4] = type;
503
+ $[5] = t2;
504
+ } else t2 = $[5];
505
+ const input = t2;
191
506
  let bounds = null;
192
- if (op === "between") bounds = /* @__PURE__ */ jsxs(Fragment, { children: [input(labels.from, state.a, (raw) => commit("between", raw, state.b)), input(labels.to, state.b, (raw) => commit("between", state.a, raw))] });
193
- else if (op !== void 0) bounds = input(labels.value, single, (raw) => commit(op, raw, ""));
194
- return /* @__PURE__ */ jsxs(FormControl, {
195
- component: "fieldset",
196
- variant: "standard",
197
- sx: { width: "100%" },
198
- children: [/* @__PURE__ */ jsx(FormLabel, {
507
+ if (op === "between") bounds = /* @__PURE__ */ jsxs(Fragment, { children: [input(labels.from, state.a, (raw_0) => commit("between", raw_0, state.b)), input(labels.to, state.b, (raw_1) => commit("between", state.a, raw_1))] });
508
+ else if (op !== void 0) {
509
+ let t3;
510
+ if ($[6] !== commit || $[7] !== op) {
511
+ t3 = (raw_2) => commit(op, raw_2, "");
512
+ $[6] = commit;
513
+ $[7] = op;
514
+ $[8] = t3;
515
+ } else t3 = $[8];
516
+ bounds = input(labels.value, single, t3);
517
+ }
518
+ let t3;
519
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
520
+ t3 = { width: "100%" };
521
+ $[9] = t3;
522
+ } else t3 = $[9];
523
+ let t4;
524
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
525
+ t4 = { mb: .75 };
526
+ $[10] = t4;
527
+ } else t4 = $[10];
528
+ let t5;
529
+ if ($[11] !== def) {
530
+ t5 = filterLabel(def);
531
+ $[11] = def;
532
+ $[12] = t5;
533
+ } else t5 = $[12];
534
+ let t6;
535
+ if ($[13] !== t5) {
536
+ t6 = /* @__PURE__ */ jsx(FormLabel, {
199
537
  component: "legend",
200
- sx: { mb: .75 },
201
- children: filterLabel(def)
202
- }), /* @__PURE__ */ jsxs(Stack, {
538
+ sx: t4,
539
+ children: t5
540
+ });
541
+ $[13] = t5;
542
+ $[14] = t6;
543
+ } else t6 = $[14];
544
+ let t7;
545
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
546
+ t7 = { flexWrap: "wrap" };
547
+ $[15] = t7;
548
+ } else t7 = $[15];
549
+ const t8 = labels.operator;
550
+ const t9 = op ?? "";
551
+ let t10;
552
+ if ($[16] !== changeOp) {
553
+ t10 = (e_0) => changeOp(e_0.target.value);
554
+ $[16] = changeOp;
555
+ $[17] = t10;
556
+ } else t10 = $[17];
557
+ let t11;
558
+ let t12;
559
+ let t13;
560
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
561
+ t11 = {
562
+ select: { native: true },
563
+ inputLabel: { shrink: true }
564
+ };
565
+ t12 = {
566
+ flex: "0 0 8.5rem",
567
+ width: "8.5rem"
568
+ };
569
+ t13 = /* @__PURE__ */ jsx("option", { value: "" });
570
+ $[18] = t11;
571
+ $[19] = t12;
572
+ $[20] = t13;
573
+ } else {
574
+ t11 = $[18];
575
+ t12 = $[19];
576
+ t13 = $[20];
577
+ }
578
+ let t14;
579
+ if ($[21] !== labels || $[22] !== opLabelKeys) {
580
+ t14 = RANGE_OPS.map((candidate_0) => /* @__PURE__ */ jsx("option", {
581
+ value: candidate_0,
582
+ children: labels[opLabelKeys[candidate_0]]
583
+ }, candidate_0));
584
+ $[21] = labels;
585
+ $[22] = opLabelKeys;
586
+ $[23] = t14;
587
+ } else t14 = $[23];
588
+ let t15;
589
+ if ($[24] !== labels.operator || $[25] !== t10 || $[26] !== t14 || $[27] !== t9) {
590
+ t15 = /* @__PURE__ */ jsxs(TextField, {
591
+ select: true,
592
+ size: "small",
593
+ label: t8,
594
+ value: t9,
595
+ onChange: t10,
596
+ slotProps: t11,
597
+ sx: t12,
598
+ children: [t13, t14]
599
+ });
600
+ $[24] = labels.operator;
601
+ $[25] = t10;
602
+ $[26] = t14;
603
+ $[27] = t9;
604
+ $[28] = t15;
605
+ } else t15 = $[28];
606
+ let t16;
607
+ if ($[29] !== bounds || $[30] !== t15) {
608
+ t16 = /* @__PURE__ */ jsxs(Stack, {
203
609
  direction: "row",
204
610
  spacing: 1,
205
611
  useFlexGap: true,
206
- sx: { flexWrap: "wrap" },
207
- children: [/* @__PURE__ */ jsxs(TextField, {
208
- select: true,
209
- size: "small",
210
- label: labels.operator,
211
- value: op ?? "",
212
- onChange: (e) => changeOp(e.target.value),
213
- slotProps: {
214
- select: { native: true },
215
- inputLabel: { shrink: true }
216
- },
217
- sx: {
218
- flex: "0 0 8.5rem",
219
- width: "8.5rem"
220
- },
221
- children: [/* @__PURE__ */ jsx("option", { value: "" }), RANGE_OPS.map((candidate) => /* @__PURE__ */ jsx("option", {
222
- value: candidate,
223
- children: labels[opLabelKeys[candidate]]
224
- }, candidate))]
225
- }), bounds]
226
- })]
227
- });
228
- }
229
- function FilterField({ def, source, labels }) {
230
- switch (def.type) {
231
- case "text": return /* @__PURE__ */ jsx(TextFilter, {
232
- def,
233
- source
612
+ sx: t7,
613
+ children: [t15, bounds]
234
614
  });
235
- case "select": return /* @__PURE__ */ jsx(SelectFilter, {
236
- def,
237
- source
238
- });
239
- case "multiSelect": return /* @__PURE__ */ jsx(MultiSelectFilter, {
240
- def,
241
- source
615
+ $[29] = bounds;
616
+ $[30] = t15;
617
+ $[31] = t16;
618
+ } else t16 = $[31];
619
+ let t17;
620
+ if ($[32] !== t16 || $[33] !== t6) {
621
+ t17 = /* @__PURE__ */ jsxs(FormControl, {
622
+ component: "fieldset",
623
+ variant: "standard",
624
+ sx: t3,
625
+ children: [t6, t16]
242
626
  });
627
+ $[32] = t16;
628
+ $[33] = t6;
629
+ $[34] = t17;
630
+ } else t17 = $[34];
631
+ return t17;
632
+ }
633
+ function FilterField(t0) {
634
+ const $ = c(13);
635
+ const { def, source, labels } = t0;
636
+ switch (def.type) {
637
+ case "text": {
638
+ let t1;
639
+ if ($[0] !== def || $[1] !== source) {
640
+ t1 = /* @__PURE__ */ jsx(TextFilter, {
641
+ def,
642
+ source
643
+ });
644
+ $[0] = def;
645
+ $[1] = source;
646
+ $[2] = t1;
647
+ } else t1 = $[2];
648
+ return t1;
649
+ }
650
+ case "select": {
651
+ let t1;
652
+ if ($[3] !== def || $[4] !== source) {
653
+ t1 = /* @__PURE__ */ jsx(SelectFilter, {
654
+ def,
655
+ source
656
+ });
657
+ $[3] = def;
658
+ $[4] = source;
659
+ $[5] = t1;
660
+ } else t1 = $[5];
661
+ return t1;
662
+ }
663
+ case "multiSelect": {
664
+ let t1;
665
+ if ($[6] !== def || $[7] !== source) {
666
+ t1 = /* @__PURE__ */ jsx(MultiSelectFilter, {
667
+ def,
668
+ source
669
+ });
670
+ $[6] = def;
671
+ $[7] = source;
672
+ $[8] = t1;
673
+ } else t1 = $[8];
674
+ return t1;
675
+ }
243
676
  case "dateRange":
244
- case "numberRange": return /* @__PURE__ */ jsx(RangeFilter, {
245
- def,
246
- type: def.type,
247
- source,
248
- labels
249
- });
677
+ case "numberRange": {
678
+ let t1;
679
+ if ($[9] !== def || $[10] !== labels || $[11] !== source) {
680
+ t1 = /* @__PURE__ */ jsx(RangeFilter, {
681
+ def,
682
+ type: def.type,
683
+ source,
684
+ labels
685
+ });
686
+ $[9] = def;
687
+ $[10] = labels;
688
+ $[11] = source;
689
+ $[12] = t1;
690
+ } else t1 = $[12];
691
+ return t1;
692
+ }
250
693
  }
251
694
  }
252
695
  /**
@@ -257,18 +700,42 @@ function FilterField({ def, source, labels }) {
257
700
  *
258
701
  * @typeParam TRow - The row type.
259
702
  */
260
- function AutoFilterForm({ defs, source, labels }) {
261
- return /* @__PURE__ */ jsx(Stack, {
262
- spacing: 1.5,
263
- children: defs.map((def) => /* @__PURE__ */ jsx(FilterField, {
264
- def,
265
- source,
266
- labels
267
- }, def.key))
268
- });
703
+ function AutoFilterForm(t0) {
704
+ const $ = c(9);
705
+ const { defs, source, labels } = t0;
706
+ let t1;
707
+ if ($[0] !== defs || $[1] !== labels || $[2] !== source) {
708
+ let t2;
709
+ if ($[4] !== labels || $[5] !== source) {
710
+ t2 = (def) => /* @__PURE__ */ jsx(FilterField, {
711
+ def,
712
+ source,
713
+ labels
714
+ }, def.key);
715
+ $[4] = labels;
716
+ $[5] = source;
717
+ $[6] = t2;
718
+ } else t2 = $[6];
719
+ t1 = defs.map(t2);
720
+ $[0] = defs;
721
+ $[1] = labels;
722
+ $[2] = source;
723
+ $[3] = t1;
724
+ } else t1 = $[3];
725
+ let t2;
726
+ if ($[7] !== t1) {
727
+ t2 = /* @__PURE__ */ jsx(Stack, {
728
+ spacing: 1.5,
729
+ children: t1
730
+ });
731
+ $[7] = t1;
732
+ $[8] = t2;
733
+ } else t2 = $[8];
734
+ return t2;
269
735
  }
270
736
  //#endregion
271
737
  //#region src/components/FilterPopover.tsx
738
+ /** Props for {@link FilterPopover}. */
272
739
  /**
273
740
  * Anchored filter card (the default filter container). Opens under the Filters
274
741
  * button. Built on a non-modal `Popper` (+ `ClickAwayListener`) rather than the
@@ -277,105 +744,222 @@ function AutoFilterForm({ defs, source, labels }) {
277
744
  * `bottom-end` (flips to `bottom-start` for RTL). Pair with
278
745
  * `filtersMode="drawer"` for the slide-in panel instead.
279
746
  */
280
- function FilterPopover({ open, onClose, anchorEl, filters, activeFilterCount, onClearFilters, labels, dir = "ltr" }) {
281
- useEffect(() => {
282
- if (!open) return;
283
- const onKeyDown = (event) => {
284
- if (event.key === "Escape") onClose();
747
+ function FilterPopover(t0) {
748
+ const $ = c(33);
749
+ const { open, onClose, anchorEl, filters, activeFilterCount, onClearFilters, labels, dir: t1 } = t0;
750
+ const dir = t1 === void 0 ? "ltr" : t1;
751
+ let t2;
752
+ let t3;
753
+ if ($[0] !== onClose || $[1] !== open) {
754
+ t2 = () => {
755
+ if (!open) return;
756
+ const onKeyDown = (event) => {
757
+ if (event.key === "Escape") onClose();
758
+ };
759
+ document.addEventListener("keydown", onKeyDown);
760
+ return () => document.removeEventListener("keydown", onKeyDown);
285
761
  };
286
- document.addEventListener("keydown", onKeyDown);
287
- return () => document.removeEventListener("keydown", onKeyDown);
288
- }, [open, onClose]);
289
- return /* @__PURE__ */ jsx(Popper, {
290
- open: open && anchorEl !== null,
291
- anchorEl,
292
- placement: dir === "rtl" ? "bottom-start" : "bottom-end",
293
- modifiers: [{
762
+ t3 = [open, onClose];
763
+ $[0] = onClose;
764
+ $[1] = open;
765
+ $[2] = t2;
766
+ $[3] = t3;
767
+ } else {
768
+ t2 = $[2];
769
+ t3 = $[3];
770
+ }
771
+ useEffect(t2, t3);
772
+ const t4 = open && anchorEl !== null;
773
+ const t5 = dir === "rtl" ? "bottom-start" : "bottom-end";
774
+ let t6;
775
+ let t7;
776
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
777
+ t6 = [{
294
778
  name: "offset",
295
779
  options: { offset: [0, 4] }
296
- }],
297
- style: { zIndex: 1300 },
298
- children: /* @__PURE__ */ jsx(ClickAwayListener, {
780
+ }];
781
+ t7 = { zIndex: 1300 };
782
+ $[4] = t6;
783
+ $[5] = t7;
784
+ } else {
785
+ t6 = $[4];
786
+ t7 = $[5];
787
+ }
788
+ let t8;
789
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
790
+ t8 = {
791
+ width: 360,
792
+ maxWidth: "calc(100vw - 32px)",
793
+ borderRadius: 2
794
+ };
795
+ $[6] = t8;
796
+ } else t8 = $[6];
797
+ let t9;
798
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
799
+ t9 = {
800
+ p: 2,
801
+ display: "flex",
802
+ flexDirection: "column",
803
+ gap: 2
804
+ };
805
+ $[7] = t9;
806
+ } else t9 = $[7];
807
+ let t10;
808
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
809
+ t10 = {
810
+ justifyContent: "space-between",
811
+ alignItems: "center"
812
+ };
813
+ $[8] = t10;
814
+ } else t10 = $[8];
815
+ let t11;
816
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
817
+ t11 = { fontWeight: 600 };
818
+ $[9] = t11;
819
+ } else t11 = $[9];
820
+ let t12;
821
+ if ($[10] !== labels.filters) {
822
+ t12 = /* @__PURE__ */ jsx(Typography, {
823
+ variant: "subtitle1",
824
+ sx: t11,
825
+ children: labels.filters
826
+ });
827
+ $[10] = labels.filters;
828
+ $[11] = t12;
829
+ } else t12 = $[11];
830
+ const t13 = activeFilterCount === 0;
831
+ let t14;
832
+ if ($[12] !== labels.clearAll || $[13] !== onClearFilters || $[14] !== t13) {
833
+ t14 = /* @__PURE__ */ jsx(Button, {
834
+ size: "small",
835
+ onClick: onClearFilters,
836
+ disabled: t13,
837
+ children: labels.clearAll
838
+ });
839
+ $[12] = labels.clearAll;
840
+ $[13] = onClearFilters;
841
+ $[14] = t13;
842
+ $[15] = t14;
843
+ } else t14 = $[15];
844
+ let t15;
845
+ if ($[16] !== t12 || $[17] !== t14) {
846
+ t15 = /* @__PURE__ */ jsxs(Stack, {
847
+ direction: "row",
848
+ sx: t10,
849
+ children: [t12, t14]
850
+ });
851
+ $[16] = t12;
852
+ $[17] = t14;
853
+ $[18] = t15;
854
+ } else t15 = $[18];
855
+ let t16;
856
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
857
+ t16 = {
858
+ display: "flex",
859
+ flexDirection: "column",
860
+ gap: 2
861
+ };
862
+ $[19] = t16;
863
+ } else t16 = $[19];
864
+ let t17;
865
+ if ($[20] !== filters) {
866
+ t17 = /* @__PURE__ */ jsx(Box, {
867
+ sx: t16,
868
+ children: filters
869
+ });
870
+ $[20] = filters;
871
+ $[21] = t17;
872
+ } else t17 = $[21];
873
+ let t18;
874
+ if ($[22] !== t15 || $[23] !== t17) {
875
+ t18 = /* @__PURE__ */ jsx(Paper, {
876
+ elevation: 8,
877
+ sx: t8,
878
+ children: /* @__PURE__ */ jsxs(Box, {
879
+ sx: t9,
880
+ children: [t15, t17]
881
+ })
882
+ });
883
+ $[22] = t15;
884
+ $[23] = t17;
885
+ $[24] = t18;
886
+ } else t18 = $[24];
887
+ let t19;
888
+ if ($[25] !== onClose || $[26] !== t18) {
889
+ t19 = /* @__PURE__ */ jsx(ClickAwayListener, {
299
890
  mouseEvent: "onMouseDown",
300
891
  onClickAway: onClose,
301
- children: /* @__PURE__ */ jsx(Paper, {
302
- elevation: 8,
303
- sx: {
304
- width: 360,
305
- maxWidth: "calc(100vw - 32px)",
306
- borderRadius: 2
307
- },
308
- children: /* @__PURE__ */ jsxs(Box, {
309
- sx: {
310
- p: 2,
311
- display: "flex",
312
- flexDirection: "column",
313
- gap: 2
314
- },
315
- children: [/* @__PURE__ */ jsxs(Stack, {
316
- direction: "row",
317
- sx: {
318
- justifyContent: "space-between",
319
- alignItems: "center"
320
- },
321
- children: [/* @__PURE__ */ jsx(Typography, {
322
- variant: "subtitle1",
323
- sx: { fontWeight: 600 },
324
- children: labels.filters
325
- }), /* @__PURE__ */ jsx(Button, {
326
- size: "small",
327
- onClick: onClearFilters,
328
- disabled: activeFilterCount === 0,
329
- children: labels.clearAll
330
- })]
331
- }), /* @__PURE__ */ jsx(Box, {
332
- sx: {
333
- display: "flex",
334
- flexDirection: "column",
335
- gap: 2
336
- },
337
- children: filters
338
- })]
339
- })
340
- })
341
- })
342
- });
892
+ children: t18
893
+ });
894
+ $[25] = onClose;
895
+ $[26] = t18;
896
+ $[27] = t19;
897
+ } else t19 = $[27];
898
+ let t20;
899
+ if ($[28] !== anchorEl || $[29] !== t19 || $[30] !== t4 || $[31] !== t5) {
900
+ t20 = /* @__PURE__ */ jsx(Popper, {
901
+ open: t4,
902
+ anchorEl,
903
+ placement: t5,
904
+ modifiers: t6,
905
+ style: t7,
906
+ children: t19
907
+ });
908
+ $[28] = anchorEl;
909
+ $[29] = t19;
910
+ $[30] = t4;
911
+ $[31] = t5;
912
+ $[32] = t20;
913
+ } else t20 = $[32];
914
+ return t20;
343
915
  }
344
916
  //#endregion
345
917
  //#region src/components/chrome.tsx
346
918
  /** Funnel/filter glyph (currentColor, no icon-lib dependency). */
347
919
  function FiltersIcon() {
348
- return /* @__PURE__ */ jsx("svg", {
349
- width: "16",
350
- height: "16",
351
- viewBox: "0 0 24 24",
352
- fill: "none",
353
- stroke: "currentColor",
354
- strokeWidth: "1.8",
355
- strokeLinecap: "round",
356
- strokeLinejoin: "round",
357
- "aria-hidden": "true",
358
- children: /* @__PURE__ */ jsx("path", { d: "M3 5h18l-7 8v5l-4 2v-7L3 5Z" })
359
- });
920
+ const $ = c(1);
921
+ let t0;
922
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
923
+ t0 = /* @__PURE__ */ jsx("svg", {
924
+ width: "16",
925
+ height: "16",
926
+ viewBox: "0 0 24 24",
927
+ fill: "none",
928
+ stroke: "currentColor",
929
+ strokeWidth: "1.8",
930
+ strokeLinecap: "round",
931
+ strokeLinejoin: "round",
932
+ "aria-hidden": "true",
933
+ children: /* @__PURE__ */ jsx("path", { d: "M3 5h18l-7 8v5l-4 2v-7L3 5Z" })
934
+ });
935
+ $[0] = t0;
936
+ } else t0 = $[0];
937
+ return t0;
360
938
  }
361
939
  /** Magnifying-glass glyph for the search field (currentColor, no icon-lib). */
362
940
  function SearchIcon() {
363
- return /* @__PURE__ */ jsxs("svg", {
364
- width: "18",
365
- height: "18",
366
- viewBox: "0 0 24 24",
367
- fill: "none",
368
- stroke: "currentColor",
369
- strokeWidth: "1.8",
370
- strokeLinecap: "round",
371
- strokeLinejoin: "round",
372
- "aria-hidden": "true",
373
- children: [/* @__PURE__ */ jsx("circle", {
374
- cx: "11",
375
- cy: "11",
376
- r: "7"
377
- }), /* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" })]
378
- });
941
+ const $ = c(1);
942
+ let t0;
943
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
944
+ t0 = /* @__PURE__ */ jsxs("svg", {
945
+ width: "18",
946
+ height: "18",
947
+ viewBox: "0 0 24 24",
948
+ fill: "none",
949
+ stroke: "currentColor",
950
+ strokeWidth: "1.8",
951
+ strokeLinecap: "round",
952
+ strokeLinejoin: "round",
953
+ "aria-hidden": "true",
954
+ children: [/* @__PURE__ */ jsx("circle", {
955
+ cx: "11",
956
+ cy: "11",
957
+ r: "7"
958
+ }), /* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" })]
959
+ });
960
+ $[0] = t0;
961
+ } else t0 = $[0];
962
+ return t0;
379
963
  }
380
964
  /** Inline equivalent of `@mui/utils` visuallyHidden (avoids an extra dep). */
381
965
  const srOnly = {
@@ -389,6 +973,11 @@ const srOnly = {
389
973
  whiteSpace: "nowrap",
390
974
  border: 0
391
975
  };
976
+ /**
977
+ * Toolbar props: the shared {@link ToolbarChromeProps} plus the filter-container
978
+ * wiring (mode + open/close handlers) so the Filters button can act as either
979
+ * the popover anchor (default) or the drawer trigger.
980
+ */
392
981
  /** Search field + sort select + filters button + rows-per-page. */
393
982
  function Toolbar({ table, hideSearch, searchPlaceholder, sortByOptions, customToolbar, hasFilters, activeFilterCount, showRowsPerPage, filtersMode, filters, filtersOpen, onToggleFilters, onFiltersTriggerPointerDown, onCloseFilters, onClearFilters, dir, columnMenu }) {
394
983
  const { labels, source } = table;
@@ -480,7 +1069,7 @@ function Toolbar({ table, hideSearch, searchPlaceholder, sortByOptions, customTo
480
1069
  size: "small",
481
1070
  label: labels.rowsPerPage,
482
1071
  value: source.limit,
483
- onChange: (e) => source.setLimit(Number(e.target.value)),
1072
+ onChange: (e_0) => source.setLimit(Number(e_0.target.value)),
484
1073
  sx: { minWidth: 110 },
485
1074
  children: pageSizeOptions(source.limit).map((n) => /* @__PURE__ */ jsx(MenuItem, {
486
1075
  value: n,
@@ -492,67 +1081,145 @@ function Toolbar({ table, hideSearch, searchPlaceholder, sortByOptions, customTo
492
1081
  });
493
1082
  }
494
1083
  /** Removable MUI chips. */
495
- function Chips({ chips, onClearAll, labels }) {
1084
+ function Chips(t0) {
1085
+ const $ = c(13);
1086
+ const { chips, onClearAll, labels } = t0;
496
1087
  if (chips.length === 0) return null;
497
- return /* @__PURE__ */ jsxs(Stack, {
498
- direction: "row",
499
- spacing: .5,
500
- useFlexGap: true,
501
- component: "ul",
502
- "aria-label": labels.filters,
503
- sx: {
1088
+ const t1 = labels.filters;
1089
+ let t2;
1090
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1091
+ t2 = {
504
1092
  listStyle: "none",
505
1093
  p: 0,
506
1094
  m: 0,
507
1095
  flexWrap: "wrap"
508
- },
509
- children: [chips.map((chip) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Chip, {
510
- label: chip.label,
511
- size: "small",
512
- onDelete: chip.onRemove,
513
- deleteIcon: /* @__PURE__ */ jsx("span", {
514
- "aria-label": `${labels.clearAll}: ${chip.label}`,
515
- children: "×"
516
- })
517
- }) }, chip.key)), /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Button, {
1096
+ };
1097
+ $[0] = t2;
1098
+ } else t2 = $[0];
1099
+ let t3;
1100
+ if ($[1] !== chips || $[2] !== labels.clearAll) {
1101
+ let t4;
1102
+ if ($[4] !== labels.clearAll) {
1103
+ t4 = (chip) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Chip, {
1104
+ label: chip.label,
1105
+ size: "small",
1106
+ onDelete: chip.onRemove,
1107
+ deleteIcon: /* @__PURE__ */ jsx("span", {
1108
+ "aria-label": `${labels.clearAll}: ${chip.label}`,
1109
+ children: "×"
1110
+ })
1111
+ }) }, chip.key);
1112
+ $[4] = labels.clearAll;
1113
+ $[5] = t4;
1114
+ } else t4 = $[5];
1115
+ t3 = chips.map(t4);
1116
+ $[1] = chips;
1117
+ $[2] = labels.clearAll;
1118
+ $[3] = t3;
1119
+ } else t3 = $[3];
1120
+ let t4;
1121
+ if ($[6] !== labels.clearAll || $[7] !== onClearAll) {
1122
+ t4 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(Button, {
518
1123
  size: "small",
519
1124
  onClick: onClearAll,
520
1125
  children: labels.clearAll
521
- }) })]
522
- });
1126
+ }) });
1127
+ $[6] = labels.clearAll;
1128
+ $[7] = onClearAll;
1129
+ $[8] = t4;
1130
+ } else t4 = $[8];
1131
+ let t5;
1132
+ if ($[9] !== labels.filters || $[10] !== t3 || $[11] !== t4) {
1133
+ t5 = /* @__PURE__ */ jsxs(Stack, {
1134
+ direction: "row",
1135
+ spacing: .5,
1136
+ useFlexGap: true,
1137
+ component: "ul",
1138
+ "aria-label": t1,
1139
+ sx: t2,
1140
+ children: [t3, t4]
1141
+ });
1142
+ $[9] = labels.filters;
1143
+ $[10] = t3;
1144
+ $[11] = t4;
1145
+ $[12] = t5;
1146
+ } else t5 = $[12];
1147
+ return t5;
523
1148
  }
524
1149
  /** Selection toolbar. */
525
- function BulkBar({ selection, total, bulkActions, confirm, labels }) {
1150
+ function BulkBar(t0) {
1151
+ const $ = c(69);
1152
+ const { selection, total, bulkActions, confirm, labels } = t0;
526
1153
  const { selectedIds, selectedCount, headerState, visibleIds, allMatching, selectAllMatching, clear } = selection;
527
- const { pending, run } = useBulkActionRunner({
528
- confirm,
529
- cancelLabel: labels.cancel,
530
- onComplete: clear
531
- });
1154
+ let t1;
1155
+ if ($[0] !== clear || $[1] !== confirm || $[2] !== labels.cancel) {
1156
+ t1 = {
1157
+ confirm,
1158
+ cancelLabel: labels.cancel,
1159
+ onComplete: clear
1160
+ };
1161
+ $[0] = clear;
1162
+ $[1] = confirm;
1163
+ $[2] = labels.cancel;
1164
+ $[3] = t1;
1165
+ } else t1 = $[3];
1166
+ const { pending, run } = useBulkActionRunner(t1);
532
1167
  if (selectedCount === 0) return null;
533
- const ids = [...selectedIds];
534
- const showBanner = headerState === "all" && total > visibleIds.length;
535
- return /* @__PURE__ */ jsxs(Stack, {
536
- direction: "row",
537
- spacing: 1,
538
- useFlexGap: true,
539
- sx: {
540
- alignItems: "center",
541
- justifyContent: "space-between",
542
- flexWrap: "wrap"
543
- },
544
- children: [/* @__PURE__ */ jsxs(Stack, {
545
- direction: "row",
546
- spacing: 1,
547
- useFlexGap: true,
548
- sx: {
1168
+ let T0;
1169
+ let T1;
1170
+ let t10;
1171
+ let t11;
1172
+ let t12;
1173
+ let t2;
1174
+ let t3;
1175
+ let t4;
1176
+ let t5;
1177
+ let t6;
1178
+ let t7;
1179
+ let t8;
1180
+ let t9;
1181
+ if ($[4] !== allMatching || $[5] !== bulkActions || $[6] !== clear || $[7] !== headerState || $[8] !== labels || $[9] !== pending || $[10] !== run || $[11] !== selectAllMatching || $[12] !== selectedCount || $[13] !== selectedIds || $[14] !== total || $[15] !== visibleIds) {
1182
+ const ids = [...selectedIds];
1183
+ const showBanner = headerState === "all" && total > visibleIds.length;
1184
+ T1 = Stack;
1185
+ t8 = "row";
1186
+ t9 = 1;
1187
+ t10 = true;
1188
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
1189
+ t11 = {
549
1190
  alignItems: "center",
1191
+ justifyContent: "space-between",
550
1192
  flexWrap: "wrap"
551
- },
552
- children: [/* @__PURE__ */ jsx(Typography, {
1193
+ };
1194
+ $[29] = t11;
1195
+ } else t11 = $[29];
1196
+ let t13;
1197
+ if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
1198
+ t13 = {
1199
+ alignItems: "center",
1200
+ flexWrap: "wrap"
1201
+ };
1202
+ $[30] = t13;
1203
+ } else t13 = $[30];
1204
+ let t14;
1205
+ if ($[31] !== labels || $[32] !== selectedCount) {
1206
+ t14 = labels.selectedCount(selectedCount);
1207
+ $[31] = labels;
1208
+ $[32] = selectedCount;
1209
+ $[33] = t14;
1210
+ } else t14 = $[33];
1211
+ let t15;
1212
+ if ($[34] !== t14) {
1213
+ t15 = /* @__PURE__ */ jsx(Typography, {
553
1214
  variant: "body2",
554
- children: labels.selectedCount(selectedCount)
555
- }), showBanner && (allMatching ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Typography, {
1215
+ children: t14
1216
+ });
1217
+ $[34] = t14;
1218
+ $[35] = t15;
1219
+ } else t15 = $[35];
1220
+ let t16;
1221
+ if ($[36] !== allMatching || $[37] !== clear || $[38] !== labels || $[39] !== pending || $[40] !== selectAllMatching || $[41] !== showBanner || $[42] !== total || $[43] !== visibleIds) {
1222
+ t16 = showBanner && (allMatching ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Typography, {
556
1223
  variant: "body2",
557
1224
  color: "text.secondary",
558
1225
  children: labels.allMatchingSelected(total)
@@ -572,206 +1239,582 @@ function BulkBar({ selection, total, bulkActions, confirm, labels }) {
572
1239
  onClick: selectAllMatching,
573
1240
  disabled: pending !== null,
574
1241
  children: labels.selectAllMatching(total)
575
- })] }))]
576
- }), /* @__PURE__ */ jsxs(Stack, {
577
- direction: "row",
578
- spacing: 1,
579
- useFlexGap: true,
580
- sx: { flexWrap: "wrap" },
581
- children: [/* @__PURE__ */ jsx(Button, {
1242
+ })] }));
1243
+ $[36] = allMatching;
1244
+ $[37] = clear;
1245
+ $[38] = labels;
1246
+ $[39] = pending;
1247
+ $[40] = selectAllMatching;
1248
+ $[41] = showBanner;
1249
+ $[42] = total;
1250
+ $[43] = visibleIds;
1251
+ $[44] = t16;
1252
+ } else t16 = $[44];
1253
+ if ($[45] !== t15 || $[46] !== t16) {
1254
+ t12 = /* @__PURE__ */ jsxs(Stack, {
1255
+ direction: "row",
1256
+ spacing: 1,
1257
+ useFlexGap: true,
1258
+ sx: t13,
1259
+ children: [t15, t16]
1260
+ });
1261
+ $[45] = t15;
1262
+ $[46] = t16;
1263
+ $[47] = t12;
1264
+ } else t12 = $[47];
1265
+ T0 = Stack;
1266
+ t2 = "row";
1267
+ t3 = 1;
1268
+ t4 = true;
1269
+ if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
1270
+ t5 = { flexWrap: "wrap" };
1271
+ $[48] = t5;
1272
+ } else t5 = $[48];
1273
+ const t17 = pending !== null;
1274
+ if ($[49] !== clear || $[50] !== labels.clearAll || $[51] !== t17) {
1275
+ t6 = /* @__PURE__ */ jsx(Button, {
582
1276
  size: "small",
583
1277
  variant: "text",
584
1278
  onClick: clear,
585
- disabled: pending !== null,
1279
+ disabled: t17,
586
1280
  children: labels.clearAll
587
- }), bulkActions.map((action) => {
588
- const reason = resolveDisabledReason(action.disabledReason?.(ids));
589
- return /* @__PURE__ */ jsx(Tooltip, {
590
- title: reason ?? "",
591
- children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Button, {
592
- size: "small",
593
- variant: "contained",
594
- color: action.color,
595
- startIcon: action.icon,
596
- disabled: reason !== void 0 || pending !== null,
597
- onClick: () => run(action, ids, allMatching ? {
598
- allMatching: true,
599
- total
600
- } : void 0),
601
- children: action.label
602
- }) })
603
- }, action.key);
604
- })]
605
- })]
606
- });
1281
+ });
1282
+ $[49] = clear;
1283
+ $[50] = labels.clearAll;
1284
+ $[51] = t17;
1285
+ $[52] = t6;
1286
+ } else t6 = $[52];
1287
+ t7 = bulkActions.map((action) => {
1288
+ const reason = resolveDisabledReason(action.disabledReason?.(ids));
1289
+ return /* @__PURE__ */ jsx(Tooltip, {
1290
+ title: reason ?? "",
1291
+ children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(Button, {
1292
+ size: "small",
1293
+ variant: "contained",
1294
+ color: action.color,
1295
+ startIcon: action.icon,
1296
+ disabled: reason !== void 0 || pending !== null,
1297
+ onClick: () => run(action, ids, allMatching ? {
1298
+ allMatching: true,
1299
+ total
1300
+ } : void 0),
1301
+ children: action.label
1302
+ }) })
1303
+ }, action.key);
1304
+ });
1305
+ $[4] = allMatching;
1306
+ $[5] = bulkActions;
1307
+ $[6] = clear;
1308
+ $[7] = headerState;
1309
+ $[8] = labels;
1310
+ $[9] = pending;
1311
+ $[10] = run;
1312
+ $[11] = selectAllMatching;
1313
+ $[12] = selectedCount;
1314
+ $[13] = selectedIds;
1315
+ $[14] = total;
1316
+ $[15] = visibleIds;
1317
+ $[16] = T0;
1318
+ $[17] = T1;
1319
+ $[18] = t10;
1320
+ $[19] = t11;
1321
+ $[20] = t12;
1322
+ $[21] = t2;
1323
+ $[22] = t3;
1324
+ $[23] = t4;
1325
+ $[24] = t5;
1326
+ $[25] = t6;
1327
+ $[26] = t7;
1328
+ $[27] = t8;
1329
+ $[28] = t9;
1330
+ } else {
1331
+ T0 = $[16];
1332
+ T1 = $[17];
1333
+ t10 = $[18];
1334
+ t11 = $[19];
1335
+ t12 = $[20];
1336
+ t2 = $[21];
1337
+ t3 = $[22];
1338
+ t4 = $[23];
1339
+ t5 = $[24];
1340
+ t6 = $[25];
1341
+ t7 = $[26];
1342
+ t8 = $[27];
1343
+ t9 = $[28];
1344
+ }
1345
+ let t13;
1346
+ if ($[53] !== T0 || $[54] !== t2 || $[55] !== t3 || $[56] !== t4 || $[57] !== t5 || $[58] !== t6 || $[59] !== t7) {
1347
+ t13 = /* @__PURE__ */ jsxs(T0, {
1348
+ direction: t2,
1349
+ spacing: t3,
1350
+ useFlexGap: t4,
1351
+ sx: t5,
1352
+ children: [t6, t7]
1353
+ });
1354
+ $[53] = T0;
1355
+ $[54] = t2;
1356
+ $[55] = t3;
1357
+ $[56] = t4;
1358
+ $[57] = t5;
1359
+ $[58] = t6;
1360
+ $[59] = t7;
1361
+ $[60] = t13;
1362
+ } else t13 = $[60];
1363
+ let t14;
1364
+ if ($[61] !== T1 || $[62] !== t10 || $[63] !== t11 || $[64] !== t12 || $[65] !== t13 || $[66] !== t8 || $[67] !== t9) {
1365
+ t14 = /* @__PURE__ */ jsxs(T1, {
1366
+ direction: t8,
1367
+ spacing: t9,
1368
+ useFlexGap: t10,
1369
+ sx: t11,
1370
+ children: [t12, t13]
1371
+ });
1372
+ $[61] = T1;
1373
+ $[62] = t10;
1374
+ $[63] = t11;
1375
+ $[64] = t12;
1376
+ $[65] = t13;
1377
+ $[66] = t8;
1378
+ $[67] = t9;
1379
+ $[68] = t14;
1380
+ } else t14 = $[68];
1381
+ return t14;
607
1382
  }
608
1383
  /** Paged footer: rows-per-page + range on the left, pager on the right. */
609
- function Footer({ pagination, total, limit, setPage, setLimit, labels }) {
610
- return /* @__PURE__ */ jsxs(Stack, {
611
- direction: "row",
612
- spacing: 2,
613
- useFlexGap: true,
614
- sx: {
1384
+ function Footer(t0) {
1385
+ const $ = c(32);
1386
+ const { pagination, total, limit, setPage, setLimit, labels } = t0;
1387
+ let t1;
1388
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1389
+ t1 = {
615
1390
  alignItems: "center",
616
1391
  justifyContent: "space-between",
617
1392
  flexWrap: "wrap"
618
- },
619
- children: [/* @__PURE__ */ jsxs(Stack, {
1393
+ };
1394
+ $[0] = t1;
1395
+ } else t1 = $[0];
1396
+ let t2;
1397
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1398
+ t2 = { alignItems: "center" };
1399
+ $[1] = t2;
1400
+ } else t2 = $[1];
1401
+ const t3 = labels.rowsPerPage;
1402
+ const t4 = String(limit);
1403
+ let t5;
1404
+ if ($[2] !== setLimit) {
1405
+ t5 = (e) => setLimit(Number(e.target.value));
1406
+ $[2] = setLimit;
1407
+ $[3] = t5;
1408
+ } else t5 = $[3];
1409
+ let t6;
1410
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1411
+ t6 = { minWidth: 100 };
1412
+ $[4] = t6;
1413
+ } else t6 = $[4];
1414
+ let t7;
1415
+ if ($[5] !== limit) {
1416
+ t7 = pageSizeOptions(limit).map(_temp);
1417
+ $[5] = limit;
1418
+ $[6] = t7;
1419
+ } else t7 = $[6];
1420
+ let t8;
1421
+ if ($[7] !== labels.rowsPerPage || $[8] !== t4 || $[9] !== t5 || $[10] !== t7) {
1422
+ t8 = /* @__PURE__ */ jsx(TextField, {
1423
+ select: true,
1424
+ size: "small",
1425
+ label: t3,
1426
+ value: t4,
1427
+ onChange: t5,
1428
+ sx: t6,
1429
+ children: t7
1430
+ });
1431
+ $[7] = labels.rowsPerPage;
1432
+ $[8] = t4;
1433
+ $[9] = t5;
1434
+ $[10] = t7;
1435
+ $[11] = t8;
1436
+ } else t8 = $[11];
1437
+ let t9;
1438
+ if ($[12] !== labels || $[13] !== pagination.fromIndex || $[14] !== pagination.toIndex || $[15] !== total) {
1439
+ t9 = total > 0 && /* @__PURE__ */ jsx(Typography, {
1440
+ variant: "caption",
1441
+ color: "text.secondary",
1442
+ children: labels.showing({
1443
+ from: pagination.fromIndex,
1444
+ to: pagination.toIndex,
1445
+ total
1446
+ })
1447
+ });
1448
+ $[12] = labels;
1449
+ $[13] = pagination.fromIndex;
1450
+ $[14] = pagination.toIndex;
1451
+ $[15] = total;
1452
+ $[16] = t9;
1453
+ } else t9 = $[16];
1454
+ let t10;
1455
+ if ($[17] !== t8 || $[18] !== t9) {
1456
+ t10 = /* @__PURE__ */ jsxs(Stack, {
620
1457
  direction: "row",
621
1458
  spacing: 1.5,
622
1459
  useFlexGap: true,
623
- sx: { alignItems: "center" },
624
- children: [/* @__PURE__ */ jsx(TextField, {
625
- select: true,
626
- size: "small",
627
- label: labels.rowsPerPage,
628
- value: String(limit),
629
- onChange: (e) => setLimit(Number(e.target.value)),
630
- sx: { minWidth: 100 },
631
- children: pageSizeOptions(limit).map((n) => /* @__PURE__ */ jsx(MenuItem, {
632
- value: String(n),
633
- children: n
634
- }, n))
635
- }), total > 0 && /* @__PURE__ */ jsx(Typography, {
636
- variant: "caption",
637
- color: "text.secondary",
638
- children: labels.showing({
639
- from: pagination.fromIndex,
640
- to: pagination.toIndex,
641
- total
642
- })
643
- })]
644
- }), /* @__PURE__ */ jsx(Pagination, {
1460
+ sx: t2,
1461
+ children: [t8, t9]
1462
+ });
1463
+ $[17] = t8;
1464
+ $[18] = t9;
1465
+ $[19] = t10;
1466
+ } else t10 = $[19];
1467
+ let t11;
1468
+ if ($[20] !== setPage) {
1469
+ t11 = (_, page) => setPage(page);
1470
+ $[20] = setPage;
1471
+ $[21] = t11;
1472
+ } else t11 = $[21];
1473
+ let t12;
1474
+ if ($[22] !== labels) {
1475
+ t12 = (type, page_0) => {
1476
+ if (type === "page") return labels.goToPage(page_0);
1477
+ return type === "previous" ? labels.previousPage : labels.nextPage;
1478
+ };
1479
+ $[22] = labels;
1480
+ $[23] = t12;
1481
+ } else t12 = $[23];
1482
+ let t13;
1483
+ if ($[24] !== pagination.safePage || $[25] !== pagination.totalPages || $[26] !== t11 || $[27] !== t12) {
1484
+ t13 = /* @__PURE__ */ jsx(Pagination, {
645
1485
  count: pagination.totalPages,
646
1486
  page: pagination.safePage,
647
- onChange: (_, page) => setPage(page),
1487
+ onChange: t11,
648
1488
  size: "small",
649
- getItemAriaLabel: (type, page) => {
650
- if (type === "page") return labels.goToPage(page);
651
- return type === "previous" ? labels.previousPage : labels.nextPage;
652
- }
653
- })]
654
- });
1489
+ getItemAriaLabel: t12
1490
+ });
1491
+ $[24] = pagination.safePage;
1492
+ $[25] = pagination.totalPages;
1493
+ $[26] = t11;
1494
+ $[27] = t12;
1495
+ $[28] = t13;
1496
+ } else t13 = $[28];
1497
+ let t14;
1498
+ if ($[29] !== t10 || $[30] !== t13) {
1499
+ t14 = /* @__PURE__ */ jsxs(Stack, {
1500
+ direction: "row",
1501
+ spacing: 2,
1502
+ useFlexGap: true,
1503
+ sx: t1,
1504
+ children: [t10, t13]
1505
+ });
1506
+ $[29] = t10;
1507
+ $[30] = t13;
1508
+ $[31] = t14;
1509
+ } else t14 = $[31];
1510
+ return t14;
655
1511
  }
656
1512
  /** Error alert. */
657
- function ErrorState({ error, labels, onRetry }) {
658
- return /* @__PURE__ */ jsxs(Alert, {
659
- severity: "error",
660
- action: onRetry ? /* @__PURE__ */ jsx(Button, {
1513
+ function _temp(n) {
1514
+ return /* @__PURE__ */ jsx(MenuItem, {
1515
+ value: String(n),
1516
+ children: n
1517
+ }, n);
1518
+ }
1519
+ function ErrorState(t0) {
1520
+ const $ = c(9);
1521
+ const { error, labels, onRetry } = t0;
1522
+ let t1;
1523
+ if ($[0] !== labels.retry || $[1] !== onRetry) {
1524
+ t1 = onRetry ? /* @__PURE__ */ jsx(Button, {
661
1525
  color: "inherit",
662
1526
  size: "small",
663
1527
  onClick: onRetry,
664
1528
  children: labels.retry
665
- }) : void 0,
666
- children: [
667
- /* @__PURE__ */ jsx("strong", { children: labels.errorTitle }),
668
- " ",
669
- error.message
670
- ]
671
- });
1529
+ }) : void 0;
1530
+ $[0] = labels.retry;
1531
+ $[1] = onRetry;
1532
+ $[2] = t1;
1533
+ } else t1 = $[2];
1534
+ let t2;
1535
+ if ($[3] !== labels.errorTitle) {
1536
+ t2 = /* @__PURE__ */ jsx("strong", { children: labels.errorTitle });
1537
+ $[3] = labels.errorTitle;
1538
+ $[4] = t2;
1539
+ } else t2 = $[4];
1540
+ let t3;
1541
+ if ($[5] !== error.message || $[6] !== t1 || $[7] !== t2) {
1542
+ t3 = /* @__PURE__ */ jsxs(Alert, {
1543
+ severity: "error",
1544
+ action: t1,
1545
+ children: [
1546
+ t2,
1547
+ " — ",
1548
+ error.message
1549
+ ]
1550
+ });
1551
+ $[5] = error.message;
1552
+ $[6] = t1;
1553
+ $[7] = t2;
1554
+ $[8] = t3;
1555
+ } else t3 = $[8];
1556
+ return t3;
672
1557
  }
673
1558
  /** Skeleton loading placeholder. */
674
- function LoadingState({ rows, columns, loadingLabel }) {
675
- return /* @__PURE__ */ jsxs(Box, {
676
- role: "status",
677
- "aria-busy": "true",
678
- "aria-live": "polite",
679
- "data-testid": "adapttable-loading",
680
- children: [Array.from({ length: rows }, (_, r) => /* @__PURE__ */ jsx(Stack, {
681
- direction: "row",
682
- spacing: 2,
683
- sx: { py: 1 },
684
- children: Array.from({ length: Math.max(columns, 1) }, (_, c) => /* @__PURE__ */ jsx(Skeleton, {
685
- variant: "text",
686
- width: c === 0 ? "30%" : "20%"
687
- }, c))
688
- }, r)), loadingLabel ? /* @__PURE__ */ jsx(Box, {
1559
+ function LoadingState(t0) {
1560
+ const $ = c(10);
1561
+ const { rows, columns, loadingLabel } = t0;
1562
+ let t1;
1563
+ if ($[0] !== columns || $[1] !== rows) {
1564
+ let t2;
1565
+ if ($[3] !== columns) {
1566
+ t2 = (_, r) => /* @__PURE__ */ jsx(Stack, {
1567
+ direction: "row",
1568
+ spacing: 2,
1569
+ sx: { py: 1 },
1570
+ children: Array.from({ length: Math.max(columns, 1) }, _temp2)
1571
+ }, r);
1572
+ $[3] = columns;
1573
+ $[4] = t2;
1574
+ } else t2 = $[4];
1575
+ t1 = Array.from({ length: rows }, t2);
1576
+ $[0] = columns;
1577
+ $[1] = rows;
1578
+ $[2] = t1;
1579
+ } else t1 = $[2];
1580
+ let t2;
1581
+ if ($[5] !== loadingLabel) {
1582
+ t2 = loadingLabel ? /* @__PURE__ */ jsx(Box, {
689
1583
  component: "span",
690
1584
  sx: srOnly,
691
1585
  children: loadingLabel
692
- }) : null]
693
- });
1586
+ }) : null;
1587
+ $[5] = loadingLabel;
1588
+ $[6] = t2;
1589
+ } else t2 = $[6];
1590
+ let t3;
1591
+ if ($[7] !== t1 || $[8] !== t2) {
1592
+ t3 = /* @__PURE__ */ jsxs(Box, {
1593
+ role: "status",
1594
+ "aria-busy": "true",
1595
+ "aria-live": "polite",
1596
+ "data-testid": "adapttable-loading",
1597
+ children: [t1, t2]
1598
+ });
1599
+ $[7] = t1;
1600
+ $[8] = t2;
1601
+ $[9] = t3;
1602
+ } else t3 = $[9];
1603
+ return t3;
694
1604
  }
695
1605
  /** Filters drawer. */
696
- function FilterDrawer({ open, onClose, filters, activeFilterCount, onClearFilters, labels, dir = "ltr" }) {
697
- return /* @__PURE__ */ jsx(Drawer, {
698
- anchor: dir === "rtl" ? "left" : "right",
699
- open,
700
- onClose,
701
- children: /* @__PURE__ */ jsxs(Box, {
702
- sx: {
703
- width: 360,
704
- p: 2,
705
- display: "flex",
706
- flexDirection: "column",
707
- gap: 2,
708
- height: "100%"
709
- },
1606
+ function _temp2(__0, c) {
1607
+ return /* @__PURE__ */ jsx(Skeleton, {
1608
+ variant: "text",
1609
+ width: c === 0 ? "30%" : "20%"
1610
+ }, c);
1611
+ }
1612
+ function FilterDrawer(t0) {
1613
+ const $ = c(26);
1614
+ const { open, onClose, filters, activeFilterCount, onClearFilters, labels, dir: t1 } = t0;
1615
+ const t2 = (t1 === void 0 ? "ltr" : t1) === "rtl" ? "left" : "right";
1616
+ let t3;
1617
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1618
+ t3 = {
1619
+ width: 360,
1620
+ p: 2,
1621
+ display: "flex",
1622
+ flexDirection: "column",
1623
+ gap: 2,
1624
+ height: "100%"
1625
+ };
1626
+ $[0] = t3;
1627
+ } else t3 = $[0];
1628
+ let t4;
1629
+ if ($[1] !== labels.filters) {
1630
+ t4 = /* @__PURE__ */ jsx(Typography, {
1631
+ variant: "h6",
1632
+ children: labels.filters
1633
+ });
1634
+ $[1] = labels.filters;
1635
+ $[2] = t4;
1636
+ } else t4 = $[2];
1637
+ let t5;
1638
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1639
+ t5 = {
1640
+ flex: 1,
1641
+ display: "flex",
1642
+ flexDirection: "column",
1643
+ gap: 2
1644
+ };
1645
+ $[3] = t5;
1646
+ } else t5 = $[3];
1647
+ let t6;
1648
+ if ($[4] !== filters) {
1649
+ t6 = /* @__PURE__ */ jsx(Box, {
1650
+ sx: t5,
1651
+ children: filters
1652
+ });
1653
+ $[4] = filters;
1654
+ $[5] = t6;
1655
+ } else t6 = $[5];
1656
+ let t7;
1657
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
1658
+ t7 = { justifyContent: "space-between" };
1659
+ $[6] = t7;
1660
+ } else t7 = $[6];
1661
+ const t8 = activeFilterCount === 0;
1662
+ let t9;
1663
+ if ($[7] !== labels.clearAll || $[8] !== onClearFilters || $[9] !== t8) {
1664
+ t9 = /* @__PURE__ */ jsx(Button, {
1665
+ onClick: onClearFilters,
1666
+ disabled: t8,
1667
+ children: labels.clearAll
1668
+ });
1669
+ $[7] = labels.clearAll;
1670
+ $[8] = onClearFilters;
1671
+ $[9] = t8;
1672
+ $[10] = t9;
1673
+ } else t9 = $[10];
1674
+ let t10;
1675
+ if ($[11] !== labels.applyFilters || $[12] !== onClose) {
1676
+ t10 = /* @__PURE__ */ jsx(Button, {
1677
+ variant: "contained",
1678
+ onClick: onClose,
1679
+ children: labels.applyFilters
1680
+ });
1681
+ $[11] = labels.applyFilters;
1682
+ $[12] = onClose;
1683
+ $[13] = t10;
1684
+ } else t10 = $[13];
1685
+ let t11;
1686
+ if ($[14] !== t10 || $[15] !== t9) {
1687
+ t11 = /* @__PURE__ */ jsxs(Stack, {
1688
+ direction: "row",
1689
+ sx: t7,
1690
+ children: [t9, t10]
1691
+ });
1692
+ $[14] = t10;
1693
+ $[15] = t9;
1694
+ $[16] = t11;
1695
+ } else t11 = $[16];
1696
+ let t12;
1697
+ if ($[17] !== t11 || $[18] !== t4 || $[19] !== t6) {
1698
+ t12 = /* @__PURE__ */ jsxs(Box, {
1699
+ sx: t3,
710
1700
  children: [
711
- /* @__PURE__ */ jsx(Typography, {
712
- variant: "h6",
713
- children: labels.filters
714
- }),
715
- /* @__PURE__ */ jsx(Box, {
716
- sx: {
717
- flex: 1,
718
- display: "flex",
719
- flexDirection: "column",
720
- gap: 2
721
- },
722
- children: filters
723
- }),
724
- /* @__PURE__ */ jsxs(Stack, {
725
- direction: "row",
726
- sx: { justifyContent: "space-between" },
727
- children: [/* @__PURE__ */ jsx(Button, {
728
- onClick: onClearFilters,
729
- disabled: activeFilterCount === 0,
730
- children: labels.clearAll
731
- }), /* @__PURE__ */ jsx(Button, {
732
- variant: "contained",
733
- onClick: onClose,
734
- children: labels.applyFilters
735
- })]
736
- })
1701
+ t4,
1702
+ t6,
1703
+ t11
737
1704
  ]
738
- })
739
- });
1705
+ });
1706
+ $[17] = t11;
1707
+ $[18] = t4;
1708
+ $[19] = t6;
1709
+ $[20] = t12;
1710
+ } else t12 = $[20];
1711
+ let t13;
1712
+ if ($[21] !== onClose || $[22] !== open || $[23] !== t12 || $[24] !== t2) {
1713
+ t13 = /* @__PURE__ */ jsx(Drawer, {
1714
+ anchor: t2,
1715
+ open,
1716
+ onClose,
1717
+ children: t12
1718
+ });
1719
+ $[21] = onClose;
1720
+ $[22] = open;
1721
+ $[23] = t12;
1722
+ $[24] = t2;
1723
+ $[25] = t13;
1724
+ } else t13 = $[25];
1725
+ return t13;
740
1726
  }
741
1727
  //#endregion
742
1728
  //#region src/components/ColumnMenu.tsx
1729
+ /** Props for the column menu — the shared core contract + actions wiring. */
1730
+ /** Labels the visibility toggle and the row name share. */
743
1731
  /** Eye show/hide toggle — shared by the data rows and the actions row. */
744
- function VisibilityToggle({ hidden, name, labels, onToggle }) {
745
- return /* @__PURE__ */ jsx(IconButton, {
746
- size: "small",
747
- "aria-label": `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`,
748
- "aria-pressed": !hidden,
749
- color: hidden ? "default" : "primary",
750
- onClick: onToggle,
751
- children: /* @__PURE__ */ jsx(EyeIcon, { off: hidden })
752
- });
1732
+ function VisibilityToggle(t0) {
1733
+ const $ = c(8);
1734
+ const { hidden, name, labels, onToggle } = t0;
1735
+ const t1 = `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`;
1736
+ const t2 = !hidden;
1737
+ const t3 = hidden ? "default" : "primary";
1738
+ let t4;
1739
+ if ($[0] !== hidden) {
1740
+ t4 = /* @__PURE__ */ jsx(EyeIcon, { off: hidden });
1741
+ $[0] = hidden;
1742
+ $[1] = t4;
1743
+ } else t4 = $[1];
1744
+ let t5;
1745
+ if ($[2] !== onToggle || $[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4) {
1746
+ t5 = /* @__PURE__ */ jsx(IconButton, {
1747
+ size: "small",
1748
+ "aria-label": t1,
1749
+ "aria-pressed": t2,
1750
+ color: t3,
1751
+ onClick: onToggle,
1752
+ children: t4
1753
+ });
1754
+ $[2] = onToggle;
1755
+ $[3] = t1;
1756
+ $[4] = t2;
1757
+ $[5] = t3;
1758
+ $[6] = t4;
1759
+ $[7] = t5;
1760
+ } else t5 = $[7];
1761
+ return t5;
753
1762
  }
754
1763
  /** Row name — struck through and dimmed while the column is hidden. */
755
- function RowName({ hidden, name }) {
756
- return /* @__PURE__ */ jsx(Typography, {
757
- variant: "body2",
758
- sx: {
1764
+ function RowName(t0) {
1765
+ const $ = c(6);
1766
+ const { hidden, name } = t0;
1767
+ const t1 = hidden ? "text.disabled" : "text.primary";
1768
+ const t2 = hidden ? "line-through" : "none";
1769
+ let t3;
1770
+ if ($[0] !== t1 || $[1] !== t2) {
1771
+ t3 = {
759
1772
  flex: 1,
760
- color: hidden ? "text.disabled" : "text.primary",
761
- textDecoration: hidden ? "line-through" : "none"
762
- },
763
- children: name
764
- });
1773
+ color: t1,
1774
+ textDecoration: t2
1775
+ };
1776
+ $[0] = t1;
1777
+ $[1] = t2;
1778
+ $[2] = t3;
1779
+ } else t3 = $[2];
1780
+ let t4;
1781
+ if ($[3] !== name || $[4] !== t3) {
1782
+ t4 = /* @__PURE__ */ jsx(Typography, {
1783
+ variant: "body2",
1784
+ sx: t3,
1785
+ children: name
1786
+ });
1787
+ $[3] = name;
1788
+ $[4] = t3;
1789
+ $[5] = t4;
1790
+ } else t4 = $[5];
1791
+ return t4;
765
1792
  }
766
1793
  /** Pin button — shared markup; the caller decides the cycle and the label. */
767
- function PinToggle({ active, label, onClick }) {
768
- return /* @__PURE__ */ jsx(IconButton, {
769
- size: "small",
770
- color: active ? "primary" : "default",
771
- "aria-label": label,
772
- onClick,
773
- children: /* @__PURE__ */ jsx(PinIcon, {})
774
- });
1794
+ function PinToggle(t0) {
1795
+ const $ = c(5);
1796
+ const { active, label, onClick } = t0;
1797
+ const t1 = active ? "primary" : "default";
1798
+ let t2;
1799
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1800
+ t2 = /* @__PURE__ */ jsx(PinIcon, {});
1801
+ $[0] = t2;
1802
+ } else t2 = $[0];
1803
+ let t3;
1804
+ if ($[1] !== label || $[2] !== onClick || $[3] !== t1) {
1805
+ t3 = /* @__PURE__ */ jsx(IconButton, {
1806
+ size: "small",
1807
+ color: t1,
1808
+ "aria-label": label,
1809
+ onClick,
1810
+ children: t2
1811
+ });
1812
+ $[1] = label;
1813
+ $[2] = onClick;
1814
+ $[3] = t1;
1815
+ $[4] = t3;
1816
+ } else t3 = $[4];
1817
+ return t3;
775
1818
  }
776
1819
  /**
777
1820
  * Trailing menu row for the injected row-actions column. It is not a data
@@ -780,39 +1823,107 @@ function PinToggle({ active, label, onClick }) {
780
1823
  * a ONE-CLICK right↔unpinned toggle (the column always trails, so a left pin
781
1824
  * would be meaningless).
782
1825
  */
783
- function ActionsRow({ layout, labels }) {
784
- const hidden = layout.isHidden(ACTIONS_COLUMN_KEY);
1826
+ function ActionsRow(t0) {
1827
+ const $ = c(25);
1828
+ const { layout, labels } = t0;
1829
+ let t1;
1830
+ if ($[0] !== layout) {
1831
+ t1 = layout.isHidden(ACTIONS_COLUMN_KEY);
1832
+ $[0] = layout;
1833
+ $[1] = t1;
1834
+ } else t1 = $[1];
1835
+ const hidden = t1;
785
1836
  const pinned = layout.state.pinned[ACTIONS_COLUMN_KEY] === "right";
786
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Divider, { sx: { my: .5 } }), /* @__PURE__ */ jsxs(Stack, {
787
- direction: "row",
788
- spacing: .5,
789
- sx: {
1837
+ let t2;
1838
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1839
+ t2 = /* @__PURE__ */ jsx(Divider, { sx: { my: .5 } });
1840
+ $[2] = t2;
1841
+ } else t2 = $[2];
1842
+ let t3;
1843
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1844
+ t3 = {
790
1845
  px: .5,
791
1846
  py: .25,
792
1847
  alignItems: "center"
793
- },
794
- children: [
795
- /* @__PURE__ */ jsx(Box, {
796
- "aria-hidden": true,
797
- sx: { width: 24 }
798
- }),
799
- /* @__PURE__ */ jsx(VisibilityToggle, {
800
- hidden,
801
- name: labels.actions,
802
- labels,
803
- onToggle: () => layout.toggleVisible(ACTIONS_COLUMN_KEY)
804
- }),
805
- /* @__PURE__ */ jsx(RowName, {
806
- hidden,
807
- name: labels.actions
808
- }),
809
- /* @__PURE__ */ jsx(PinToggle, {
810
- active: pinned,
811
- label: `${pinned ? labels.unpin : labels.pinRight}: ${labels.actions}`,
812
- onClick: () => layout.setPinned(ACTIONS_COLUMN_KEY, pinned ? void 0 : "right")
813
- })
814
- ]
815
- })] });
1848
+ };
1849
+ $[3] = t3;
1850
+ } else t3 = $[3];
1851
+ let t4;
1852
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1853
+ t4 = /* @__PURE__ */ jsx(Box, {
1854
+ "aria-hidden": true,
1855
+ sx: { width: 24 }
1856
+ });
1857
+ $[4] = t4;
1858
+ } else t4 = $[4];
1859
+ let t5;
1860
+ if ($[5] !== layout) {
1861
+ t5 = () => layout.toggleVisible(ACTIONS_COLUMN_KEY);
1862
+ $[5] = layout;
1863
+ $[6] = t5;
1864
+ } else t5 = $[6];
1865
+ let t6;
1866
+ if ($[7] !== hidden || $[8] !== labels || $[9] !== t5) {
1867
+ t6 = /* @__PURE__ */ jsx(VisibilityToggle, {
1868
+ hidden,
1869
+ name: labels.actions,
1870
+ labels,
1871
+ onToggle: t5
1872
+ });
1873
+ $[7] = hidden;
1874
+ $[8] = labels;
1875
+ $[9] = t5;
1876
+ $[10] = t6;
1877
+ } else t6 = $[10];
1878
+ let t7;
1879
+ if ($[11] !== hidden || $[12] !== labels.actions) {
1880
+ t7 = /* @__PURE__ */ jsx(RowName, {
1881
+ hidden,
1882
+ name: labels.actions
1883
+ });
1884
+ $[11] = hidden;
1885
+ $[12] = labels.actions;
1886
+ $[13] = t7;
1887
+ } else t7 = $[13];
1888
+ const t8 = `${pinned ? labels.unpin : labels.pinRight}: ${labels.actions}`;
1889
+ let t9;
1890
+ if ($[14] !== layout || $[15] !== pinned) {
1891
+ t9 = () => layout.setPinned(ACTIONS_COLUMN_KEY, pinned ? void 0 : "right");
1892
+ $[14] = layout;
1893
+ $[15] = pinned;
1894
+ $[16] = t9;
1895
+ } else t9 = $[16];
1896
+ let t10;
1897
+ if ($[17] !== pinned || $[18] !== t8 || $[19] !== t9) {
1898
+ t10 = /* @__PURE__ */ jsx(PinToggle, {
1899
+ active: pinned,
1900
+ label: t8,
1901
+ onClick: t9
1902
+ });
1903
+ $[17] = pinned;
1904
+ $[18] = t8;
1905
+ $[19] = t9;
1906
+ $[20] = t10;
1907
+ } else t10 = $[20];
1908
+ let t11;
1909
+ if ($[21] !== t10 || $[22] !== t6 || $[23] !== t7) {
1910
+ t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t2, /* @__PURE__ */ jsxs(Stack, {
1911
+ direction: "row",
1912
+ spacing: .5,
1913
+ sx: t3,
1914
+ children: [
1915
+ t4,
1916
+ t6,
1917
+ t7,
1918
+ t10
1919
+ ]
1920
+ })] });
1921
+ $[21] = t10;
1922
+ $[22] = t6;
1923
+ $[23] = t7;
1924
+ $[24] = t11;
1925
+ } else t11 = $[24];
1926
+ return t11;
816
1927
  }
817
1928
  /**
818
1929
  * MUI column-management popover: per-column drag grip (reorder), eye
@@ -820,104 +1931,219 @@ function ActionsRow({ layout, labels }) {
820
1931
  * navigation never fights the grip's arrow-key reorder. With row actions, a
821
1932
  * separated trailing row manages the injected actions column too.
822
1933
  */
823
- function ColumnMenu({ allColumns, layout, labels, hasRowActions }) {
1934
+ function ColumnMenu(t0) {
1935
+ const $ = c(42);
1936
+ const { allColumns, layout, labels, hasRowActions } = t0;
824
1937
  const drag = useColumnDragState();
825
1938
  const [anchor, setAnchor] = useState(null);
826
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
827
- size: "small",
828
- variant: "outlined",
829
- "aria-expanded": anchor !== null,
830
- "aria-haspopup": "true",
831
- onClick: (e) => setAnchor(e.currentTarget),
832
- children: labels.columns
833
- }), /* @__PURE__ */ jsx(Popover, {
834
- anchorEl: anchor,
835
- open: anchor !== null,
836
- onClose: () => setAnchor(null),
837
- anchorOrigin: {
1939
+ const t1 = anchor !== null;
1940
+ let t2;
1941
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1942
+ t2 = (e) => setAnchor(e.currentTarget);
1943
+ $[0] = t2;
1944
+ } else t2 = $[0];
1945
+ let t3;
1946
+ if ($[1] !== labels.columns || $[2] !== t1) {
1947
+ t3 = /* @__PURE__ */ jsx(Button, {
1948
+ size: "small",
1949
+ variant: "outlined",
1950
+ "aria-expanded": t1,
1951
+ "aria-haspopup": "true",
1952
+ onClick: t2,
1953
+ children: labels.columns
1954
+ });
1955
+ $[1] = labels.columns;
1956
+ $[2] = t1;
1957
+ $[3] = t3;
1958
+ } else t3 = $[3];
1959
+ const t4 = anchor !== null;
1960
+ let t5;
1961
+ let t6;
1962
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1963
+ t5 = () => setAnchor(null);
1964
+ t6 = {
838
1965
  vertical: "bottom",
839
1966
  horizontal: "left"
840
- },
841
- children: /* @__PURE__ */ jsxs(Box, {
842
- sx: {
843
- p: .75,
844
- minWidth: 250
845
- },
846
- children: [
847
- /* @__PURE__ */ jsx(Typography, {
848
- variant: "caption",
1967
+ };
1968
+ $[4] = t5;
1969
+ $[5] = t6;
1970
+ } else {
1971
+ t5 = $[4];
1972
+ t6 = $[5];
1973
+ }
1974
+ let t7;
1975
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
1976
+ t7 = {
1977
+ p: .75,
1978
+ minWidth: 250
1979
+ };
1980
+ $[6] = t7;
1981
+ } else t7 = $[6];
1982
+ let t8;
1983
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1984
+ t8 = {
1985
+ display: "block",
1986
+ px: 1,
1987
+ pb: .5,
1988
+ fontWeight: 600,
1989
+ textTransform: "uppercase",
1990
+ letterSpacing: "0.06em",
1991
+ color: "text.secondary"
1992
+ };
1993
+ $[7] = t8;
1994
+ } else t8 = $[7];
1995
+ let t9;
1996
+ if ($[8] !== labels.columns) {
1997
+ t9 = /* @__PURE__ */ jsx(Typography, {
1998
+ variant: "caption",
1999
+ sx: t8,
2000
+ children: labels.columns
2001
+ });
2002
+ $[8] = labels.columns;
2003
+ $[9] = t9;
2004
+ } else t9 = $[9];
2005
+ let t10;
2006
+ if ($[10] !== allColumns || $[11] !== drag || $[12] !== labels || $[13] !== layout) {
2007
+ let t11;
2008
+ if ($[15] !== drag || $[16] !== labels || $[17] !== layout) {
2009
+ t11 = (r) => {
2010
+ const indicator = drag.rowAttrs(r.key, r.index);
2011
+ const edge = indicator["data-drop"];
2012
+ const edgeOffset = edge === "before" ? "2px" : "-2px";
2013
+ return /* @__PURE__ */ jsxs(Stack, {
2014
+ direction: "row",
2015
+ spacing: .5,
849
2016
  sx: {
850
- display: "block",
851
- px: 1,
852
- pb: .5,
853
- fontWeight: 600,
854
- textTransform: "uppercase",
855
- letterSpacing: "0.06em",
856
- color: "text.secondary"
2017
+ alignItems: "center",
2018
+ px: .5,
2019
+ py: .25,
2020
+ cursor: "grab",
2021
+ opacity: "data-dragging" in indicator ? .4 : void 0,
2022
+ boxShadow: edge ? (theme) => `inset 0 ${edgeOffset} 0 0 ${theme.palette.primary.main}` : void 0
857
2023
  },
858
- children: labels.columns
859
- }),
860
- columnMenuRows(allColumns, layout).map((r) => {
861
- const indicator = drag.rowAttrs(r.key, r.index);
862
- const edge = indicator["data-drop"];
863
- const edgeOffset = edge === "before" ? "2px" : "-2px";
864
- return /* @__PURE__ */ jsxs(Stack, {
865
- direction: "row",
866
- spacing: .5,
867
- sx: {
868
- alignItems: "center",
869
- px: .5,
870
- py: .25,
871
- cursor: "grab",
872
- opacity: "data-dragging" in indicator ? .4 : void 0,
873
- boxShadow: edge ? (theme) => `inset 0 ${edgeOffset} 0 0 ${theme.palette.primary.main}` : void 0
874
- },
875
- ...drag.rowDragProps(r.key, r.index),
876
- ...drag.dropProps(r.index, layout.move),
877
- ...indicator,
878
- children: [
879
- /* @__PURE__ */ jsx(IconButton, {
880
- size: "small",
881
- sx: {
882
- cursor: "grab",
883
- color: "text.disabled"
884
- },
885
- ...columnReorderKeyProps(r.key, r.index, layout.move, `${labels.moveLeft} / ${labels.moveRight}: ${r.name}`),
886
- children: /* @__PURE__ */ jsx(GripIcon, {})
887
- }),
888
- /* @__PURE__ */ jsx(VisibilityToggle, {
889
- hidden: r.hidden,
890
- name: r.name,
891
- labels,
892
- onToggle: () => layout.toggleVisible(r.key)
893
- }),
894
- /* @__PURE__ */ jsx(RowName, {
895
- hidden: r.hidden,
896
- name: r.name
897
- }),
898
- /* @__PURE__ */ jsx(PinToggle, {
899
- active: r.pinned !== void 0,
900
- label: `${pinActionLabel(r.pinned, labels)}: ${r.name}`,
901
- onClick: () => layout.setPinned(r.key, nextPinSide(r.pinned))
902
- })
903
- ]
904
- }, r.key);
905
- }),
906
- hasRowActions && /* @__PURE__ */ jsx(ActionsRow, {
907
- layout,
908
- labels
909
- }),
910
- /* @__PURE__ */ jsx(Divider, { sx: { my: .5 } }),
911
- /* @__PURE__ */ jsx(Button, {
912
- size: "small",
913
- fullWidth: true,
914
- sx: { justifyContent: "flex-start" },
915
- onClick: () => layout.reset(),
916
- children: labels.resetColumns
917
- })
2024
+ ...drag.rowDragProps(r.key, r.index),
2025
+ ...drag.dropProps(r.index, layout.move),
2026
+ ...indicator,
2027
+ children: [
2028
+ /* @__PURE__ */ jsx(IconButton, {
2029
+ size: "small",
2030
+ sx: {
2031
+ cursor: "grab",
2032
+ color: "text.disabled"
2033
+ },
2034
+ ...columnReorderKeyProps(r.key, r.index, layout.move, `${labels.moveLeft} / ${labels.moveRight}: ${r.name}`),
2035
+ children: /* @__PURE__ */ jsx(GripIcon, {})
2036
+ }),
2037
+ /* @__PURE__ */ jsx(VisibilityToggle, {
2038
+ hidden: r.hidden,
2039
+ name: r.name,
2040
+ labels,
2041
+ onToggle: () => layout.toggleVisible(r.key)
2042
+ }),
2043
+ /* @__PURE__ */ jsx(RowName, {
2044
+ hidden: r.hidden,
2045
+ name: r.name
2046
+ }),
2047
+ /* @__PURE__ */ jsx(PinToggle, {
2048
+ active: r.pinned !== void 0,
2049
+ label: `${pinActionLabel(r.pinned, labels)}: ${r.name}`,
2050
+ onClick: () => layout.setPinned(r.key, nextPinSide(r.pinned))
2051
+ })
2052
+ ]
2053
+ }, r.key);
2054
+ };
2055
+ $[15] = drag;
2056
+ $[16] = labels;
2057
+ $[17] = layout;
2058
+ $[18] = t11;
2059
+ } else t11 = $[18];
2060
+ t10 = columnMenuRows(allColumns, layout).map(t11);
2061
+ $[10] = allColumns;
2062
+ $[11] = drag;
2063
+ $[12] = labels;
2064
+ $[13] = layout;
2065
+ $[14] = t10;
2066
+ } else t10 = $[14];
2067
+ let t11;
2068
+ if ($[19] !== hasRowActions || $[20] !== labels || $[21] !== layout) {
2069
+ t11 = hasRowActions && /* @__PURE__ */ jsx(ActionsRow, {
2070
+ layout,
2071
+ labels
2072
+ });
2073
+ $[19] = hasRowActions;
2074
+ $[20] = labels;
2075
+ $[21] = layout;
2076
+ $[22] = t11;
2077
+ } else t11 = $[22];
2078
+ let t12;
2079
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
2080
+ t12 = /* @__PURE__ */ jsx(Divider, { sx: { my: .5 } });
2081
+ $[23] = t12;
2082
+ } else t12 = $[23];
2083
+ let t13;
2084
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
2085
+ t13 = { justifyContent: "flex-start" };
2086
+ $[24] = t13;
2087
+ } else t13 = $[24];
2088
+ let t14;
2089
+ if ($[25] !== layout) {
2090
+ t14 = () => layout.reset();
2091
+ $[25] = layout;
2092
+ $[26] = t14;
2093
+ } else t14 = $[26];
2094
+ let t15;
2095
+ if ($[27] !== labels.resetColumns || $[28] !== t14) {
2096
+ t15 = /* @__PURE__ */ jsx(Button, {
2097
+ size: "small",
2098
+ fullWidth: true,
2099
+ sx: t13,
2100
+ onClick: t14,
2101
+ children: labels.resetColumns
2102
+ });
2103
+ $[27] = labels.resetColumns;
2104
+ $[28] = t14;
2105
+ $[29] = t15;
2106
+ } else t15 = $[29];
2107
+ let t16;
2108
+ if ($[30] !== t10 || $[31] !== t11 || $[32] !== t15 || $[33] !== t9) {
2109
+ t16 = /* @__PURE__ */ jsxs(Box, {
2110
+ sx: t7,
2111
+ children: [
2112
+ t9,
2113
+ t10,
2114
+ t11,
2115
+ t12,
2116
+ t15
918
2117
  ]
919
- })
920
- })] });
2118
+ });
2119
+ $[30] = t10;
2120
+ $[31] = t11;
2121
+ $[32] = t15;
2122
+ $[33] = t9;
2123
+ $[34] = t16;
2124
+ } else t16 = $[34];
2125
+ let t17;
2126
+ if ($[35] !== anchor || $[36] !== t16 || $[37] !== t4) {
2127
+ t17 = /* @__PURE__ */ jsx(Popover, {
2128
+ anchorEl: anchor,
2129
+ open: t4,
2130
+ onClose: t5,
2131
+ anchorOrigin: t6,
2132
+ children: t16
2133
+ });
2134
+ $[35] = anchor;
2135
+ $[36] = t16;
2136
+ $[37] = t4;
2137
+ $[38] = t17;
2138
+ } else t17 = $[38];
2139
+ let t18;
2140
+ if ($[39] !== t17 || $[40] !== t3) {
2141
+ t18 = /* @__PURE__ */ jsxs(Fragment, { children: [t3, t17] });
2142
+ $[39] = t17;
2143
+ $[40] = t3;
2144
+ $[41] = t18;
2145
+ } else t18 = $[41];
2146
+ return t18;
921
2147
  }
922
2148
  //#endregion
923
2149
  //#region src/components/tables.tsx
@@ -952,19 +2178,25 @@ function useStableToggle(target) {
952
2178
  return useCallback((id) => ref.current?.toggle(id), []);
953
2179
  }
954
2180
  /** Inline chevron pointing at the reading end; rotates down when open. */
955
- function ExpandChevron({ expanded, dir }) {
2181
+ function ExpandChevron(t0) {
2182
+ const $ = c(5);
2183
+ const { expanded, dir } = t0;
956
2184
  let transform;
957
2185
  if (expanded) transform = "rotate(90deg)";
958
2186
  else if (dir === "rtl") transform = "rotate(180deg)";
959
- return /* @__PURE__ */ jsx(Box, {
960
- component: "span",
961
- "aria-hidden": true,
962
- sx: {
2187
+ let t1;
2188
+ if ($[0] !== transform) {
2189
+ t1 = {
963
2190
  display: "inline-flex",
964
2191
  transition: "transform 150ms",
965
2192
  transform
966
- },
967
- children: /* @__PURE__ */ jsx("svg", {
2193
+ };
2194
+ $[0] = transform;
2195
+ $[1] = t1;
2196
+ } else t1 = $[1];
2197
+ let t2;
2198
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2199
+ t2 = /* @__PURE__ */ jsx("svg", {
968
2200
  width: "1em",
969
2201
  height: "1em",
970
2202
  viewBox: "0 0 24 24",
@@ -974,21 +2206,60 @@ function ExpandChevron({ expanded, dir }) {
974
2206
  strokeLinecap: "round",
975
2207
  strokeLinejoin: "round",
976
2208
  children: /* @__PURE__ */ jsx("path", { d: "M9 6l6 6-6 6" })
977
- })
978
- });
2209
+ });
2210
+ $[2] = t2;
2211
+ } else t2 = $[2];
2212
+ let t3;
2213
+ if ($[3] !== t1) {
2214
+ t3 = /* @__PURE__ */ jsx(Box, {
2215
+ component: "span",
2216
+ "aria-hidden": true,
2217
+ sx: t1,
2218
+ children: t2
2219
+ });
2220
+ $[3] = t1;
2221
+ $[4] = t3;
2222
+ } else t3 = $[4];
2223
+ return t3;
979
2224
  }
980
2225
  /** The per-row expand/collapse chevron button (desktop cell + mobile card). */
981
- function ExpandToggle({ id, expanded, onToggle, dir, expandLabel, collapseLabel }) {
982
- return /* @__PURE__ */ jsx(IconButton, {
983
- size: "small",
984
- "aria-expanded": expanded,
985
- "aria-label": expanded ? collapseLabel : expandLabel,
986
- onClick: () => onToggle(id),
987
- children: /* @__PURE__ */ jsx(ExpandChevron, {
2226
+ function ExpandToggle(t0) {
2227
+ const $ = c(11);
2228
+ const { id, expanded, onToggle, dir, expandLabel, collapseLabel } = t0;
2229
+ const t1 = expanded ? collapseLabel : expandLabel;
2230
+ let t2;
2231
+ if ($[0] !== id || $[1] !== onToggle) {
2232
+ t2 = () => onToggle(id);
2233
+ $[0] = id;
2234
+ $[1] = onToggle;
2235
+ $[2] = t2;
2236
+ } else t2 = $[2];
2237
+ let t3;
2238
+ if ($[3] !== dir || $[4] !== expanded) {
2239
+ t3 = /* @__PURE__ */ jsx(ExpandChevron, {
988
2240
  expanded,
989
2241
  dir
990
- })
991
- });
2242
+ });
2243
+ $[3] = dir;
2244
+ $[4] = expanded;
2245
+ $[5] = t3;
2246
+ } else t3 = $[5];
2247
+ let t4;
2248
+ if ($[6] !== expanded || $[7] !== t1 || $[8] !== t2 || $[9] !== t3) {
2249
+ t4 = /* @__PURE__ */ jsx(IconButton, {
2250
+ size: "small",
2251
+ "aria-expanded": expanded,
2252
+ "aria-label": t1,
2253
+ onClick: t2,
2254
+ children: t3
2255
+ });
2256
+ $[6] = expanded;
2257
+ $[7] = t1;
2258
+ $[8] = t2;
2259
+ $[9] = t3;
2260
+ $[10] = t4;
2261
+ } else t4 = $[10];
2262
+ return t4;
992
2263
  }
993
2264
  /**
994
2265
  * Logical (RTL-aware) `text-align` for a column. Applied via `sx` rather
@@ -1000,36 +2271,71 @@ function muiAlign(align) {
1000
2271
  if (align === "end") return "end";
1001
2272
  return "start";
1002
2273
  }
1003
- function RowActionButtons({ row, actions, confirm, cancelLabel }) {
1004
- return /* @__PURE__ */ jsx(Stack, {
1005
- direction: "row",
1006
- spacing: .5,
1007
- sx: { justifyContent: "flex-end" },
1008
- children: actions.map((action) => {
1009
- if (action.isHidden?.(row)) return null;
1010
- const reason = resolveDisabledReason(action.disabledReason?.(row));
1011
- const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
1012
- return /* @__PURE__ */ jsx(Tooltip, {
1013
- title: reason ?? action.label,
1014
- children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(IconButton, {
1015
- size: "small",
1016
- color: muiColor(action.color),
1017
- disabled,
1018
- "aria-label": action.label,
1019
- onClick: disabled ? void 0 : (e) => {
1020
- e.stopPropagation();
1021
- runRowAction(action, row, confirm, cancelLabel);
1022
- },
1023
- children: action.icon ?? /* @__PURE__ */ jsx(Typography, {
1024
- variant: "caption",
1025
- children: action.label
1026
- })
1027
- }) })
1028
- }, action.key);
1029
- })
1030
- });
2274
+ function RowActionButtons(t0) {
2275
+ const $ = c(12);
2276
+ const { row, actions, confirm, cancelLabel } = t0;
2277
+ let t1;
2278
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2279
+ t1 = { justifyContent: "flex-end" };
2280
+ $[0] = t1;
2281
+ } else t1 = $[0];
2282
+ let t2;
2283
+ if ($[1] !== actions || $[2] !== cancelLabel || $[3] !== confirm || $[4] !== row) {
2284
+ let t3;
2285
+ if ($[6] !== cancelLabel || $[7] !== confirm || $[8] !== row) {
2286
+ t3 = (action) => {
2287
+ if (action.isHidden?.(row)) return null;
2288
+ const reason = resolveDisabledReason(action.disabledReason?.(row));
2289
+ const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
2290
+ return /* @__PURE__ */ jsx(Tooltip, {
2291
+ title: reason ?? action.label,
2292
+ children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(IconButton, {
2293
+ size: "small",
2294
+ color: muiColor(action.color),
2295
+ disabled,
2296
+ "aria-label": action.label,
2297
+ onClick: disabled ? void 0 : (e) => {
2298
+ e.stopPropagation();
2299
+ runRowAction(action, row, confirm, cancelLabel);
2300
+ },
2301
+ children: action.icon ?? /* @__PURE__ */ jsx(Typography, {
2302
+ variant: "caption",
2303
+ children: action.label
2304
+ })
2305
+ }) })
2306
+ }, action.key);
2307
+ };
2308
+ $[6] = cancelLabel;
2309
+ $[7] = confirm;
2310
+ $[8] = row;
2311
+ $[9] = t3;
2312
+ } else t3 = $[9];
2313
+ t2 = actions.map(t3);
2314
+ $[1] = actions;
2315
+ $[2] = cancelLabel;
2316
+ $[3] = confirm;
2317
+ $[4] = row;
2318
+ $[5] = t2;
2319
+ } else t2 = $[5];
2320
+ let t3;
2321
+ if ($[10] !== t2) {
2322
+ t3 = /* @__PURE__ */ jsx(Stack, {
2323
+ direction: "row",
2324
+ spacing: .5,
2325
+ sx: t1,
2326
+ children: t2
2327
+ });
2328
+ $[10] = t2;
2329
+ $[11] = t3;
2330
+ } else t3 = $[11];
2331
+ return t3;
1031
2332
  }
1032
2333
  /**
2334
+ * Per-render-stable sx for the memoized desktop row. Built once per
2335
+ * `DesktopTable` render (memoized on the pin/width/column inputs), so the
2336
+ * row comparator can treat one object identity as "the cell styling".
2337
+ */
2338
+ /**
1033
2339
  * The visual inputs a desktop row re-renders for. Deliberately NOT the
1034
2340
  * per-render `table` object or the handler props: handlers are stable (or
1035
2341
  * latest-dispatching wrappers), and everything that changes what the row
@@ -1059,58 +2365,157 @@ const DESKTOP_ROW_COMPARED = [
1059
2365
  function desktopRowPropsAreEqual(prev, next) {
1060
2366
  return DESKTOP_ROW_COMPARED.every((key) => prev[key] === next[key]);
1061
2367
  }
1062
- function DesktopRowImpl({ row, index, selected, expanded, columns, sx, columnSpan, dir, className, hasSelection, hasExpansion, showActions, selectRowLabel, cancelLabel, expandLabel, collapseLabel, id, rowActions, confirm, renderRowDetail, onToggleSelect, onToggleExpand, onRowClick, prefetch, measureElement }) {
1063
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(TableRow, {
1064
- ...rowClickProps(row, onRowClick),
1065
- className,
1066
- ref: measureElement,
1067
- "data-index": index,
1068
- hover: true,
1069
- selected,
1070
- onMouseEnter: prefetch ? () => prefetch(row) : void 0,
1071
- children: [
1072
- hasExpansion && /* @__PURE__ */ jsx(TableCell, {
1073
- padding: "checkbox",
1074
- sx: sx.expand,
1075
- children: /* @__PURE__ */ jsx(ExpandToggle, {
1076
- id,
1077
- expanded,
1078
- onToggle: onToggleExpand,
1079
- dir,
1080
- expandLabel,
1081
- collapseLabel
1082
- })
1083
- }),
1084
- hasSelection && /* @__PURE__ */ jsx(TableCell, {
1085
- padding: "checkbox",
1086
- sx: sx.selection,
1087
- children: /* @__PURE__ */ jsx(Checkbox, {
1088
- slotProps: { input: { "aria-label": selectRowLabel } },
1089
- checked: selected,
1090
- onChange: () => onToggleSelect(id)
1091
- })
1092
- }),
1093
- columns.map((column) => /* @__PURE__ */ jsx(TableCell, {
2368
+ function DesktopRowImpl(t0) {
2369
+ const $ = c(57);
2370
+ const { row, index, selected, expanded, columns, sx, columnSpan, dir, className, hasSelection, hasExpansion, showActions, selectRowLabel, cancelLabel, expandLabel, collapseLabel, id, rowActions, confirm, renderRowDetail, onToggleSelect, onToggleExpand, onRowClick, prefetch, measureElement } = t0;
2371
+ let t1;
2372
+ if ($[0] !== onRowClick || $[1] !== row) {
2373
+ t1 = rowClickProps(row, onRowClick);
2374
+ $[0] = onRowClick;
2375
+ $[1] = row;
2376
+ $[2] = t1;
2377
+ } else t1 = $[2];
2378
+ let t2;
2379
+ if ($[3] !== prefetch || $[4] !== row) {
2380
+ t2 = prefetch ? () => prefetch(row) : void 0;
2381
+ $[3] = prefetch;
2382
+ $[4] = row;
2383
+ $[5] = t2;
2384
+ } else t2 = $[5];
2385
+ let t3;
2386
+ if ($[6] !== collapseLabel || $[7] !== dir || $[8] !== expandLabel || $[9] !== expanded || $[10] !== hasExpansion || $[11] !== id || $[12] !== onToggleExpand || $[13] !== sx) {
2387
+ t3 = hasExpansion && /* @__PURE__ */ jsx(TableCell, {
2388
+ padding: "checkbox",
2389
+ sx: sx.expand,
2390
+ children: /* @__PURE__ */ jsx(ExpandToggle, {
2391
+ id,
2392
+ expanded,
2393
+ onToggle: onToggleExpand,
2394
+ dir,
2395
+ expandLabel,
2396
+ collapseLabel
2397
+ })
2398
+ });
2399
+ $[6] = collapseLabel;
2400
+ $[7] = dir;
2401
+ $[8] = expandLabel;
2402
+ $[9] = expanded;
2403
+ $[10] = hasExpansion;
2404
+ $[11] = id;
2405
+ $[12] = onToggleExpand;
2406
+ $[13] = sx;
2407
+ $[14] = t3;
2408
+ } else t3 = $[14];
2409
+ let t4;
2410
+ if ($[15] !== hasSelection || $[16] !== id || $[17] !== onToggleSelect || $[18] !== selectRowLabel || $[19] !== selected || $[20] !== sx) {
2411
+ t4 = hasSelection && /* @__PURE__ */ jsx(TableCell, {
2412
+ padding: "checkbox",
2413
+ sx: sx.selection,
2414
+ children: /* @__PURE__ */ jsx(Checkbox, {
2415
+ slotProps: { input: { "aria-label": selectRowLabel } },
2416
+ checked: selected,
2417
+ onChange: () => onToggleSelect(id)
2418
+ })
2419
+ });
2420
+ $[15] = hasSelection;
2421
+ $[16] = id;
2422
+ $[17] = onToggleSelect;
2423
+ $[18] = selectRowLabel;
2424
+ $[19] = selected;
2425
+ $[20] = sx;
2426
+ $[21] = t4;
2427
+ } else t4 = $[21];
2428
+ let t5;
2429
+ if ($[22] !== columns || $[23] !== index || $[24] !== row || $[25] !== sx) {
2430
+ let t6;
2431
+ if ($[27] !== index || $[28] !== row || $[29] !== sx) {
2432
+ t6 = (column) => /* @__PURE__ */ jsx(TableCell, {
1094
2433
  sx: sx.cells[column.key],
1095
2434
  children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
1096
2435
  row,
1097
2436
  rowIndex: index
1098
2437
  }) : column.accessor?.(row)
1099
- }, column.key)),
1100
- showActions && /* @__PURE__ */ jsx(TableCell, {
1101
- sx: sx.actions,
1102
- children: /* @__PURE__ */ jsx(RowActionButtons, {
1103
- row,
1104
- actions: rowActions,
1105
- confirm,
1106
- cancelLabel
1107
- })
2438
+ }, column.key);
2439
+ $[27] = index;
2440
+ $[28] = row;
2441
+ $[29] = sx;
2442
+ $[30] = t6;
2443
+ } else t6 = $[30];
2444
+ t5 = columns.map(t6);
2445
+ $[22] = columns;
2446
+ $[23] = index;
2447
+ $[24] = row;
2448
+ $[25] = sx;
2449
+ $[26] = t5;
2450
+ } else t5 = $[26];
2451
+ let t6;
2452
+ if ($[31] !== cancelLabel || $[32] !== confirm || $[33] !== row || $[34] !== rowActions || $[35] !== showActions || $[36] !== sx) {
2453
+ t6 = showActions && /* @__PURE__ */ jsx(TableCell, {
2454
+ sx: sx.actions,
2455
+ children: /* @__PURE__ */ jsx(RowActionButtons, {
2456
+ row,
2457
+ actions: rowActions,
2458
+ confirm,
2459
+ cancelLabel
1108
2460
  })
1109
- ]
1110
- }), expanded && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
1111
- colSpan: columnSpan,
1112
- children: renderRowDetail(row)
1113
- }) })] });
2461
+ });
2462
+ $[31] = cancelLabel;
2463
+ $[32] = confirm;
2464
+ $[33] = row;
2465
+ $[34] = rowActions;
2466
+ $[35] = showActions;
2467
+ $[36] = sx;
2468
+ $[37] = t6;
2469
+ } else t6 = $[37];
2470
+ let t7;
2471
+ if ($[38] !== className || $[39] !== index || $[40] !== measureElement || $[41] !== selected || $[42] !== t1 || $[43] !== t2 || $[44] !== t3 || $[45] !== t4 || $[46] !== t5 || $[47] !== t6) {
2472
+ t7 = /* @__PURE__ */ jsxs(TableRow, {
2473
+ ...t1,
2474
+ className,
2475
+ ref: measureElement,
2476
+ "data-index": index,
2477
+ hover: true,
2478
+ selected,
2479
+ onMouseEnter: t2,
2480
+ children: [
2481
+ t3,
2482
+ t4,
2483
+ t5,
2484
+ t6
2485
+ ]
2486
+ });
2487
+ $[38] = className;
2488
+ $[39] = index;
2489
+ $[40] = measureElement;
2490
+ $[41] = selected;
2491
+ $[42] = t1;
2492
+ $[43] = t2;
2493
+ $[44] = t3;
2494
+ $[45] = t4;
2495
+ $[46] = t5;
2496
+ $[47] = t6;
2497
+ $[48] = t7;
2498
+ } else t7 = $[48];
2499
+ let t8;
2500
+ if ($[49] !== columnSpan || $[50] !== expanded || $[51] !== renderRowDetail || $[52] !== row) {
2501
+ t8 = expanded && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
2502
+ colSpan: columnSpan,
2503
+ children: renderRowDetail(row)
2504
+ }) });
2505
+ $[49] = columnSpan;
2506
+ $[50] = expanded;
2507
+ $[51] = renderRowDetail;
2508
+ $[52] = row;
2509
+ $[53] = t8;
2510
+ } else t8 = $[53];
2511
+ let t9;
2512
+ if ($[54] !== t7 || $[55] !== t8) {
2513
+ t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
2514
+ $[54] = t7;
2515
+ $[55] = t8;
2516
+ $[56] = t9;
2517
+ } else t9 = $[56];
2518
+ return t9;
1114
2519
  }
1115
2520
  /**
1116
2521
  * Memoized desktop row: a search keystroke (or any chrome re-render) must
@@ -1154,8 +2559,8 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1154
2559
  right: leadRight
1155
2560
  };
1156
2561
  const selectionLead = expandActive ? EXPAND_WIDTH : 0;
1157
- const hasLeftPin = table.columns.some((c) => pinOffset?.(c.key)?.side === "left");
1158
- const stickActions = table.columns.some((c) => pinOffset?.(c.key)?.side === "right") || actionsPinned;
2562
+ const hasLeftPin = table.columns.some((c_0) => pinOffset?.(c_0.key)?.side === "left");
2563
+ const stickActions = table.columns.some((c_1) => pinOffset?.(c_1.key)?.side === "right") || actionsPinned;
1159
2564
  const headCellSx = (column) => {
1160
2565
  const pin = pinnedCellStyle(pinOffset?.(column.key), PIN_Z.headerPinned, leads);
1161
2566
  const width = pin ? pinnedColumnWidth(column, columnWidths) : columnWidths?.[column.key] ?? column.width;
@@ -1172,38 +2577,38 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1172
2577
  };
1173
2578
  };
1174
2579
  const edgeHeadSx = (side, active, lead = 0) => {
1175
- const pin = edgePinStyle(side, active, PIN_Z.headerPinned);
2580
+ const pin_0 = edgePinStyle(side, active, PIN_Z.headerPinned);
1176
2581
  return {
1177
2582
  ...headSx,
1178
- ...pin && {
1179
- ...pin,
2583
+ ...pin_0 && {
2584
+ ...pin_0,
1180
2585
  bgcolor: "background.paper"
1181
2586
  },
1182
- ...pin && lead > 0 && { insetInlineStart: lead }
2587
+ ...pin_0 && lead > 0 && { insetInlineStart: lead }
1183
2588
  };
1184
2589
  };
1185
2590
  const rowSx = useMemo(() => {
1186
- const edge = (side, active, lead = 0) => {
1187
- const pin = edgePinStyle(side, active, PIN_Z.body);
1188
- if (!pin) return void 0;
2591
+ const edge = (side_0, active_0, lead_0 = 0) => {
2592
+ const pin_1 = edgePinStyle(side_0, active_0, PIN_Z.body);
2593
+ if (!pin_1) return void 0;
1189
2594
  return {
1190
- ...pin,
1191
- ...lead > 0 && { insetInlineStart: lead },
2595
+ ...pin_1,
2596
+ ...lead_0 > 0 && { insetInlineStart: lead_0 },
1192
2597
  bgcolor: "background.paper"
1193
2598
  };
1194
2599
  };
1195
2600
  const cells = {};
1196
- for (const column of columns) {
1197
- const pin = pinnedCellStyle(pinOffset?.(column.key), PIN_Z.body, {
2601
+ for (const column_0 of columns) {
2602
+ const pin_2 = pinnedCellStyle(pinOffset?.(column_0.key), PIN_Z.body, {
1198
2603
  left: leadLeft,
1199
2604
  right: leadRight
1200
2605
  });
1201
- cells[column.key] = {
1202
- ...pin && {
1203
- ...pin,
2606
+ cells[column_0.key] = {
2607
+ ...pin_2 && {
2608
+ ...pin_2,
1204
2609
  bgcolor: "background.paper"
1205
2610
  },
1206
- textAlign: muiAlign(column.align)
2611
+ textAlign: muiAlign(column_0.align)
1207
2612
  };
1208
2613
  }
1209
2614
  return {
@@ -1272,20 +2677,20 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1272
2677
  onChange: selection.toggleAll
1273
2678
  })
1274
2679
  }),
1275
- columns.map((column) => {
1276
- const headerCellProps = table.getHeaderCellProps(column);
2680
+ columns.map((column_1) => {
2681
+ const headerCellProps = table.getHeaderCellProps(column_1);
1277
2682
  const ariaSort = headerCellProps["aria-sort"];
1278
- const active = ariaSort === "ascending" || ariaSort === "descending";
2683
+ const active_1 = ariaSort === "ascending" || ariaSort === "descending";
1279
2684
  const sortIndex = headerCellProps["data-sort-index"];
1280
2685
  return /* @__PURE__ */ jsxs(TableCell, {
1281
2686
  "aria-sort": ariaSort,
1282
2687
  "data-sort-index": sortIndex,
1283
- sx: headCellSx(column),
1284
- children: [column.sortable ? /* @__PURE__ */ jsxs(TableSortLabel, {
1285
- active,
2688
+ sx: headCellSx(column_1),
2689
+ children: [column_1.sortable ? /* @__PURE__ */ jsxs(TableSortLabel, {
2690
+ active: active_1,
1286
2691
  direction: ariaSort === "descending" ? "desc" : "asc",
1287
- onClick: table.getSortButtonProps(column).onClick,
1288
- children: [column.header, sortIndex !== void 0 && /* @__PURE__ */ jsx(Box, {
2692
+ onClick: table.getSortButtonProps(column_1).onClick,
2693
+ children: [column_1.header, sortIndex !== void 0 && /* @__PURE__ */ jsx(Box, {
1289
2694
  component: "span",
1290
2695
  sx: {
1291
2696
  fontSize: 10,
@@ -1293,12 +2698,12 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1293
2698
  },
1294
2699
  children: sortIndex
1295
2700
  })]
1296
- }) : column.header, setWidth && /* @__PURE__ */ jsx(Box, {
2701
+ }) : column_1.header, setWidth && /* @__PURE__ */ jsx(Box, {
1297
2702
  component: "span",
1298
2703
  sx: RESIZE_HANDLE_SX,
1299
- ...columnResizeHandleProps(column.key, setWidth, `${resizeLabel}: ${typeof column.header === "string" ? column.header : column.key}`)
2704
+ ...columnResizeHandleProps(column_1.key, setWidth, `${resizeLabel}: ${typeof column_1.header === "string" ? column_1.header : column_1.key}`)
1300
2705
  })]
1301
- }, column.key);
2706
+ }, column_1.key);
1302
2707
  }),
1303
2708
  showActions && /* @__PURE__ */ jsx(TableCell, {
1304
2709
  sx: {
@@ -1364,10 +2769,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1364
2769
  summaryCells && /* @__PURE__ */ jsx(TableFooter, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
1365
2770
  expandActive && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox" }),
1366
2771
  selection && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox" }),
1367
- columns.map((column) => /* @__PURE__ */ jsx(TableCell, {
1368
- sx: { textAlign: muiAlign(column.align) },
1369
- children: summaryCells[column.key]
1370
- }, column.key)),
2772
+ columns.map((column_2) => /* @__PURE__ */ jsx(TableCell, {
2773
+ sx: { textAlign: muiAlign(column_2.align) },
2774
+ children: summaryCells[column_2.key]
2775
+ }, column_2.key)),
1371
2776
  showActions && /* @__PURE__ */ jsx(TableCell, {})
1372
2777
  ] }) })
1373
2778
  ]
@@ -1378,91 +2783,80 @@ function mobileLabel(column) {
1378
2783
  return column.mobileLabel ?? (typeof column.header === "string" ? column.header : column.key);
1379
2784
  }
1380
2785
  /** Mobile MUI card list. */
1381
- function MobileCards({ table, rows, rowActions, confirm, getRowId, size, dir, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, rowEntries, paddingTop = 0, paddingBottom = 0, measureElement }) {
2786
+ function MobileCards(t0) {
2787
+ const $ = c(48);
2788
+ const { table, rows, rowActions, confirm, getRowId, size, dir, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, rowEntries, paddingTop: t1, paddingBottom: t2, measureElement } = t0;
2789
+ const paddingTop = t1 === void 0 ? 0 : t1;
2790
+ const paddingBottom = t2 === void 0 ? 0 : t2;
1382
2791
  const { columns, selection, labels } = table;
1383
- const entries = resolveVirtualRows(rows, getRowId, rowEntries);
1384
- const compact = size === "small";
1385
- const expand = expansion && renderRowDetail ? expansion : void 0;
1386
- const summaryCells = summaryRow?.(rows);
1387
- return /* @__PURE__ */ jsxs(Stack, {
1388
- spacing: compact ? 1 : 1.5,
1389
- role: "list",
1390
- "aria-label": table.getTableProps()["aria-label"],
1391
- children: [
1392
- paddingTop > 0 && /* @__PURE__ */ jsx(Box, {
2792
+ let T0;
2793
+ let compact;
2794
+ let summaryCells;
2795
+ let t3;
2796
+ let t4;
2797
+ let t5;
2798
+ let t6;
2799
+ let t7;
2800
+ if ($[0] !== columns || $[1] !== confirm || $[2] !== dir || $[3] !== expansion || $[4] !== getRowId || $[5] !== labels || $[6] !== measureElement || $[7] !== onRowClick || $[8] !== paddingTop || $[9] !== renderRowDetail || $[10] !== rowActions || $[11] !== rowClassName || $[12] !== rowEntries || $[13] !== rows || $[14] !== selection || $[15] !== size || $[16] !== summaryRow || $[17] !== table) {
2801
+ const entries = resolveVirtualRows(rows, getRowId, rowEntries);
2802
+ compact = size === "small";
2803
+ const expand = expansion && renderRowDetail ? expansion : void 0;
2804
+ let t8;
2805
+ if ($[26] !== rows || $[27] !== summaryRow) {
2806
+ t8 = summaryRow?.(rows);
2807
+ $[26] = rows;
2808
+ $[27] = summaryRow;
2809
+ $[28] = t8;
2810
+ } else t8 = $[28];
2811
+ summaryCells = t8;
2812
+ T0 = Stack;
2813
+ t3 = compact ? 1 : 1.5;
2814
+ t4 = "list";
2815
+ let t9;
2816
+ if ($[29] !== table) {
2817
+ t9 = table.getTableProps();
2818
+ $[29] = table;
2819
+ $[30] = t9;
2820
+ } else t9 = $[30];
2821
+ t5 = t9["aria-label"];
2822
+ if ($[31] !== paddingTop) {
2823
+ t6 = paddingTop > 0 && /* @__PURE__ */ jsx(Box, {
1393
2824
  "aria-hidden": true,
1394
2825
  sx: { height: paddingTop }
1395
- }),
1396
- entries.map(({ row, index, key }) => {
1397
- const id = getRowId(row);
1398
- return /* @__PURE__ */ jsx(Card, {
1399
- ref: measureElement,
1400
- "data-index": index,
1401
- variant: "outlined",
1402
- role: "listitem",
1403
- className: rowClassName?.(row, index),
1404
- ...rowClickProps(row, onRowClick),
1405
- children: /* @__PURE__ */ jsxs(CardContent, {
1406
- sx: compact ? {
1407
- p: 1.25,
1408
- "&:last-child": { pb: 1.25 }
1409
- } : void 0,
1410
- children: [
1411
- selection && /* @__PURE__ */ jsx(Checkbox, {
1412
- slotProps: { input: { "aria-label": labels.selectRow } },
1413
- checked: selection.isSelected(id),
1414
- onChange: () => selection.toggle(id)
1415
- }),
1416
- expand && /* @__PURE__ */ jsx(ExpandToggle, {
1417
- id,
1418
- expanded: expand.isExpanded(id),
1419
- onToggle: expand.toggle,
1420
- dir,
1421
- expandLabel: labels.expandRow,
1422
- collapseLabel: labels.collapseRow
1423
- }),
1424
- columns.map((column) => /* @__PURE__ */ jsxs(Box, {
1425
- sx: { mb: compact ? .5 : 1 },
1426
- children: [/* @__PURE__ */ jsx(Typography, {
1427
- variant: "caption",
1428
- color: "text.secondary",
1429
- sx: { display: "block" },
1430
- children: mobileLabel(column)
1431
- }), /* @__PURE__ */ jsx(Typography, {
1432
- component: "div",
1433
- variant: "body2",
1434
- children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
1435
- row,
1436
- rowIndex: index
1437
- }) : column.accessor?.(row)
1438
- })]
1439
- }, column.key)),
1440
- rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx(RowActionButtons, {
1441
- row,
1442
- actions: rowActions,
1443
- confirm,
1444
- cancelLabel: labels.cancel
1445
- }),
1446
- expand?.isExpanded(id) && /* @__PURE__ */ jsx(Box, {
1447
- sx: { mt: 1 },
1448
- children: renderRowDetail(row)
1449
- })
1450
- ]
1451
- })
1452
- }, key);
1453
- }),
1454
- summaryCells && /* @__PURE__ */ jsx(Card, {
2826
+ });
2827
+ $[31] = paddingTop;
2828
+ $[32] = t6;
2829
+ } else t6 = $[32];
2830
+ t7 = entries.map((t10) => {
2831
+ const { row, index, key } = t10;
2832
+ const id = getRowId(row);
2833
+ return /* @__PURE__ */ jsx(Card, {
2834
+ ref: measureElement,
2835
+ "data-index": index,
1455
2836
  variant: "outlined",
1456
2837
  role: "listitem",
1457
- children: /* @__PURE__ */ jsx(CardContent, {
2838
+ className: rowClassName?.(row, index),
2839
+ ...rowClickProps(row, onRowClick),
2840
+ children: /* @__PURE__ */ jsxs(CardContent, {
1458
2841
  sx: compact ? {
1459
2842
  p: 1.25,
1460
2843
  "&:last-child": { pb: 1.25 }
1461
2844
  } : void 0,
1462
- children: columns.map((column) => {
1463
- const value = summaryCells[column.key];
1464
- if (value === void 0) return null;
1465
- return /* @__PURE__ */ jsxs(Box, {
2845
+ children: [
2846
+ selection && /* @__PURE__ */ jsx(Checkbox, {
2847
+ slotProps: { input: { "aria-label": labels.selectRow } },
2848
+ checked: selection.isSelected(id),
2849
+ onChange: () => selection.toggle(id)
2850
+ }),
2851
+ expand && /* @__PURE__ */ jsx(ExpandToggle, {
2852
+ id,
2853
+ expanded: expand.isExpanded(id),
2854
+ onToggle: expand.toggle,
2855
+ dir,
2856
+ expandLabel: labels.expandRow,
2857
+ collapseLabel: labels.collapseRow
2858
+ }),
2859
+ columns.map((column) => /* @__PURE__ */ jsxs(Box, {
1466
2860
  sx: { mb: compact ? .5 : 1 },
1467
2861
  children: [/* @__PURE__ */ jsx(Typography, {
1468
2862
  variant: "caption",
@@ -1472,18 +2866,129 @@ function MobileCards({ table, rows, rowActions, confirm, getRowId, size, dir, on
1472
2866
  }), /* @__PURE__ */ jsx(Typography, {
1473
2867
  component: "div",
1474
2868
  variant: "body2",
1475
- children: value
2869
+ children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
2870
+ row,
2871
+ rowIndex: index
2872
+ }) : column.accessor?.(row)
1476
2873
  })]
1477
- }, column.key);
1478
- })
2874
+ }, column.key)),
2875
+ rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx(RowActionButtons, {
2876
+ row,
2877
+ actions: rowActions,
2878
+ confirm,
2879
+ cancelLabel: labels.cancel
2880
+ }),
2881
+ expand?.isExpanded(id) && /* @__PURE__ */ jsx(Box, {
2882
+ sx: { mt: 1 },
2883
+ children: renderRowDetail(row)
2884
+ })
2885
+ ]
2886
+ })
2887
+ }, key);
2888
+ });
2889
+ $[0] = columns;
2890
+ $[1] = confirm;
2891
+ $[2] = dir;
2892
+ $[3] = expansion;
2893
+ $[4] = getRowId;
2894
+ $[5] = labels;
2895
+ $[6] = measureElement;
2896
+ $[7] = onRowClick;
2897
+ $[8] = paddingTop;
2898
+ $[9] = renderRowDetail;
2899
+ $[10] = rowActions;
2900
+ $[11] = rowClassName;
2901
+ $[12] = rowEntries;
2902
+ $[13] = rows;
2903
+ $[14] = selection;
2904
+ $[15] = size;
2905
+ $[16] = summaryRow;
2906
+ $[17] = table;
2907
+ $[18] = T0;
2908
+ $[19] = compact;
2909
+ $[20] = summaryCells;
2910
+ $[21] = t3;
2911
+ $[22] = t4;
2912
+ $[23] = t5;
2913
+ $[24] = t6;
2914
+ $[25] = t7;
2915
+ } else {
2916
+ T0 = $[18];
2917
+ compact = $[19];
2918
+ summaryCells = $[20];
2919
+ t3 = $[21];
2920
+ t4 = $[22];
2921
+ t5 = $[23];
2922
+ t6 = $[24];
2923
+ t7 = $[25];
2924
+ }
2925
+ let t8;
2926
+ if ($[33] !== columns || $[34] !== compact || $[35] !== summaryCells) {
2927
+ t8 = summaryCells && /* @__PURE__ */ jsx(Card, {
2928
+ variant: "outlined",
2929
+ role: "listitem",
2930
+ children: /* @__PURE__ */ jsx(CardContent, {
2931
+ sx: compact ? {
2932
+ p: 1.25,
2933
+ "&:last-child": { pb: 1.25 }
2934
+ } : void 0,
2935
+ children: columns.map((column_0) => {
2936
+ const value = summaryCells[column_0.key];
2937
+ if (value === void 0) return null;
2938
+ return /* @__PURE__ */ jsxs(Box, {
2939
+ sx: { mb: compact ? .5 : 1 },
2940
+ children: [/* @__PURE__ */ jsx(Typography, {
2941
+ variant: "caption",
2942
+ color: "text.secondary",
2943
+ sx: { display: "block" },
2944
+ children: mobileLabel(column_0)
2945
+ }), /* @__PURE__ */ jsx(Typography, {
2946
+ component: "div",
2947
+ variant: "body2",
2948
+ children: value
2949
+ })]
2950
+ }, column_0.key);
1479
2951
  })
1480
- }),
1481
- paddingBottom > 0 && /* @__PURE__ */ jsx(Box, {
1482
- "aria-hidden": true,
1483
- sx: { height: paddingBottom }
1484
2952
  })
1485
- ]
1486
- });
2953
+ });
2954
+ $[33] = columns;
2955
+ $[34] = compact;
2956
+ $[35] = summaryCells;
2957
+ $[36] = t8;
2958
+ } else t8 = $[36];
2959
+ let t9;
2960
+ if ($[37] !== paddingBottom) {
2961
+ t9 = paddingBottom > 0 && /* @__PURE__ */ jsx(Box, {
2962
+ "aria-hidden": true,
2963
+ sx: { height: paddingBottom }
2964
+ });
2965
+ $[37] = paddingBottom;
2966
+ $[38] = t9;
2967
+ } else t9 = $[38];
2968
+ let t10;
2969
+ if ($[39] !== T0 || $[40] !== t3 || $[41] !== t4 || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9) {
2970
+ t10 = /* @__PURE__ */ jsxs(T0, {
2971
+ spacing: t3,
2972
+ role: t4,
2973
+ "aria-label": t5,
2974
+ children: [
2975
+ t6,
2976
+ t7,
2977
+ t8,
2978
+ t9
2979
+ ]
2980
+ });
2981
+ $[39] = T0;
2982
+ $[40] = t3;
2983
+ $[41] = t4;
2984
+ $[42] = t5;
2985
+ $[43] = t6;
2986
+ $[44] = t7;
2987
+ $[45] = t8;
2988
+ $[46] = t9;
2989
+ $[47] = t10;
2990
+ } else t10 = $[47];
2991
+ return t10;
1487
2992
  }
1488
2993
  //#endregion
1489
2994
  //#region src/DataTable.tsx
@@ -1524,35 +3029,78 @@ function resolveActionsColumn(declared, layout) {
1524
3029
  * runtime's chip-label resolvers merge under any caller overrides.
1525
3030
  */
1526
3031
  function useChromeProps(props) {
1527
- const { source, runtime } = useTableData({
1528
- locale: props.locale,
1529
- source: props.source,
1530
- data: props.data,
1531
- total: props.total,
1532
- loading: props.loading,
1533
- onQueryChange: props.onQueryChange,
1534
- columns: props.columns,
1535
- filters: props.filters,
1536
- adapter: props.urlSync === false ? void 0 : props.urlAdapter,
1537
- enabled: props.urlSync,
1538
- urlKey: props.urlKey
1539
- });
3032
+ const $ = c(24);
3033
+ const t0 = props.urlSync === false ? void 0 : props.urlAdapter;
3034
+ let t1;
3035
+ 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) {
3036
+ t1 = {
3037
+ locale: props.locale,
3038
+ source: props.source,
3039
+ data: props.data,
3040
+ total: props.total,
3041
+ loading: props.loading,
3042
+ onQueryChange: props.onQueryChange,
3043
+ columns: props.columns,
3044
+ filters: props.filters,
3045
+ adapter: t0,
3046
+ enabled: props.urlSync,
3047
+ urlKey: props.urlKey
3048
+ };
3049
+ $[0] = props.columns;
3050
+ $[1] = props.data;
3051
+ $[2] = props.filters;
3052
+ $[3] = props.loading;
3053
+ $[4] = props.locale;
3054
+ $[5] = props.onQueryChange;
3055
+ $[6] = props.source;
3056
+ $[7] = props.total;
3057
+ $[8] = props.urlKey;
3058
+ $[9] = props.urlSync;
3059
+ $[10] = t0;
3060
+ $[11] = t1;
3061
+ } else t1 = $[11];
3062
+ const { source, runtime } = useTableData(t1);
1540
3063
  let filtersNode;
1541
- if (isDeclarativeFilters(props.filters) || props.filters === void 0) filtersNode = runtime.defs.length > 0 ? /* @__PURE__ */ jsx(AutoFilterForm, {
1542
- defs: runtime.defs,
1543
- source,
1544
- labels: resolveLabels(props.labels)
1545
- }) : void 0;
1546
- else filtersNode = props.filters;
1547
- return {
1548
- ...props,
1549
- source,
1550
- filters: filtersNode,
1551
- filterLabels: {
3064
+ if (isDeclarativeFilters(props.filters) || props.filters === void 0) {
3065
+ let t2;
3066
+ if ($[12] !== props.labels || $[13] !== runtime.defs || $[14] !== source) {
3067
+ t2 = runtime.defs.length > 0 ? /* @__PURE__ */ jsx(AutoFilterForm, {
3068
+ defs: runtime.defs,
3069
+ source,
3070
+ labels: resolveLabels(props.labels)
3071
+ }) : void 0;
3072
+ $[12] = props.labels;
3073
+ $[13] = runtime.defs;
3074
+ $[14] = source;
3075
+ $[15] = t2;
3076
+ } else t2 = $[15];
3077
+ filtersNode = t2;
3078
+ } else filtersNode = props.filters;
3079
+ let t2;
3080
+ if ($[16] !== props.filterLabels || $[17] !== runtime.filterLabels) {
3081
+ t2 = {
1552
3082
  ...runtime.filterLabels,
1553
3083
  ...props.filterLabels
1554
- }
1555
- };
3084
+ };
3085
+ $[16] = props.filterLabels;
3086
+ $[17] = runtime.filterLabels;
3087
+ $[18] = t2;
3088
+ } else t2 = $[18];
3089
+ let t3;
3090
+ if ($[19] !== filtersNode || $[20] !== props || $[21] !== source || $[22] !== t2) {
3091
+ t3 = {
3092
+ ...props,
3093
+ source,
3094
+ filters: filtersNode,
3095
+ filterLabels: t2
3096
+ };
3097
+ $[19] = filtersNode;
3098
+ $[20] = props;
3099
+ $[21] = source;
3100
+ $[22] = t2;
3101
+ $[23] = t3;
3102
+ } else t3 = $[23];
3103
+ return t3;
1556
3104
  }
1557
3105
  /**
1558
3106
  * Batteries-included Material UI data table. Drop in `columns`, `data` (or
@@ -1565,185 +3113,454 @@ function useChromeProps(props) {
1565
3113
  * @typeParam TRow - The row type.
1566
3114
  */
1567
3115
  function DataTable(props) {
3116
+ const $ = c(150);
1568
3117
  const { slots, className } = props;
1569
- const size = tableSize(props.size, props.density);
1570
- const { filtersMode = "popover" } = props;
3118
+ let t0;
3119
+ if ($[0] !== props.density || $[1] !== props.size) {
3120
+ t0 = tableSize(props.size, props.density);
3121
+ $[0] = props.density;
3122
+ $[1] = props.size;
3123
+ $[2] = t0;
3124
+ } else t0 = $[2];
3125
+ const size = t0;
3126
+ const { filtersMode: t1 } = props;
3127
+ const filtersMode = t1 === void 0 ? "popover" : t1;
1571
3128
  const chromeProps = useChromeProps(props);
1572
3129
  const { source, filters: filtersNode } = chromeProps;
1573
- const c = useTableChrome(chromeProps);
1574
- const { table, confirm, getRowId } = c;
3130
+ const c$1 = useTableChrome(chromeProps);
3131
+ const { table, confirm, getRowId } = c$1;
1575
3132
  const { labels } = table;
1576
3133
  const [filtersOpen, setFiltersOpen] = useState(false);
1577
3134
  const filtersTrigger = useFilterTriggerToggle(filtersOpen, setFiltersOpen);
1578
3135
  const rootRef = useRef(null);
1579
- useChromeScrollReset(rootRef, c, chromeProps);
1580
- const { virtualization, loadMoreRef, canLoadMore, virtualScrollRef } = useChromeBodyData(c, chromeProps);
1581
- const { hasRowActions, rowActions, actionsPinned } = resolveActionsColumn(props.rowActions, c.columnLayout);
1582
- const columnMenu = props.enableColumnMenu && !c.isMobile && /* @__PURE__ */ jsx(ColumnMenu, {
1583
- allColumns: c.allColumns,
1584
- layout: c.columnLayout,
1585
- labels,
1586
- hasRowActions
1587
- });
1588
- const savedViewsMenu = props.savedViews && /* @__PURE__ */ jsx(SavedViewsMenu, {
1589
- options: {
1590
- adapter: props.urlAdapter,
1591
- urlKey: props.urlKey,
1592
- ...props.savedViews
1593
- },
1594
- labels
1595
- });
3136
+ useChromeScrollReset(rootRef, c$1, chromeProps);
3137
+ const { virtualization, loadMoreRef, canLoadMore, virtualScrollRef } = useChromeBodyData(c$1, chromeProps);
3138
+ let t2;
3139
+ if ($[3] !== c$1.columnLayout || $[4] !== props.rowActions) {
3140
+ t2 = resolveActionsColumn(props.rowActions, c$1.columnLayout);
3141
+ $[3] = c$1.columnLayout;
3142
+ $[4] = props.rowActions;
3143
+ $[5] = t2;
3144
+ } else t2 = $[5];
3145
+ const { hasRowActions, rowActions, actionsPinned } = t2;
3146
+ let t3;
3147
+ if ($[6] !== c$1.allColumns || $[7] !== c$1.columnLayout || $[8] !== c$1.isMobile || $[9] !== hasRowActions || $[10] !== labels || $[11] !== props.enableColumnMenu) {
3148
+ t3 = props.enableColumnMenu && !c$1.isMobile && /* @__PURE__ */ jsx(ColumnMenu, {
3149
+ allColumns: c$1.allColumns,
3150
+ layout: c$1.columnLayout,
3151
+ labels,
3152
+ hasRowActions
3153
+ });
3154
+ $[6] = c$1.allColumns;
3155
+ $[7] = c$1.columnLayout;
3156
+ $[8] = c$1.isMobile;
3157
+ $[9] = hasRowActions;
3158
+ $[10] = labels;
3159
+ $[11] = props.enableColumnMenu;
3160
+ $[12] = t3;
3161
+ } else t3 = $[12];
3162
+ const columnMenu = t3;
3163
+ let t4;
3164
+ if ($[13] !== labels || $[14] !== props.savedViews || $[15] !== props.urlAdapter || $[16] !== props.urlKey) {
3165
+ t4 = props.savedViews && /* @__PURE__ */ jsx(SavedViewsMenu, {
3166
+ options: {
3167
+ adapter: props.urlAdapter,
3168
+ urlKey: props.urlKey,
3169
+ ...props.savedViews
3170
+ },
3171
+ labels
3172
+ });
3173
+ $[13] = labels;
3174
+ $[14] = props.savedViews;
3175
+ $[15] = props.urlAdapter;
3176
+ $[16] = props.urlKey;
3177
+ $[17] = t4;
3178
+ } else t4 = $[17];
3179
+ const savedViewsMenu = t4;
1596
3180
  let body;
1597
- if (c.body === "skeleton") body = slots?.skeleton ?? /* @__PURE__ */ jsx(LoadingState, {
1598
- rows: props.skeletonRows ?? source.limit,
1599
- columns: table.columns.length,
1600
- loadingLabel: labels.loading
1601
- });
1602
- else if (c.body === "empty") body = slots?.empty ?? /* @__PURE__ */ jsxs(Stack, {
1603
- role: "status",
1604
- spacing: 1.5,
1605
- sx: {
1606
- py: 6,
1607
- alignItems: "center"
1608
- },
1609
- children: [/* @__PURE__ */ jsx(Typography, {
1610
- color: "text.secondary",
1611
- align: "center",
1612
- children: c.emptyVariant === "noResults" ? labels.noResults : labels.noData
1613
- }), c.emptyVariant === "noResults" && /* @__PURE__ */ jsx(Button, {
1614
- variant: "outlined",
1615
- size: "small",
1616
- onClick: c.clearFilters,
1617
- children: labels.clearAll
1618
- })]
1619
- });
1620
- else if (c.body === "mobile") body = /* @__PURE__ */ jsx(MobileCards, {
1621
- table,
1622
- rows: source.rows,
1623
- rowActions,
1624
- confirm,
1625
- getRowId,
1626
- size,
1627
- dir: props.dir,
1628
- onRowClick: props.onRowClick,
1629
- rowClassName: props.rowClassName,
1630
- renderRowDetail: props.renderRowDetail,
1631
- summaryRow: props.summaryRow,
1632
- expansion: c.detail?.expansion,
1633
- rowEntries: virtualization.enabled ? virtualization.rows : void 0,
1634
- paddingTop: virtualization.paddingTop,
1635
- paddingBottom: virtualization.paddingBottom,
1636
- measureElement: virtualization.measureElement
1637
- });
1638
- else body = /* @__PURE__ */ jsx(DesktopTable, {
1639
- table,
1640
- rows: source.rows,
1641
- rowActions,
1642
- actionsPinned,
1643
- confirm,
1644
- getRowId,
1645
- size,
1646
- dir: props.dir,
1647
- prefetch: props.prefetch,
1648
- onRowClick: props.onRowClick,
1649
- rowClassName: props.rowClassName,
1650
- renderRowDetail: props.renderRowDetail,
1651
- summaryRow: props.summaryRow,
1652
- expansion: c.detail?.expansion,
1653
- rowEntries: virtualization.enabled ? virtualization.rows : void 0,
1654
- paddingTop: virtualization.paddingTop,
1655
- paddingBottom: virtualization.paddingBottom,
1656
- measureElement: virtualization.measureElement,
1657
- stickyHeader: props.stickyHeader,
1658
- stickyTop: props.stickyTop,
1659
- pinOffset: c.columnLayout.pinOffset,
1660
- maxHeight: props.maxHeight,
1661
- virtualScrollRef,
1662
- setWidth: resizeSetter(props.resizableColumns, c.columnLayout.setWidth),
1663
- columnWidths: c.columnLayout.state.widths,
1664
- resizeLabel: labels.resizeColumn
1665
- });
1666
- return /* @__PURE__ */ jsxs(Paper, {
1667
- ref: rootRef,
1668
- variant: "outlined",
1669
- dir: props.dir,
1670
- className,
1671
- "aria-busy": c.isRefreshing || void 0,
1672
- sx: { p: 1.5 },
1673
- children: [/* @__PURE__ */ jsxs(Stack, {
3181
+ if (c$1.body === "skeleton") {
3182
+ let t5;
3183
+ if ($[18] !== labels || $[19] !== props.skeletonRows || $[20] !== slots?.skeleton || $[21] !== source.limit || $[22] !== table.columns) {
3184
+ t5 = slots?.skeleton ?? /* @__PURE__ */ jsx(LoadingState, {
3185
+ rows: props.skeletonRows ?? source.limit,
3186
+ columns: table.columns.length,
3187
+ loadingLabel: labels.loading
3188
+ });
3189
+ $[18] = labels;
3190
+ $[19] = props.skeletonRows;
3191
+ $[20] = slots?.skeleton;
3192
+ $[21] = source.limit;
3193
+ $[22] = table.columns;
3194
+ $[23] = t5;
3195
+ } else t5 = $[23];
3196
+ body = t5;
3197
+ } else if (c$1.body === "empty") {
3198
+ let t5;
3199
+ if ($[24] !== c$1.clearFilters || $[25] !== c$1.emptyVariant || $[26] !== labels || $[27] !== slots?.empty) {
3200
+ t5 = slots?.empty ?? /* @__PURE__ */ jsxs(Stack, {
3201
+ role: "status",
3202
+ spacing: 1.5,
3203
+ sx: {
3204
+ py: 6,
3205
+ alignItems: "center"
3206
+ },
3207
+ children: [/* @__PURE__ */ jsx(Typography, {
3208
+ color: "text.secondary",
3209
+ align: "center",
3210
+ children: c$1.emptyVariant === "noResults" ? labels.noResults : labels.noData
3211
+ }), c$1.emptyVariant === "noResults" && /* @__PURE__ */ jsx(Button, {
3212
+ variant: "outlined",
3213
+ size: "small",
3214
+ onClick: c$1.clearFilters,
3215
+ children: labels.clearAll
3216
+ })]
3217
+ });
3218
+ $[24] = c$1.clearFilters;
3219
+ $[25] = c$1.emptyVariant;
3220
+ $[26] = labels;
3221
+ $[27] = slots?.empty;
3222
+ $[28] = t5;
3223
+ } else t5 = $[28];
3224
+ body = t5;
3225
+ } else if (c$1.body === "mobile") {
3226
+ const t5 = c$1.detail?.expansion;
3227
+ const t6 = virtualization.enabled ? virtualization.rows : void 0;
3228
+ let t7;
3229
+ if ($[29] !== confirm || $[30] !== getRowId || $[31] !== props.dir || $[32] !== props.onRowClick || $[33] !== props.renderRowDetail || $[34] !== props.rowClassName || $[35] !== props.summaryRow || $[36] !== rowActions || $[37] !== size || $[38] !== source.rows || $[39] !== t5 || $[40] !== t6 || $[41] !== table || $[42] !== virtualization.measureElement || $[43] !== virtualization.paddingBottom || $[44] !== virtualization.paddingTop) {
3230
+ t7 = /* @__PURE__ */ jsx(MobileCards, {
3231
+ table,
3232
+ rows: source.rows,
3233
+ rowActions,
3234
+ confirm,
3235
+ getRowId,
3236
+ size,
3237
+ dir: props.dir,
3238
+ onRowClick: props.onRowClick,
3239
+ rowClassName: props.rowClassName,
3240
+ renderRowDetail: props.renderRowDetail,
3241
+ summaryRow: props.summaryRow,
3242
+ expansion: t5,
3243
+ rowEntries: t6,
3244
+ paddingTop: virtualization.paddingTop,
3245
+ paddingBottom: virtualization.paddingBottom,
3246
+ measureElement: virtualization.measureElement
3247
+ });
3248
+ $[29] = confirm;
3249
+ $[30] = getRowId;
3250
+ $[31] = props.dir;
3251
+ $[32] = props.onRowClick;
3252
+ $[33] = props.renderRowDetail;
3253
+ $[34] = props.rowClassName;
3254
+ $[35] = props.summaryRow;
3255
+ $[36] = rowActions;
3256
+ $[37] = size;
3257
+ $[38] = source.rows;
3258
+ $[39] = t5;
3259
+ $[40] = t6;
3260
+ $[41] = table;
3261
+ $[42] = virtualization.measureElement;
3262
+ $[43] = virtualization.paddingBottom;
3263
+ $[44] = virtualization.paddingTop;
3264
+ $[45] = t7;
3265
+ } else t7 = $[45];
3266
+ body = t7;
3267
+ } else {
3268
+ const t5 = source.rows;
3269
+ const t6 = props.dir;
3270
+ const t7 = props.prefetch;
3271
+ const t8 = props.onRowClick;
3272
+ const t9 = props.rowClassName;
3273
+ const t10 = props.renderRowDetail;
3274
+ const t11 = props.summaryRow;
3275
+ const t12 = c$1.detail?.expansion;
3276
+ const t13 = virtualization.enabled ? virtualization.rows : void 0;
3277
+ const t14 = virtualization.paddingTop;
3278
+ const t15 = virtualization.paddingBottom;
3279
+ const t16 = virtualization.measureElement;
3280
+ const t17 = props.stickyHeader;
3281
+ const t18 = props.stickyTop;
3282
+ const t19 = c$1.columnLayout.pinOffset;
3283
+ const t20 = props.maxHeight;
3284
+ let t21;
3285
+ if ($[46] !== c$1.columnLayout.setWidth || $[47] !== props.resizableColumns) {
3286
+ t21 = resizeSetter(props.resizableColumns, c$1.columnLayout.setWidth);
3287
+ $[46] = c$1.columnLayout.setWidth;
3288
+ $[47] = props.resizableColumns;
3289
+ $[48] = t21;
3290
+ } else t21 = $[48];
3291
+ let t22;
3292
+ if ($[49] !== actionsPinned || $[50] !== c$1.columnLayout.pinOffset || $[51] !== c$1.columnLayout.state.widths || $[52] !== confirm || $[53] !== getRowId || $[54] !== labels.resizeColumn || $[55] !== props.dir || $[56] !== props.maxHeight || $[57] !== props.onRowClick || $[58] !== props.prefetch || $[59] !== props.renderRowDetail || $[60] !== props.rowClassName || $[61] !== props.stickyHeader || $[62] !== props.stickyTop || $[63] !== props.summaryRow || $[64] !== rowActions || $[65] !== size || $[66] !== source.rows || $[67] !== t12 || $[68] !== t13 || $[69] !== t21 || $[70] !== table || $[71] !== virtualScrollRef || $[72] !== virtualization.measureElement || $[73] !== virtualization.paddingBottom || $[74] !== virtualization.paddingTop) {
3293
+ t22 = /* @__PURE__ */ jsx(DesktopTable, {
3294
+ table,
3295
+ rows: t5,
3296
+ rowActions,
3297
+ actionsPinned,
3298
+ confirm,
3299
+ getRowId,
3300
+ size,
3301
+ dir: t6,
3302
+ prefetch: t7,
3303
+ onRowClick: t8,
3304
+ rowClassName: t9,
3305
+ renderRowDetail: t10,
3306
+ summaryRow: t11,
3307
+ expansion: t12,
3308
+ rowEntries: t13,
3309
+ paddingTop: t14,
3310
+ paddingBottom: t15,
3311
+ measureElement: t16,
3312
+ stickyHeader: t17,
3313
+ stickyTop: t18,
3314
+ pinOffset: t19,
3315
+ maxHeight: t20,
3316
+ virtualScrollRef,
3317
+ setWidth: t21,
3318
+ columnWidths: c$1.columnLayout.state.widths,
3319
+ resizeLabel: labels.resizeColumn
3320
+ });
3321
+ $[49] = actionsPinned;
3322
+ $[50] = c$1.columnLayout.pinOffset;
3323
+ $[51] = c$1.columnLayout.state.widths;
3324
+ $[52] = confirm;
3325
+ $[53] = getRowId;
3326
+ $[54] = labels.resizeColumn;
3327
+ $[55] = props.dir;
3328
+ $[56] = props.maxHeight;
3329
+ $[57] = props.onRowClick;
3330
+ $[58] = props.prefetch;
3331
+ $[59] = props.renderRowDetail;
3332
+ $[60] = props.rowClassName;
3333
+ $[61] = props.stickyHeader;
3334
+ $[62] = props.stickyTop;
3335
+ $[63] = props.summaryRow;
3336
+ $[64] = rowActions;
3337
+ $[65] = size;
3338
+ $[66] = source.rows;
3339
+ $[67] = t12;
3340
+ $[68] = t13;
3341
+ $[69] = t21;
3342
+ $[70] = table;
3343
+ $[71] = virtualScrollRef;
3344
+ $[72] = virtualization.measureElement;
3345
+ $[73] = virtualization.paddingBottom;
3346
+ $[74] = virtualization.paddingTop;
3347
+ $[75] = t22;
3348
+ } else t22 = $[75];
3349
+ body = t22;
3350
+ }
3351
+ const t5 = props.dir;
3352
+ const t6 = c$1.isRefreshing || void 0;
3353
+ let t7;
3354
+ if ($[76] === Symbol.for("react.memo_cache_sentinel")) {
3355
+ t7 = { p: 1.5 };
3356
+ $[76] = t7;
3357
+ } else t7 = $[76];
3358
+ const t8 = props.hideSearch;
3359
+ const t9 = props.searchPlaceholder;
3360
+ const t10 = props.sortByOptions;
3361
+ let t11;
3362
+ if ($[77] !== props.toolbar || $[78] !== savedViewsMenu) {
3363
+ t11 = /* @__PURE__ */ jsxs(Fragment, { children: [savedViewsMenu, props.toolbar] });
3364
+ $[77] = props.toolbar;
3365
+ $[78] = savedViewsMenu;
3366
+ $[79] = t11;
3367
+ } else t11 = $[79];
3368
+ const t12 = Boolean(filtersNode);
3369
+ let t13;
3370
+ if ($[80] === Symbol.for("react.memo_cache_sentinel")) {
3371
+ t13 = () => setFiltersOpen(false);
3372
+ $[80] = t13;
3373
+ } else t13 = $[80];
3374
+ let t14;
3375
+ if ($[81] !== c$1.activeFilterCount || $[82] !== c$1.clearFilters || $[83] !== canLoadMore || $[84] !== columnMenu || $[85] !== filtersMode || $[86] !== filtersNode || $[87] !== filtersOpen || $[88] !== filtersTrigger.onClick || $[89] !== filtersTrigger.onPointerDown || $[90] !== props.dir || $[91] !== props.hideSearch || $[92] !== props.searchPlaceholder || $[93] !== props.sortByOptions || $[94] !== t11 || $[95] !== t12 || $[96] !== table) {
3376
+ t14 = /* @__PURE__ */ jsx(Toolbar, {
3377
+ table,
3378
+ hideSearch: t8,
3379
+ searchPlaceholder: t9,
3380
+ sortByOptions: t10,
3381
+ customToolbar: t11,
3382
+ hasFilters: t12,
3383
+ activeFilterCount: c$1.activeFilterCount,
3384
+ showRowsPerPage: canLoadMore,
3385
+ filtersMode,
3386
+ filters: filtersNode,
3387
+ filtersOpen,
3388
+ onToggleFilters: filtersTrigger.onClick,
3389
+ onFiltersTriggerPointerDown: filtersTrigger.onPointerDown,
3390
+ onCloseFilters: t13,
3391
+ onClearFilters: c$1.clearFilters,
3392
+ dir: props.dir,
3393
+ columnMenu
3394
+ });
3395
+ $[81] = c$1.activeFilterCount;
3396
+ $[82] = c$1.clearFilters;
3397
+ $[83] = canLoadMore;
3398
+ $[84] = columnMenu;
3399
+ $[85] = filtersMode;
3400
+ $[86] = filtersNode;
3401
+ $[87] = filtersOpen;
3402
+ $[88] = filtersTrigger.onClick;
3403
+ $[89] = filtersTrigger.onPointerDown;
3404
+ $[90] = props.dir;
3405
+ $[91] = props.hideSearch;
3406
+ $[92] = props.searchPlaceholder;
3407
+ $[93] = props.sortByOptions;
3408
+ $[94] = t11;
3409
+ $[95] = t12;
3410
+ $[96] = table;
3411
+ $[97] = t14;
3412
+ } else t14 = $[97];
3413
+ let t15;
3414
+ if ($[98] !== c$1.isRefreshing || $[99] !== labels) {
3415
+ t15 = c$1.isRefreshing && /* @__PURE__ */ jsx(LinearProgress, { "aria-label": labels.loading });
3416
+ $[98] = c$1.isRefreshing;
3417
+ $[99] = labels;
3418
+ $[100] = t15;
3419
+ } else t15 = $[100];
3420
+ let t16;
3421
+ if ($[101] !== c$1.clearFilters || $[102] !== c$1.mergedChips || $[103] !== labels) {
3422
+ t16 = /* @__PURE__ */ jsx(Chips, {
3423
+ chips: c$1.mergedChips,
3424
+ onClearAll: c$1.clearFilters,
3425
+ labels
3426
+ });
3427
+ $[101] = c$1.clearFilters;
3428
+ $[102] = c$1.mergedChips;
3429
+ $[103] = labels;
3430
+ $[104] = t16;
3431
+ } else t16 = $[104];
3432
+ let t17;
3433
+ if ($[105] !== confirm || $[106] !== labels || $[107] !== props.bulkActions || $[108] !== source.total || $[109] !== table.selection) {
3434
+ t17 = table.selection && props.bulkActions && /* @__PURE__ */ jsx(BulkBar, {
3435
+ selection: table.selection,
3436
+ total: source.total,
3437
+ bulkActions: props.bulkActions,
3438
+ confirm,
3439
+ labels
3440
+ });
3441
+ $[105] = confirm;
3442
+ $[106] = labels;
3443
+ $[107] = props.bulkActions;
3444
+ $[108] = source.total;
3445
+ $[109] = table.selection;
3446
+ $[110] = t17;
3447
+ } else t17 = $[110];
3448
+ let t18;
3449
+ if ($[111] !== body || $[112] !== labels || $[113] !== source) {
3450
+ t18 = source.error ? /* @__PURE__ */ jsx(ErrorState, {
3451
+ error: source.error,
3452
+ labels,
3453
+ onRetry: source.refetch ? () => void source.refetch?.() : void 0
3454
+ }) : body;
3455
+ $[111] = body;
3456
+ $[112] = labels;
3457
+ $[113] = source;
3458
+ $[114] = t18;
3459
+ } else t18 = $[114];
3460
+ let t19;
3461
+ if ($[115] !== canLoadMore || $[116] !== labels || $[117] !== loadMoreRef || $[118] !== source) {
3462
+ t19 = canLoadMore && source.hasNextPage && /* @__PURE__ */ jsx(Box, {
3463
+ ref: loadMoreRef,
3464
+ sx: {
3465
+ display: "flex",
3466
+ justifyContent: "center",
3467
+ py: 1
3468
+ },
3469
+ children: /* @__PURE__ */ jsx(Button, {
3470
+ variant: "outlined",
3471
+ size: "small",
3472
+ disabled: source.isFetchingNextPage,
3473
+ onClick: () => source.fetchNextPage(),
3474
+ children: labels.loadMore
3475
+ })
3476
+ });
3477
+ $[115] = canLoadMore;
3478
+ $[116] = labels;
3479
+ $[117] = loadMoreRef;
3480
+ $[118] = source;
3481
+ $[119] = t19;
3482
+ } else t19 = $[119];
3483
+ let t20;
3484
+ if ($[120] !== c$1.showFooter || $[121] !== labels || $[122] !== source.limit || $[123] !== source.setLimit || $[124] !== source.setPage || $[125] !== source.total || $[126] !== table.pagination) {
3485
+ t20 = c$1.showFooter && /* @__PURE__ */ jsx(Footer, {
3486
+ pagination: table.pagination,
3487
+ total: source.total,
3488
+ limit: source.limit,
3489
+ setPage: source.setPage,
3490
+ setLimit: source.setLimit,
3491
+ labels
3492
+ });
3493
+ $[120] = c$1.showFooter;
3494
+ $[121] = labels;
3495
+ $[122] = source.limit;
3496
+ $[123] = source.setLimit;
3497
+ $[124] = source.setPage;
3498
+ $[125] = source.total;
3499
+ $[126] = table.pagination;
3500
+ $[127] = t20;
3501
+ } else t20 = $[127];
3502
+ let t21;
3503
+ if ($[128] !== t14 || $[129] !== t15 || $[130] !== t16 || $[131] !== t17 || $[132] !== t18 || $[133] !== t19 || $[134] !== t20) {
3504
+ t21 = /* @__PURE__ */ jsxs(Stack, {
1674
3505
  spacing: 1.5,
1675
3506
  children: [
1676
- /* @__PURE__ */ jsx(Toolbar, {
1677
- table,
1678
- hideSearch: props.hideSearch,
1679
- searchPlaceholder: props.searchPlaceholder,
1680
- sortByOptions: props.sortByOptions,
1681
- customToolbar: /* @__PURE__ */ jsxs(Fragment, { children: [savedViewsMenu, props.toolbar] }),
1682
- hasFilters: Boolean(filtersNode),
1683
- activeFilterCount: c.activeFilterCount,
1684
- showRowsPerPage: canLoadMore,
1685
- filtersMode,
1686
- filters: filtersNode,
1687
- filtersOpen,
1688
- onToggleFilters: filtersTrigger.onClick,
1689
- onFiltersTriggerPointerDown: filtersTrigger.onPointerDown,
1690
- onCloseFilters: () => setFiltersOpen(false),
1691
- onClearFilters: c.clearFilters,
1692
- dir: props.dir,
1693
- columnMenu
1694
- }),
1695
- c.isRefreshing && /* @__PURE__ */ jsx(LinearProgress, { "aria-label": labels.loading }),
1696
- /* @__PURE__ */ jsx(Chips, {
1697
- chips: c.mergedChips,
1698
- onClearAll: c.clearFilters,
1699
- labels
1700
- }),
1701
- table.selection && props.bulkActions && /* @__PURE__ */ jsx(BulkBar, {
1702
- selection: table.selection,
1703
- total: source.total,
1704
- bulkActions: props.bulkActions,
1705
- confirm,
1706
- labels
1707
- }),
1708
- source.error ? /* @__PURE__ */ jsx(ErrorState, {
1709
- error: source.error,
1710
- labels,
1711
- onRetry: source.refetch ? () => void source.refetch?.() : void 0
1712
- }) : body,
1713
- canLoadMore && source.hasNextPage && /* @__PURE__ */ jsx(Box, {
1714
- ref: loadMoreRef,
1715
- sx: {
1716
- display: "flex",
1717
- justifyContent: "center",
1718
- py: 1
1719
- },
1720
- children: /* @__PURE__ */ jsx(Button, {
1721
- variant: "outlined",
1722
- size: "small",
1723
- disabled: source.isFetchingNextPage,
1724
- onClick: () => source.fetchNextPage(),
1725
- children: labels.loadMore
1726
- })
1727
- }),
1728
- c.showFooter && /* @__PURE__ */ jsx(Footer, {
1729
- pagination: table.pagination,
1730
- total: source.total,
1731
- limit: source.limit,
1732
- setPage: source.setPage,
1733
- setLimit: source.setLimit,
1734
- labels
1735
- })
3507
+ t14,
3508
+ t15,
3509
+ t16,
3510
+ t17,
3511
+ t18,
3512
+ t19,
3513
+ t20
1736
3514
  ]
1737
- }), filtersNode && filtersMode === "drawer" && /* @__PURE__ */ jsx(FilterDrawer, {
3515
+ });
3516
+ $[128] = t14;
3517
+ $[129] = t15;
3518
+ $[130] = t16;
3519
+ $[131] = t17;
3520
+ $[132] = t18;
3521
+ $[133] = t19;
3522
+ $[134] = t20;
3523
+ $[135] = t21;
3524
+ } else t21 = $[135];
3525
+ let t22;
3526
+ if ($[136] !== c$1.activeFilterCount || $[137] !== c$1.clearFilters || $[138] !== filtersMode || $[139] !== filtersNode || $[140] !== filtersOpen || $[141] !== labels || $[142] !== props.dir) {
3527
+ t22 = filtersNode && filtersMode === "drawer" && /* @__PURE__ */ jsx(FilterDrawer, {
1738
3528
  open: filtersOpen,
1739
3529
  onClose: () => setFiltersOpen(false),
1740
3530
  filters: filtersNode,
1741
- activeFilterCount: c.activeFilterCount,
1742
- onClearFilters: c.clearFilters,
3531
+ activeFilterCount: c$1.activeFilterCount,
3532
+ onClearFilters: c$1.clearFilters,
1743
3533
  labels,
1744
3534
  dir: props.dir
1745
- })]
1746
- });
3535
+ });
3536
+ $[136] = c$1.activeFilterCount;
3537
+ $[137] = c$1.clearFilters;
3538
+ $[138] = filtersMode;
3539
+ $[139] = filtersNode;
3540
+ $[140] = filtersOpen;
3541
+ $[141] = labels;
3542
+ $[142] = props.dir;
3543
+ $[143] = t22;
3544
+ } else t22 = $[143];
3545
+ let t23;
3546
+ if ($[144] !== className || $[145] !== props.dir || $[146] !== t21 || $[147] !== t22 || $[148] !== t6) {
3547
+ t23 = /* @__PURE__ */ jsxs(Paper, {
3548
+ ref: rootRef,
3549
+ variant: "outlined",
3550
+ dir: t5,
3551
+ className,
3552
+ "aria-busy": t6,
3553
+ sx: t7,
3554
+ children: [t21, t22]
3555
+ });
3556
+ $[144] = className;
3557
+ $[145] = props.dir;
3558
+ $[146] = t21;
3559
+ $[147] = t22;
3560
+ $[148] = t6;
3561
+ $[149] = t23;
3562
+ } else t23 = $[149];
3563
+ return t23;
1747
3564
  }
1748
3565
  //#endregion
1749
3566
  export { DataTable, SavedViewsMenu, createHistoryAdapter, createMemoryAdapter, defaultConfirm, defaultLabels, deriveSortByOptions, getHistoryAdapter, useBackendData, useDataTable, useFrontendData, useSavedViews, useTableUrlState };