@itwin/presentation-hierarchies-react 2.0.0-alpha.52 → 2.0.0-alpha.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/lib/esm/presentation-hierarchies-react/Renderers.d.ts +62 -55
- package/lib/esm/presentation-hierarchies-react/Renderers.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts +33 -29
- package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts +27 -16
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.js +181 -54
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.d.ts +12 -6
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.js +54 -49
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts +7 -30
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js +116 -74
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.d.ts +67 -54
- package/lib/esm/presentation-hierarchies-react/UseTree.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.js +283 -226
- package/lib/esm/presentation-hierarchies-react/UseTree.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/Utils.js +44 -27
- package/lib/esm/presentation-hierarchies-react/Utils.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js +6 -7
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js +271 -298
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js +91 -82
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts +3 -47
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js +114 -151
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +32 -37
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js +128 -101
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/Utils.js +29 -44
- package/lib/esm/presentation-hierarchies-react/internal/Utils.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts +24 -13
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js +344 -67
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts +16 -15
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.js +78 -60
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts +122 -117
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.js +59 -38
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts +16 -5
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.js +161 -35
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.d.ts +21 -17
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.js +84 -31
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts +22 -14
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js +61 -26
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts +15 -6
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js +75 -25
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts +16 -40
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js +140 -61
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts +14 -42
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js +489 -121
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts +58 -55
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.js +412 -181
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react.d.ts +17 -17
- package/lib/esm/presentation-hierarchies-react.js +15 -18
- package/package.json +17 -14
- package/lib/esm/presentation-hierarchies-react/Renderers.js +0 -6
- package/lib/esm/presentation-hierarchies-react/Renderers.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/TreeNode.js +0 -6
- package/lib/esm/presentation-hierarchies-react/TreeNode.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/Utils.d.ts +0 -8
- package/lib/esm/presentation-hierarchies-react/Utils.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts +0 -2
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts +0 -53
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts +0 -62
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts +0 -23
- package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRenderer.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/stratakit/TreeRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAKL,UAAU,EACV,IAAI,EAKJ,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzD,OAAO,EAAiB,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAkC,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvH,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAA0B,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAwB,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/H,OAAO,EAAE,eAAe,EAA0B,yBAAyB,EAAyB,MAAM,uBAAuB,CAAC;AA0DlI;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAqG,UAAU,CAG/I,SAAS,qBAAqB,CAAC,KAAK,EAAE,YAAY;IAClD,MAAM,EACJ,EAAE,EACF,SAAS,EACT,WAAW,EACX,aAAa,EACb,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,gBAAgB,EAAE,GAAG,mBAAmB,CAAC;QA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nH,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,QAAQ,CAAiD,CAAC,CAAC,EAAE,EAAE;QACjF,IAAI,aAAa,EAAE,WAAW,EAAE,CAAC;YAC/B,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;QACD,wCAAwC;QACxC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;YACf,CAAC,CAAC,cAAc,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,aAAa,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,CACL,KAAC,yBAAyB,OACpB,aAAa,KACb,IAAI,KACJ,WAAW,EACf,GAAG,EAAE,GAAG,gBACI,IAAI,CAAC,KAAK,mBACP,IAAI,CAAC,UAAU,kBAChB,IAAI,CAAC,SAAS,EAC5B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;AACJ,CAAC,CAAC,CACH,CAAC;AAEF,SAAS,eAAe,KAAI,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport {\n ComponentProps,\n ComponentPropsWithoutRef,\n CSSProperties,\n FC,\n forwardRef,\n memo,\n PropsWithoutRef,\n ReactElement,\n ReactNode,\n RefAttributes,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\nimport { Tree } from \"@stratakit/structures\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { TreeRendererProps } from \"../Renderers.js\";\nimport { TreeNode } from \"../TreeNode.js\";\nimport { SelectionMode, useSelectionHandler } from \"../UseSelectionHandler.js\";\nimport { useEvent, useMergedRefs } from \"../Utils.js\";\nimport { FlatTreeItem, FlatTreeNodeItem, isPlaceholderItem, useErrorNodes, useFlatTreeItems } from \"./FlatTreeNode.js\";\nimport { LocalizationContextProvider } from \"./LocalizationContext.js\";\nimport { TreeErrorRenderer, TreeErrorRendererProps } from \"./TreeErrorRenderer.js\";\nimport { TreeNodeEditingProps, TreeNodeRenameContextProvider, useTreeNodeRenameContextValue } from \"./TreeNodeRenameAction.js\";\nimport { PlaceholderNode, StrataKitTreeItemProps, StrataKitTreeNodeRenderer, TreeNodeRendererProps } from \"./TreeNodeRenderer.js\";\n\n/** @alpha */\ninterface TreeRendererOwnProps {\n id?: string;\n /**\n * A user friendly display label of the tree. Should be unique within the consuming application,\n * as it's used for accessibility purposes.\n */\n treeLabel: string;\n /** Active selection mode used by the tree. Defaults to `\"single\"`. */\n selectionMode?: SelectionMode;\n /** A render function for errors' display component. Defaults to `<TreeErrorRenderer />`. */\n errorRenderer?: (props: TreeErrorRendererProps) => ReactElement;\n /** Props that defines if current node supports editing. */\n getEditingProps?: (node: TreeNode) => TreeNodeEditingProps | undefined;\n\n /** Custom props for the root Tree component. */\n treeRootProps?: Partial<Omit<ComponentProps<typeof Tree.Root>, \"style\">>;\n\n /** A callback that returns tree item props for specific node. */\n getTreeItemProps?: (node: TreeNode) => Partial<Omit<StrataKitTreeItemProps, \"selected\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\">>;\n\n /**\n * Callback that returns menu actions for tree item.\n * Must return an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n getMenuActions?: (props: { targetNode: TreeNode; selectedNodes: TreeNode[] }) => ReactNode[];\n /**\n * Callback that returns inline actions for tree item.\n * Must return an array of `<TreeActionBase />` elements.\n * Max 2 items.\n */\n getInlineActions?: (props: { targetNode: TreeNode; selectedNodes: TreeNode[] }) => ReactNode[];\n /**\n * Callback that returns actions for tree item context menu.\n * Must return an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n getContextMenuActions?: (props: { targetNode: TreeNode; selectedNodes: TreeNode[] }) => ReactNode[];\n}\n\n/** @alpha */\nexport interface StrataKitTreeRendererAttributes {\n /**\n * Opens rename mode for the first node that matches the given predicate. Node must be already loaded in the tree.\n * If the node is not visible (because its parent is collapsed), all parents will be expanded to make it visible and node will be scrolled into view.\n *\n * Returns \"node-not-found\" if no node matches the predicate, \"success\" if rename was initiated.\n */\n renameNode: (nodePredicate: (node: TreeNode) => boolean) => \"node-not-found\" | \"success\";\n}\n\n/** @alpha */\ntype StrataKitTreeRendererProps = TreeRendererProps &\n Pick<TreeErrorRendererProps, \"filterHierarchyLevel\"> &\n TreeRendererOwnProps &\n ComponentPropsWithoutRef<typeof LocalizationContextProvider>;\n\n/**\n * A component that renders a tree using the `Tree` component from `@itwin/itwinui-react`. The tree nodes\n * are rendered using `TreeNodeRenderer` component from this package.\n *\n * @see https://itwinui.bentley.com/docs/tree\n * @alpha\n */\nexport const StrataKitTreeRenderer: FC<PropsWithoutRef<StrataKitTreeRendererProps> & RefAttributes<StrataKitTreeRendererAttributes>> = forwardRef<\n StrataKitTreeRendererAttributes,\n StrataKitTreeRendererProps\n>(function StrataKitTreeRenderer(props, forwardedRef) {\n const {\n id,\n rootNodes,\n selectNodes,\n selectionMode,\n expandNode,\n treeLabel,\n localizedStrings,\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree,\n isNodeSelected,\n errorRenderer,\n treeRootProps,\n getContextMenuActions,\n getEditingProps,\n getInlineActions,\n getMenuActions,\n getTreeItemProps,\n } = props;\n const { handleNodeSelect } = useSelectionHandler({\n rootNodes,\n selectNodes: selectNodes ?? noopSelectNodes,\n selectionMode: selectionMode ?? \"single\",\n });\n const flatItems = useFlatTreeItems(rootNodes);\n const errorNodes = useErrorNodes(rootNodes);\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n const virtualizer = useVirtualizer({\n count: flatItems.length,\n getScrollElement: () => parentRef.current,\n getItemKey: useCallback((index: number) => flatItems[index].id, [flatItems]),\n estimateSize: () => 28,\n overscan: 10,\n });\n const items = virtualizer.getVirtualItems();\n const expandAndScrollToNode = useExpandAndScrollToNode({ rootNodes, flatItems, expandNode, virtualizer });\n\n const renameContext = useTreeNodeRenameContextValue({\n getEditingProps,\n });\n useImperativeHandle(forwardedRef, () => ({\n renameNode: (nodePredicate) =>\n expandAndScrollToNode({\n nodePredicate,\n onComplete: (targetNode) => {\n // give time to scroll node into view before starting rename\n requestAnimationFrame(() => renameContext.startRename(targetNode));\n },\n }),\n }));\n\n const cancelRename = renameContext.cancelRename;\n const isScrolling = virtualizer.isScrolling;\n useEffect(() => {\n if (isScrolling) {\n // cancel rename when scroll is initiated\n cancelRename();\n }\n }, [isScrolling, cancelRename]);\n\n const errorRendererProps: TreeErrorRendererProps = {\n treeLabel,\n errorNodes,\n scrollToNode: (node) => expandAndScrollToNode({ nodePredicate: (n) => n.id === node.id }),\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree: useCallback<TreeErrorRendererProps[\"reloadTree\"]>(({ parentNodeId }) => reloadTree({ parentNodeId, state: \"reset\" }), [reloadTree]),\n };\n\n const getSelectedNodes = useMemo(() => {\n let calculatedSelectedNodes: TreeNode[];\n return () => {\n if (calculatedSelectedNodes === undefined) {\n calculatedSelectedNodes = flatItems\n .filter((item): item is FlatTreeNodeItem => !isPlaceholderItem(item) && isNodeSelected?.(item.id))\n .map((item) => item.node);\n }\n return calculatedSelectedNodes;\n };\n }, [flatItems, isNodeSelected]);\n\n return (\n <LocalizationContextProvider localizedStrings={localizedStrings}>\n {errorRenderer ? errorRenderer(errorRendererProps) : <TreeErrorRenderer {...errorRendererProps} />}\n <div id={id} style={{ height: \"100%\", width: \"100%\", overflowY: \"auto\" }} ref={parentRef}>\n <Tree.Root\n {...treeRootProps}\n style={{ height: virtualizer.getTotalSize(), minHeight: \"100%\", width: \"100%\", position: \"relative\", overflow: \"hidden\" }}\n >\n <TreeNodeRenameContextProvider value={renameContext}>\n {items.map((virtualizedItem) => {\n const item = flatItems[virtualizedItem.index];\n const selected = isNodeSelected?.(item.id) ?? false;\n return (\n <VirtualTreeItem\n ref={virtualizer.measureElement}\n key={virtualizedItem.key}\n data-index={virtualizedItem.index}\n start={virtualizedItem.start}\n item={item}\n selected={selected}\n expandNode={expandNode}\n reloadTree={reloadTree}\n handleNodeSelect={handleNodeSelect}\n getSelectedNodes={getSelectedNodes}\n getContextMenuActions={getContextMenuActions}\n getInlineActions={getInlineActions}\n getMenuActions={getMenuActions}\n getTreeItemProps={getTreeItemProps}\n />\n );\n })}\n </TreeNodeRenameContextProvider>\n </Tree.Root>\n </div>\n </LocalizationContextProvider>\n );\n});\n\nfunction useExpandAndScrollToNode({\n rootNodes,\n flatItems,\n expandNode,\n virtualizer,\n}: Pick<StrataKitTreeRendererProps, \"rootNodes\" | \"expandNode\"> & {\n flatItems: ReturnType<typeof useFlatTreeItems>;\n virtualizer: Pick<ReturnType<typeof useVirtualizer>, \"scrollToIndex\">;\n}) {\n const expandToNode = (nodePredicate: (node: TreeNode) => boolean) => {\n const pathToNode = findPathToNode(rootNodes, nodePredicate);\n if (!pathToNode) {\n return undefined;\n }\n const targetNode = pathToNode.pop()!;\n const collapsedNodes = pathToNode.filter((pathNode) => !pathNode.isExpanded);\n collapsedNodes.forEach((node) => expandNode(node.id, true));\n return { targetNode, didExpand: collapsedNodes.length > 0 };\n };\n\n const scrollToNode = useRef<{ id: string; onScrollComplete?: () => void } | undefined>(undefined);\n useEffect(() => {\n if (scrollToNode.current === undefined) {\n return;\n }\n const targetNodeId = scrollToNode.current.id;\n const index = flatItems.findIndex((flatItem) => flatItem.id === targetNodeId);\n if (index === -1) {\n return;\n }\n virtualizer.scrollToIndex(index, { align: \"auto\" });\n scrollToNode.current.onScrollComplete?.();\n scrollToNode.current = undefined;\n }, [flatItems, virtualizer]);\n\n return ({ nodePredicate, onComplete }: { nodePredicate: (node: TreeNode) => boolean; onComplete?: (targetNode: TreeNode) => void }) => {\n const expandResult = expandToNode(nodePredicate);\n if (!expandResult) {\n return \"node-not-found\";\n }\n\n const { targetNode, didExpand } = expandResult;\n if (didExpand) {\n scrollToNode.current = {\n id: targetNode.id,\n onScrollComplete: onComplete ? () => onComplete(targetNode) : undefined,\n };\n } else {\n const index = flatItems.findIndex((flatItem) => flatItem.id === targetNode.id);\n virtualizer.scrollToIndex(index, { align: \"auto\" });\n onComplete?.(targetNode);\n }\n return \"success\";\n };\n}\n\nfunction findPathToNode(rootNodes: TreeNode[], nodePredicate: (node: TreeNode) => boolean): TreeNode[] | undefined {\n for (const parent of rootNodes) {\n if (nodePredicate(parent)) {\n return [parent];\n }\n if (parent.children && parent.children !== true) {\n const childPath = findPathToNode(parent.children, nodePredicate);\n if (childPath) {\n return [parent, ...childPath];\n }\n }\n }\n return undefined;\n}\n\ntype VirtualTreeItemProps = Omit<HierarchyNodeItemProps, \"item\"> & {\n start: number;\n \"data-index\": number;\n item: FlatTreeItem;\n};\n\nconst VirtualTreeItem = memo(\n forwardRef<HTMLElement, VirtualTreeItemProps>(function VirtualTreeItem({ start, item, ...props }, forwardedRef) {\n const style: CSSProperties = useMemo(\n () => ({\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n transform: `translateY(${start}px)`,\n willChange: \"transform\",\n }),\n [start],\n );\n\n if (isPlaceholderItem(item)) {\n return <PlaceholderNode ref={forwardedRef} data-index={props[\"data-index\"]} style={style} aria-level={item.level} aria-posinset={1} aria-setsize={1} />;\n }\n\n return <HierarchyNodeItem {...props} ref={forwardedRef} style={style} item={item} />;\n }),\n);\n\ntype HierarchyNodeItemProps = {\n item: FlatTreeNodeItem;\n style?: CSSProperties;\n getSelectedNodes: () => TreeNode[];\n} & Pick<TreeNodeRendererProps, \"expandNode\" | \"reloadTree\" | \"selected\"> &\n Pick<TreeRendererOwnProps, \"getContextMenuActions\" | \"getInlineActions\" | \"getMenuActions\" | \"getTreeItemProps\"> &\n Pick<ReturnType<typeof useSelectionHandler>, \"handleNodeSelect\">;\n\nconst HierarchyNodeItem = memo(\n forwardRef<HTMLElement, HierarchyNodeItemProps>(function HierarchyNodeItem(\n { item, selected, getTreeItemProps, handleNodeSelect, getSelectedNodes, getMenuActions, getInlineActions, getContextMenuActions, ...rest },\n forwardedRef,\n ) {\n const nodeRef = useRef<HTMLElement>(null);\n const node = item.node;\n const treeItemProps = getTreeItemProps?.(node);\n\n const isDisabled = treeItemProps?.[\"aria-disabled\"] === true;\n const nodeActions = useMemo(\n () => ({\n menuActions: getMenuActions ? getMenuActions({ targetNode: node, selectedNodes: getSelectedNodes() }) : undefined,\n inlineActions: getInlineActions ? getInlineActions({ targetNode: node, selectedNodes: getSelectedNodes() }) : undefined,\n contextMenuActions: getContextMenuActions ? getContextMenuActions({ targetNode: node, selectedNodes: getSelectedNodes() }) : undefined,\n }),\n [node, getMenuActions, getInlineActions, getContextMenuActions, getSelectedNodes],\n );\n\n const onClick = useEvent<Required<TreeNodeRendererProps>[\"onClick\"]>((e) => {\n if (treeItemProps?.onClick) {\n treeItemProps.onClick(e);\n }\n // ignore if this is double click\n if (isDisabled || e.detail > 1) {\n return;\n }\n handleNodeSelect({ nodeId: node.id, isSelected: selected ?? false, shiftDown: e.shiftKey, ctrlDown: e.ctrlKey });\n });\n\n const onMouseDown = useEvent<Required<TreeNodeRendererProps>[\"onMouseDown\"]>((e) => {\n if (treeItemProps?.onMouseDown) {\n treeItemProps.onMouseDown(e);\n }\n // prevent text selection on shift+click\n if (e.shiftKey) {\n e.preventDefault();\n }\n });\n\n const ref = useMergedRefs(forwardedRef, nodeRef);\n return (\n <StrataKitTreeNodeRenderer\n {...treeItemProps}\n {...rest}\n {...nodeActions}\n ref={ref}\n aria-level={item.level}\n aria-posinset={item.posInLevel}\n aria-setsize={item.levelSize}\n node={item.node}\n selected={selected}\n onClick={onClick}\n onMouseDown={onMouseDown}\n />\n );\n }),\n);\n\nfunction noopSelectNodes() {}\n"]}
|
|
1
|
+
{"version":3,"file":"TreeRenderer.js","names":["forwardRef","memo","useCallback","useEffect","useImperativeHandle","useMemo","useRef","Tree","useVirtualizer","useSelectionHandler","useEvent","useMergedRefs","isPlaceholderItem","useErrorNodes","useFlatTreeItems","LocalizationContextProvider","TreeErrorRenderer","TreeNodeRenameContextProvider","useTreeNodeRenameContextValue","PlaceholderNode","StrataKitTreeNodeRenderer","ComponentProps","ComponentPropsWithoutRef","CSSProperties","FC","PropsWithoutRef","ReactElement","ReactNode","RefAttributes","TreeRendererProps","TreeNode","SelectionMode","FlatTreeItem","FlatTreeNodeItem","TreeErrorRendererProps","TreeNodeEditingProps","StrataKitTreeItemProps","TreeNodeRendererProps","TreeRendererOwnProps","id","treeLabel","selectionMode","errorRenderer","props","getEditingProps","node","treeRootProps","Partial","Omit","Root","getTreeItemProps","getMenuActions","targetNode","selectedNodes","getInlineActions","getContextMenuActions","StrataKitTreeRendererAttributes","renameNode","nodePredicate","StrataKitTreeRendererProps","Pick","StrataKitTreeRenderer","forwardedRef","rootNodes","selectNodes","expandNode","localizedStrings","getHierarchyLevelDetails","filterHierarchyLevel","reloadTree","isNodeSelected","handleNodeSelect","flatItems","errorNodes","parentRef","HTMLDivElement","virtualizer","count","length","getScrollElement","current","getItemKey","index","estimateSize","overscan","items","getVirtualItems","expandAndScrollToNode","useExpandAndScrollToNode","renameContext","onComplete","requestAnimationFrame","startRename","cancelRename","isScrolling","errorRendererProps","scrollToNode","n","parentNodeId","state","getSelectedNodes","calculatedSelectedNodes","undefined","filter","item","map","height","width","overflowY","getTotalSize","minHeight","position","overflow","virtualizedItem","selected","measureElement","key","start","t0","$","_c","t1","pathToNode","findPathToNode","pop","collapsedNodes","_temp","forEach","didExpand","expandToNode","t2","t3","targetNodeId","findIndex","flatItem","scrollToIndex","align","onScrollComplete","t4","t5","nodePredicate_0","expandResult","targetNode_0","index_0","flatItem_0","pathNode","isExpanded","parent","children","childPath","VirtualTreeItemProps","HierarchyNodeItemProps","VirtualTreeItem","HTMLElement","top","left","transform","willChange","style","level","ReturnType","HierarchyNodeItem","rest","nodeRef","treeItemProps","isDisabled","menuActions","inlineActions","contextMenuActions","nodeActions","t6","e","onClick","detail","nodeId","isSelected","shiftDown","shiftKey","ctrlDown","ctrlKey","t7","e_0","onMouseDown","preventDefault","ref","t8","levelSize","posInLevel"],"sources":["../../../../src/presentation-hierarchies-react/stratakit/TreeRenderer.tsx"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from \"react\";\nimport { Tree } from \"@stratakit/structures\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\nimport { useSelectionHandler } from \"../UseSelectionHandler.js\";\nimport { useEvent, useMergedRefs } from \"../Utils.js\";\nimport { isPlaceholderItem, useErrorNodes, useFlatTreeItems } from \"./FlatTreeNode.js\";\nimport { LocalizationContextProvider } from \"./LocalizationContext.js\";\nimport { TreeErrorRenderer } from \"./TreeErrorRenderer.js\";\nimport { TreeNodeRenameContextProvider, useTreeNodeRenameContextValue } from \"./TreeNodeRenameAction.js\";\nimport { PlaceholderNode, StrataKitTreeNodeRenderer } from \"./TreeNodeRenderer.js\";\n\nimport type { ComponentProps, ComponentPropsWithoutRef, CSSProperties, FC, PropsWithoutRef, ReactElement, ReactNode, RefAttributes } from \"react\";\nimport type { TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { SelectionMode } from \"../UseSelectionHandler.js\";\nimport type { FlatTreeItem, FlatTreeNodeItem } from \"./FlatTreeNode.js\";\nimport type { TreeErrorRendererProps } from \"./TreeErrorRenderer.js\";\nimport type { TreeNodeEditingProps } from \"./TreeNodeRenameAction.js\";\nimport type { StrataKitTreeItemProps, TreeNodeRendererProps } from \"./TreeNodeRenderer.js\";\n\n/** @alpha */\ninterface TreeRendererOwnProps {\n id?: string;\n /**\n * A user friendly display label of the tree. Should be unique within the consuming application,\n * as it's used for accessibility purposes.\n */\n treeLabel: string;\n /** Active selection mode used by the tree. Defaults to `\"single\"`. */\n selectionMode?: SelectionMode;\n /** A render function for errors' display component. Defaults to `<TreeErrorRenderer />`. */\n errorRenderer?: (props: TreeErrorRendererProps) => ReactElement;\n /** Props that defines if current node supports editing. */\n getEditingProps?: (node: TreeNode) => TreeNodeEditingProps | undefined;\n\n /** Custom props for the root Tree component. */\n treeRootProps?: Partial<Omit<ComponentProps<typeof Tree.Root>, \"style\">>;\n\n /** A callback that returns tree item props for specific node. */\n getTreeItemProps?: (node: TreeNode) => Partial<Omit<StrataKitTreeItemProps, \"selected\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\">>;\n\n /**\n * Callback that returns menu actions for tree item.\n * Must return an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n getMenuActions?: (props: { targetNode: TreeNode; selectedNodes: TreeNode[] }) => ReactNode[];\n /**\n * Callback that returns inline actions for tree item.\n * Must return an array of `<TreeActionBase />` elements.\n * Max 2 items.\n */\n getInlineActions?: (props: { targetNode: TreeNode; selectedNodes: TreeNode[] }) => ReactNode[];\n /**\n * Callback that returns actions for tree item context menu.\n * Must return an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n getContextMenuActions?: (props: { targetNode: TreeNode; selectedNodes: TreeNode[] }) => ReactNode[];\n}\n\n/** @alpha */\nexport interface StrataKitTreeRendererAttributes {\n /**\n * Opens rename mode for the first node that matches the given predicate. Node must be already loaded in the tree.\n * If the node is not visible (because its parent is collapsed), all parents will be expanded to make it visible and node will be scrolled into view.\n *\n * Returns \"node-not-found\" if no node matches the predicate, \"success\" if rename was initiated.\n */\n renameNode: (nodePredicate: (node: TreeNode) => boolean) => \"node-not-found\" | \"success\";\n}\n\n/** @alpha */\ntype StrataKitTreeRendererProps = TreeRendererProps &\n Pick<TreeErrorRendererProps, \"filterHierarchyLevel\"> &\n TreeRendererOwnProps &\n ComponentPropsWithoutRef<typeof LocalizationContextProvider>;\n\n/**\n * A component that renders a tree using the `Tree` component from `@itwin/itwinui-react`. The tree nodes\n * are rendered using `TreeNodeRenderer` component from this package.\n *\n * @see https://itwinui.bentley.com/docs/tree\n * @alpha\n */\nexport const StrataKitTreeRenderer: FC<PropsWithoutRef<StrataKitTreeRendererProps> & RefAttributes<StrataKitTreeRendererAttributes>> = forwardRef<\n StrataKitTreeRendererAttributes,\n StrataKitTreeRendererProps\n>(function StrataKitTreeRenderer(props, forwardedRef) {\n const {\n id,\n rootNodes,\n selectNodes,\n selectionMode,\n expandNode,\n treeLabel,\n localizedStrings,\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree,\n isNodeSelected,\n errorRenderer,\n treeRootProps,\n getContextMenuActions,\n getEditingProps,\n getInlineActions,\n getMenuActions,\n getTreeItemProps,\n } = props;\n const { handleNodeSelect } = useSelectionHandler({\n rootNodes,\n selectNodes,\n selectionMode: selectionMode ?? \"single\",\n });\n const flatItems = useFlatTreeItems(rootNodes);\n const errorNodes = useErrorNodes(rootNodes);\n\n const parentRef = useRef<HTMLDivElement>(null);\n\n // eslint-disable-next-line react-hooks/incompatible-library\n const virtualizer = useVirtualizer({\n count: flatItems.length,\n getScrollElement: () => parentRef.current,\n getItemKey: useCallback((index: number) => flatItems[index].id, [flatItems]),\n estimateSize: () => 28,\n overscan: 10,\n });\n const items = virtualizer.getVirtualItems();\n const expandAndScrollToNode = useExpandAndScrollToNode({ rootNodes, flatItems, expandNode, virtualizer });\n\n const renameContext = useTreeNodeRenameContextValue({\n getEditingProps,\n });\n useImperativeHandle(forwardedRef, () => ({\n renameNode: (nodePredicate) =>\n expandAndScrollToNode({\n nodePredicate,\n onComplete: (targetNode) => {\n // give time to scroll node into view before starting rename\n requestAnimationFrame(() => renameContext.startRename(targetNode));\n },\n }),\n }));\n\n const cancelRename = renameContext.cancelRename;\n const isScrolling = virtualizer.isScrolling;\n useEffect(() => {\n if (isScrolling) {\n // cancel rename when scroll is initiated\n cancelRename();\n }\n }, [isScrolling, cancelRename]);\n\n const errorRendererProps: TreeErrorRendererProps = {\n treeLabel,\n errorNodes,\n scrollToNode: (node) => expandAndScrollToNode({ nodePredicate: (n) => n.id === node.id }),\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree: useCallback<TreeErrorRendererProps[\"reloadTree\"]>(({ parentNodeId }) => reloadTree({ parentNodeId, state: \"reset\" }), [reloadTree]),\n };\n\n const getSelectedNodes = useMemo(() => {\n let calculatedSelectedNodes: TreeNode[] | undefined;\n return () => {\n if (calculatedSelectedNodes === undefined) {\n calculatedSelectedNodes = flatItems\n .filter((item): item is FlatTreeNodeItem => !isPlaceholderItem(item) && isNodeSelected(item.id))\n .map((item) => item.node);\n }\n return calculatedSelectedNodes;\n };\n }, [flatItems, isNodeSelected]);\n\n return (\n <LocalizationContextProvider localizedStrings={localizedStrings}>\n {errorRenderer ? errorRenderer(errorRendererProps) : <TreeErrorRenderer {...errorRendererProps} />}\n <div id={id} style={{ height: \"100%\", width: \"100%\", overflowY: \"auto\" }} ref={parentRef}>\n <Tree.Root\n {...treeRootProps}\n style={{ height: virtualizer.getTotalSize(), minHeight: \"100%\", width: \"100%\", position: \"relative\", overflow: \"hidden\" }}\n >\n <TreeNodeRenameContextProvider value={renameContext}>\n {items.map((virtualizedItem) => {\n const item = flatItems[virtualizedItem.index];\n const selected = isNodeSelected(item.id);\n return (\n <VirtualTreeItem\n ref={virtualizer.measureElement}\n key={virtualizedItem.key}\n data-index={virtualizedItem.index}\n start={virtualizedItem.start}\n item={item}\n selected={selected}\n expandNode={expandNode}\n reloadTree={reloadTree}\n handleNodeSelect={handleNodeSelect}\n getSelectedNodes={getSelectedNodes}\n getContextMenuActions={getContextMenuActions}\n getInlineActions={getInlineActions}\n getMenuActions={getMenuActions}\n getTreeItemProps={getTreeItemProps}\n />\n );\n })}\n </TreeNodeRenameContextProvider>\n </Tree.Root>\n </div>\n </LocalizationContextProvider>\n );\n});\n\nfunction useExpandAndScrollToNode({\n rootNodes,\n flatItems,\n expandNode,\n virtualizer,\n}: Pick<StrataKitTreeRendererProps, \"rootNodes\" | \"expandNode\"> & {\n flatItems: ReturnType<typeof useFlatTreeItems>;\n virtualizer: Pick<ReturnType<typeof useVirtualizer>, \"scrollToIndex\">;\n}) {\n const expandToNode = (nodePredicate: (node: TreeNode) => boolean) => {\n const pathToNode = findPathToNode(rootNodes, nodePredicate);\n if (!pathToNode) {\n return undefined;\n }\n const targetNode = pathToNode.pop()!;\n const collapsedNodes = pathToNode.filter((pathNode) => !pathNode.isExpanded);\n collapsedNodes.forEach((node) => expandNode(node.id, true));\n return { targetNode, didExpand: collapsedNodes.length > 0 };\n };\n\n const scrollToNode = useRef<{ id: string; onScrollComplete?: () => void } | undefined>(undefined);\n useEffect(() => {\n if (scrollToNode.current === undefined) {\n return;\n }\n const targetNodeId = scrollToNode.current.id;\n const index = flatItems.findIndex((flatItem) => flatItem.id === targetNodeId);\n if (index === -1) {\n return;\n }\n virtualizer.scrollToIndex(index, { align: \"auto\" });\n scrollToNode.current.onScrollComplete?.();\n scrollToNode.current = undefined;\n }, [flatItems, virtualizer]);\n\n return ({ nodePredicate, onComplete }: { nodePredicate: (node: TreeNode) => boolean; onComplete?: (targetNode: TreeNode) => void }) => {\n const expandResult = expandToNode(nodePredicate);\n if (!expandResult) {\n return \"node-not-found\";\n }\n\n const { targetNode, didExpand } = expandResult;\n if (didExpand) {\n scrollToNode.current = {\n id: targetNode.id,\n onScrollComplete: onComplete ? () => onComplete(targetNode) : undefined,\n };\n } else {\n const index = flatItems.findIndex((flatItem) => flatItem.id === targetNode.id);\n virtualizer.scrollToIndex(index, { align: \"auto\" });\n onComplete?.(targetNode);\n }\n return \"success\";\n };\n}\n\nfunction findPathToNode(rootNodes: TreeNode[], nodePredicate: (node: TreeNode) => boolean): TreeNode[] | undefined {\n for (const parent of rootNodes) {\n if (nodePredicate(parent)) {\n return [parent];\n }\n if (parent.children !== true) {\n const childPath = findPathToNode(parent.children, nodePredicate);\n if (childPath) {\n return [parent, ...childPath];\n }\n }\n }\n return undefined;\n}\n\ntype VirtualTreeItemProps = Omit<HierarchyNodeItemProps, \"item\"> & {\n start: number;\n \"data-index\": number;\n item: FlatTreeItem;\n};\n\nconst VirtualTreeItem = memo(\n forwardRef<HTMLElement, VirtualTreeItemProps>(function VirtualTreeItem({ start, item, ...props }, forwardedRef) {\n const style: CSSProperties = useMemo(\n () => ({\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n transform: `translateY(${start}px)`,\n willChange: \"transform\",\n }),\n [start],\n );\n\n if (isPlaceholderItem(item)) {\n return <PlaceholderNode ref={forwardedRef} data-index={props[\"data-index\"]} style={style} aria-level={item.level} aria-posinset={1} aria-setsize={1} />;\n }\n\n return <HierarchyNodeItem {...props} ref={forwardedRef} style={style} item={item} />;\n }),\n);\n\ntype HierarchyNodeItemProps = {\n item: FlatTreeNodeItem;\n style?: CSSProperties;\n getSelectedNodes: () => TreeNode[];\n} & Pick<TreeNodeRendererProps, \"expandNode\" | \"reloadTree\" | \"selected\"> &\n Pick<TreeRendererOwnProps, \"getContextMenuActions\" | \"getInlineActions\" | \"getMenuActions\" | \"getTreeItemProps\"> &\n Pick<ReturnType<typeof useSelectionHandler>, \"handleNodeSelect\">;\n\nconst HierarchyNodeItem = memo(\n forwardRef<HTMLElement, HierarchyNodeItemProps>(function HierarchyNodeItem(\n { item, selected, getTreeItemProps, handleNodeSelect, getSelectedNodes, getMenuActions, getInlineActions, getContextMenuActions, ...rest },\n forwardedRef,\n ) {\n const nodeRef = useRef<HTMLElement>(null);\n const node = item.node;\n const treeItemProps = getTreeItemProps?.(node);\n\n const isDisabled = treeItemProps?.[\"aria-disabled\"] === true;\n const nodeActions = useMemo(\n () => ({\n menuActions: getMenuActions ? getMenuActions({ targetNode: node, selectedNodes: getSelectedNodes() }) : undefined,\n inlineActions: getInlineActions ? getInlineActions({ targetNode: node, selectedNodes: getSelectedNodes() }) : undefined,\n contextMenuActions: getContextMenuActions ? getContextMenuActions({ targetNode: node, selectedNodes: getSelectedNodes() }) : undefined,\n }),\n [node, getMenuActions, getInlineActions, getContextMenuActions, getSelectedNodes],\n );\n\n const onClick = useEvent<Required<TreeNodeRendererProps>[\"onClick\"]>((e) => {\n if (treeItemProps?.onClick) {\n treeItemProps.onClick(e);\n }\n // ignore if this is double click\n if (isDisabled || e.detail > 1) {\n return;\n }\n handleNodeSelect({ nodeId: node.id, isSelected: selected ?? false, shiftDown: e.shiftKey, ctrlDown: e.ctrlKey });\n });\n\n const onMouseDown = useEvent<Required<TreeNodeRendererProps>[\"onMouseDown\"]>((e) => {\n if (treeItemProps?.onMouseDown) {\n treeItemProps.onMouseDown(e);\n }\n // prevent text selection on shift+click\n if (e.shiftKey) {\n e.preventDefault();\n }\n });\n\n const ref = useMergedRefs(forwardedRef, nodeRef);\n return (\n <StrataKitTreeNodeRenderer\n {...treeItemProps}\n {...rest}\n {...nodeActions}\n ref={ref}\n aria-level={item.level}\n aria-posinset={item.posInLevel}\n aria-setsize={item.levelSize}\n node={item.node}\n selected={selected}\n onClick={onClick}\n onMouseDown={onMouseDown}\n />\n );\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwFA,MAAa6D,wBAA0H7D,WAGrI,SAAS6D,sBAAsBlB,OAAOmB,cAAc;CACpD,MAAM,EACJvB,IACAwB,WACAC,aACAvB,eACAwB,YACAzB,WACA0B,kBACAC,0BACAC,sBACAC,YACAC,gBACA5B,eACAI,eACAS,uBACAX,iBACAU,kBACAH,gBACAD,qBACEP;CACJ,MAAM,EAAE4B,qBAAqB9D,oBAAoB;EAC/CsD;EACAC;EACAvB,eAAeA,iBAAiB;EACjC,CAAC;CACF,MAAM+B,YAAY1D,iBAAiBiD,UAAU;CAC7C,MAAMU,aAAa5D,cAAckD,UAAU;CAE3C,MAAMW,YAAYpE,OAAuB,KAAK;CAG9C,MAAMsE,cAAcpE,eAAe;EACjCqE,OAAOL,UAAUM;EACjBC,wBAAwBL,UAAUM;EAClCC,YAAY/E,aAAagF,UAAkBV,UAAUU,OA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Node.js";
|
|
2
|
+
import { HierarchyLevelDetails, TreeRendererProps } from "./presentation-hierarchies-react/Renderers.js";
|
|
3
|
+
import { useTree, useUnifiedSelectionTree } from "./presentation-hierarchies-react/UseTree.js";
|
|
4
|
+
import { useNodeHighlighting } from "./presentation-hierarchies-react/UseNodeHighlighting.js";
|
|
5
|
+
import { useIModelTree, useIModelUnifiedSelectionTree } from "./presentation-hierarchies-react/UseIModelTree.js";
|
|
6
|
+
import { TreeActionBase, TreeActionBaseAttributes } from "./presentation-hierarchies-react/stratakit/TreeAction.js";
|
|
7
|
+
import { TreeNodeFilterAction } from "./presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js";
|
|
8
|
+
import { TreeNodeRenameAction } from "./presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js";
|
|
9
|
+
import { LocalizationContextProvider } from "./presentation-hierarchies-react/stratakit/LocalizationContext.js";
|
|
10
|
+
import { FlatTreeItem, useErrorNodes, useFlatTreeItems } from "./presentation-hierarchies-react/stratakit/FlatTreeNode.js";
|
|
11
|
+
import { ErrorItemRenderer } from "./presentation-hierarchies-react/stratakit/ErrorItemRenderer.js";
|
|
12
|
+
import { TreeErrorRenderer } from "./presentation-hierarchies-react/stratakit/TreeErrorRenderer.js";
|
|
13
|
+
import { StrataKitTreeRenderer, StrataKitTreeRendererAttributes } from "./presentation-hierarchies-react/stratakit/TreeRenderer.js";
|
|
14
|
+
import { StrataKitRootErrorRenderer } from "./presentation-hierarchies-react/stratakit/RootErrorRenderer.js";
|
|
15
|
+
import { GenericInstanceFilter, HierarchyNode, HierarchyProvider, getLogger, setLogger } from "@itwin/presentation-hierarchies";
|
|
16
|
+
import { SelectionStorage } from "@itwin/unified-selection";
|
|
17
|
+
export { type ErrorInfo, ErrorItemRenderer, type FlatTreeItem, type GenericErrorInfo, GenericInstanceFilter, type HierarchyLevelDetails, HierarchyNode, type HierarchyProvider, LocalizationContextProvider, type ResultSetTooLargeErrorInfo, type SelectionStorage, StrataKitRootErrorRenderer, StrataKitTreeRenderer, type StrataKitTreeRendererAttributes, TreeActionBase, type TreeActionBaseAttributes, TreeErrorRenderer, type TreeNode, TreeNodeFilterAction, TreeNodeRenameAction, type TreeRendererProps, getLogger, setLogger, useErrorNodes, useFlatTreeItems, useIModelTree, useIModelUnifiedSelectionTree, useNodeHighlighting, useTree, useUnifiedSelectionTree };
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
export { LocalizationContextProvider } from "./presentation-hierarchies-react/stratakit/LocalizationContext.js";
|
|
17
|
-
export { GenericInstanceFilter, HierarchyNode, getLogger, setLogger } from "@itwin/presentation-hierarchies";
|
|
18
|
-
//# sourceMappingURL=presentation-hierarchies-react.js.map
|
|
1
|
+
import { useTree, useUnifiedSelectionTree } from "./presentation-hierarchies-react/UseTree.js";
|
|
2
|
+
import { useNodeHighlighting } from "./presentation-hierarchies-react/UseNodeHighlighting.js";
|
|
3
|
+
import { useIModelTree, useIModelUnifiedSelectionTree } from "./presentation-hierarchies-react/UseIModelTree.js";
|
|
4
|
+
import { TreeActionBase } from "./presentation-hierarchies-react/stratakit/TreeAction.js";
|
|
5
|
+
import { LocalizationContextProvider } from "./presentation-hierarchies-react/stratakit/LocalizationContext.js";
|
|
6
|
+
import { TreeNodeFilterAction } from "./presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js";
|
|
7
|
+
import { TreeNodeRenameAction } from "./presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js";
|
|
8
|
+
import { useErrorNodes, useFlatTreeItems } from "./presentation-hierarchies-react/stratakit/FlatTreeNode.js";
|
|
9
|
+
import { ErrorItemRenderer } from "./presentation-hierarchies-react/stratakit/ErrorItemRenderer.js";
|
|
10
|
+
import { TreeErrorRenderer } from "./presentation-hierarchies-react/stratakit/TreeErrorRenderer.js";
|
|
11
|
+
import { StrataKitTreeRenderer } from "./presentation-hierarchies-react/stratakit/TreeRenderer.js";
|
|
12
|
+
import { StrataKitRootErrorRenderer } from "./presentation-hierarchies-react/stratakit/RootErrorRenderer.js";
|
|
13
|
+
import { GenericInstanceFilter, HierarchyNode, getLogger, setLogger } from "@itwin/presentation-hierarchies";
|
|
14
|
+
|
|
15
|
+
export { ErrorItemRenderer, GenericInstanceFilter, HierarchyNode, LocalizationContextProvider, StrataKitRootErrorRenderer, StrataKitTreeRenderer, TreeActionBase, TreeErrorRenderer, TreeNodeFilterAction, TreeNodeRenameAction, getLogger, setLogger, useErrorNodes, useFlatTreeItems, useIModelTree, useIModelUnifiedSelectionTree, useNodeHighlighting, useTree, useUnifiedSelectionTree };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/presentation-hierarchies-react",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.54",
|
|
4
4
|
"description": "React components based on `@itwin/presentation-hierarchies`",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
],
|
|
30
30
|
"type": "module",
|
|
31
31
|
"types": "lib/esm/presentation-hierarchies-react.d.ts",
|
|
32
|
-
"module": "lib/esm/presentation-hierarchies-react.js",
|
|
33
32
|
"exports": {
|
|
34
33
|
".": {
|
|
35
34
|
"import": "./lib/esm/presentation-hierarchies-react.js"
|
|
@@ -37,15 +36,16 @@
|
|
|
37
36
|
"./package.json": "./package.json"
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"@itwin/core-bentley": "^5.5.
|
|
39
|
+
"@itwin/core-bentley": "^5.5.2",
|
|
41
40
|
"@tanstack/react-virtual": "^3.13.13",
|
|
42
41
|
"classnames": "^2.5.1",
|
|
43
42
|
"immer": "^10.2.0",
|
|
43
|
+
"react-compiler-runtime": "^1.0.0",
|
|
44
44
|
"react-error-boundary": "^4.1.2",
|
|
45
45
|
"rxjs": "^7.8.2",
|
|
46
|
-
"@itwin/presentation-hierarchies": "^2.0.0-alpha.
|
|
47
|
-
"@itwin/presentation-shared": "^2.0.0-alpha.
|
|
48
|
-
"@itwin/unified-selection": "^1.6.6
|
|
46
|
+
"@itwin/presentation-hierarchies": "^2.0.0-alpha.11",
|
|
47
|
+
"@itwin/presentation-shared": "^2.0.0-alpha.7",
|
|
48
|
+
"@itwin/unified-selection": "^1.6.6"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@stratakit/bricks": "^0.5.4",
|
|
@@ -70,14 +70,15 @@
|
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@itwin/build-tools": "^5.5.
|
|
73
|
+
"@itwin/build-tools": "^5.5.2",
|
|
74
74
|
"@itwin/eslint-plugin": "5.1.0",
|
|
75
|
+
"@rollup/plugin-babel": "^6.1.0",
|
|
75
76
|
"@stratakit/bricks": "^0.5.4",
|
|
76
77
|
"@stratakit/foundations": "^0.4.5",
|
|
77
78
|
"@stratakit/icons": "^0.2.2",
|
|
78
79
|
"@stratakit/structures": "^0.5.4",
|
|
79
80
|
"@testing-library/dom": "^10.4.1",
|
|
80
|
-
"@testing-library/react": "^16.3.
|
|
81
|
+
"@testing-library/react": "^16.3.2",
|
|
81
82
|
"@testing-library/user-event": "^14.6.1",
|
|
82
83
|
"@types/chai": "^5.2.3",
|
|
83
84
|
"@types/chai-as-promised": "^8.0.2",
|
|
@@ -88,13 +89,14 @@
|
|
|
88
89
|
"@types/react-dom": "^18.3.7",
|
|
89
90
|
"@types/sinon": "^17.0.4",
|
|
90
91
|
"@types/sinon-chai": "^4.0.0",
|
|
91
|
-
"
|
|
92
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
92
93
|
"chai": "^5.3.3",
|
|
93
94
|
"chai-as-promised": "^8.0.2",
|
|
94
95
|
"cpx2": "^7.0.2",
|
|
95
96
|
"cross-env": "^7.0.3",
|
|
96
97
|
"eslint": "^9.39.2",
|
|
97
98
|
"eslint-plugin-react": "^7.37.5",
|
|
99
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
98
100
|
"global-jsdom": "^26.0.0",
|
|
99
101
|
"ignore-styles": "^5.0.1",
|
|
100
102
|
"jsdom": "^26.1.0",
|
|
@@ -104,16 +106,17 @@
|
|
|
104
106
|
"rimraf": "^6.1.2",
|
|
105
107
|
"sinon": "^19.0.5",
|
|
106
108
|
"sinon-chai": "^4.0.1",
|
|
109
|
+
"tsdown": "^0.20.1",
|
|
107
110
|
"typescript": "~5.7.3",
|
|
108
111
|
"presentation-test-utilities": "^0.0.1"
|
|
109
112
|
},
|
|
110
113
|
"scripts": {
|
|
111
|
-
"build": "npm run -s build:
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
+
"build": "tsdown && npm run -s copy:css && npm run -s build:test",
|
|
115
|
+
"copy:css": "cpx \"./src/**/*.css\" ./lib/esm",
|
|
116
|
+
"build:test": "tsdown --config tsdown.test.config.ts",
|
|
114
117
|
"clean": "rimraf lib build",
|
|
115
|
-
"cover": "
|
|
116
|
-
"lint": "eslint ./src/**/*.{ts,tsx}",
|
|
118
|
+
"cover": "npm -s test",
|
|
119
|
+
"lint": "eslint \"./src/**/*.{ts,tsx}\"",
|
|
117
120
|
"test:dev": "node --experimental-test-module-mocks --enable-source-maps --import presentation-test-utilities/node-hooks/ignore-styles ./node_modules/mocha/bin/mocha.js --config ./.mocharc.json",
|
|
118
121
|
"test": "npm run test:dev -- --parallel --jobs=4",
|
|
119
122
|
"extract-api": "betools extract-api --entry=lib/esm/presentation-hierarchies-react --apiReportFolder=./api --apiReportTempFolder=./api/temp --apiSummaryFolder=./api --includeUnexportedApis",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=Renderers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Renderers.js","sourceRoot":"","sources":["../../../src/presentation-hierarchies-react/Renderers.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { GenericInstanceFilter, HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport { InstanceKey } from \"@itwin/presentation-shared\";\nimport { ErrorInfo, TreeNode } from \"./TreeNode.js\";\nimport { SelectionChangeType } from \"./UseSelectionHandler.js\";\n\n/**\n * Type definition used to render tree rendering UI component.\n * @alpha\n */\nexport type TreeRendererProps = {\n /**\n * Array containing root tree nodes.\n */\n rootNodes: TreeNode[];\n /**\n * A function that should be called to either expand or collapse the given node.\n */\n expandNode: (nodeId: string, isExpanded: boolean) => void;\n /**\n * A function that should be called to select nodes in the tree.\n * @param nodeIds Ids of the nodes that are selected.\n * @param changeType Type of change that occurred for the selection.\n */\n selectNodes: (nodeIds: Array<string>, changeType: SelectionChangeType) => void;\n /** Determines whether a given node is selected. */\n isNodeSelected: (nodeId: string) => boolean;\n} & CommonRendererProps;\n\n/**\n * Type definition used to render root error handling UI component.\n * @alpha\n */\nexport type RootErrorRendererProps = {\n /** Object containing root error information */\n error: ErrorInfo;\n} & CommonRendererProps;\n\n/**\n * @alpha\n */\ninterface CommonRendererProps {\n /**\n * A function that should be called to reload the tree.\n */\n reloadTree: (options?: ReloadTreeOptions) => void;\n /** Returns hierarchy level details for a given node ID. */\n getHierarchyLevelDetails: (nodeId: string | undefined) => HierarchyLevelDetails | undefined;\n}\n\n/**\n * Options for doing either full or a sub tree reload.\n * @public\n */\ninterface ReloadTreeOptions {\n /** Specifies parent node under which sub tree should be reloaded. */\n parentNodeId: string | undefined;\n\n /**\n * Specifies how current tree state should be handled:\n * - `keep` - try to keep current tree state (expanded/collapsed nodes, instance filters, etc.).\n * - `discard` - do not try to keep current tree state. Tree model will be update after nodes are reloaded.\n * - `reset` - remove subtree from the model before reloading and reload nodes ignoring cache.\n *\n * Defaults to `\"keep\"`.\n */\n state?: \"keep\" | \"discard\" | \"reset\";\n}\n\n/**\n * A data structure that contains information about a single hierarchy level.\n * @public\n */\nexport interface HierarchyLevelDetails {\n /** The parent node whose hierarchy level's information is contained in this data structure */\n hierarchyNode: HierarchyNode | undefined;\n\n /** A function to get instance keys of the hierarchy level. */\n getInstanceKeysIterator: (props?: {\n instanceFilter?: GenericInstanceFilter;\n hierarchyLevelSizeLimit?: number | \"unbounded\";\n }) => AsyncIterableIterator<InstanceKey>;\n\n /** Get the limit of how many nodes can be loaded in this hierarchy level. */\n sizeLimit?: number | \"unbounded\";\n /** Set the limit of how many nodes can be loaded in this hierarchy level. */\n setSizeLimit: (value: undefined | number | \"unbounded\") => void;\n\n /** Get the active instance filter applied to this hierarchy level. */\n instanceFilter?: GenericInstanceFilter;\n /** Set the instance filter to apply to this hierarchy level */\n setInstanceFilter: (filter: GenericInstanceFilter | undefined) => void;\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=TreeNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNode.js","sourceRoot":"","sources":["../../../src/presentation-hierarchies-react/TreeNode.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { HierarchyNode } from \"@itwin/presentation-hierarchies\";\n\n/**\n * A type that defines an node in a UI tree component, built with `useTree` hook.\n * @public\n */\nexport interface TreeNode {\n id: string;\n label: string;\n children: true | Array<TreeNode>;\n isExpanded: boolean;\n isLoading: boolean;\n isFilterable: boolean;\n isFiltered: boolean;\n /** UI-agnostic source of this node object. */\n nodeData: HierarchyNode;\n /** Contains error encountered from expanding the node */\n error?: ErrorInfo;\n}\n\n/**\n * A type of `ErrorInfo` that is returned,\n * when none of the child nodes match the filter.\n *\n * @public\n */\nexport interface NoFilterMatchesErrorInfo {\n id: string;\n type: \"NoFilterMatches\";\n}\n\n/**\n * A type of `ErrorInfo` that is returned, when the\n * number of child nodes exceeds the limit set on the tree nodes loader. The limit is also included\n * on this error as `resultSetSizeLimit` attribute.\n *\n * @public\n */\nexport interface ResultSetTooLargeErrorInfo {\n id: string;\n type: \"ResultSetTooLarge\";\n resultSetSizeLimit: number;\n}\n\n/**\n * A type of `ErrorInfo` that contains a user-friendly message to be displayed in the UI.\n * Created in cases like an error loading children. The\n * renderer may offer users to re-load the children or the whole component in such cases.\n *\n * @public\n */\nexport interface ChildrenLoadErrorInfo {\n id: string;\n type: \"ChildrenLoad\";\n message: string;\n}\n\n/**\n * A type of `ErrorInfo` that can be used to show/handle generic errors,\n * that might not be directly caused by the tree components. (e.g. tree components\n * shows hierarchy of connections to external systems and an error is show in the\n * tree when some connections are unreachable).\n *\n * @public\n */\nexport interface GenericErrorInfo {\n id: string;\n type: \"Unknown\";\n message: string;\n additionalData?: unknown;\n}\n\n/**\n * A collection of types that defines an error state for `TreeNode` node in a UI tree component, built\n * with `useTree` hook.\n *\n * @public\n */\nexport type ErrorInfo = GenericErrorInfo | ResultSetTooLargeErrorInfo | NoFilterMatchesErrorInfo | ChildrenLoadErrorInfo;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { LegacyRef, MutableRefObject, Ref } from "react";
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare function useLatest<T>(value: T): MutableRefObject<T>;
|
|
4
|
-
/** @internal */
|
|
5
|
-
export declare function useEvent<TCallback extends (...args: any[]) => void>(callback: TCallback): (...args: Parameters<TCallback>) => void;
|
|
6
|
-
/** @internal */
|
|
7
|
-
export declare function useMergedRefs<T>(...refs: ReadonlyArray<Ref<T> | LegacyRef<T> | undefined | null>): (instance: T | null) => void;
|
|
8
|
-
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../src/presentation-hierarchies-react/Utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAA2C,MAAM,OAAO,CAAC;AAElG,gBAAgB;AAChB,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,uBAQpC;AAGD,gBAAgB;AAChB,wBAAgB,QAAQ,CAAC,SAAS,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,QAAQ,EAAE,SAAS,aAI1E,UAAU,CAAC,SAAS,CAAC,UAKlC;AAID,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,cAElF,CAAC,GAAG,IAAI,UAWtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisposePolyfill.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/internal/DisposePolyfill.ts"],"names":[],"mappings":""}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import "./DisposePolyfill.js";
|
|
2
|
-
import { GenericInstanceFilter, HierarchyNode, HierarchyProvider } from "@itwin/presentation-hierarchies";
|
|
3
|
-
import { SelectionChangeType } from "../UseSelectionHandler.js";
|
|
4
|
-
import { TreeModel, TreeModelHierarchyNode, TreeModelRootNode } from "./TreeModel.js";
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare class TreeActions {
|
|
7
|
-
private _onModelChanged;
|
|
8
|
-
private _onLoad;
|
|
9
|
-
private _onHierarchyLimitExceeded;
|
|
10
|
-
private _onHierarchyLoadError;
|
|
11
|
-
private _loader;
|
|
12
|
-
private _nodeIdFactory;
|
|
13
|
-
private _currentModel;
|
|
14
|
-
private _reset;
|
|
15
|
-
private _nodeLoader;
|
|
16
|
-
constructor(_onModelChanged: (model: TreeModel) => void, _onLoad: (actionType: "initial-load" | "hierarchy-level-load" | "reload", duration: number) => void, _onHierarchyLimitExceeded: (props: {
|
|
17
|
-
parentId?: string;
|
|
18
|
-
filter?: GenericInstanceFilter;
|
|
19
|
-
limit?: number | "unbounded";
|
|
20
|
-
}) => void, _onHierarchyLoadError: (props: {
|
|
21
|
-
parentId?: string;
|
|
22
|
-
type: "timeout" | "unknown";
|
|
23
|
-
error: unknown;
|
|
24
|
-
}) => void, nodeIdFactory?: (node: Pick<HierarchyNode, "key" | "parentKeys">) => string, seed?: TreeModel);
|
|
25
|
-
private createNodeLoader;
|
|
26
|
-
private updateTreeModel;
|
|
27
|
-
private handleLoadedHierarchy;
|
|
28
|
-
private onLoadingComplete;
|
|
29
|
-
private getLoadAction;
|
|
30
|
-
private loadSubTree;
|
|
31
|
-
private loadNodes;
|
|
32
|
-
private reloadSubTree;
|
|
33
|
-
reset(): void;
|
|
34
|
-
setHierarchyProvider(provider?: HierarchyProvider): void;
|
|
35
|
-
getNode(nodeId: string | undefined): TreeModelHierarchyNode | TreeModelRootNode | undefined;
|
|
36
|
-
selectNodes(nodeIds: Array<string>, changeType: SelectionChangeType): void;
|
|
37
|
-
expandNode(nodeId: string, isExpanded: boolean): {
|
|
38
|
-
complete: Promise<void>;
|
|
39
|
-
};
|
|
40
|
-
setHierarchyLimit(nodeId: string | undefined, limit?: number | "unbounded"): {
|
|
41
|
-
complete: Promise<void>;
|
|
42
|
-
};
|
|
43
|
-
setInstanceFilter(nodeId: string | undefined, filter?: GenericInstanceFilter): {
|
|
44
|
-
complete: Promise<void>;
|
|
45
|
-
};
|
|
46
|
-
reloadTree(options?: {
|
|
47
|
-
parentNodeId?: string;
|
|
48
|
-
state?: "keep" | "discard" | "reset";
|
|
49
|
-
}): {
|
|
50
|
-
complete: Promise<void>;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=TreeActions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeActions.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/internal/TreeActions.ts"],"names":[],"mappings":"AAKA,OAAO,sBAAsB,CAAC;AAI9B,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAE1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AActF,gBAAgB;AAChB,qBAAa,WAAW;IAQpB,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,yBAAyB;IACjC,OAAO,CAAC,qBAAqB;IAV/B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,cAAc,CAA8D;IACpF,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAqC;gBAG9C,eAAe,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,EAC3C,OAAO,EAAE,CAAC,UAAU,EAAE,cAAc,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B;;;IAc5E,UAAU,CAAC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;KAAE;;;CAa5F"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Observable } from "rxjs";
|
|
2
|
-
import { GenericInstanceFilter, HierarchyNode, HierarchyProvider } from "@itwin/presentation-hierarchies";
|
|
3
|
-
import { ErrorInfo } from "../TreeNode.js";
|
|
4
|
-
import { TreeModelHierarchyNode, TreeModelRootNode } from "./TreeModel.js";
|
|
5
|
-
/** @internal */
|
|
6
|
-
export type LoadedTreePart = {
|
|
7
|
-
parent: TreeModelHierarchyNode | TreeModelRootNode;
|
|
8
|
-
} & ({
|
|
9
|
-
loadedNodes: TreeModelHierarchyNode[];
|
|
10
|
-
} | {
|
|
11
|
-
error: ErrorInfo;
|
|
12
|
-
});
|
|
13
|
-
/** @internal */
|
|
14
|
-
export interface HierarchyLevelOptions {
|
|
15
|
-
instanceFilter?: GenericInstanceFilter;
|
|
16
|
-
hierarchyLevelSizeLimit?: number | "unbounded";
|
|
17
|
-
}
|
|
18
|
-
/** @internal */
|
|
19
|
-
export interface LoadNodesOptions {
|
|
20
|
-
parent: TreeModelHierarchyNode | TreeModelRootNode;
|
|
21
|
-
getHierarchyLevelOptions: (node: TreeModelRootNode | TreeModelHierarchyNode) => HierarchyLevelOptions;
|
|
22
|
-
shouldLoadChildren: (node: TreeModelHierarchyNode) => boolean;
|
|
23
|
-
buildNode?: (node: TreeModelHierarchyNode) => TreeModelHierarchyNode;
|
|
24
|
-
ignoreCache?: boolean;
|
|
25
|
-
}
|
|
26
|
-
/** @internal */
|
|
27
|
-
export interface ITreeLoader {
|
|
28
|
-
loadNodes(options: LoadNodesOptions): Observable<LoadedTreePart>;
|
|
29
|
-
}
|
|
30
|
-
/** @internal */
|
|
31
|
-
export declare class TreeLoader implements ITreeLoader {
|
|
32
|
-
private _hierarchyProvider;
|
|
33
|
-
private _onHierarchyLimitExceeded;
|
|
34
|
-
private _onHierarchyLoadError;
|
|
35
|
-
private _treeNodeIdFactory;
|
|
36
|
-
constructor(_hierarchyProvider: HierarchyProvider, _onHierarchyLimitExceeded: (props: {
|
|
37
|
-
parentId?: string;
|
|
38
|
-
filter?: GenericInstanceFilter;
|
|
39
|
-
limit?: number | "unbounded";
|
|
40
|
-
}) => void, _onHierarchyLoadError: (props: {
|
|
41
|
-
parentId?: string;
|
|
42
|
-
type: "timeout" | "unknown";
|
|
43
|
-
error: unknown;
|
|
44
|
-
}) => void, treeNodeIdFactory?: (node: Pick<HierarchyNode, "key" | "parentKeys">) => string);
|
|
45
|
-
private loadChildren;
|
|
46
|
-
loadNodes({ shouldLoadChildren, ...options }: LoadNodesOptions): Observable<LoadedTreePart | {
|
|
47
|
-
parent: TreeModelRootNode | TreeModelHierarchyNode;
|
|
48
|
-
error: {
|
|
49
|
-
id: string;
|
|
50
|
-
type: "ResultSetTooLarge";
|
|
51
|
-
resultSetSizeLimit: number;
|
|
52
|
-
};
|
|
53
|
-
} | {
|
|
54
|
-
parent: TreeModelRootNode | TreeModelHierarchyNode;
|
|
55
|
-
error: {
|
|
56
|
-
id: string;
|
|
57
|
-
type: "ChildrenLoad";
|
|
58
|
-
message: string;
|
|
59
|
-
};
|
|
60
|
-
}>;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=TreeLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeLoader.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/internal/TreeLoader.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0D,UAAU,EAAe,MAAM,MAAM,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,iBAAiB,EAA0B,MAAM,iCAAiC,CAAC;AAClI,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,sBAA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AAC,EAAE,UAAU,EAAE,mBAAmB,QAcpG;IAED,SAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGxE;IAED,SAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,sBAAsB,GAAG,iBAAiB,GAAG,SAAS,CAK5H;IAED,SAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,OAAO,QAW5F;CACF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import "./DisposePolyfill.js";
|
|
2
|
-
import { HierarchyNode } from "@itwin/presentation-hierarchies";
|
|
3
|
-
/** @internal */
|
|
4
|
-
export declare function createNodeId(node: Pick<HierarchyNode, "key" | "parentKeys">): string;
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare function sameNodes(lhs: HierarchyNode, rhs: HierarchyNode): boolean;
|
|
7
|
-
/** @internal */
|
|
8
|
-
export declare const MAX_LIMIT_OVERRIDE = 10000;
|
|
9
|
-
/**
|
|
10
|
-
* A helper that disposes the given object, if it's disposable.
|
|
11
|
-
*
|
|
12
|
-
* The first option is to dispose using the deprecated `dispose` method if it exists on the object.
|
|
13
|
-
* If not, we use the new `Symbol.dispose` method. If that doesn't exist either, the object is
|
|
14
|
-
* considered as non-disposable and nothing is done with it.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare function safeDispose(disposable: {} | {
|
|
19
|
-
[Symbol.dispose]: () => void;
|
|
20
|
-
} | {
|
|
21
|
-
dispose: () => void;
|
|
22
|
-
}): void;
|
|
23
|
-
//# sourceMappingURL=Utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/internal/Utils.ts"],"names":[],"mappings":"AAK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O,EAAE,2BAA2B,EAAE,MAAM,mEAAmE,CAAC;AAEhH,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAqB,SAAS,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nexport { GenericErrorInfo, TreeNode, ErrorInfo, ResultSetTooLargeErrorInfo } from \"./presentation-hierarchies-react/TreeNode.js\";\nexport { useTree, useUnifiedSelectionTree } from \"./presentation-hierarchies-react/UseTree.js\";\nexport { useNodeHighlighting } from \"./presentation-hierarchies-react/UseNodeHighlighting.js\";\nexport { HierarchyLevelDetails, TreeRendererProps } from \"./presentation-hierarchies-react/Renderers.js\";\nexport { useIModelTree, useIModelUnifiedSelectionTree } from \"./presentation-hierarchies-react/UseIModelTree.js\";\nexport { TreeActionBase, TreeActionBaseAttributes } from \"./presentation-hierarchies-react/stratakit/TreeAction.js\";\nexport { TreeNodeFilterAction } from \"./presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js\";\nexport { TreeNodeRenameAction } from \"./presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js\";\nexport { StrataKitTreeRenderer, StrataKitTreeRendererAttributes } from \"./presentation-hierarchies-react/stratakit/TreeRenderer.js\";\nexport { StrataKitRootErrorRenderer } from \"./presentation-hierarchies-react/stratakit/RootErrorRenderer.js\";\nexport { TreeErrorRenderer } from \"./presentation-hierarchies-react/stratakit/TreeErrorRenderer.js\";\nexport { ErrorItemRenderer } from \"./presentation-hierarchies-react/stratakit/ErrorItemRenderer.js\";\nexport { useFlatTreeItems, useErrorNodes, FlatTreeItem } from \"./presentation-hierarchies-react/stratakit/FlatTreeNode.js\";\nexport { LocalizationContextProvider } from \"./presentation-hierarchies-react/stratakit/LocalizationContext.js\";\n\nexport { GenericInstanceFilter, HierarchyNode, HierarchyProvider, getLogger, setLogger } from \"@itwin/presentation-hierarchies\";\nexport { SelectionStorage } from \"@itwin/unified-selection\";\n"]}
|