@adapttable/mui 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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,590 @@ 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(29);
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] !== labels.filters) {
1618
+ t3 = { paper: { "aria-label": labels.filters } };
1619
+ $[0] = labels.filters;
1620
+ $[1] = t3;
1621
+ } else t3 = $[1];
1622
+ let t4;
1623
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1624
+ t4 = {
1625
+ width: 360,
1626
+ p: 2,
1627
+ display: "flex",
1628
+ flexDirection: "column",
1629
+ gap: 2,
1630
+ height: "100%"
1631
+ };
1632
+ $[2] = t4;
1633
+ } else t4 = $[2];
1634
+ let t5;
1635
+ if ($[3] !== labels.filters) {
1636
+ t5 = /* @__PURE__ */ jsx(Typography, {
1637
+ variant: "h6",
1638
+ children: labels.filters
1639
+ });
1640
+ $[3] = labels.filters;
1641
+ $[4] = t5;
1642
+ } else t5 = $[4];
1643
+ let t6;
1644
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
1645
+ t6 = {
1646
+ flex: 1,
1647
+ display: "flex",
1648
+ flexDirection: "column",
1649
+ gap: 2
1650
+ };
1651
+ $[5] = t6;
1652
+ } else t6 = $[5];
1653
+ let t7;
1654
+ if ($[6] !== filters) {
1655
+ t7 = /* @__PURE__ */ jsx(Box, {
1656
+ sx: t6,
1657
+ children: filters
1658
+ });
1659
+ $[6] = filters;
1660
+ $[7] = t7;
1661
+ } else t7 = $[7];
1662
+ let t8;
1663
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
1664
+ t8 = { justifyContent: "space-between" };
1665
+ $[8] = t8;
1666
+ } else t8 = $[8];
1667
+ const t9 = activeFilterCount === 0;
1668
+ let t10;
1669
+ if ($[9] !== labels.clearAll || $[10] !== onClearFilters || $[11] !== t9) {
1670
+ t10 = /* @__PURE__ */ jsx(Button, {
1671
+ onClick: onClearFilters,
1672
+ disabled: t9,
1673
+ children: labels.clearAll
1674
+ });
1675
+ $[9] = labels.clearAll;
1676
+ $[10] = onClearFilters;
1677
+ $[11] = t9;
1678
+ $[12] = t10;
1679
+ } else t10 = $[12];
1680
+ let t11;
1681
+ if ($[13] !== labels.applyFilters || $[14] !== onClose) {
1682
+ t11 = /* @__PURE__ */ jsx(Button, {
1683
+ variant: "contained",
1684
+ onClick: onClose,
1685
+ children: labels.applyFilters
1686
+ });
1687
+ $[13] = labels.applyFilters;
1688
+ $[14] = onClose;
1689
+ $[15] = t11;
1690
+ } else t11 = $[15];
1691
+ let t12;
1692
+ if ($[16] !== t10 || $[17] !== t11) {
1693
+ t12 = /* @__PURE__ */ jsxs(Stack, {
1694
+ direction: "row",
1695
+ sx: t8,
1696
+ children: [t10, t11]
1697
+ });
1698
+ $[16] = t10;
1699
+ $[17] = t11;
1700
+ $[18] = t12;
1701
+ } else t12 = $[18];
1702
+ let t13;
1703
+ if ($[19] !== t12 || $[20] !== t5 || $[21] !== t7) {
1704
+ t13 = /* @__PURE__ */ jsxs(Box, {
1705
+ sx: t4,
710
1706
  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
- })
1707
+ t5,
1708
+ t7,
1709
+ t12
737
1710
  ]
738
- })
739
- });
1711
+ });
1712
+ $[19] = t12;
1713
+ $[20] = t5;
1714
+ $[21] = t7;
1715
+ $[22] = t13;
1716
+ } else t13 = $[22];
1717
+ let t14;
1718
+ if ($[23] !== onClose || $[24] !== open || $[25] !== t13 || $[26] !== t2 || $[27] !== t3) {
1719
+ t14 = /* @__PURE__ */ jsx(Drawer, {
1720
+ anchor: t2,
1721
+ open,
1722
+ onClose,
1723
+ slotProps: t3,
1724
+ children: t13
1725
+ });
1726
+ $[23] = onClose;
1727
+ $[24] = open;
1728
+ $[25] = t13;
1729
+ $[26] = t2;
1730
+ $[27] = t3;
1731
+ $[28] = t14;
1732
+ } else t14 = $[28];
1733
+ return t14;
740
1734
  }
741
1735
  //#endregion
742
1736
  //#region src/components/ColumnMenu.tsx
1737
+ /** Props for the column menu — the shared core contract + actions wiring. */
1738
+ /** Labels the visibility toggle and the row name share. */
743
1739
  /** 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
- });
1740
+ function VisibilityToggle(t0) {
1741
+ const $ = c(8);
1742
+ const { hidden, name, labels, onToggle } = t0;
1743
+ const t1 = `${hidden ? labels.showColumn : labels.hideColumn}: ${name}`;
1744
+ const t2 = !hidden;
1745
+ const t3 = hidden ? "default" : "primary";
1746
+ let t4;
1747
+ if ($[0] !== hidden) {
1748
+ t4 = /* @__PURE__ */ jsx(EyeIcon, { off: hidden });
1749
+ $[0] = hidden;
1750
+ $[1] = t4;
1751
+ } else t4 = $[1];
1752
+ let t5;
1753
+ if ($[2] !== onToggle || $[3] !== t1 || $[4] !== t2 || $[5] !== t3 || $[6] !== t4) {
1754
+ t5 = /* @__PURE__ */ jsx(IconButton, {
1755
+ size: "small",
1756
+ "aria-label": t1,
1757
+ "aria-pressed": t2,
1758
+ color: t3,
1759
+ onClick: onToggle,
1760
+ children: t4
1761
+ });
1762
+ $[2] = onToggle;
1763
+ $[3] = t1;
1764
+ $[4] = t2;
1765
+ $[5] = t3;
1766
+ $[6] = t4;
1767
+ $[7] = t5;
1768
+ } else t5 = $[7];
1769
+ return t5;
753
1770
  }
754
1771
  /** 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: {
1772
+ function RowName(t0) {
1773
+ const $ = c(6);
1774
+ const { hidden, name } = t0;
1775
+ const t1 = hidden ? "text.disabled" : "text.primary";
1776
+ const t2 = hidden ? "line-through" : "none";
1777
+ let t3;
1778
+ if ($[0] !== t1 || $[1] !== t2) {
1779
+ t3 = {
759
1780
  flex: 1,
760
- color: hidden ? "text.disabled" : "text.primary",
761
- textDecoration: hidden ? "line-through" : "none"
762
- },
763
- children: name
764
- });
1781
+ color: t1,
1782
+ textDecoration: t2
1783
+ };
1784
+ $[0] = t1;
1785
+ $[1] = t2;
1786
+ $[2] = t3;
1787
+ } else t3 = $[2];
1788
+ let t4;
1789
+ if ($[3] !== name || $[4] !== t3) {
1790
+ t4 = /* @__PURE__ */ jsx(Typography, {
1791
+ variant: "body2",
1792
+ sx: t3,
1793
+ children: name
1794
+ });
1795
+ $[3] = name;
1796
+ $[4] = t3;
1797
+ $[5] = t4;
1798
+ } else t4 = $[5];
1799
+ return t4;
765
1800
  }
766
1801
  /** 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
- });
1802
+ function PinToggle(t0) {
1803
+ const $ = c(5);
1804
+ const { active, label, onClick } = t0;
1805
+ const t1 = active ? "primary" : "default";
1806
+ let t2;
1807
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1808
+ t2 = /* @__PURE__ */ jsx(PinIcon, {});
1809
+ $[0] = t2;
1810
+ } else t2 = $[0];
1811
+ let t3;
1812
+ if ($[1] !== label || $[2] !== onClick || $[3] !== t1) {
1813
+ t3 = /* @__PURE__ */ jsx(IconButton, {
1814
+ size: "small",
1815
+ color: t1,
1816
+ "aria-label": label,
1817
+ onClick,
1818
+ children: t2
1819
+ });
1820
+ $[1] = label;
1821
+ $[2] = onClick;
1822
+ $[3] = t1;
1823
+ $[4] = t3;
1824
+ } else t3 = $[4];
1825
+ return t3;
775
1826
  }
776
1827
  /**
777
1828
  * Trailing menu row for the injected row-actions column. It is not a data
@@ -780,39 +1831,107 @@ function PinToggle({ active, label, onClick }) {
780
1831
  * a ONE-CLICK right↔unpinned toggle (the column always trails, so a left pin
781
1832
  * would be meaningless).
782
1833
  */
