@dxos/react-ui-list 0.8.4-main.67995b8 → 0.8.4-main.72ec0f3
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 +94 -90
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +94 -90
- 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 +7 -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 +6 -2
- 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 +26 -26
- package/src/components/Accordion/Accordion.stories.tsx +7 -9
- package/src/components/Accordion/Accordion.tsx +1 -1
- package/src/components/Accordion/AccordionItem.tsx +5 -2
- package/src/components/List/List.stories.tsx +19 -17
- 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 +41 -35
- package/src/components/Tree/TreeItemHeading.tsx +9 -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,29 @@ 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
|
-
|
|
458
|
+
import { getStyles } from "@dxos/react-ui-theme";
|
|
459
|
+
var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label, className, icon, iconHue, disabled, current, onSelect }, forwardedRef) => {
|
|
463
460
|
var _effect = _useSignals5();
|
|
464
461
|
try {
|
|
465
|
-
const { t } =
|
|
462
|
+
const { t } = useTranslation2();
|
|
463
|
+
const styles = iconHue ? getStyles(iconHue) : void 0;
|
|
466
464
|
const handleSelect = useCallback2((event) => {
|
|
467
465
|
onSelect?.(event.altKey);
|
|
468
466
|
}, [
|
|
@@ -499,10 +497,13 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ label,
|
|
|
499
497
|
...current && {
|
|
500
498
|
"aria-current": "location"
|
|
501
499
|
}
|
|
502
|
-
}, icon && /* @__PURE__ */ React5.createElement(
|
|
500
|
+
}, icon && /* @__PURE__ */ React5.createElement(Icon2, {
|
|
503
501
|
icon: icon ?? "ph--placeholder--regular",
|
|
504
502
|
size: 5,
|
|
505
|
-
classNames:
|
|
503
|
+
classNames: [
|
|
504
|
+
"mlb-1",
|
|
505
|
+
styles?.icon
|
|
506
|
+
]
|
|
506
507
|
}), /* @__PURE__ */ React5.createElement("span", {
|
|
507
508
|
className: "flex-1 is-0 truncate text-start text-sm font-normal",
|
|
508
509
|
"data-tooltip": true
|
|
@@ -514,41 +515,37 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ label,
|
|
|
514
515
|
|
|
515
516
|
// src/components/Tree/TreeItemToggle.tsx
|
|
516
517
|
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
517
|
-
import React6, { forwardRef as
|
|
518
|
-
import {
|
|
519
|
-
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */
|
|
518
|
+
import React6, { forwardRef as forwardRef2, memo as memo2 } from "react";
|
|
519
|
+
import { IconButton as IconButton2 } from "@dxos/react-ui";
|
|
520
|
+
var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ open, isBranch, hidden, classNames, ...props }, forwardedRef) => {
|
|
520
521
|
var _effect = _useSignals6();
|
|
521
522
|
try {
|
|
522
|
-
return /* @__PURE__ */ React6.createElement(
|
|
523
|
+
return /* @__PURE__ */ React6.createElement(IconButton2, {
|
|
523
524
|
ref: forwardedRef,
|
|
524
525
|
"data-testid": "treeItem.toggle",
|
|
525
526
|
"aria-expanded": open,
|
|
526
527
|
variant: "ghost",
|
|
527
528
|
density: "fine",
|
|
528
529
|
classNames: [
|
|
529
|
-
"is-6 pli-0
|
|
530
|
-
|
|
530
|
+
"bs-full is-6 pli-0",
|
|
531
|
+
"[&_svg]:transition-[transform] [&_svg]:duration-200",
|
|
532
|
+
open && "[&_svg]:rotate-90",
|
|
533
|
+
hidden ? "hidden" : !isBranch && "invisible",
|
|
534
|
+
classNames
|
|
531
535
|
],
|
|
532
|
-
onClick: onToggle
|
|
533
|
-
}, /* @__PURE__ */ React6.createElement(Icon4, {
|
|
534
|
-
icon: "ph--caret-right--bold",
|
|
535
536
|
size: 3,
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
537
|
+
icon: "ph--caret-right--bold",
|
|
538
|
+
iconOnly: true,
|
|
539
|
+
noTooltip: true,
|
|
540
|
+
label: open ? "Click to close" : "Click to open",
|
|
541
|
+
tabIndex: -1,
|
|
542
|
+
...props
|
|
543
|
+
});
|
|
541
544
|
} finally {
|
|
542
545
|
_effect.f();
|
|
543
546
|
}
|
|
544
547
|
}));
|
|
545
548
|
|
|
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
549
|
// src/components/Tree/TreeItem.tsx
|
|
553
550
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui-list/src/components/Tree/TreeItem.tsx";
|
|
554
551
|
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 +555,7 @@ var TreeDataSchema = Schema.Struct({
|
|
|
558
555
|
item: Schema.Any
|
|
559
556
|
});
|
|
560
557
|
var isTreeData = (data) => Schema.is(TreeDataSchema)(data);
|
|
561
|
-
var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColumns: Columns, canDrop, onOpenChange, onSelect
|
|
558
|
+
var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, canDrop, canSelect, onOpenChange, onSelect }) => {
|
|
562
559
|
var _effect = _useSignals7();
|
|
563
560
|
try {
|
|
564
561
|
const rowRef = useRef2(null);
|
|
@@ -570,7 +567,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
570
567
|
const [menuOpen, setMenuOpen] = useState3(false);
|
|
571
568
|
const { useItems, getProps, isOpen, isCurrent } = useTree();
|
|
572
569
|
const items = useItems(item);
|
|
573
|
-
const { id, label,
|
|
570
|
+
const { id, parentOf, label, className, headingClassName, icon, iconHue, disabled, testId } = getProps(item, _path);
|
|
574
571
|
const path = useMemo(() => [
|
|
575
572
|
..._path,
|
|
576
573
|
id
|
|
@@ -583,6 +580,10 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
583
580
|
const level = path.length - levelOffset;
|
|
584
581
|
const isBranch = !!parentOf;
|
|
585
582
|
const mode = last ? "last-in-group" : open ? "expanded" : "standard";
|
|
583
|
+
const canSelectItem = canSelect?.({
|
|
584
|
+
item,
|
|
585
|
+
path
|
|
586
|
+
}) ?? true;
|
|
586
587
|
const cancelExpand = useCallback3(() => {
|
|
587
588
|
if (cancelExpandRef.current) {
|
|
588
589
|
clearTimeout(cancelExpandRef.current);
|
|
@@ -595,7 +596,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
595
596
|
}
|
|
596
597
|
invariant2(buttonRef.current, void 0, {
|
|
597
598
|
F: __dxlog_file2,
|
|
598
|
-
L:
|
|
599
|
+
L: 110,
|
|
599
600
|
S: void 0,
|
|
600
601
|
A: [
|
|
601
602
|
"buttonRef.current",
|
|
@@ -700,7 +701,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
700
701
|
useEffect3(() => () => cancelExpand(), [
|
|
701
702
|
cancelExpand
|
|
702
703
|
]);
|
|
703
|
-
const
|
|
704
|
+
const handleOpenToggle = useCallback3(() => onOpenChange?.({
|
|
704
705
|
item,
|
|
705
706
|
path,
|
|
706
707
|
open: !open
|
|
@@ -711,9 +712,13 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
711
712
|
open
|
|
712
713
|
]);
|
|
713
714
|
const handleSelect = useCallback3((option = false) => {
|
|
714
|
-
if (isBranch) {
|
|
715
|
-
|
|
716
|
-
} else {
|
|
715
|
+
if (isBranch && (option || current)) {
|
|
716
|
+
handleOpenToggle();
|
|
717
|
+
} else if (canSelectItem) {
|
|
718
|
+
canSelect?.({
|
|
719
|
+
item,
|
|
720
|
+
path
|
|
721
|
+
});
|
|
717
722
|
rowRef.current?.focus();
|
|
718
723
|
onSelect?.({
|
|
719
724
|
item,
|
|
@@ -727,25 +732,21 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
727
732
|
path,
|
|
728
733
|
current,
|
|
729
734
|
isBranch,
|
|
730
|
-
|
|
735
|
+
canSelectItem,
|
|
736
|
+
handleOpenToggle,
|
|
731
737
|
onSelect
|
|
732
738
|
]);
|
|
733
739
|
const handleKeyDown = useCallback3((event) => {
|
|
734
740
|
switch (event.key) {
|
|
735
741
|
case "ArrowRight":
|
|
736
|
-
isBranch && !open && handleOpenChange();
|
|
737
|
-
break;
|
|
738
742
|
case "ArrowLeft":
|
|
739
|
-
isBranch &&
|
|
740
|
-
break;
|
|
741
|
-
case " ":
|
|
742
|
-
handleSelect(event.altKey);
|
|
743
|
+
isBranch && handleOpenToggle();
|
|
743
744
|
break;
|
|
744
745
|
}
|
|
745
746
|
}, [
|
|
746
747
|
isBranch,
|
|
747
748
|
open,
|
|
748
|
-
|
|
749
|
+
handleOpenToggle,
|
|
749
750
|
handleSelect
|
|
750
751
|
]);
|
|
751
752
|
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Treegrid.Row, {
|
|
@@ -761,9 +762,10 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
761
762
|
hoverableFocusedWithinControls,
|
|
762
763
|
hoverableDescriptionIcons,
|
|
763
764
|
ghostHover,
|
|
765
|
+
ghostFocusWithin,
|
|
764
766
|
className
|
|
765
767
|
],
|
|
766
|
-
"data-
|
|
768
|
+
"data-object-id": id,
|
|
767
769
|
"data-testid": testId,
|
|
768
770
|
// NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS
|
|
769
771
|
// without alerting the user (except for in the correct link element). See also:
|
|
@@ -774,25 +776,25 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
774
776
|
event.preventDefault();
|
|
775
777
|
setMenuOpen(true);
|
|
776
778
|
}
|
|
777
|
-
}, /* @__PURE__ */ React7.createElement(Treegrid.Cell, {
|
|
778
|
-
indent: true,
|
|
779
|
-
classNames: "relative grid grid-cols-subgrid col-[tree-row]",
|
|
780
|
-
style: paddingIndentation(level)
|
|
781
779
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
782
780
|
role: "none",
|
|
783
|
-
className: "
|
|
781
|
+
className: "indent relative grid grid-cols-subgrid col-[tree-row]",
|
|
782
|
+
style: paddingIndentation(level)
|
|
783
|
+
}, /* @__PURE__ */ React7.createElement(Treegrid.Cell, {
|
|
784
|
+
classNames: "flex items-center"
|
|
784
785
|
}, /* @__PURE__ */ React7.createElement(TreeItemToggle, {
|
|
785
786
|
isBranch,
|
|
786
787
|
open,
|
|
787
|
-
|
|
788
|
+
onClick: handleOpenToggle
|
|
788
789
|
}), /* @__PURE__ */ React7.createElement(TreeItemHeading, {
|
|
789
|
-
ref: buttonRef,
|
|
790
|
-
label,
|
|
791
|
-
icon,
|
|
792
|
-
className: headingClassName,
|
|
793
790
|
disabled,
|
|
794
791
|
current,
|
|
795
|
-
|
|
792
|
+
label,
|
|
793
|
+
className: headingClassName,
|
|
794
|
+
icon,
|
|
795
|
+
iconHue,
|
|
796
|
+
onSelect: handleSelect,
|
|
797
|
+
ref: buttonRef
|
|
796
798
|
})), Columns && /* @__PURE__ */ React7.createElement(Columns, {
|
|
797
799
|
item,
|
|
798
800
|
path,
|
|
@@ -810,6 +812,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
810
812
|
draggable: _draggable,
|
|
811
813
|
renderColumns: Columns,
|
|
812
814
|
canDrop,
|
|
815
|
+
canSelect,
|
|
813
816
|
onOpenChange,
|
|
814
817
|
onSelect
|
|
815
818
|
})));
|
|
@@ -820,7 +823,7 @@ var RawTreeItem = ({ item, path: _path, last, draggable: _draggable, renderColum
|
|
|
820
823
|
var TreeItem = /* @__PURE__ */ memo3(RawTreeItem);
|
|
821
824
|
|
|
822
825
|
// 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 }) => {
|
|
826
|
+
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
827
|
var _effect = _useSignals8();
|
|
825
828
|
try {
|
|
826
829
|
const context = useMemo2(() => ({
|
|
@@ -858,6 +861,7 @@ var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable:
|
|
|
858
861
|
draggable: draggable3,
|
|
859
862
|
renderColumns,
|
|
860
863
|
canDrop,
|
|
864
|
+
canSelect,
|
|
861
865
|
onOpenChange,
|
|
862
866
|
onSelect
|
|
863
867
|
}))));
|