@neo4j-ndl/react 4.9.32 → 4.9.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/lib/cjs/popover/Popover.js.map +1 -1
  2. package/lib/cjs/popover/use-popover.js +8 -7
  3. package/lib/cjs/popover/use-popover.js.map +1 -1
  4. package/lib/cjs/tree-view/TreeItemWrapper.js +3 -3
  5. package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
  6. package/lib/cjs/tree-view/TreeView.js +34 -6
  7. package/lib/cjs/tree-view/TreeView.js.map +1 -1
  8. package/lib/cjs/tree-view/TreeViewItem.js +2 -2
  9. package/lib/cjs/tree-view/TreeViewItem.js.map +1 -1
  10. package/lib/cjs/tree-view/TreeViewTextItem.js +1 -1
  11. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  12. package/lib/cjs/tree-view/stories/treeview-default.story.js +9 -9
  13. package/lib/cjs/tree-view/stories/treeview-default.story.js.map +1 -1
  14. package/lib/cjs/tree-view/tree-view-types.js.map +1 -1
  15. package/lib/esm/popover/Popover.js.map +1 -1
  16. package/lib/esm/popover/use-popover.js +8 -7
  17. package/lib/esm/popover/use-popover.js.map +1 -1
  18. package/lib/esm/tree-view/TreeItemWrapper.js +3 -3
  19. package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
  20. package/lib/esm/tree-view/TreeView.js +34 -6
  21. package/lib/esm/tree-view/TreeView.js.map +1 -1
  22. package/lib/esm/tree-view/TreeViewItem.js +2 -2
  23. package/lib/esm/tree-view/TreeViewItem.js.map +1 -1
  24. package/lib/esm/tree-view/TreeViewTextItem.js +1 -1
  25. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  26. package/lib/esm/tree-view/stories/treeview-default.story.js +9 -9
  27. package/lib/esm/tree-view/stories/treeview-default.story.js.map +1 -1
  28. package/lib/esm/tree-view/tree-view-types.js.map +1 -1
  29. package/lib/types/popover/Popover.d.ts +3 -1
  30. package/lib/types/popover/Popover.d.ts.map +1 -1
  31. package/lib/types/tree-view/TreeItemWrapper.d.ts +1 -1
  32. package/lib/types/tree-view/TreeItemWrapper.d.ts.map +1 -1
  33. package/lib/types/tree-view/TreeView.d.ts +6 -3
  34. package/lib/types/tree-view/TreeView.d.ts.map +1 -1
  35. package/lib/types/tree-view/TreeViewItem.d.ts +4 -1
  36. package/lib/types/tree-view/TreeViewItem.d.ts.map +1 -1
  37. package/lib/types/tree-view/TreeViewTextItem.d.ts.map +1 -1
  38. package/lib/types/tree-view/tree-view-types.d.ts +3 -0
  39. package/lib/types/tree-view/tree-view-types.d.ts.map +1 -1
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../src/tree-view/TreeView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAEL,aAAa,EACb,oBAAoB,EACpB,UAAU,EAIV,WAAW,EAGX,cAAc,EACd,iBAAiB,EACjB,aAAa,EAEb,SAAS,EACT,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,eAAe,EACf,2BAA2B,GAC5B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AAOnF,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,EACb,gBAAgB,EAEhB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,g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CAAC,EAAE,CAAC,EACvC,oBAAoB,EAAE,IAAI,CAAC,UAAU,KAAK,KAAK,IAvB1C,IAAI,CAAC,EAAE,CAwBZ,CACH,CAAA;qBAAA,CAAC,IACC,EAEJ,YAAY,CACX,KAAC,WAAW,IAAC,aAAa,EAAE,mBAAmB,GAAgB,EAC/D,QAAQ,CAAC,IAAI,CACd,IACe,GACP,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,oBAAoB;IACpB,eAAe;IACf,gBAAgB;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type Announcements,\n closestCenter,\n defaultDropAnimation,\n DndContext,\n type DragEndEvent,\n type DragMoveEvent,\n type DragOverEvent,\n DragOverlay,\n type DragStartEvent,\n type DropAnimation,\n KeyboardSensor,\n MeasuringStrategy,\n PointerSensor,\n type UniqueIdentifier,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n arrayMove,\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\nimport type React from 'react';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { type HtmlAttributes } from '../_common/types';\nimport { sortableTreeKeyboardCoordinates } from './tree-view-keyboard-coordinates';\nimport {\n type FlattenedTreeItem,\n type ItemChangedReason,\n type TreeItem,\n type TreeItemComponent,\n} from './tree-view-types';\nimport {\n buildTree,\n flattenTree,\n getProjection,\n removeChildrenOf,\n type SensorContext,\n transformToString,\n} from './tree-view-utils';\nimport { TreeItemWrapper } from './TreeItemWrapper';\nimport { SortableTreeViewItem } from './TreeViewItem';\nimport { TreeViewTextItem } from './TreeViewTextItem';\n\nconst indentationWidth = 20;\nconst ACTIVE_PLACEHOLDER_ID = 'ndl-active-tree-item';\n\nconst dropAnimationConfig: DropAnimation = {\n easing: 'ease-out',\n keyframes({ transform }) {\n return [\n {\n opacity: 1,\n transform: transformToString(transform.initial),\n },\n {\n opacity: 0,\n transform: transformToString({\n ...transform.final,\n y: transform.final.y + 5,\n x: transform.final.x + 5,\n }),\n },\n ];\n },\n sideEffects({ active }) {\n active.node.animate([{ opacity: 0 }, { opacity: 1 }], {\n duration: defaultDropAnimation.duration,\n easing: defaultDropAnimation.easing,\n });\n },\n};\n\nexport interface TreeViewProps<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n> extends React.HTMLAttributes<HTMLOListElement> {\n /** The items to be displayed in the tree view */\n items: TreeItem<T>[];\n /** A function that is called when the items in the tree view change */\n onItemsChanged: (\n newItems: TreeItem<T>[],\n itemChangedReason: ItemChangedReason<T>,\n ) => void;\n /** The component to use for the tree items, if not provided the default component will be used */\n TreeItemComponent?: TreeItemComponent<T, E>;\n /** HTML attributes */\n htmlAttributes?: HtmlAttributes<'ol'>;\n}\n\nconst TreeViewComponent = function TreeView<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n>({\n items,\n TreeItemComponent,\n onItemsChanged,\n htmlAttributes,\n}: TreeViewProps<T, E>) {\n const flattenItems = useMemo(() => flattenTree(items), [items]);\n const [activeId, setActiveId] = useState<UniqueIdentifier | null>(null);\n const [overId, setOverId] = useState<UniqueIdentifier | null>(null);\n const [focusedRowId, setFocusedRowId] = useState<UniqueIdentifier | null>(\n null,\n );\n\n const [currentPosition, setCurrentPosition] = useState<{\n parentId: UniqueIdentifier | null;\n overId: UniqueIdentifier;\n } | null>(null);\n const [offsetLeft, setOffsetLeft] = useState(0);\n\n /* ------------------------------ Setup of Data ------------------------------ */\n\n const flattenedAndRemovedCollapsedItems = useMemo(() => {\n const collapsedItemsIds = flattenItems\n .filter((item) => item.canHaveSubItems && item.isCollapsed)\n .map((item) => item.id);\n\n return removeChildrenOf(\n [...flattenItems],\n activeId !== null ? [activeId, ...collapsedItemsIds] : collapsedItemsIds,\n );\n }, [activeId, flattenItems]);\n\n const activeItem = useMemo(\n () => (activeId ? flattenItems.find(({ id }) => id === activeId) : null),\n [activeId, flattenItems],\n );\n\n const flattenedAndRemovedCollapsedItemsWithActive = useMemo(() => {\n const collapsedItems = flattenItems.reduce<UniqueIdentifier[]>(\n (acc, item) => {\n if (item.canHaveSubItems && item.isCollapsed) {\n return [...acc, item.id];\n }\n return acc;\n },\n [],\n );\n\n const ItemsWithCollapsedRemoved = removeChildrenOf(\n flattenItems,\n activeId ? [activeId, ...collapsedItems] : collapsedItems,\n );\n const newArray: FlattenedTreeItem<T>[] = [];\n for (const item of ItemsWithCollapsedRemoved) {\n newArray.push(item);\n if (item.id === activeId) {\n newArray.push({\n ...item,\n id: ACTIVE_PLACEHOLDER_ID,\n });\n }\n }\n\n return newArray;\n }, [flattenItems, activeId]);\n\n if (activeItem?.canHaveSubItems && !activeItem?.isCollapsed) {\n flattenedAndRemovedCollapsedItems.push({\n ...activeItem,\n id: ACTIVE_PLACEHOLDER_ID,\n });\n }\n\n const sensorContext: SensorContext<T> = useRef({\n items: flattenedAndRemovedCollapsedItemsWithActive,\n offset: offsetLeft,\n });\n\n const coordinateGetter = useMemo(() => {\n sensorContext.current.items = flattenedAndRemovedCollapsedItemsWithActive;\n sensorContext.current.offset = offsetLeft;\n\n return sortableTreeKeyboardCoordinates<T>(\n sensorContext,\n true,\n indentationWidth,\n );\n }, [flattenedAndRemovedCollapsedItemsWithActive, offsetLeft]);\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: coordinateGetter,\n }),\n );\n\n const projected = useMemo(\n () =>\n activeId && overId\n ? getProjection(\n flattenedAndRemovedCollapsedItemsWithActive,\n activeId,\n overId,\n offsetLeft,\n indentationWidth,\n )\n : null,\n [activeId, overId, flattenedAndRemovedCollapsedItemsWithActive, offsetLeft],\n );\n /* ------------------------------ Handlers ------------------------------ */\n function handleDragStart({ active }: DragStartEvent) {\n const activeId = active.id;\n setActiveId(activeId);\n setOverId(activeId);\n\n const activeItem = flattenItems.find(({ id }) => id === activeId);\n if (activeItem) {\n setCurrentPosition({\n overId: activeId,\n parentId: activeItem.parentId,\n });\n }\n\n document.body.style.setProperty('cursor', 'grabbing');\n }\n\n function handleDragMove({ delta }: DragMoveEvent) {\n setOffsetLeft(delta.x);\n }\n\n function handleDragOver({ over }: DragOverEvent) {\n setOverId(over?.id ?? null);\n }\n\n function resetState() {\n setOverId(null);\n setActiveId(null);\n setOffsetLeft(0);\n setCurrentPosition(null);\n\n document.body.style.setProperty('cursor', '');\n }\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n resetState();\n let overIndex = flattenItems.findIndex((item) => item.id === over?.id);\n\n if (over?.id === ACTIVE_PLACEHOLDER_ID) {\n overIndex = flattenItems.findIndex((item) => item.id === active.id);\n }\n if (projected && over) {\n const { depth, parentId } = projected;\n const clonedItems: FlattenedTreeItem<T>[] = [...flattenItems];\n\n const parentIndex = clonedItems.findIndex(\n (item) => item.id === parentId,\n );\n const activeIndex = clonedItems.findIndex(({ id }) => id === active.id);\n const activeTreeItem = clonedItems[activeIndex];\n\n clonedItems[activeIndex] = { ...activeTreeItem, depth, parentId };\n const parentItem = clonedItems[parentIndex];\n if (parentItem && parentItem.canHaveSubItems) {\n clonedItems[parentIndex] = { ...parentItem, isCollapsed: false };\n }\n const newItems = buildTree(\n arrayMove(clonedItems, activeIndex, overIndex),\n );\n\n onItemsChanged(newItems, {\n item: activeTreeItem,\n reason: 'dropped',\n });\n }\n },\n [flattenItems, onItemsChanged, projected],\n );\n\n function handleToggleCollapse(id: UniqueIdentifier) {\n const item = flattenItems.find((item) => item.id === id);\n if (!item || item.canHaveSubItems !== true) {\n return;\n }\n\n onItemsChanged(\n buildTree(\n flattenItems.map((item) => {\n if (item.id === id && item.canHaveSubItems === true) {\n return { ...item, isCollapsed: !item.isCollapsed };\n }\n return item;\n }),\n ),\n {\n item,\n reason: item.isCollapsed ? 'expanded' : 'collapsed',\n },\n );\n }\n\n function handleDragCancel() {\n resetState();\n }\n\n /* ------------------------------ Keyboard functions ------------------------------ */\n const getMovementAnnouncement = (\n eventName: string,\n activeId: UniqueIdentifier,\n overId?: UniqueIdentifier,\n ) => {\n if (overId && projected) {\n if (eventName !== 'onDragEnd') {\n if (\n currentPosition &&\n projected.parentId === currentPosition.parentId &&\n overId === currentPosition.overId\n ) {\n return;\n } else {\n setCurrentPosition({\n overId,\n parentId: projected.parentId,\n });\n }\n }\n\n const clonedItems: FlattenedTreeItem<T>[] = [\n ...flattenedAndRemovedCollapsedItemsWithActive,\n ];\n const overIndex = clonedItems.findIndex(({ id }) => id === overId);\n const activeIndex = clonedItems.findIndex(({ id }) => id === activeId);\n const sortedItems = arrayMove(clonedItems, activeIndex, overIndex);\n\n const previousItem = sortedItems[overIndex - 1];\n\n let announcement;\n const movedVerb = eventName === 'onDragEnd' ? 'dropped' : 'moved';\n const nestedVerb = eventName === 'onDragEnd' ? 'dropped' : 'nested';\n\n if (!previousItem) {\n const nextItem = sortedItems[overIndex + 1];\n announcement = `${activeId} was ${movedVerb} before ${nextItem.id}.`;\n } else {\n if (projected.depth > previousItem.depth) {\n announcement = `${activeId} was ${nestedVerb} under ${previousItem.id}.`;\n } else {\n let previousSibling: FlattenedTreeItem<T> | undefined = previousItem;\n while (previousSibling && projected.depth < previousSibling.depth) {\n const parentId: UniqueIdentifier | null = previousSibling.parentId;\n previousSibling = sortedItems.find(({ id }) => id === parentId);\n }\n\n if (previousSibling) {\n announcement = `${activeId} was ${movedVerb} after ${previousSibling.id}.`;\n }\n }\n }\n\n return announcement;\n }\n\n return;\n };\n\n const announcements: Announcements = {\n onDragCancel({ active }) {\n return `Moving was cancelled. ${active.id} was dropped in its original position.`;\n },\n onDragEnd({ active, over }) {\n return getMovementAnnouncement('onDragEnd', active.id, over?.id);\n },\n onDragMove({ active, over }) {\n return getMovementAnnouncement('onDragMove', active.id, over?.id);\n },\n onDragOver({ active, over }) {\n return getMovementAnnouncement('onDragOver', active.id, over?.id);\n },\n onDragStart({ active }) {\n return `Picked up ${active.id}.`;\n },\n };\n /* ------------------------------ Visual ------------------------------ */\n function getTrailList() {\n const trails: Record<\n UniqueIdentifier,\n ('none' | 'straight' | 'straight-curved' | 'curved')[]\n > = {};\n // Loop through the items in reverse\n [...flattenedAndRemovedCollapsedItemsWithActive]\n .reverse()\n .forEach((item, itemIndex, reversedList) => {\n const trailList: (\n | 'none'\n | 'straight'\n | 'straight-curved'\n | 'curved'\n )[] = [];\n const nextItem = reversedList[itemIndex - 1];\n // Loop through the depth of the item\n\n for (let trailDepth = 0; trailDepth < item.depth; trailDepth++) {\n // Not closest to the item so should be straight or none\n if (trailDepth < item.depth - 1) {\n if (nextItem === undefined) {\n trailList.push('none');\n continue;\n } else if (trails[nextItem?.id][trailDepth] === 'none') {\n trailList.push('none');\n continue;\n } else if (nextItem && nextItem.depth <= trailDepth) {\n trailList.push('none');\n continue;\n }\n trailList.push('straight');\n } else {\n if (\n (nextItem && trails[nextItem?.id][trailDepth] === 'none') ||\n nextItem === undefined ||\n nextItem.depth <= trailDepth\n ) {\n trailList.push('curved');\n } else {\n trailList.push('straight-curved');\n }\n }\n }\n trails[item.id] = trailList;\n });\n return trails;\n }\n\n const measuring = {\n droppable: {\n strategy: MeasuringStrategy.Always,\n },\n };\n\n const trails = getTrailList();\n const rowIdWithFocus =\n focusedRowId ?? flattenedAndRemovedCollapsedItemsWithActive[0]?.id;\n return (\n <DndContext\n accessibility={{ announcements }}\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n onDragStart={handleDragStart}\n onDragMove={handleDragMove}\n onDragOver={handleDragOver}\n onDragCancel={handleDragCancel}\n measuring={measuring}\n >\n <SortableContext\n items={flattenedAndRemovedCollapsedItemsWithActive.map(\n (item) => item.id,\n )}\n strategy={verticalListSortingStrategy}\n >\n <ol className=\"ndl-tree-view-list\" role=\"tree\" {...htmlAttributes}>\n {flattenedAndRemovedCollapsedItemsWithActive.map((item) => (\n <SortableTreeViewItem<T, E>\n key={item.id}\n depth={\n item.id === activeId && projected ? projected.depth : item.depth\n }\n indentationWidth={indentationWidth}\n item={item}\n isLast={false}\n parent={flattenItems.find((i) => i.id === item.parentId) ?? null}\n id={item.id}\n trails={trails[item.id]}\n keepGhostInPlace={item.id === ACTIVE_PLACEHOLDER_ID}\n TreeItemComponent={\n TreeItemComponent === undefined\n ? (TreeViewTextItem as TreeItemComponent<T, E>)\n : TreeItemComponent\n }\n onCollapse={() => handleToggleCollapse(item.id)}\n onItemsChanged={(newItems, itemChangedReason) =>\n onItemsChanged(buildTree(newItems), itemChangedReason)\n }\n items={flattenItems}\n tabIndex={item.id === rowIdWithFocus ? 0 : -1}\n onFocus={() => setFocusedRowId(item.id)}\n shouldDisableSorting={item.isSortable === false}\n />\n ))}\n </ol>\n {/* Portal is used to show the item the user drags */}\n {createPortal(\n <DragOverlay dropAnimation={dropAnimationConfig}></DragOverlay>,\n document.body,\n )}\n </SortableContext>\n </DndContext>\n );\n};\n\nconst TreeViewComponents = {\n SortableTreeViewItem,\n TreeItemWrapper,\n TreeViewTextItem,\n};\n\nexport const TreeView = Object.assign(TreeViewComponent, TreeViewComponents);\n"]}
1
+ {"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../src/tree-view/TreeView.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAE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MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type Announcements,\n closestCenter,\n defaultDropAnimation,\n DndContext,\n type DragEndEvent,\n type DragMoveEvent,\n type DragOverEvent,\n DragOverlay,\n type DragStartEvent,\n type DropAnimation,\n KeyboardSensor,\n MeasuringStrategy,\n PointerSensor,\n type UniqueIdentifier,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n arrayMove,\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\nimport type React from 'react';\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { type HtmlAttributes } from '../_common/types';\nimport { sortableTreeKeyboardCoordinates } from './tree-view-keyboard-coordinates';\nimport {\n type FlattenedTreeItem,\n type ItemChangedReason,\n type TreeItem,\n type TreeItemComponent,\n} from './tree-view-types';\nimport {\n buildTree,\n flattenTree,\n getProjection,\n removeChildrenOf,\n type SensorContext,\n transformToString,\n} from './tree-view-utils';\nimport { TreeItemWrapper } from './TreeItemWrapper';\nimport { SortableTreeViewItem } from './TreeViewItem';\nimport { TreeViewTextItem } from './TreeViewTextItem';\n\nconst indentationWidth = 20;\nconst ACTIVE_PLACEHOLDER_ID = 'ndl-active-tree-item';\n\nconst dropAnimationConfig: DropAnimation = {\n easing: 'ease-out',\n keyframes({ transform }) {\n return [\n {\n opacity: 1,\n transform: transformToString(transform.initial),\n },\n {\n opacity: 0,\n transform: transformToString({\n ...transform.final,\n y: transform.final.y + 5,\n x: transform.final.x + 5,\n }),\n },\n ];\n },\n sideEffects({ active }) {\n active.node.animate([{ opacity: 0 }, { opacity: 1 }], {\n duration: defaultDropAnimation.duration,\n easing: defaultDropAnimation.easing,\n });\n },\n};\n\nexport interface TreeViewProps<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n> extends React.HTMLAttributes<HTMLOListElement> {\n /** The items to be displayed in the tree view */\n items: TreeItem<T>[];\n /** A function that is called when the items in the tree view change */\n onItemsChanged: (\n newItems: TreeItem<T>[],\n itemChangedReason: ItemChangedReason<T>,\n ) => void;\n /** The component to use for the tree items, if not provided the default component will be used */\n TreeItemComponent?: TreeItemComponent<T, E>;\n /** HTML attributes */\n htmlAttributes?: HtmlAttributes<'ol'>;\n}\n\nconst TreeViewComponent = function TreeView<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n>({\n items,\n TreeItemComponent,\n onItemsChanged,\n htmlAttributes,\n ...restProps\n}: TreeViewProps<T, E>) {\n const flattenItems = useMemo(() => flattenTree(items), [items]);\n const [activeId, setActiveId] = useState<UniqueIdentifier | null>(null);\n const [overId, setOverId] = useState<UniqueIdentifier | null>(null);\n const [focusedRowId, setFocusedRowId] = useState<UniqueIdentifier | null>(\n null,\n );\n\n const [currentPosition, setCurrentPosition] = useState<{\n parentId: UniqueIdentifier | null;\n overId: UniqueIdentifier;\n } | null>(null);\n const [offsetLeft, setOffsetLeft] = useState(0);\n\n /* ------------------------------ Setup of Data ------------------------------ */\n\n const flattenedAndRemovedCollapsedItems = useMemo(() => {\n const collapsedItemsIds = flattenItems\n .filter((item) => item.canHaveSubItems && item.isCollapsed)\n .map((item) => item.id);\n\n return removeChildrenOf(\n [...flattenItems],\n activeId !== null ? [activeId, ...collapsedItemsIds] : collapsedItemsIds,\n );\n }, [activeId, flattenItems]);\n\n const activeItem = useMemo(\n () => (activeId ? flattenItems.find(({ id }) => id === activeId) : null),\n [activeId, flattenItems],\n );\n\n const flattenedAndRemovedCollapsedItemsWithActive = useMemo(() => {\n const collapsedItems = flattenItems.reduce<UniqueIdentifier[]>(\n (acc, item) => {\n if (item.canHaveSubItems && item.isCollapsed) {\n return [...acc, item.id];\n }\n return acc;\n },\n [],\n );\n\n const ItemsWithCollapsedRemoved = removeChildrenOf(\n flattenItems,\n activeId ? [activeId, ...collapsedItems] : collapsedItems,\n );\n const newArray: FlattenedTreeItem<T>[] = [];\n for (const item of ItemsWithCollapsedRemoved) {\n newArray.push(item);\n if (item.id === activeId) {\n newArray.push({\n ...item,\n id: ACTIVE_PLACEHOLDER_ID,\n });\n }\n }\n\n return newArray;\n }, [flattenItems, activeId]);\n\n if (activeItem?.canHaveSubItems && !activeItem?.isCollapsed) {\n flattenedAndRemovedCollapsedItems.push({\n ...activeItem,\n id: ACTIVE_PLACEHOLDER_ID,\n });\n }\n\n const sensorContext: SensorContext<T> = useRef({\n items: flattenedAndRemovedCollapsedItemsWithActive,\n offset: offsetLeft,\n });\n\n const coordinateGetter = useMemo(() => {\n sensorContext.current.items = flattenedAndRemovedCollapsedItemsWithActive;\n sensorContext.current.offset = offsetLeft;\n\n return sortableTreeKeyboardCoordinates<T>(\n sensorContext,\n true,\n indentationWidth,\n );\n }, [flattenedAndRemovedCollapsedItemsWithActive, offsetLeft]);\n\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: coordinateGetter,\n }),\n );\n\n const projected = useMemo(\n () =>\n activeId && overId\n ? getProjection(\n flattenedAndRemovedCollapsedItemsWithActive,\n activeId,\n overId,\n offsetLeft,\n indentationWidth,\n )\n : null,\n [activeId, overId, flattenedAndRemovedCollapsedItemsWithActive, offsetLeft],\n );\n\n const hasSelectableItems = useMemo(\n () => flattenItems.some((item) => item.isSelected !== undefined),\n [flattenItems],\n );\n\n const itemAriaData = useMemo(() => {\n const visibleItems = flattenedAndRemovedCollapsedItemsWithActive.filter(\n (item) => item.id !== ACTIVE_PLACEHOLDER_ID,\n );\n\n return visibleItems.reduce<\n Record<UniqueIdentifier, { posInSet: number; setSize: number }>\n >((acc, item) => {\n const siblings = visibleItems.filter(\n (sibling) => sibling.parentId === item.parentId,\n );\n\n acc[item.id] = {\n posInSet: siblings.findIndex((sibling) => sibling.id === item.id) + 1,\n setSize: siblings.length,\n };\n\n return acc;\n }, {});\n }, [flattenedAndRemovedCollapsedItemsWithActive]);\n\n /* ------------------------------ Handlers ------------------------------ */\n function handleDragStart({ active }: DragStartEvent) {\n const activeId = active.id;\n setActiveId(activeId);\n setOverId(activeId);\n\n const activeItem = flattenItems.find(({ id }) => id === activeId);\n if (activeItem) {\n setCurrentPosition({\n overId: activeId,\n parentId: activeItem.parentId,\n });\n }\n\n document.body.style.setProperty('cursor', 'grabbing');\n }\n\n function handleDragMove({ delta }: DragMoveEvent) {\n setOffsetLeft(delta.x);\n }\n\n function handleDragOver({ over }: DragOverEvent) {\n setOverId(over?.id ?? null);\n }\n\n function resetState() {\n setOverId(null);\n setActiveId(null);\n setOffsetLeft(0);\n setCurrentPosition(null);\n\n document.body.style.setProperty('cursor', '');\n }\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n resetState();\n let overIndex = flattenItems.findIndex((item) => item.id === over?.id);\n\n if (over?.id === ACTIVE_PLACEHOLDER_ID) {\n overIndex = flattenItems.findIndex((item) => item.id === active.id);\n }\n if (projected && over) {\n const { depth, parentId } = projected;\n const clonedItems: FlattenedTreeItem<T>[] = [...flattenItems];\n\n const parentIndex = clonedItems.findIndex(\n (item) => item.id === parentId,\n );\n const activeIndex = clonedItems.findIndex(({ id }) => id === active.id);\n const activeTreeItem = clonedItems[activeIndex];\n\n clonedItems[activeIndex] = { ...activeTreeItem, depth, parentId };\n const parentItem = clonedItems[parentIndex];\n if (parentItem && parentItem.canHaveSubItems) {\n clonedItems[parentIndex] = { ...parentItem, isCollapsed: false };\n }\n const newItems = buildTree(\n arrayMove(clonedItems, activeIndex, overIndex),\n );\n\n onItemsChanged(newItems, {\n item: activeTreeItem,\n reason: 'dropped',\n });\n }\n },\n [flattenItems, onItemsChanged, projected],\n );\n\n function handleToggleCollapse(id: UniqueIdentifier) {\n const item = flattenItems.find((item) => item.id === id);\n if (!item || item.canHaveSubItems !== true) {\n return;\n }\n\n onItemsChanged(\n buildTree(\n flattenItems.map((item) => {\n if (item.id === id && item.canHaveSubItems === true) {\n return { ...item, isCollapsed: !item.isCollapsed };\n }\n return item;\n }),\n ),\n {\n item,\n reason: item.isCollapsed ? 'expanded' : 'collapsed',\n },\n );\n }\n\n function handleDragCancel() {\n resetState();\n }\n\n /* ------------------------------ Keyboard functions ------------------------------ */\n const getMovementAnnouncement = (\n eventName: string,\n activeId: UniqueIdentifier,\n overId?: UniqueIdentifier,\n ) => {\n if (overId && projected) {\n if (eventName !== 'onDragEnd') {\n if (\n currentPosition &&\n projected.parentId === currentPosition.parentId &&\n overId === currentPosition.overId\n ) {\n return;\n } else {\n setCurrentPosition({\n overId,\n parentId: projected.parentId,\n });\n }\n }\n\n const clonedItems: FlattenedTreeItem<T>[] = [\n ...flattenedAndRemovedCollapsedItemsWithActive,\n ];\n const overIndex = clonedItems.findIndex(({ id }) => id === overId);\n const activeIndex = clonedItems.findIndex(({ id }) => id === activeId);\n const sortedItems = arrayMove(clonedItems, activeIndex, overIndex);\n\n const previousItem = sortedItems[overIndex - 1];\n\n let announcement;\n const movedVerb = eventName === 'onDragEnd' ? 'dropped' : 'moved';\n const nestedVerb = eventName === 'onDragEnd' ? 'dropped' : 'nested';\n\n if (!previousItem) {\n const nextItem = sortedItems[overIndex + 1];\n announcement = `${activeId} was ${movedVerb} before ${nextItem.id}.`;\n } else {\n if (projected.depth > previousItem.depth) {\n announcement = `${activeId} was ${nestedVerb} under ${previousItem.id}.`;\n } else {\n let previousSibling: FlattenedTreeItem<T> | undefined = previousItem;\n while (previousSibling && projected.depth < previousSibling.depth) {\n const parentId: UniqueIdentifier | null = previousSibling.parentId;\n previousSibling = sortedItems.find(({ id }) => id === parentId);\n }\n\n if (previousSibling) {\n announcement = `${activeId} was ${movedVerb} after ${previousSibling.id}.`;\n }\n }\n }\n\n return announcement;\n }\n\n return;\n };\n\n const announcements: Announcements = {\n onDragCancel({ active }) {\n return `Moving was cancelled. ${active.id} was dropped in its original position.`;\n },\n onDragEnd({ active, over }) {\n return getMovementAnnouncement('onDragEnd', active.id, over?.id);\n },\n onDragMove({ active, over }) {\n return getMovementAnnouncement('onDragMove', active.id, over?.id);\n },\n onDragOver({ active, over }) {\n return getMovementAnnouncement('onDragOver', active.id, over?.id);\n },\n onDragStart({ active }) {\n return `Picked up ${active.id}.`;\n },\n };\n /* ------------------------------ Visual ------------------------------ */\n function getTrailList() {\n const trails: Record<\n UniqueIdentifier,\n ('none' | 'straight' | 'straight-curved' | 'curved')[]\n > = {};\n // Loop through the items in reverse\n [...flattenedAndRemovedCollapsedItemsWithActive]\n .reverse()\n .forEach((item, itemIndex, reversedList) => {\n const trailList: (\n | 'none'\n | 'straight'\n | 'straight-curved'\n | 'curved'\n )[] = [];\n const nextItem = reversedList[itemIndex - 1];\n // Loop through the depth of the item\n\n for (let trailDepth = 0; trailDepth < item.depth; trailDepth++) {\n // Not closest to the item so should be straight or none\n if (trailDepth < item.depth - 1) {\n if (nextItem === undefined) {\n trailList.push('none');\n continue;\n } else if (trails[nextItem?.id][trailDepth] === 'none') {\n trailList.push('none');\n continue;\n } else if (nextItem && nextItem.depth <= trailDepth) {\n trailList.push('none');\n continue;\n }\n trailList.push('straight');\n } else {\n if (\n (nextItem && trails[nextItem?.id][trailDepth] === 'none') ||\n nextItem === undefined ||\n nextItem.depth <= trailDepth\n ) {\n trailList.push('curved');\n } else {\n trailList.push('straight-curved');\n }\n }\n }\n trails[item.id] = trailList;\n });\n return trails;\n }\n\n const measuring = {\n droppable: {\n strategy: MeasuringStrategy.Always,\n },\n };\n\n const trails = getTrailList();\n const rowIdWithFocus =\n focusedRowId ?? flattenedAndRemovedCollapsedItemsWithActive[0]?.id;\n return (\n <DndContext\n accessibility={{ announcements }}\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n onDragStart={handleDragStart}\n onDragMove={handleDragMove}\n onDragOver={handleDragOver}\n onDragCancel={handleDragCancel}\n measuring={measuring}\n >\n <SortableContext\n items={flattenedAndRemovedCollapsedItemsWithActive.map(\n (item) => item.id,\n )}\n strategy={verticalListSortingStrategy}\n >\n <ol\n className=\"ndl-tree-view-list\"\n role=\"tree\"\n aria-multiselectable={hasSelectableItems ? true : undefined}\n {...restProps}\n {...htmlAttributes}\n >\n {flattenedAndRemovedCollapsedItemsWithActive.map((item) => (\n <SortableTreeViewItem<T, E>\n key={item.id}\n depth={\n item.id === activeId && projected ? projected.depth : item.depth\n }\n indentationWidth={indentationWidth}\n item={item}\n isLast={false}\n parent={flattenItems.find((i) => i.id === item.parentId) ?? null}\n id={item.id}\n trails={trails[item.id]}\n keepGhostInPlace={item.id === ACTIVE_PLACEHOLDER_ID}\n TreeItemComponent={\n TreeItemComponent === undefined\n ? (TreeViewTextItem as TreeItemComponent<T, E>)\n : TreeItemComponent\n }\n onCollapse={() => handleToggleCollapse(item.id)}\n onItemsChanged={(newItems, itemChangedReason) =>\n onItemsChanged(buildTree(newItems), itemChangedReason)\n }\n items={flattenItems}\n ariaLevel={\n item.id === ACTIVE_PLACEHOLDER_ID ? undefined : item.depth + 1\n }\n ariaPosInSet={\n item.id === ACTIVE_PLACEHOLDER_ID\n ? undefined\n : itemAriaData[item.id]?.posInSet\n }\n ariaSetSize={\n item.id === ACTIVE_PLACEHOLDER_ID\n ? undefined\n : itemAriaData[item.id]?.setSize\n }\n tabIndex={item.id === rowIdWithFocus ? 0 : -1}\n onFocus={() => setFocusedRowId(item.id)}\n shouldDisableSorting={item.isSortable === false}\n />\n ))}\n </ol>\n {/* Portal is used to show the item the user drags */}\n {createPortal(\n <DragOverlay dropAnimation={dropAnimationConfig}></DragOverlay>,\n document.body,\n )}\n </SortableContext>\n </DndContext>\n );\n};\n\nconst TreeViewComponents = {\n SortableTreeViewItem,\n TreeItemWrapper,\n TreeViewTextItem,\n};\n\nexport const TreeView = Object.assign(TreeViewComponent, TreeViewComponents);\n"]}
@@ -39,7 +39,7 @@ const SortableTreeViewItemNotMemoized = function SortableTreeViewItem(_a) {
39
39
  var { id, depth, isLast, TreeItemComponent, parent, shouldDisableSorting,
40
40
  // need to destruct to avoid passing it to the component
41
41
  // oxlint-disable-next-line no-unused-vars
42
- sortableProps, keepGhostInPlace, item, onCollapse, trails, onItemsChanged, items, tabIndex, onFocus } = _a, restProps = __rest(_a, ["id", "depth", "isLast", "TreeItemComponent", "parent", "shouldDisableSorting", "sortableProps", "keepGhostInPlace", "item", "onCollapse", "trails", "onItemsChanged", "items", "tabIndex", "onFocus"]);
42
+ sortableProps, keepGhostInPlace, item, onCollapse, trails, onItemsChanged, items, ariaLevel, ariaPosInSet, ariaSetSize, tabIndex, onFocus } = _a, restProps = __rest(_a, ["id", "depth", "isLast", "TreeItemComponent", "parent", "shouldDisableSorting", "sortableProps", "keepGhostInPlace", "item", "onCollapse", "trails", "onItemsChanged", "items", "ariaLevel", "ariaPosInSet", "ariaSetSize", "tabIndex", "onFocus"]);
43
43
  const { attributes, listeners, setNodeRef, transform, setActivatorNodeRef, transition, isDragging, isSorting, isOver, } = useSortable({
44
44
  animateLayoutChanges,
45
45
  id: id,
@@ -58,7 +58,7 @@ const SortableTreeViewItemNotMemoized = function SortableTreeViewItem(_a) {
58
58
  }
59
59
  return () => onCollapse === null || onCollapse === void 0 ? void 0 : onCollapse(item.id);
60
60
  }, [item.id, onCollapse]);