783
- function ActionsRow({ layout, labels }) {
784
- const hidden = layout.isHidden(ACTIONS_COLUMN_KEY);
785
- 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: {
1834
+ function ActionsRow(t0) {
1835
+ const $ = c(25);
1836
+ const { layout, labels } = t0;
1837
+ let t1;
1838
+ if ($[0] !== layout) {
1839
+ t1 = layout.isHidden(ACTIONS_COLUMN_KEY);
1840
+ $[0] = layout;
1841
+ $[1] = t1;
1842
+ } else t1 = $[1];
1843
+ const hidden = t1;
1844
+ const pinned = layout.state.pinned[ACTIONS_COLUMN_KEY] === "end";
1845
+ let t2;
1846
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1847
+ t2 = /* @__PURE__ */ jsx(Divider, { sx: { my: .5 } });
1848
+ $[2] = t2;
1849
+ } else t2 = $[2];
1850
+ let t3;
1851
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1852
+ t3 = {
790
1853
  px: .5,
791
1854
  py: .25,
792
1855
  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
- })] });
1856
+ };
1857
+ $[3] = t3;
1858
+ } else t3 = $[3];
1859
+ let t4;
1860
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1861
+ t4 = /* @__PURE__ */ jsx(Box, {
1862
+ "aria-hidden": true,
1863
+ sx: { width: 24 }
1864
+ });
1865
+ $[4] = t4;
1866
+ } else t4 = $[4];
1867
+ let t5;
1868
+ if ($[5] !== layout) {
1869
+ t5 = () => layout.toggleVisible(ACTIONS_COLUMN_KEY);
1870
+ $[5] = layout;
1871
+ $[6] = t5;
1872
+ } else t5 = $[6];
1873
+ let t6;
1874
+ if ($[7] !== hidden || $[8] !== labels || $[9] !== t5) {
1875
+ t6 = /* @__PURE__ */ jsx(VisibilityToggle, {
1876
+ hidden,
1877
+ name: labels.actions,
1878
+ labels,
1879
+ onToggle: t5
1880
+ });
1881
+ $[7] = hidden;
1882
+ $[8] = labels;
1883
+ $[9] = t5;
1884
+ $[10] = t6;
1885
+ } else t6 = $[10];
1886
+ let t7;
1887
+ if ($[11] !== hidden || $[12] !== labels.actions) {
1888
+ t7 = /* @__PURE__ */ jsx(RowName, {
1889
+ hidden,
1890
+ name: labels.actions
1891
+ });
1892
+ $[11] = hidden;
1893
+ $[12] = labels.actions;
1894
+ $[13] = t7;
1895
+ } else t7 = $[13];
1896
+ const t8 = `${pinned ? labels.unpin : labels.pinEnd}: ${labels.actions}`;
1897
+ let t9;
1898
+ if ($[14] !== layout || $[15] !== pinned) {
1899
+ t9 = () => layout.setPinned(ACTIONS_COLUMN_KEY, pinned ? void 0 : "end");
1900
+ $[14] = layout;
1901
+ $[15] = pinned;
1902
+ $[16] = t9;
1903
+ } else t9 = $[16];
1904
+ let t10;
1905
+ if ($[17] !== pinned || $[18] !== t8 || $[19] !== t9) {
1906
+ t10 = /* @__PURE__ */ jsx(PinToggle, {
1907
+ active: pinned,
1908
+ label: t8,
1909
+ onClick: t9
1910
+ });
1911
+ $[17] = pinned;
1912
+ $[18] = t8;
1913
+ $[19] = t9;
1914
+ $[20] = t10;
1915
+ } else t10 = $[20];
1916
+ let t11;
1917
+ if ($[21] !== t10 || $[22] !== t6 || $[23] !== t7) {
1918
+ t11 = /* @__PURE__ */ jsxs(Fragment, { children: [t2, /* @__PURE__ */ jsxs(Stack, {
1919
+ direction: "row",
1920
+ spacing: .5,
1921
+ sx: t3,
1922
+ children: [
1923
+ t4,
1924
+ t6,
1925
+ t7,
1926
+ t10
1927
+ ]
1928
+ })] });
1929
+ $[21] = t10;
1930
+ $[22] = t6;
1931
+ $[23] = t7;
1932
+ $[24] = t11;
1933
+ } else t11 = $[24];
1934
+ return t11;
816
1935
  }
817
1936
  /**
818
1937
  * MUI column-management popover: per-column drag grip (reorder), eye
@@ -820,104 +1939,219 @@ function ActionsRow({ layout, labels }) {
820
1939
  * navigation never fights the grip's arrow-key reorder. With row actions, a
821
1940
  * separated trailing row manages the injected actions column too.
822
1941
  */
823
- function ColumnMenu({ allColumns, layout, labels, hasRowActions }) {
1942
+ function ColumnMenu(t0) {
1943
+ const $ = c(42);
1944
+ const { allColumns, layout, labels, hasRowActions } = t0;
824
1945
  const drag = useColumnDragState();
825
1946
  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: {
1947
+ const t1 = anchor !== null;
1948
+ let t2;
1949
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1950
+ t2 = (e) => setAnchor(e.currentTarget);
1951
+ $[0] = t2;
1952
+ } else t2 = $[0];
1953
+ let t3;
1954
+ if ($[1] !== labels.columns || $[2] !== t1) {
1955
+ t3 = /* @__PURE__ */ jsx(Button, {
1956
+ size: "small",
1957
+ variant: "outlined",
1958
+ "aria-expanded": t1,
1959
+ "aria-haspopup": "true",
1960
+ onClick: t2,
1961
+ children: labels.columns
1962
+ });
1963
+ $[1] = labels.columns;
1964
+ $[2] = t1;
1965
+ $[3] = t3;
1966
+ } else t3 = $[3];
1967
+ const t4 = anchor !== null;
1968
+ let t5;
1969
+ let t6;
1970
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
1971
+ t5 = () => setAnchor(null);
1972
+ t6 = {
838
1973
  vertical: "bottom",
839
1974
  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",
1975
+ };
1976
+ $[4] = t5;
1977
+ $[5] = t6;
1978
+ } else {
1979
+ t5 = $[4];
1980
+ t6 = $[5];
1981
+ }
1982
+ let t7;
1983
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
1984
+ t7 = {
1985
+ p: .75,
1986
+ minWidth: 250
1987
+ };
1988
+ $[6] = t7;
1989
+ } else t7 = $[6];
1990
+ let t8;
1991
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
1992
+ t8 = {
1993
+ display: "block",
1994
+ px: 1,
1995
+ pb: .5,
1996
+ fontWeight: 600,
1997
+ textTransform: "uppercase",
1998
+ letterSpacing: "0.06em",
1999
+ color: "text.secondary"
2000
+ };
2001
+ $[7] = t8;
2002
+ } else t8 = $[7];
2003
+ let t9;
2004
+ if ($[8] !== labels.columns) {
2005
+ t9 = /* @__PURE__ */ jsx(Typography, {
2006
+ variant: "caption",
2007
+ sx: t8,
2008
+ children: labels.columns
2009
+ });
2010
+ $[8] = labels.columns;
2011
+ $[9] = t9;
2012
+ } else t9 = $[9];
2013
+ let t10;
2014
+ if ($[10] !== allColumns || $[11] !== drag || $[12] !== labels || $[13] !== layout) {
2015
+ let t11;
2016
+ if ($[15] !== drag || $[16] !== labels || $[17] !== layout) {
2017
+ t11 = (r) => {
2018
+ const indicator = drag.rowAttrs(r.key, r.index);
2019
+ const edge = indicator["data-drop"];
2020
+ const edgeOffset = edge === "before" ? "2px" : "-2px";
2021
+ return /* @__PURE__ */ jsxs(Stack, {
2022
+ direction: "row",
2023
+ spacing: .5,
849
2024
  sx: {
850
- display: "block",
851
- px: 1,
852
- pb: .5,
853
- fontWeight: 600,
854
- textTransform: "uppercase",
855
- letterSpacing: "0.06em",
856
- color: "text.secondary"
2025
+ alignItems: "center",
2026
+ px: .5,
2027
+ py: .25,
2028
+ cursor: "grab",
2029
+ opacity: "data-dragging" in indicator ? .4 : void 0,
2030
+ boxShadow: edge ? (theme) => `inset 0 ${edgeOffset} 0 0 ${theme.palette.primary.main}` : void 0
857
2031
  },
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
- })
2032
+ ...drag.rowDragProps(r.key, r.index),
2033
+ ...drag.dropProps(r.index, layout.move),
2034
+ ...indicator,
2035
+ children: [
2036
+ /* @__PURE__ */ jsx(IconButton, {
2037
+ size: "small",
2038
+ sx: {
2039
+ cursor: "grab",
2040
+ color: "text.disabled"
2041
+ },
2042
+ ...columnReorderKeyProps(r.key, r.index, layout.move, `${labels.moveStart} / ${labels.moveEnd}: ${r.name}`),
2043
+ children: /* @__PURE__ */ jsx(GripIcon, {})
2044
+ }),
2045
+ /* @__PURE__ */ jsx(VisibilityToggle, {
2046
+ hidden: r.hidden,
2047
+ name: r.name,
2048
+ labels,
2049
+ onToggle: () => layout.toggleVisible(r.key)
2050
+ }),
2051
+ /* @__PURE__ */ jsx(RowName, {
2052
+ hidden: r.hidden,
2053
+ name: r.name
2054
+ }),
2055
+ /* @__PURE__ */ jsx(PinToggle, {
2056
+ active: r.pinned !== void 0,
2057
+ label: `${pinActionLabel(r.pinned, labels)}: ${r.name}`,
2058
+ onClick: () => layout.setPinned(r.key, nextPinSide(r.pinned))
2059
+ })
2060
+ ]
2061
+ }, r.key);
2062
+ };
2063
+ $[15] = drag;
2064
+ $[16] = labels;
2065
+ $[17] = layout;
2066
+ $[18] = t11;
2067
+ } else t11 = $[18];
2068
+ t10 = columnMenuRows(allColumns, layout).map(t11);
2069
+ $[10] = allColumns;
2070
+ $[11] = drag;
2071
+ $[12] = labels;
2072
+ $[13] = layout;
2073
+ $[14] = t10;
2074
+ } else t10 = $[14];
2075
+ let t11;
2076
+ if ($[19] !== hasRowActions || $[20] !== labels || $[21] !== layout) {
2077
+ t11 = hasRowActions && /* @__PURE__ */ jsx(ActionsRow, {
2078
+ layout,
2079
+ labels
2080
+ });
2081
+ $[19] = hasRowActions;
2082
+ $[20] = labels;
2083
+ $[21] = layout;
2084
+ $[22] = t11;
2085
+ } else t11 = $[22];
2086
+ let t12;
2087
+ if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
2088
+ t12 = /* @__PURE__ */ jsx(Divider, { sx: { my: .5 } });
2089
+ $[23] = t12;
2090
+ } else t12 = $[23];
2091
+ let t13;
2092
+ if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
2093
+ t13 = { justifyContent: "flex-start" };
2094
+ $[24] = t13;
2095
+ } else t13 = $[24];
2096
+ let t14;
2097
+ if ($[25] !== layout) {
2098
+ t14 = () => layout.reset();
2099
+ $[25] = layout;
2100
+ $[26] = t14;
2101
+ } else t14 = $[26];
2102
+ let t15;
2103
+ if ($[27] !== labels.resetColumns || $[28] !== t14) {
2104
+ t15 = /* @__PURE__ */ jsx(Button, {
2105
+ size: "small",
2106
+ fullWidth: true,
2107
+ sx: t13,
2108
+ onClick: t14,
2109
+ children: labels.resetColumns
2110
+ });
2111
+ $[27] = labels.resetColumns;
2112
+ $[28] = t14;
2113
+ $[29] = t15;
2114
+ } else t15 = $[29];
2115
+ let t16;
2116
+ if ($[30] !== t10 || $[31] !== t11 || $[32] !== t15 || $[33] !== t9) {
2117
+ t16 = /* @__PURE__ */ jsxs(Box, {
2118
+ sx: t7,
2119
+ children: [
2120
+ t9,
2121
+ t10,
2122
+ t11,
2123
+ t12,
2124
+ t15
918
2125
  ]
919
- })
920
- })] });
2126
+ });
2127
+ $[30] = t10;
2128
+ $[31] = t11;
2129
+ $[32] = t15;
2130
+ $[33] = t9;
2131
+ $[34] = t16;
2132
+ } else t16 = $[34];
2133
+ let t17;
2134
+ if ($[35] !== anchor || $[36] !== t16 || $[37] !== t4) {
2135
+ t17 = /* @__PURE__ */ jsx(Popover, {
2136
+ anchorEl: anchor,
2137
+ open: t4,
2138
+ onClose: t5,
2139
+ anchorOrigin: t6,
2140
+ children: t16
2141
+ });
2142
+ $[35] = anchor;
2143
+ $[36] = t16;
2144
+ $[37] = t4;
2145
+ $[38] = t17;
2146
+ } else t17 = $[38];
2147
+ let t18;
2148
+ if ($[39] !== t17 || $[40] !== t3) {
2149
+ t18 = /* @__PURE__ */ jsxs(Fragment, { children: [t3, t17] });
2150
+ $[39] = t17;
2151
+ $[40] = t3;
2152
+ $[41] = t18;
2153
+ } else t18 = $[41];
2154
+ return t18;
921
2155
  }
