@ynput/ayon-frontend-shared 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/DetailsPanel.es.js +39 -39
  2. package/dist/ListTable.es.js +738 -651
  3. package/dist/NewEntity.es.js +2 -2
  4. package/dist/ProjectTreeTable.es.js +827 -827
  5. package/dist/Slicer.es.js +10 -10
  6. package/dist/Views.es.js +36 -34
  7. package/dist/chunks/ColumnDropIndicator.es.js +27 -21
  8. package/dist/chunks/EntityPickerDialog.es.js +19 -19
  9. package/dist/chunks/Feed.es.js +77 -77
  10. package/dist/chunks/FilmstripEntityCard.es.js +1 -1
  11. package/dist/chunks/MetaWidget.es.js +444 -439
  12. package/dist/chunks/ReviewablesSelector.es.js +1 -1
  13. package/dist/chunks/Slicer.es.js +32 -32
  14. package/dist/chunks/TableExportContextInstance.es.js +408 -469
  15. package/dist/chunks/Watchers.es.js +1 -1
  16. package/dist/chunks/getUris.es.js +1069 -1057
  17. package/dist/chunks/useLocalStorage.es.js +78 -0
  18. package/dist/components.es.js +50 -50
  19. package/dist/context.es.js +348 -337
  20. package/dist/hooks.es.js +218 -187
  21. package/dist/types/Actions.d.ts +17 -16
  22. package/dist/types/ContextMenu.d.ts +17 -16
  23. package/dist/types/DetailsPanel.d.ts +17 -16
  24. package/dist/types/EntityPickerDialog.d.ts +17 -16
  25. package/dist/types/Feed.d.ts +17 -16
  26. package/dist/types/ListTable.d.ts +27 -17
  27. package/dist/types/NewEntity.d.ts +17 -16
  28. package/dist/types/ProjectTreeTable.d.ts +18 -16
  29. package/dist/types/ProjectsTable.d.ts +17 -16
  30. package/dist/types/RepresentationsList.d.ts +17 -16
  31. package/dist/types/SimpleTable.d.ts +17 -16
  32. package/dist/types/Slicer.d.ts +17 -16
  33. package/dist/types/Views.d.ts +18 -17
  34. package/dist/types/api.d.ts +18 -17
  35. package/dist/types/components.d.ts +18 -17
  36. package/dist/types/context.d.ts +26 -17
  37. package/dist/types/hooks.d.ts +20 -17
  38. package/dist/types/index.d.ts +17 -16
  39. package/dist/types/util.d.ts +17 -16
  40. package/package.json +1 -1
@@ -1,16 +1,16 @@
1
- import { jsx as a, Fragment as De, jsxs as M } from "react/jsx-runtime";
2
- import Gt, { useState as L, useEffect as Mt, useRef as At, useCallback as O, useMemo as tt } from "react";
3
- import A from "clsx";
4
- import { flexRender as nt, useReactTable as Ee, getSortedRowModel as Re, getExpandedRowModel as Se, getCoreRowModel as we } from "@tanstack/react-table";
5
- import { Button as ze, Icon as Ie } from "@ynput/ayon-react-components";
1
+ import { jsx as d, Fragment as Ot, jsxs as M } from "react/jsx-runtime";
2
+ import Fe, { useState as G, useEffect as ne, useRef as Be, useCallback as O, useMemo as ie, useId as Nt } from "react";
3
+ import $ from "clsx";
4
+ import { flexRender as ae, useReactTable as jt, getSortedRowModel as Kt, getExpandedRowModel as Wt, getCoreRowModel as Pt } from "@tanstack/react-table";
5
+ import { Button as Ft, Icon as Bt } from "@ynput/ayon-react-components";
6
6
  import "./chunks/FilmstripEntityCard.es.js";
7
7
  import "date-fns";
8
- import { D as Te, B as Ve, T as _e, E as ke, j as Le } from "./chunks/MetaWidget.es.js";
8
+ import { D as Yt, B as Ut, T as Xt, E as Jt, j as qt } from "./chunks/MetaWidget.es.js";
9
9
  import "react-toastify";
10
10
  import "lodash";
11
11
  import "primereact/confirmdialog";
12
12
  import "uuid";
13
- import { bD as Ge } from "./chunks/searchTerms.es.js";
13
+ import { bD as Qt } from "./chunks/searchTerms.es.js";
14
14
  import "axios";
15
15
  import "lexical";
16
16
  import "@lexical/markdown";
@@ -22,31 +22,31 @@ import "@lexical/selection";
22
22
  import "@lexical/utils";
23
23
  import "@lexical/react/LexicalBlockWithAlignableContents";
24
24
  import "@lexical/react/LexicalDecoratorBlockNode";
25
- import { dK as vt, dL as Me } from "./chunks/getUris.es.js";
26
- import { u as Ae } from "./chunks/TableExportContextInstance.es.js";
25
+ import { dK as Ve, dL as Zt } from "./chunks/getUris.es.js";
26
+ import { u as eo } from "./chunks/TableExportContextInstance.es.js";
27
27
  import "@ynput/ayon-addon";
28
28
  import "@module-federation/enhanced/runtime";
29
29
  import "@ynput/ayon-addon/host";
30
30
  import "semver";
31
- import { u as He } from "./chunks/useCreateContextMenu.es.js";
31
+ import { u as to } from "./chunks/useCreateContextMenu.es.js";
32
32
  import "react-dom";
33
33
  import "react-router-dom";
34
34
  import "react-redux";
35
- import { useVirtualizer as Oe } from "@tanstack/react-virtual";
36
- import { useSensors as $e, useSensor as Ct, PointerSensor as Ne, KeyboardSensor as je, DndContext as xt, closestCenter as Dt, DragOverlay as Et, defaultDropAnimationSideEffects as Rt } from "@dnd-kit/core";
37
- import { restrictToHorizontalAxis as Ke, restrictToVerticalAxis as We } from "@dnd-kit/modifiers";
38
- import { useSortable as Ht, sortableKeyboardCoordinates as Pe, arrayMove as Fe, SortableContext as St, horizontalListSortingStrategy as Be, verticalListSortingStrategy as Ye } from "@dnd-kit/sortable";
39
- import { CSS as Ot } from "@dnd-kit/utilities";
35
+ import { useVirtualizer as oo } from "@tanstack/react-virtual";
36
+ import { useSensors as no, useSensor as _e, PointerSensor as io, KeyboardSensor as ro, DndContext as ke, closestCenter as Le, DragOverlay as Ge, defaultDropAnimationSideEffects as Ae } from "@dnd-kit/core";
37
+ import { restrictToHorizontalAxis as so, restrictToVerticalAxis as ao } from "@dnd-kit/modifiers";
38
+ import { useSortable as Ye, sortableKeyboardCoordinates as lo, arrayMove as co, SortableContext as He, horizontalListSortingStrategy as uo, verticalListSortingStrategy as go } from "@dnd-kit/sortable";
39
+ import { CSS as Ue } from "@dnd-kit/utilities";
40
40
  import v from "styled-components";
41
- import { H as Ue } from "./chunks/addonColumnTags.es.js";
41
+ import { H as po } from "./chunks/addonColumnTags.es.js";
42
42
  import "./chunks/ContextMenuContextInstance.es.js";
43
43
  import "./chunks/Menu.es.js";
44
44
  import "./chunks/EmptyPlaceholder.es.js";
45
45
  import "./chunks/EmptyPlaceholderFlex.styled.es.js";
46
46
  import "./chunks/InfoMessage.es.js";
47
- import { C as Xe } from "./chunks/ColumnHeaderMenuUI.es.js";
47
+ import { C as mo } from "./chunks/ColumnHeaderMenuUI.es.js";
48
48
  import "primereact-context/contextmenu";
49
- const $t = v.tr`
49
+ const Xe = 32, re = 32, Je = v.tr`
50
50
  display: flex;
51
51
  position: absolute;
52
52
  top: 0;
@@ -137,7 +137,7 @@ const $t = v.tr`
137
137
  }
138
138
  }
139
139
  }
140
- `, wt = v.td`
140
+ `, $e = v.td`
141
141
  position: relative;
142
142
  height: 100%;
143
143
 
@@ -157,7 +157,7 @@ const $t = v.tr`
157
157
  &:focus-visible {
158
158
  outline: none;
159
159
  }
160
- `, zt = v.div`
160
+ `, Me = v.div`
161
161
  position: absolute;
162
162
  inset: 0;
163
163
 
@@ -168,7 +168,7 @@ const $t = v.tr`
168
168
  cursor: pointer;
169
169
  box-sizing: border-box;
170
170
  min-width: 0;
171
- `, Je = v.div`
171
+ `, fo = v.div`
172
172
  display: flex;
173
173
  align-items: center;
174
174
  width: 100%;
@@ -176,7 +176,7 @@ const $t = v.tr`
176
176
  color: var(--md-sys-color-on-surface-variant);
177
177
  font-style: italic;
178
178
  pointer-events: none;
179
- `, qe = v.div`
179
+ `, ho = v.div`
180
180
  position: relative;
181
181
  display: flex;
182
182
  align-items: center;
@@ -192,7 +192,7 @@ const $t = v.tr`
192
192
  white-space: nowrap !important;
193
193
  min-width: 0;
194
194
  }
195
- `, Qe = v.div`
195
+ `, bo = v.div`
196
196
  position: relative;
197
197
  display: flex;
198
198
  align-items: center;
@@ -226,7 +226,7 @@ v.div`
226
226
  border-radius: var(--border-radius-m);
227
227
  background-color: var(--md-sys-color-surface-container-low);
228
228
  `;
229
- const Ze = v.div`
229
+ const yo = v.div`
230
230
  position: relative;
231
231
  display: flex;
232
232
  height: 100%;
@@ -253,20 +253,71 @@ const Ze = v.div`
253
253
  position: relative;
254
254
  display: grid;
255
255
  }
256
- `, tn = v.table`
256
+
257
+ &.data {
258
+ padding: 0;
259
+
260
+ table {
261
+ min-width: max-content;
262
+ }
263
+
264
+ thead {
265
+ min-height: ${re}px;
266
+ background-color: var(--md-sys-color-surface-container);
267
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
268
+ }
269
+
270
+ th,
271
+ td {
272
+ flex-shrink: 0;
273
+ }
274
+
275
+ th {
276
+ height: ${re - 1}px;
277
+ }
278
+
279
+ .resize-handle:not(.resizing) {
280
+ background-color: var(--md-sys-color-outline-variant);
281
+ }
282
+
283
+ .table-list-row {
284
+ height: ${Xe}px;
285
+ border-radius: 0;
286
+
287
+ td .inner-td {
288
+ left: 0 !important;
289
+ gap: var(--base-gap-small);
290
+ border: 0;
291
+ border-radius: 0;
292
+ background-color: transparent;
293
+ }
294
+
295
+ &:hover td .inner-td,
296
+ &[data-context-menu-target] td .inner-td {
297
+ background-color: var(--md-sys-color-surface-container-hover);
298
+ }
299
+
300
+ &.selected td .inner-td {
301
+ border: 0;
302
+ background-color: var(--md-sys-color-primary-container);
303
+ color: var(--md-sys-color-on-primary-container);
304
+ }
305
+ }
306
+ }
307
+ `, vo = v.table`
257
308
  width: 100%;
