@ynput/ayon-frontend-shared 0.7.3 → 0.7.4

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 (66) hide show
  1. package/LICENSE +105 -0
  2. package/dist/DetailsPanel.es.js +1088 -969
  3. package/dist/ListTable.es.js +70 -67
  4. package/dist/NewEntity.es.js +8 -5
  5. package/dist/ProjectTreeTable.es.js +4134 -3825
  6. package/dist/ProjectsTable.es.js +526 -0
  7. package/dist/Slicer.es.js +75 -73
  8. package/dist/Views.es.js +86 -84
  9. package/dist/chunks/Actions.es.js +4 -2
  10. package/dist/chunks/ColumnDropIndicator.es.js +21 -18
  11. package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
  12. package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
  13. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
  14. package/dist/chunks/EmptyPlaceholder.es.js +9 -8
  15. package/dist/chunks/EntityPath.es.js +15 -14
  16. package/dist/chunks/EntityPickerDialog.es.js +5 -3
  17. package/dist/chunks/EntityTooltip.es.js +10 -8
  18. package/dist/chunks/EntityUpdatesContext.es.js +13 -12
  19. package/dist/chunks/Feed.es.js +12 -11
  20. package/dist/chunks/FilterErrorActions.es.js +6 -4
  21. package/dist/chunks/GroupSettingsFallback.es.js +75 -0
  22. package/dist/chunks/JsonViewer.es.js +3 -2
  23. package/dist/chunks/Menu.es.js +105 -103
  24. package/dist/chunks/MetaWidget.es.js +278 -275
  25. package/dist/chunks/PlayableIcon.es.js +868 -862
  26. package/dist/chunks/ProjectContext.es.js +5 -4
  27. package/dist/chunks/RepresentationsList.es.js +3 -2
  28. package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
  29. package/dist/chunks/SimpleTable.es.js +492 -402
  30. package/dist/chunks/Slicer.es.js +936 -896
  31. package/dist/chunks/TableExportContextInstance.es.js +437 -339
  32. package/dist/chunks/TableSettingsFallback.es.js +5 -3
  33. package/dist/chunks/ThumbnailSimple.es.js +15 -13
  34. package/dist/chunks/VideoPlayer.es.js +14 -12
  35. package/dist/chunks/Watchers.es.js +97 -95
  36. package/dist/chunks/getProjectDisplayName.es.js +4 -0
  37. package/dist/chunks/getUris.es.js +375 -374
  38. package/dist/chunks/useHierarchySelection.es.js +5 -3
  39. package/dist/chunks/useLoadModule.es.js +10 -8
  40. package/dist/chunks/viewUpdateHelper.es.js +12 -10
  41. package/dist/components.es.js +1488 -1186
  42. package/dist/context.es.js +589 -539
  43. package/dist/hooks.es.js +169 -212
  44. package/dist/index.es.js +17 -12
  45. package/dist/types/Actions.d.ts +17 -14
  46. package/dist/types/ContextMenu.d.ts +17 -14
  47. package/dist/types/DetailsPanel.d.ts +17 -14
  48. package/dist/types/EntityPickerDialog.d.ts +17 -14
  49. package/dist/types/Feed.d.ts +17 -14
  50. package/dist/types/ListTable.d.ts +17 -14
  51. package/dist/types/NewEntity.d.ts +17 -14
  52. package/dist/types/ProjectTreeTable.d.ts +749 -15
  53. package/dist/types/ProjectsTable.d.ts +228 -0
  54. package/dist/types/RepresentationsList.d.ts +17 -14
  55. package/dist/types/SimpleTable.d.ts +31 -14
  56. package/dist/types/Slicer.d.ts +18 -14
  57. package/dist/types/Views.d.ts +17 -14
  58. package/dist/types/api.d.ts +17 -14
  59. package/dist/types/components.d.ts +822 -25
  60. package/dist/types/context.d.ts +53 -15
  61. package/dist/types/hooks.d.ts +17 -14
  62. package/dist/types/index.d.ts +17 -14
  63. package/dist/types/util.d.ts +21 -14
  64. package/dist/util.es.js +152 -144
  65. package/package.json +15 -7
  66. /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
@@ -1,21 +1,24 @@
1
- import { jsx as u, jsxs as W, Fragment as Le } from "react/jsx-runtime";
2
- import { useCallback as w, createContext as je, useContext as Pe, forwardRef as qe, useState as He, useEffect as ce, useRef as v, useMemo as se } from "react";
3
- import { theme as Ve, Button as ve, Icon as xe, InputText as Be, Spacer as Oe } from "@ynput/ayon-react-components";
4
- import P from "styled-components";
5
- import { functionalUpdate as be, useReactTable as _e, getExpandedRowModel as Qe, getFilteredRowModel as Je, getCoreRowModel as Ue, flexRender as We, sortingFns as Ye } from "@tanstack/react-table";
6
- import { useVirtualizer as Ge } from "@tanstack/react-virtual";
7
- import M from "clsx";
8
- import { compareItems as Xe } from "@tanstack/match-sorter-utils";
1
+ import { jsx as p, jsxs as B, Fragment as Re } from "react/jsx-runtime";
2
+ import { useCallback as w, createContext as He, useContext as Oe, forwardRef as _e, useState as Ce, useEffect as ce, useMemo as le, useRef as R } from "react";
3
+ import { theme as Qe, Button as Ee, Icon as ve, InputText as Ue, Spacer as Je, Dialog as We } from "@ynput/ayon-react-components";
4
+ import H from "styled-components";
5
+ import { functionalUpdate as Se, useReactTable as Xe, getExpandedRowModel as Ye, getFilteredRowModel as Ge, getCoreRowModel as Ze, flexRender as et, sortingFns as tt } from "@tanstack/react-table";
6
+ import { useVirtualizer as nt } from "@tanstack/react-virtual";
7
+ import T from "clsx";
8
+ import { compareItems as ot } 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 { bE as Ze, bF as et } from "./searchTerms.es.js";
14
- import { E as tt } from "./EmptyPlaceholder.es.js";
13
+ import { bE as rt, bF as at } from "./searchTerms.es.js";
14
+ import "axios";
15
+ import { E as it } from "./EmptyPlaceholder.es.js";
15
16
  import "./ContextMenuContextInstance.es.js";
16
17
  import "primereact-context/contextmenu";
17
- import { u as nt } from "./useCreateContextMenu.es.js";
18
- const ot = P.div`
18
+ import { u as st } from "./useCreateContextMenu.es.js";
19
+ import { ContributionView as lt, useContributions as ct, runContribution as dt } from "@ynput/ayon-addon";
20
+ import { reportContributionError as ut, parseShortcut as pt, matchesShortcut as gt } from "@ynput/ayon-addon/host";
21
+ const mt = H.div`
19
22
  display: flex;