922
2156
  //#endregion
923
2157
  //#region src/components/tables.tsx
@@ -952,19 +2186,25 @@ function useStableToggle(target) {
952
2186
  return useCallback((id) => ref.current?.toggle(id), []);
953
2187
  }
954
2188
  /** Inline chevron pointing at the reading end; rotates down when open. */
955
- function ExpandChevron({ expanded, dir }) {
2189
+ function ExpandChevron(t0) {
2190
+ const $ = c(5);
2191
+ const { expanded, dir } = t0;
956
2192
  let transform;
957
2193
  if (expanded) transform = "rotate(90deg)";
958
2194
  else if (dir === "rtl") transform = "rotate(180deg)";
959
- return /* @__PURE__ */ jsx(Box, {
960
- component: "span",
961
- "aria-hidden": true,
962
- sx: {
2195
+ let t1;
2196
+ if ($[0] !== transform) {
2197
+ t1 = {
963
2198
  display: "inline-flex",
964
2199
  transition: "transform 150ms",
965
2200
  transform
966
- },
967
- children: /* @__PURE__ */ jsx("svg", {
2201
+ };
2202
+ $[0] = transform;
2203
+ $[1] = t1;
2204
+ } else t1 = $[1];
2205
+ let t2;
2206
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
2207
+ t2 = /* @__PURE__ */ jsx("svg", {
968
2208
  width: "1em",
969
2209
  height: "1em",
970
2210
  viewBox: "0 0 24 24",
@@ -974,21 +2214,60 @@ function ExpandChevron({ expanded, dir }) {
974
2214
  strokeLinecap: "round",
975
2215
  strokeLinejoin: "round",
976
2216
  children: /* @__PURE__ */ jsx("path", { d: "M9 6l6 6-6 6" })
977
- })
978
- });
2217
+ });
2218
+ $[2] = t2;
2219
+ } else t2 = $[2];
2220
+ let t3;
2221
+ if ($[3] !== t1) {
2222
+ t3 = /* @__PURE__ */ jsx(Box, {
2223
+ component: "span",
2224
+ "aria-hidden": true,
2225
+ sx: t1,
2226
+ children: t2
2227
+ });
2228
+ $[3] = t1;
2229
+ $[4] = t3;
2230
+ } else t3 = $[4];
2231
+ return t3;
979
2232
  }
980
2233
  /** 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, {
2234
+ function ExpandToggle(t0) {
2235
+ const $ = c(11);
2236
+ const { id, expanded, onToggle, dir, expandLabel, collapseLabel } = t0;
2237
+ const t1 = expanded ? collapseLabel : expandLabel;
2238
+ let t2;
2239
+ if ($[0] !== id || $[1] !== onToggle) {
2240
+ t2 = () => onToggle(id);
2241
+ $[0] = id;
2242
+ $[1] = onToggle;
2243
+ $[2] = t2;
2244
+ } else t2 = $[2];
2245
+ let t3;
2246
+ if ($[3] !== dir || $[4] !== expanded) {
2247
+ t3 = /* @__PURE__ */ jsx(ExpandChevron, {
988
2248
  expanded,
989
2249
  dir
990
- })
991
- });
2250
+ });
2251
+ $[3] = dir;
2252
+ $[4] = expanded;
2253
+ $[5] = t3;
2254
+ } else t3 = $[5];
2255
+ let t4;
2256
+ if ($[6] !== expanded || $[7] !== t1 || $[8] !== t2 || $[9] !== t3) {
2257
+ t4 = /* @__PURE__ */ jsx(IconButton, {
2258
+ size: "small",
2259
+ "aria-expanded": expanded,
2260
+ "aria-label": t1,
2261
+ onClick: t2,
2262
+ children: t3
2263
+ });
2264
+ $[6] = expanded;
2265
+ $[7] = t1;
2266
+ $[8] = t2;
2267
+ $[9] = t3;
2268
+ $[10] = t4;
2269
+ } else t4 = $[10];
2270
+ return t4;
992
2271
  }
993
2272
  /**
994
2273
  * Logical (RTL-aware) `text-align` for a column. Applied via `sx` rather
@@ -1000,36 +2279,71 @@ function muiAlign(align) {
1000
2279
  if (align === "end") return "end";
1001
2280
  return "start";
1002
2281
  }
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
- });
2282
+ function RowActionButtons(t0) {
2283
+ const $ = c(12);
2284
+ const { row, actions, confirm, cancelLabel } = t0;
2285
+ let t1;
2286
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
2287
+ t1 = { justifyContent: "flex-end" };
2288
+ $[0] = t1;
2289
+ } else t1 = $[0];
2290
+ let t2;
2291
+ if ($[1] !== actions || $[2] !== cancelLabel || $[3] !== confirm || $[4] !== row) {
2292
+ let t3;
2293
+ if ($[6] !== cancelLabel || $[7] !== confirm || $[8] !== row) {
2294
+ t3 = (action) => {
2295
+ if (action.isHidden?.(row)) return null;
2296
+ const reason = resolveDisabledReason(action.disabledReason?.(row));
2297
+ const disabled = reason !== void 0 || (action.isDisabled?.(row) ?? false);
2298
+ return /* @__PURE__ */ jsx(Tooltip, {
2299
+ title: reason ?? action.label,
2300
+ children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(IconButton, {
2301
+ size: "small",
2302
+ color: muiColor(action.color),
2303
+ disabled,
2304
+ "aria-label": action.label,
2305
+ onClick: disabled ? void 0 : (e) => {
2306
+ e.stopPropagation();
2307
+ runRowAction(action, row, confirm, cancelLabel);
2308
+ },
2309
+ children: action.icon ?? /* @__PURE__ */ jsx(Typography, {
2310
+ variant: "caption",
2311
+ children: action.label
2312
+ })
2313
+ }) })
2314
+ }, action.key);
2315
+ };
2316
+ $[6] = cancelLabel;
2317
+ $[7] = confirm;
2318
+ $[8] = row;
2319
+ $[9] = t3;
2320
+ } else t3 = $[9];
2321
+ t2 = actions.map(t3);
2322
+ $[1] = actions;
2323
+ $[2] = cancelLabel;
2324
+ $[3] = confirm;
2325
+ $[4] = row;
2326
+ $[5] = t2;
2327
+ } else t2 = $[5];
2328
+ let t3;
2329
+ if ($[10] !== t2) {
2330
+ t3 = /* @__PURE__ */ jsx(Stack, {
2331
+ direction: "row",
2332
+ spacing: .5,
2333
+ sx: t1,
2334
+ children: t2
2335
+ });
2336
+ $[10] = t2;
2337
+ $[11] = t3;
2338
+ } else t3 = $[11];
2339
+ return t3;
1031
2340
  }
