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