20
23
 
21
24
  height: 100%;
@@ -41,7 +44,7 @@ const ot = P.div`
41
44
  font-size: 32px;
42
45
  }
43
46
  h3 {
44
- ${Ve.titleMedium}
47
+ ${Qe.titleMedium}
45
48
  }
46
49
  }
47
50
 
@@ -71,7 +74,7 @@ const ot = P.div`
71
74
  padding: 1px 0px;
72
75
  width: 100%;
73
76
  }
74
- `, rt = P.div`
77
+ `, ft = H.div`
75
78
  width: 100%;
76
79
  min-height: 32px;
77
80
  user-select: none;
@@ -277,7 +280,7 @@ const ot = P.div`
277
280
  border-radius: 2px;
278
281
  }
279
282
  }
280
- `, at = P(ve)`
283
+ `, ht = H(Ee)`
281
284
  &.expander {
282
285
  background-color: unset;
283
286
  padding: 2px;
@@ -286,7 +289,7 @@ const ot = P.div`
286
289
  background-color: var(--md-sys-color-surface-container-high-hover);
287
290
  }
288
291
  }
289
- `, Dt = P.div`
292
+ `, Wt = H.div`
290
293
  border-radius: var(--border-radius-m);
291
294
  overflow: hidden;
292
295
  background-color: var(--md-sys-color-surface-container-low);
@@ -296,7 +299,7 @@ const ot = P.div`
296
299
  display: flex;
297
300
  flex-direction: column;
298
301
  position: relative;
299
- `, zt = P.div`
302
+ `, Xt = H.div`
300
303
  padding: 2px;
301
304
  width: 100%;
302
305
  justify-content: space-between;
@@ -307,7 +310,7 @@ const ot = P.div`
307
310
  gap: var(--base-gap-small);
308
311
 
309
312
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
310
- `, Tt = P(ve)`
313
+ `, Yt = H(Ee)`
311
314
  background-color: unset !important;
312
315
  z-index: 110;
313
316
  position: relative;
@@ -328,10 +331,10 @@ const ot = P.div`
328
331
  background-color: var(--md-sys-color-surface-container-hover) !important;
329
332
  }
330
333
  `;