61
- return (_jsx(TreeItemComponent, Object.assign({ item: item, isOverParent: false }, restProps, { setActivatorNodeRef: setActivatorNodeRef, setNodeRef: setNodeRef, style: style, depth: depth, isGhost: keepGhostInPlace, shouldDisableInteraction: isSorting, isLastInParent: isLast, parent: parent, dragHandleProps: Object.assign(Object.assign({}, attributes), listeners), isIndicator: isDragging, onCollapse: localCollapse, onItemsChanged: onItemsChanged, items: items, shouldDisableSorting: shouldDisableSorting, isOver: isOver, trails: trails, tabIndex: tabIndex, onFocus: onFocus })));
61
+ return (_jsx(TreeItemComponent, Object.assign({ item: item, isOverParent: false }, restProps, { setActivatorNodeRef: setActivatorNodeRef, setNodeRef: setNodeRef, style: style, depth: depth, isGhost: keepGhostInPlace, shouldDisableInteraction: isSorting, isLastInParent: isLast, parent: parent, dragHandleProps: Object.assign(Object.assign({}, attributes), listeners), isIndicator: isDragging, onCollapse: localCollapse, onItemsChanged: onItemsChanged, items: items, ariaLevel: ariaLevel, ariaPosInSet: ariaPosInSet, ariaSetSize: ariaSetSize, shouldDisableSorting: shouldDisableSorting, isOver: isOver, trails: trails, tabIndex: tabIndex, onFocus: onFocus })));
62
62
  };
