@ynput/ayon-frontend-shared 0.4.7 → 0.5.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 (48) hide show
  1. package/dist/DetailsPanel.es.js +684 -651
  2. package/dist/ListTable.es.js +8 -7
  3. package/dist/ProjectTreeTable.es.js +2223 -2184
  4. package/dist/Slicer.es.js +152 -120
  5. package/dist/api.es.js +202 -201
  6. package/dist/chunks/Actions.es.js +20 -20
  7. package/dist/chunks/ColumnDropIndicator.es.js +127 -241
  8. package/dist/chunks/DeleteEntitiesContext.es.js +36 -36
  9. package/dist/chunks/DetailsDialog.es.js +3 -3
  10. package/dist/chunks/EntityPath.es.js +22 -22
  11. package/dist/chunks/EntityPickerDialog.es.js +1 -1
  12. package/dist/chunks/EntityTooltip.es.js +12 -12
  13. package/dist/chunks/Feed.es.js +2 -2
  14. package/dist/chunks/FilterErrorActions.es.js +5 -5
  15. package/dist/chunks/GlobalContext.es.js +14 -14
  16. package/dist/chunks/InfoMessage.es.js +146 -0
  17. package/dist/chunks/Menu.es.js +5 -5
  18. package/dist/chunks/MenuContext.es.js +75 -73
  19. package/dist/chunks/MetaWidget.es.js +1968 -1960
  20. package/dist/chunks/NewEntityContext.es.js +538 -543
  21. package/dist/chunks/PlayableIcon.es.js +54 -54
  22. package/dist/chunks/ProjectContext.es.js +12 -12
  23. package/dist/chunks/ProjectFoldersContext.es.js +84 -76
  24. package/dist/chunks/RepresentationsList.es.js +1 -1
  25. package/dist/chunks/ReviewablesSelector.es.js +387 -384
  26. package/dist/chunks/SimpleTable.es.js +286 -283
  27. package/dist/chunks/Slicer.es.js +1121 -683
  28. package/dist/chunks/VersionUploadContext.es.js +26 -26
  29. package/dist/chunks/ViewsContext.es.js +31 -31
  30. package/dist/chunks/Watchers.es.js +1 -1
  31. package/dist/chunks/entityDefinitions.es.js +275 -133
  32. package/dist/chunks/getUris.es.js +236 -231
  33. package/dist/chunks/searchTerms.es.js +9 -0
  34. package/dist/chunks/useAttributeEnums.es.js +69 -61
  35. package/dist/chunks/useLocalStorage.es.js +10 -10
  36. package/dist/chunks/viewUpdateHelper.es.js +23 -23
  37. package/dist/components.es.js +166 -166
  38. package/dist/hooks.es.js +44 -43
  39. package/dist/index.es.js +11 -10
  40. package/dist/types/DetailsPanel.d.ts +6 -0
  41. package/dist/types/ProjectTreeTable.d.ts +28 -6
  42. package/dist/types/RepresentationsList.d.ts +3 -0
  43. package/dist/types/SimpleTable.d.ts +1 -0
  44. package/dist/types/Slicer.d.ts +103 -18
  45. package/dist/types/api.d.ts +13 -0
  46. package/dist/types/components.d.ts +7 -5
  47. package/package.json +11 -10
  48. package/dist/chunks/useSlicerSplitter.es.js +0 -18
@@ -1,20 +1,20 @@
1
- import { jsx as d, jsxs as O, Fragment as ze } from "react/jsx-runtime";
2
- import { useCallback as w, createContext as Te, useContext as Ae, forwardRef as Le, useState as je, useEffect as me, useRef as S, useMemo as le } from "react";
3
- import { theme as Ie, Button as fe, Icon as pe, InputText as Pe, Spacer as $e } from "@ynput/ayon-react-components";
4
- import P from "styled-components";
5
- import { functionalUpdate as ge, useReactTable as He, getExpandedRowModel as Ve, getFilteredRowModel as Be, getCoreRowModel as qe, flexRender as Oe, sortingFns as Ge } from "@tanstack/react-table";
6
- import { useVirtualizer as _e } from "@tanstack/react-virtual";
7
- import F from "clsx";
8
- import { compareItems as Qe } from "@tanstack/match-sorter-utils";
1
+ import { jsx as d, jsxs as G, Fragment as $e } from "react/jsx-runtime";
2
+ import { useCallback as w, createContext as Ie, useContext as Le, forwardRef as je, useState as Pe, useEffect as ye, useRef as R, useMemo as se } from "react";
3
+ import { theme as He, Button as xe, Icon as fe, InputText as Ve, Spacer as Be } from "@ynput/ayon-react-components";
4
+ import L from "styled-components";
5
+ import { functionalUpdate as he, useReactTable as qe, getExpandedRowModel as Oe, getFilteredRowModel as Ge, getCoreRowModel as _e, flexRender as Qe, sortingFns as Je } from "@tanstack/react-table";
6
+ import { useVirtualizer as Ue } from "@tanstack/react-virtual";
7
+ import K from "clsx";
8
+ import { compareItems as We } from "@tanstack/match-sorter-utils";
9
9
  import "lodash";
10
10
  import "primereact/confirmdialog";
11
11
  import "react-toastify";
12
12
  import "uuid";