1032
2341
  /**
2342
+ * Per-render-stable sx for the memoized desktop row. Built once per
2343
+ * `DesktopTable` render (memoized on the pin/width/column inputs), so the
2344
+ * row comparator can treat one object identity as "the cell styling".
2345
+ */
2346
+ /**
1033
2347
  * The visual inputs a desktop row re-renders for. Deliberately NOT the
1034
2348
  * per-render `table` object or the handler props: handlers are stable (or
1035
2349
  * latest-dispatching wrappers), and everything that changes what the row
@@ -1059,58 +2373,157 @@ const DESKTOP_ROW_COMPARED = [
1059
2373
  function desktopRowPropsAreEqual(prev, next) {
1060
2374
  return DESKTOP_ROW_COMPARED.every((key) => prev[key] === next[key]);
1061
2375
  }
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, {
2376
+ function DesktopRowImpl(t0) {
2377
+ const $ = c(57);
2378
+ 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;
2379
+ let t1;
2380
+ if ($[0] !== onRowClick || $[1] !== row) {
2381
+ t1 = rowClickProps(row, onRowClick);
2382
+ $[0] = onRowClick;
2383
+ $[1] = row;
2384
+ $[2] = t1;
2385
+ } else t1 = $[2];
2386
+ let t2;
2387
+ if ($[3] !== prefetch || $[4] !== row) {
2388
+ t2 = prefetch ? () => prefetch(row) : void 0;
2389
+ $[3] = prefetch;
2390
+ $[4] = row;
2391
+ $[5] = t2;
2392
+ } else t2 = $[5];
2393
+ let t3;
2394
+ if ($[6] !== collapseLabel || $[7] !== dir || $[8] !== expandLabel || $[9] !== expanded || $[10] !== hasExpansion || $[11] !== id || $[12] !== onToggleExpand || $[13] !== sx) {
2395
+ t3 = hasExpansion && /* @__PURE__ */ jsx(TableCell, {
2396
+ padding: "checkbox",
2397
+ sx: sx.expand,
2398
+ children: /* @__PURE__ */ jsx(ExpandToggle, {
2399
+ id,
2400
+ expanded,
2401
+ onToggle: onToggleExpand,
2402
+ dir,
2403
+ expandLabel,
2404
+ collapseLabel
2405
+ })
2406
+ });
2407
+ $[6] = collapseLabel;
2408
+ $[7] = dir;
2409
+ $[8] = expandLabel;
2410
+ $[9] = expanded;
2411
+ $[10] = hasExpansion;
2412
+ $[11] = id;
2413
+ $[12] = onToggleExpand;
2414
+ $[13] = sx;
2415
+ $[14] = t3;
2416
+ } else t3 = $[14];
2417
+ let t4;
2418
+ if ($[15] !== hasSelection || $[16] !== id || $[17] !== onToggleSelect || $[18] !== selectRowLabel || $[19] !== selected || $[20] !== sx) {
2419
+ t4 = hasSelection && /* @__PURE__ */ jsx(TableCell, {
2420
+ padding: "checkbox",
2421
+ sx: sx.selection,
2422
+ children: /* @__PURE__ */ jsx(Checkbox, {
2423
+ slotProps: { input: { "aria-label": selectRowLabel } },
2424
+ checked: selected,
2425
+ onChange: () => onToggleSelect(id)
2426
+ })
2427
+ });
2428
+ $[15] = hasSelection;
2429
+ $[16] = id;
2430
+ $[17] = onToggleSelect;
2431
+ $[18] = selectRowLabel;
2432
+ $[19] = selected;
2433
+ $[20] = sx;
2434
+ $[21] = t4;
2435
+ } else t4 = $[21];
2436
+ let t5;
2437
+ if ($[22] !== columns || $[23] !== index || $[24] !== row || $[25] !== sx) {
2438
+ let t6;
2439
+ if ($[27] !== index || $[28] !== row || $[29] !== sx) {
2440
+ t6 = (column) => /* @__PURE__ */ jsx(TableCell, {
1094
2441
  sx: sx.cells[column.key],
1095
2442
  children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
1096
2443
  row,
1097
2444
  rowIndex: index
1098
2445
  }) : 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
- })
2446
+ }, column.key);
2447
+ $[27] = index;
2448
+ $[28] = row;
2449
+ $[29] = sx;
2450
+ $[30] = t6;
2451
+ } else t6 = $[30];
2452
+ t5 = columns.map(t6);
2453
+ $[22] = columns;
2454
+ $[23] = index;
2455
+ $[24] = row;
2456
+ $[25] = sx;
2457
+ $[26] = t5;
2458
+ } else t5 = $[26];
2459
+ let t6;
2460
+ if ($[31] !== cancelLabel || $[32] !== confirm || $[33] !== row || $[34] !== rowActions || $[35] !== showActions || $[36] !== sx) {
2461
+ t6 = showActions && /* @__PURE__ */ jsx(TableCell, {
2462
+ sx: sx.actions,
2463
+ children: /* @__PURE__ */ jsx(RowActionButtons, {
2464
+ row,
2465
+ actions: rowActions,
2466
+ confirm,
2467
+ cancelLabel
1108
2468
  })
1109
- ]
1110
- }), expanded && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
1111
- colSpan: columnSpan,
1112
- children: renderRowDetail(row)
1113
- }) })] });
2469
+ });
2470
+ $[31] = cancelLabel;
2471
+ $[32] = confirm;
2472
+ $[33] = row;
2473
+ $[34] = rowActions;
2474
+ $[35] = showActions;
2475
+ $[36] = sx;
2476
+ $[37] = t6;
2477
+ } else t6 = $[37];
2478
+ let t7;
2479
+ if ($[38] !== className || $[39] !== index || $[40] !== measureElement || $[41] !== selected || $[42] !== t1 || $[43] !== t2 || $[44] !== t3 || $[45] !== t4 || $[46] !== t5 || $[47] !== t6) {
2480
+ t7 = /* @__PURE__ */ jsxs(TableRow, {
2481
+ ...t1,
2482
+ className,
2483
+ ref: measureElement,
2484
+ "data-index": index,
2485
+ hover: true,
2486
+ selected,
2487
+ onMouseEnter: t2,
2488
+ children: [
2489
+ t3,
2490
+ t4,
2491
+ t5,
2492
+ t6
2493
+ ]
2494
+ });
2495
+ $[38] = className;
2496
+ $[39] = index;
2497
+ $[40] = measureElement;
2498
+ $[41] = selected;
2499
+ $[42] = t1;
2500
+ $[43] = t2;
2501
+ $[44] = t3;
2502
+ $[45] = t4;
2503
+ $[46] = t5;
2504
+ $[47] = t6;
2505
+ $[48] = t7;
2506
+ } else t7 = $[48];
2507
+ let t8;
2508
+ if ($[49] !== columnSpan || $[50] !== expanded || $[51] !== renderRowDetail || $[52] !== row) {
2509
+ t8 = expanded && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
2510
+ colSpan: columnSpan,
2511
+ children: renderRowDetail(row)
2512
+ }) });
2513
+ $[49] = columnSpan;
2514
+ $[50] = expanded;
2515
+ $[51] = renderRowDetail;
2516
+ $[52] = row;
2517
+ $[53] = t8;
2518
+ } else t8 = $[53];
2519
+ let t9;
2520
+ if ($[54] !== t7 || $[55] !== t8) {
2521
+ t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t7, t8] });
2522
+ $[54] = t7;
2523
+ $[55] = t8;
2524
+ $[56] = t9;
2525
+ } else t9 = $[56];
2526
+ return t9;
1114
2527
  }