63
63
  export const SortableTreeViewItem = React.memo(SortableTreeViewItemNotMemoized);
64
64
  //# sourceMappingURL=TreeViewItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeViewItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,OAAO,EAEL,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAsB,OAAO,EAAE,MAAM,OAAO,CAAC;AAO3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA+BtD,MAAM,oBAAoB,GAAyB,CAAC,EAClD,SAAS,EACT,UAAU,GACX,EAAE,EAAE,CAAC,CAAC,SAAS,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AA6B/C,MAAM,+BAA+B,GAAG,SAAS,oBAAoB,CAGnE,EAmB4B;QAnB5B,EACA,EAAE,EACF,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,MAAM,EACN,oBAAo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d,eAAe,kCACV,UAAU,GACV,SAAS,GAEd,WAAW,EAAE,UAAU,EACvB,UAAU,EAAE,aAAa,EACzB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,IAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAC5C,+BAA+B,CACU,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type UniqueIdentifier } from '@dnd-kit/core';\nimport {\n type AnimateLayoutChanges,\n useSortable,\n type UseSortableArguments,\n} from '@dnd-kit/sortable';\nimport React, { type CSSProperties, useMemo } from 'react';\n\nimport {\n type FlattenedTreeItem,\n type ItemChangedReason,\n type TreeItemComponent,\n} from './tree-view-types';\nimport { transformToString } from './tree-view-utils';\n\nexport interface TreeItemProps<T> {\n /** Number of child items */\n childCount?: number;\n /** Whether this is a clone item */\n clone?: boolean;\n /** Whether the item is collapsed */\n collapsed?: boolean;\n /** Depth of the item in the tree */\n depth: number;\n /** Whether interaction should be disabled */\n shouldDisableInteraction?: boolean;\n /** Whether this is an indicator item */\n indicator?: boolean;\n /** Width of the indentation */\n indentationWidth: number;\n /** The tree item data */\n item: FlattenedTreeItem<T>;\n /** Whether this is the last item in its parent */\n isLast: boolean;\n /** Parent item of this item */\n parent: FlattenedTreeItem<T> | null;\n /** Function to call when item is collapsed */\n onCollapse?(id: UniqueIdentifier): void;\n /** Function to call when item is removed */\n onRemove?(id: UniqueIdentifier): void;\n /** Function to set the wrapper ref */\n wrapperRef?(node: HTMLLIElement): void;\n}\n\nconst animateLayoutChanges: AnimateLayoutChanges = ({\n isSorting,\n isDragging,\n}) => (isSorting || isDragging ? false : true);\n\ntype SortableTreeItemProps<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n> = TreeItemProps<T> & {\n id: UniqueIdentifier;\n /** The component to use for rendering the tree item */\n TreeItemComponent: TreeItemComponent<T, E>;\n /** Whether sorting should be disabled for this item */\n shouldDisableSorting?: boolean;\n /** Props for the sortable functionality */\n sortableProps?: Omit<UseSortableArguments, 'id'>;\n /** Whether to keep the ghost item in place while dragging */\n keepGhostInPlace?: boolean;\n /** A list of trails to render before the item */\n trails: ('none' | 'straight' | 'straight-curved' | 'curved')[];\n /** Function to call when the item has changed */\n onItemsChanged: (\n newItems: FlattenedTreeItem<T>[],\n itemChangedReason: ItemChangedReason<T>,\n ) => void;\n /** All items in the tree */\n items: FlattenedTreeItem<T>[];\n tabIndex?: number;\n /** Function to call when the item receives focus */\n onFocus?: () => void;\n};\n\nconst SortableTreeViewItemNotMemoized = function SortableTreeViewItem<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n>({\n id,\n depth,\n isLast,\n TreeItemComponent,\n parent,\n shouldDisableSorting,\n // need to destruct to avoid passing it to the component\n // oxlint-disable-next-line no-unused-vars\n sortableProps,\n keepGhostInPlace,\n item,\n onCollapse,\n trails,\n onItemsChanged,\n items,\n tabIndex,\n onFocus,\n ...restProps\n}: SortableTreeItemProps<T, E>) {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n setActivatorNodeRef,\n transition,\n isDragging,\n isSorting,\n isOver,\n } = useSortable({\n animateLayoutChanges,\n id: id,\n transition: {\n duration: 150, // milliseconds\n easing: 'cubic-bezier(0.25, 1, 0.5, 1)',\n },\n });\n\n const style: CSSProperties = {\n transform: transform ? transformToString(transform) : undefined,\n transition: transition ?? undefined,\n };\n const localCollapse = useMemo(() => {\n if (!onCollapse) {\n return undefined;\n }\n return () => onCollapse?.(item.id);\n }, [item.id, onCollapse]);\n\n return (\n <TreeItemComponent\n item={item}\n isOverParent={false}\n {...restProps}\n setActivatorNodeRef={setActivatorNodeRef}\n setNodeRef={setNodeRef}\n style={style}\n depth={depth}\n isGhost={keepGhostInPlace}\n shouldDisableInteraction={isSorting}\n isLastInParent={isLast}\n parent={parent}\n dragHandleProps={{\n ...attributes,\n ...listeners,\n }}\n isIndicator={isDragging}\n onCollapse={localCollapse}\n onItemsChanged={onItemsChanged}\n items={items}\n shouldDisableSorting={shouldDisableSorting}\n isOver={isOver}\n trails={trails}\n tabIndex={tabIndex}\n onFocus={onFocus}\n />\n );\n};\n\nexport const SortableTreeViewItem = React.memo(\n SortableTreeViewItemNotMemoized,\n) as typeof SortableTreeViewItemNotMemoized;\n"]}