331
- function it({
334
+ function yt({
332
335
  handleRowSelect: t,
333
- handleArrowNavigation: i,
334
- handleRename: l
336
+ handleArrowNavigation: o,
337
+ handleRename: s
335
338
  }) {
336
339
  return { handleRowKeyDown: w(
337
340
  (n, g) => {
@@ -339,591 +342,678 @@ function it({
339
342
  n.preventDefault(), n.stopPropagation(), t(n, g);
340
343
  else if (n.key === "ArrowDown" || n.key === "ArrowUp") {
341
344
  n.preventDefault(), n.stopPropagation();
342
- const b = n.key === "ArrowDown" ? "down" : "up";
343
- i?.(b, g, n);
344
- } else n.key.toLowerCase() === "r" && !n.ctrlKey && !n.metaKey && (n.preventDefault(), n.stopPropagation(), l?.(n, g));
345
+ const x = n.key === "ArrowDown" ? "down" : "up";
346
+ o?.(x, g, n);
347
+ } else n.key.toLowerCase() === "r" && !n.ctrlKey && !n.metaKey && (n.preventDefault(), n.stopPropagation(), s?.(n, g));
345
348
  },
346
- [t, i, l]
349
+ [t, o, s]
347
350
  ) };
348
351
  }
349
- const we = je(void 0), lt = () => {
350
- const t = Pe(we);
352
+ const ke = He(void 0), xt = () => {
353
+ const t = Oe(ke);
351
354
  if (t === void 0)
352
355
  throw new Error("useSimpleTableContext must be used within a SimpleTableProvider");
353
356
  return t;
354
- }, At = ({ children: t, ...i }) => /* @__PURE__ */ u(we.Provider, { value: { ...i }, children: t }), st = ({
357
+ }, Gt = ({ children: t, ...o }) => /* @__PURE__ */ p(ke.Provider, { value: { ...o }, children: t }), bt = ({
355
358
  isRowExpandable: t,
356
- isRowExpanded: i,
357
- enableNonFolderIndent: l = !0,
358
- isTableExpandable: p,
359
+ isRowExpanded: o,
360
+ enableNonFolderIndent: s = !0,
361
+ isTableExpandable: d,
359
362
  onExpandClick: n
360
- }) => t ? /* @__PURE__ */ u(
361
- at,
363
+ }) => t ? /* @__PURE__ */ p(
364
+ ht,
362
365
  {
363
366
  onClick: (g) => {
364
367
  g.stopPropagation(), n?.(g);
365
368
  },
366
- icon: i ? "expand_more" : "chevron_right",
369
+ icon: o ? "expand_more" : "chevron_right",
367
370
  className: "expander",
368
371
  style: { cursor: "pointer" }
369
372
  }
370
- ) : p && l && /* @__PURE__ */ u("div", { style: { display: "inline-block", minWidth: 24 } }), ct = qe(
373
+ ) : d && s && /* @__PURE__ */ p("div", { style: { display: "inline-block", minWidth: 24 } }), wt = _e(
371
374
  ({
372
375
  value: t,
373
- icon: i,
374
- parents: l,
375
- iconColor: p,
376
+ icon: o,
377
+ parents: s,
378
+ iconColor: d,
376
379
  iconFilled: n,
377
380
  img: g,
378
- imgShape: b = "square",
379
- imgRatio: h,
380
- imgPosition: N = "start",
381
- isRowExpandable: Y,
382
- isRowExpanded: q,
383
- isTableExpandable: G,
384
- enableNonFolderIndent: X = !0,
385
- onExpandClick: H,
386
- startContent: R,
387
- endContent: V,
388
- badge: k,
389
- actions: D,
390
- isRenaming: F,
391
- renameInitialValue: z,
381
+ imgShape: x = "square",
382
+ imgRatio: c,
383
+ imgPosition: b = "start",
384
+ isRowExpandable: C,
385
+ isRowExpanded: K,
386
+ isTableExpandable: z,
387
+ enableNonFolderIndent: G = !0,
388
+ onExpandClick: O,
389
+ startContent: k,
390
+ endContent: _,
391
+ badge: F,
392
+ actions: A,
393
+ isRenaming: D,
394
+ renameInitialValue: I,
392
395
  onSubmitRename: Z,
393
- onCancelRename: B,
396
+ onCancelRename: Q,
394
397
  renamePlaceholder: ee,
395
- depth: O = 0,
396
- isDisabled: K,
397
- disabledMessage: re,
398
- active: te,
399
- inactive: ne,
400
- style: T,
398
+ depth: U = 0,
399
+ isDisabled: J,
400
+ disabledMessage: j,
401
+ active: de,
402
+ inactive: $,
403
+ style: W,
401
404
  pt: y,
402
- ..._
403
- }, ae) => {
404
- const [Q, J] = He(z ?? t);
405
+ ...te
406
+ }, ne) => {
407
+ const [oe, X] = Ce(I ?? t);
405
408
  ce(() => {
406
- F && J(z ?? t);
407
- }, [t, F, z]);
408
- const A = g ? /* @__PURE__ */ u(
409
+ D && X(I ?? t);
410
+ }, [t, D, I]);
411
+ const Y = g ? /* @__PURE__ */ p(
409
412
  "img",
410
413
  {
411
414
  src: g,
412
415
  ...y?.img,
413
416
  alt: "",
414
- className: M("image", b, `img-${N}`, y?.img?.className),
417
+ className: T("image", x, `img-${b}`, y?.img?.className),
415
418
  style: {
416
- aspectRatio: (h ?? 1).toString(),
419
+ aspectRatio: (c ?? 1).toString(),
417
420
  ...y?.img?.style
418
421
  }
419
422
  }
420
423
  ) : (
421
424
  // keep the slot so rows don't shift when a thumbnail is missing
422
- h !== void 0 && /* @__PURE__ */ u(
425
+ c !== void 0 && /* @__PURE__ */ p(
423
426
  "div",
424
427
  {
425
- className: M("image", b, `img-${N}`, y?.img?.className),
428
+ className: T("image", x, `img-${b}`, y?.img?.className),
426
429
  style: {
427
- aspectRatio: h.toString(),
430
+ aspectRatio: c.toString(),
428
431
  ...y?.img?.style
429
432
  }
430
433
  }
431
434
  )
432
435
  );
433
- return /* @__PURE__ */ W(
434
- rt,
436
+ return /* @__PURE__ */ B(
437
+ ft,
435
438
  {
436
- ..._,
437
- ref: ae,
438
- className: M(_.className, {
439
- disabled: K,
440
- inactive: ne || te === !1,
441
- "has-actions": !!D?.length
439
+ ...te,
440
+ ref: ne,
441
+ className: T(te.className, {
442
+ disabled: J,
443
+ inactive: $ || de === !1,
444
+ "has-actions": !!A?.length
442
445
  }),
443
446
  style: {
444
- ...T,
445
- paddingLeft: `calc(${O * 1.5}rem + 4px)`
447
+ ...W,
448
+ paddingLeft: `calc(${U * 1.5}rem + 4px)`
446
449
  },
447
- title: K ? re : void 0,
450
+ title: J ? j : void 0,
448
451
  children: [
449
- /* @__PURE__ */ u(
450
- st,
452
+ /* @__PURE__ */ p(
453
+ bt,
451
454
  {
452
- isRowExpandable: Y,
453
- isRowExpanded: q,
454
- isTableExpandable: G,
455
- onExpandClick: H,
456
- enableNonFolderIndent: X,
455
+ isRowExpandable: C,
456
+ isRowExpanded: K,
457
+ isTableExpandable: z,
458
+ onExpandClick: O,
459
+ enableNonFolderIndent: G,
457
460
  ...y?.expander
458
461
  }
459
462
  ),
460
- N === "start" && A,
461
- R,
462
- i && /* @__PURE__ */ u(
463
- xe,
463
+ b === "start" && Y,
464
+ k,
465
+ o && /* @__PURE__ */ p(
466
+ ve,
464
467
  {
465
- icon: i,
466
- className: M({ filled: n }, y?.icon?.className),
468
+ icon: o,
469
+ className: T({ filled: n }, y?.icon?.className),
467
470
  style: {
468
- color: p,
471
+ color: d,
469
472
  ...y?.icon?.style
470
473
  },
471
474
  ...y?.icon
472
475
  }
473
476
  ),
474
- F ? /* @__PURE__ */ u(
475
- Be,
477
+ D ? /* @__PURE__ */ p(
478
+ Ue,
476
479
  {
477
480
  autoFocus: !0,
478
481
  style: { flex: 1 },
479
- onChange: (f) => J(f.target.value),
480
- value: Q,
482
+ onChange: (v) => X(v.target.value),
483
+ value: oe,
481
484
  placeholder: ee,
482
- onKeyDown: (f) => {
483
- f.key === "Enter" && Z?.(Q), f.key === "Escape" && B?.();
485
+ onKeyDown: (v) => {
486
+ v.key === "Enter" && Z?.(oe), v.key === "Escape" && Q?.();
484
487
  },
485
488
  onBlur: () => {
486
- B?.();
489
+ Q?.();
487
490
  },
488
- onFocus: (f) => {
489
- f.target.select();
491
+ onFocus: (v) => {
492
+ v.target.select();
490
493
  },
491
494
  ...y?.input
492
495
  }
493
- ) : /* @__PURE__ */ W("div", { className: "text", ...y?.text, children: [
494
- l && O === 0 && /* @__PURE__ */ W("span", { className: "path", children: [
495
- l.join(" / "),
496
+ ) : /* @__PURE__ */ B("div", { className: "text", ...y?.text, children: [
497
+ s && U === 0 && /* @__PURE__ */ B("span", { className: "path", children: [
498
+ s.join(" / "),
496
499
  " / "
497
500
  ] }),
498
- /* @__PURE__ */ u("span", { className: "value", children: t })
501
+ /* @__PURE__ */ p("span", { className: "value", children: t })
499
502
  ] }),
500
- !F && /* @__PURE__ */ W(Le, { children: [
501
- /* @__PURE__ */ u(Oe, { className: "spacer" }),
502
- k?.toString() && /* @__PURE__ */ u("div", { className: "badges", children: typeof k == "string" ? /* @__PURE__ */ u("span", { children: k }) : k }),
503
- D && /* @__PURE__ */ u("div", { className: "actions", children: D.map((f, S) => {
504
- const { show: $ = "hover", ...E } = f;
505
- return $ === "hidden" ? null : /* @__PURE__ */ u(
506
- xe,
503
+ !D && /* @__PURE__ */ B(Re, { children: [
504
+ /* @__PURE__ */ p(Je, { className: "spacer" }),
505
+ F?.toString() && /* @__PURE__ */ p("div", { className: "badges", children: typeof F == "string" ? /* @__PURE__ */ p("span", { children: F }) : F }),
506
+ A && /* @__PURE__ */ p("div", { className: "actions", children: A.map((v, M) => {
507
+ const { show: E = "hover", ...N } = v;
508
+ return E === "hidden" ? null : /* @__PURE__ */ p(
509
+ ve,
507
510
  {
508
- ...E,
509
- className: M(E.className, { "show-always": $ === "always" })
511
+ ...N,
512
+ className: T(N.className, { "show-always": E === "always" })
510
513
  },
511
- E.icon + S.toString()
514
+ N.icon + M.toString()
512
515
  );
513
516
  }) })
514
517
  ] }),
515
- N === "end" && A,
516
- V && V
518
+ b === "end" && Y,
519
+ _ && _
517
520
  ]
518
521
  }
519
522
  );
520
523
  }
521
- ), dt = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : [t] : [], Re = (t, i) => {
522
- t.toggleExpanded(i), t.subRows.forEach((l) => Re(l, i));
523
- }, Se = (t, i, l, p) => {
524
- const n = t.getValue(i);
524
+ ), vt = ({
525
+ contribution: t,
526
+ error: o,
527
+ onReported: s
528
+ }) => (ce(() => {
529
+ ut(t, o), s();
530
+ }, [t, o, s]), null), St = ({ contribution: t, context: o }) => {
531
+ const s = t;
532
+ return /* @__PURE__ */ p(
533
+ We,
534
+ {
535
+ isOpen: !0,
536
+ header: String(s.dialogTitle || s.label || s.id),
537
+ size: s.dialogSize || "md",
538
+ onClose: o.close,
539
+ children: /* @__PURE__ */ p(
540
+ lt,
541
+ {
542
+ contribution: t,
543
+ piece: "dialog",
544
+ context: o,
545
+ error: (d) => /* @__PURE__ */ p(vt, { contribution: s, error: d, onReported: o.close })
546
+ }
547
+ )
548
+ }
549
+ );
550
+ }, Rt = (t) => {
551
+ const { contributions: o } = ct("table.shortcut"), [s, d] = Ce(null), n = le(
552
+ () => t ? o.flatMap((c) => {
553
+ const b = pt(c.keys), C = !c.tables?.length || c.tables.includes(t);
554
+ return b && C ? [{ contribution: c, shortcut: b }] : [];
555
+ }) : [],
556
+ [o, t]
557
+ ), g = w(
558
+ (c, b) => {
559
+ c.dialog ? d({ contribution: c, context: { ...b, close: () => d(null) } }) : dt(c, b);
560
+ },
561
+ []
562
+ ), x = w(
563
+ (c, b) => {
564
+ if (!t || c.repeat) return !1;
565
+ const C = n.find(({ shortcut: z }) => gt(c, z));
566
+ if (!C) return !1;
567
+ const K = b();
568
+ return K?.rows.length ? (c.preventDefault(), c.stopPropagation(), g(C.contribution, { ...K, table: t }), !0) : !1;
569
+ },
570
+ [n, t, g]
571
+ );
572
+ return { hasShortcuts: n.length > 0, handleShortcut: x, runShortcut: g, dialog: s };
573
+ }, Ct = (t) => t ? Array.isArray(t) ? t.filter(Boolean) : [t] : [], Ke = (t, o) => {
574
+ t.toggleExpanded(o), t.subRows.forEach((s) => Ke(s, o));
575
+ }, Me = (t, o, s, d) => {
576
+ const n = t.getValue(o);
525
577
  let g = typeof n == "string" ? n : Array.isArray(n) ? n.join(" ") : JSON.stringify(n);
526
- i === "label" && (g = [t.original.label, t.original.name, ...t.original.parents || []].join(
578
+ o === "label" && (g = [t.original.label, t.original.name, ...t.original.parents || []].join(
527
579
  " "
528
580
  ));
529
- const b = Ze(g, l);
530
- return p({ itemRank: b }), b.passed;
581
+ const x = rt(g, s);
582
+ return d({ itemRank: x }), x.passed;
531
583
  };
532
- Se.resolveFilterValue = et;
533
- const ut = (t, i, l) => {
534
- let p = 0;
535
- return t.columnFiltersMeta[l] && (p = Xe(
536
- t.columnFiltersMeta[l]?.itemRank,
537
- i.columnFiltersMeta[l]?.itemRank
538
- )), p === 0 ? Ye.alphanumeric(t, i, l) : p;
584
+ Me.resolveFilterValue = at;
585
+ const Et = (t, o, s) => {
586
+ let d = 0;
587
+ return t.columnFiltersMeta[s] && (d = ot(
588
+ t.columnFiltersMeta[s]?.itemRank,
589
+ o.columnFiltersMeta[s]?.itemRank
590
+ )), d === 0 ? tt.alphanumeric(t, o, s) : d;
539
591
  };
540
- function pt(t, i, l) {
541
- let p = -1, n = -1;
542
- for (let h = 0; h < t.length && (t[h].id === i && (p = h), t[h].id === l && (n = h), !(p !== -1 && n !== -1)); h++)
592
+ function kt(t, o, s) {
593
+ let d = -1, n = -1;
594
+ for (let c = 0; c < t.length && (t[c].id === o && (d = c), t[c].id === s && (n = c), !(d !== -1 && n !== -1)); c++)
543
595
  ;
544
- if (p === -1 || n === -1) return [];
545
- const g = Math.min(p, n), b = Math.max(p, n);
546
- return t.slice(g, b + 1);
596
+ if (d === -1 || n === -1) return [];
597
+ const g = Math.min(d, n), x = Math.max(d, n);
598
+ return t.slice(g, x + 1);
547
599
  }
548
- const $t = ({
600
+ const Zt = ({
549
601
  data: t = [],
550
- isLoading: i,
551
- error: l,
552
- isExpandable: p,
602
+ isLoading: o,
603
+ error: s,
604
+ isExpandable: d,
553
605
  isMultiSelect: n = !0,
554
606
  enableClickToDeselect: g = !0,
555
- enableNonFolderIndent: b = !0,
556
- forceUpdateTable: h,
557
- globalFilter: N,
558
- meta: Y,
559
- rowHeight: q,
560
- imgRatio: G,
561
- imgPosition: X,
562
- onScrollBottom: H,
563
- scrollToRowId: R,
564
- onRename: V,
565
- renamingId: k,
566
- renameInitialValue: D,
567
- onSubmitRename: F,
568
- onCancelRename: z,
607
+ enableNonFolderIndent: x = !0,
608
+ forceUpdateTable: c,
609
+ globalFilter: b,
610
+ meta: C,
611
+ rowHeight: K,
612
+ imgRatio: z,
613
+ imgPosition: G,
614
+ onScrollBottom: O,
615
+ scrollToRowId: k,
616
+ onRename: _,
617
+ renamingId: F,
618
+ renameInitialValue: A,
619
+ onSubmitRename: D,
620
+ onCancelRename: I,
569
621
  onRowDoubleClick: Z,
570
- onRowOptionClick: B,
622
+ onRowOptionClick: Q,
571
623
  rowContextMenuBuilders: ee = [],
572
- children: O,
573
- pt: K,
574
- fitContent: re,
575
- rowIdPrefix: te,
576
- ...ne
624
+ addonShortcuts: U,
625
+ children: J,
626
+ pt: j,
627
+ fitContent: de,
628
+ rowIdPrefix: $,
629
+ ...W
577
630
  }) => {
578
631
  const {
579
- rowSelection: T,
580
- expanded: y,
581
- setExpanded: _,
582
- onExpandedChange: ae,
583
- onRowSelectionChange: Q,
584
- rowPinning: J,
585
- onRowPinningChange: A
586
- } = lt(), f = v(null), S = v(null), $ = v(te);
587
- $.current = te;
588
- const E = (e) => $.current ? `${$.current}-${e}` : e, [de] = nt(), ue = v(Z);
589
- ue.current = Z;
590
- const ie = v(k);
591
- ie.current = k;
592
- const pe = v(D);
632
+ rowSelection: y,
633
+ expanded: te,
634
+ setExpanded: ne,
635
+ onExpandedChange: oe,
636
+ onRowSelectionChange: X,
637
+ rowPinning: Y,
638
+ onRowPinningChange: v
639
+ } = xt(), M = R(null), E = R(null), N = R($);
640
+ N.current = $;
641
+ const re = (e) => N.current ? `${N.current}-${e}` : e, [ge] = st(), me = R(Z);
642
+ me.current = Z;
643
+ const ue = R(F);
644
+ ue.current = F;
645
+ const fe = R(A);
646
+ fe.current = A;
647
+ const pe = R(D);
593
648
  pe.current = D;
594
- const le = v(F);
595
- le.current = F;
596
- const ge = v(z);
597
- ge.current = z;
598
- const me = v(V);
599
- me.current = V;
600
- const Ce = se(() => i ? Array.from({ length: 10 }, (e, r) => ({
601
- id: `placeholder-${r}`,
602
- name: `placeholder-${r}`,
603
- label: `placeholder-${r}`,
649
+ const he = R(I);
650
+ he.current = I;
651
+ const ye = R(_);
652
+ ye.current = _;
653
+ const Fe = le(() => o ? Array.from({ length: 10 }, (e, a) => ({
654
+ id: `placeholder-${a}`,
655
+ name: `placeholder-${a}`,
656
+ label: `placeholder-${a}`,
604
657
  icon: null,
605
658
  img: null,
606
659
  subRows: [],
607
660
  data: {
608
- id: `placeholder-${r}`
661
+ id: `placeholder-${a}`
609
662
  }
610
- })) : t, [i, t, h]), I = w(
611
- (e, r, a, d) => {
612
- const s = r, m = e.getRowModel(), o = m.rows, C = m.rowsById[s], x = e.getState().rowSelection || {};
613
- if (!C) return { ...x };
614
- if (C.original.isDisabled)
615
- return { ...x };
616
- if (g && !a && !d && Object.keys(x).length === 1 && x[s])
617
- return e.setRowSelection({}), f.current = null, {};
618
- let c;
619
- if (n && a && f.current) {
620
- const $e = f.current, ye = pt(o, s, $e);
621
- ye.length === 0 ? c = { ...x, [s]: !0 } : (c = { ...x }, ye.forEach((Ie) => c[Ie.id] = !0));
622
- } else n && d ? (c = { ...x }, c[s] ? delete c[s] : c[s] = !0) : (c = { ...x }, Object.keys(c).length === 1 && c[s] || (c = { [s]: !0 }));
623
- return e.setRowSelection(c), f.current = s, c;
663
+ })) : t, [o, t, c]), L = w(
664
+ (e, a, i, u) => {
665
+ const m = a, f = e.getRowModel(), r = f.rows, S = f.rowsById[m], h = e.getState().rowSelection || {};
666
+ if (!S) return { ...h };
667
+ if (S.original.isDisabled)
668
+ return { ...h };
669
+ if (g && !i && !u && Object.keys(h).length === 1 && h[m])
670
+ return e.setRowSelection({}), M.current = null, {};
671
+ let l;
672
+ if (n && i && M.current) {
673
+ const se = M.current, we = kt(r, m, se);
674
+ we.length === 0 ? l = { ...h, [m]: !0 } : (l = { ...h }, we.forEach((Be) => l[Be.id] = !0));
675
+ } else n && u ? (l = { ...h }, l[m] ? delete l[m] : l[m] = !0) : (l = { ...h }, Object.keys(l).length === 1 && l[m] || (l = { [m]: !0 }));
676
+ return e.setRowSelection(l), M.current = m, l;
624
677
  },
625
678
  [n, g]
626
- ), Ee = w(
627
- (e, r) => {
628
- if (!S.current) {
679
+ ), De = w(
680
+ (e, a) => {
681
+ if (!E.current) {
629
682
  console.warn("tableRef not yet available in handleRowSelectForKeydown");
630
683
  return;
631
684
  }
632
- const a = e.shiftKey, d = e.ctrlKey || e.metaKey;
633
- I(
634
- S.current,
685
+ const i = e.shiftKey, u = e.ctrlKey || e.metaKey;
686
+ L(
687
+ E.current,
635
688
  // Pass the main table instance
636
- r.id,
637
- a,
638
- d
689
+ a.id,
690
+ i,
691
+ u
639
692
  );
640
693
  },
641
- [I]
694
+ [L]
642
695
  // Depends only on handleSelectionLogic
643
- ), ke = w(
644
- (e, r, a) => {
645
- if (!S.current) return;
646
- const d = S.current.getRowModel().rows, s = d.findIndex((o) => o.id === r.id);
647
- if (s === -1) return;
648
- let m = e === "down" ? s + 1 : s - 1;
649
- if (!(m < 0 || m >= d.length))
650
- for (; m >= 0 && m < d.length; ) {
651
- const o = d[m];
652
- if (!o.original.isDisabled) {
653
- I(
654
- S.current,
655
- o.id,
656
- a.shiftKey,
657
- a.ctrlKey || a.metaKey
696
+ ), Ne = w(
697
+ (e, a, i) => {
698
+ if (!E.current) return;
699
+ const u = E.current.getRowModel().rows, m = u.findIndex((r) => r.id === a.id);
700
+ if (m === -1) return;
701
+ let f = e === "down" ? m + 1 : m - 1;
702
+ if (!(f < 0 || f >= u.length))
703
+ for (; f >= 0 && f < u.length; ) {
704
+ const r = u[f];
705
+ if (!r.original.isDisabled) {
706
+ L(
707
+ E.current,
708
+ r.id,
709
+ i.shiftKey,
710
+ i.ctrlKey || i.metaKey
658
711
  ), requestAnimationFrame(() => {
659
- const C = oe.current, c = (C ? C.querySelector(`#${CSS.escape(E(o.id))}`) : document.getElementById(E(o.id)))?.querySelector('[tabindex="0"]');
660
- c && (c.focus(), c.scrollIntoView({ block: "nearest", behavior: "smooth" }));
712
+ const S = ae.current, l = (S ? S.querySelector(`#${CSS.escape(re(r.id))}`) : document.getElementById(re(r.id)))?.querySelector('[tabindex="0"]');
713
+ l && (l.focus(), l.scrollIntoView({ block: "nearest", behavior: "smooth" }));
661
714
  });
662
715
  return;
663
716
  }
664
- m = e === "down" ? m + 1 : m - 1;
717
+ f = e === "down" ? f + 1 : f - 1;
665
718
  }
666
719
  },
667
- [I]
668
- ), Fe = w(
669
- (e, r) => {
670
- r.original.isDisabled || me.current?.(r.id, r);
720
+ [L]
721
+ ), Te = w(
722
+ (e, a) => {
723
+ a.original.isDisabled || ye.current?.(a.id, a);
671
724
  },
672
725
  []
673
726
  // eslint-disable-line react-hooks/exhaustive-deps
674
- ), { handleRowKeyDown: fe } = it({
675
- handleRowSelect: Ee,
676
- handleArrowNavigation: ke,
677
- handleRename: Fe
678
- }), Ke = se(
727
+ ), { handleRowKeyDown: xe } = yt({
728
+ handleRowSelect: De,
729
+ handleArrowNavigation: Ne,
730
+ handleRename: Te
731
+ }), ze = le(
679
732
  () => [
680
733
  {
681
734
  accessorKey: "label",
682
735
  header: void 0,
683
736
  filterFn: "fuzzy",
684
- sortingFn: ut,
737
+ sortingFn: Et,
685
738
  //sort by fuzzy rank (falls back to alphanumeric)
686
- cell: ({ row: e, getValue: r, table: a }) => {
687
- const d = a.options.meta, s = (o) => {
688
- 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"))
739
+ cell: ({ row: e, getValue: a, table: i }) => {
740
+ const u = i.options.meta, m = (r) => {
741
+ if (r.target instanceof HTMLInputElement || r.target instanceof HTMLButtonElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement || r.target instanceof HTMLAnchorElement || r.target.closest("button, a, input, textarea, select"))
689
742
  return;
690
- const x = o.altKey && e.getIsSelected() && !o.shiftKey && !o.ctrlKey && !o.metaKey ? a.getState().rowSelection || {} : I(
691
- a,
743
+ const h = r.altKey && e.getIsSelected() && !r.shiftKey && !r.ctrlKey && !r.metaKey ? i.getState().rowSelection || {} : L(
744
+ i,
692
745
  // Pass the cell's table instance
693
746
  e.id,
694
- o.shiftKey,
695
- o.ctrlKey || o.metaKey
747
+ r.shiftKey,
748
+ r.ctrlKey || r.metaKey
696
749
  );
697
- o.altKey && B?.(e.original, Object.keys(x));
698
- }, m = {
699
- className: M({
750
+ r.altKey && Q?.(e.original, Object.keys(h));
751
+ }, f = {
752
+ className: T({
700
753
  selected: e.getIsSelected(),
701
- loading: d?.isLoading,
754
+ loading: u?.isLoading,
702
755
  disabled: e.original.isDisabled,
703
756
  // you can't select disabled rows
704
757
  inactive: e.original.inactive
705
758
  // false: archived items but still selectable
706
759
  }),
707
- onKeyDown: (o) => {
708
- o.target instanceof HTMLInputElement || fe(o, e);
760
+ onKeyDown: (r) => {
761
+ r.target instanceof HTMLInputElement || xe(r, e);
709
762
  },
710
763
  depth: e.depth,
711
764
  tabIndex: 0,
712
- value: r(),
765
+ value: a(),
713
766
  parents: e.original.parents,
714
767
  icon: e.original.icon || void 0,
715
768
  iconColor: e.original.iconColor,
716
769
  iconFilled: e.original.iconFilled,
717
770
  img: e.original.img,
718
771
  imgShape: e.original.imgShape,
719
- imgRatio: G,
720
- imgPosition: X,
772
+ imgRatio: z,
773
+ imgPosition: G,
721
774
  isRowExpandable: e.getCanExpand(),
722
- enableNonFolderIndent: b,
775
+ enableNonFolderIndent: x,
723
776
  isRowExpanded: e.getIsExpanded(),
724
- isTableExpandable: d?.isExpandable,
725
- onExpandClick: (o) => {
726
- o?.altKey ? Re(e, !e.getIsExpanded()) : e.toggleExpanded();
777
+ isTableExpandable: u?.isExpandable,
778
+ onExpandClick: (r) => {
779
+ r?.altKey ? Ke(e, !e.getIsExpanded()) : e.toggleExpanded();
727
780
  },
728
781
  startContent: e.original.startContent,
729
782
  endContent: e.original.endContent,
730
783
  badge: e.original.badge,
731
784
  isDisabled: e.original.isDisabled,
732
785
  disabledMessage: e.original.disabledMessage,
733
- isRenaming: e.id === ie.current,
734
- renameInitialValue: e.id === ie.current ? pe.current : void 0,
735
- onSubmitRename: le.current ? (o) => le.current(e.id, o) : void 0,
736
- onCancelRename: ge.current,
737
- ...K?.cell,
738
- onClick: s,
786
+ isRenaming: e.id === ue.current,
787
+ renameInitialValue: e.id === ue.current ? fe.current : void 0,
788
+ onSubmitRename: pe.current ? (r) => pe.current(e.id, r) : void 0,
789
+ onCancelRename: he.current,
790
+ ...j?.cell,
791
+ onClick: m,
739
792
  // Added onClick handler
740
- onDoubleClick: (o) => ue.current?.(e.id, e)
793
+ onDoubleClick: (r) => me.current?.(e.id, e)
741
794
  };
742
- return d?.children ? d.children(m, e, a) : /* @__PURE__ */ u(ct, { ...m, ...K?.cell });
795
+ return u?.children ? u.children(f, e, i) : /* @__PURE__ */ p(wt, { ...f, ...j?.cell });
743
796
  }
744
797
  }
745
798
  ],
746
799
  [
747
- h,
748
- I,
749
- fe,
800
+ c,
801
+ L,
802
+ xe,
750
803
  g,
751
- b,
804
+ x,
805
+ z,
752
806
  G,
753
- X,
754
- B
807
+ Q
755
808
  ]
756
- ), Me = w(
809
+ ), Ae = w(
757
810
  (e) => {
758
- Q(be(e, T));
811
+ X(Se(e, y));
759
812
  },
760
- [Q]
761
- ), Ne = w(
813
+ [X]
814
+ ), Ie = w(
762
815
  (e) => {
763
- A?.(be(e, J || {}));
816
+ v?.(Se(e, Y || {}));
764
817
  },
765
- [A]
766
- ), De = w(
818
+ [v]
819
+ ), je = w(
767
820
  (e) => {
768
- _?.((r) => {
769
- const a = e instanceof Function ? e(r) : e;
770
- return ae?.(a), a;
821
+ ne?.((a) => {
822
+ const i = e instanceof Function ? e(a) : e;
823
+ return oe?.(i), i;
771
824
  });
772
825
  },
773
- [_]
774
- ), U = _e({
775
- data: Ce,
776
- columns: Ke,
826
+ [ne]
827
+ ), P = Xe({
828
+ data: Fe,
829
+ columns: ze,
777
830
  state: {
778
- expanded: y,
779
- rowSelection: T,
780
- globalFilter: N,
781
- rowPinning: J
831
+ expanded: te,
832
+ rowSelection: y,
833
+ globalFilter: b,
834
+ rowPinning: Y
782
835
  },
783
- onRowSelectionChange: Me,
784
- onRowPinningChange: Ne,
836
+ onRowSelectionChange: Ae,
837
+ onRowPinningChange: Ie,
785
838
  filterFns: {
786
- fuzzy: Se
839
+ fuzzy: Me
787
840
  },
788
841
  globalFilterFn: "fuzzy",
789
842
  enableRowSelection: !0,
790
843
  //enable row selection for all rows
791
- enableRowPinning: !!A,
844
+ enableRowPinning: !!v,
792
845
  getRowId: (e) => e.id,
793
846
  enableSubRowSelection: !1,
794
847
  //disable sub row selection
795
- onExpandedChange: De,
848
+ onExpandedChange: je,
796
849
  getSubRows: (e) => e.subRows,
797
- getCoreRowModel: Ue(),
798
- getFilteredRowModel: Je(),
799
- getExpandedRowModel: Qe(),
850
+ getCoreRowModel: Ze(),
851
+ getFilteredRowModel: Ge(),
852
+ getExpandedRowModel: Ye(),
800
853
  filterFromLeafRows: !0,
801
854
  // debugTable: true,
802
855
  // @ts-expect-error: updateData is not required
803
- meta: se(
856
+ meta: le(
804
857
  () => ({
805
- isExpandable: !!p,
806
- isLoading: i,
807
- children: O,
808
- ...Y
858
+ isExpandable: !!d,
859
+ isLoading: o,
860
+ children: J,
861
+ ...C
809
862
  }),
810
- [p, i, O, Y]
863
+ [d, o, J, C]
811
864
  )
812
865
  });
813
866
  ce(() => {
814
- S.current = U;
815
- }, [U]);
816
- const { rows: L } = U.getRowModel(), ze = w(
817
- (e, r, a) => {
818
- if (!S.current) return;
819
- const d = L[r];
820
- if (!d || d.original === void 0) return;
821
- a.preventDefault(), a.stopPropagation();
822
- const s = Object.keys(T), m = s.includes(e), o = m ? s : [e], C = ee.flatMap(
823
- (x) => dt(
824
- x(a, {
867
+ E.current = P;
868
+ }, [P]);
869
+ const { rows: V } = P.getRowModel(), $e = w(
870
+ (e, a, i) => {
871
+ if (!E.current) return;
872
+ const u = V[a];
873
+ if (!u || u.original === void 0) return;
874
+ i.preventDefault(), i.stopPropagation();
875
+ const m = Object.keys(y), f = m.includes(e), r = f ? m : [e], S = ee.flatMap(
876
+ (h) => Ct(
877
+ h(i, {
825
878
  rowId: e,
826
- rowIndex: r,
827
- row: d,
828
- selectedRows: o,
829
- selectedTableRows: o.map((c) => U.getRowModel().rowsById[c]).filter((c) => !!c),
830
- isSelected: m
879
+ rowIndex: a,
880
+ row: u,
881
+ selectedRows: r,
882
+ selectedTableRows: r.map((l) => P.getRowModel().rowsById[l]).filter((l) => !!l),
883
+ isSelected: f
831
884
  })
832
885
  )
833
886
  );
834
- C.length > 0 && de(a, C);
887
+ S.length > 0 && ge(i, S);
835
888
  },
836
- [ee, L, T, de]
837
- ), oe = v(null), j = Ge({
838
- count: L.length,
839
- estimateSize: () => q || 34,
889
+ [ee, V, y, ge]
890
+ ), ae = R(null), q = nt({
891
+ count: V.length,
892
+ estimateSize: () => K || 34,
840
893
  //estimate row height for accurate scrollbar dragging
841
- getScrollElement: () => oe.current,
894
+ getScrollElement: () => ae.current,
842
895
  //measure dynamic row height, except in firefox because it measures table border height incorrectly
843
- measureElement: q ? () => q : typeof window < "u" && navigator.userAgent.indexOf("Firefox") === -1 ? (e) => e?.getBoundingClientRect().height : void 0,
896
+ measureElement: K ? () => K : typeof window < "u" && navigator.userAgent.indexOf("Firefox") === -1 ? (e) => e?.getBoundingClientRect().height : void 0,
844
897
  overscan: 5
845
- }), he = v(void 0);
898
+ }), be = R(void 0);
846
899
  ce(() => {
847
- if (!R || he.current === R) return;
848
- const e = L.findIndex((r) => r.id === R);
849
- e < 0 || (he.current = R, f.current = R, j.scrollToIndex(e, { align: "center" }), requestAnimationFrame(
900
+ if (!k || be.current === k) return;
901
+ const e = V.findIndex((a) => a.id === k);
902
+ e < 0 || (be.current = k, M.current = k, q.scrollToIndex(e, { align: "center" }), requestAnimationFrame(
850
903
  () => requestAnimationFrame(() => {
851
- oe.current?.querySelector(
852
- `#${CSS.escape(E(R))}`
904
+ ae.current?.querySelector(
905
+ `#${CSS.escape(re(k))}`
853
906
  )?.querySelector('[tabindex="0"]')?.focus({ preventScroll: !0 });
854
907
  })
855
908
  ));
856
- }, [R, L, j]);
857
- const Te = w(
909
+ }, [k, V, q]);
910
+ const Le = w(
858
911
  (e) => {
859
- e && j.measureElement(e);
912
+ e && q.measureElement(e);
860
913
  },
861
- [j]
862
- ), Ae = w(
914
+ [q]
915
+ ), Pe = w(
863
916
  (e) => {
864
- if (!H) return;
865
- const r = e.currentTarget, { scrollTop: a, scrollHeight: d, clientHeight: s } = r;
866
- d - a - s < 100 && !i && H();
917
+ if (!O) return;
918
+ const a = e.currentTarget, { scrollTop: i, scrollHeight: u, clientHeight: m } = a;
919
+ u - i - m < 100 && !o && O();
867
920
  },
868
- [H, i]
869
- );
870
- return /* @__PURE__ */ W(
871
- ot,
872
- {
873
- ref: oe,
874
- onScroll: Ae,
875
- onClick: (e) => {
876
- g && !e.target.closest("tr") && (U.setRowSelection({}), f.current = null);
877
- },
878
- ...ne,
879
- className: M(ne.className, { isLoading: i, fitContent: re }),
880
- children: [
881
- !l && /* @__PURE__ */ u("table", { children: /* @__PURE__ */ u(
882
- "tbody",
883
- {
884
- style: {
885
- height: `${j?.getTotalSize()}px`
886
- //tells scrollbar how big the table is
887
- },
888
- children: j?.getVirtualItems().map((e) => {
889
- const r = L[e.index];
890
- return /* @__PURE__ */ u(
891
- "tr",
892
- {
893
- "data-index": e.index,
894
- ref: Te,
895
- id: E(r.id),
896
- onContextMenu: (a) => ze(r.id, e.index, a),
897
- ...K?.row,
898
- style: {
899
- transform: `translateY(${e.start}px)`,
900
- //this should always be a `style` as it changes on scroll
901
- ...K?.row?.style
902
- // custom styles to be passed
921
+ [O, o]
922
+ ), {
923
+ hasShortcuts: Ve,
924
+ handleShortcut: qe,
925
+ dialog: ie
926
+ } = Rt(U?.table);
927
+ return /* @__PURE__ */ B(Re, { children: [
928
+ /* @__PURE__ */ B(
929
+ mt,
930
+ {
931
+ ref: ae,
932
+ onScroll: Pe,
933
+ onClick: (e) => {
934
+ g && !e.target.closest("tr") && (P.setRowSelection({}), M.current = null);
935
+ },
936
+ ...W,
937
+ onKeyDown: (e) => {
938
+ W.onKeyDown?.(e);
939
+ const a = e.target;
940
+ if (!Ve || ie || e.defaultPrevented || ["INPUT", "TEXTAREA"].includes(a.tagName) || a.isContentEditable) return;
941
+ const i = a.closest("tr")?.id;
942
+ if (!i) return;
943
+ const u = $ ? i.slice($.length + 1) : i;
944
+ qe(e, () => {
945
+ const { rowsById: m } = P.getRowModel(), f = (h) => {
946
+ const l = m[h]?.original;
947
+ if (!l) return;
948
+ const { entityType: se } = l.data;
949
+ return {
950
+ id: l.id,
951
+ entityType: typeof se == "string" ? se : void 0,
952
+ name: l.name,
953
+ label: l.label,
954
+ data: l.data
955
+ };
956
+ }, r = Object.keys(y).filter((h) => y[h]), S = r.includes(u) ? r : [u];
957
+ return {
958
+ projectName: U?.projectName ?? null,
959
+ rows: S.flatMap((h) => f(h) || []),
960
+ focused: { rowId: u },
961
+ cells: []
962
+ };
963
+ });
964
+ },
965
+ className: T(W.className, { isLoading: o, fitContent: de }),
966
+ children: [
967
+ !s && /* @__PURE__ */ p("table", { children: /* @__PURE__ */ p(
968
+ "tbody",
969
+ {
970
+ style: {
971
+ height: `${q?.getTotalSize()}px`
972
+ //tells scrollbar how big the table is
973
+ },
974
+ children: q?.getVirtualItems().map((e) => {
975
+ const a = V[e.index];
976
+ return /* @__PURE__ */ p(
977
+ "tr",
978
+ {
979
+ "data-index": e.index,
980
+ ref: Le,
981
+ id: re(a.id),
982
+ onContextMenu: (i) => $e(a.id, e.index, i),
983
+ ...j?.row,
984
+ style: {
985
+ transform: `translateY(${e.start}px)`,
986
+ //this should always be a `style` as it changes on scroll
987
+ ...j?.row?.style
988
+ // custom styles to be passed
989
+ },
990
+ children: a.getVisibleCells().map((i) => /* @__PURE__ */ p("td", { children: et(i.column.columnDef.cell, i.getContext()) }, i.id))
903
991
  },
904
- children: r.getVisibleCells().map((a) => /* @__PURE__ */ u("td", { children: We(a.column.columnDef.cell, a.getContext()) }, a.id))
905
- },
906
- r.id
907
- );
908
- })
909
- }
910
- ) }),
911
- !!l && /* @__PURE__ */ u(tt, { error: l })
912
- ]
913
- }
914
- );
992
+ a.id
993
+ );
994
+ })
995
+ }
996
+ ) }),
997
+ !!s && /* @__PURE__ */ p(it, { error: s })
998
+ ]
999
+ }
1000
+ ),
1001
+ ie && /* @__PURE__ */ p(St, { contribution: ie.contribution, context: ie.context })
1002
+ ] });
915
1003
  };
916
1004
  export {
917
- rt as C,
918
- at as E,
919
- zt as H,
920
- st as R,
921
- $t as S,
922
- ot as T,
923
- Dt as a,
924
- Tt as b,
925
- ct as c,
926
- we as d,
927
- At as e,
928
- lt as u
1005
+ St as A,
1006
+ ft as C,
1007
+ ht as E,
1008
+ Xt as H,
1009
+ bt as R,
1010
+ Zt as S,
1011
+ mt as T,
1012
+ Wt as a,
1013
+ Yt as b,
1014
+ wt as c,
1015
+ ke as d,
1016
+ Gt as e,
1017
+ Rt as f,
1018
+ xt as u
929
1019
  };