1115
2528
  /**
1116
2529
  * Memoized desktop row: a search keystroke (or any chrome re-render) must
@@ -1147,15 +2560,15 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1147
2560
  } : void 0;
1148
2561
  const selectionWidth = 48;
1149
2562
  const actionsWidth = 120;
1150
- const leadLeft = (expandActive ? EXPAND_WIDTH : 0) + (selection ? selectionWidth : 0);
1151
- const leadRight = showActions ? actionsWidth : 0;
2563
+ const leadStart = (expandActive ? EXPAND_WIDTH : 0) + (selection ? selectionWidth : 0);
2564
+ const leadEnd = showActions ? actionsWidth : 0;
1152
2565
  const leads = {
1153
- left: leadLeft,
1154
- right: leadRight
2566
+ start: leadStart,
2567
+ end: leadEnd
1155
2568
  };
1156
2569
  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;
2570
+ const hasStartPin = table.columns.some((c_0) => pinOffset?.(c_0.key)?.side === "start");
2571
+ const stickActions = table.columns.some((c_1) => pinOffset?.(c_1.key)?.side === "end") || actionsPinned;
1159
2572
  const headCellSx = (column) => {
1160
2573
  const pin = pinnedCellStyle(pinOffset?.(column.key), PIN_Z.headerPinned, leads);
1161
2574
  const width = pin ? pinnedColumnWidth(column, columnWidths) : columnWidths?.[column.key] ?? column.width;
@@ -1172,55 +2585,55 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1172
2585
  };
1173
2586
  };
1174
2587
  const edgeHeadSx = (side, active, lead = 0) => {
1175
- const pin = edgePinStyle(side, active, PIN_Z.headerPinned);
2588
+ const pin_0 = edgePinStyle(side, active, PIN_Z.headerPinned);
1176
2589
  return {
1177
2590
  ...headSx,
1178
- ...pin && {
1179
- ...pin,
2591
+ ...pin_0 && {
2592
+ ...pin_0,
1180
2593
  bgcolor: "background.paper"
1181
2594
  },
1182
- ...pin && lead > 0 && { insetInlineStart: lead }
2595
+ ...pin_0 && lead > 0 && { insetInlineStart: lead }
1183
2596
  };
1184
2597
  };
1185
2598
  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;
2599
+ const edge = (side_0, active_0, lead_0 = 0) => {
2600
+ const pin_1 = edgePinStyle(side_0, active_0, PIN_Z.body);
2601
+ if (!pin_1) return void 0;
1189
2602
  return {
1190
- ...pin,
1191
- ...lead > 0 && { insetInlineStart: lead },
2603
+ ...pin_1,
2604
+ ...lead_0 > 0 && { insetInlineStart: lead_0 },
1192
2605
  bgcolor: "background.paper"
1193
2606
  };
1194
2607
  };
1195
2608
  const cells = {};
1196
- for (const column of columns) {
1197
- const pin = pinnedCellStyle(pinOffset?.(column.key), PIN_Z.body, {
1198
- left: leadLeft,
1199
- right: leadRight
2609
+ for (const column_0 of columns) {
2610
+ const pin_2 = pinnedCellStyle(pinOffset?.(column_0.key), PIN_Z.body, {
2611
+ start: leadStart,
2612
+ end: leadEnd
1200
2613
  });
1201
- cells[column.key] = {
1202
- ...pin && {
1203
- ...pin,
2614
+ cells[column_0.key] = {
2615
+ ...pin_2 && {
2616
+ ...pin_2,
1204
2617
  bgcolor: "background.paper"
1205
2618
  },
1206
- textAlign: muiAlign(column.align)
2619
+ textAlign: muiAlign(column_0.align)
1207
2620
  };
1208
2621
  }
1209
2622
  return {
1210
2623
  cells,
1211
- expand: edge("left", hasLeftPin),
1212
- selection: edge("left", hasLeftPin, selectionLead),
2624
+ expand: edge("start", hasStartPin),
2625
+ selection: edge("start", hasStartPin, selectionLead),
1213
2626
  actions: {
1214
- ...edge("right", stickActions),
2627
+ ...edge("end", stickActions),
1215
2628
  textAlign: "end"
1216
2629
  }
1217
2630
  };
1218
2631
  }, [
1219
2632
  columns,
1220
2633
  pinOffset,
1221
- leadLeft,
1222
- leadRight,
1223
- hasLeftPin,
2634
+ leadStart,
2635
+ leadEnd,
2636
+ hasStartPin,
1224
2637
  stickActions,
1225
2638
  selectionLead
1226
2639
  ]);
@@ -1232,7 +2645,7 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1232
2645
  else if (hasPinned || overflow.overflowing) boxSx = { overflowX: "auto" };
1233
2646
  const minWidth = tableMinWidth(columns, {
1234
2647
  widths: columnWidths,
1235
- extra: leadLeft + leadRight
2648
+ extra: leadStart + leadEnd
1236
2649
  });
1237
2650
  return /* @__PURE__ */ jsx(Box, {
1238
2651
  ref: (node) => {
@@ -1260,11 +2673,11 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1260
2673
  ] }), /* @__PURE__ */ jsxs(TableRow, { children: [
1261
2674
  expandActive && /* @__PURE__ */ jsx(TableCell, {
1262
2675
  padding: "checkbox",
1263
- sx: edgeHeadSx("left", hasLeftPin)
2676
+ sx: edgeHeadSx("start", hasStartPin)
1264
2677
  }),
1265
2678
  selection && /* @__PURE__ */ jsx(TableCell, {
1266
2679
  padding: "checkbox",
1267
- sx: edgeHeadSx("left", hasLeftPin, selectionLead),
2680
+ sx: edgeHeadSx("start", hasStartPin, selectionLead),
1268
2681
  children: /* @__PURE__ */ jsx(Checkbox, {
1269
2682
  slotProps: { input: { "aria-label": labels.selectAll } },
1270
2683
  checked: selection.headerState === "all",
@@ -1272,20 +2685,20 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1272
2685
  onChange: selection.toggleAll
1273
2686
  })
1274
2687
  }),
1275
- columns.map((column) => {
1276
- const headerCellProps = table.getHeaderCellProps(column);
2688
+ columns.map((column_1) => {
2689
+ const headerCellProps = table.getHeaderCellProps(column_1);
1277
2690
  const ariaSort = headerCellProps["aria-sort"];
1278
- const active = ariaSort === "ascending" || ariaSort === "descending";
2691
+ const active_1 = ariaSort === "ascending" || ariaSort === "descending";
1279
2692
  const sortIndex = headerCellProps["data-sort-index"];
1280
2693
  return /* @__PURE__ */ jsxs(TableCell, {
1281
2694
  "aria-sort": ariaSort,
1282
2695
  "data-sort-index": sortIndex,
1283
- sx: headCellSx(column),
1284
- children: [column.sortable ? /* @__PURE__ */ jsxs(TableSortLabel, {
1285
- active,
2696
+ sx: headCellSx(column_1),
2697
+ children: [column_1.sortable ? /* @__PURE__ */ jsxs(TableSortLabel, {
2698
+ active: active_1,
1286
2699
  direction: ariaSort === "descending" ? "desc" : "asc",
1287
- onClick: table.getSortButtonProps(column).onClick,
1288
- children: [column.header, sortIndex !== void 0 && /* @__PURE__ */ jsx(Box, {
2700
+ onClick: table.getSortButtonProps(column_1).onClick,
2701
+ children: [column_1.header, sortIndex !== void 0 && /* @__PURE__ */ jsx(Box, {
1289
2702
  component: "span",
1290
2703
  sx: {
1291
2704
  fontSize: 10,
@@ -1293,16 +2706,16 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1293
2706
  },
1294
2707
  children: sortIndex
1295
2708
  })]
1296
- }) : column.header, setWidth && /* @__PURE__ */ jsx(Box, {
2709
+ }) : column_1.header, setWidth && /* @__PURE__ */ jsx(Box, {
1297
2710
  component: "span",
1298
2711
  sx: RESIZE_HANDLE_SX,
1299
- ...columnResizeHandleProps(column.key, setWidth, `${resizeLabel}: ${typeof column.header === "string" ? column.header : column.key}`)
2712
+ ...columnResizeHandleProps(column_1.key, setWidth, `${resizeLabel}: ${typeof column_1.header === "string" ? column_1.header : column_1.key}`)
1300
2713
  })]
1301
- }, column.key);
2714
+ }, column_1.key);
1302
2715
  }),
1303
2716
  showActions && /* @__PURE__ */ jsx(TableCell, {
1304
2717
  sx: {
1305
- ...edgeHeadSx("right", stickActions),
2718
+ ...edgeHeadSx("end", stickActions),
1306
2719
  textAlign: "end"
1307
2720
  },
1308
2721
  children: labels.actions
@@ -1364,10 +2777,10 @@ function DesktopTable({ table, rows, rowActions, confirm, getRowId, size, dir, p
1364
2777
  summaryCells && /* @__PURE__ */ jsx(TableFooter, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
1365
2778
  expandActive && /* @__PURE__ */ jsx(TableCell, { padding: "checkbox" }),
1366
2779
  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)),
2780
+ columns.map((column_2) => /* @__PURE__ */ jsx(TableCell, {
2781
+ sx: { textAlign: muiAlign(column_2.align) },
2782
+ children: summaryCells[column_2.key]
2783
+ }, column_2.key)),
1371
2784
  showActions && /* @__PURE__ */ jsx(TableCell, {})
1372
2785
  ] }) })
1373
2786
  ]
@@ -1378,91 +2791,80 @@ function mobileLabel(column) {
1378
2791
  return column.mobileLabel ?? (typeof column.header === "string" ? column.header : column.key);
1379
2792
  }
1380
2793
  /** 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 }) {
2794
+ function MobileCards(t0) {
2795
+ const $ = c(48);
2796
+ const { table, rows, rowActions, confirm, getRowId, size, dir, onRowClick, rowClassName, renderRowDetail, summaryRow, expansion, rowEntries, paddingTop: t1, paddingBottom: t2, measureElement } = t0;
2797
+ const paddingTop = t1 === void 0 ? 0 : t1;
2798
+ const paddingBottom = t2 === void 0 ? 0 : t2;
1382
2799
  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, {
2800
+ let T0;
2801
+ let compact;
2802
+ let summaryCells;
2803
+ let t3;
2804
+ let t4;
2805
+ let t5;
2806
+ let t6;
2807
+ let t7;
2808
+ 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) {
2809
+ const entries = resolveVirtualRows(rows, getRowId, rowEntries);
2810
+ compact = size === "small";
2811
+ const expand = expansion && renderRowDetail ? expansion : void 0;
2812
+ let t8;
2813
+ if ($[26] !== rows || $[27] !== summaryRow) {
2814
+ t8 = summaryRow?.(rows);
2815
+ $[26] = rows;
2816
+ $[27] = summaryRow;
2817
+ $[28] = t8;
2818
+ } else t8 = $[28];
2819
+ summaryCells = t8;
2820
+ T0 = Stack;
2821
+ t3 = compact ? 1 : 1.5;
2822
+ t4 = "list";
2823
+ let t9;
2824
+ if ($[29] !== table) {
2825
+ t9 = table.getTableProps();
2826
+ $[29] = table;
2827
+ $[30] = t9;
2828
+ } else t9 = $[30];
2829
+ t5 = t9["aria-label"];
2830
+ if ($[31] !== paddingTop) {
2831
+ t6 = paddingTop > 0 && /* @__PURE__ */ jsx(Box, {
1393
2832
  "aria-hidden": true,
1394
2833
  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, {
2834
+ });
2835
+ $[31] = paddingTop;
2836
+ $[32] = t6;
2837
+ } else t6 = $[32];
2838
+ t7 = entries.map((t10) => {
2839
+ const { row, index, key } = t10;
2840
+ const id = getRowId(row);
2841
+ return /* @__PURE__ */ jsx(Card, {
2842
+ ref: measureElement,
2843
+ "data-index": index,
1455
2844
  variant: "outlined",
1456
2845
  role: "listitem",
1457
- children: /* @__PURE__ */ jsx(CardContent, {
2846
+ className: rowClassName?.(row, index),
2847
+ ...rowClickProps(row, onRowClick),
2848
+ children: /* @__PURE__ */ jsxs(CardContent, {
1458
2849
  sx: compact ? {
1459
2850
  p: 1.25,
1460
2851
  "&:last-child": { pb: 1.25 }
1461
2852
  } : 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, {
2853
+ children: [
2854
+ selection && /* @__PURE__ */ jsx(Checkbox, {
2855
+ slotProps: { input: { "aria-label": labels.selectRow } },
2856
+ checked: selection.isSelected(id),
2857
+ onChange: () => selection.toggle(id)
2858
+ }),
2859
+ expand && /* @__PURE__ */ jsx(ExpandToggle, {
2860
+ id,
2861
+ expanded: expand.isExpanded(id),
2862
+ onToggle: expand.toggle,
2863
+ dir,
2864
+ expandLabel: labels.expandRow,
2865
+ collapseLabel: labels.collapseRow
2866
+ }),
2867
+ columns.map((column) => /* @__PURE__ */ jsxs(Box, {
1466
2868
  sx: { mb: compact ? .5 : 1 },
1467
2869
  children: [/* @__PURE__ */ jsx(Typography, {
1468
2870
  variant: "caption",
@@ -1472,18 +2874,129 @@ function MobileCards({ table, rows, rowActions, confirm, getRowId, size, dir, on
1472
2874
  }), /* @__PURE__ */ jsx(Typography, {
1473
2875
  component: "div",
1474
2876
  variant: "body2",
1475
- children: value
2877
+ children: column.Cell ? /* @__PURE__ */ jsx(column.Cell, {
2878
+ row,
2879
+ rowIndex: index
2880
+ }) : column.accessor?.(row)
1476
2881
  })]
1477
- }, column.key);
1478
- })
2882
+ }, column.key)),
2883
+ rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx(RowActionButtons, {
2884
+ row,
2885
+ actions: rowActions,
2886
+ confirm,
2887
+ cancelLabel: labels.cancel
2888
+ }),
2889
+ expand?.isExpanded(id) && /* @__PURE__ */ jsx(Box, {
2890
+ sx: { mt: 1 },
2891
+ children: renderRowDetail(row)
2892
+ })
2893
+ ]
2894
+ })
2895
+ }, key);
2896
+ });
2897
+ $[0] = columns;
2898
+ $[1] = confirm;
2899
+ $[2] = dir;
2900
+ $[3] = expansion;
2901
+ $[4] = getRowId;
2902
+ $[5] = labels;
2903
+ $[6] = measureElement;
2904
+ $[7] = onRowClick;
2905
+ $[8] = paddingTop;
2906
+ $[9] = renderRowDetail;
2907
+ $[10] = rowActions;
2908
+ $[11] = rowClassName;
2909
+ $[12] = rowEntries;
2910
+ $[13] = rows;
2911
+ $[14] = selection;
2912
+ $[15] = size;
2913
+ $[16] = summaryRow;
2914
+ $[17] = table;
2915
+ $[18] = T0;
2916
+ $[19] = compact;
2917
+ $[20] = summaryCells;
2918
+ $[21] = t3;
2919
+ $[22] = t4;
2920
+ $[23] = t5;
2921
+ $[24] = t6;
2922
+ $[25] = t7;
2923
+ } else {
2924
+ T0 = $[18];
2925
+ compact = $[19];
2926
+ summaryCells = $[20];
2927
+ t3 = $[21];
2928
+ t4 = $[22];
2929
+ t5 = $[23];
2930
+ t6 = $[24];
2931
+ t7 = $[25];
2932
+ }
2933
+ let t8;
2934
+ if ($[33] !== columns || $[34] !== compact || $[35] !== summaryCells) {
2935
+ t8 = summaryCells && /* @__PURE__ */ jsx(Card, {
2936
+ variant: "outlined",
2937
+ role: "listitem",
2938
+ children: /* @__PURE__ */ jsx(CardContent, {
2939
+ sx: compact ? {
2940
+ p: 1.25,
2941
+ "&:last-child": { pb: 1.25 }
2942
+ } : void 0,
2943
+ children: columns.map((column_0) => {
2944
+ const value = summaryCells[column_0.key];
2945
+ if (value === void 0) return null;
2946
+ return /* @__PURE__ */ jsxs(Box, {
2947
+ sx: { mb: compact ? .5 : 1 },
2948
+ children: [/* @__PURE__ */ jsx(Typography, {
2949
+ variant: "caption",
2950
+ color: "text.secondary",
2951
+ sx: { display: "block" },
2952
+ children: mobileLabel(column_0)
2953
+ }), /* @__PURE__ */ jsx(Typography, {
2954
+ component: "div",
2955
+ variant: "body2",
2956
+ children: value
2957
+ })]
2958
+ }, column_0.key);
1479
2959
  })
1480
- }),
1481
- paddingBottom > 0 && /* @__PURE__ */ jsx(Box, {
1482
- "aria-hidden": true,
1483
- sx: { height: paddingBottom }
1484
2960
  })
1485
- ]
1486
- });
2961
+ });
2962
+ $[33] = columns;
2963
+ $[34] = compact;
2964
+ $[35] = summaryCells;
2965
+ $[36] = t8;
2966
+ } else t8 = $[36];
2967
+ let t9;
2968
+ if ($[37] !== paddingBottom) {
2969
+ t9 = paddingBottom > 0 && /* @__PURE__ */ jsx(Box, {
2970
+ "aria-hidden": true,
2971
+ sx: { height: paddingBottom }
2972
+ });
2973
+ $[37] = paddingBottom;
2974
+ $[38] = t9;
2975
+ } else t9 = $[38];
2976
+ let t10;
2977
+ if ($[39] !== T0 || $[40] !== t3 || $[41] !== t4 || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9) {
2978
+ t10 = /* @__PURE__ */ jsxs(T0, {
2979
+ spacing: t3,
2980
+ role: t4,
2981
+ "aria-label": t5,
2982
+ children: [
2983
+ t6,
2984
+ t7,
2985
+ t8,
2986
+ t9
2987
+ ]
2988
+ });
2989
+ $[39] = T0;
2990
+ $[40] = t3;
2991
+ $[41] = t4;
2992
+ $[42] = t5;
2993
+ $[43] = t6;
2994
+ $[44] = t7;
2995
+ $[45] = t8;
2996
+ $[46] = t9;
2997
+ $[47] = t10;
2998
+ } else t10 = $[47];
2999
+ return t10;
1487
3000
  }
1488
3001
  //#endregion
1489
3002
  //#region src/DataTable.tsx
@@ -1513,7 +3026,7 @@ function resolveActionsColumn(declared, layout) {
1513
3026
  return {
1514
3027
  hasRowActions,
1515
3028
  rowActions,
1516
- actionsPinned: rowActions !== void 0 && layout.state.pinned[ACTIONS_COLUMN_KEY] === "right"
3029
+ actionsPinned: rowActions !== void 0 && layout.state.pinned[ACTIONS_COLUMN_KEY] === "end"
1517
3030
  };
1518
3031
  }
1519
3032
  /**
@@ -1524,35 +3037,78 @@ function resolveActionsColumn(declared, layout) {
1524
3037
  * runtime's chip-label resolvers merge under any caller overrides.
1525
3038
  */
1526
3039
  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
- });
3040
+ const $ = c(24);
3041
+ const t0 = props.urlSync === false ? void 0 : props.urlAdapter;
3042
+ let t1;
3043
+ 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) {
3044
+ t1 = {
3045
+ locale: props.locale,
3046
+ source: props.source,
3047
+ data: props.data,
3048
+ total: props.total,
3049
+ loading: props.loading,
3050
+ onQueryChange: props.onQueryChange,
3051
+ columns: props.columns,
3052
+ filters: props.filters,
3053
+ adapter: t0,
3054
+ enabled: props.urlSync,
3055
+ urlKey: props.urlKey
3056
+ };
3057
+ $[0] = props.columns;
3058
+ $[1] = props.data;
3059
+ $[2] = props.filters;
3060
+ $[3] = props.loading;
3061
+ $[4] = props.locale;
3062
+ $[5] = props.onQueryChange;
3063
+ $[6] = props.source;
3064
+ $[7] = props.total;
3065
+ $[8] = props.urlKey;
3066
+ $[9] = props.urlSync;
3067
+ $[10] = t0;
3068
+ $[11] = t1;
3069
+ } else t1 = $[11];
3070
+ const { source, runtime } = useTableData(t1);
1540
3071
  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: {
3072
+ if (isDeclarativeFilters(props.filters) || props.filters === void 0) {
3073
+ let t2;
3074
+ if ($[12] !== props.labels || $[13] !== runtime.defs || $[14] !== source) {
3075
+ t2 = runtime.defs.length > 0 ? /* @__PURE__ */ jsx(AutoFilterForm, {
3076
+ defs: runtime.defs,
3077
+ source,
3078
+ labels: resolveLabels(props.labels)
3079
+ }) : void 0;
3080
+ $[12] = props.labels;
3081
+ $[13] = runtime.defs;
3082
+ $[14] = source;
3083
+ $[15] = t2;
3084
+ } else t2 = $[15];
3085
+ filtersNode = t2;
3086
+ } else filtersNode = props.filters;
3087
+ let t2;
3088
+ if ($[16] !== props.filterLabels || $[17] !== runtime.filterLabels) {
3089
+ t2 = {
1552
3090
  ...runtime.filterLabels,
1553
3091
  ...props.filterLabels
1554
- }
1555
- };
3092
+ };
3093
+ $[16] = props.filterLabels;
3094
+ $[17] = runtime.filterLabels;
3095
+ $[18] = t2;
3096
+ } else t2 = $[18];
3097
+ let t3;
3098
+ if ($[19] !== filtersNode || $[20] !== props || $[21] !== source || $[22] !== t2) {
3099
+ t3 = {
3100
+ ...props,
3101
+ source,
3102
+ filters: filtersNode,
3103
+ filterLabels: t2
3104
+ };
3105
+ $[19] = filtersNode;
3106
+ $[20] = props;
3107
+ $[21] = source;
3108
+ $[22] = t2;
3109
+ $[23] = t3;
3110
+ } else t3 = $[23];
3111
+ return t3;
1556
3112
  }