1
+ {"version":3,"file":"TreeViewItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAqBA,OAAO,EAEL,WAAW,GAEZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAsB,OAAO,EAAE,MAAM,OAAO,CAAC;AAO3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA+BtD,MAAM,oBAAoB,GAAyB,CAAC,EAClD,SAAS,EACT,UAAU,GACX,EAAE,EAAE,CAAC,CAAC,SAAS,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAgC/C,MAAM,+BAA+B,GAAG,SAAS,oBAAoB,CAGnE,EAsB4B;QAtB5B,EACA,EAAE,EACF,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,MAAM,EACN,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EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,eAAe,kCACV,UAAU,GACV,SAAS,GAEd,WAAW,EAAE,UAAU,EACvB,UAAU,EAAE,aAAa,EACzB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,IAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAC5C,+BAA+B,CACU,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type UniqueIdentifier } from '@dnd-kit/core';\nimport {\n type AnimateLayoutChanges,\n useSortable,\n type UseSortableArguments,\n} from '@dnd-kit/sortable';\nimport React, { type CSSProperties, useMemo } from 'react';\n\nimport {\n type FlattenedTreeItem,\n type ItemChangedReason,\n type TreeItemComponent,\n} from './tree-view-types';\nimport { transformToString } from './tree-view-utils';\n\nexport interface TreeItemProps<T> {\n /** Number of child items */\n childCount?: number;\n /** Whether this is a clone item */\n clone?: boolean;\n /** Whether the item is collapsed */\n collapsed?: boolean;\n /** Depth of the item in the tree */\n depth: number;\n /** Whether interaction should be disabled */\n shouldDisableInteraction?: boolean;\n /** Whether this is an indicator item */\n indicator?: boolean;\n /** Width of the indentation */\n indentationWidth: number;\n /** The tree item data */\n item: FlattenedTreeItem<T>;\n /** Whether this is the last item in its parent */\n isLast: boolean;\n /** Parent item of this item */\n parent: FlattenedTreeItem<T> | null;\n /** Function to call when item is collapsed */\n onCollapse?(id: UniqueIdentifier): void;\n /** Function to call when item is removed */\n onRemove?(id: UniqueIdentifier): void;\n /** Function to set the wrapper ref */\n wrapperRef?(node: HTMLLIElement): void;\n}\n\nconst animateLayoutChanges: AnimateLayoutChanges = ({\n isSorting,\n isDragging,\n}) => (isSorting || isDragging ? false : true);\n\ntype SortableTreeItemProps<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n> = TreeItemProps<T> & {\n id: UniqueIdentifier;\n /** The component to use for rendering the tree item */\n TreeItemComponent: TreeItemComponent<T, E>;\n /** Whether sorting should be disabled for this item */\n shouldDisableSorting?: boolean;\n /** Props for the sortable functionality */\n sortableProps?: Omit<UseSortableArguments, 'id'>;\n /** Whether to keep the ghost item in place while dragging */\n keepGhostInPlace?: boolean;\n /** A list of trails to render before the item */\n trails: ('none' | 'straight' | 'straight-curved' | 'curved')[];\n /** Function to call when the item has changed */\n onItemsChanged: (\n newItems: FlattenedTreeItem<T>[],\n itemChangedReason: ItemChangedReason<T>,\n ) => void;\n /** All items in the tree */\n items: FlattenedTreeItem<T>[];\n ariaLevel?: number;\n ariaPosInSet?: number;\n ariaSetSize?: number;\n tabIndex?: number;\n /** Function to call when the item receives focus */\n onFocus?: () => void;\n};\n\nconst SortableTreeViewItemNotMemoized = function SortableTreeViewItem<\n T extends Record<string, unknown>,\n E extends HTMLElement,\n>({\n id,\n depth,\n isLast,\n TreeItemComponent,\n parent,\n shouldDisableSorting,\n // need to destruct to avoid passing it to the component\n // oxlint-disable-next-line no-unused-vars\n sortableProps,\n keepGhostInPlace,\n item,\n onCollapse,\n trails,\n onItemsChanged,\n items,\n ariaLevel,\n ariaPosInSet,\n ariaSetSize,\n tabIndex,\n onFocus,\n ...restProps\n}: SortableTreeItemProps<T, E>) {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n setActivatorNodeRef,\n transition,\n isDragging,\n isSorting,\n isOver,\n } = useSortable({\n animateLayoutChanges,\n id: id,\n transition: {\n duration: 150, // milliseconds\n easing: 'cubic-bezier(0.25, 1, 0.5, 1)',\n },\n });\n\n const style: CSSProperties = {\n transform: transform ? transformToString(transform) : undefined,\n transition: transition ?? undefined,\n };\n const localCollapse = useMemo(() => {\n if (!onCollapse) {\n return undefined;\n }\n return () => onCollapse?.(item.id);\n }, [item.id, onCollapse]);\n\n return (\n <TreeItemComponent\n item={item}\n isOverParent={false}\n {...restProps}\n setActivatorNodeRef={setActivatorNodeRef}\n setNodeRef={setNodeRef}\n style={style}\n depth={depth}\n isGhost={keepGhostInPlace}\n shouldDisableInteraction={isSorting}\n isLastInParent={isLast}\n parent={parent}\n dragHandleProps={{\n ...attributes,\n ...listeners,\n }}\n isIndicator={isDragging}\n onCollapse={localCollapse}\n onItemsChanged={onItemsChanged}\n items={items}\n ariaLevel={ariaLevel}\n ariaPosInSet={ariaPosInSet}\n ariaSetSize={ariaSetSize}\n shouldDisableSorting={shouldDisableSorting}\n isOver={isOver}\n trails={trails}\n tabIndex={tabIndex}\n onFocus={onFocus}\n />\n );\n};\n\nexport const SortableTreeViewItem = React.memo(\n SortableTreeViewItemNotMemoized,\n) as typeof SortableTreeViewItemNotMemoized;\n"]}
@@ -78,7 +78,7 @@ export const TreeViewTextItem = (_a) => {
78
78
  : false;
79
79
  return (_jsxs(TreeItemWrapper, Object.assign({ depth: depth, shouldDisableInteraction: shouldDisableInteraction, shouldDisableSorting: shouldDisableSorting, isGhost: isGhost, indentationWidth: indentationWidth, isIndicator: isIndicator, isCollapsed: isCollapsed, onCollapse: onCollapse, item: item, parent: parent, isOver: isOver, isOverParent: isOverParent, setNodeRef: setNodeRef, setActivatorNodeRef: setActivatorNodeRef, dragHandleProps: dragHandleProps, style: style, trails: trails,
80
80
  // oxlint-disable-next-line @typescript-eslint/no-empty-function
81
- onItemsChanged: () => { }, ref: ref, items: items, tabIndex: tabIndex }, restProps, { children: [item.canHaveSubItems && onCollapse && (_jsxs("button", { type: "button", className: "ndl-tree-view-collapse-button", onClick: () => onCollapse(), "aria-label": item.isCollapsed ? 'Expand' : 'Collapse', "aria-expanded": item.isCollapsed ? 'false' : 'true', "aria-pressed": !item.isCollapsed,
81
+ onItemsChanged: () => { }, ref: ref, items: items, tabIndex: tabIndex }, restProps, { children: [item.canHaveSubItems && onCollapse && (_jsxs("button", { type: "button", className: "ndl-tree-view-collapse-button", onClick: () => onCollapse(), "aria-label": item.isCollapsed ? 'Expand' : 'Collapse', "aria-expanded": item.isCollapsed ? 'false' : 'true',
82
82
  /**
83
83
  * Tab index is set to -1 to prevent the item from being focused when the tree is navigated with tab
84
84
  * since we use the arrow keys instead
@@ -1 +1 @@
1
- {"version":3,"file":"TreeViewTextItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTextItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,CACjC,IAAqC,EACrC,KAAwC,EAC/B,EAAE;IACX,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAA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BACJ,CAAC,CAAC,GACA,KACU,CACnB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\n\nimport { Checkbox } from '../checkbox';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { ChevronDownIconOutline, ChevronRightIconOutline } from '../icons';\nimport { Skeleton } from '../skeleton';\nimport { Typography } from '../typography';\nimport {\n type FlattenedTreeItem,\n type TextItemData,\n type TreeItemComponentProps,\n} from './tree-view-types';\nimport { TreeItemWrapper } from './TreeItemWrapper';\n\n/**\n * checks if any parent is checked\n * @param item\n * @param items\n * @returns\n */\nconst parentIsCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const parent = items.find((i) => i.id === item.parentId);\n if (parent) {\n if (parent.isSelected) {\n return true;\n }\n return parentIsCheckedRecursively(parent, items);\n }\n return false;\n};\n\n/**\n * checks if any children are checked\n * @param item\n * @param items\n * @returns\n */\nconst childrenCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const children = items.filter((i) => i.parentId === item.id);\n if (children.length === 0) {\n return false;\n }\n return children.some(\n (i) => i.isSelected || childrenCheckedRecursively(i, items),\n );\n};\n\nexport const TreeViewTextItem = <T extends TextItemData>({\n depth,\n shouldDisableInteraction,\n shouldDisableSorting,\n isGhost,\n indentationWidth,\n isIndicator,\n isCollapsed,\n onCollapse,\n item,\n parent,\n isOver,\n isOverParent,\n setNodeRef,\n setActivatorNodeRef,\n dragHandleProps,\n style,\n trails,\n onItemsChanged,\n items,\n tabIndex,\n ref,\n ...restProps\n}: TreeItemComponentProps<T> & { ref?: React.Ref<HTMLElement> }) => {\n const isAnyParentChecked = parentIsCheckedRecursively(item, items);\n const isAnyChildChecked = childrenCheckedRecursively(item, items);\n\n const isIndeterminate =\n isAnyChildChecked === true &&\n isAnyParentChecked === false &&\n item.isSelected === false\n ? true\n : false;\n\n return (\n <TreeItemWrapper\n depth={depth}\n shouldDisableInteraction={shouldDisableInteraction}\n shouldDisableSorting={shouldDisableSorting}\n isGhost={isGhost}\n indentationWidth={indentationWidth}\n isIndicator={isIndicator}\n isCollapsed={isCollapsed}\n onCollapse={onCollapse}\n item={item}\n parent={parent}\n isOver={isOver}\n isOverParent={isOverParent}\n setNodeRef={setNodeRef}\n setActivatorNodeRef={setActivatorNodeRef}\n dragHandleProps={dragHandleProps}\n style={style}\n trails={trails}\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n onItemsChanged={() => {}}\n ref={ref}\n items={items}\n tabIndex={tabIndex}\n {...restProps}\n >\n {item.canHaveSubItems && onCollapse && (\n <button\n type=\"button\"\n className=\"ndl-tree-view-collapse-button\"\n onClick={() => onCollapse()}\n aria-label={item.isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={item.isCollapsed ? 'false' : 'true'}\n aria-pressed={!item.isCollapsed}\n /**\n * Tab index is set to -1 to prevent the item from being focused when the tree is navigated with tab\n * since we use the arrow keys instead\n */\n tabIndex={tabIndex}\n >\n {item.isCollapsed && <ChevronRightIconOutline className=\"ndl-icon\" />}\n {!item.isCollapsed && <ChevronDownIconOutline className=\"ndl-icon\" />}\n </button>\n )}\n {item.isSelected !== undefined && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <Checkbox\n isIndeterminate={isIndeterminate}\n isChecked={item.isSelected}\n ariaLabel={item.data.text}\n htmlAttributes={{\n tabIndex,\n }}\n onChange={(event) => {\n const newItems = items.map((i) => {\n if (i.id === item.id) {\n return {\n ...i,\n isSelected: event.target.checked,\n };\n }\n return i;\n });\n\n // Uncheck parents if a child is unchecked\n if (!event.target.checked) {\n let parentId = item.parentId;\n while (parentId !== null) {\n const parent = newItems.find(\n (newItem) => newItem.id === parentId,\n );\n if (parent) {\n newItems.forEach((newItem) => {\n if (newItem.id === parent.id) {\n newItem.isSelected = false;\n }\n });\n parentId = parent.parentId;\n } else {\n parentId = null;\n }\n }\n }\n // Check children if a parent is checked\n if (item.canHaveSubItems) {\n const childIdsToUncheck = items\n .filter((i) => i.parentId === item.id)\n .map((i) => i.id);\n while (childIdsToUncheck.length > 0) {\n const childId = childIdsToUncheck.pop();\n const child = items.find((i) => i.id === childId);\n if (child) {\n newItems.forEach((newItem) => {\n if (newItem.id === child.id) {\n newItem.isSelected = event.target.checked;\n }\n });\n newItems\n .filter((i) => i.parentId === child.id)\n .forEach((i) => {\n childIdsToUncheck.push(i.id);\n });\n }\n }\n }\n onItemsChanged(newItems, { item, reason: 'selected' });\n }}\n aria-label={item.data.text}\n />\n </Skeleton>\n )}\n\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n height=\"20px\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <ConditionalWrap\n shouldWrap={item.data.onTextClick !== undefined}\n wrap={(children) => (\n <button\n type=\"button\"\n onClick={item.data.onTextClick}\n className=\"ndl-tree-view-text-clickable\"\n tabIndex={tabIndex}\n >\n {children}\n </button>\n )}\n >\n <Typography\n variant={item.canHaveSubItems ? 'subheading-small' : 'body-medium'}\n htmlAttributes={{\n style: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n }}\n >\n {item.data.text}\n </Typography>\n </ConditionalWrap>\n </Skeleton>\n <div className=\"ndl-tree-view-actions\">\n {item.data.actions &&\n item.data.actions.map((action, index) => {\n return (\n <CleanIconButton\n key={index}\n className=\"ndl-tree-view-action\"\n size=\"small\"\n {...action.buttonProps}\n htmlAttributes={{\n tabIndex,\n ...action.buttonProps.htmlAttributes,\n }}\n >\n {action.icon}\n </CleanIconButton>\n );\n })}\n </div>\n </TreeItemWrapper>\n );\n};\n"]}
1
+ {"version":3,"file":"TreeViewTextItem.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTextItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,CACjC,IAAqC,EACrC,KAAwC,EAC/B,EAAE;IACX,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzD,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,0BAA0B,GAAG,CACjC,IAAqC,EACrC,K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AW,KAAK,SAAS,EAC/C,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAClB,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAC9B,SAAS,EAAC,8BAA8B,EACxC,QAAQ,EAAE,QAAQ,YAEjB,QAAQ,GACF,CACV,YAED,KAAC,UAAU,IACT,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,aAAa,EAClE,cAAc,EAAE;4BACd,KAAK,EAAE;gCACL,QAAQ,EAAE,QAAQ;gCAClB,YAAY,EAAE,UAAU;gCACxB,UAAU,EAAE,QAAQ;6BACrB;yBACF,YAEA,IAAI,CAAC,IAAI,CAAC,IAAI,GACJ,GACG,IACT,EACX,cAAK,SAAS,EAAC,uBAAuB,YACnC,IAAI,CAAC,IAAI,CAAC,OAAO;oBAChB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;wBACtC,OAAO,CACL,KAAC,eAAe,kBAEd,SAAS,EAAC,sBAAsB,EAChC,IAAI,EAAC,OAAO,IACR,MAAM,CAAC,WAAW,IACtB,cAAc,kBACZ,QAAQ,IACL,MAAM,CAAC,WAAW,CAAC,cAAc,aAGrC,MAAM,CAAC,IAAI,KATP,KAAK,CAUM,CACnB,CAAC;oBACJ,CAAC,CAAC,GACA,KACU,CACnB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\n\nimport { Checkbox } from '../checkbox';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { ChevronDownIconOutline, ChevronRightIconOutline } from '../icons';\nimport { Skeleton } from '../skeleton';\nimport { Typography } from '../typography';\nimport {\n type FlattenedTreeItem,\n type TextItemData,\n type TreeItemComponentProps,\n} from './tree-view-types';\nimport { TreeItemWrapper } from './TreeItemWrapper';\n\n/**\n * checks if any parent is checked\n * @param item\n * @param items\n * @returns\n */\nconst parentIsCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const parent = items.find((i) => i.id === item.parentId);\n if (parent) {\n if (parent.isSelected) {\n return true;\n }\n return parentIsCheckedRecursively(parent, items);\n }\n return false;\n};\n\n/**\n * checks if any children are checked\n * @param item\n * @param items\n * @returns\n */\nconst childrenCheckedRecursively = (\n item: FlattenedTreeItem<TextItemData>,\n items: FlattenedTreeItem<TextItemData>[],\n): boolean => {\n const children = items.filter((i) => i.parentId === item.id);\n if (children.length === 0) {\n return false;\n }\n return children.some(\n (i) => i.isSelected || childrenCheckedRecursively(i, items),\n );\n};\n\nexport const TreeViewTextItem = <T extends TextItemData>({\n depth,\n shouldDisableInteraction,\n shouldDisableSorting,\n isGhost,\n indentationWidth,\n isIndicator,\n isCollapsed,\n onCollapse,\n item,\n parent,\n isOver,\n isOverParent,\n setNodeRef,\n setActivatorNodeRef,\n dragHandleProps,\n style,\n trails,\n onItemsChanged,\n items,\n tabIndex,\n ref,\n ...restProps\n}: TreeItemComponentProps<T> & { ref?: React.Ref<HTMLElement> }) => {\n const isAnyParentChecked = parentIsCheckedRecursively(item, items);\n const isAnyChildChecked = childrenCheckedRecursively(item, items);\n\n const isIndeterminate =\n isAnyChildChecked === true &&\n isAnyParentChecked === false &&\n item.isSelected === false\n ? true\n : false;\n\n return (\n <TreeItemWrapper\n depth={depth}\n shouldDisableInteraction={shouldDisableInteraction}\n shouldDisableSorting={shouldDisableSorting}\n isGhost={isGhost}\n indentationWidth={indentationWidth}\n isIndicator={isIndicator}\n isCollapsed={isCollapsed}\n onCollapse={onCollapse}\n item={item}\n parent={parent}\n isOver={isOver}\n isOverParent={isOverParent}\n setNodeRef={setNodeRef}\n setActivatorNodeRef={setActivatorNodeRef}\n dragHandleProps={dragHandleProps}\n style={style}\n trails={trails}\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n onItemsChanged={() => {}}\n ref={ref}\n items={items}\n tabIndex={tabIndex}\n {...restProps}\n >\n {item.canHaveSubItems && onCollapse && (\n <button\n type=\"button\"\n className=\"ndl-tree-view-collapse-button\"\n onClick={() => onCollapse()}\n aria-label={item.isCollapsed ? 'Expand' : 'Collapse'}\n aria-expanded={item.isCollapsed ? 'false' : 'true'}\n /**\n * Tab index is set to -1 to prevent the item from being focused when the tree is navigated with tab\n * since we use the arrow keys instead\n */\n tabIndex={tabIndex}\n >\n {item.isCollapsed && <ChevronRightIconOutline className=\"ndl-icon\" />}\n {!item.isCollapsed && <ChevronDownIconOutline className=\"ndl-icon\" />}\n </button>\n )}\n {item.isSelected !== undefined && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <Checkbox\n isIndeterminate={isIndeterminate}\n isChecked={item.isSelected}\n ariaLabel={item.data.text}\n htmlAttributes={{\n tabIndex,\n }}\n onChange={(event) => {\n const newItems = items.map((i) => {\n if (i.id === item.id) {\n return {\n ...i,\n isSelected: event.target.checked,\n };\n }\n return i;\n });\n\n // Uncheck parents if a child is unchecked\n if (!event.target.checked) {\n let parentId = item.parentId;\n while (parentId !== null) {\n const parent = newItems.find(\n (newItem) => newItem.id === parentId,\n );\n if (parent) {\n newItems.forEach((newItem) => {\n if (newItem.id === parent.id) {\n newItem.isSelected = false;\n }\n });\n parentId = parent.parentId;\n } else {\n parentId = null;\n }\n }\n }\n // Check children if a parent is checked\n if (item.canHaveSubItems) {\n const childIdsToUncheck = items\n .filter((i) => i.parentId === item.id)\n .map((i) => i.id);\n while (childIdsToUncheck.length > 0) {\n const childId = childIdsToUncheck.pop();\n const child = items.find((i) => i.id === childId);\n if (child) {\n newItems.forEach((newItem) => {\n if (newItem.id === child.id) {\n newItem.isSelected = event.target.checked;\n }\n });\n newItems\n .filter((i) => i.parentId === child.id)\n .forEach((i) => {\n childIdsToUncheck.push(i.id);\n });\n }\n }\n }\n onItemsChanged(newItems, { item, reason: 'selected' });\n }}\n aria-label={item.data.text}\n />\n </Skeleton>\n )}\n\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n height=\"20px\"\n {...item.skeletonProps}\n isLoading={item.isSkeletonLoading}\n >\n <ConditionalWrap\n shouldWrap={item.data.onTextClick !== undefined}\n wrap={(children) => (\n <button\n type=\"button\"\n onClick={item.data.onTextClick}\n className=\"ndl-tree-view-text-clickable\"\n tabIndex={tabIndex}\n >\n {children}\n </button>\n )}\n >\n <Typography\n variant={item.canHaveSubItems ? 'subheading-small' : 'body-medium'}\n htmlAttributes={{\n style: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n },\n }}\n >\n {item.data.text}\n </Typography>\n </ConditionalWrap>\n </Skeleton>\n <div className=\"ndl-tree-view-actions\">\n {item.data.actions &&\n item.data.actions.map((action, index) => {\n return (\n <CleanIconButton\n key={index}\n className=\"ndl-tree-view-action\"\n size=\"small\"\n {...action.buttonProps}\n htmlAttributes={{\n tabIndex,\n ...action.buttonProps.htmlAttributes,\n }}\n >\n {action.icon}\n </CleanIconButton>\n );\n })}\n </div>\n </TreeItemWrapper>\n );\n};\n"]}
@@ -30,10 +30,10 @@ const TREE_ITEMS = [
30
30
  actions: [
31
31
  {
32
32
  buttonProps: {
33
+ description: 'Edit',
33
34
  onClick: () => {
34
35
  alert('Pencil was clicked');
35
36
  },
36
- tooltip: 'Edit',
37
37
  },
38
38
  icon: _jsx(PencilIconOutline, {}),
39
39
  },
@@ -54,10 +54,10 @@ const TREE_ITEMS = [
54
54
  actions: [
55
55
  {
56
56
  buttonProps: {
57
+ description: 'Edit',
57
58
  onClick: () => {
58
59
  alert('Pencil was clicked');
59
60
  },
60
- tooltip: 'Edit',
61
61
  },
62
62
  icon: _jsx(PencilIconOutline, {}),
63
63
  },
@@ -77,10 +77,10 @@ const TREE_ITEMS = [
77
77
  actions: [
78
78
  {
79
79
  buttonProps: {
80
+ description: 'Edit',
80
81
  onClick: () => {
81
82
  alert('Pencil was clicked');
82
83
  },
83
- tooltip: 'Edit',
84
84
  },
85
85
  icon: _jsx(PencilIconOutline, {}),
86
86
  },
@@ -100,10 +100,10 @@ const TREE_ITEMS = [
100
100
  actions: [
101
101
  {
102
102
  buttonProps: {
103
+ description: 'Edit',
103
104
  onClick: () => {
104
105
  alert('Pencil was clicked');
105
106
  },
106
- tooltip: 'Edit',
107
107
  },
108
108
  icon: _jsx(PencilIconOutline, {}),
109
109
  },
@@ -123,10 +123,10 @@ const TREE_ITEMS = [
123
123
  actions: [
124
124
  {
125
125
  buttonProps: {
126
+ description: 'Edit',
126
127
  onClick: () => {
127
128
  alert('Pencil was clicked');
128
129
  },
129
- tooltip: 'Edit',
130
130
  },
131
131
  icon: _jsx(PencilIconOutline, {}),
132
132
  },
@@ -147,10 +147,10 @@ const TREE_ITEMS = [
147
147
  actions: [
148
148
  {
149
149
  buttonProps: {
150
+ description: 'Edit',
150
151
  onClick: () => {
151
152
  alert('Pencil was clicked');
152
153
  },
153
- tooltip: 'Edit',
154
154
  },
155
155
  icon: _jsx(PencilIconOutline, {}),
156
156
  },
@@ -169,10 +169,10 @@ const TREE_ITEMS = [
169
169
  actions: [
170
170
  {
171
171
  buttonProps: {
172
+ description: 'Edit',
172
173
  onClick: () => {
173
174
  alert('Pencil was clicked');
174
175
  },
175
- tooltip: 'Edit',
176
176
  },
177
177
  icon: _jsx(PencilIconOutline, {}),
178
178
  },
@@ -191,10 +191,10 @@ const TREE_ITEMS = [
191
191
  actions: [
192
192
  {
193
193
  buttonProps: {
194
+ description: 'Edit',
194
195
  onClick: () => {
195
196
  alert('Pencil was clicked');
196
197
  },
197
- tooltip: 'Edit',
198
198
  },
199
199
  icon: _jsx(PencilIconOutline, {}),
200
200
  },
@@ -217,10 +217,10 @@ const TREE_ITEMS = [
217
217
  actions: [
218
218
  {
219
219
  buttonProps: {
220
+ description: 'Edit',
220
221
  onClick: () => {
221
222
  alert('Pencil was clicked');
222
223
  },
223
- tooltip: 'Edit',
224
224
  },
225
225
  icon: _jsx(PencilIconOutline, {}),
226
226
  },
@@ -1 +1 @@
1
- {"version":3,"file":"treeview-default.story.js","sourceRoot":"","sources":["../../../../src/tree-view/stories/treeview-default.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,UAAU,GAAmD;IACjE;QACE,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP;oBACE,WAAW,EAAE;wBACX,OAAO,EAAE,GAAG,EAAE;4BACZ,KAAK,CAAC,oBAAoB,CAAC,CAAC;wBAC9B,CAAC;wBACD,OAAO,EAAE,MAAM;qBAChB;oBACD,IAAI,EAAE,KAAC,iBAAiB,KAAG;iBAC5B;aACF;YACD,WAAW,EAAE,GAAG,EAAE;gBAChB,KAAK,CAAC,kBAAkB,CAAC,CAAC;YAC5B,CAAC;YACD,IAAI,EAAE,UAAU;SACjB;QACD,EAAE,EAAE,UAAU;QACd,WAAW,EAAE,KAAK;QAClB,UAAU,EAAE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GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GACrB,QAAQ,CAAiD,UAAU,CAAC,CAAC;IAEvE,OAAO,CACL,KAAC,QAAQ,IACP,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC9C,gDAAgD;YAChD,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,CAAC;YACjE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { TreeView } from '@neo4j-ndl/react';\nimport { PencilIconOutline } from '@neo4j-ndl/react/icons';\nimport type React from 'react';\nimport { useState } from 'react';\n\nconst TREE_ITEMS: React.ComponentProps<typeof TreeView>['items'] = [\n {\n canHaveSubItems: true,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Folder 1',\n },\n id: 'Folder 1',\n isCollapsed: false,\n isSelected: false,\n isSortable: false,\n subItems: [\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 1',\n },\n id: 'Child 1',\n isSelected: false,\n isSortable: true,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 2',\n },\n id: 'Child 2',\n isSelected: false,\n isSortable: true,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 3',\n },\n id: 'Child 3',\n isSelected: false,\n isSortable: true,\n },\n {\n canHaveSubItems: true,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Folder 2',\n },\n id: 'Folder 2',\n isCollapsed: true,\n isSelected: false,\n isSortable: true,\n subItems: [\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 4',\n },\n\n id: 'Child 4',\n isSelected: false,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 5',\n },\n id: 'Child 5',\n isSelected: false,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 6',\n },\n id: 'Child 6',\n isSelected: false,\n },\n ],\n },\n ],\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n onClick: () => {\n alert('Pencil was clicked');\n },\n tooltip: 'Edit',\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 7',\n },\n id: 'Child 7',\n isSelected: false,\n isSortable: true,\n },\n];\n\nconst Component = () => {\n const [items, setItems] =\n useState<React.ComponentProps<typeof TreeView>['items']>(TREE_ITEMS);\n\n return (\n <TreeView\n items={items}\n onItemsChanged={(newItems, itemChangedReason) => {\n // eslint-disable-next-line no-restricted-syntax\n console.log('change with itemChangedReason:', itemChangedReason);\n setItems(newItems);\n }}\n TreeItemComponent={undefined}\n />\n );\n};\n\nexport default Component;\n"]}
1
+ {"version":3,"file":"treeview-default.story.js","sourceRoot":"","sources":["../../../../src/tree-view/stories/treeview-default.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,UAAU,GAAmD;IACjE;QACE,eAAe,EAAE,IAAI;QACrB,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP;oBACE,WAAW,EAAE;wBACX,WAAW,EAAE,MAAM;wBACnB,OAAO,EAAE,GAAG,EAAE;4BACZ,KAAK,CAAC,oBAAoB,CAAC,CAAC;wBA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BAAiB,KAAG;iBAC5B;aACF;YACD,WAAW,EAAE,GAAG,EAAE;gBAChB,KAAK,CAAC,kBAAkB,CAAC,CAAC;YAC5B,CAAC;YACD,IAAI,EAAE,SAAS;SAChB;QACD,EAAE,EAAE,SAAS;QACb,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,IAAI;KACjB;CACF,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GACrB,QAAQ,CAAiD,UAAU,CAAC,CAAC;IAEvE,OAAO,CACL,KAAC,QAAQ,IACP,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC9C,gDAAgD;YAChD,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,CAAC;YACjE,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC,EACD,iBAAiB,EAAE,SAAS,GAC5B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { TreeView } from '@neo4j-ndl/react';\nimport { PencilIconOutline } from '@neo4j-ndl/react/icons';\nimport type React from 'react';\nimport { useState } from 'react';\n\nconst TREE_ITEMS: React.ComponentProps<typeof TreeView>['items'] = [\n {\n canHaveSubItems: true,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Folder 1',\n },\n id: 'Folder 1',\n isCollapsed: false,\n isSelected: false,\n isSortable: false,\n subItems: [\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 1',\n },\n id: 'Child 1',\n isSelected: false,\n isSortable: true,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 2',\n },\n id: 'Child 2',\n isSelected: false,\n isSortable: true,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 3',\n },\n id: 'Child 3',\n isSelected: false,\n isSortable: true,\n },\n {\n canHaveSubItems: true,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Folder 2',\n },\n id: 'Folder 2',\n isCollapsed: true,\n isSelected: false,\n isSortable: true,\n subItems: [\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 4',\n },\n\n id: 'Child 4',\n isSelected: false,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 5',\n },\n id: 'Child 5',\n isSelected: false,\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 6',\n },\n id: 'Child 6',\n isSelected: false,\n },\n ],\n },\n ],\n },\n {\n canHaveSubItems: false,\n data: {\n actions: [\n {\n buttonProps: {\n description: 'Edit',\n onClick: () => {\n alert('Pencil was clicked');\n },\n },\n icon: <PencilIconOutline />,\n },\n ],\n onTextClick: () => {\n alert('Text was clicked');\n },\n text: 'Child 7',\n },\n id: 'Child 7',\n isSelected: false,\n isSortable: true,\n },\n];\n\nconst Component = () => {\n const [items, setItems] =\n useState<React.ComponentProps<typeof TreeView>['items']>(TREE_ITEMS);\n\n return (\n <TreeView\n items={items}\n onItemsChanged={(newItems, itemChangedReason) => {\n // eslint-disable-next-line no-restricted-syntax\n console.log('change with itemChangedReason:', itemChangedReason);\n setItems(newItems);\n }}\n TreeItemComponent={undefined}\n />\n );\n};\n\nexport default Component;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"tree-view-types.js","sourceRoot":"","sources":["../../../src/tree-view/tree-view-types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type UniqueIdentifier } from '@dnd-kit/core';\nimport { type RefAttributes } from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport { type IconButton } from '../icon-button';\nimport { type Skeleton } from '../skeleton';\n\nexport type TreeItem<T> =\n | {\n id: UniqueIdentifier;\n canHaveSubItems: false;\n isSortable?: boolean;\n data: T;\n isSelected?: boolean;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n }\n | {\n id: UniqueIdentifier;\n canHaveSubItems: true;\n isCollapsed: boolean;\n subItems: TreeItem<T>[];\n isSortable?: boolean;\n data: T;\n isSelected?: boolean;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n };\n\nexport type TextItemData = {\n text: string;\n onTextClick?: () => void;\n actions: {\n icon: React.ReactNode;\n buttonProps: Omit<\n React.ComponentPropsWithoutRef<typeof IconButton>,\n 'children' | 'as'\n >;\n }[];\n};\nexport type DefaultTreeItem = TreeItem<TextItemData>;\n\nexport type FlattenedTreeItem<T> = TreeItem<T> & {\n depth: number;\n parentId: UniqueIdentifier | null;\n};\n\nexport type TreeItemComponent<\n T extends Record<string, unknown>,\n TElement extends HTMLElement,\n> = React.FC<\n React.PropsWithChildren<TreeItemComponentProps<T> & RefAttributes<TElement>>\n>;\n\nexport type TreeItemComponentProps<T extends Record<string, unknown>> = Omit<\n CommonProps<\n 'div',\n {\n /** The tree item data */\n item: FlattenedTreeItem<T>;\n /** Parent item of this item */\n parent: FlattenedTreeItem<T> | null;\n\n /** If the item is should be rendered as a placeholder (for example, while dragging) */\n isGhost?: boolean;\n\n /** If the item is collapsed */\n isCollapsed?: boolean;\n\n /** Depth of the item in the tree */\n depth: number;\n\n /** While dragging it makes sense to disable some interaction for all other items. */\n shouldDisableInteraction?: boolean;\n\n /** True if sorting is disabled for this item. */\n shouldDisableSorting?: boolean;\n\n /** True if dragged item is over this Node. */\n isOver: boolean;\n\n /** True if dragged item is over the parent of this Node. */\n isOverParent: boolean;\n\n /** True if this item is the last in the parent list */\n isLastInParent: boolean;\n\n /** True if the item should be rendered as a indicator (for example, while dragging) */\n isIndicator?: boolean;\n\n /** Width of the indentation */\n indentationWidth: number;\n\n /** Function to call when the item is collapsed/expanded */\n onCollapse?(): void;\n\n /** Function to set the ref of the element that should activate sorting */\n setActivatorNodeRef: (node: HTMLElement | null) => void;\n\n /** Function to set the ref of the element that should be sorted (the wrapper element of the item) */\n setNodeRef: (node: HTMLLIElement) => void;\n\n /** Props for the drag handle */\n dragHandleProps?: Record<string, unknown>;\n\n /** A list of trails to render before the item */\n trails: ('none' | 'straight' | 'straight-curved' | 'curved')[];\n\n /** Function to call when the item has changed */\n onItemsChanged: (\n newItems: FlattenedTreeItem<T>[],\n reason: ItemChangedReason<T>,\n ) => void;\n\n /** All items in the tree */\n items: FlattenedTreeItem<T>[];\n tabIndex?: number;\n\n /** Function to call when the item receives focus */\n onFocus?: () => void;\n }\n >,\n 'htmlAttributes'\n>;\n\nexport type ItemChangedReason<T> = {\n /** The item that was changed */\n item: TreeItem<T>;\n /** The reason for the change */\n reason: 'collapsed' | 'expanded' | 'dropped' | 'selected' | 'other';\n};\n"]}
1
+ {"version":3,"file":"tree-view-types.js","sourceRoot":"","sources":["../../../src/tree-view/tree-view-types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { type UniqueIdentifier } from '@dnd-kit/core';\nimport { type RefAttributes } from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport { type IconButton } from '../icon-button';\nimport { type Skeleton } from '../skeleton';\n\nexport type TreeItem<T> =\n | {\n id: UniqueIdentifier;\n canHaveSubItems: false;\n isSortable?: boolean;\n data: T;\n isSelected?: boolean;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n }\n | {\n id: UniqueIdentifier;\n canHaveSubItems: true;\n isCollapsed: boolean;\n subItems: TreeItem<T>[];\n isSortable?: boolean;\n data: T;\n isSelected?: boolean;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n };\n\nexport type TextItemData = {\n text: string;\n onTextClick?: () => void;\n actions: {\n icon: React.ReactNode;\n buttonProps: Omit<\n React.ComponentPropsWithoutRef<typeof IconButton>,\n 'children' | 'as'\n >;\n }[];\n};\nexport type DefaultTreeItem = TreeItem<TextItemData>;\n\nexport type FlattenedTreeItem<T> = TreeItem<T> & {\n depth: number;\n parentId: UniqueIdentifier | null;\n};\n\nexport type TreeItemComponent<\n T extends Record<string, unknown>,\n TElement extends HTMLElement,\n> = React.FC<\n React.PropsWithChildren<TreeItemComponentProps<T> & RefAttributes<TElement>>\n>;\n\nexport type TreeItemComponentProps<T extends Record<string, unknown>> = Omit<\n CommonProps<\n 'div',\n {\n /** The tree item data */\n item: FlattenedTreeItem<T>;\n /** Parent item of this item */\n parent: FlattenedTreeItem<T> | null;\n\n /** If the item is should be rendered as a placeholder (for example, while dragging) */\n isGhost?: boolean;\n\n /** If the item is collapsed */\n isCollapsed?: boolean;\n\n /** Depth of the item in the tree */\n depth: number;\n\n /** While dragging it makes sense to disable some interaction for all other items. */\n shouldDisableInteraction?: boolean;\n\n /** True if sorting is disabled for this item. */\n shouldDisableSorting?: boolean;\n\n /** True if dragged item is over this Node. */\n isOver: boolean;\n\n /** True if dragged item is over the parent of this Node. */\n isOverParent: boolean;\n\n /** True if this item is the last in the parent list */\n isLastInParent: boolean;\n\n /** True if the item should be rendered as a indicator (for example, while dragging) */\n isIndicator?: boolean;\n\n /** Width of the indentation */\n indentationWidth: number;\n\n /** Function to call when the item is collapsed/expanded */\n onCollapse?(): void;\n\n /** Function to set the ref of the element that should activate sorting */\n setActivatorNodeRef: (node: HTMLElement | null) => void;\n\n /** Function to set the ref of the element that should be sorted (the wrapper element of the item) */\n setNodeRef: (node: HTMLLIElement) => void;\n\n /** Props for the drag handle */\n dragHandleProps?: Record<string, unknown>;\n\n /** A list of trails to render before the item */\n trails: ('none' | 'straight' | 'straight-curved' | 'curved')[];\n\n /** Function to call when the item has changed */\n onItemsChanged: (\n newItems: FlattenedTreeItem<T>[],\n reason: ItemChangedReason<T>,\n ) => void;\n\n /** All items in the tree */\n items: FlattenedTreeItem<T>[];\n tabIndex?: number;\n ariaLevel?: number;\n ariaPosInSet?: number;\n ariaSetSize?: number;\n\n /** Function to call when the item receives focus */\n onFocus?: () => void;\n }\n >,\n 'htmlAttributes'\n>;\n\nexport type ItemChangedReason<T> = {\n /** The item that was changed */\n item: TreeItem<T>;\n /** The reason for the change */\n reason: 'collapsed' | 'expanded' | 'dropped' | 'selected' | 'other';\n};\n"]}
@@ -50,7 +50,9 @@ type PopoverProps = {
50
50
  shouldCaptureFocus?: boolean;
51
51
  /** Which element to initially focus. **/
52
52
  initialFocus?: number | React.RefObject<HTMLElement | null>;
53
- /** The role of the popover */
53
+ /** The role of the popover.
54
+ * @deprecated - This prop will be removed in v5.
55
+ */
54
56
  role?: 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree';
55
57
  /** If the popover should close when the user clicks outside of it */
56
58
  closeOnClickOutside?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Popover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T,QAAQ,GACR,aAAa,GACb,MAAM,GACN,SAAS,GACT,MAAM,GACN,MAAM,CAAC;IACX,qEAAqE;IACrE,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAChC,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAMF,eAAO,MAAM,iBAAiB,gDAQ7B,CAAC;AA+CF,KAAK,mBAAmB,GAAG;IACzB,iCAAiC;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iGAAiG;IACjG,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AA0CF,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAmCF,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAqEF,QAAA,MAAM,OAAO,kPA3LV,YAAY;0CAwFZ,WAAW,CAAC,KAAK,EAAE,kBAAkB,CAAC;cAgCjB,CAAC,SAAS,KAAK,CAAC,WAAW,iFAQhD,sBAAsB,CAAC,CAAC,EAAE,mBAAmB,CAAC;6DAtF9C,WAAW,CAAC,QAAQ,EAAE,mBAAmB,CAAC;CAqJ3C,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -27,7 +27,7 @@ import { type TreeItemComponentProps } from './tree-view-types';
27
27
  * Useful if you want to add additional functionality to the tree item but still keep the drag handle and trail
28
28
  * Is also used internally to create the TreeViewTextItem component
29
29
  */
30
- declare function TreeItemWrapperInner<T extends Record<string, unknown>>({ depth, shouldDisableInteraction, shouldDisableSorting, isGhost, isIndicator, onCollapse, item, setNodeRef, setActivatorNodeRef, dragHandleProps, style, className, trails, children, indentationWidth, tabIndex, onFocus, ref, ...restProps }: React.PropsWithChildren<TreeItemComponentProps<T>>): import("react/jsx-runtime").JSX.Element;
30
+ declare function TreeItemWrapperInner<T extends Record<string, unknown>>({ depth, shouldDisableInteraction, shouldDisableSorting, isGhost, isIndicator, onCollapse, item, setNodeRef, setActivatorNodeRef, dragHandleProps, style, className, trails, children, indentationWidth, ariaLevel, ariaPosInSet, ariaSetSize, tabIndex, onFocus, ref, ...restProps }: React.PropsWithChildren<TreeItemComponentProps<T>>): import("react/jsx-runtime").JSX.Element;
31
31
  export declare const TreeItemWrapper: typeof TreeItemWrapperInner;
32
32
  export {};
33
33
  //# sourceMappingURL=TreeItemWrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeItemWrapper.d.ts","sourceRoot":"","sources":["../../../src/tree-view/TreeItemWrapper.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAiB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAiH/E;;;;;GAKG;AACH,iBAAS,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC/D,KAAK,EACL,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,UAAU,EACV,IAAI,EACJ,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,GAAG,EAGH,GAAG,SAAS,EACb,EAAE,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,2CAsEpD;AAED,eAAO,MAAM,eAAe,6BAAuB,CAAC"}
1
+ {"version":3,"file":"TreeItemWrapper.d.ts","sourceRoot":"","sources":["../../../src/tree-view/TreeItemWrapper.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAiB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAiH/E;;;;;GAKG;AACH,iBAAS,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC/D,KAAK,EACL,wBAAwB,EACxB,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,UAAU,EACV,IAAI,EACJ,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,OAAO,EACP,GAAG,EAGH,GAAG,SAAS,EACb,EAAE,KAAK,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,2CA0EpD;AAED,eAAO,MAAM,eAAe,6BAAuB,CAAC"}
@@ -32,8 +32,8 @@ export interface TreeViewProps<T extends Record<string, unknown>, E extends HTML
32
32
  /** HTML attributes */
33
33
  htmlAttributes?: HtmlAttributes<'ol'>;
34
34
  }
35
- export declare const TreeView: (<T extends Record<string, unknown>, E extends HTMLElement>({ items, TreeItemComponent, onItemsChanged, htmlAttributes, }: TreeViewProps<T, E>) => import("react/jsx-runtime").JSX.Element) & {
36
- SortableTreeViewItem: <T extends Record<string, unknown>, E extends HTMLElement>({ id, depth, isLast, TreeItemComponent, parent, shouldDisableSorting, sortableProps, keepGhostInPlace, item, onCollapse, trails, onItemsChanged, items, tabIndex, onFocus, ...restProps }: import("./TreeViewItem").TreeItemProps<T> & {
35
+ export declare const TreeView: (<T extends Record<string, unknown>, E extends HTMLElement>({ items, TreeItemComponent, onItemsChanged, htmlAttributes, ...restProps }: TreeViewProps<T, E>) => import("react/jsx-runtime").JSX.Element) & {
36
+ SortableTreeViewItem: <T extends Record<string, unknown>, E extends HTMLElement>({ id, depth, isLast, TreeItemComponent, parent, shouldDisableSorting, sortableProps, keepGhostInPlace, item, onCollapse, trails, onItemsChanged, items, ariaLevel, ariaPosInSet, ariaSetSize, tabIndex, onFocus, ...restProps }: import("./TreeViewItem").TreeItemProps<T> & {
37
37
  id: UniqueIdentifier;
38
38
  TreeItemComponent: TreeItemComponent<T, E>;
39
39
  shouldDisableSorting?: boolean;
@@ -42,10 +42,13 @@ export declare const TreeView: (<T extends Record<string, unknown>, E extends HT
42
42
  trails: ("none" | "straight" | "straight-curved" | "curved")[];
43
43
  onItemsChanged: (newItems: FlattenedTreeItem<T>[], itemChangedReason: ItemChangedReason<T>) => void;
44
44
  items: FlattenedTreeItem<T>[];
45
+ ariaLevel?: number;
46
+ ariaPosInSet?: number;
47
+ ariaSetSize?: number;
45
48
  tabIndex?: number;
46
49
  onFocus?: () => void;
47
50
  }) => import("react/jsx-runtime").JSX.Element;
48
- TreeItemWrapper: <T extends Record<string, unknown>>({ depth, shouldDisableInteraction, shouldDisableSorting, isGhost, isIndicator, onCollapse, item, setNodeRef, setActivatorNodeRef, dragHandleProps, style, className, trails, children, indentationWidth, tabIndex, onFocus, ref, ...restProps }: React.PropsWithChildren<import("./tree-view-types").TreeItemComponentProps<T>>) => import("react/jsx-runtime").JSX.Element;
51
+ TreeItemWrapper: <T extends Record<string, unknown>>({ depth, shouldDisableInteraction, shouldDisableSorting, isGhost, isIndicator, onCollapse, item, setNodeRef, setActivatorNodeRef, dragHandleProps, style, className, trails, children, indentationWidth, ariaLevel, ariaPosInSet, ariaSetSize, tabIndex, onFocus, ref, ...restProps }: React.PropsWithChildren<import("./tree-view-types").TreeItemComponentProps<T>>) => import("react/jsx-runtime").JSX.Element;
49
52
  TreeViewTextItem: <T extends import("./tree-view-types").TextItemData>({ depth, shouldDisableInteraction, shouldDisableSorting, isGhost, indentationWidth, isIndicator, isCollapsed, onCollapse, item, parent, isOver, isOverParent, setNodeRef, setActivatorNodeRef, dragHandleProps, style, trails, onItemsChanged, items, tabIndex, ref, ...restProps }: import("./tree-view-types").TreeItemComponentProps<T> & {
50
53
  ref?: React.Ref<HTMLElement>;
51
54
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../src/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAcL,KAAK,gBAAgB,EAGtB,MAAM,eAAe,CAAC;AAMvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AA0C3B,MAAM,WAAW,aAAa,CAC5B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,WAAW,CACrB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAC9C,iDAAiD;IACjD,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,uEAAuE;IACvE,cAAc,EAAE,CACd,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EACvB,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC,KACpC,IAAI,CAAC;IACV,kGAAkG;IAClG,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,sBAAsB;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;CACvC;AA2ZD,eAAO,MAAM,QAAQ,IAxZnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,WAAW,iEAMpB,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;WA9BX,CAAC;;CA+agE,CAAC"}
1
+ {"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../src/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAcL,KAAK,gBAAgB,EAGtB,MAAM,eAAe,CAAC;AAMvB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AA0C3B,MAAM,WAAW,aAAa,CAC5B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,WAAW,CACrB,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IAC9C,iDAAiD;IACjD,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,uEAAuE;IACvE,cAAc,EAAE,CACd,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EACvB,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC,KACpC,IAAI,CAAC;IACV,kGAAkG;IAClG,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,sBAAsB;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;CACvC;AA0cD,eAAO,MAAM,QAAQ,IAvcnB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,WAAW,8EAOpB,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;WA/BX,CAAC;;CA8dgE,CAAC"}
@@ -65,11 +65,14 @@ type SortableTreeItemProps<T extends Record<string, unknown>, E extends HTMLElem
65
65
  onItemsChanged: (newItems: FlattenedTreeItem<T>[], itemChangedReason: ItemChangedReason<T>) => void;
66
66
  /** All items in the tree */
67
67
  items: FlattenedTreeItem<T>[];
68
+ ariaLevel?: number;
69
+ ariaPosInSet?: number;
70
+ ariaSetSize?: number;
68
71
  tabIndex?: number;
69
72
  /** Function to call when the item receives focus */
70
73
  onFocus?: () => void;
71
74
  };
72
- declare const SortableTreeViewItemNotMemoized: <T extends Record<string, unknown>, E extends HTMLElement>({ id, depth, isLast, TreeItemComponent, parent, shouldDisableSorting, sortableProps, keepGhostInPlace, item, onCollapse, trails, onItemsChanged, items, tabIndex, onFocus, ...restProps }: SortableTreeItemProps<T, E>) => import("react/jsx-runtime").JSX.Element;
75
+ declare const SortableTreeViewItemNotMemoized: <T extends Record<string, unknown>, E extends HTMLElement>({ id, depth, isLast, TreeItemComponent, parent, shouldDisableSorting, sortableProps, keepGhostInPlace, item, onCollapse, trails, onItemsChanged, items, ariaLevel, ariaPosInSet, ariaSetSize, tabIndex, onFocus, ...restProps }: SortableTreeItemProps<T, E>) => import("react/jsx-runtime").JSX.Element;
73
76
  export declare const SortableTreeViewItem: typeof SortableTreeViewItemNotMemoized;
74
77
  export {};
75
78
  //# sourceMappingURL=TreeViewItem.d.ts.map