@dxos/react-ui-list 0.8.4-main.c1de068 → 0.8.4-main.c4373fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +91 -89
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +91 -89
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts +10 -4
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts +1 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +6 -6
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +14 -5
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListItem.d.ts +4 -7
- package/dist/types/src/components/List/ListItem.d.ts.map +1 -1
- package/dist/types/src/components/List/ListRoot.d.ts.map +1 -1
- package/dist/types/src/components/List/testing.d.ts +1 -1
- package/dist/types/src/components/List/testing.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.d.ts +3 -3
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +36 -6
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeContext.d.ts +3 -2
- package/dist/types/src/components/Tree/TreeContext.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItem.d.ts +14 -9
- package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItemHeading.d.ts +4 -3
- package/dist/types/src/components/Tree/TreeItemHeading.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItemToggle.d.ts +3 -3
- package/dist/types/src/components/Tree/TreeItemToggle.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing.d.ts +2 -2
- package/dist/types/src/components/Tree/testing.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +25 -24
- package/src/components/Accordion/Accordion.stories.tsx +8 -7
- package/src/components/Accordion/Accordion.tsx +1 -1
- package/src/components/Accordion/AccordionItem.tsx +5 -2
- package/src/components/List/List.stories.tsx +16 -14
- package/src/components/List/List.tsx +2 -5
- package/src/components/List/ListItem.tsx +39 -27
- package/src/components/List/ListRoot.tsx +1 -1
- package/src/components/List/testing.ts +2 -2
- package/src/components/Tree/Tree.stories.tsx +51 -48
- package/src/components/Tree/Tree.tsx +7 -2
- package/src/components/Tree/TreeContext.tsx +3 -2
- package/src/components/Tree/TreeItem.tsx +52 -42
- package/src/components/Tree/TreeItemHeading.tsx +7 -6
- package/src/components/Tree/TreeItemToggle.tsx +29 -18
- package/src/components/Tree/testing.ts +2 -2
|
@@ -38,7 +38,7 @@ var AccordionRoot = ({ classNames, items, getId = defaultGetId, children, value,
|
|
|
38
38
|
|
|
39
39
|
// src/components/Accordion/AccordionItem.tsx
|
|
40
40
|
var ACCORDION_ITEM_NAME = "AccordionItem";
|
|
41
|
-
var [AccordionItemProvider,
|
|
41
|
+
var [AccordionItemProvider, useDxAccordionItemContext] = createContext2(ACCORDION_ITEM_NAME);
|
|
42
42
|
var AccordionItem = ({ children, classNames, item }) => {
|
|
43
43
|
var _effect = _useSignals2();
|
|
44
44
|
try {
|
|
@@ -99,10 +99,10 @@ import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-d
|
|
|
99
99
|
import { setCustomNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview";
|
|
100
100
|
import { attachClosestEdge, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
|
|
101
101
|
import { createContext as createContext4 } from "@radix-ui/react-context";
|
|
102
|
-
import React4, {
|
|
102
|
+
import React4, { useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
103
103
|
import { createPortal } from "react-dom";
|
|
104
104
|
import { invariant } from "@dxos/invariant";
|
|
105
|
-
import {
|
|
105
|
+
import { IconButton, ListItem as NaturalListItem, useTranslation } from "@dxos/react-ui";
|
|
106
106
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
107
107
|
|
|
108
108
|
// src/components/List/ListRoot.tsx
|
|
@@ -202,7 +202,7 @@ var ListItem = ({ children, classNames, item, ...props }) => {
|
|
|
202
202
|
const element = ref.current;
|
|
203
203
|
invariant(element, void 0, {
|
|
204
204
|
F: __dxlog_file,
|
|
205
|
-
L:
|
|
205
|
+
L: 98,
|
|
206
206
|
S: void 0,
|
|
207
207
|
A: [
|
|
208
208
|
"element",
|
|
@@ -311,67 +311,54 @@ var ListItem = ({ children, classNames, item, ...props }) => {
|
|
|
311
311
|
return /* @__PURE__ */ React4.createElement(ListItemProvider, {
|
|
312
312
|
item,
|
|
313
313
|
dragHandleRef
|
|
314
|
-
}, /* @__PURE__ */ React4.createElement("div", {
|
|
315
|
-
role: "none",
|
|
316
|
-
className: "relative"
|
|
317
314
|
}, /* @__PURE__ */ React4.createElement("div", {
|
|
318
315
|
ref,
|
|
319
316
|
role: "listitem",
|
|
320
|
-
className: mx3("flex
|
|
317
|
+
className: mx3("flex relative", classNames, stateStyles[state.type]),
|
|
321
318
|
...props
|
|
322
|
-
}, children
|
|
319
|
+
}, children, state.type === "is-dragging-over" && state.closestEdge && /* @__PURE__ */ React4.createElement(NaturalListItem.DropIndicator, {
|
|
323
320
|
edge: state.closestEdge
|
|
324
321
|
})));
|
|
325
322
|
} finally {
|
|
326
323
|
_effect.f();
|
|
327
324
|
}
|
|
328
325
|
};
|
|
329
|
-
var
|
|
330
|
-
var _effect = _useSignals4();
|
|
331
|
-
try {
|
|
332
|
-
return /* @__PURE__ */ React4.createElement("button", {
|
|
333
|
-
ref: forwardedRef,
|
|
334
|
-
className: mx3("flex items-center justify-center", classNames),
|
|
335
|
-
...props
|
|
336
|
-
}, /* @__PURE__ */ React4.createElement(Icon2, {
|
|
337
|
-
icon,
|
|
338
|
-
classNames: "cursor-pointer",
|
|
339
|
-
size: 4
|
|
340
|
-
}));
|
|
341
|
-
} finally {
|
|
342
|
-
_effect.f();
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
var ListItemDeleteButton = ({ autoHide = true, classNames, disabled, icon = "ph--x--regular", ...props }) => {
|
|
326
|
+
var ListItemDeleteButton = ({ autoHide = true, classNames, disabled, icon = "ph--x--regular", label, ...props }) => {
|
|
346
327
|
var _effect = _useSignals4();
|
|
347
328
|
try {
|
|
348
329
|
const { state } = useListContext("DELETE_BUTTON");
|
|
349
330
|
const isDisabled = state.type !== "idle" || disabled;
|
|
331
|
+
const { t } = useTranslation("os");
|
|
350
332
|
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
333
|
+
iconOnly: true,
|
|
334
|
+
variant: "ghost",
|
|
335
|
+
...props,
|
|
351
336
|
icon,
|
|
352
337
|
disabled: isDisabled,
|
|
338
|
+
label: label ?? t("delete label"),
|
|
353
339
|
classNames: [
|
|
354
340
|
classNames,
|
|
355
341
|
autoHide && disabled && "hidden"
|
|
356
|
-
]
|
|
357
|
-
...props
|
|
342
|
+
]
|
|
358
343
|
});
|
|
359
344
|
} finally {
|
|
360
345
|
_effect.f();
|
|
361
346
|
}
|
|
362
347
|
};
|
|
363
|
-
var ListItemButton = ({ autoHide = true, classNames, disabled, ...props }) => {
|
|
348
|
+
var ListItemButton = ({ autoHide = true, iconOnly = true, variant = "ghost", classNames, disabled, ...props }) => {
|
|
364
349
|
var _effect = _useSignals4();
|
|
365
350
|
try {
|
|
366
351
|
const { state } = useListContext("ITEM_BUTTON");
|
|
367
352
|
const isDisabled = state.type !== "idle" || disabled;
|
|
368
353
|
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
354
|
+
...props,
|
|
369
355
|
disabled: isDisabled,
|
|
356
|
+
iconOnly,
|
|
357
|
+
variant,
|
|
370
358
|
classNames: [
|
|
371
359
|
classNames,
|
|
372
360
|
autoHide && disabled && "hidden"
|
|
373
|
-
]
|
|
374
|
-
...props
|
|
361
|
+
]
|
|
375
362
|
});
|
|
376
363
|
} finally {
|
|
377
364
|
_effect.f();
|
|
@@ -381,7 +368,11 @@ var ListItemDragHandle = ({ disabled }) => {
|
|
|
381
368
|
var _effect = _useSignals4();
|
|
382
369
|
try {
|
|
383
370
|
const { dragHandleRef } = useListItemContext("DRAG_HANDLE");
|
|
371
|
+
const { t } = useTranslation("os");
|
|
384
372
|
return /* @__PURE__ */ React4.createElement(IconButton, {
|
|
373
|
+
iconOnly: true,
|
|
374
|
+
variant: "ghost",
|
|
375
|
+
label: t("drag handle label"),
|
|
385
376
|
ref: dragHandleRef,
|
|
386
377
|
icon: "ph--dots-six-vertical--regular",
|
|
387
378
|
disabled
|
|
@@ -427,8 +418,7 @@ var List = {
|
|
|
427
418
|
ItemDragHandle: ListItemDragHandle,
|
|
428
419
|
ItemDeleteButton: ListItemDeleteButton,
|
|
429
420
|
ItemButton: ListItemButton,
|
|
430
|
-
ItemTitle: ListItemTitle
|
|
431
|
-
IconButton
|
|
421
|
+
ItemTitle: ListItemTitle
|
|
432
422
|
};
|
|
433
423
|
|
|
434
424
|
// src/components/Tree/Tree.tsx
|
|
@@ -448,21 +438,27 @@ import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking"
|
|
|
448
438
|
import { combine as combine2 } from "@atlaskit/pragmatic-drag-and-drop/combine";
|
|
449
439
|
import { draggable as draggable2, dropTargetForElements as dropTargetForElements2 } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
|
|
450
440
|
import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
|
|
451
|
-
import
|
|
441
|
+
import * as Schema from "effect/Schema";
|
|
452
442
|
import React7, { memo as memo3, useCallback as useCallback3, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
|
|
453
443
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
454
|
-
import {
|
|
455
|
-
import { ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls } from "@dxos/react-ui-theme";
|
|
444
|
+
import { TreeItem as NaturalTreeItem, Treegrid } from "@dxos/react-ui";
|
|
445
|
+
import { ghostFocusWithin, ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls } from "@dxos/react-ui-theme";
|
|
446
|
+
|
|
447
|
+
// src/components/Tree/helpers.ts
|
|
448
|
+
var DEFAULT_INDENTATION = 8;
|
|
449
|
+
var paddingIndentation = (level, indentation = DEFAULT_INDENTATION) => ({
|
|
450
|
+
paddingInlineStart: `${(level - 1) * indentation}px`
|
|
451
|
+
});
|
|
456
452
|
|
|
457
453
|
// src/components/Tree/TreeItemHeading.tsx
|
|
458
454
|
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
459
|
-
import React5, { forwardRef
|
|
460
|
-
import { Button, Icon as
|
|
455
|
+
import React5, { forwardRef, memo, useCallback as useCallback2 } from "react";
|
|
456
|
+
import { Button, Icon as Icon2, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
461
457
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
462
|
-
var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */
|
|
458
|
+
var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label, className, icon, iconClassName, disabled, current, onSelect }, forwardedRef) => {
|
|
463
459
|
var _effect = _useSignals5();
|
|
464
460
|
try {
|
|
465
|
-
const { t } =
|
|
461
|
+
const { t } = useTranslation2();
|
|
466
462
|
const handleSelect = useCallback2((event) => {
|
|
467
463
|
onSelect?.(event.altKey);
|
|
468
464
|
}, [
|
|
@@ -499,10 +495,13 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ label,
|
|
|
499
495
|
...current && {
|
|
500
496
|
"aria-current": "location"
|
|
501
497
|
}
|
|
502
|
-
}, icon && /* @__PURE__ */ React5.createElement(
|
|
498
|
+
}, icon && /* @__PURE__ */ React5.createElement(Icon2, {
|
|
503
499
|
icon: icon ?? "ph--placeholder--regular",
|
|
504
500
|
size: 5,
|
|
505
|
-
classNames:
|
|
501
|
+
classNames: [
|
|
502
|
+
"mlb-1",
|
|
503
|
+
iconClassName
|
|
504
|
+
]
|
|
506
505
|
}), /* @__PURE__ */ React5.createElement("span", {
|
|
507
506
|
className: "flex-1 is-0 truncate text-start text-sm font-normal",
|
|
508
507
|
"data-tooltip": true
|
|
@@ -514,41 +513,37 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ label,
|
|
|
514
513
|
|
|
515
514
|
// src/components/Tree/TreeItemToggle.tsx
|
|
516
515
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
517
|
-
import React6, { forwardRef as
|
|
518
|
-
import {
|
|
519
|
-
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */
|
|
516
|
+
import React6, { forwardRef as forwardRef2, memo as memo2 } from "react";
|
|
517
|
+
import { IconButton as IconButton2 } from "@dxos/react-ui";
|
|
518
|
+
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ open, isBranch, hidden, classNames, ...props }, forwardedRef) => {
|
|
520
519
|
var _effect = _useSignals6();
|
|
521
520
|
try {
|
|
522
|
-
return /* @__PURE__ */ React6.createElement(
|
|
521
|
+
return /* @__PURE__ */ React6.createElement(IconButton2, {
|
|
523
522
|
ref: forwardedRef,
|
|
524
523
|
"data-testid": "treeItem.toggle",
|
|
525
524
|
"aria-expanded": open,
|
|
526
525
|
variant: "ghost",
|
|
527
526
|
density: "fine",
|
|
528
527
|
classNames: [
|
|
529
|
-
"is-6 pli-0
|
|
530
|
-
|
|
528
|
+
"bs-full is-6 pli-0",
|
|
529
|
+
"[&_svg]:transition-[transform] [&_svg]:duration-200",
|
|
530
|
+
open && "[&_svg]:rotate-90",
|
|
531
|
+
hidden ? "hidden" : !isBranch && "invisible",
|
|
532
|
+
classNames
|
|
531
533
|
],
|
|
532
|
-
onClick: onToggle
|
|
533
|
-
}, /* @__PURE__ */ React6.createElement(Icon4, {
|
|
534
|
-
icon: "ph--caret-right--bold",
|
|
535
534
|
size: 3,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
535
|
+
icon: "ph--caret-right--bold",
|
|
536
|
+
iconOnly: true,
|
|
537
|
+
noTooltip: true,
|
|
538
|
+
label: open ? "Click to close" : "Click to open",
|
|
539
|
+
tabIndex: -1,
|
|
540
|
+
...props
|
|
541
|
+
});
|
|
541
542
|
} finally {
|
|
542
543
|
_effect.f();
|
|
543
544
|
}
|
|
544
545
|
}));
|
|
545
546
|
|
|
546
|
-
// src/components/Tree/helpers.ts
|
|
547
|
-
var DEFAULT_INDENTATION = 8;
|
|
548
|
-
var paddingIndentation = (level, indentation = DEFAULT_INDENTATION) => ({
|
|
549
|
-
paddingInlineStart: `${(level - 1) * indentation}px`
|
|
550
|
-
});
|
|
551
|
-
|
|
552
547
|
// src/components/Tree/TreeItem.tsx
|
|
553
548
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui-list/src/components/Tree/TreeItem.tsx";
|
|
554
549
|
var hoverableDescriptionIcons = "[--icons-color:inherit] hover-hover:[--icons-color:var(--description-text)] hover-hover:hover:[--icons-color:inherit] focus-within:[--icons-color:inherit]";
|
|
@@ -558,7 +553,7 @@ var TreeDataSchema = Schema.Struct({
|
|
|
558
553
|
item: Schema.Any
|
|
559
554
|
});
|
|
560
555
|
var isTreeData = (data) => Schema.is(TreeDataSchema)(data);
|
|
561
|
-
var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColumns: Columns, canDrop, onOpenChange, onSelect
|
|
556
|
+
var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, canDrop, canSelect, onOpenChange, onSelect }) => {
|
|
562
557
|
var _effect = _useSignals7();
|
|
563
558
|
try {
|
|
564
559
|
const rowRef = useRef2(null);
|
|
@@ -570,7 +565,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
570
565
|
const [menuOpen, setMenuOpen] = useState3(false);
|
|
571
566
|
const { useItems, getProps, isOpen, isCurrent } = useTree();
|
|
572
567
|
const items = useItems(item);
|
|
573
|
-
const { id, label,
|
|
568
|
+
const { id, parentOf, label, className, headingClassName, icon, iconClassName, disabled, testId } = getProps(item, _path);
|
|
574
569
|
const path = useMemo(() => [
|
|
575
570
|
..._path,
|
|
576
571
|
id
|
|
@@ -583,6 +578,10 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
583
578
|
const level = path.length - levelOffset;
|
|
584
579
|
const isBranch = !!parentOf;
|
|
585
580
|
const mode = last ? "last-in-group" : open ? "expanded" : "standard";
|
|
581
|
+
const canSelectItem = canSelect?.({
|
|
582
|
+
item,
|
|
583
|
+
path
|
|
584
|
+
}) ?? true;
|
|
586
585
|
const cancelExpand = useCallback3(() => {
|
|
587
586
|
if (cancelExpandRef.current) {
|
|
588
587
|
clearTimeout(cancelExpandRef.current);
|
|
@@ -595,7 +594,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
595
594
|
}
|
|
596
595
|
invariant2(buttonRef.current, void 0, {
|
|
597
596
|
F: __dxlog_file2,
|
|
598
|
-
L:
|
|
597
|
+
L: 113,
|
|
599
598
|
S: void 0,
|
|
600
599
|
A: [
|
|
601
600
|
"buttonRef.current",
|
|
@@ -700,7 +699,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
700
699
|
useEffect3(() => () => cancelExpand(), [
|
|
701
700
|
cancelExpand
|
|
702
701
|
]);
|
|
703
|
-
const
|
|
702
|
+
const handleOpenToggle = useCallback3(() => onOpenChange?.({
|
|
704
703
|
item,
|
|
705
704
|
path,
|
|
706
705
|
open: !open
|
|
@@ -711,9 +710,13 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
711
710
|
open
|
|
712
711
|
]);
|
|
713
712
|
const handleSelect = useCallback3((option = false) => {
|
|
714
|
-
if (isBranch) {
|
|
715
|
-
|
|
716
|
-
} else {
|
|
713
|
+
if (isBranch && (option || current)) {
|
|
714
|
+
handleOpenToggle();
|
|
715
|
+
} else if (canSelectItem) {
|
|
716
|
+
canSelect?.({
|
|
717
|
+
item,
|
|
718
|
+
path
|
|
719
|
+
});
|
|
717
720
|
rowRef.current?.focus();
|
|
718
721
|
onSelect?.({
|
|
719
722
|
item,
|
|
@@ -727,25 +730,21 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
727
730
|
path,
|
|
728
731
|
current,
|
|
729
732
|
isBranch,
|
|
730
|
-
|
|
733
|
+
canSelectItem,
|
|
734
|
+
handleOpenToggle,
|
|
731
735
|
onSelect
|
|
732
736
|
]);
|
|
733
737
|
const handleKeyDown = useCallback3((event) => {
|
|
734
738
|
switch (event.key) {
|
|
735
739
|
case "ArrowRight":
|
|
736
|
-
isBranch && !open && handleOpenChange();
|
|
737
|
-
break;
|
|
738
740
|
case "ArrowLeft":
|
|
739
|
-
isBranch &&
|
|
740
|
-
break;
|
|
741
|
-
case " ":
|
|
742
|
-
handleSelect(event.altKey);
|
|
741
|
+
isBranch && handleOpenToggle();
|
|
743
742
|
break;
|
|
744
743
|
}
|
|
745
744
|
}, [
|
|
746
745
|
isBranch,
|
|
747
746
|
open,
|
|
748
|
-
|
|
747
|
+
handleOpenToggle,
|
|
749
748
|
handleSelect
|
|
750
749
|
]);
|
|
751
750
|
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Treegrid.Row, {
|
|
@@ -761,6 +760,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
761
760
|
hoverableFocusedWithinControls,
|
|
762
761
|
hoverableDescriptionIcons,
|
|
763
762
|
ghostHover,
|
|
763
|
+
ghostFocusWithin,
|
|
764
764
|
className
|
|
765
765
|
],
|
|
766
766
|
"data-itemid": id,
|
|
@@ -774,25 +774,25 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
774
774
|
event.preventDefault();
|
|
775
775
|
setMenuOpen(true);
|
|
776
776
|
}
|
|
777
|
-
}, /* @__PURE__ */ React7.createElement(Treegrid.Cell, {
|
|
778
|
-
indent: true,
|
|
779
|
-
classNames: "relative grid grid-cols-subgrid col-[tree-row]",
|
|
780
|
-
style: paddingIndentation(level)
|
|
781
777
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
782
778
|
role: "none",
|
|
783
|
-
className: "
|
|
779
|
+
className: "indent relative grid grid-cols-subgrid col-[tree-row]",
|
|
780
|
+
style: paddingIndentation(level)
|
|
781
|
+
}, /* @__PURE__ */ React7.createElement(Treegrid.Cell, {
|
|
782
|
+
classNames: "flex items-center"
|
|
784
783
|
}, /* @__PURE__ */ React7.createElement(TreeItemToggle, {
|
|
785
784
|
isBranch,
|
|
786
785
|
open,
|
|
787
|
-
|
|
786
|
+
onClick: handleOpenToggle
|
|
788
787
|
}), /* @__PURE__ */ React7.createElement(TreeItemHeading, {
|
|
789
|
-
ref: buttonRef,
|
|
790
|
-
label,
|
|
791
|
-
icon,
|
|
792
|
-
className: headingClassName,
|
|
793
788
|
disabled,
|
|
794
789
|
current,
|
|
795
|
-
|
|
790
|
+
label,
|
|
791
|
+
className: headingClassName,
|
|
792
|
+
icon,
|
|
793
|
+
iconClassName,
|
|
794
|
+
onSelect: handleSelect,
|
|
795
|
+
ref: buttonRef
|
|
796
796
|
})), Columns && /* @__PURE__ */ React7.createElement(Columns, {
|
|
797
797
|
item,
|
|
798
798
|
path,
|
|
@@ -810,6 +810,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
810
810
|
draggable: _draggable,
|
|
811
811
|
renderColumns: Columns,
|
|
812
812
|
canDrop,
|
|
813
|
+
canSelect,
|
|
813
814
|
onOpenChange,
|
|
814
815
|
onSelect
|
|
815
816
|
})));
|
|
@@ -820,7 +821,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
820
821
|
var TreeItem = /* @__PURE__ */ memo3(RawTreeItem);
|
|
821
822
|
|
|
822
823
|
// src/components/Tree/Tree.tsx
|
|
823
|
-
var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, canDrop, onOpenChange, onSelect }) => {
|
|
824
|
+
var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, canDrop, canSelect, onOpenChange, onSelect }) => {
|
|
824
825
|
var _effect = _useSignals8();
|
|
825
826
|
try {
|
|
826
827
|
const context = useMemo2(() => ({
|
|
@@ -858,6 +859,7 @@ var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable:
|
|
|
858
859
|
draggable: draggable3,
|
|
859
860
|
renderColumns,
|
|
860
861
|
canDrop,
|
|
862
|
+
canSelect,
|
|
861
863
|
onOpenChange,
|
|
862
864
|
onSelect
|
|
863
865
|
}))));
|