@ynput/ayon-frontend-shared 0.7.2 → 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.
- package/LICENSE +105 -0
- package/dist/DetailsPanel.es.js +1088 -969
- package/dist/ListTable.es.js +70 -67
- package/dist/NewEntity.es.js +8 -5
- package/dist/ProjectTreeTable.es.js +4134 -3825
- package/dist/ProjectsTable.es.js +526 -0
- package/dist/Slicer.es.js +75 -73
- package/dist/Views.es.js +86 -84
- package/dist/chunks/Actions.es.js +4 -2
- package/dist/chunks/ColumnDropIndicator.es.js +21 -18
- package/dist/chunks/ColumnDropIndicator.styled.es.js +14 -13
- package/dist/chunks/ColumnHeaderMenuUI.es.js +9 -7
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +12 -11
- package/dist/chunks/EmptyPlaceholder.es.js +9 -8
- package/dist/chunks/EntityPath.es.js +15 -14
- package/dist/chunks/EntityPickerDialog.es.js +5 -3
- package/dist/chunks/EntityTooltip.es.js +10 -8
- package/dist/chunks/EntityUpdatesContext.es.js +13 -12
- package/dist/chunks/Feed.es.js +12 -11
- package/dist/chunks/FilterErrorActions.es.js +6 -4
- package/dist/chunks/GroupSettingsFallback.es.js +75 -0
- package/dist/chunks/JsonViewer.es.js +3 -2
- package/dist/chunks/Menu.es.js +105 -103
- package/dist/chunks/MetaWidget.es.js +278 -275
- package/dist/chunks/PlayableIcon.es.js +868 -862
- package/dist/chunks/ProjectContext.es.js +5 -4
- package/dist/chunks/RepresentationsList.es.js +3 -2
- package/dist/chunks/ReviewablesSelector.es.js +3471 -2067
- package/dist/chunks/SimpleTable.es.js +492 -402
- package/dist/chunks/Slicer.es.js +936 -896
- package/dist/chunks/TableExportContextInstance.es.js +437 -339
- package/dist/chunks/TableSettingsFallback.es.js +5 -3
- package/dist/chunks/ThumbnailSimple.es.js +15 -13
- package/dist/chunks/VideoPlayer.es.js +14 -12
- package/dist/chunks/Watchers.es.js +97 -95
- package/dist/chunks/getProjectDisplayName.es.js +4 -0
- package/dist/chunks/getUris.es.js +375 -374
- package/dist/chunks/useHierarchySelection.es.js +5 -3
- package/dist/chunks/useLoadModule.es.js +10 -8
- package/dist/chunks/viewUpdateHelper.es.js +12 -10
- package/dist/components.es.js +1488 -1186
- package/dist/context.es.js +589 -539
- package/dist/hooks.es.js +169 -212
- package/dist/index.es.js +17 -12
- package/dist/types/Actions.d.ts +17 -14
- package/dist/types/ContextMenu.d.ts +17 -14
- package/dist/types/DetailsPanel.d.ts +17 -14
- package/dist/types/EntityPickerDialog.d.ts +17 -14
- package/dist/types/Feed.d.ts +17 -14
- package/dist/types/ListTable.d.ts +17 -14
- package/dist/types/NewEntity.d.ts +17 -14
- package/dist/types/ProjectTreeTable.d.ts +749 -15
- package/dist/types/ProjectsTable.d.ts +228 -0
- package/dist/types/RepresentationsList.d.ts +17 -14
- package/dist/types/SimpleTable.d.ts +31 -14
- package/dist/types/Slicer.d.ts +18 -14
- package/dist/types/Views.d.ts +17 -14
- package/dist/types/api.d.ts +17 -14
- package/dist/types/components.d.ts +822 -25
- package/dist/types/context.d.ts +53 -15
- package/dist/types/hooks.d.ts +17 -14
- package/dist/types/index.d.ts +17 -14
- package/dist/types/util.d.ts +21 -14
- package/dist/util.es.js +152 -144
- package/package.json +16 -9
- /package/dist/{ContextMenuContextInstance.css → style.css} +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useCallback as w, createContext as
|
|
3
|
-
import { theme as
|
|
4
|
-
import
|
|
5
|
-
import { functionalUpdate as
|
|
6
|
-
import { useVirtualizer as
|
|
7
|
-
import
|
|
8
|
-
import { compareItems as
|
|
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
|
|
14
|
-
import
|
|
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
|
|
18
|
-
|
|
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
|
-
${
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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
|
|
334
|
+
function yt({
|
|
332
335
|
handleRowSelect: t,
|
|
333
|
-
handleArrowNavigation:
|
|
334
|
-
handleRename:
|
|
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
|
|
343
|
-
|
|
344
|
-
} else n.key.toLowerCase() === "r" && !n.ctrlKey && !n.metaKey && (n.preventDefault(), n.stopPropagation(),
|
|
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,
|
|
349
|
+
[t, o, s]
|
|
347
350
|
) };
|
|
348
351
|
}
|
|
349
|
-
const
|
|
350
|
-
const t =
|
|
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
|
-
},
|
|
357
|
+
}, Gt = ({ children: t, ...o }) => /* @__PURE__ */ p(ke.Provider, { value: { ...o }, children: t }), bt = ({
|
|
355
358
|
isRowExpandable: t,
|
|
356
|
-
isRowExpanded:
|
|
357
|
-
enableNonFolderIndent:
|
|
358
|
-
isTableExpandable:
|
|
359
|
+
isRowExpanded: o,
|
|
360
|
+
enableNonFolderIndent: s = !0,
|
|
361
|
+
isTableExpandable: d,
|
|
359
362
|
onExpandClick: n
|
|
360
|
-
}) => t ? /* @__PURE__ */
|
|
361
|
-
|
|
363
|
+
}) => t ? /* @__PURE__ */ p(
|
|
364
|
+
ht,
|
|
362
365
|
{
|
|
363
366
|
onClick: (g) => {
|
|
364
367
|
g.stopPropagation(), n?.(g);
|
|
365
368
|
},
|
|
366
|
-
icon:
|
|
369
|
+
icon: o ? "expand_more" : "chevron_right",
|
|
367
370
|
className: "expander",
|
|
368
371
|
style: { cursor: "pointer" }
|
|
369
372
|
}
|
|
370
|
-
) :
|
|
373
|
+
) : d && s && /* @__PURE__ */ p("div", { style: { display: "inline-block", minWidth: 24 } }), wt = _e(
|
|
371
374
|
({
|
|
372
375
|
value: t,
|
|
373
|
-
icon:
|
|
374
|
-
parents:
|
|
375
|
-
iconColor:
|
|
376
|
+
icon: o,
|
|
377
|
+
parents: s,
|
|
378
|
+
iconColor: d,
|
|
376
379
|
iconFilled: n,
|
|
377
380
|
img: g,
|
|
378
|
-
imgShape:
|
|
379
|
-
imgRatio:
|
|
380
|
-
imgPosition:
|
|
381
|
-
isRowExpandable:
|
|
382
|
-
isRowExpanded:
|
|
383
|
-
isTableExpandable:
|
|
384
|
-
enableNonFolderIndent:
|
|
385
|
-
onExpandClick:
|
|
386
|
-
startContent:
|
|
387
|
-
endContent:
|
|
388
|
-
badge:
|
|
389
|
-
actions:
|
|
390
|
-
isRenaming:
|
|
391
|
-
renameInitialValue:
|
|
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:
|
|
396
|
+
onCancelRename: Q,
|
|
394
397
|
renamePlaceholder: ee,
|
|
395
|
-
depth:
|
|
396
|
-
isDisabled:
|
|
397
|
-
disabledMessage:
|
|
398
|
-
active:
|
|
399
|
-
inactive:
|
|
400
|
-
style:
|
|
398
|
+
depth: U = 0,
|
|
399
|
+
isDisabled: J,
|
|
400
|
+
disabledMessage: j,
|
|
401
|
+
active: de,
|
|
402
|
+
inactive: $,
|
|
403
|
+
style: W,
|
|
401
404
|
pt: y,
|
|
402
|
-
...
|
|
403
|
-
},
|
|
404
|
-
const [
|
|
405
|
+
...te
|
|
406
|
+
}, ne) => {
|
|
407
|
+
const [oe, X] = Ce(I ?? t);
|
|
405
408
|
ce(() => {
|
|
406
|
-
|
|
407
|
-
}, [t,
|
|
408
|
-
const
|
|
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:
|
|
417
|
+
className: T("image", x, `img-${b}`, y?.img?.className),
|
|
415
418
|
style: {
|
|
416
|
-
aspectRatio: (
|
|
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
|
-
|
|
425
|
+
c !== void 0 && /* @__PURE__ */ p(
|
|
423
426
|
"div",
|
|
424
427
|
{
|
|
425
|
-
className:
|
|
428
|
+
className: T("image", x, `img-${b}`, y?.img?.className),
|
|
426
429
|
style: {
|
|
427
|
-
aspectRatio:
|
|
430
|
+
aspectRatio: c.toString(),
|
|
428
431
|
...y?.img?.style
|
|
429
432
|
}
|
|
430
433
|
}
|
|
431
434
|
)
|
|
432
435
|
);
|
|
433
|
-
return /* @__PURE__ */
|
|
434
|
-
|
|
436
|
+
return /* @__PURE__ */ B(
|
|
437
|
+
ft,
|
|
435
438
|
{
|
|
436
|
-
...
|
|
437
|
-
ref:
|
|
438
|
-
className:
|
|
439
|
-
disabled:
|
|
440
|
-
inactive:
|
|
441
|
-
"has-actions": !!
|
|
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
|
-
...
|
|
445
|
-
paddingLeft: `calc(${
|
|
447
|
+
...W,
|
|
448
|
+
paddingLeft: `calc(${U * 1.5}rem + 4px)`
|
|
446
449
|
},
|
|
447
|
-
title:
|
|
450
|
+
title: J ? j : void 0,
|
|
448
451
|
children: [
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
|
|
452
|
+
/* @__PURE__ */ p(
|
|
453
|
+
bt,
|
|
451
454
|
{
|
|
452
|
-
isRowExpandable:
|
|
453
|
-
isRowExpanded:
|
|
454
|
-
isTableExpandable:
|
|
455
|
-
onExpandClick:
|
|
456
|
-
enableNonFolderIndent:
|
|
455
|
+
isRowExpandable: C,
|
|
456
|
+
isRowExpanded: K,
|
|
457
|
+
isTableExpandable: z,
|
|
458
|
+
onExpandClick: O,
|
|
459
|
+
enableNonFolderIndent: G,
|
|
457
460
|
...y?.expander
|
|
458
461
|
}
|
|
459
462
|
),
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
463
|
+
b === "start" && Y,
|
|
464
|
+
k,
|
|
465
|
+
o && /* @__PURE__ */ p(
|
|
466
|
+
ve,
|
|
464
467
|
{
|
|
465
|
-
icon:
|
|
466
|
-
className:
|
|
468
|
+
icon: o,
|
|
469
|
+
className: T({ filled: n }, y?.icon?.className),
|
|
467
470
|
style: {
|
|
468
|
-
color:
|
|
471
|
+
color: d,
|
|
469
472
|
...y?.icon?.style
|
|
470
473
|
},
|
|
471
474
|
...y?.icon
|
|
472
475
|
}
|
|
473
476
|
),
|
|
474
|
-
|
|
475
|
-
|
|
477
|
+
D ? /* @__PURE__ */ p(
|
|
478
|
+
Ue,
|
|
476
479
|
{
|
|
477
480
|
autoFocus: !0,
|
|
478
481
|
style: { flex: 1 },
|
|
479
|
-
onChange: (
|
|
480
|
-
value:
|
|
482
|
+
onChange: (v) => X(v.target.value),
|
|
483
|
+
value: oe,
|
|
481
484
|
placeholder: ee,
|
|
482
|
-
onKeyDown: (
|
|
483
|
-
|
|
485
|
+
onKeyDown: (v) => {
|
|
486
|
+
v.key === "Enter" && Z?.(oe), v.key === "Escape" && Q?.();
|
|
484
487
|
},
|
|
485
488
|
onBlur: () => {
|
|
486
|
-
|
|
489
|
+
Q?.();
|
|
487
490
|
},
|
|
488
|
-
onFocus: (
|
|
489
|
-
|
|
491
|
+
onFocus: (v) => {
|
|
492
|
+
v.target.select();
|
|
490
493
|
},
|
|
491
494
|
...y?.input
|
|
492
495
|
}
|
|
493
|
-
) : /* @__PURE__ */
|
|
494
|
-
|
|
495
|
-
|
|
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__ */
|
|
501
|
+
/* @__PURE__ */ p("span", { className: "value", children: t })
|
|
499
502
|
] }),
|
|
500
|
-
!
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
const { show:
|
|
505
|
-
return
|
|
506
|
-
|
|
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
|
-
...
|
|
509
|
-
className:
|
|
511
|
+
...N,
|
|
512
|
+
className: T(N.className, { "show-always": E === "always" })
|
|
510
513
|
},
|
|
511
|
-
|
|
514
|
+
N.icon + M.toString()
|
|
512
515
|
);
|
|
513
516
|
}) })
|
|
514
517
|
] }),
|
|
515
|
-
|
|
516
|
-
|
|
518
|
+
b === "end" && Y,
|
|
519
|
+
_ && _
|
|
517
520
|
]
|
|
518
521
|
}
|
|
519
522
|
);
|
|
520
523
|
}
|
|
521
|
-
),
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
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
|
-
|
|
578
|
+
o === "label" && (g = [t.original.label, t.original.name, ...t.original.parents || []].join(
|
|
527
579
|
" "
|
|
528
580
|
));
|
|
529
|
-
const
|
|
530
|
-
return
|
|
581
|
+
const x = rt(g, s);
|
|
582
|
+
return d({ itemRank: x }), x.passed;
|
|
531
583
|
};
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
let
|
|
535
|
-
return t.columnFiltersMeta[
|
|
536
|
-
t.columnFiltersMeta[
|
|
537
|
-
|
|
538
|
-
)),
|
|
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
|
|
541
|
-
let
|
|
542
|
-
for (let
|
|
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 (
|
|
545
|
-
const g = Math.min(
|
|
546
|
-
return t.slice(g,
|
|
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
|
|
600
|
+
const Zt = ({
|
|
549
601
|
data: t = [],
|
|
550
|
-
isLoading:
|
|
551
|
-
error:
|
|
552
|
-
isExpandable:
|
|
602
|
+
isLoading: o,
|
|
603
|
+
error: s,
|
|
604
|
+
isExpandable: d,
|
|
553
605
|
isMultiSelect: n = !0,
|
|
554
606
|
enableClickToDeselect: g = !0,
|
|
555
|
-
enableNonFolderIndent:
|
|
556
|
-
forceUpdateTable:
|
|
557
|
-
globalFilter:
|
|
558
|
-
meta:
|
|
559
|
-
rowHeight:
|
|
560
|
-
imgRatio:
|
|
561
|
-
imgPosition:
|
|
562
|
-
onScrollBottom:
|
|
563
|
-
scrollToRowId:
|
|
564
|
-
onRename:
|
|
565
|
-
renamingId:
|
|
566
|
-
renameInitialValue:
|
|
567
|
-
onSubmitRename:
|
|
568
|
-
onCancelRename:
|
|
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:
|
|
622
|
+
onRowOptionClick: Q,
|
|
571
623
|
rowContextMenuBuilders: ee = [],
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
624
|
+
addonShortcuts: U,
|
|
625
|
+
children: J,
|
|
626
|
+
pt: j,
|
|
627
|
+
fitContent: de,
|
|
628
|
+
rowIdPrefix: $,
|
|
629
|
+
...W
|
|
577
630
|
}) => {
|
|
578
631
|
const {
|
|
579
|
-
rowSelection:
|
|
580
|
-
expanded:
|
|
581
|
-
setExpanded:
|
|
582
|
-
onExpandedChange:
|
|
583
|
-
onRowSelectionChange:
|
|
584
|
-
rowPinning:
|
|
585
|
-
onRowPinningChange:
|
|
586
|
-
} =
|
|
587
|
-
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
const
|
|
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
|
|
595
|
-
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
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-${
|
|
661
|
+
id: `placeholder-${a}`
|
|
609
662
|
}
|
|
610
|
-
})) : t, [
|
|
611
|
-
(e,
|
|
612
|
-
const
|
|
613
|
-
if (!
|
|
614
|
-
if (
|
|
615
|
-
return { ...
|
|
616
|
-
if (g && !
|
|
617
|
-
return e.setRowSelection({}),
|
|
618
|
-
let
|
|
619
|
-
if (n &&
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
} else n &&
|
|
623
|
-
return e.setRowSelection(
|
|
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
|
-
),
|
|
627
|
-
(e,
|
|
628
|
-
if (!
|
|
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
|
|
633
|
-
|
|
634
|
-
|
|
685
|
+
const i = e.shiftKey, u = e.ctrlKey || e.metaKey;
|
|
686
|
+
L(
|
|
687
|
+
E.current,
|
|
635
688
|
// Pass the main table instance
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
689
|
+
a.id,
|
|
690
|
+
i,
|
|
691
|
+
u
|
|
639
692
|
);
|
|
640
693
|
},
|
|
641
|
-
[
|
|
694
|
+
[L]
|
|
642
695
|
// Depends only on handleSelectionLogic
|
|
643
|
-
),
|
|
644
|
-
(e,
|
|
645
|
-
if (!
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
let
|
|
649
|
-
if (!(
|
|
650
|
-
for (;
|
|
651
|
-
const
|
|
652
|
-
if (!
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
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
|
|
660
|
-
|
|
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
|
-
|
|
717
|
+
f = e === "down" ? f + 1 : f - 1;
|
|
665
718
|
}
|
|
666
719
|
},
|
|
667
|
-
[
|
|
668
|
-
),
|
|
669
|
-
(e,
|
|
670
|
-
|
|
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:
|
|
675
|
-
handleRowSelect:
|
|
676
|
-
handleArrowNavigation:
|
|
677
|
-
handleRename:
|
|
678
|
-
}),
|
|
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:
|
|
737
|
+
sortingFn: Et,
|
|
685
738
|
//sort by fuzzy rank (falls back to alphanumeric)
|
|
686
|
-
cell: ({ row: e, getValue:
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
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
|
|
691
|
-
|
|
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
|
-
|
|
695
|
-
|
|
747
|
+
r.shiftKey,
|
|
748
|
+
r.ctrlKey || r.metaKey
|
|
696
749
|
);
|
|
697
|
-
|
|
698
|
-
},
|
|
699
|
-
className:
|
|
750
|
+
r.altKey && Q?.(e.original, Object.keys(h));
|
|
751
|
+
}, f = {
|
|
752
|
+
className: T({
|
|
700
753
|
selected: e.getIsSelected(),
|
|
701
|
-
loading:
|
|
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: (
|
|
708
|
-
|
|
760
|
+
onKeyDown: (r) => {
|
|
761
|
+
r.target instanceof HTMLInputElement || xe(r, e);
|
|
709
762
|
},
|
|
710
763
|
depth: e.depth,
|
|
711
764
|
tabIndex: 0,
|
|
712
|
-
value:
|
|
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:
|
|
720
|
-
imgPosition:
|
|
772
|
+
imgRatio: z,
|
|
773
|
+
imgPosition: G,
|
|
721
774
|
isRowExpandable: e.getCanExpand(),
|
|
722
|
-
enableNonFolderIndent:
|
|
775
|
+
enableNonFolderIndent: x,
|
|
723
776
|
isRowExpanded: e.getIsExpanded(),
|
|
724
|
-
isTableExpandable:
|
|
725
|
-
onExpandClick: (
|
|
726
|
-
|
|
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 ===
|
|
734
|
-
renameInitialValue: e.id ===
|
|
735
|
-
onSubmitRename:
|
|
736
|
-
onCancelRename:
|
|
737
|
-
...
|
|
738
|
-
onClick:
|
|
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: (
|
|
793
|
+
onDoubleClick: (r) => me.current?.(e.id, e)
|
|
741
794
|
};
|
|
742
|
-
return
|
|
795
|
+
return u?.children ? u.children(f, e, i) : /* @__PURE__ */ p(wt, { ...f, ...j?.cell });
|
|
743
796
|
}
|
|
744
797
|
}
|
|
745
798
|
],
|
|
746
799
|
[
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
800
|
+
c,
|
|
801
|
+
L,
|
|
802
|
+
xe,
|
|
750
803
|
g,
|
|
751
|
-
|
|
804
|
+
x,
|
|
805
|
+
z,
|
|
752
806
|
G,
|
|
753
|
-
|
|
754
|
-
B
|
|
807
|
+
Q
|
|
755
808
|
]
|
|
756
|
-
),
|
|
809
|
+
), Ae = w(
|
|
757
810
|
(e) => {
|
|
758
|
-
|
|
811
|
+
X(Se(e, y));
|
|
759
812
|
},
|
|
760
|
-
[
|
|
761
|
-
),
|
|
813
|
+
[X]
|
|
814
|
+
), Ie = w(
|
|
762
815
|
(e) => {
|
|
763
|
-
|
|
816
|
+
v?.(Se(e, Y || {}));
|
|
764
817
|
},
|
|
765
|
-
[
|
|
766
|
-
),
|
|
818
|
+
[v]
|
|
819
|
+
), je = w(
|
|
767
820
|
(e) => {
|
|
768
|
-
|
|
769
|
-
const
|
|
770
|
-
return
|
|
821
|
+
ne?.((a) => {
|
|
822
|
+
const i = e instanceof Function ? e(a) : e;
|
|
823
|
+
return oe?.(i), i;
|
|
771
824
|
});
|
|
772
825
|
},
|
|
773
|
-
[
|
|
774
|
-
),
|
|
775
|
-
data:
|
|
776
|
-
columns:
|
|
826
|
+
[ne]
|
|
827
|
+
), P = Xe({
|
|
828
|
+
data: Fe,
|
|
829
|
+
columns: ze,
|
|
777
830
|
state: {
|
|
778
|
-
expanded:
|
|
779
|
-
rowSelection:
|
|
780
|
-
globalFilter:
|
|
781
|
-
rowPinning:
|
|
831
|
+
expanded: te,
|
|
832
|
+
rowSelection: y,
|
|
833
|
+
globalFilter: b,
|
|
834
|
+
rowPinning: Y
|
|
782
835
|
},
|
|
783
|
-
onRowSelectionChange:
|
|
784
|
-
onRowPinningChange:
|
|
836
|
+
onRowSelectionChange: Ae,
|
|
837
|
+
onRowPinningChange: Ie,
|
|
785
838
|
filterFns: {
|
|
786
|
-
fuzzy:
|
|
839
|
+
fuzzy: Me
|
|
787
840
|
},
|
|
788
841
|
globalFilterFn: "fuzzy",
|
|
789
842
|
enableRowSelection: !0,
|
|
790
843
|
//enable row selection for all rows
|
|
791
|
-
enableRowPinning: !!
|
|
844
|
+
enableRowPinning: !!v,
|
|
792
845
|
getRowId: (e) => e.id,
|
|
793
846
|
enableSubRowSelection: !1,
|
|
794
847
|
//disable sub row selection
|
|
795
|
-
onExpandedChange:
|
|
848
|
+
onExpandedChange: je,
|
|
796
849
|
getSubRows: (e) => e.subRows,
|
|
797
|
-
getCoreRowModel:
|
|
798
|
-
getFilteredRowModel:
|
|
799
|
-
getExpandedRowModel:
|
|
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:
|
|
856
|
+
meta: le(
|
|
804
857
|
() => ({
|
|
805
|
-
isExpandable: !!
|
|
806
|
-
isLoading:
|
|
807
|
-
children:
|
|
808
|
-
...
|
|
858
|
+
isExpandable: !!d,
|
|
859
|
+
isLoading: o,
|
|
860
|
+
children: J,
|
|
861
|
+
...C
|
|
809
862
|
}),
|
|
810
|
-
[
|
|
863
|
+
[d, o, J, C]
|
|
811
864
|
)
|
|
812
865
|
});
|
|
813
866
|
ce(() => {
|
|
814
|
-
|
|
815
|
-
}, [
|
|
816
|
-
const { rows:
|
|
817
|
-
(e,
|
|
818
|
-
if (!
|
|
819
|
-
const
|
|
820
|
-
if (!
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
(
|
|
824
|
-
|
|
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:
|
|
827
|
-
row:
|
|
828
|
-
selectedRows:
|
|
829
|
-
selectedTableRows:
|
|
830
|
-
isSelected:
|
|
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
|
-
|
|
887
|
+
S.length > 0 && ge(i, S);
|
|
835
888
|
},
|
|
836
|
-
[ee,
|
|
837
|
-
),
|
|
838
|
-
count:
|
|
839
|
-
estimateSize: () =>
|
|
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: () =>
|
|
894
|
+
getScrollElement: () => ae.current,
|
|
842
895
|
//measure dynamic row height, except in firefox because it measures table border height incorrectly
|
|
843
|
-
measureElement:
|
|
896
|
+
measureElement: K ? () => K : typeof window < "u" && navigator.userAgent.indexOf("Firefox") === -1 ? (e) => e?.getBoundingClientRect().height : void 0,
|
|
844
897
|
overscan: 5
|
|
845
|
-
}),
|
|
898
|
+
}), be = R(void 0);
|
|
846
899
|
ce(() => {
|
|
847
|
-
if (!
|
|
848
|
-
const e =
|
|
849
|
-
e < 0 || (
|
|
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
|
-
|
|
852
|
-
`#${CSS.escape(
|
|
904
|
+
ae.current?.querySelector(
|
|
905
|
+
`#${CSS.escape(re(k))}`
|
|
853
906
|
)?.querySelector('[tabindex="0"]')?.focus({ preventScroll: !0 });
|
|
854
907
|
})
|
|
855
908
|
));
|
|
856
|
-
}, [
|
|
857
|
-
const
|
|
909
|
+
}, [k, V, q]);
|
|
910
|
+
const Le = w(
|
|
858
911
|
(e) => {
|
|
859
|
-
e &&
|
|
912
|
+
e && q.measureElement(e);
|
|
860
913
|
},
|
|
861
|
-
[
|
|
862
|
-
),
|
|
914
|
+
[q]
|
|
915
|
+
), Pe = w(
|
|
863
916
|
(e) => {
|
|
864
|
-
if (!
|
|
865
|
-
const
|
|
866
|
-
|
|
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
|
-
[
|
|
869
|
-
)
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
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
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
|
|
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
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
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
|
};
|