258
309
  text-align: left;
259
310
  font-size: var(--font-size-s);
260
311
  color: var(--md-sys-color-on-surface);
261
312
  display: grid;
262
- `, en = v.thead`
313
+ `, Co = v.thead`
263
314
  display: grid !important;
264
315
  position: sticky;
265
316
  top: 0;
266
317
  min-height: 34px;
267
318
  z-index: 10;
268
319
  background-color: var(--md-sys-color-surface-container-low);
269
- `, nn = v.tr`
320
+ `, xo = v.tr`
270
321
  display: flex;
271
322
  width: 100%;
272
323
  `;
@@ -283,11 +334,11 @@ v.th`
283
334
  white-space: nowrap;
284
335
  min-height: fit-content;
285
336
  `;
286
- const It = v.tbody`
337
+ const Oe = v.tbody`
287
338
  display: grid;
288
339
  width: 100%;
289
340
  position: relative;
290
- `, on = v.tr`
341
+ `, Do = v.tr`
291
342
  position: absolute;
292
343
  top: 0;
293
344
  left: 0;
@@ -296,7 +347,7 @@ const It = v.tbody`
296
347
  justify-content: center;
297
348
  padding: var(--padding-m);
298
349
  color: var(--md-sys-color-outline);
299
- `, rn = v.tr`
350
+ `, Ro = v.tr`
300
351
  display: flex;
301
352
  width: 100%;
302
353
  background-color: var(--md-sys-color-surface-container-high);
@@ -308,7 +359,7 @@ const It = v.tbody`
308
359
  &.inactive {
309
360
  color: var(--md-sys-color-on-surface-variant);
310
361
  }
311
- `, sn = v.th`
362
+ `, wo = v.th`
312
363
  position: relative;
313
364
  background-color: transparent;
314
365
  display: flex;
@@ -362,7 +413,7 @@ const It = v.tbody`
362
413
  &.resizing .resize-handle:not(.resizing) {
363
414
  opacity: 0;
364
415
  }
365
- `, an = v.div`
416
+ `, Eo = v.div`
366
417
  display: flex;
367
418
  align-items: center;
368
419
  gap: 6px;
@@ -374,7 +425,7 @@ const It = v.tbody`
374
425
  color: var(--md-sys-color-on-surface-variant);
375
426
  cursor: pointer;
376
427
  user-select: none;
377
- `, ln = v(ze)`
428
+ `, Io = v(Ft)`
378
429
  &.expander {
379
430
  background-color: unset;
380
431
  padding: 2px;
@@ -384,22 +435,22 @@ const It = v.tbody`
384
435
  }
385
436
  }
386
437
  cursor: pointer;
387
- `, dn = v.td`
438
+ `, To = v.td`
388
439
  position: relative;
389
440
  display: flex;
390
441
  width: 100%;
391
442
  height: 100%;
392
443
  padding: 0;
393
- `, cn = v.span`
444
+ `, zo = v.span`
394
445
  font-weight: 400;
395
446
  color: var(--md-sys-color-outline);
396
447
  opacity: 0.7;
397
- `, un = v.span`
448
+ `, So = v.span`
398
449
  width: 10px;
399
450
  height: 10px;
400
451
  border-radius: 2px;
401
452
  flex-shrink: 0;
402
- `, gn = v.th`
453
+ `, Vo = v.th`
403
454
  position: relative;
404
455
  cursor: grabbing;
405
456
  background-color: var(--md-sys-color-surface-container-high);
@@ -412,7 +463,7 @@ const It = v.tbody`
412
463
  white-space: nowrap;
413
464
  z-index: 50;
414
465
  height: 30px;
415
- `, pn = v.span`
466
+ `, _o = v.span`
416
467
  display: flex;
417
468
  align-items: center;
418
469
  gap: 4px;
@@ -422,7 +473,7 @@ const It = v.tbody`
422
473
  white-space: nowrap;
423
474
  min-width: 0;
424
475
  user-select: none;
425
- `, mn = v.div.attrs({ className: "th-actions" })`
476
+ `, ko = v.div.attrs({ className: "th-actions" })`
426
477
  position: absolute;
427
478
  right: var(--padding-m);
428
479
  top: 50%;
@@ -432,7 +483,7 @@ const It = v.tbody`
432
483
  gap: 2px;
433
484
  flex-shrink: 0;
434
485
  z-index: 1;
435
- `, fn = v.div`
486
+ `, Lo = v.div`
436
487
  position: absolute;
437
488
  right: -3px;
438
489
  top: 0;
@@ -447,251 +498,259 @@ const It = v.tbody`
447
498
  background-color: var(--md-sys-color-primary);
448
499
  opacity: 1;
449
500
  }