13
- import { bq as Je, br as Ue } from "./searchTerms.es.js";
14
- import { E as We } from "./EmptyPlaceholder.es.js";
15
- import { a as Ye } from "./useCreateContextMenu.es.js";
13
+ import { bq as Ye, br as Xe } from "./searchTerms.es.js";
14
+ import { E as Ze } from "./EmptyPlaceholder.es.js";
15
+ import { a as et } from "./useCreateContextMenu.es.js";
16
16
  import "primereact-context/contextmenu";
17
- const Xe = P.div`
17
+ const tt = L.div`
18
18
  display: flex;
19
19
 
20
20
  height: 100%;
@@ -40,7 +40,7 @@ const Xe = P.div`
40
40
  font-size: 32px;
41
41
  }
42
42
  h3 {
43
- ${Ie.titleMedium}
43
+ ${He.titleMedium}
44
44
  }
45
45
  }
46
46
 
@@ -70,7 +70,7 @@ const Xe = P.div`
70
70
  padding: 1px 0px;
71
71
  width: 100%;
72
72
  }
73
- `, Ze = P.div`
73
+ `, nt = L.div`
74
74
  width: 100%;
75
75
  min-height: 32px;
76
76
  user-select: none;
@@ -261,7 +261,7 @@ const Xe = P.div`
261
261
  border-radius: 2px;
262
262
  }
263
263
  }
264
- `, et = P(fe)`
264
+ `, ot = L(xe)`
265
265
  &.expander {
266
266
  background-color: unset;
267
267
  padding: 2px;
@@ -270,7 +270,7 @@ const Xe = P.div`
270
270
  background-color: var(--md-sys-color-surface-container-high-hover);
271
271
  }
272
272
  }
273
- `, Et = P.div`
273
+ `, Mt = L.div`
274
274
  border-radius: var(--border-radius-m);
275
275
  overflow: hidden;
276
276
  background-color: var(--md-sys-color-surface-container-low);
@@ -280,7 +280,7 @@ const Xe = P.div`
280
280
  display: flex;
281
281
  flex-direction: column;
282
282
  position: relative;
283
- `, kt = P.div`
283
+ `, Ft = L.div`
284
284
  padding: 2px;
285
285
  width: 100%;
286
286
  justify-content: space-between;
@@ -291,7 +291,7 @@ const Xe = P.div`
291
291
  gap: var(--base-gap-small);
292
292
 
293
293
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
294
- `, Kt = P(fe)`
294
+ `, Nt = L(xe)`
295
295
  background-color: unset !important;
296
296
  z-index: 110;
297
297
  position: relative;
@@ -312,7 +312,7 @@ const Xe = P.div`
312
312
  background-color: var(--md-sys-color-surface-container-hover) !important;
313
313
  }
314
314
  `;