1557
3113
  /**
1558
3114
  * Batteries-included Material UI data table. Drop in `columns`, `data` (or
@@ -1565,185 +3121,454 @@ function useChromeProps(props) {
1565
3121
  * @typeParam TRow - The row type.
1566
3122
  */
1567
3123
  function DataTable(props) {
3124
+ const $ = c(150);
1568
3125
  const { slots, className } = props;
1569
- const size = tableSize(props.size, props.density);
1570
- const { filtersMode = "popover" } = props;
3126
+ let t0;
3127
+ if ($[0] !== props.density || $[1] !== props.size) {
3128
+ t0 = tableSize(props.size, props.density);
3129
+ $[0] = props.density;
3130
+ $[1] = props.size;
3131
+ $[2] = t0;
3132
+ } else t0 = $[2];
3133
+ const size = t0;
3134
+ const { filtersMode: t1 } = props;
3135
+ const filtersMode = t1 === void 0 ? "popover" : t1;
1571
3136
  const chromeProps = useChromeProps(props);
1572
3137
  const { source, filters: filtersNode } = chromeProps;
1573
- const c = useTableChrome(chromeProps);
1574
- const { table, confirm, getRowId } = c;
3138
+ const c$1 = useTableChrome(chromeProps);
3139
+ const { table, confirm, getRowId } = c$1;
1575
3140
  const { labels } = table;
1576
3141
  const [filtersOpen, setFiltersOpen] = useState(false);
1577
3142
  const filtersTrigger = useFilterTriggerToggle(filtersOpen, setFiltersOpen);
1578
3143
  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
- });
3144
+ useChromeScrollReset(rootRef, c$1, chromeProps);
3145
+ const { virtualization, loadMoreRef, canLoadMore, virtualScrollRef } = useChromeBodyData(c$1, chromeProps);
3146
+ let t2;
3147
+ if ($[3] !== c$1.columnLayout || $[4] !== props.rowActions) {
3148
+ t2 = resolveActionsColumn(props.rowActions, c$1.columnLayout);
3149
+ $[3] = c$1.columnLayout;
3150
+ $[4] = props.rowActions;
3151
+ $[5] = t2;
3152
+ } else t2 = $[5];
3153
+ const { hasRowActions, rowActions, actionsPinned } = t2;
3154
+ let t3;
3155
+ if ($[6] !== c$1.allColumns || $[7] !== c$1.columnLayout || $[8] !== c$1.isMobile || $[9] !== hasRowActions || $[10] !== labels || $[11] !== props.enableColumnMenu) {
3156
+ t3 = props.enableColumnMenu && !c$1.isMobile && /* @__PURE__ */ jsx(ColumnMenu, {
3157
+ allColumns: c$1.allColumns,
3158
+ layout: c$1.columnLayout,
3159
+ labels,
3160
+ hasRowActions
3161
+ });
3162
+ $[6] = c$1.allColumns;
3163
+ $[7] = c$1.columnLayout;
3164
+ $[8] = c$1.isMobile;
3165
+ $[9] = hasRowActions;
3166
+ $[10] = labels;
3167
+ $[11] = props.enableColumnMenu;
3168
+ $[12] = t3;
3169
+ } else t3 = $[12];
3170
+ const columnMenu = t3;
3171
+ let t4;
3172
+ if ($[13] !== labels || $[14] !== props.savedViews || $[15] !== props.urlAdapter || $[16] !== props.urlKey) {
3173
+ t4 = props.savedViews && /* @__PURE__ */ jsx(SavedViewsMenu, {
3174
+ options: {
3175
+ adapter: props.urlAdapter,
3176
+ urlKey: props.urlKey,
3177
+ ...props.savedViews
3178
+ },
3179
+ labels
3180
+ });
3181
+ $[13] = labels;
3182
+ $[14] = props.savedViews;
3183
+ $[15] = props.urlAdapter;
3184
+ $[16] = props.urlKey;
3185
+ $[17] = t4;
3186
+ } else t4 = $[17];
3187
+ const savedViewsMenu = t4;
1596
3188
  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, {
3189
+ if (c$1.body === "skeleton") {
3190
+ let t5;
3191
+ if ($[18] !== labels || $[19] !== props.skeletonRows || $[20] !== slots?.skeleton || $[21] !== source.limit || $[22] !== table.columns) {
3192
+ t5 = slots?.skeleton ?? /* @__PURE__ */ jsx(LoadingState, {
3193
+ rows: props.skeletonRows ?? source.limit,
3194
+ columns: table.columns.length,
3195
+ loadingLabel: labels.loading
3196
+ });
3197
+ $[18] = labels;
3198
+ $[19] = props.skeletonRows;
3199
+ $[20] = slots?.skeleton;
3200
+ $[21] = source.limit;
3201
+ $[22] = table.columns;
3202
+ $[23] = t5;
3203
+ } else t5 = $[23];
3204
+ body = t5;
3205
+ } else if (c$1.body === "empty") {
3206
+ let t5;
3207
+ if ($[24] !== c$1.clearFilters || $[25] !== c$1.emptyVariant || $[26] !== labels || $[27] !== slots?.empty) {
3208
+ t5 = slots?.empty ?? /* @__PURE__ */ jsxs(Stack, {
3209
+ role: "status",
3210
+ spacing: 1.5,
3211
+ sx: {
3212
+ py: 6,
3213
+ alignItems: "center"
3214
+ },
3215
+ children: [/* @__PURE__ */ jsx(Typography, {
3216
+ color: "text.secondary",
3217
+ align: "center",
3218
+ children: c$1.emptyVariant === "noResults" ? labels.noResults : labels.noData
3219
+ }), c$1.emptyVariant === "noResults" && /* @__PURE__ */ jsx(Button, {
3220
+ variant: "outlined",
3221
+ size: "small",
3222
+ onClick: c$1.clearFilters,
3223
+ children: labels.clearAll
3224
+ })]
3225
+ });
3226
+ $[24] = c$1.clearFilters;
3227
+ $[25] = c$1.emptyVariant;
3228
+ $[26] = labels;
3229
+ $[27] = slots?.empty;
3230
+ $[28] = t5;
3231
+ } else t5 = $[28];
3232
+ body = t5;
3233
+ } else if (c$1.body === "mobile") {
3234
+ const t5 = c$1.detail?.expansion;
3235
+ const t6 = virtualization.enabled ? virtualization.rows : void 0;
3236
+ let t7;
3237
+ 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) {
3238
+ t7 = /* @__PURE__ */ jsx(MobileCards, {
3239
+ table,
3240
+ rows: source.rows,
3241
+ rowActions,
3242
+ confirm,
3243
+ getRowId,
3244
+ size,
3245
+ dir: props.dir,
3246
+ onRowClick: props.onRowClick,
3247
+ rowClassName: props.rowClassName,
3248
+ renderRowDetail: props.renderRowDetail,
3249
+ summaryRow: props.summaryRow,
3250
+ expansion: t5,
3251
+ rowEntries: t6,
3252
+ paddingTop: virtualization.paddingTop,
3253
+ paddingBottom: virtualization.paddingBottom,
3254
+ measureElement: virtualization.measureElement
3255
+ });
3256
+ $[29] = confirm;
3257
+ $[30] = getRowId;
3258
+ $[31] = props.dir;
3259
+ $[32] = props.onRowClick;
3260
+ $[33] = props.renderRowDetail;
3261
+ $[34] = props.rowClassName;
3262
+ $[35] = props.summaryRow;
3263
+ $[36] = rowActions;
3264
+ $[37] = size;
3265
+ $[38] = source.rows;
3266
+ $[39] = t5;
3267
+ $[40] = t6;
3268
+ $[41] = table;
3269
+ $[42] = virtualization.measureElement;
3270
+ $[43] = virtualization.paddingBottom;
3271
+ $[44] = virtualization.paddingTop;
3272
+ $[45] = t7;
3273
+ } else t7 = $[45];
3274
+ body = t7;
3275
+ } else {
3276
+ const t5 = source.rows;
3277
+ const t6 = props.dir;
3278
+ const t7 = props.prefetch;
3279
+ const t8 = props.onRowClick;
3280
+ const t9 = props.rowClassName;
3281
+ const t10 = props.renderRowDetail;
3282
+ const t11 = props.summaryRow;
3283
+ const t12 = c$1.detail?.expansion;
3284
+ const t13 = virtualization.enabled ? virtualization.rows : void 0;
3285
+ const t14 = virtualization.paddingTop;
3286
+ const t15 = virtualization.paddingBottom;
3287
+ const t16 = virtualization.measureElement;
3288
+ const t17 = props.stickyHeader;
3289
+ const t18 = props.stickyTop;
3290
+ const t19 = c$1.columnLayout.pinOffset;
3291
+ const t20 = props.maxHeight;
3292
+ let t21;
3293
+ if ($[46] !== c$1.columnLayout.setWidth || $[47] !== props.resizableColumns) {
3294
+ t21 = resizeSetter(props.resizableColumns, c$1.columnLayout.setWidth);
3295
+ $[46] = c$1.columnLayout.setWidth;
3296
+ $[47] = props.resizableColumns;
3297
+ $[48] = t21;
3298
+ } else t21 = $[48];
3299
+ let t22;
3300
+ 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) {
3301
+ t22 = /* @__PURE__ */ jsx(DesktopTable, {
3302
+ table,
3303
+ rows: t5,
3304
+ rowActions,
3305
+ actionsPinned,
3306
+ confirm,
3307
+ getRowId,
3308
+ size,
3309
+ dir: t6,
3310
+ prefetch: t7,
3311
+ onRowClick: t8,
3312
+ rowClassName: t9,
3313
+ renderRowDetail: t10,
3314
+ summaryRow: t11,
3315
+ expansion: t12,
3316
+ rowEntries: t13,
3317
+ paddingTop: t14,
3318
+ paddingBottom: t15,
3319
+ measureElement: t16,
3320
+ stickyHeader: t17,
3321
+ stickyTop: t18,
3322
+ pinOffset: t19,
3323
+ maxHeight: t20,
3324
+ virtualScrollRef,
3325
+ setWidth: t21,
3326
+ columnWidths: c$1.columnLayout.state.widths,
3327
+ resizeLabel: labels.resizeColumn
3328
+ });
3329
+ $[49] = actionsPinned;
3330
+ $[50] = c$1.columnLayout.pinOffset;
3331
+ $[51] = c$1.columnLayout.state.widths;
3332
+ $[52] = confirm;
3333
+ $[53] = getRowId;
3334
+ $[54] = labels.resizeColumn;
3335
+ $[55] = props.dir;
3336
+ $[56] = props.maxHeight;
3337
+ $[57] = props.onRowClick;
3338
+ $[58] = props.prefetch;
3339
+ $[59] = props.renderRowDetail;
3340
+ $[60] = props.rowClassName;
3341
+ $[61] = props.stickyHeader;
3342
+ $[62] = props.stickyTop;
3343
+ $[63] = props.summaryRow;
3344
+ $[64] = rowActions;
3345
+ $[65] = size;
3346
+ $[66] = source.rows;
3347
+ $[67] = t12;
3348
+ $[68] = t13;
3349
+ $[69] = t21;
3350
+ $[70] = table;
3351
+ $[71] = virtualScrollRef;
3352
+ $[72] = virtualization.measureElement;
3353
+ $[73] = virtualization.paddingBottom;
3354
+ $[74] = virtualization.paddingTop;
3355
+ $[75] = t22;
3356
+ } else t22 = $[75];
3357
+ body = t22;
3358
+ }
3359
+ const t5 = props.dir;
3360
+ const t6 = c$1.isRefreshing || void 0;
3361
+ let t7;
3362
+ if ($[76] === Symbol.for("react.memo_cache_sentinel")) {
3363
+ t7 = { p: 1.5 };
3364
+ $[76] = t7;
3365
+ } else t7 = $[76];
3366
+ const t8 = props.hideSearch;
3367
+ const t9 = props.searchPlaceholder;
3368
+ const t10 = props.sortByOptions;
3369
+ let t11;
3370
+ if ($[77] !== props.toolbar || $[78] !== savedViewsMenu) {
3371
+ t11 = /* @__PURE__ */ jsxs(Fragment, { children: [savedViewsMenu, props.toolbar] });
3372
+ $[77] = props.toolbar;
3373
+ $[78] = savedViewsMenu;
3374
+ $[79] = t11;
3375
+ } else t11 = $[79];
3376
+ const t12 = Boolean(filtersNode);
3377
+ let t13;
3378
+ if ($[80] === Symbol.for("react.memo_cache_sentinel")) {
3379
+ t13 = () => setFiltersOpen(false);
3380
+ $[80] = t13;
3381
+ } else t13 = $[80];
3382
+ let t14;
3383
+ 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) {
3384
+ t14 = /* @__PURE__ */ jsx(Toolbar, {
3385
+ table,
3386
+ hideSearch: t8,
3387
+ searchPlaceholder: t9,
3388
+ sortByOptions: t10,
3389
+ customToolbar: t11,
3390
+ hasFilters: t12,
3391
+ activeFilterCount: c$1.activeFilterCount,
3392
+ showRowsPerPage: canLoadMore,
3393
+ filtersMode,
3394
+ filters: filtersNode,
3395
+ filtersOpen,
3396
+ onToggleFilters: filtersTrigger.onClick,
3397
+ onFiltersTriggerPointerDown: filtersTrigger.onPointerDown,
3398
+ onCloseFilters: t13,
3399
+ onClearFilters: c$1.clearFilters,
3400
+ dir: props.dir,
3401
+ columnMenu
3402
+ });
3403
+ $[81] = c$1.activeFilterCount;
3404
+ $[82] = c$1.clearFilters;
3405
+ $[83] = canLoadMore;
3406
+ $[84] = columnMenu;
3407
+ $[85] = filtersMode;
3408
+ $[86] = filtersNode;
3409
+ $[87] = filtersOpen;
3410
+ $[88] = filtersTrigger.onClick;
3411
+ $[89] = filtersTrigger.onPointerDown;
3412
+ $[90] = props.dir;
3413
+ $[91] = props.hideSearch;
3414
+ $[92] = props.searchPlaceholder;
3415
+ $[93] = props.sortByOptions;
3416
+ $[94] = t11;
3417
+ $[95] = t12;
3418
+ $[96] = table;
3419
+ $[97] = t14;
3420
+ } else t14 = $[97];
3421
+ let t15;
3422
+ if ($[98] !== c$1.isRefreshing || $[99] !== labels) {
3423
+ t15 = c$1.isRefreshing && /* @__PURE__ */ jsx(LinearProgress, { "aria-label": labels.loading });
3424
+ $[98] = c$1.isRefreshing;
3425
+ $[99] = labels;
3426
+ $[100] = t15;
3427
+ } else t15 = $[100];
3428
+ let t16;
3429
+ if ($[101] !== c$1.clearFilters || $[102] !== c$1.mergedChips || $[103] !== labels) {
3430
+ t16 = /* @__PURE__ */ jsx(Chips, {
3431
+ chips: c$1.mergedChips,
3432
+ onClearAll: c$1.clearFilters,
3433
+ labels
3434
+ });
3435
+ $[101] = c$1.clearFilters;
3436
+ $[102] = c$1.mergedChips;
3437
+ $[103] = labels;
3438
+ $[104] = t16;
3439
+ } else t16 = $[104];
3440
+ let t17;
3441
+ if ($[105] !== confirm || $[106] !== labels || $[107] !== props.bulkActions || $[108] !== source.total || $[109] !== table.selection) {
3442
+ t17 = table.selection && props.bulkActions && /* @__PURE__ */ jsx(BulkBar, {
3443
+ selection: table.selection,
3444
+ total: source.total,
3445
+ bulkActions: props.bulkActions,
3446
+ confirm,
3447
+ labels
3448
+ });
3449
+ $[105] = confirm;
3450
+ $[106] = labels;
3451
+ $[107] = props.bulkActions;
3452
+ $[108] = source.total;
3453
+ $[109] = table.selection;
3454
+ $[110] = t17;
3455
+ } else t17 = $[110];
3456
+ let t18;
3457
+ if ($[111] !== body || $[112] !== labels || $[113] !== source) {
3458
+ t18 = source.error ? /* @__PURE__ */ jsx(ErrorState, {
3459
+ error: source.error,
3460
+ labels,
3461
+ onRetry: source.refetch ? () => void source.refetch?.() : void 0
3462
+ }) : body;
3463
+ $[111] = body;
3464
+ $[112] = labels;
3465
+ $[113] = source;
3466
+ $[114] = t18;
3467
+ } else t18 = $[114];
3468
+ let t19;
3469
+ if ($[115] !== canLoadMore || $[116] !== labels || $[117] !== loadMoreRef || $[118] !== source) {
3470
+ t19 = canLoadMore && source.hasNextPage && /* @__PURE__ */ jsx(Box, {
3471
+ ref: loadMoreRef,
3472
+ sx: {
3473
+ display: "flex",
3474
+ justifyContent: "center",
3475
+ py: 1
3476
+ },
3477
+ children: /* @__PURE__ */ jsx(Button, {
3478
+ variant: "outlined",
3479
+ size: "small",
3480
+ disabled: source.isFetchingNextPage,
3481
+ onClick: () => source.fetchNextPage(),
3482
+ children: labels.loadMore
3483
+ })
3484
+ });
3485
+ $[115] = canLoadMore;
3486
+ $[116] = labels;
3487
+ $[117] = loadMoreRef;
3488
+ $[118] = source;
3489
+ $[119] = t19;
3490
+ } else t19 = $[119];
3491
+ let t20;
3492
+ if ($[120] !== c$1.showFooter || $[121] !== labels || $[122] !== source.limit || $[123] !== source.setLimit || $[124] !== source.setPage || $[125] !== source.total || $[126] !== table.pagination) {
3493
+ t20 = c$1.showFooter && /* @__PURE__ */ jsx(Footer, {
3494
+ pagination: table.pagination,
3495
+ total: source.total,
3496
+ limit: source.limit,
3497
+ setPage: source.setPage,
3498
+ setLimit: source.setLimit,
3499
+ labels
3500
+ });
3501
+ $[120] = c$1.showFooter;
3502
+ $[121] = labels;
3503
+ $[122] = source.limit;
3504
+ $[123] = source.setLimit;
3505
+ $[124] = source.setPage;
3506
+ $[125] = source.total;
3507
+ $[126] = table.pagination;
3508
+ $[127] = t20;
3509
+ } else t20 = $[127];
3510
+ let t21;
3511
+ if ($[128] !== t14 || $[129] !== t15 || $[130] !== t16 || $[131] !== t17 || $[132] !== t18 || $[133] !== t19 || $[134] !== t20) {
3512
+ t21 = /* @__PURE__ */ jsxs(Stack, {
1674
3513
  spacing: 1.5,
1675
3514
  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
- })
3515
+ t14,
3516
+ t15,
3517
+ t16,
3518
+ t17,
3519
+ t18,
3520
+ t19,
3521
+ t20
1736
3522
  ]