450
- `, Nt = (t) => Ge(t), F = (t) => {
451
- if (t == null) return "";
452
- if (typeof t == "string") return t;
453
- if (typeof t == "number" || typeof t == "boolean") return String(t);
454
- if (Array.isArray(t)) return t.join(", ");
501
+ `, qe = (e) => Qt(e), U = (e) => {
502
+ if (e == null) return "";
503
+ if (typeof e == "string") return e;
504
+ if (typeof e == "number" || typeof e == "boolean") return String(e);
505
+ if (Array.isArray(e)) return e.join(", ");
455
506
  try {
456
- return JSON.stringify(t);
507
+ return JSON.stringify(e);
457
508
  } catch {
458
- return String(t);
509
+ return String(e);
459
510
  }
460
- }, jt = ({
461
- value: t,
462
- attributeData: e,
511
+ }, Qe = ({
512
+ value: e,
513
+ attributeData: t,
463
514
  isEditing: n,
464
515
  isReadOnly: r,
465
- startEditing: i,
516
+ startEditing: o,
466
517
  stopEditing: u,
467
- updateValue: s
518
+ updateValue: c
468
519
  }) => {
469
- const m = Array.isArray(t) ? t : t == null ? [] : [t];
470
- return /* @__PURE__ */ a(
471
- ke,
520
+ const p = Array.isArray(e) ? e : e == null ? [] : [e];
521
+ return /* @__PURE__ */ d(
522
+ Jt,
472
523
  {
473
- value: m,
474
- options: e.enum || [],
475
- type: e.type,
524
+ value: p,
525
+ options: t.enum || [],
526
+ type: t.type,
476
527
  isEditing: n,
477
528
  isReadOnly: r,
478
- onOpen: i,
529
+ onOpen: o,
479
530
  onCancelEdit: u,
480
- onChange: (l) => s(l)
531
+ onChange: (s) => c(s)
481
532
  }
482
533
  );
483
- }, Q = (t) => Nt(t.attributeData) ? jt(t) : /* @__PURE__ */ a(
484
- _e,
534
+ }, te = (e) => qe(e.attributeData) ? Qe(e) : /* @__PURE__ */ d(
535
+ Xt,
485
536
  {
486
- value: F(t.value),
487
- type: t.attributeData.type,
488
- columnId: t.columnId,
489
- cellId: t.cellId,
490
- isEditing: t.isEditing,
491
- isReadOnly: t.isReadOnly,
492
- onRequestEdit: () => t.startEditing(),
493
- onCancelEdit: t.stopEditing,
494
- onChange: (e) => t.updateValue(e),
495
- getDraftValue: t.getDraftValue,
496
- setDraftValue: t.setDraftValue
537
+ value: U(e.value),
538
+ type: e.attributeData.type,
539
+ columnId: e.columnId,
540
+ cellId: e.cellId,
541
+ isEditing: e.isEditing,
542
+ isReadOnly: e.isReadOnly,
543
+ onRequestEdit: () => e.startEditing(),
544
+ onCancelEdit: e.stopEditing,
545
+ onChange: (t) => e.updateValue(t),
546
+ getDraftValue: e.getDraftValue,
547
+ setDraftValue: e.setDraftValue
497
548
  }
498
- ), hn = (t) => /* @__PURE__ */ a(
499
- Ve,
549
+ ), Go = (e) => /* @__PURE__ */ d(
550
+ Ut,
500
551
  {
501
- value: !!t.value,
502
- isEditing: t.isEditing,
503
- isReadOnly: t.isReadOnly,
504
- onCancelEdit: t.stopEditing,
505
- onChange: (e) => t.updateValue(e)
552
+ value: !!e.value,
553
+ isEditing: e.isEditing,
554
+ isReadOnly: e.isReadOnly,
555
+ onCancelEdit: e.stopEditing,
556
+ onChange: (t) => e.updateValue(t)
506
557
  }
507
- ), bn = (t) => {
508
- const e = t.row.original.midnightExclusiveFields;
509
- return /* @__PURE__ */ a(
510
- Te,
558
+ ), Ao = (e) => {
559
+ const t = e.row.original.midnightExclusiveFields;
560
+ return /* @__PURE__ */ d(
561
+ Yt,
511
562
  {
512
- value: typeof t.value == "string" ? t.value : void 0,
513
- isEditing: t.isEditing,
514
- isReadOnly: t.isReadOnly,
515
- onCancelEdit: t.stopEditing,
516
- onChange: (n) => t.updateValue(n),
517
- isMidnightExclusive: e?.includes(t.columnId) ?? !1
563
+ value: typeof e.value == "string" ? e.value : void 0,
564
+ isEditing: e.isEditing,
565
+ isReadOnly: e.isReadOnly,
566
+ onCancelEdit: e.stopEditing,
567
+ onChange: (n) => e.updateValue(n),
568
+ isMidnightExclusive: t?.includes(e.columnId) ?? !1
518
569
  }
519
570
  );
520
- }, Z = (t) => Nt(t.attributeData) ? jt(t) : F(t.value), Tt = (t) => F(t.value), yn = {
521
- string: Q,
522
- integer: Q,
523
- float: Q,
524
- boolean: hn,
525
- datetime: bn,
526
- list_of_strings: Z,
527
- list_of_integers: Z,
528
- list_of_any: Z,
529
- list_of_submodels: Tt,
530
- dict: Tt
531
- }, ko = () => yn, Kt = (t, e) => `list-table-cell-${t}-${e}`, vn = (t) => F(t), Vt = "editable", Cn = (t) => !!t && typeof t == "object" && "__listTablePlaceholder" in t, xn = ({
532
- cell: t,
533
- row: e,
571
+ }, oe = (e) => qe(e.attributeData) ? Qe(e) : U(e.value), Ne = (e) => U(e.value), Ho = {
572
+ string: te,
573
+ integer: te,
574
+ float: te,
575
+ boolean: Go,
576
+ datetime: Ao,
577
+ list_of_strings: oe,
578
+ list_of_integers: oe,
579
+ list_of_any: oe,
580
+ list_of_submodels: Ne,
581
+ dict: Ne
582
+ }, Jn = () => Ho, Ze = (e, t) => `list-table-cell-${e}-${t}`, et = (e, t) => `${e}-row-${t}`, tt = (e, t) => {
583
+ const n = e.getVisibleLeafColumns();
584
+ return (n.find((o) => o.columnDef.meta?.listTableGrow) ?? n[n.length - 1])?.id === t;
585
+ }, $o = (e) => U(e), je = "editable", Mo = (e) => !!e && typeof e == "object" && "__listTablePlaceholder" in e, Oo = ({
586
+ cell: e,
587
+ row: t,
534
588
  rowIndex: n,
535
589
  attributeData: r,
536
- dataTypeWidgets: i,
590
+ dataTypeWidgets: o,
537
591
  editingState: u,
538
- callbacks: s,
539
- isReadOnly: m
592
+ callbacks: c,
593
+ isReadOnly: p
540
594
  }) => {
541
- const l = r?.type;
542
- if (!l || !i?.[l])
595
+ const s = r?.type;
596
+ if (!s || !o?.[s])
543
597
  return null;
544
- const E = i[l];
545
- if (!E)
598
+ const x = o[s];
599
+ if (!x)
546
600
  return null;
547
- const R = t.column.id, c = Kt(e.id, R), d = {
548
- row: e,
549
- cell: t,
550
- value: t.getValue(),
601
+ const w = e.column.id, a = Ze(t.id, w), l = {
602
+ row: t,
603
+ cell: e,
604
+ value: e.getValue(),
551
605
  rowIndex: n,
552
- columnId: R,
553
- cellId: c,
606
+ columnId: w,
607
+ cellId: a,
554
608
  attributeData: r,
555
- isEditing: u.editingCellId === c,
556
- isReadOnly: m,
557
- startEditing: () => u.startEditingCell(c),
609
+ isEditing: u.editingCellId === a,
610
+ isReadOnly: p,
611
+ startEditing: () => u.startEditingCell(a),
558
612
  stopEditing: u.stopEditingCell,
559
- updateValue: (C) => {
560
- s.onUpdateRow(R, C, e.id), u.stopEditingCell();
613
+ updateValue: (h) => {
614
+ c.onUpdateRow(w, h, t.id), u.stopEditingCell();
561
615
  },
562
- openViewer: () => s.onOpenViewer?.(e.original),
616
+ openViewer: () => c.onOpenViewer?.(t.original),
563
617
  getDraftValue: u.getDraftValue,
564
618
  setDraftValue: u.setDraftValue
565
619
  };
566
- return E(d);
567
- }, Wt = ({
568
- row: t,
569
- cellWrapper: e,
620
+ return x(l);
621
+ }, ot = ({
622
+ row: e,
623
+ cellWrapper: t,
570
624
  columnAttributeData: n,
571
625
  dataTypeWidgets: r,
572
- editingState: i,
626
+ editingState: o,
573
627
  callbacks: u,
574
- editable: s = !0
628
+ editable: c = !0
575
629
  }) => {
576
- const m = Cn(t.original);
577
- if (m) {
578
- const l = t.original && typeof t.original == "object" && "label" in t.original ? String(t.original.label ?? "") : "";
579
- return /* @__PURE__ */ a(wt, { style: { width: "100%" }, children: /* @__PURE__ */ a(
580
- zt,
630
+ const p = Mo(e.original);
631
+ if (p) {
632
+ const s = e.original && typeof e.original == "object" && "label" in e.original ? String(e.original.label ?? "") : "";
633
+ return /* @__PURE__ */ d($e, { role: "gridcell", style: { width: "100%" }, children: /* @__PURE__ */ d(
634
+ Me,
581
635
  {
582
- style: { left: 0, paddingLeft: `calc(var(--padding-m) + ${t.depth * 16}px)` },
583
- children: /* @__PURE__ */ a(Je, { children: l })
636
+ style: { left: 0, paddingLeft: `calc(var(--padding-m) + ${e.depth * 16}px)` },
637
+ children: /* @__PURE__ */ d(fo, { children: s })
584
638
  }
585
- ) }, `${t.id}-placeholder`);
639
+ ) }, `${e.id}-placeholder`);
586
640
  }
587
- return /* @__PURE__ */ a(De, { children: t.getVisibleCells().map((l, E, R) => {
588
- const c = Kt(t.id, l.column.id), d = n?.[l.column.id], C = !!l.column.columnDef.meta?.listTableCustomCell, g = d?.type, f = !!g && !C, h = !!(g && r?.[g]), b = i.editingCellId === c, x = s && l.column.columnDef.meta?.editable !== !1, T = !f || m ? null : xn({
589
- cell: l,
590
- row: t,
591
- rowIndex: t.index,
592
- attributeData: d,
641
+ return /* @__PURE__ */ d(Ot, { children: e.getVisibleCells().map((s, x, w) => {
642
+ const a = Ze(e.id, s.column.id), l = n?.[s.column.id], h = !!s.column.columnDef.meta?.listTableCustomCell, y = l?.type, R = !!y && !h, g = !!(y && r?.[y]), m = o.editingCellId === a, b = c && s.column.columnDef.meta?.editable !== !1, T = !R || p ? null : Oo({
643
+ cell: s,
644
+ row: e,
645
+ rowIndex: e.index,
646
+ attributeData: l,
593
647
  dataTypeWidgets: r,
594
- editingState: i,
648
+ editingState: o,
595
649
  callbacks: u,
596
- isReadOnly: !x
597
- }), z = !f || m ? nt(l.column.columnDef.cell, l.getContext()) : T ?? vn(l.getValue());
598
- let y = z;
599
- e !== null && (e ? y = e(t, z) || z : y = /* @__PURE__ */ a(qe, { children: z }));
600
- const S = x && f && h && !m;
601
- return S && (y = /* @__PURE__ */ a(
602
- Qe,
650
+ isReadOnly: !b
651
+ }), E = !R || p ? ae(s.column.columnDef.cell, s.getContext()) : T ?? $o(s.getValue());
652
+ let C = E;
653
+ t !== null && (t ? C = t(e, E) || E : C = /* @__PURE__ */ d(ho, { children: E }));
654
+ const _ = b && R && g && !p;
655
+ return _ && (C = /* @__PURE__ */ d(
656
+ bo,
603
657
  {
604
- className: A(Vt, g, { editing: b }),
605
- children: y
658
+ className: $(je, y, { editing: m }),
659
+ children: C
606
660
  }
607
- )), /* @__PURE__ */ a(
608
- wt,
661
+ )), /* @__PURE__ */ d(
662
+ $e,
609
663
  {
610
- id: c,
664
+ id: a,
665
+ role: "gridcell",
611
666
  style: {
612
- width: `calc(var(--col-${l.column.id}-size) * 1px)`,
613
- paddingRight: E === R.length - 1 ? "var(--padding-m)" : void 0,
614
- flexGrow: E === R.length - 1 ? 1 : void 0
667
+ width: `calc(var(--col-${s.column.id}-size) * 1px)`,
668
+ paddingRight: x === w.length - 1 ? "var(--padding-m)" : void 0,
669
+ flexGrow: tt(s.getContext().table, s.column.id) ? 1 : void 0
615
670
  },
616
- onDoubleClick: S ? (w) => {
617
- w.stopPropagation(), i.startEditingCell(c);
671
+ onDoubleClick: _ ? (I) => {
672
+ I.stopPropagation(), o.startEditingCell(a);
618
673
  } : void 0,
619
- onClick: (w) => {
620
- const V = w.target;
621
- if (b && V.closest(".editing"))
622
- w.stopPropagation();
623
- else if (x) {
624
- const H = V.closest(`.${Vt}`), $ = V.closest(
625
- `.${Le}, input, textarea, select, [contenteditable="true"]`
674
+ onClick: (I) => {
675
+ const z = I.target;
676
+ if (m && z.closest(".editing"))
677
+ I.stopPropagation();
678
+ else if (b) {
679
+ const A = z.closest(`.${je}`), k = z.closest(
680
+ `.${qt}, input, textarea, select, [contenteditable="true"]`
626
681
  );
627
- (H || $) && (i.startEditingCell(c), w.stopPropagation());
682
+ (A || k) && (o.startEditingCell(a), I.stopPropagation());
628
683
  }
629
684
  },
630
- children: /* @__PURE__ */ a(
631
- zt,
685
+ children: /* @__PURE__ */ d(
686
+ Me,
632
687
  {
633
688
  className: "inner-td",
634
689
  style: {
635
- left: E === 0 ? `calc(var(--padding-m) + ${t.depth * 16}px)` : void 0
690
+ left: x === 0 ? `calc(var(--padding-m) + ${e.depth * 16}px)` : void 0
636
691
  },
637
- children: y
692
+ children: C
638
693
  }
639
694
  )
640
695
  },
641
- l.id
696
+ s.id
642
697
  );
643
698
  }) });
644
- }, _t = "__group_path__", Dn = (t) => {
645
- if (!t.startsWith(_t)) return null;
646
- const e = t.slice(_t.length), n = e.lastIndexOf("__");
699
+ }, Ke = "__group_path__", No = (e) => {
700
+ if (!e.startsWith(Ke)) return null;
701
+ const t = e.slice(Ke.length), n = t.lastIndexOf("__");
647
702
  if (n === -1) return null;
648
- const r = e.slice(0, n), i = Number(e.slice(n + 2));
649
- return Number.isNaN(i) ? null : { baseColumnId: r, level: i };
650
- }, En = (t) => !!t && typeof t == "object" && ("label" in t || "value" in t), P = (t) => !!t && typeof t == "object" && "__listTableGroup" in t;
651
- function Rn(t, e) {
652
- return e == null ? "(None)" : typeof e == "boolean" ? t === "active" ? e ? "Active" : "Inactive" : t === "library" ? e ? "Library" : "Standard" : e ? "Yes" : "No" : String(e);
703
+ const r = t.slice(0, n), o = Number(t.slice(n + 2));
704
+ return Number.isNaN(o) ? null : { baseColumnId: r, level: o };
705
+ }, jo = (e) => !!e && typeof e == "object" && ("label" in e || "value" in e), Y = (e) => !!e && typeof e == "object" && "__listTableGroup" in e;
706
+ function Ko(e, t) {
707
+ return t == null ? "(None)" : typeof t == "boolean" ? e === "active" ? t ? "Active" : "Inactive" : e === "library" ? t ? "Library" : "Standard" : t ? "Yes" : "No" : String(t);
653
708
  }
654
- function Sn({
655
- groupColumnId: t,
656
- groupValue: e,
709
+ function Wo({
710
+ groupColumnId: e,
711
+ groupValue: t,
657
712
  count: n,
658
713
  countLabel: r,
659
- depth: i,
714
+ depth: o,
660
715
  isExpanded: u,
661
- onToggle: s,
662
- virtualStart: m,
663
- onContextMenu: l
716
+ onToggle: c,
717
+ virtualStart: p,
718
+ rowIndex: s,
719
+ onContextMenu: x
664
720
  }) {
665
- const R = Dn(t)?.baseColumnId ?? t, c = En(e) ? e : void 0, d = c?.value ?? e, C = c?.label ?? Rn(R, d);
666
- return /* @__PURE__ */ a(
667
- $t,
721
+ const a = No(e)?.baseColumnId ?? e, l = jo(t) ? t : void 0, h = l?.value ?? t, y = l?.label ?? Ko(a, h);
722
+ return /* @__PURE__ */ d(
723
+ Je,
668
724
  {
725
+ role: "row",
726
+ "aria-rowindex": s + 2,
727
+ "aria-expanded": u,
669
728
  style: {
670
- transform: `translateY(${m}px)`,
671
- paddingLeft: i * 16
729
+ transform: `translateY(${p}px)`,
730
+ paddingLeft: o * 16
672
731
  },
673
- onClick: s,
674
- onContextMenu: l,
675
- className: A("group-row", { expanded: u }),
676
- children: /* @__PURE__ */ a(dn, { children: /* @__PURE__ */ M(an, { children: [
677
- /* @__PURE__ */ a(
678
- ln,
732
+ onClick: c,
733
+ onContextMenu: x,
734
+ className: $("group-row", { expanded: u }),
735
+ children: /* @__PURE__ */ d(To, { role: "gridcell", children: /* @__PURE__ */ M(Eo, { children: [
736
+ /* @__PURE__ */ d(
737
+ Io,
679
738
  {
680
739
  className: "expander",
681
740
  icon: u ? "expand_more" : "chevron_right",
682
741
  variant: "text"
683
742
  }
684
743
  ),
685
- c?.icon ? /* @__PURE__ */ a(
686
- Ie,
744
+ l?.icon ? /* @__PURE__ */ d(
745
+ Bt,
687
746
  {
688
- icon: c.icon,
689
- style: { color: c.color },
747
+ icon: l.icon,
748
+ style: { color: l.color },
690
749
  filled: !0
691
750
  }
692
- ) : c?.color ? /* @__PURE__ */ a(un, { style: { backgroundColor: c.color } }) : null,
693
- /* @__PURE__ */ a("span", { children: C }),
694
- /* @__PURE__ */ M(cn, { children: [
751
+ ) : l?.color ? /* @__PURE__ */ d(So, { style: { backgroundColor: l.color } }) : null,
752
+ /* @__PURE__ */ d("span", { children: y }),
753
+ /* @__PURE__ */ M(zo, { children: [
695
754
  n,
696
755
  r ? ` ${r}` : ""
697
756
  ] })
@@ -699,522 +758,544 @@ function Sn({
699
758
  }
700
759
  );
701
760
  }
702
- const kt = (t) => !!t && typeof t == "object" && "__listTablePlaceholder" in t;
703
- function wn({
761
+ const We = (e) => !!e && typeof e == "object" && "__listTablePlaceholder" in e;
762
+ function Po({
763
+ tableId: e,
704
764
  row: t,
705
- virtualRow: e,
706
- isSelected: n,
707
- rowIndex: r,
708
- onRowClick: i,
709
- onRowDoubleClick: u,
710
- onRowContextMenu: s,
711
- cellWrapper: m,
712
- columnAttributeData: l,
713
- dataTypeWidgets: E,
714
- editingState: R,
715
- callbacks: c,
716
- editable: d,
717
- isInactive: C
765
+ virtualRow: n,
766
+ isSelected: r,
767
+ rowIndex: o,
768
+ onRowClick: u,
769
+ onRowDoubleClick: c,
770
+ onRowContextMenu: p,
771
+ cellWrapper: s,
772
+ columnAttributeData: x,
773
+ dataTypeWidgets: w,
774
+ editingState: a,
775
+ callbacks: l,
776
+ editable: h,
777
+ isInactive: y,
778
+ rowClassName: R
718
779
  }) {
719
- const g = P(t.original), f = kt(t.original), { transform: h, transition: b, setNodeRef: x, isDragging: T } = Ht({
780
+ const g = Y(t.original), m = We(t.original), { transform: b, transition: T, setNodeRef: E, isDragging: C } = Ye({
720
781
  id: t.id,
721
- disabled: g || f
782
+ disabled: g || m
722
783
  });
723
784
  if (g) {
724
- const S = t.original;
725
- return /* @__PURE__ */ a(
726
- Sn,
785
+ const z = t.original;
786
+ return /* @__PURE__ */ d(
787
+ Wo,
727
788
  {
728
- groupColumnId: S.__groupColumnId,
729
- groupValue: S.__groupValue,
730
- count: t.getLeafRows().filter((w) => {
731
- const V = w.original;
732
- return !kt(V) && !P(V) && V?.entityType !== "folder" && V?.type !== "folder";
789
+ groupColumnId: z.__groupColumnId,
790
+ groupValue: z.__groupValue,
791
+ count: t.getLeafRows().filter((A) => {
792
+ const k = A.original;
793
+ return !We(k) && !Y(k) && k?.entityType !== "folder" && k?.type !== "folder";
733
794
  }).length,
734
795
  depth: t.depth,
735
796
  isExpanded: t.getIsExpanded(),
736
797
  onToggle: t.getToggleExpandedHandler(),
737
- virtualStart: e.start,
738
- onContextMenu: s ? (w) => s(t.id, r, w) : void 0
798
+ virtualStart: n.start,
799
+ rowIndex: o,
800
+ onContextMenu: p ? (A) => p(t.id, o, A) : void 0
739
801
  }
740
802
  );
741
803
  }
742
- const z = `translateY(${e.start}px)`, y = h ? Ot.Transform.toString(h) : "";
743
- return /* @__PURE__ */ a(
744
- $t,
804
+ const _ = `translateY(${n.start}px)`, I = b ? Ue.Transform.toString(b) : "";
805
+ return /* @__PURE__ */ d(
806
+ Je,
745
807
  {
746
- ref: x,
808
+ ref: E,
809
+ id: et(e, o),
810
+ role: "row",
811
+ "aria-rowindex": o + 2,
812
+ "aria-selected": m ? void 0 : r,
747
813
  style: {
748
- transform: `${z} ${y}`,
749
- transition: b
814
+ transform: `${_} ${I}`,
815
+ transition: T
750
816
  },
751
817
  tabIndex: -1,
752
- onClick: (S) => i(t.id, r, S),
753
- onDoubleClick: u ? (S) => u(t.id, r, S) : void 0,
754
- onContextMenu: s ? (S) => s(t.id, r, S) : void 0,
755
- className: A("table-list-row", {
756
- dragging: T,
757
- selected: n,
758
- inactive: C,
759
- "placeholder-row": f
818
+ onClick: (z) => u(t.id, o, z),
819
+ onDoubleClick: c ? (z) => c(t.id, o, z) : void 0,
820
+ onContextMenu: p ? (z) => p(t.id, o, z) : void 0,
821
+ className: $("table-list-row", R, {
822
+ dragging: C,
823
+ selected: r,
824
+ inactive: y,
825
+ "placeholder-row": m
760
826
  }),
761
- children: /* @__PURE__ */ a(
762
- Wt,
827
+ children: /* @__PURE__ */ d(
828
+ ot,
763
829
  {
764
830
  row: t,
765
- cellWrapper: m,
766
- columnAttributeData: l,
767
- dataTypeWidgets: E,
768
- editingState: R,
769
- callbacks: c,
770
- editable: d
831
+ cellWrapper: s,
832
+ columnAttributeData: x,
833
+ dataTypeWidgets: w,
834
+ editingState: a,
835
+ callbacks: l,
836
+ editable: h
771
837
  }
772
838
  )
773
839
  }
774
840
  );
775
841
  }
776
- const zn = Gt.memo(wn);
777
- function In({
778
- header: t,
779
- enabled: e,
842
+ const Fo = Fe.memo(Po);
843
+ function Bo({
844
+ header: e,
845
+ enabled: t,
780
846
  enableSorting: n = !1,
781
847
  enableColumnVisibility: r = !1,
782
- enableColumnResizing: i = !1,
783
- isLast: u = !1
848
+ enableColumnResizing: o = !1
784
849
  }) {
785
- const { attributes: s, listeners: m, setNodeRef: l, isDragging: E, transform: R, transition: c } = Ht({
786
- id: t.id,
850
+ const { attributes: u, listeners: c, setNodeRef: p, isDragging: s, transform: x, transition: w } = Ye({
851
+ id: e.id,
787
852
  data: { type: "column" },
788
- disabled: !e
789
- }), d = t.column, C = n && d.getCanSort(), g = d.getIsSorted(), f = `list-table-menu-${t.id}`, { menuOpen: h } = Ae(), b = h === f, x = C ? [
853
+ disabled: !t
854
+ }), a = e.column, l = n && a.getCanSort(), h = a.getIsSorted(), y = `list-table-menu-${e.id}`, { menuOpen: R } = eo(), g = R === y, m = l ? [
790
855
  {
791
856
  id: "sort-asc",
792
857
  label: "Sort ascending",
793
858
  icon: "sort",
794
- selected: g === "asc",
795
- onClick: () => d.toggleSorting(!1)
859
+ selected: h === "asc",
860
+ onClick: () => a.toggleSorting(!1)
796
861
  },
797
862
  {
798
863
  id: "sort-desc",
799
864
  label: "Sort descending",
800
865
  icon: "sort",
801
866
  className: "sort-desc-icon",
802
- selected: g === "desc",
803
- onClick: () => d.toggleSorting(!0)
867
+ selected: h === "desc",
868
+ onClick: () => a.toggleSorting(!0)
804
869
  }
805
- ] : [], z = r && d.getCanHide() ? [
806
- ...x.length > 0 ? [{ id: "divider-visibility", type: "divider" }] : [],
870
+ ] : [], T = r && a.getCanHide() ? [
871
+ ...m.length > 0 ? [{ id: "divider-visibility", type: "divider" }] : [],
807
872
  {
808
873
  id: "hide",
809
874
  label: "Hide column",
810
875
  icon: "visibility_off",
811
- onClick: () => d.toggleVisibility(!1)
876
+ onClick: () => a.toggleVisibility(!1)
812
877
  }
813
- ] : [], y = [...x, ...z], S = i && d.getCanResize(), w = d.getIsResizing(), { columnSizingInfo: V } = t.getContext().table.getState(), H = V.isResizingColumn === d.id ? V.deltaOffset ?? 0 : 0, $ = !!V.isResizingColumn, B = {
814
- onPointerDown: (k) => k.stopPropagation(),
815
- onMouseDown: (k) => k.stopPropagation()
878
+ ] : [], E = [...m, ...T], C = o && a.getCanResize(), _ = a.getIsResizing(), { columnSizingInfo: I } = e.getContext().table.getState(), z = I.isResizingColumn === a.id ? I.deltaOffset ?? 0 : 0, A = !!I.isResizingColumn, k = {
879
+ onPointerDown: (L) => L.stopPropagation(),
880
+ onMouseDown: (L) => L.stopPropagation()
816
881
  };
817
882
  return /* @__PURE__ */ M(
818
- sn,
883
+ wo,
819
884
  {
820
- ref: l,
885
+ ref: p,
821
886
  style: {
822
- width: `calc(var(--header-${t.id}-size) * 1px)`,
823
- transform: Ot.Transform.toString(R) ?? void 0,
824
- transition: c,
825
- flexGrow: u ? 1 : void 0
887
+ width: `calc(var(--header-${e.id}-size) * 1px)`,
888
+ transform: Ue.Transform.toString(x) ?? void 0,
889
+ transition: w,
890
+ flexGrow: tt(e.getContext().table, e.column.id) ? 1 : void 0
826
891
  },
827
- className: A({
828
- grab: e,
829
- dragging: E,
830
- "menu-open": b,
831
- resizing: $,
832
- sorted: !!g
892
+ className: $({
893
+ grab: t,
894
+ dragging: s,
895
+ "menu-open": g,
896
+ resizing: A,
897
+ sorted: !!h
833
898
  }),
834
- ...e ? { ...s, ...m } : {},
899
+ ...t ? { ...u, ...c } : {},
900
+ role: "columnheader",
835
901
  children: [
836
- /* @__PURE__ */ a(pn, { children: t.isPlaceholder ? null : nt(t.column.columnDef.header, t.getContext()) }),
837
- (y.length > 0 || C) && /* @__PURE__ */ M(mn, { ...B, children: [
838
- y.length > 0 && /* @__PURE__ */ a(Xe, { menuItems: y, menuId: f, className: "header-menu" }),
839
- C && /* @__PURE__ */ a(
840
- Ue,
902
+ /* @__PURE__ */ d(_o, { children: e.isPlaceholder ? null : ae(e.column.columnDef.header, e.getContext()) }),
903
+ (E.length > 0 || l) && /* @__PURE__ */ M(ko, { ...k, children: [
904
+ E.length > 0 && /* @__PURE__ */ d(mo, { menuItems: E, menuId: y, className: "header-menu" }),
905
+ l && /* @__PURE__ */ d(
906
+ po,
841
907
  {
842
908
  icon: "sort",
843
- className: A("sort-button", { visible: !!g }),
909
+ className: $("sort-button", { visible: !!h }),
844
910
  style: {
845
- transform: g === "desc" ? "rotate(180deg) scaleX(-1)" : "none"
911
+ transform: h === "desc" ? "rotate(180deg) scaleX(-1)" : "none"
846
912
  },
847
- onClick: d.getToggleSortingHandler(),
848
- selected: !!g
913
+ onClick: a.getToggleSortingHandler(),
914
+ selected: !!h
849
915
  }
850
916
  )
851
917
  ] }),
852
- S && /* @__PURE__ */ a(
853
- fn,
918
+ C && /* @__PURE__ */ d(
919
+ Lo,
854
920
  {
855
- className: A("resize-handle", { resizing: w }),
856
- style: { transform: H ? `translateX(${H}px)` : void 0 },
857
- onDoubleClick: () => d.resetSize(),
858
- onMouseDown: (k) => {
859
- k.stopPropagation(), t.getResizeHandler()(k);
921
+ className: $("resize-handle", { resizing: _ }),
922
+ style: { transform: z ? `translateX(${z}px)` : void 0 },
923
+ onDoubleClick: () => a.resetSize(),
924
+ onMouseDown: (L) => {
925
+ L.stopPropagation(), e.getResizeHandler()(L);
860
926
  },
861
- onTouchStart: t.getResizeHandler(),
862
- onPointerDown: (k) => k.stopPropagation()
927
+ onTouchStart: e.getResizeHandler(),
928
+ onPointerDown: (L) => L.stopPropagation()
863
929
  }
864
930
  )
865
931
  ]
866
932
  }
867
933
  );
868
934
  }
869
- function Tn(t, e) {
870
- const [n, r] = L(() => {
871
- if (e && e.length > 0) {
872
- const u = t.map((s) => s.id).filter((s) => !e.includes(s));
873
- return [...e, ...u];
935
+ function Yo(e, t) {
936
+ const [n, r] = G(() => {
937
+ if (t && t.length > 0) {
938
+ const u = e.map((c) => c.id).filter((c) => !t.includes(c));
939
+ return [...t, ...u];
874
940
  }
875
- return t.map((i) => i.id);
941
+ return e.map((o) => o.id);
876
942
  });
877
- return Mt(() => {
878
- if (e && e.length > 0) {
879
- const u = t.map((s) => s.id).filter((s) => !e.includes(s));
880
- r([...e, ...u]);
943
+ return ne(() => {
944
+ if (t && t.length > 0) {
945
+ const u = e.map((c) => c.id).filter((c) => !t.includes(c));
946
+ r([...t, ...u]);
881
947
  }
882
- }, [e]), { columnOrder: n, setColumnOrder: r };
948
+ }, [t]), { columnOrder: n, setColumnOrder: r };
883
949
  }
884
- const W = (t) => !!t.original && typeof t.original == "object" && "__listTableGroup" in t.original;
885
- function Vn({
886
- rows: t,
887
- selectedRows: e,
950
+ const B = (e) => !!e.original && typeof e.original == "object" && "__listTableGroup" in e.original;
951
+ function Uo({
952
+ rows: e,
953
+ selectedRows: t,
888
954
  onSelectedRowsChange: n,
889
955
  multiSelection: r,
890
- rowVirtualizer: i,
956
+ rowVirtualizer: o,
891
957
  tableContainerRef: u
892
958
  }) {
893
- const [s, m] = L(-1), l = At(-1), E = O(
894
- (c, d, C) => {
895
- const g = t[d];
896
- if (!(g && W(g))) {
897
- if (r && C.shiftKey && l.current >= 0) {
898
- const f = Math.min(l.current, d), h = Math.max(l.current, d), b = t.slice(f, h + 1).filter((x) => !W(x)).map((x) => x.id);
899
- C.metaKey || C.ctrlKey ? n?.(Array.from(/* @__PURE__ */ new Set([...e, ...b]))) : n?.(b);
900
- } else r && (C.metaKey || C.ctrlKey) ? (e.includes(c) ? n?.(e.filter((f) => f !== c)) : n?.([...e, c]), l.current = d) : e.includes(c) ? n?.(e.filter((f) => f !== c)) : (n?.([c]), l.current = d);
901
- m(d), u.current?.focus();
959
+ const [c, p] = G(-1), s = Be(-1), x = O(
960
+ (a, l, h) => {
961
+ const y = e[l];
962
+ if (!(y && B(y))) {
963
+ if (r && h.shiftKey && s.current >= 0) {
964
+ const R = Math.min(s.current, l), g = Math.max(s.current, l), m = e.slice(R, g + 1).filter((b) => !B(b)).map((b) => b.id);
965
+ h.metaKey || h.ctrlKey ? n?.(Array.from(/* @__PURE__ */ new Set([...t, ...m]))) : n?.(m);
966
+ } else r && (h.metaKey || h.ctrlKey) ? (t.includes(a) ? n?.(t.filter((R) => R !== a)) : n?.([...t, a]), s.current = l) : t.includes(a) ? n?.(t.filter((R) => R !== a)) : (n?.([a]), s.current = l);
967
+ p(l), u.current?.focus();
902
968
  }
903
969
  },
904
- [e, t, n, r, u]
905
- ), R = O(
906
- (c) => {
907
- if (c.key !== "ArrowDown" && c.key !== "ArrowUp") return;
908
- c.preventDefault();
909
- const d = c.key === "ArrowDown" ? 1 : -1;
910
- let g = s < 0 ? d > 0 ? -1 : t.length : s;
970
+ [t, e, n, r, u]
971
+ ), w = O(
972
+ (a) => {
973
+ if (a.key !== "ArrowDown" && a.key !== "ArrowUp") return;
974
+ a.preventDefault();
975
+ const l = a.key === "ArrowDown" ? 1 : -1, h = !r && t.length === 1 ? e.findIndex((b) => b.id === t[0]) : -1, y = h >= 0 ? h : c;
976
+ let g = y < 0 ? l > 0 ? -1 : e.length : y;
911
977
  for (; ; ) {
912
- if (g += d, g < 0 || g >= t.length) {
913
- g = Math.max(0, Math.min(t.length - 1, g));
978
+ if (g += l, g < 0 || g >= e.length) {
979
+ g = Math.max(0, Math.min(e.length - 1, g));
914
980
  break;
915
981
  }
916
- if (!W(t[g]))
982
+ if (!B(e[g]))
917
983
  break;
918
984
  }
919
- if (g === s || W(t[g])) return;
920
- const f = t[g]?.id;
921
- if (f) {
922
- if (c.shiftKey && r)
923
- if (e.includes(f)) {
924
- const h = t[s]?.id;
925
- h && n?.(e.filter((b) => b !== h));
985
+ if (g === y || B(e[g])) return;
986
+ const m = e[g]?.id;
987
+ if (m) {
988
+ if (a.shiftKey && r)
989
+ if (t.includes(m)) {
990
+ const b = e[c]?.id;
991
+ b && n?.(t.filter((T) => T !== b));
926
992
  } else
927
- n?.([...e, f]);
993
+ n?.([...t, m]);
928
994
  else
929
- n?.([f]), l.current = g;
930
- m(g), i.scrollToIndex(g, { behavior: "smooth" });
995
+ n?.([m]), s.current = g;
996
+ p(g), o.scrollToIndex(g, { behavior: "smooth" });
931
997
  }
932
998
  },
933
- [s, t, e, n, i]
999
+ [c, e, t, n, r, o]
934
1000
  );
935
- return { activeRowIndex: s, handleRowClick: E, handleKeyDown: R };
1001
+ return { activeRowIndex: c, handleRowClick: x, handleKeyDown: w };
936
1002
  }
937
- function _n() {
938
- const [t, e] = L(null), [n, r] = L(null), i = O((m) => {
939
- e(m);
1003
+ function Xo() {
1004
+ const [e, t] = G(null), [n, r] = G(null), o = O((p) => {
1005
+ t(p);
940
1006
  }, []), u = O(() => {
941
- e(null), r(null);
1007
+ t(null), r(null);
942
1008
  }, []);
943
- return { editingState: Gt.useMemo(
1009
+ return { editingState: Fe.useMemo(
944
1010
  () => ({
945
- editingCellId: t,
946
- startEditingCell: i,
1011
+ editingCellId: e,
1012
+ startEditingCell: o,
947
1013
  stopEditingCell: u,
948
1014
  getDraftValue: () => n,
949
1015
  setDraftValue: r
950
1016
  }),
951
- [t, n, i, u]
1017
+ [e, n, o, u]
952
1018
  ) };
953
1019
  }
954
- function kn({
955
- rows: t,
956
- columnOrder: e,
1020
+ function Jo({
1021
+ rows: e,
1022
+ columnOrder: t,
957
1023
  onReorderRows: n,
958
1024
  setColumnOrder: r,
959
- onColumnOrderChange: i
1025
+ onColumnOrderChange: o
960
1026
  }) {
961
- const [u, s] = L(null), [m, l] = L(null);
1027
+ const [u, c] = G(null), [p, s] = G(null);
962
1028
  return {
963
- sensors: $e(
964
- Ct(Ne),
965
- Ct(je, { coordinateGetter: Pe })
1029
+ sensors: no(
1030
+ _e(io),
1031
+ _e(ro, { coordinateGetter: lo })
966
1032
  ),
967
1033
  activeRowId: u,
968
- activeColumnId: m,
969
- handleColumnDragStart: (h) => {
970
- l(h.active.id);
1034
+ activeColumnId: p,
1035
+ handleColumnDragStart: (g) => {
1036
+ s(g.active.id);
971
1037
  },
972
- handleColumnDragEnd: (h) => {
973
- l(null);
974
- const { active: b, over: x } = h;
975
- if (x && b.id !== x.id) {
976
- const T = e.indexOf(b.id), z = e.indexOf(x.id);
977
- if (T !== -1 && z !== -1) {
978
- const y = Fe(e, T, z);
979
- r(() => y), i?.(y);
1038
+ handleColumnDragEnd: (g) => {
1039
+ s(null);
1040
+ const { active: m, over: b } = g;
1041
+ if (b && m.id !== b.id) {
1042
+ const T = t.indexOf(m.id), E = t.indexOf(b.id);
1043
+ if (T !== -1 && E !== -1) {
1044
+ const C = co(t, T, E);
1045
+ r(() => C), o?.(C);
980
1046
  }
981
1047
  }
982
1048
  },
983
- handleColumnDragCancel: () => l(null),
984
- handleRowDragStart: (h) => {
985
- s(h.active.id);
1049
+ handleColumnDragCancel: () => s(null),
1050
+ handleRowDragStart: (g) => {
1051
+ c(g.active.id);
986
1052
  },
987
- handleRowDragEnd: (h) => {
988
- s(null);
989
- const { active: b, over: x } = h;
990
- if (x && b.id !== x.id) {
991
- const T = t.findIndex((y) => y.id === b.id), z = t.findIndex((y) => y.id === x.id);
992
- n?.(T, z);
1053
+ handleRowDragEnd: (g) => {
1054
+ c(null);
1055
+ const { active: m, over: b } = g;
1056
+ if (b && m.id !== b.id) {
1057
+ const T = e.findIndex((C) => C.id === m.id), E = e.findIndex((C) => C.id === b.id);
1058
+ n?.(T, E);
993
1059
  }
994
1060
  },
995
- handleRowDragCancel: () => s(null)
1061
+ handleRowDragCancel: () => c(null)
996
1062
  };
997
1063
  }
998
- function Ln(t) {
999
- const e = t.getFlatHeaders(), n = t.getState().columnSizing;
1000
- return tt(() => {
1064
+ function qo(e) {
1065
+ const t = e.getFlatHeaders(), n = e.getState().columnSizing;
1066
+ return ie(() => {
1001
1067
  const r = {};
1002
- for (const i of e)
1003
- r[`--header-${i.id}-size`] = i.getSize(), r[`--col-${i.column.id}-size`] = i.column.getSize();
1068
+ for (const o of t)
1069
+ r[`--header-${o.id}-size`] = o.getSize(), r[`--col-${o.column.id}-size`] = o.column.getSize();
1004
1070
  return r;
1005
- }, [n, e]);
1071
+ }, [n, t]);
1006
1072
  }
1007
- const Gn = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : [t] : [];
1008
- function Lo({
1009
- data: t,
1010
- columns: e,
1073
+ const Qo = (e) => e ? Array.isArray(e) ? e.filter(Boolean) : [e] : [];
1074
+ function qn({
1075
+ data: e,
1076
+ columns: t,
1011
1077
  getRowId: n,
1012
1078
  fetchNextPage: r,
1013
- hasNextPage: i,
1079
+ hasNextPage: o,
1014
1080
  isFetchingNextPage: u,
1015
- onUpdateRow: s,
1016
- onOpenViewer: m,
1017
- editable: l = !0,
1018
- onReorderRows: E,
1019
- rowContextMenuBuilders: R = [],
1020
- onRowDoubleClick: c,
1021
- selectedRows: d = [],
1022
- onSelectedRowsChange: C,
1023
- multiSelection: g = !1,
1024
- cellWrapper: f,
1025
- columnAttributeData: h,
1026
- dataTypeWidgets: b,
1027
- enableColumnReordering: x = !1,
1081
+ onUpdateRow: c,
1082
+ onOpenViewer: p,
1083
+ editable: s = !0,
1084
+ onReorderRows: x,
1085
+ rowContextMenuBuilders: w = [],
1086
+ onRowDoubleClick: a,
1087
+ selectedRows: l = [],
1088
+ onSelectedRowsChange: h,
1089
+ multiSelection: y = !1,
1090
+ cellWrapper: R,
1091
+ columnAttributeData: g,
1092
+ dataTypeWidgets: m,
1093
+ enableColumnReordering: b = !1,
1028
1094
  columnOrder: T,
1029
- onColumnOrderChange: z,
1030
- enableColumnVisibility: y = !1,
1031
- columnVisibility: S,
1032
- defaultColumnVisibility: w,
1033
- onColumnVisibilityChange: V,
1034
- enableColumnResizing: H = !1,
1035
- columnSizing: $,
1036
- onColumnSizingChange: B,
1037
- enableSorting: k = !1,
1038
- sorting: Bt,
1039
- onSortingChange: Yt,
1040
- enableExpanding: Ut = !0,
1041
- expanded: Xt,
1042
- onExpandedChange: Jt,
1043
- getIsRowInactive: ot
1095
+ onColumnOrderChange: E,
1096
+ enableColumnVisibility: C = !1,
1097
+ columnVisibility: _,
1098
+ defaultColumnVisibility: I,
1099
+ onColumnVisibilityChange: z,
1100
+ enableColumnResizing: A = !1,
1101
+ columnSizing: k,
1102
+ onColumnSizingChange: L,
1103
+ enableSorting: le = !1,
1104
+ sorting: rt,
1105
+ onSortingChange: st,
1106
+ enableExpanding: at = !0,
1107
+ expanded: lt,
1108
+ onExpandedChange: dt,
1109
+ getIsRowInactive: de,
1110
+ getRowClassName: ct,
1111
+ variant: ut = "default",
1112
+ scrollToSelection: ce = !1,
1113
+ ariaLabel: gt
1044
1114
  }) {
1045
- const [qt, Qt] = L([]), [Zt, te] = L({}), [ee, ne] = L({}), [oe, ie] = L({}), Y = At(null), [it] = He(), rt = Bt ?? qt, re = (o) => {
1046
- const p = typeof o == "function" ? o(rt) : o;
1047
- Qt(p), Yt?.(p);
1048
- }, st = Xt ?? oe, se = (o) => {
1049
- const p = typeof o == "function" ? o(st) : o;
1050
- ie(p), Jt?.(p);
1051
- }, U = S ?? Zt, ae = (o) => {
1052
- const p = typeof o == "function" ? o(at) : o, D = {};
1053
- Object.keys(p).forEach((I) => {
1054
- const G = vt({}, I, w);
1055
- p[I] !== G && (D[I] = p[I]);
1056
- }), te(D), V?.(D);
1057
- }, at = tt(() => {
1058
- const o = {};
1059
- return e.forEach((p) => {
1060
- const D = p.id || p.accessorKey;
1115
+ const ue = Nt(), [pt, mt] = G([]), [ft, ht] = G({}), [bt, yt] = G({}), [vt, Ct] = G({}), X = Be(null), [ge] = to(), pe = rt ?? pt, xt = (i) => {
1116
+ const f = typeof i == "function" ? i(pe) : i;
1117
+ mt(f), st?.(f);
1118
+ }, me = lt ?? vt, Dt = (i) => {
1119
+ const f = typeof i == "function" ? i(me) : i;
1120
+ Ct(f), dt?.(f);
1121
+ }, J = _ ?? ft, Rt = (i) => {
1122
+ const f = typeof i == "function" ? i(fe) : i, D = {};
1123
+ Object.keys(f).forEach((V) => {
1124
+ const H = Ve({}, V, I);
1125
+ f[V] !== H && (D[V] = f[V]);
1126
+ }), ht(D), z?.(D);
1127
+ }, fe = ie(() => {
1128
+ const i = {};
1129
+ return t.forEach((f) => {
1130
+ const D = f.id || f.accessorKey;
1061
1131
  if (D) {
1062
- const I = vt(U, D, w), G = p.visible;
1063
- G !== void 0 && U[D] === void 0 ? o[D] = G : o[D] = I;
1132
+ const V = Ve(J, D, I), H = f.visible;
1133
+ H !== void 0 && J[D] === void 0 ? i[D] = H : i[D] = V;
1064
1134
  }
1065
- }), Me(
1066
- o,
1067
- e.map((p) => p.id || p.accessorKey).filter(Boolean)
1135
+ }), Zt(
1136
+ i,
1137
+ t.map((f) => f.id || f.accessorKey).filter(Boolean)
1068
1138
  );
1069
- }, [U, w, e]), lt = $ ?? ee, le = (o) => {
1070
- const p = typeof o == "function" ? o(lt) : o;
1071
- ne(p), B?.(p);
1072
- }, { columnOrder: dt, setColumnOrder: ct } = Tn(e, T), N = Ee({
1073
- data: t,
1074
- columns: e,
1139
+ }, [J, I, t]), he = k ?? bt, wt = (i) => {
1140
+ const f = typeof i == "function" ? i(he) : i;
1141
+ yt(f), L?.(f);
1142
+ }, { columnOrder: be, setColumnOrder: ye } = Yo(t, T), N = jt({
1143
+ data: e,
1144
+ columns: t,
1075
1145
  getRowId: n,
1076
1146
  state: {
1077
- columnOrder: dt,
1078
- sorting: rt,
1079
- columnVisibility: at,
1080
- columnSizing: lt,
1081
- expanded: st
1147
+ columnOrder: be,
1148
+ sorting: pe,
1149
+ columnVisibility: fe,
1150
+ columnSizing: he,
1151
+ expanded: me
1082
1152
  },
1083
1153
  filterFns: { fuzzy: () => !0 },
1084
1154
  // Placeholder for fuzzy filtering
1085
- onColumnOrderChange: ct,
1086
- onSortingChange: re,
1087
- onColumnVisibilityChange: ae,
1088
- onColumnSizingChange: le,
1089
- onExpandedChange: se,
1090
- enableSorting: k,
1091
- enableExpanding: Ut,
1155
+ onColumnOrderChange: ye,
1156
+ onSortingChange: xt,
1157
+ onColumnVisibilityChange: Rt,
1158
+ onColumnSizingChange: wt,
1159
+ onExpandedChange: Dt,
1160
+ enableSorting: le,
1161
+ enableExpanding: at,
1092
1162
  columnResizeMode: "onEnd",
1093
- getCoreRowModel: we(),
1094
- getExpandedRowModel: Se(),
1095
- getSortedRowModel: Re(),
1096
- getSubRows: (o) => o.subRows,
1097
- getRowCanExpand: (o) => o.subRows.length > 0,
1163
+ getCoreRowModel: Pt(),
1164
+ getExpandedRowModel: Wt(),
1165
+ getSortedRowModel: Kt(),
1166
+ getSubRows: (i) => i.subRows,
1167
+ getRowCanExpand: (i) => i.subRows.length > 0,
1098
1168
  meta: {
1099
- updateData: s,
1100
- openViewerDialog: m
1169
+ updateData: c,
1170
+ openViewerDialog: p
1101
1171
  }
1102
- }), { rows: _ } = N.getRowModel(), X = Oe({
1103
- count: i ? _.length + 1 : _.length,
1104
- getScrollElement: () => Y.current,
1105
- estimateSize: () => 44,
1106
- overscan: 10
1107
- }), J = X.getVirtualItems(), { handleRowClick: de, handleKeyDown: ce } = Vn({
1108
- rows: _,
1109
- selectedRows: d,
1110
- onSelectedRowsChange: C,
1111
- multiSelection: g,
1112
- rowVirtualizer: X,
1113
- tableContainerRef: Y
1114
- }), ue = O(
1115
- (o, p, D) => {
1116
- if (!c) return;
1117
- const I = _[p];
1118
- !I || I.original === void 0 || P(I.original) || c(D, {
1119
- rowId: o,
1120
- rowIndex: p,
1121
- row: I,
1122
- isSelected: d.includes(o)
1172
+ }), { rows: S } = N.getRowModel(), K = ut === "data", W = oo({
1173
+ count: o ? S.length + 1 : S.length,
1174
+ getScrollElement: () => X.current,
1175
+ estimateSize: () => K ? Xe : 44,
1176
+ // the sticky header pushes rows down, so a row scrolled in from below needs that much extra
1177
+ scrollPaddingEnd: K ? re : 0,
1178
+ overscan: K ? 12 : 10
1179
+ }), P = W.getVirtualItems(), { activeRowIndex: ve, handleRowClick: Et, handleKeyDown: It } = Uo({
1180
+ rows: S,
1181
+ selectedRows: l,
1182
+ onSelectedRowsChange: h,
1183
+ multiSelection: y,
1184
+ rowVirtualizer: W,
1185
+ tableContainerRef: X
1186
+ }), q = l.length === 1 ? l[0] : void 0, Q = q ? S.findIndex((i) => i.id === q) : -1, Z = Q >= 0;
1187
+ ne(() => {
1188
+ ce && Z && W.scrollToIndex(Q, { align: "auto" });
1189
+ }, [ce, q, Z]);
1190
+ const Ce = S[ve], xe = Z ? Q : Ce && l.includes(Ce.id) ? ve : -1, Tt = P.some((i) => i.index === xe), zt = O(
1191
+ (i, f, D) => {
1192
+ if (!a) return;
1193
+ const V = S[f];
1194
+ !V || V.original === void 0 || Y(V.original) || a(D, {
1195
+ rowId: i,
1196
+ rowIndex: f,
1197
+ row: V,
1198
+ isSelected: l.includes(i)
1123
1199
  });
1124
1200
  },
1125
- [c, _, d]
1126
- ), ge = O(
1127
- (o, p, D) => {
1128
- const I = _[p];
1129
- if (!I || I.original === void 0) return;
1130
- const G = P(I.original);
1131
- let ht = {};
1132
- if (G) {
1133
- const K = I.original;
1134
- ht = {
1135
- groupColumnId: K.__groupColumnId,
1136
- groupValue: K.__groupValue
1201
+ [a, S, l]
1202
+ ), St = O(
1203
+ (i, f, D) => {
1204
+ const V = S[f];
1205
+ if (!V || V.original === void 0) return;
1206
+ const H = Y(V.original);
1207
+ let Te = {};
1208
+ if (H) {
1209
+ const F = V.original;
1210
+ Te = {
1211
+ groupColumnId: F.__groupColumnId,
1212
+ groupValue: F.__groupValue
1137
1213
  };
1138
1214
  }
1139
1215
  D.preventDefault(), D.stopPropagation();
1140
- const bt = d.includes(o), xe = G || bt ? d : [o], yt = R.flatMap(
1141
- (K) => Gn(
1142
- K(D, {
1143
- rowId: o,
1144
- rowIndex: p,
1145
- row: I,
1146
- selectedRows: xe,
1147
- isSelected: bt,
1148
- isGroupRow: G,
1149
- ...ht
1216
+ const ze = l.includes(i), Mt = H || ze ? l : [i], Se = w.flatMap(
1217
+ (F) => Qo(
1218
+ F(D, {
1219
+ rowId: i,
1220
+ rowIndex: f,
1221
+ row: V,
1222
+ selectedRows: Mt,
1223
+ isSelected: ze,
1224
+ isGroupRow: H,
1225
+ ...Te
1150
1226
  })
1151
1227
  )
1152
1228
  );
1153
- yt.length > 0 && it(D, yt);
1229
+ Se.length > 0 && ge(D, Se);
1154
1230
  },
1155
- [R, _, d, it]
1156
- ), { editingState: ut } = _n(), {
1157
- sensors: gt,
1158
- activeRowId: pt,
1159
- activeColumnId: mt,
1160
- handleColumnDragStart: pe,
1161
- handleColumnDragEnd: me,
1162
- handleColumnDragCancel: fe,
1163
- handleRowDragStart: he,
1164
- handleRowDragEnd: be,
1165
- handleRowDragCancel: ye
1166
- } = kn({ rows: _, columnOrder: dt, onReorderRows: E, setColumnOrder: ct, onColumnOrderChange: z }), ft = tt(() => ({ onUpdateRow: s, onOpenViewer: m }), [s, m]), ve = Ln(N), Ce = !!N.getState().columnSizingInfo.isResizingColumn;
1167
- Mt(() => {
1168
- const [o] = J.slice(-1);
1169
- o && o.index >= _.length - 1 && i && !u && r?.();
1170
- }, [i, r, _.length, u, J]);
1171
- const q = pt ? _.find((o) => o.id === pt) : null, j = mt ? N.getHeaderGroups()[0]?.headers.find((o) => o.id === mt) : null;
1172
- return /* @__PURE__ */ a(
1173
- Ze,
1231
+ [w, S, l, ge]
1232
+ ), { editingState: De } = Xo(), {
1233
+ sensors: Re,
1234
+ activeRowId: we,
1235
+ activeColumnId: Ee,
1236
+ handleColumnDragStart: Vt,
1237
+ handleColumnDragEnd: _t,
1238
+ handleColumnDragCancel: kt,
1239
+ handleRowDragStart: Lt,
1240
+ handleRowDragEnd: Gt,
1241
+ handleRowDragCancel: At
1242
+ } = Jo({ rows: S, columnOrder: be, onReorderRows: x, setColumnOrder: ye, onColumnOrderChange: E }), Ie = ie(() => ({ onUpdateRow: c, onOpenViewer: p }), [c, p]), Ht = qo(N), $t = !!N.getState().columnSizingInfo.isResizingColumn;
1243
+ ne(() => {
1244
+ const [i] = P.slice(-1);
1245
+ i && i.index >= S.length - 1 && o && !u && r?.();
1246
+ }, [o, r, S.length, u, P]);
1247
+ const ee = we ? S.find((i) => i.id === we) : null, j = Ee ? N.getHeaderGroups()[0]?.headers.find((i) => i.id === Ee) : null;
1248
+ return /* @__PURE__ */ d(
1249
+ yo,
1174
1250
  {
1175
- ref: Y,
1251
+ ref: X,
1252
+ className: $(K && "data"),
1253
+ role: "grid",
1254
+ "aria-label": gt,
1255
+ "aria-multiselectable": y || void 0,
1256
+ "aria-rowcount": o ? -1 : S.length + 1,
1257
+ "aria-activedescendant": Tt ? et(ue, xe) : void 0,
1176
1258
  tabIndex: 0,
1177
- onKeyDown: ce,
1178
- style: Ce ? { cursor: "col-resize" } : void 0,
1179
- children: /* @__PURE__ */ M(tn, { style: ve, children: [
1259
+ onKeyDown: It,
1260
+ style: $t ? { cursor: "col-resize" } : void 0,
1261
+ children: /* @__PURE__ */ M(vo, { role: "presentation", style: Ht, children: [
1180
1262
  /* @__PURE__ */ M(
1181
- xt,
1263
+ ke,
1182
1264
  {
1183
- sensors: gt,
1184
- collisionDetection: Dt,
1185
- onDragStart: pe,
1186
- onDragEnd: me,
1187
- onDragCancel: fe,
1188
- modifiers: [Ke],
1265
+ sensors: Re,
1266
+ collisionDetection: Le,
1267
+ onDragStart: Vt,
1268
+ onDragEnd: _t,
1269
+ onDragCancel: kt,
1270
+ modifiers: [so],
1189
1271
  children: [
1190
- /* @__PURE__ */ a(en, { children: N.getHeaderGroups().map((o) => /* @__PURE__ */ a(nn, { children: /* @__PURE__ */ a(
1191
- St,
1272
+ /* @__PURE__ */ d(Co, { role: "rowgroup", children: N.getHeaderGroups().map((i) => /* @__PURE__ */ d(xo, { role: "row", "aria-rowindex": 1, children: /* @__PURE__ */ d(
1273
+ He,
1192
1274
  {
1193
- items: o.headers.map((p) => p.id),
1194
- strategy: Be,
1195
- children: o.headers.map((p, D) => /* @__PURE__ */ a(
1196
- In,
1275
+ items: i.headers.map((f) => f.id),
1276
+ strategy: uo,
1277
+ children: i.headers.map((f) => /* @__PURE__ */ d(
1278
+ Bo,
1197
1279
  {
1198
- header: p,
1199
- enabled: x,
1200
- enableSorting: k,
1201
- enableColumnVisibility: y,
1202
- enableColumnResizing: H,
1203
- isLast: D === o.headers.length - 1
1280
+ header: f,
1281
+ enabled: b,
1282
+ enableSorting: le,
1283
+ enableColumnVisibility: C,
1284
+ enableColumnResizing: A
1204
1285
  },
1205
- p.id
1286
+ f.id
1206
1287
  ))
1207
1288
  }
1208
- ) }, o.id)) }),
1209
- /* @__PURE__ */ a(
1210
- Et,
1289
+ ) }, i.id)) }),
1290
+ /* @__PURE__ */ d(
1291
+ Ge,
1211
1292
  {
1212
1293
  dropAnimation: {
1213
- sideEffects: Rt({
1294
+ sideEffects: Ae({
1214
1295
  styles: { active: { opacity: "0.4" } }
1215
1296
  })
1216
1297
  },
1217
- children: j ? /* @__PURE__ */ a("table", { children: /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(gn, { style: { width: j.getSize() }, children: j.isPlaceholder ? null : nt(
1298
+ children: j ? /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d(Vo, { style: { width: j.getSize() }, children: j.isPlaceholder ? null : ae(
1218
1299
  j.column.columnDef.header,
1219
1300
  j.getContext()
1220
1301
  ) }) }) }) }) : null
@@ -1224,76 +1305,80 @@ function Lo({
1224
1305
  }
1225
1306
  ),
1226
1307
  /* @__PURE__ */ M(
1227
- xt,
1308
+ ke,
1228
1309
  {
1229
- sensors: gt,
1230
- collisionDetection: Dt,
1231
- onDragStart: he,
1232
- onDragEnd: be,
1233
- onDragCancel: ye,
1234
- modifiers: [We],
1310
+ sensors: Re,
1311
+ collisionDetection: Le,
1312
+ onDragStart: Lt,
1313
+ onDragEnd: Gt,
1314
+ onDragCancel: At,
1315
+ modifiers: [ao],
1235
1316
  children: [
1236
- /* @__PURE__ */ a(It, { style: { height: `${X.getTotalSize()}px` }, children: /* @__PURE__ */ a(
1237
- St,
1317
+ /* @__PURE__ */ d(Oe, { role: "rowgroup", style: { height: `${W.getTotalSize()}px` }, children: /* @__PURE__ */ d(
1318
+ He,
1238
1319
  {
1239
- items: _.map((o) => o.id),
1240
- strategy: Ye,
1241
- children: J.map((o) => {
1242
- if (o.index > _.length - 1)
1243
- return /* @__PURE__ */ a(
1244
- on,
1320
+ items: S.map((i) => i.id),
1321
+ strategy: go,
1322
+ children: P.map((i) => {
1323
+ if (i.index > S.length - 1)
1324
+ return /* @__PURE__ */ d(
1325
+ Do,
1245
1326
  {
1246
- style: { transform: `translateY(${o.start}px)` },
1247
- children: /* @__PURE__ */ a("td", { children: "Loading more data..." })
1327
+ role: "row",
1328
+ "aria-rowindex": i.index + 2,
1329
+ style: { transform: `translateY(${i.start}px)` },
1330
+ children: /* @__PURE__ */ d("td", { role: "gridcell", children: "Loading more data..." })
1248
1331
  },
1249
1332
  "loader"
1250
1333
  );
1251
- const D = _[o.index];
1252
- return /* @__PURE__ */ a(
1253
- zn,
1334
+ const D = S[i.index];
1335
+ return /* @__PURE__ */ d(
1336
+ Fo,
1254
1337
  {
1338
+ tableId: ue,
1255
1339
  row: D,
1256
- virtualRow: o,
1257
- isSelected: d.includes(D.id),
1258
- rowIndex: o.index,
1259
- onRowClick: de,
1260
- onRowDoubleClick: c ? ue : void 0,
1261
- onRowContextMenu: R.length > 0 ? ge : void 0,
1262
- cellWrapper: f,
1263
- columnAttributeData: h,
1264
- dataTypeWidgets: b,
1265
- editingState: ut,
1266
- callbacks: ft,
1267
- editable: l,
1268
- isInactive: ot?.(D.original)
1340
+ virtualRow: i,
1341
+ isSelected: l.includes(D.id),
1342
+ rowIndex: i.index,
1343
+ onRowClick: Et,
1344
+ onRowDoubleClick: a ? zt : void 0,
1345
+ onRowContextMenu: w.length > 0 ? St : void 0,
1346
+ cellWrapper: R,
1347
+ columnAttributeData: g,
1348
+ dataTypeWidgets: m,
1349
+ editingState: De,
1350
+ callbacks: Ie,
1351
+ editable: s,
1352
+ isInactive: de?.(D.original),
1353
+ rowClassName: ct?.(D.original)
1269
1354
  },
1270
1355
  D.id
1271
1356
  );
1272
1357
  })
1273
1358
  }
1274
1359
  ) }),
1275
- /* @__PURE__ */ a(
1276
- Et,
1360
+ /* @__PURE__ */ d(
1361
+ Ge,
1277
1362
  {
1278
1363
  dropAnimation: {
1279
- sideEffects: Rt({
1364
+ sideEffects: Ae({
1280
1365
  styles: { active: { opacity: "0.4" } }
1281
1366
  })
1282
1367
  },
1283
- children: q ? /* @__PURE__ */ a("table", { style: { width: "100%" }, children: /* @__PURE__ */ a(It, { children: /* @__PURE__ */ a(
1284
- rn,
1368
+ children: ee ? /* @__PURE__ */ d("table", { style: { width: "100%" }, children: /* @__PURE__ */ d(Oe, { children: /* @__PURE__ */ d(
1369
+ Ro,
1285
1370
  {
1286
- className: A({ inactive: ot?.(q.original) }),
1287
- children: /* @__PURE__ */ a(
1288
- Wt,
1371
+ className: $({ inactive: de?.(ee.original) }),
1372
+ children: /* @__PURE__ */ d(
1373
+ ot,
1289
1374
  {
1290
- row: q,
1291
- cellWrapper: f,
1292
- columnAttributeData: h,
1293
- dataTypeWidgets: b,
1294
- editingState: ut,
1295
- callbacks: ft,
1296
- editable: l
1375
+ row: ee,
1376
+ cellWrapper: R,
1377
+ columnAttributeData: g,
1378
+ dataTypeWidgets: m,
1379
+ editingState: De,
1380
+ callbacks: Ie,
1381
+ editable: s
1297
1382
  }
1298
1383
  )
1299
1384
  }
@@ -1307,54 +1392,56 @@ function Lo({
1307
1392
  }
1308
1393
  );
1309
1394
  }
1310
- const Pt = (t) => !!t && typeof t == "object" && ("label" in t || "value" in t), et = (t) => !!t && typeof t == "object" && "__listTableGroup" in t, Mn = (t) => Pt(t) ? t.value : t, Lt = (t) => Pt(t) ? typeof t.sortIndex == "number" ? t.sortIndex : t.sortValue !== void 0 ? t.sortValue : t.label !== void 0 ? t.label : t.value : t, An = (t, e) => {
1311
- const n = Lt(t), r = Lt(e);
1395
+ const nt = (e) => !!e && typeof e == "object" && ("label" in e || "value" in e), se = (e) => !!e && typeof e == "object" && "__listTableGroup" in e, Zo = (e) => nt(e) ? e.value : e, Pe = (e) => nt(e) ? typeof e.sortIndex == "number" ? e.sortIndex : e.sortValue !== void 0 ? e.sortValue : e.label !== void 0 ? e.label : e.value : e, en = (e, t) => {
1396
+ const n = Pe(e), r = Pe(t);
1312
1397
  return typeof n == "number" && typeof r == "number" ? n - r : String(n ?? "").localeCompare(String(r ?? ""), void 0, {
1313
1398
  sensitivity: "base"
1314
1399
  });
1315
- }, Ft = (t, e) => {
1316
- const n = t.filter(et), r = t.filter((i) => !et(i));
1317
- return n.sort((i, u) => {
1318
- const s = An(i.__groupValue, u.__groupValue);
1319
- return e ? -s : s;
1320
- }), n.forEach((i) => {
1321
- i.subRows = Ft(i.subRows, e);
1400
+ }, it = (e, t) => {
1401
+ const n = e.filter(se), r = e.filter((o) => !se(o));
1402
+ return n.sort((o, u) => {
1403
+ const c = en(o.__groupValue, u.__groupValue);
1404
+ return t ? -c : c;
1405
+ }), n.forEach((o) => {
1406
+ o.subRows = it(o.subRows, t);
1322
1407
  }), [...n, ...r];
1323
- }, Go = (t, e, n, r, i, u) => {
1324
- const s = [], m = (l, E, R, c) => {
1325
- if (!R.length) {
1326
- l.push(E);
1408
+ }, Qn = (e, t, n, r, o, u) => {
1409
+ const c = [], p = (s, x, w, a) => {
1410
+ if (!w.length) {
1411
+ s.push(x);
1327
1412
  return;
1328
1413
  }
1329
- const [d, ...C] = R, g = r(d, E) ?? [u(E, d)];
1330
- if (!g.length) {
1331
- m(l, E, C, c);
1414
+ const [l, ...h] = w, y = r(l, x) ?? [u(x, l)];
1415
+ if (!y.length) {
1416
+ p(s, x, h, a);
1332
1417
  return;
1333
1418
  }
1334
- const f = (h, b, x) => {
1335
- const T = g[b], z = Mn(T), y = `${x}|${d}:${b}:${JSON.stringify(z)}`;
1336
- let S = h.find(
1337
- (w) => et(w) && w.__groupKey === y
1419
+ const R = (g, m, b) => {
1420
+ const T = y[m], E = Zo(T), C = `${b}|${l}:${m}:${JSON.stringify(E)}`;
1421
+ let _ = g.find(
1422
+ (I) => se(I) && I.__groupKey === C
1338
1423
  );
1339
- if (S || (S = i(d, y, T), h.push(S)), b < g.length - 1) {
1340
- f(S.subRows, b + 1, y);
1424
+ if (_ || (_ = o(l, C, T), g.push(_)), m < y.length - 1) {
1425
+ R(_.subRows, m + 1, C);
1341
1426
  return;
1342
1427
  }
1343
- m(S.subRows, E, C, y);
1428
+ p(_.subRows, x, h, C);
1344
1429
  };
1345
- f(l, 0, c);
1430
+ R(s, 0, a);
1346
1431
  };
1347
- return t.forEach((l) => m(s, l, e, "root")), Ft(s, n);
1432
+ return e.forEach((s) => p(c, s, t, "root")), it(c, n);
1348
1433
  };
1349
1434
  export {
1350
- Lo as ListTable,
1351
- Go as buildGroupedData,
1352
- An as compareGroupingPathItems,
1353
- yn as defaultListTableDataTypeWidgets,
1354
- ko as getDefaultListTableDataTypeWidgets,
1355
- Mn as getGroupItemValue,
1356
- Kt as getListTableCellId,
1357
- Pt as isListTableGroupDisplayObject,
1358
- et as isListTableGroupRow,
1359
- vn as renderListTableFallbackValue
1435
+ qn as ListTable,
1436
+ Qn as buildGroupedData,
1437
+ en as compareGroupingPathItems,
1438
+ Ho as defaultListTableDataTypeWidgets,
1439
+ Jn as getDefaultListTableDataTypeWidgets,
1440
+ Zo as getGroupItemValue,
1441
+ Ze as getListTableCellId,
1442
+ et as getListTableRowId,
1443
+ nt as isListTableGroupDisplayObject,
1444
+ se as isListTableGroupRow,
1445
+ tt as isListTableGrowColumn,
1446
+ $o as renderListTableFallbackValue
1360
1447
  };