@adapttable/mui 0.2.1 → 0.2.2

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