1737
- }), filtersNode && filtersMode === "drawer" && /* @__PURE__ */ jsx(FilterDrawer, {
3523
+ });
3524
+ $[128] = t14;
3525
+ $[129] = t15;
3526
+ $[130] = t16;
3527
+ $[131] = t17;
3528
+ $[132] = t18;
3529
+ $[133] = t19;
3530
+ $[134] = t20;
3531
+ $[135] = t21;
3532
+ } else t21 = $[135];
3533
+ let t22;
3534
+ if ($[136] !== c$1.activeFilterCount || $[137] !== c$1.clearFilters || $[138] !== filtersMode || $[139] !== filtersNode || $[140] !== filtersOpen || $[141] !== labels || $[142] !== props.dir) {
3535
+ t22 = filtersNode && filtersMode === "drawer" && /* @__PURE__ */ jsx(FilterDrawer, {
1738
3536
  open: filtersOpen,
1739
3537
  onClose: () => setFiltersOpen(false),
1740
3538
  filters: filtersNode,
1741
- activeFilterCount: c.activeFilterCount,
1742
- onClearFilters: c.clearFilters,
3539
+ activeFilterCount: c$1.activeFilterCount,
3540
+ onClearFilters: c$1.clearFilters,
1743
3541
  labels,
1744
3542
  dir: props.dir
1745
- })]
1746
- });
3543
+ });
3544
+ $[136] = c$1.activeFilterCount;
3545
+ $[137] = c$1.clearFilters;
3546
+ $[138] = filtersMode;
3547
+ $[139] = filtersNode;
3548
+ $[140] = filtersOpen;
3549
+ $[141] = labels;
3550
+ $[142] = props.dir;
3551
+ $[143] = t22;
3552
+ } else t22 = $[143];
3553
+ let t23;
3554
+ if ($[144] !== className || $[145] !== props.dir || $[146] !== t21 || $[147] !== t22 || $[148] !== t6) {
3555
+ t23 = /* @__PURE__ */ jsxs(Paper, {
3556
+ ref: rootRef,
3557
+ variant: "outlined",
3558
+ dir: t5,
3559
+ className,
3560
+ "aria-busy": t6,
3561
+ sx: t7,
3562
+ children: [t21, t22]
3563
+ });
3564
+ $[144] = className;
3565
+ $[145] = props.dir;
3566
+ $[146] = t21;
3567
+ $[147] = t22;
3568
+ $[148] = t6;
3569
+ $[149] = t23;
3570
+ } else t23 = $[149];
3571
+ return t23;
1747
3572
  }
1748
3573
  //#endregion
1749
3574
  export { DataTable, SavedViewsMenu, createHistoryAdapter, createMemoryAdapter, defaultConfirm, defaultLabels, deriveSortByOptions, getHistoryAdapter, useBackendData, useDataTable, useFrontendData, useSavedViews, useTableUrlState };