315
- function tt({
315
+ function rt({
316
316
  handleRowSelect: t,
317
317
  handleArrowNavigation: a,
318
318
  handleRename: l
@@ -323,26 +323,26 @@ function tt({
323
323
  n.preventDefault(), n.stopPropagation(), t(n, p);
324
324
  else if (n.key === "ArrowDown" || n.key === "ArrowUp") {
325
325
  n.preventDefault(), n.stopPropagation();
326
- const x = n.key === "ArrowDown" ? "down" : "up";
327
- a?.(x, p, n);
326
+ const b = n.key === "ArrowDown" ? "down" : "up";
327
+ a?.(b, p, n);
328
328
  } else n.key.toLowerCase() === "r" && !n.ctrlKey && !n.metaKey && (n.preventDefault(), n.stopPropagation(), l?.(n, p));
329
329
  },
330
330
  [t, a, l]
331
331
  ) };
332
332
  }
333
- const he = Te(void 0), Mt = ({ children: t, ...a }) => /* @__PURE__ */ d(he.Provider, { value: { ...a }, children: t }), nt = () => {
334
- const t = Ae(he);
333
+ const be = Ie(void 0), Dt = ({ children: t, ...a }) => /* @__PURE__ */ d(be.Provider, { value: { ...a }, children: t }), at = () => {
334
+ const t = Le(be);
335
335
  if (t === void 0)
336
336
  throw new Error("useSimpleTableContext must be used within a SimpleTableProvider");
337
337
  return t;
338
- }, ot = ({
338
+ }, it = ({
339
339
  isRowExpandable: t,
340
340
  isRowExpanded: a,
341
341
  enableNonFolderIndent: l = !0,
342
342
  isTableExpandable: u,
343
343
  onExpandClick: n
344
344
  }) => t ? /* @__PURE__ */ d(
345
- et,
345
+ ot,
346
346
  {
347
347
  onClick: (p) => {
348
348
  p.stopPropagation(), n?.(p);
@@ -351,7 +351,7 @@ const he = Te(void 0), Mt = ({ children: t, ...a }) => /* @__PURE__ */ d(he.Prov
351
351
  className: "expander",
352
352
  style: { cursor: "pointer" }
353
353
  }
354
- ) : u && l && /* @__PURE__ */ d("div", { style: { display: "inline-block", minWidth: 24 } }), rt = Le(
354
+ ) : u && l && /* @__PURE__ */ d("div", { style: { display: "inline-block", minWidth: 24 } }), lt = je(
355
355
  ({
356
356
  value: t,
357
357
  icon: a,
@@ -359,95 +359,95 @@ const he = Te(void 0), Mt = ({ children: t, ...a }) => /* @__PURE__ */ d(he.Prov
359
359
  iconColor: u,
360
360
  iconFilled: n,
361
361
  img: p,
362
- imgShape: x = "square",
363
- imgRatio: h,
364
- imgPosition: N = "start",
365
- isRowExpandable: G,
366
- isRowExpanded: $,
367
- isTableExpandable: _,
368
- enableNonFolderIndent: Q = !0,
369
- onExpandClick: H,
370
- startContent: J,
371
- endContent: V,
372
- badge: E,
373
- actions: D,
374
- isRenaming: k,
375
- renameInitialValue: z,
376
- onSubmitRename: U,
377
- onCancelRename: B,
378
- renamePlaceholder: W,
379
- depth: K = 0,
380
- isDisabled: Y,
381
- disabledMessage: X,
382
- active: T,
383
- inactive: re,
384
- style: Z,
362
+ imgShape: b = "square",
363
+ imgRatio: x,
364
+ imgPosition: M = "start",
365
+ isRowExpandable: _,
366
+ isRowExpanded: j,
367
+ isTableExpandable: Q,
368
+ enableNonFolderIndent: J = !0,
369
+ onExpandClick: P,
370
+ startContent: U,
371
+ endContent: H,
372
+ badge: C,
373
+ actions: F,
374
+ isRenaming: E,
375
+ renameInitialValue: N,
376
+ onSubmitRename: W,
377
+ onCancelRename: V,
378
+ renamePlaceholder: Y,
379
+ depth: k = 0,
380
+ isDisabled: X,
381
+ disabledMessage: Z,
382
+ active: ee,
383
+ inactive: D,
384
+ style: re,
385
385
  pt: y,
386
- ...M
387
- }, ee) => {
388
- const [A, C] = je(z ?? t);
389
- me(() => {
390
- k && C(z ?? t);
391
- }, [t, k, z]);
392
- const v = p ? /* @__PURE__ */ d(
386
+ ...te
387
+ }, z) => {
388
+ const [B, T] = Pe(N ?? t);
389
+ ye(() => {
390
+ E && T(N ?? t);
391
+ }, [t, E, N]);
392
+ const S = p ? /* @__PURE__ */ d(
393
393
  "img",
394
394
  {
395
395
  src: p,
396
396
  ...y?.img,
397
397
  alt: "",
398
- className: F("image", x, `img-${N}`, y?.img?.className),
398
+ className: K("image", b, `img-${M}`, y?.img?.className),
399
399
  style: {
400
- aspectRatio: (h ?? 1).toString(),
400
+ aspectRatio: (x ?? 1).toString(),
401
401
  ...y?.img?.style
402
402
  }
403
403
  }
404
404
  ) : (
405
405
  // keep the slot so rows don't shift when a thumbnail is missing
406
- h !== void 0 && /* @__PURE__ */ d(
406
+ x !== void 0 && /* @__PURE__ */ d(
407
407
  "div",
408
408
  {
409
- className: F("image", x, `img-${N}`, y?.img?.className),
409
+ className: K("image", b, `img-${M}`, y?.img?.className),
410
410
  style: {
411
- aspectRatio: h.toString(),
411
+ aspectRatio: x.toString(),
412
412
  ...y?.img?.style
413
413
  }
414
414
  }
415
415
  )
416
416
  );
417
- return /* @__PURE__ */ O(
418
- Ze,
417
+ return /* @__PURE__ */ G(
418
+ nt,
419
419
  {
420
- ...M,
421
- ref: ee,
422
- className: F(M.className, {
423
- disabled: Y,
424
- inactive: re || T === !1,
425
- "has-actions": !!D?.length
420
+ ...te,
421
+ ref: z,
422
+ className: K(te.className, {
423
+ disabled: X,
424
+ inactive: D || ee === !1,
425
+ "has-actions": !!F?.length
426
426
  }),
427
427
  style: {
428
- ...Z,
429
- paddingLeft: `calc(${K * 1.5}rem + 4px)`
428
+ ...re,
429
+ paddingLeft: `calc(${k * 1.5}rem + 4px)`
430
430
  },
431
- title: Y ? X : void 0,
431
+ title: X ? Z : void 0,
432
432
  children: [
433
433
  /* @__PURE__ */ d(
434
- ot,
434
+ it,
435
435
  {
436
- isRowExpandable: G,
437
- isRowExpanded: $,
438
- isTableExpandable: _,
439
- onExpandClick: H,
440
- enableNonFolderIndent: Q,
436
+ isRowExpandable: _,
437
+ isRowExpanded: j,
438
+ isTableExpandable: Q,
439
+ onExpandClick: P,
440
+ enableNonFolderIndent: J,
441
441
  ...y?.expander
442
442
  }
443
443
  ),
444
- N === "start" && v,
445
- J,
444
+ M === "start" && S,
445
+ U,
446
446
  a && /* @__PURE__ */ d(
447
- pe,
447
+ fe,
448
448
  {
449
449
  icon: a,
450
- className: F({ filled: n }, y?.icon?.className),
450
+ className: K({ filled: n }, y?.icon?.className),
451
451
  style: {
452
452
  color: u,
453
453
  ...y?.icon?.style
@@ -455,129 +455,132 @@ const he = Te(void 0), Mt = ({ children: t, ...a }) => /* @__PURE__ */ d(he.Prov
455
455
  ...y?.icon
456
456
  }
457
457
  ),
458
- k ? /* @__PURE__ */ d(
459
- Pe,
458
+ E ? /* @__PURE__ */ d(
459
+ Ve,
460
460
  {
461
461
  autoFocus: !0,
462
462
  style: { flex: 1 },
463
- onChange: (b) => C(b.target.value),
464
- value: A,
465
- placeholder: W,
466
- onKeyDown: (b) => {
467
- b.key === "Enter" && U?.(A), b.key === "Escape" && B?.();
463
+ onChange: (f) => T(f.target.value),
464
+ value: B,
465
+ placeholder: Y,
466
+ onKeyDown: (f) => {
467
+ f.key === "Enter" && W?.(B), f.key === "Escape" && V?.();
468
468
  },
469
469
  onBlur: () => {
470
- B?.();
470
+ V?.();
471
471
  },
472
- onFocus: (b) => {
473
- b.target.select();
472
+ onFocus: (f) => {
473
+ f.target.select();
474
474
  },
475
475
  ...y?.input
476
476
  }
477
- ) : /* @__PURE__ */ O("div", { className: "text", ...y?.text, children: [
478
- l && K === 0 && /* @__PURE__ */ O("span", { className: "path", children: [
477
+ ) : /* @__PURE__ */ G("div", { className: "text", ...y?.text, children: [
478
+ l && k === 0 && /* @__PURE__ */ G("span", { className: "path", children: [
479
479
  l.join(" / "),
480
480
  " / "
481
481
  ] }),
482
482
  /* @__PURE__ */ d("span", { className: "value", children: t })
483
483
  ] }),
484
- !k && /* @__PURE__ */ O(ze, { children: [
485
- /* @__PURE__ */ d($e, { className: "spacer" }),
486
- E?.toString() && /* @__PURE__ */ d("div", { className: "badges", children: typeof E == "string" ? /* @__PURE__ */ d("span", { children: E }) : E }),
487
- D && /* @__PURE__ */ d("div", { className: "actions", children: D.map((b, te) => {
488
- const { show: L = "hover", ...j } = b;
489
- return L === "hidden" ? null : /* @__PURE__ */ d(
490
- pe,
484
+ !E && /* @__PURE__ */ G($e, { children: [
485
+ /* @__PURE__ */ d(Be, { className: "spacer" }),
486
+ C?.toString() && /* @__PURE__ */ d("div", { className: "badges", children: typeof C == "string" ? /* @__PURE__ */ d("span", { children: C }) : C }),
487
+ F && /* @__PURE__ */ d("div", { className: "actions", children: F.map((f, q) => {
488
+ const { show: A = "hover", ...$ } = f;
489
+ return A === "hidden" ? null : /* @__PURE__ */ d(
490
+ fe,
491
491
  {
492
- ...j,
493
- className: F(j.className, { "show-always": L === "always" })
492
+ ...$,
493
+ className: K($.className, { "show-always": A === "always" })
494
494
  },
495
- j.icon + te.toString()
495
+ $.icon + q.toString()
496
496
  );
497
497
  }) })
498
498
  ] }),
499
- N === "end" && v,
500
- V && V
499
+ M === "end" && S,
500
+ H && H
501
501
  ]
502
502
  }
503
503
  );
504
504
  }
505
- ), at = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : [t] : [], ye = (t, a) => {
506
- t.toggleExpanded(a), t.subRows.forEach((l) => ye(l, a));
507
- }, xe = (t, a, l, u) => {
505
+ ), st = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : [t] : [], we = (t, a) => {
506
+ t.toggleExpanded(a), t.subRows.forEach((l) => we(l, a));
507
+ }, ve = (t, a, l, u) => {
508
508
  const n = t.getValue(a);
509
509
  let p = typeof n == "string" ? n : Array.isArray(n) ? n.join(" ") : JSON.stringify(n);
510
510
  a === "label" && (p = [t.original.label, t.original.name, ...t.original.parents || []].join(
511
511
  " "
512
512
  ));
513
- const x = Je(p, l);
514
- return u({ itemRank: x }), x.passed;
513
+ const b = Ye(p, l);
514
+ return u({ itemRank: b }), b.passed;
515
515
  };
516
- xe.resolveFilterValue = Ue;
517
- const it = (t, a, l) => {
516
+ ve.resolveFilterValue = Xe;
517
+ const ct = (t, a, l) => {
518
518
  let u = 0;
519
- return t.columnFiltersMeta[l] && (u = Qe(
519
+ return t.columnFiltersMeta[l] && (u = We(
520
520
  t.columnFiltersMeta[l]?.itemRank,
521
521
  a.columnFiltersMeta[l]?.itemRank
522
- )), u === 0 ? Ge.alphanumeric(t, a, l) : u;
522
+ )), u === 0 ? Je.alphanumeric(t, a, l) : u;
523
523
  };
524
- function lt(t, a, l) {
524
+ function dt(t, a, l) {
525
525
  let u = -1, n = -1;
526
- for (let h = 0; h < t.length && (t[h].id === a && (u = h), t[h].id === l && (n = h), !(u !== -1 && n !== -1)); h++)
526
+ for (let x = 0; x < t.length && (t[x].id === a && (u = x), t[x].id === l && (n = x), !(u !== -1 && n !== -1)); x++)
527
527
  ;
528
528
  if (u === -1 || n === -1) return [];
529
- const p = Math.min(u, n), x = Math.max(u, n);
530
- return t.slice(p, x + 1);
529
+ const p = Math.min(u, n), b = Math.max(u, n);
530
+ return t.slice(p, b + 1);
531
531
  }
532
- const Ft = ({
532
+ const zt = ({
533
533
  data: t = [],
534
534
  isLoading: a,
535
535
  error: l,
536
536
  isExpandable: u,
537
537
  isMultiSelect: n = !0,
538
538
  enableClickToDeselect: p = !0,
539
- enableNonFolderIndent: x = !0,
540
- forceUpdateTable: h,
541
- globalFilter: N,
542
- meta: G,
543
- rowHeight: $,
544
- imgRatio: _,
545
- imgPosition: Q,
546
- onScrollBottom: H,
547
- onRename: J,
548
- renamingId: V,
549
- renameInitialValue: E,
550
- onSubmitRename: D,
551
- onCancelRename: k,
552
- onRowDoubleClick: z,
553
- onRowOptionClick: U,
554
- rowContextMenuBuilders: B = [],
555
- children: W,
556
- pt: K,
557
- fitContent: Y,
558
- ...X
539
+ enableNonFolderIndent: b = !0,
540
+ forceUpdateTable: x,
541
+ globalFilter: M,
542
+ meta: _,
543
+ rowHeight: j,
544
+ imgRatio: Q,
545
+ imgPosition: J,
546
+ onScrollBottom: P,
547
+ onRename: U,
548
+ renamingId: H,
549
+ renameInitialValue: C,
550
+ onSubmitRename: F,
551
+ onCancelRename: E,
552
+ onRowDoubleClick: N,
553
+ onRowOptionClick: W,
554
+ rowContextMenuBuilders: V = [],
555
+ children: Y,
556
+ pt: k,
557
+ fitContent: X,
558
+ rowIdPrefix: Z,
559
+ ...ee
559
560
  }) => {
560
561
  const {
561
- rowSelection: T,
562
+ rowSelection: D,
562
563
  expanded: re,
563
- setExpanded: Z,
564
- onExpandedChange: y,
565
- onRowSelectionChange: M,
566
- rowPinning: ee,
567
- onRowPinningChange: A
568
- } = nt(), C = S(null), v = S(null), [b] = Ye(), te = S(z);
569
- te.current = z;
570
- const L = S(V);
571
- L.current = V;
572
- const j = S(E);
573
- j.current = E;
574
- const ae = S(D);
575
- ae.current = D;
576
- const se = S(k);
577
- se.current = k;
578
- const ce = S(J);
579
- ce.current = J;
580
- const be = le(() => a ? Array.from({ length: 10 }, (e, i) => ({
564
+ setExpanded: y,
565
+ onExpandedChange: te,
566
+ onRowSelectionChange: z,
567
+ rowPinning: B,
568
+ onRowPinningChange: T
569
+ } = at(), S = R(null), f = R(null), q = R(Z);
570
+ q.current = Z;
571
+ const A = (e) => q.current ? `${q.current}-${e}` : e, [$] = et(), ce = R(N);
572
+ ce.current = N;
573
+ const ae = R(H);
574
+ ae.current = H;
575
+ const de = R(C);
576
+ de.current = C;
577
+ const ie = R(F);
578
+ ie.current = F;
579
+ const ue = R(E);
580
+ ue.current = E;
581
+ const pe = R(U);
582
+ pe.current = U;
583
+ const Re = se(() => a ? Array.from({ length: 10 }, (e, i) => ({
581
584
  id: `placeholder-${i}`,
582
585
  name: `placeholder-${i}`,
583
586
  label: `placeholder-${i}`,
@@ -587,31 +590,31 @@ const Ft = ({
587
590
  data: {
588
591
  id: `placeholder-${i}`
589
592
  }
590
- })) : t, [a, t, h]), I = w(
593
+ })) : t, [a, t, x]), I = w(
591
594
  (e, i, r, c) => {
592
- const s = i, g = e.getRowModel(), o = g.rows, R = g.rowsById[s], f = e.getState().rowSelection || {};
593
- if (!R) return { ...f };
594
- if (R.original.isDisabled)
595
- return { ...f };
596
- if (p && !r && !c && Object.keys(f).length === 1 && f[s])
597
- return e.setRowSelection({}), C.current = null, {};
595
+ const s = i, g = e.getRowModel(), o = g.rows, v = g.rowsById[s], h = e.getState().rowSelection || {};
596
+ if (!v) return { ...h };
597
+ if (v.original.isDisabled)
598
+ return { ...h };
599
+ if (p && !r && !c && Object.keys(h).length === 1 && h[s])
600
+ return e.setRowSelection({}), S.current = null, {};
598
601
  let m;
599
- if (n && r && C.current) {
600
- const Ne = C.current, ue = lt(o, s, Ne);
601
- ue.length === 0 ? m = { ...f, [s]: !0 } : (m = { ...f }, ue.forEach((De) => m[De.id] = !0));
602
- } else n && c ? (m = { ...f }, m[s] ? delete m[s] : m[s] = !0) : (m = { ...f }, Object.keys(m).length === 1 && m[s] || (m = { [s]: !0 }));
603
- return e.setRowSelection(m), C.current = s, m;
602
+ if (n && r && S.current) {
603
+ const Te = S.current, me = dt(o, s, Te);
604
+ me.length === 0 ? m = { ...h, [s]: !0 } : (m = { ...h }, me.forEach((Ae) => m[Ae.id] = !0));
605
+ } else n && c ? (m = { ...h }, m[s] ? delete m[s] : m[s] = !0) : (m = { ...h }, Object.keys(m).length === 1 && m[s] || (m = { [s]: !0 }));
606
+ return e.setRowSelection(m), S.current = s, m;
604
607
  },
605
608
  [n, p]
606
- ), we = w(
609
+ ), Se = w(
607
610
  (e, i) => {
608
- if (!v.current) {
611
+ if (!f.current) {
609
612
  console.warn("tableRef not yet available in handleRowSelectForKeydown");
610
613
  return;
611
614
  }
612
615
  const r = e.shiftKey, c = e.ctrlKey || e.metaKey;
613
616
  I(
614
- v.current,
617
+ f.current,
615
618
  // Pass the main table instance
616
619
  i.id,
617
620
  r,
@@ -620,10 +623,10 @@ const Ft = ({
620
623
  },
621
624
  [I]
622
625
  // Depends only on handleSelectionLogic
623
- ), ve = w(
626
+ ), Ce = w(
624
627
  (e, i, r) => {
625
- if (!v.current) return;
626
- const c = v.current.getRowModel().rows, s = c.findIndex((o) => o.id === i.id);
628
+ if (!f.current) return;
629
+ const c = f.current.getRowModel().rows, s = c.findIndex((o) => o.id === i.id);
627
630
  if (s === -1) return;
628
631
  let g = e === "down" ? s + 1 : s - 1;
629
632
  if (!(g < 0 || g >= c.length))
@@ -631,12 +634,12 @@ const Ft = ({
631
634
  const o = c[g];
632
635
  if (!o.original.isDisabled) {
633
636
  I(
634
- v.current,
637
+ f.current,
635
638
  o.id,
636
639
  r.shiftKey,
637
640
  r.ctrlKey || r.metaKey
638
641
  ), requestAnimationFrame(() => {
639
- const R = ie.current, m = (R ? R.querySelector(`#${CSS.escape(o.id)}`) : document.getElementById(o.id))?.querySelector('[tabindex="0"]');
642
+ const v = le.current, m = (v ? v.querySelector(`#${CSS.escape(A(o.id))}`) : document.getElementById(A(o.id)))?.querySelector('[tabindex="0"]');
640
643
  m && (m.focus(), m.scrollIntoView({ block: "nearest", behavior: "smooth" }));
641
644
  });
642
645
  return;
@@ -645,38 +648,38 @@ const Ft = ({
645
648
  }
646
649
  },
647
650
  [I]
648
- ), Re = w(
651
+ ), Ee = w(
649
652
  (e, i) => {
650
- i.original.isDisabled || ce.current?.(i.id, i);
653
+ i.original.isDisabled || pe.current?.(i.id, i);
651
654
  },
652
655
  []
653
656
  // eslint-disable-line react-hooks/exhaustive-deps
654
- ), { handleRowKeyDown: de } = tt({
655
- handleRowSelect: we,
656
- handleArrowNavigation: ve,
657
- handleRename: Re
658
- }), Se = le(
657
+ ), { handleRowKeyDown: ge } = rt({
658
+ handleRowSelect: Se,
659
+ handleArrowNavigation: Ce,
660
+ handleRename: Ee
661
+ }), ke = se(
659
662
  () => [
660
663
  {
661
664
  accessorKey: "label",
662
665
  header: void 0,
663
666
  filterFn: "fuzzy",
664
- sortingFn: it,
667
+ sortingFn: ct,
665
668
  //sort by fuzzy rank (falls back to alphanumeric)
666
669
  cell: ({ row: e, getValue: i, table: r }) => {
667
670
  const c = r.options.meta, s = (o) => {
668
671
  if (o.target instanceof HTMLInputElement || o.target instanceof HTMLButtonElement || o.target instanceof HTMLTextAreaElement || o.target instanceof HTMLSelectElement || o.target instanceof HTMLAnchorElement || o.target.closest("button, a, input, textarea, select"))
669
672
  return;
670
- const f = o.altKey && e.getIsSelected() && !o.shiftKey && !o.ctrlKey && !o.metaKey ? r.getState().rowSelection || {} : I(
673
+ const h = o.altKey && e.getIsSelected() && !o.shiftKey && !o.ctrlKey && !o.metaKey ? r.getState().rowSelection || {} : I(
671
674
  r,
672
675
  // Pass the cell's table instance
673
676
  e.id,
674
677
  o.shiftKey,
675
678
  o.ctrlKey || o.metaKey
676
679
  );
677
- o.altKey && U?.(e.original, Object.keys(f));
680
+ o.altKey && W?.(e.original, Object.keys(h));
678
681
  }, g = {
679
- className: F({
682
+ className: K({
680
683
  selected: e.getIsSelected(),
681
684
  loading: c?.isLoading,
682
685
  disabled: e.original.isDisabled,
@@ -685,7 +688,7 @@ const Ft = ({
685
688
  // false: archived items but still selectable
686
689
  }),
687
690
  onKeyDown: (o) => {
688
- o.target instanceof HTMLInputElement || de(o, e);
691
+ o.target instanceof HTMLInputElement || ge(o, e);
689
692
  },
690
693
  depth: e.depth,
691
694
  tabIndex: 0,
@@ -696,160 +699,160 @@ const Ft = ({
696
699
  iconFilled: e.original.iconFilled,
697
700
  img: e.original.img,
698
701
  imgShape: e.original.imgShape,
699
- imgRatio: _,
700
- imgPosition: Q,
702
+ imgRatio: Q,
703
+ imgPosition: J,
701
704
  isRowExpandable: e.getCanExpand(),
702
- enableNonFolderIndent: x,
705
+ enableNonFolderIndent: b,
703
706
  isRowExpanded: e.getIsExpanded(),
704
707
  isTableExpandable: c?.isExpandable,
705
708
  onExpandClick: (o) => {
706
- o?.altKey ? ye(e, !e.getIsExpanded()) : e.toggleExpanded();
709
+ o?.altKey ? we(e, !e.getIsExpanded()) : e.toggleExpanded();
707
710
  },
708
711
  startContent: e.original.startContent,
709
712
  endContent: e.original.endContent,
710
713
  badge: e.original.badge,
711
714
  isDisabled: e.original.isDisabled,
712
715
  disabledMessage: e.original.disabledMessage,
713
- isRenaming: e.id === L.current,
714
- renameInitialValue: e.id === L.current ? j.current : void 0,
715
- onSubmitRename: ae.current ? (o) => ae.current(e.id, o) : void 0,
716
- onCancelRename: se.current,
717
- ...K?.cell,
716
+ isRenaming: e.id === ae.current,
717
+ renameInitialValue: e.id === ae.current ? de.current : void 0,
718
+ onSubmitRename: ie.current ? (o) => ie.current(e.id, o) : void 0,
719
+ onCancelRename: ue.current,
720
+ ...k?.cell,
718
721
  onClick: s,
719
722
  // Added onClick handler
720
- onDoubleClick: (o) => te.current?.(e.id, e)
723
+ onDoubleClick: (o) => ce.current?.(e.id, e)
721
724
  };
722
- return c?.children ? c.children(g, e, r) : /* @__PURE__ */ d(rt, { ...g, ...K?.cell });
725
+ return c?.children ? c.children(g, e, r) : /* @__PURE__ */ d(lt, { ...g, ...k?.cell });
723
726
  }
724
727
  }
725
728
  ],
726
729
  [
727
- h,
730
+ x,
728
731
  I,
729
- de,
732
+ ge,
730
733
  p,
731
- x,
732
- _,
734
+ b,
733
735
  Q,
734
- U
736
+ J,
737
+ W
735
738
  ]
736
- ), Ce = w(
739
+ ), Ke = w(
737
740
  (e) => {
738
- M(ge(e, T));
741
+ z(he(e, D));
739
742
  },
740
- [M]
741
- ), Ee = w(
743
+ [z]
744
+ ), Me = w(
742
745
  (e) => {
743
- A?.(ge(e, ee || {}));
746
+ T?.(he(e, B || {}));
744
747
  },
745
- [A]
746
- ), ke = w(
748
+ [T]
749
+ ), Fe = w(
747
750
  (e) => {
748
- Z?.((i) => {
751
+ y?.((i) => {
749
752
  const r = e instanceof Function ? e(i) : e;
750
- return y?.(r), r;
753
+ return te?.(r), r;
751
754
  });
752
755
  },
753
- [Z]
754
- ), q = He({
755
- data: be,
756
- columns: Se,
756
+ [y]
757
+ ), O = qe({
758
+ data: Re,
759
+ columns: ke,
757
760
  state: {
758
761
  expanded: re,
759
- rowSelection: T,
760
- globalFilter: N,
761
- rowPinning: ee
762
+ rowSelection: D,
763
+ globalFilter: M,
764
+ rowPinning: B
762
765
  },
763
- onRowSelectionChange: Ce,
764
- onRowPinningChange: Ee,
766
+ onRowSelectionChange: Ke,
767
+ onRowPinningChange: Me,
765
768
  filterFns: {
766
- fuzzy: xe
769
+ fuzzy: ve
767
770
  },
768
771
  globalFilterFn: "fuzzy",
769
772
  enableRowSelection: !0,
770
773
  //enable row selection for all rows
771
- enableRowPinning: !!A,
774
+ enableRowPinning: !!T,
772
775
  getRowId: (e) => e.id,
773
776
  enableSubRowSelection: !1,
774
777
  //disable sub row selection
775
- onExpandedChange: ke,
778
+ onExpandedChange: Fe,
776
779
  getSubRows: (e) => e.subRows,
777
- getCoreRowModel: qe(),
778
- getFilteredRowModel: Be(),
779
- getExpandedRowModel: Ve(),
780
+ getCoreRowModel: _e(),
781
+ getFilteredRowModel: Ge(),
782
+ getExpandedRowModel: Oe(),
780
783
  filterFromLeafRows: !0,
781
784
  // debugTable: true,
782
785
  // @ts-expect-error: updateData is not required
783
- meta: le(
786
+ meta: se(
784
787
  () => ({
785
788
  isExpandable: !!u,
786
789
  isLoading: a,
787
- children: W,
788
- ...G
790
+ children: Y,
791
+ ..._
789
792
  }),
790
- [u, a, W, G]
793
+ [u, a, Y, _]
791
794
  )
792
795
  });
793
- me(() => {
794
- v.current = q;
795
- }, [q]);
796
- const { rows: ne } = q.getRowModel(), Ke = w(
796
+ ye(() => {
797
+ f.current = O;
798
+ }, [O]);
799
+ const { rows: ne } = O.getRowModel(), Ne = w(
797
800
  (e, i, r) => {
798
- if (!v.current) return;
801
+ if (!f.current) return;
799
802
  const c = ne[i];
800
803
  if (!c || c.original === void 0) return;
801
804
  r.preventDefault(), r.stopPropagation();
802
- const s = Object.keys(T), g = s.includes(e) ? s : [e];
805
+ const s = Object.keys(D), g = s.includes(e) ? s : [e];
803
806
  if (!s.includes(e)) {
804
- const R = { [e]: !0 };
805
- M?.(R);
807
+ const v = { [e]: !0 };
808
+ z?.(v);
806
809
  }
807
- const o = B.flatMap(
808
- (R) => at(
809
- R(r, {
810
+ const o = V.flatMap(
811
+ (v) => st(
812
+ v(r, {
810
813
  rowId: e,
811
814
  rowIndex: i,
812
815
  row: c,
813
816
  selectedRows: g,
814
- selectedTableRows: g.map((f) => q.getRowModel().rowsById[f]).filter((f) => !!f),
817
+ selectedTableRows: g.map((h) => O.getRowModel().rowsById[h]).filter((h) => !!h),
815
818
  isSelected: g.includes(e)
816
819
  })
817
820
  )
818
821
  );
819
- o.length > 0 && b(r, o);
822
+ o.length > 0 && $(r, o);
820
823
  },
821
- [B, ne, T, M, b]
822
- ), ie = S(null), oe = _e({
824
+ [V, ne, D, z, $]
825
+ ), le = R(null), oe = Ue({
823
826
  count: ne.length,
824
- estimateSize: () => $ || 34,
827
+ estimateSize: () => j || 34,
825
828
  //estimate row height for accurate scrollbar dragging
826
- getScrollElement: () => ie.current,
829
+ getScrollElement: () => le.current,
827
830
  //measure dynamic row height, except in firefox because it measures table border height incorrectly
828
- measureElement: $ ? () => $ : typeof window < "u" && navigator.userAgent.indexOf("Firefox") === -1 ? (e) => e?.getBoundingClientRect().height : void 0,
831
+ measureElement: j ? () => j : typeof window < "u" && navigator.userAgent.indexOf("Firefox") === -1 ? (e) => e?.getBoundingClientRect().height : void 0,
829
832
  overscan: 5
830
- }), Me = w(
833
+ }), De = w(
831
834
  (e) => {
832
835
  e && oe.measureElement(e);
833
836
  },
834
837
  [oe]
835
- ), Fe = w(
838
+ ), ze = w(
836
839
  (e) => {
837
- if (!H) return;
840
+ if (!P) return;
838
841
  const i = e.currentTarget, { scrollTop: r, scrollHeight: c, clientHeight: s } = i;
839
- c - r - s < 100 && !a && H();
842
+ c - r - s < 100 && !a && P();
840
843
  },
841
- [H, a]
844
+ [P, a]
842
845
  );
843
- return /* @__PURE__ */ O(
844
- Xe,
846
+ return /* @__PURE__ */ G(
847
+ tt,
845
848
  {
846
- ref: ie,
847
- onScroll: Fe,
849
+ ref: le,
850
+ onScroll: ze,
848
851
  onClick: (e) => {
849
- p && !e.target.closest("tr") && (q.setRowSelection({}), C.current = null);
852
+ p && !e.target.closest("tr") && (O.setRowSelection({}), S.current = null);
850
853
  },
851
- ...X,
852
- className: F(X.className, { isLoading: a, fitContent: Y }),
854
+ ...ee,
855
+ className: K(ee.className, { isLoading: a, fitContent: X }),
853
856
  children: [
854
857
  !l && /* @__PURE__ */ d("table", { children: /* @__PURE__ */ d(
855
858
  "tbody",
@@ -864,38 +867,38 @@ const Ft = ({
864
867
  "tr",
865
868
  {
866
869
  "data-index": e.index,
867
- ref: Me,
868
- id: i.id,
869
- onContextMenu: (r) => Ke(i.id, e.index, r),
870
- ...K?.row,
870
+ ref: De,
871
+ id: A(i.id),
872
+ onContextMenu: (r) => Ne(i.id, e.index, r),
873
+ ...k?.row,
871
874
  style: {
872
875
  transform: `translateY(${e.start}px)`,
873
876
  //this should always be a `style` as it changes on scroll
874
- ...K?.row?.style
877
+ ...k?.row?.style
875
878
  // custom styles to be passed
876
879
  },
877
- children: i.getVisibleCells().map((r) => /* @__PURE__ */ d("td", { children: Oe(r.column.columnDef.cell, r.getContext()) }, r.id))
880
+ children: i.getVisibleCells().map((r) => /* @__PURE__ */ d("td", { children: Qe(r.column.columnDef.cell, r.getContext()) }, r.id))
878
881
  },
879
882
  i.id
880
883
  );
881
884
  })
882
885
  }
883
886
  ) }),
884
- !!l && /* @__PURE__ */ d(We, { error: l })
887
+ !!l && /* @__PURE__ */ d(Ze, { error: l })
885
888
  ]
886
889
  }
887
890
  );
888
891
  };
889
892
  export {
890
- Ze as C,
891
- et as E,
892
- kt as H,
893
- ot as R,
894
- Ft as S,
895
- Xe as T,
896
- Et as a,
897
- Kt as b,
898
- rt as c,
899
- Mt as d,
900
- nt as u
893
+ nt as C,
894
+ ot as E,
895
+ Ft as H,
896
+ it as R,
897
+ zt as S,
898
+ tt as T,
899
+ Mt as a,
900
+ Nt as b,
901
+ lt as c,
902
+ Dt as d,
903
+ at as u
901
904
  };