@itwin/presentation-hierarchies-react 2.0.0-alpha.63 → 2.0.0-alpha.65
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 +36 -0
- package/lib/presentation-hierarchies-react/FlatTreeNode.d.ts +1 -2
- package/lib/presentation-hierarchies-react/FlatTreeNode.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/FlatTreeNode.js.map +1 -1
- package/lib/presentation-hierarchies-react/LocalizationContext.d.ts +1 -5
- package/lib/presentation-hierarchies-react/LocalizationContext.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/LocalizationContext.js.map +1 -1
- package/lib/presentation-hierarchies-react/Renderers.d.ts +0 -1
- package/lib/presentation-hierarchies-react/Renderers.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/TreeNode.d.ts +1 -2
- package/lib/presentation-hierarchies-react/TreeNode.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/UseIModelTree.d.ts +0 -1
- package/lib/presentation-hierarchies-react/UseIModelTree.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/UseIModelTree.js.map +1 -1
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.d.ts +1 -4
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -1
- package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts +1 -0
- package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -1
- package/lib/presentation-hierarchies-react/UseTree.d.ts +4 -11
- package/lib/presentation-hierarchies-react/UseTree.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/UseTree.js +2 -1
- package/lib/presentation-hierarchies-react/UseTree.js.map +1 -1
- package/lib/presentation-hierarchies-react/Utils.js.map +1 -1
- package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js.map +1 -1
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js.map +1 -1
- package/lib/presentation-hierarchies-react/internal/TreeActions.js +5 -0
- package/lib/presentation-hierarchies-react/internal/TreeActions.js.map +1 -1
- package/lib/presentation-hierarchies-react/internal/TreeLoader.js +3 -0
- package/lib/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -1
- package/lib/presentation-hierarchies-react/internal/TreeModel.d.ts +2 -0
- package/lib/presentation-hierarchies-react/internal/TreeModel.js.map +1 -1
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +2 -1
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js +1 -1
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -1
- package/lib/presentation-hierarchies-react/internal/Utils.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts +1 -9
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js +45 -39
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts +2 -7
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.d.ts +3 -3
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts +1 -7
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts +0 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts +0 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts +3 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts +0 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +1 -1
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -1
- package/lib/presentation-hierarchies-react-extract.d.ts +2 -1
- package/package.json +16 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorItemRenderer.js","names":["Link","Typography","unstable_ErrorRegion","ErrorRegion","MAX_LIMIT_OVERRIDE","useTranslation","JSX","HierarchyLevelDetails","TreeRendererProps","ErrorInfo","TreeNode","ErrorItemRendererProps","Pick","treeNode","Omit","error","reloadTree","options","parentNodeId","scrollToNode","filterHierarchyLevel","hierarchyLevelDetails","ErrorItemRenderer","t0","$","_c","getHierarchyLevelDetails","translate","type","limit","resultSetSizeLimit","t1","id","setSizeLimit","onOverrideLimit","t2","t3","replace","toString","t4","t5","action","label","condition","t6","t7","t8","isFilterable","t9","t10","t11","t12","t13","hierarchyLevelDetails_0","_temp","_temp2","message","ErrorItemContainerProps","actions","MessageWithLinkProps","ErrorItemContainer","scrollToElement","filter","_temp3","map","_temp4","linkLabel","MessageWithLink","firstPart","splitMessage","split","trimEnd","trimStart","secondPart","Symbol","for","verticalAlign"],"sources":["../../../src/presentation-hierarchies-react/stratakit/ErrorItemRenderer.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 { Link, Typography } from \"@mui/material\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { MAX_LIMIT_OVERRIDE } from \"../internal/Utils.js\";\nimport { useTranslation } from \"../LocalizationContext.js\";\n\nimport type { JSX } from \"react\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { ErrorInfo, TreeNode } from \"../TreeNode.js\";\n\n/** @alpha */\nexport interface ErrorItemRendererProps extends Pick<TreeRendererProps, \"getHierarchyLevelDetails\"> {\n /** The tree node associated with the error. Used for displaying the node label in error messages and for scrolling to the node. */\n treeNode: Omit<TreeNode, \"errors\">;\n /** The error to render. */\n error: ErrorInfo;\n /** A callback to reload a hierarchy level when an error occurs and `retry` button is clicked. */\n reloadTree: (options: { parentNodeId: string | undefined }) => void;\n /** A callback to scroll to the node associated with the error. */\n scrollToNode: (treeNode: Omit<TreeNode, \"errors\">) => void;\n /** A callback to initiate filtering of the given hierarchy level. */\n filterHierarchyLevel?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n}\n\n/**\n * Renders StrataKit `<ErrorRegion.Item />` for all supported error types:\n * - `ResultSetTooLarge` - renders `resultLimitExceeded` message with actions to increase limit or apply filtering\n * - `NoFilterMatches` - renders `noFilteredChildren` message with action to change filter\n * - `ChildrenLoad` - renders `failedToCreateHierarchy` message with action to retry loading\n * - `Unknown` - renders message set on error object.\n *\n * @alpha\n */\nexport function ErrorItemRenderer({\n treeNode,\n error,\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree,\n scrollToNode,\n}: ErrorItemRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (error.type === \"ResultSetTooLarge\") {\n const limit = error.resultSetSizeLimit;\n const onOverrideLimit = () => getHierarchyLevelDetails(treeNode.id)?.setSizeLimit(MAX_LIMIT_OVERRIDE);\n return (\n <ErrorItemContainer\n treeNode={treeNode}\n actions={[\n {\n action: () => {\n onOverrideLimit();\n },\n label: translate(\"increaseHierarchyLimit\").replace(\"{{limit}}\", MAX_LIMIT_OVERRIDE.toString()),\n condition: () => limit < MAX_LIMIT_OVERRIDE,\n },\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(treeNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"increaseHierarchyLimitWithFiltering\"),\n condition: () => !!filterHierarchyLevel && !!treeNode.isFilterable,\n },\n ]}\n message={translate(\"resultLimitExceeded\").replace(\"{{limit}}\", limit.toString())}\n scrollToElement={() => scrollToNode(treeNode)}\n />\n );\n }\n if (error.type === \"NoFilterMatches\") {\n return (\n <ErrorItemContainer\n treeNode={treeNode}\n actions={[\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(treeNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"noFilteredChildrenChangeFilter\"),\n condition: () => true,\n },\n ]}\n message={translate(\"noFilteredChildren\")}\n scrollToElement={() => scrollToNode(treeNode)}\n />\n );\n }\n if (error.type === \"ChildrenLoad\") {\n return (\n <ErrorItemContainer\n treeNode={treeNode}\n actions={[\n { action: () => reloadTree({ parentNodeId: treeNode.id }), label: translate(\"retry\"), condition: () => true },\n ]}\n message={translate(\"failedToCreateHierarchy\")}\n scrollToElement={() => scrollToNode(treeNode)}\n />\n );\n }\n return (\n <ErrorItemContainer treeNode={treeNode} message={error.message} scrollToElement={() => scrollToNode(treeNode)} />\n );\n}\n\ntype ErrorItemContainerProps = {\n treeNode: Omit<TreeNode, \"errors\">;\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n} & Pick<MessageWithLinkProps, \"scrollToElement\">;\n\nfunction ErrorItemContainer({ treeNode, message, actions, scrollToElement }: ErrorItemContainerProps) {\n return (\n <ErrorRegion.Item\n message={<MessageWithLink linkLabel={treeNode.label} scrollToElement={scrollToElement} message={message} />}\n messageId={treeNode.id}\n actions={actions\n ?.filter(({ condition }) => condition())\n .map(({ label, action }) => (\n <Typography key={label} variant=\"caption\" render={<div />}>\n <Link render={<button type=\"button\" />} onClick={action}>\n {label}\n </Link>\n </Typography>\n ))}\n />\n );\n}\n\ninterface MessageWithLinkProps {\n scrollToElement: () => void;\n message: string;\n linkLabel?: string;\n}\n\nfunction MessageWithLink({ linkLabel, scrollToElement, message }: MessageWithLinkProps) {\n const splitMessage = message.split(\"{{node}}\", 2);\n const firstPart = splitMessage[0].trimEnd();\n const secondPart = splitMessage[1]?.trimStart();\n return (\n <div>\n {firstPart}{\" \"}\n <Link\n render={<button type=\"button\" />}\n onClick={scrollToElement}\n variant=\"caption\"\n style={{ verticalAlign: \"baseline\" }}\n >\n {linkLabel}\n </Link>\n {secondPart ? \" \" : \"\"}\n {secondPart ? secondPart : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAOsB,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAA2B,MAAA,EAAAZ,UAAAE,OAAAW,0BAAAN,sBAAAJ,YAAAG,iBAAAI;CAQhC,MAAAI,YAAkBtB,gBAAgB;AAElC,KAAIU,MAAKa,SAAU,qBAAmB;EACpC,MAAAC,QAAcd,MAAKe;EAAoB,IAAAC;AAAA,MAAAP,EAAA,OAAAE,4BAAAF,EAAA,OAAAX,UAAA;AACfkB,cAAML,yBAAyBb,SAAQmB,GAAkB,EAAAC,aAAC7B,mBAAmB;AAAAoB,KAAA,KAAAE;AAAAF,KAAA,KAAAX;AAAAW,KAAA,KAAAO;QAAAA,MAAAP,EAAA;EAArG,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AAA4C;AAAA5C,IAAA,KAAAO;QAAA;AAAAqC,cAAA5C,EAAA;AAAAO,OAAAP,EAAA;;CAA/C,MAAAiD,aAAmB1C;CAA6B,IAAAI;AAAA,KAAAX,EAAA,OAAAkD,OAAAC,IAAA,4BAAA,EAAA;AAKlCxC,OAAA,oBAAA,UAAA,EAAa,MAAA,UAAW,CAAA;AAAAX,IAAA,KAAAW;OAAAA,MAAAX,EAAA;CAAA,IAAAY;AAAA,KAAAZ,EAAA,OAAAkD,OAAAC,IAAA,4BAAA,EAAA;AAGzBvC,OAAA,EAAAwC,eAAiB,YAAY;AAAApD,IAAA,KAAAY;OAAAA,MAAAZ,EAAA;CAAA,IAAAe;AAAA,KAAAf,EAAA,OAAA0C,aAAA1C,EAAA,OAAAqC,iBAAA;AAJtCtB,OAAA,oBAAC,MAAD;GACU,QAAAJ;GACC0B,SAAAA;GACD,SAAA;GACD,OAAAzB;aAEN8B;GACI,CAAA;AAAA1C,IAAA,KAAA0C;AAAA1C,IAAA,KAAAqC;AAAArC,IAAA,KAAAe;OAAAA,MAAAf,EAAA;CACN,MAAAgB,KAAAiC,aAAA,MAAA;CACA,MAAA7B,KAAA6B,aAAAA,aAAA;CAA8B,IAAA5B;AAAA,KAAArB,EAAA,OAAA4C,aAAA5C,EAAA,OAAAe,MAAAf,EAAA,QAAAgB,MAAAhB,EAAA,QAAAoB,IAAA;AAXjCC,OAAA,qBAAA,OAAA,EAAA,UAAA;GACGuB;GAAW;GACZ7B;GAQCC;GACAI;GACG,EAAA,CAAA;AAAApB,IAAA,KAAA4C;AAAA5C,IAAA,KAAAe;AAAAf,IAAA,MAAAgB;AAAAhB,IAAA,MAAAoB;AAAApB,IAAA,MAAAqB;OAAAA,MAAArB,EAAA;AAAA,QAZNqB"}
|
|
1
|
+
{"version":3,"file":"ErrorItemRenderer.js","names":["Link","Typography","unstable_ErrorRegion","ErrorRegion","MAX_LIMIT_OVERRIDE","useTranslation","JSX","HierarchyLevelDetails","TreeRendererProps","ErrorInfo","TreeNode","ErrorItemRendererProps","Pick","treeNode","Omit","error","reloadTree","options","parentNodeId","scrollToNode","filterHierarchyLevel","hierarchyLevelDetails","ErrorItemRenderer","t0","$","_c","getHierarchyLevelDetails","translate","type","limit","resultSetSizeLimit","t1","id","setSizeLimit","onOverrideLimit","t2","t3","replace","toString","t4","t5","action","label","condition","t6","t7","t8","isFilterable","t9","t10","t11","t12","t13","hierarchyLevelDetails_0","_temp","_temp2","message","ErrorItemContainerProps","actions","MessageWithLinkProps","ErrorItemContainer","scrollToElement","filter","_temp3","map","_temp4","linkLabel","MessageWithLink","split","splitMessage","firstPart","secondPart","length","undefined","Symbol","for","verticalAlign","linkToNode"],"sources":["../../../src/presentation-hierarchies-react/stratakit/ErrorItemRenderer.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 { Link, Typography } from \"@mui/material\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { MAX_LIMIT_OVERRIDE } from \"../internal/Utils.js\";\nimport { useTranslation } from \"../LocalizationContext.js\";\n\nimport type { JSX } from \"react\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { ErrorInfo, TreeNode } from \"../TreeNode.js\";\n\n/** @alpha */\nexport interface ErrorItemRendererProps extends Pick<TreeRendererProps, \"getHierarchyLevelDetails\"> {\n /** The tree node associated with the error. Used for displaying the node label in error messages and for scrolling to the node. */\n treeNode: Omit<TreeNode, \"errors\">;\n /** The error to render. */\n error: ErrorInfo;\n /** A callback to reload a hierarchy level when an error occurs and `retry` button is clicked. */\n reloadTree: (options: { parentNodeId: string | undefined }) => void;\n /** A callback to scroll to the node associated with the error. */\n scrollToNode: (treeNode: Omit<TreeNode, \"errors\">) => void;\n /** A callback to initiate filtering of the given hierarchy level. */\n filterHierarchyLevel?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n}\n\n/**\n * Renders StrataKit `<ErrorRegion.Item />` for all supported error types:\n * - `ResultSetTooLarge` - renders `resultLimitExceeded` message with actions to increase limit or apply filtering\n * - `NoFilterMatches` - renders `noFilteredChildren` message with action to change filter\n * - `ChildrenLoad` - renders `failedToCreateHierarchy` message with action to retry loading\n * - `Unknown` - renders message set on error object.\n *\n * @alpha\n */\nexport function ErrorItemRenderer({\n treeNode,\n error,\n getHierarchyLevelDetails,\n filterHierarchyLevel,\n reloadTree,\n scrollToNode,\n}: ErrorItemRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (error.type === \"ResultSetTooLarge\") {\n const limit = error.resultSetSizeLimit;\n const onOverrideLimit = () => getHierarchyLevelDetails(treeNode.id)?.setSizeLimit(MAX_LIMIT_OVERRIDE);\n return (\n <ErrorItemContainer\n treeNode={treeNode}\n actions={[\n {\n action: () => {\n onOverrideLimit();\n },\n label: translate(\"increaseHierarchyLimit\").replace(\"{{limit}}\", MAX_LIMIT_OVERRIDE.toString()),\n condition: () => limit < MAX_LIMIT_OVERRIDE,\n },\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(treeNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"increaseHierarchyLimitWithFiltering\"),\n condition: () => !!filterHierarchyLevel && !!treeNode.isFilterable,\n },\n ]}\n message={translate(\"resultLimitExceeded\").replace(\"{{limit}}\", limit.toString())}\n scrollToElement={() => scrollToNode(treeNode)}\n />\n );\n }\n if (error.type === \"NoFilterMatches\") {\n return (\n <ErrorItemContainer\n treeNode={treeNode}\n actions={[\n {\n action: () => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(treeNode.id);\n hierarchyLevelDetails && filterHierarchyLevel?.(hierarchyLevelDetails);\n },\n label: translate(\"noFilteredChildrenChangeFilter\"),\n condition: () => true,\n },\n ]}\n message={translate(\"noFilteredChildren\")}\n scrollToElement={() => scrollToNode(treeNode)}\n />\n );\n }\n if (error.type === \"ChildrenLoad\") {\n return (\n <ErrorItemContainer\n treeNode={treeNode}\n actions={[\n { action: () => reloadTree({ parentNodeId: treeNode.id }), label: translate(\"retry\"), condition: () => true },\n ]}\n message={translate(\"failedToCreateHierarchy\")}\n scrollToElement={() => scrollToNode(treeNode)}\n />\n );\n }\n return (\n <ErrorItemContainer treeNode={treeNode} message={error.message} scrollToElement={() => scrollToNode(treeNode)} />\n );\n}\n\ntype ErrorItemContainerProps = {\n treeNode: Omit<TreeNode, \"errors\">;\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n} & Pick<MessageWithLinkProps, \"scrollToElement\">;\n\nfunction ErrorItemContainer({ treeNode, message, actions, scrollToElement }: ErrorItemContainerProps) {\n return (\n <ErrorRegion.Item\n message={<MessageWithLink linkLabel={treeNode.label} scrollToElement={scrollToElement} message={message} />}\n messageId={treeNode.id}\n actions={actions\n ?.filter(({ condition }) => condition())\n .map(({ label, action }) => (\n <Typography key={label} variant=\"caption\" render={<div />}>\n <Link render={<button type=\"button\" />} onClick={action}>\n {label}\n </Link>\n </Typography>\n ))}\n />\n );\n}\n\ninterface MessageWithLinkProps {\n scrollToElement: () => void;\n message: string;\n linkLabel?: string;\n}\n\nfunction MessageWithLink({ linkLabel, scrollToElement, message }: MessageWithLinkProps) {\n const splitMessage = message.split(\"{{node}}\", 2);\n const firstPart = splitMessage[0];\n const secondPart = splitMessage.length > 1 ? splitMessage[1] : undefined;\n const linkToNode = (\n <Link\n render={<button type=\"button\" />}\n onClick={scrollToElement}\n variant=\"caption\"\n style={{ verticalAlign: \"baseline\" }}\n >\n {linkLabel}\n </Link>\n );\n\n if (message.length === firstPart.length) {\n return (\n <div>\n {linkToNode}\n {\": \"}\n {firstPart}\n </div>\n );\n }\n\n return (\n <div>\n {firstPart}\n {linkToNode}\n {secondPart ? secondPart : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAOsB,kBA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B,UAAAA;EANE,CAAA;EAOE1C,EAAA,KAAA0C;EAAA1C,EAAA,KAAAqC;EAAArC,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CART,MAAAqD,aACEtC;CAUF,IAAIiB,QAAOgB,WAAYF,UAASE,QAAO;EAAA,IAAAhC;EAAA,IAAAhB,EAAA,OAAA8C,aAAA9C,EAAA,OAAAqD,YAAA;GAEnCrC,KAAA,qBAAA,OAAA,EAAA,UAAA;IACGqC;IACA;IACAP;GACG,EAAA,CAAA;GAAA9C,EAAA,KAAA8C;GAAA9C,EAAA,KAAAqD;GAAArD,EAAA,KAAAgB;EAAA,OAAAA,KAAAhB,EAAA;EAAA,OAJNgB;CAIM;CAQL,MAAAA,KAAA+B,aAAAA,aAAA;CAA8B,IAAA3B;CAAA,IAAApB,EAAA,QAAA8C,aAAA9C,EAAA,QAAAqD,cAAArD,EAAA,QAAAgB,IAAA;EAHjCI,KAAA,qBAAA,OAAA,EAAA,UAAA;GACG0B;GACAO;GACArC;EACG,EAAA,CAAA;EAAAhB,EAAA,MAAA8C;EAAA9C,EAAA,MAAAqD;EAAArD,EAAA,MAAAgB;EAAAhB,EAAA,MAAAoB;CAAA,OAAAA,KAAApB,EAAA;CAAA,OAJNoB;AAIM"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RootErrorRendererProps } from "../Renderers.js";
|
|
2
2
|
import { JSX } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* @alpha
|
|
@@ -11,11 +10,7 @@ type StrataKitRootErrorRendererProps = RootErrorRendererProps;
|
|
|
11
10
|
*
|
|
12
11
|
* @alpha
|
|
13
12
|
*/
|
|
14
|
-
declare function StrataKitRootErrorRenderer({
|
|
15
|
-
error,
|
|
16
|
-
getHierarchyLevelDetails,
|
|
17
|
-
reloadTree
|
|
18
|
-
}: StrataKitRootErrorRendererProps): JSX.Element;
|
|
13
|
+
declare function StrataKitRootErrorRenderer({ error, getHierarchyLevelDetails, reloadTree }: StrataKitRootErrorRendererProps): JSX.Element;
|
|
19
14
|
//#endregion
|
|
20
|
-
export { StrataKitRootErrorRenderer };
|
|
15
|
+
export { StrataKitRootErrorRenderer, StrataKitRootErrorRendererProps };
|
|
21
16
|
//# sourceMappingURL=RootErrorRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"RootErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx"],"mappings":";;;;;;KAiBY,kCAAkC;;;;;;iBAO9B,6BACd,OACA,0BACA,cACC,kCAAkC,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootErrorRenderer.js","names":["Button","Typography","Icon","useTranslation","errorSvg","JSX","RootErrorRendererProps","StrataKitRootErrorRendererProps","StrataKitRootErrorRenderer","t0","$","_c","error","getHierarchyLevelDetails","reloadTree","translate","type","t1","undefined","setSizeLimit","onOverrideLimit","t2","resultSetSizeLimit","replace","toString","t3","t4","action","label","condition","_temp","t5","parentNodeId","state","_temp2","RootErrorContainerProps","message","actions","RootErrorContainer","Symbol","for","height","display","flexDirection","justifyContent","alignItems","gap","textAlign","filter","_temp3","map","_temp4","t6"],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.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 { Button, Typography } from \"@mui/material\";\nimport { Icon } from \"@stratakit/mui\";\nimport { useTranslation } from \"../LocalizationContext.js\";\n\nimport errorSvg from \"@stratakit/icons/status-error.svg\";\n\nimport type { JSX } from \"react\";\nimport type { RootErrorRendererProps } from \"../Renderers.js\";\n\n/**\n * @alpha\n */\nexport type StrataKitRootErrorRendererProps = RootErrorRendererProps;\n\n/**\n * A component that renders root node error state.\n *\n * @alpha\n */\nexport function StrataKitRootErrorRenderer({\n error,\n getHierarchyLevelDetails,\n reloadTree,\n}: StrataKitRootErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (error.type === \"ResultSetTooLarge\") {\n const onOverrideLimit = () => getHierarchyLevelDetails(undefined)?.setSizeLimit(\"unbounded\");\n return (\n <RootErrorContainer\n message={translate(\"rootResultLimitExceeded\").replace(\"{{limit}}\", error.resultSetSizeLimit.toString())}\n actions={[\n { action: onOverrideLimit, label: translate(\"increaseHierarchyLimitToUnlimited\"), condition: () => true },\n ]}\n />\n );\n }\n\n return (\n <RootErrorContainer\n message={translate(\"failedToCreateRootHierarchy\")}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: undefined, state: \"reset\" }),\n label: translate(\"retry\"),\n condition: () => true,\n },\n ]}\n />\n );\n}\n\ninterface RootErrorContainerProps {\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n}\n\nfunction RootErrorContainer({ actions, message }: RootErrorContainerProps) {\n return (\n <div\n style={{\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n }}\n >\n <Icon href={errorSvg} size=\"large\" />\n <Typography variant=\"caption\" style={{ textAlign: \"center\" }}>\n {message}\n </Typography>\n {actions\n ?.filter(({ condition }) => condition())\n .map((action) => {\n return (\n <Button key={action.label} onClick={() => action.action()} size=\"small\">\n {action.label}\n </Button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwBA,SAAOQ,2BAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,
|
|
1
|
+
{"version":3,"file":"RootErrorRenderer.js","names":["Button","Typography","Icon","useTranslation","errorSvg","JSX","RootErrorRendererProps","StrataKitRootErrorRendererProps","StrataKitRootErrorRenderer","t0","$","_c","error","getHierarchyLevelDetails","reloadTree","translate","type","t1","undefined","setSizeLimit","onOverrideLimit","t2","resultSetSizeLimit","replace","toString","t3","t4","action","label","condition","_temp","t5","parentNodeId","state","_temp2","RootErrorContainerProps","message","actions","RootErrorContainer","Symbol","for","height","display","flexDirection","justifyContent","alignItems","gap","textAlign","filter","_temp3","map","_temp4","t6"],"sources":["../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.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 { Button, Typography } from \"@mui/material\";\nimport { Icon } from \"@stratakit/mui\";\nimport { useTranslation } from \"../LocalizationContext.js\";\n\nimport errorSvg from \"@stratakit/icons/status-error.svg\";\n\nimport type { JSX } from \"react\";\nimport type { RootErrorRendererProps } from \"../Renderers.js\";\n\n/**\n * @alpha\n */\nexport type StrataKitRootErrorRendererProps = RootErrorRendererProps;\n\n/**\n * A component that renders root node error state.\n *\n * @alpha\n */\nexport function StrataKitRootErrorRenderer({\n error,\n getHierarchyLevelDetails,\n reloadTree,\n}: StrataKitRootErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n\n if (error.type === \"ResultSetTooLarge\") {\n const onOverrideLimit = () => getHierarchyLevelDetails(undefined)?.setSizeLimit(\"unbounded\");\n return (\n <RootErrorContainer\n message={translate(\"rootResultLimitExceeded\").replace(\"{{limit}}\", error.resultSetSizeLimit.toString())}\n actions={[\n { action: onOverrideLimit, label: translate(\"increaseHierarchyLimitToUnlimited\"), condition: () => true },\n ]}\n />\n );\n }\n\n return (\n <RootErrorContainer\n message={translate(\"failedToCreateRootHierarchy\")}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: undefined, state: \"reset\" }),\n label: translate(\"retry\"),\n condition: () => true,\n },\n ]}\n />\n );\n}\n\ninterface RootErrorContainerProps {\n message: string;\n actions?: { action: () => void; label: string; condition: () => boolean }[];\n}\n\nfunction RootErrorContainer({ actions, message }: RootErrorContainerProps) {\n return (\n <div\n style={{\n height: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n }}\n >\n <Icon href={errorSvg} size=\"large\" />\n <Typography variant=\"caption\" style={{ textAlign: \"center\" }}>\n {message}\n </Typography>\n {actions\n ?.filter(({ condition }) => condition())\n .map((action) => {\n return (\n <Button key={action.label} onClick={() => action.action()} size=\"small\">\n {action.label}\n </Button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAwBA,SAAOQ,2BAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAoC,MAAA,EAAAC,OAAAC,0BAAAC,eAAAL;CAKzC,MAAAM,YAAkBZ,eAAe;CAEjC,IAAIS,MAAKI,SAAU,qBAAmB;EAAA,IAAAC;EAAA,IAAAP,EAAA,OAAAG,0BAAA;GACZI,WAAMJ,yBAAyBK,KAAAA,CAAuB,CAAC,EAAAC,aAAC,WAAW;GAACT,EAAA,KAAAG;GAAAH,EAAA,KAAAO;EAAA,OAAAA,KAAAP,EAAA;EAA5F,MAAAU,kBAAwBH;EAAqE,IAAAI;EAAA,IAAAX,EAAA,OAAAE,MAAAU,sBAAAZ,EAAA,OAAAK,WAAA;GAGhFM,KAAAN,UAAU,yBAAyB,CAAC,CAAAQ,QAAS,aAAaX,MAAKU,mBAAmBE,SAAU,CAAC;GAACd,EAAA,KAAAE,MAAAU;GAAAZ,EAAA,KAAAK;GAAAL,EAAA,KAAAW;EAAA,OAAAA,KAAAX,EAAA;EAAA,IAAAe;EAAA,IAAAf,EAAA,OAAAK,WAAA;GAEnEU,KAAAV,UAAU,mCAAmC;GAACL,EAAA,KAAAK;GAAAL,EAAA,KAAAe;EAAA,OAAAA,KAAAf,EAAA;EAAA,IAAA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AA;CAAA,IAAA0C;CAAA,IAAA1C,EAAA,OAAAgB,MAAAhB,EAAA,OAAAqB,IAAA;EAtBNqB,KAAA,qBAAA,OAAA;GACS,OAAAnC;GADT,UAAA;IAUEI;IACAK;IAGCK;GASG;;EAAArB,EAAA,KAAAgB;EAAAhB,EAAA,KAAAqB;EAAArB,EAAA,KAAA0C;CAAA,OAAAA,KAAA1C,EAAA;CAAA,OAvBN0C;AAuBM;AAzBV,SAAAD,OAAAxB,QAAA;CAAA,OAoBY,oBAAC,QAAD;EAAoC,eAAMA,OAAMA,OAAQ;EAAQ,MAAA;EAC7DA,UAAAA,OAAMC;CADF,GAAMD,OAAMC,KAAZ;AAEE;AAtBrB,SAAAqB,OAAAxC,IAAA;CAiBkB,MAAA,EAAAoB,cAAApB;CAAa,OAAKoB,UAAU;AAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, NamedExoticComponent } from "react";
|
|
2
2
|
import { Tree } from "@stratakit/structures";
|
|
3
|
-
|
|
4
3
|
//#region src/presentation-hierarchies-react/stratakit/TreeAction.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context
|
|
@@ -24,7 +23,8 @@ interface TreeActionBaseAttributes {
|
|
|
24
23
|
}
|
|
25
24
|
/** @alpha */
|
|
26
25
|
type TreeActionBaseProps = Omit<ComponentPropsWithoutRef<typeof Tree.ItemAction>, "onClick"> & TreeActionBaseAttributes & {
|
|
27
|
-
/** Callback invoked when the action is clicked. */
|
|
26
|
+
/** Callback invoked when the action is clicked. */
|
|
27
|
+
onClick?: () => void;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.
|
|
@@ -47,5 +47,5 @@ type TreeActionBaseProps = Omit<ComponentPropsWithoutRef<typeof Tree.ItemAction>
|
|
|
47
47
|
*/
|
|
48
48
|
declare const TreeActionBase: NamedExoticComponent<TreeActionBaseProps>;
|
|
49
49
|
//#endregion
|
|
50
|
-
export { TreeActionBase, TreeActionBaseAttributes };
|
|
50
|
+
export { TreeActionBase, TreeActionBaseAttributes, TreeActionBaseProps };
|
|
51
51
|
//# sourceMappingURL=TreeAction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"mappings":";;;;;;;;UAiBiB;;;;;;;;EAQf;;;;;EAKA;;;KAIU,sBAAsB,KAAK,gCAAgC,KAAK,0BAC1E;;EAEE;;;;;;;;;;;;;;;;;;;;;cAsBS,gBAAgB,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeAction.js","names":["memo","ListItemIcon","MenuItem","Typography","Icon","Tree","ComponentPropsWithoutRef","NamedExoticComponent","TreeActionBaseAttributes","variant","hide","TreeActionBaseProps","Omit","ItemAction","onClick","TreeActionBase","t0","$","_c","actionProps","dot","t1","visible","undefined","t2","label","icon","t3","t4"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeAction.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 { memo } from \"react\";\nimport { ListItemIcon, MenuItem, Typography } from \"@mui/material\";\nimport { Icon } from \"@stratakit/mui\";\nimport { Tree } from \"@stratakit/structures\";\n\nimport type { ComponentPropsWithoutRef, NamedExoticComponent } from \"react\";\n\n/**\n * Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context\n * where that action is used.\n * @alpha\n */\nexport interface TreeActionBaseAttributes {\n /**\n * Specifies action variant supported by tree nodes:\n *\n * - \"default\" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node.\n * - \"inline\" - actions displayed directly on the tree node.\n * - \"context-menu\" - actions displayed in the context menu opened by right-clicking the tree node.\n */\n variant?: \"default\" | \"inline\" | \"context-menu\";\n /**\n * Indicates that the actions is not applicable for current tree node and should be hidden.\n * When set to true, the action will not be rendered at all.\n */\n hide?: boolean;\n}\n\n/** @alpha */\nexport type TreeActionBaseProps = Omit<ComponentPropsWithoutRef<typeof Tree.ItemAction>, \"onClick\"> &\n TreeActionBaseAttributes & {\n /** Callback invoked when the action is clicked. */\n onClick
|
|
1
|
+
{"version":3,"file":"TreeAction.js","names":["memo","ListItemIcon","MenuItem","Typography","Icon","Tree","ComponentPropsWithoutRef","NamedExoticComponent","TreeActionBaseAttributes","variant","hide","TreeActionBaseProps","Omit","ItemAction","onClick","TreeActionBase","t0","$","_c","actionProps","dot","t1","visible","undefined","t2","label","icon","t3","t4"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeAction.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 { memo } from \"react\";\nimport { ListItemIcon, MenuItem, Typography } from \"@mui/material\";\nimport { Icon } from \"@stratakit/mui\";\nimport { Tree } from \"@stratakit/structures\";\n\nimport type { ComponentPropsWithoutRef, NamedExoticComponent } from \"react\";\n\n/**\n * Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context\n * where that action is used.\n * @alpha\n */\nexport interface TreeActionBaseAttributes {\n /**\n * Specifies action variant supported by tree nodes:\n *\n * - \"default\" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node.\n * - \"inline\" - actions displayed directly on the tree node.\n * - \"context-menu\" - actions displayed in the context menu opened by right-clicking the tree node.\n */\n variant?: \"default\" | \"inline\" | \"context-menu\";\n /**\n * Indicates that the actions is not applicable for current tree node and should be hidden.\n * When set to true, the action will not be rendered at all.\n */\n hide?: boolean;\n}\n\n/** @alpha */\nexport type TreeActionBaseProps = Omit<ComponentPropsWithoutRef<typeof Tree.ItemAction>, \"onClick\"> &\n TreeActionBaseAttributes & {\n /** Callback invoked when the action is clicked. */\n onClick?: () => void;\n };\n\n/**\n * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.\n * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.\n *\n * When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example:\n *\n * ```tsx\n * interface MyCustomTreeActionProps extends TreeActionBaseAttributes {\n * myProp: string\n * }\n *\n * function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) {\n * // custom button logic goes here\n * return <TreeActionBase {...attributes} icon={...} onClick={...} />\n * }\n * ```\n *\n * @alpha\n */\nexport const TreeActionBase: NamedExoticComponent<TreeActionBaseProps> = memo(function TreeActionBase({\n hide,\n variant = \"default\",\n dot,\n visible,\n ...actionProps\n}: TreeActionBaseProps) {\n if (hide) {\n return variant === \"inline\" ? <Tree.ItemAction {...actionProps} visible={false} /> : undefined;\n }\n\n if (variant === \"context-menu\") {\n const { label, icon, onClick } = actionProps;\n return (\n <MenuItem dense onClick={onClick}>\n {icon ? <ListItemIcon>{typeof icon === \"string\" ? <Icon href={icon} /> : icon}</ListItemIcon> : null}\n <Typography variant=\"caption\">{label}</Typography>\n </MenuItem>\n );\n }\n\n return <Tree.ItemAction {...actionProps} dot={dot} visible={variant === \"inline\" ? visible : undefined} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,MAAae,iBAA4Df,KAAK,SAAAe,eAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAV;CAAA,IAAAW;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAwB,CAA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AA;GAFpDC,KAAA,qBAAC,UAAD;IAAU,OAAA;IAAed;IAAzB,UAAA,CACGU,IACDG,EAFO;;GAGEV,EAAA,MAAAH;GAAAG,EAAA,MAAAO;GAAAP,EAAA,MAAAU;GAAAV,EAAA,MAAAW;EAAA,OAAAA,KAAAX,EAAA;EAAA,OAHXW;CAGW;CAI6C,MAAAJ,KAAAf,YAAY,WAAZa,UAAAC,KAAAA;CAA0C,IAAAI;CAAA,IAAAV,EAAA,QAAAE,eAAAF,EAAA,QAAAG,OAAAH,EAAA,QAAAO,IAAA;EAA/FG,KAAA,oBAAA,KAAA,YAAA;GAAA,GAAqBR;GAAkBC;GAAc,SAAAI;EAA0C,CAAA;EAAIP,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAO;EAAAP,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OAAnGU;AAAmG,CAC3G"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useErrorNodes } from "../FlatTreeNode.js";
|
|
2
2
|
import { ErrorItemRendererProps } from "./ErrorItemRenderer.js";
|
|
3
3
|
import { JSX, ReactElement } from "react";
|
|
4
|
-
|
|
5
4
|
//#region src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Interface containing building blocks for `TreeErrorRenderer`.
|
|
@@ -27,12 +26,7 @@ type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRenderer
|
|
|
27
26
|
*
|
|
28
27
|
* @alpha
|
|
29
28
|
*/
|
|
30
|
-
declare function TreeErrorRenderer({
|
|
31
|
-
treeLabel,
|
|
32
|
-
errorNodes,
|
|
33
|
-
renderError,
|
|
34
|
-
...errorItemRendererProps
|
|
35
|
-
}: TreeErrorRendererProps): JSX.Element;
|
|
29
|
+
declare function TreeErrorRenderer({ treeLabel, errorNodes, renderError, ...errorItemRendererProps }: TreeErrorRendererProps): JSX.Element;
|
|
36
30
|
//#endregion
|
|
37
31
|
export { TreeErrorRenderer, TreeErrorRendererProps };
|
|
38
32
|
//# sourceMappingURL=TreeErrorRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"mappings":";;;;;;;;;UAmBU;;;;;EAKR;;EAEA,YAAY,kBAAkB;;EAE9B,eAAe,OAAO,2BAA2B;;;KAIvC,yBAAyB,4BAA4B,KAAK;;;;;;;iBAQtD,oBACd,WACA,YACA,gBACG,0BACF,yBAAyB,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeErrorRenderer.js","names":["cloneElement","useMemo","unstable_ErrorRegion","ErrorRegion","useTranslation","ErrorItemRenderer","JSX","ReactElement","useErrorNodes","ErrorItemRendererProps","TreeErrorRendererOwnProps","treeLabel","errorNodes","ReturnType","renderError","props","TreeErrorRendererProps","Omit","TreeErrorRenderer","t0","$","_c","errorItemRendererProps","translate","errorItems","flatMap","errorNode","errors","map","error","treeNode","key","id","t1","reduce","_temp","totalErrorCount","t2","Symbol","for","width","t3","replace","t4","toString","t5","sum","n","length"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.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 { cloneElement, useMemo } from \"react\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { ErrorItemRenderer } from \"./ErrorItemRenderer.js\";\n\nimport type { JSX, ReactElement } from \"react\";\nimport type { useErrorNodes } from \"../FlatTreeNode.js\";\nimport type { ErrorItemRendererProps } from \"./ErrorItemRenderer.js\";\n\n/**\n * Interface containing building blocks for `TreeErrorRenderer`.\n *\n * @alpha\n */\ninterface TreeErrorRendererOwnProps {\n /**\n * A user friendly display label of the tree. Should be unique within the consuming application,\n * as it's used for creating a unique accessible label for the error region.\n */\n treeLabel: string;\n /** List of error nodes to render errors for. */\n errorNodes: ReturnType<typeof useErrorNodes>;\n /** Callback to render custom error messages. Component should be wrapped in `unstable_ErrorRegion.Item` from `@stratakit/structures` package. */\n renderError?: (props: ErrorItemRendererProps) => ReactElement;\n}\n\n/** @alpha */\nexport type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRendererProps, \"treeNode\" | \"error\">;\n\n/**\n * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@stratakit/structures`.\n * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorNodes` hook.\n *\n * @alpha\n */\nexport function TreeErrorRenderer({\n treeLabel,\n errorNodes,\n renderError,\n ...errorItemRendererProps\n}: TreeErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n const errorItems = errorNodes.flatMap((errorNode) =>\n errorNode.errors.map((error) => {\n if (renderError) {\n return cloneElement(renderError({ treeNode: errorNode, error, ...errorItemRendererProps }), {\n key: `${errorNode.id}:${error.id}`,\n });\n }\n return (\n <ErrorItemRenderer\n key={`${errorNode.id}:${error.id}`}\n treeNode={errorNode}\n error={error}\n {...errorItemRendererProps}\n />\n );\n }),\n );\n\n const totalErrorCount = useMemo(() => errorNodes.reduce((sum, n) => sum + n.errors.length, 0), [errorNodes]);\n\n return (\n <ErrorRegion.Root\n style={{ width: \"100%\" }}\n aria-label={translate(\"issuesForTree\").replace(\"{{tree_label}}\", treeLabel)}\n label={\n totalErrorCount === 0\n ? translate(\"noIssuesFound\")\n : translate(\"issuesFound\").replace(\"{{number_of_issues}}\", totalErrorCount.toString())\n }\n items={errorItems}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAwCA,SAAOkB,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,
|
|
1
|
+
{"version":3,"file":"TreeErrorRenderer.js","names":["cloneElement","useMemo","unstable_ErrorRegion","ErrorRegion","useTranslation","ErrorItemRenderer","JSX","ReactElement","useErrorNodes","ErrorItemRendererProps","TreeErrorRendererOwnProps","treeLabel","errorNodes","ReturnType","renderError","props","TreeErrorRendererProps","Omit","TreeErrorRenderer","t0","$","_c","errorItemRendererProps","translate","errorItems","flatMap","errorNode","errors","map","error","treeNode","key","id","t1","reduce","_temp","totalErrorCount","t2","Symbol","for","width","t3","replace","t4","toString","t5","sum","n","length"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.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 { cloneElement, useMemo } from \"react\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { ErrorItemRenderer } from \"./ErrorItemRenderer.js\";\n\nimport type { JSX, ReactElement } from \"react\";\nimport type { useErrorNodes } from \"../FlatTreeNode.js\";\nimport type { ErrorItemRendererProps } from \"./ErrorItemRenderer.js\";\n\n/**\n * Interface containing building blocks for `TreeErrorRenderer`.\n *\n * @alpha\n */\ninterface TreeErrorRendererOwnProps {\n /**\n * A user friendly display label of the tree. Should be unique within the consuming application,\n * as it's used for creating a unique accessible label for the error region.\n */\n treeLabel: string;\n /** List of error nodes to render errors for. */\n errorNodes: ReturnType<typeof useErrorNodes>;\n /** Callback to render custom error messages. Component should be wrapped in `unstable_ErrorRegion.Item` from `@stratakit/structures` package. */\n renderError?: (props: ErrorItemRendererProps) => ReactElement;\n}\n\n/** @alpha */\nexport type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRendererProps, \"treeNode\" | \"error\">;\n\n/**\n * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@stratakit/structures`.\n * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorNodes` hook.\n *\n * @alpha\n */\nexport function TreeErrorRenderer({\n treeLabel,\n errorNodes,\n renderError,\n ...errorItemRendererProps\n}: TreeErrorRendererProps): JSX.Element {\n const translate = useTranslation();\n const errorItems = errorNodes.flatMap((errorNode) =>\n errorNode.errors.map((error) => {\n if (renderError) {\n return cloneElement(renderError({ treeNode: errorNode, error, ...errorItemRendererProps }), {\n key: `${errorNode.id}:${error.id}`,\n });\n }\n return (\n <ErrorItemRenderer\n key={`${errorNode.id}:${error.id}`}\n treeNode={errorNode}\n error={error}\n {...errorItemRendererProps}\n />\n );\n }),\n );\n\n const totalErrorCount = useMemo(() => errorNodes.reduce((sum, n) => sum + n.errors.length, 0), [errorNodes]);\n\n return (\n <ErrorRegion.Root\n style={{ width: \"100%\" }}\n aria-label={translate(\"issuesForTree\").replace(\"{{tree_label}}\", treeLabel)}\n label={\n totalErrorCount === 0\n ? translate(\"noIssuesFound\")\n : translate(\"issuesFound\").replace(\"{{number_of_issues}}\", totalErrorCount.toString())\n }\n items={errorItems}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAwCA,SAAOkB,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA2B,MAAA,EAAAV,WAAAC,YAAAE,aAAA,GAAAQ,2BAAAH;CAMhC,MAAAI,YAAkBnB,eAAe;CACjC,MAAAoB,aAAmBZ,WAAUa,SAASC,cACpCA,UAASC,OAAOC,KAAKC,UAAA;EACnB,IAAIf,aAAW,OACNd,aAAac,YAAY;GAAAgB,UAAYJ;GAASG;GAAA,GAAYP;EAAuB,CAAC,GAAG,EAAAS,KACrF,GAAGL,UAASM,GAAG,GAAIH,MAAKG,KAC/B,CAAC;EACF,OAEC,oBAAC,mBAAD;GAEYN,UAAAA;GACHG;GAAK,GACRP;E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;AASE;AArCC,SAAAV,MAAAW,KAAAC,GAAA;CAAA,OAyB+DD,MAAMC,EAACpB,OAAOqB;AAAO"}
|
|
@@ -2,7 +2,6 @@ import { TreeNode } from "../TreeNode.js";
|
|
|
2
2
|
import { HierarchyLevelDetails, TreeRendererProps } from "../Renderers.js";
|
|
3
3
|
import { TreeActionBaseAttributes } from "./TreeAction.js";
|
|
4
4
|
import { NamedExoticComponent } from "react";
|
|
5
|
-
|
|
6
5
|
//#region src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts
|
|
7
6
|
/** @alpha */
|
|
8
7
|
type TreeNodeFilterActionProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeFilterAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeNodeFilterAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx"],"mappings":";;;;;;KAiBK;;;;EAIH,YAAY,uBAAuB;IACjC,2BACF,KAAK;;;;;;;;;;;cAYM,sBAAsB,qBAAqB;EAA8B,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeFilterAction.js","names":["memo","useCallback","useTranslation","TreeActionBase","filterSvg","NamedExoticComponent","HierarchyLevelDetails","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeFilterActionProps","onFilter","hierarchyLevelDetails","Pick","TreeNodeFilterAction","node","t0","$","_c","actionAttributes","getHierarchyLevelDetails","translate","t1","filterHierarchyLevel","t2","filterHierarchyLevelActiveDescription","t3","id","handleClick","t4","isFiltered","undefined","t5","t6","isFilterable","t7"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.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 { memo, useCallback } from \"react\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport filterSvg from \"@stratakit/icons/filter.svg\";\n\nimport type { NamedExoticComponent } from \"react\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @alpha */\ntype TreeNodeFilterActionProps = {\n /**\n * Action to perform when the filter button is clicked for this node.\n */\n onFilter?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n} & TreeActionBaseAttributes &\n Pick<TreeRendererProps, \"getHierarchyLevelDetails\">;\n\n/**\n * React component that renders a filter action for a tree item.\n *\n * The action calls the `onFilter` callback prop when clicked.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeFilterAction: NamedExoticComponent<TreeNodeFilterActionProps & { node: TreeNode }> = memo(\n function TreeNodeFilterAction({\n node,\n onFilter,\n getHierarchyLevelDetails,\n ...actionAttributes\n }: TreeNodeFilterActionProps & { node: TreeNode }) {\n const translate = useTranslation();\n const filterHierarchyLevel = translate(\"filterHierarchyLevel\");\n const filterHierarchyLevelActiveDescription = translate(\"filterHierarchyLevelActiveDescription\");\n\n const handleClick = useCallback(() => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(node.id);\n hierarchyLevelDetails && onFilter?.(hierarchyLevelDetails);\n }, [node, getHierarchyLevelDetails, onFilter]);\n\n return (\n <TreeActionBase\n {...actionAttributes}\n label={filterHierarchyLevel}\n onClick={handleClick}\n icon={filterSvg}\n visible={node.isFiltered ? true : undefined}\n dot={node.isFiltered ? filterHierarchyLevelActiveDescription : undefined}\n hide={!onFilter || !node.isFilterable}\n />\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,MAAac,uBAA6Fd,KACxG,SAAAc,qBAAAE,IAAA;CAAA,MAAAC,IAAAC,EAAA,
|
|
1
|
+
{"version":3,"file":"TreeNodeFilterAction.js","names":["memo","useCallback","useTranslation","TreeActionBase","filterSvg","NamedExoticComponent","HierarchyLevelDetails","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeFilterActionProps","onFilter","hierarchyLevelDetails","Pick","TreeNodeFilterAction","node","t0","$","_c","actionAttributes","getHierarchyLevelDetails","translate","t1","filterHierarchyLevel","t2","filterHierarchyLevelActiveDescription","t3","id","handleClick","t4","isFiltered","undefined","t5","t6","isFilterable","t7"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.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 { memo, useCallback } from \"react\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport filterSvg from \"@stratakit/icons/filter.svg\";\n\nimport type { NamedExoticComponent } from \"react\";\nimport type { HierarchyLevelDetails, TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @alpha */\ntype TreeNodeFilterActionProps = {\n /**\n * Action to perform when the filter button is clicked for this node.\n */\n onFilter?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n} & TreeActionBaseAttributes &\n Pick<TreeRendererProps, \"getHierarchyLevelDetails\">;\n\n/**\n * React component that renders a filter action for a tree item.\n *\n * The action calls the `onFilter` callback prop when clicked.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeFilterAction: NamedExoticComponent<TreeNodeFilterActionProps & { node: TreeNode }> = memo(\n function TreeNodeFilterAction({\n node,\n onFilter,\n getHierarchyLevelDetails,\n ...actionAttributes\n }: TreeNodeFilterActionProps & { node: TreeNode }) {\n const translate = useTranslation();\n const filterHierarchyLevel = translate(\"filterHierarchyLevel\");\n const filterHierarchyLevelActiveDescription = translate(\"filterHierarchyLevelActiveDescription\");\n\n const handleClick = useCallback(() => {\n const hierarchyLevelDetails = getHierarchyLevelDetails(node.id);\n hierarchyLevelDetails && onFilter?.(hierarchyLevelDetails);\n }, [node, getHierarchyLevelDetails, onFilter]);\n\n return (\n <TreeActionBase\n {...actionAttributes}\n label={filterHierarchyLevel}\n onClick={handleClick}\n icon={filterSvg}\n visible={node.isFiltered ? true : undefined}\n dot={node.isFiltered ? filterHierarchyLevelActiveDescription : undefined}\n hide={!onFilter || !node.isFilterable}\n />\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,MAAac,uBAA6Fd,KACxG,SAAAc,qBAAAE,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL;CAAA,IAAAJ;CAAA,IAAAM,EAAA,OAAAD,IAAA;EAA8B,CAAA,CAAAD,MAAAJ,UAAAS,6BAAAD,oBAAAH;EAKmBC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAF;EAAAE,EAAA,KAAAN;CAAA,OAAA;EAAAQ,mBAAAF,EAAA;EAAAG,2BAAAH,EAAA;EAAAF,OAAAE,EAAA;EAAAN,WAAAM,EAAA;CAAA;CAC/C,MAAAI,YAAkBnB,eAAe;CAAE,IAAAoB;CAAA,IAAAL,EAAA,OAAAI,WAAA;EACNC,KAAAD,UAAU,sBAAsB;EAACJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAA9D,MAAAM,uBAA6BD;CAAkC,IAAAE;CAAA,IAAAP,EAAA,OAAAI,WAAA;EACjBG,KAAA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react";
|
|
4
|
-
|
|
5
4
|
//#region src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* React component that renders a rename action for a tree item.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeRenameAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeNodeRenameAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx"],"mappings":";;;;;;;;;;;;;;;cA0Ba,sBAAsB,qBAAqB;EAA6B,MAAM;;;UAmB1E;;;;;EAKf,iBAAiB;EACjB;EACA,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeRenameAction.js","names":["createContext","memo","useCallback","useContext","useMemo","useState","useTranslation","TreeActionBase","renameSvg","NamedExoticComponent","PropsWithChildren","TreeNode","TreeActionBaseAttributes","TreeNodeRenameAction","node","t0","$","_c","actionAttributes","translate","context","useTreeNodeRenameContext","t1","rename","t2","canRename","startRename","t3","handleClick","t4","t5","TreeNodeEditingProps","onLabelChanged","newLabel","labelValidationHint","validate","RenameParameters","nodeId","commit","TreeNodeRenameContext","renameParameters","cancelRename","treeNodeRenameContext","undefined","TreeNodeRenameContextProvider","value","children","useTreeNodeRenameContextValue","getEditingProps","setRenameParameters","id","Symbol","for","node_0"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.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 { createContext, memo, useCallback, useContext, useMemo, useState } from \"react\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport renameSvg from \"@stratakit/icons/rename.svg\";\n\nimport type { NamedExoticComponent, PropsWithChildren } from \"react\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/**\n * React component that renders a rename action for a tree item.\n *\n * The tree component must have `getEditingProps.onLabelChanged` prop set to enable renaming functionality. When\n * rename is completed, the `onLabelChanged` function is called to make the actual data update.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeRenameAction: NamedExoticComponent<TreeActionBaseAttributes & { node: TreeNode }> = memo(\n function TreeNodeRenameAction({ node, ...actionAttributes }: TreeActionBaseAttributes & { node: TreeNode }) {\n const translate = useTranslation();\n const context = useTreeNodeRenameContext();\n const rename = translate(\"rename\");\n\n const canRename = context?.canRename(node) ?? false;\n const startRename = context?.startRename;\n const handleClick = useCallback(() => {\n startRename?.(node);\n }, [startRename, node]);\n\n return (\n <TreeActionBase {...actionAttributes} label={rename} onClick={handleClick} icon={renameSvg} hide={!canRename} />\n );\n },\n);\n\n/** @alpha */\nexport interface TreeNodeEditingProps {\n /**\n * A callback that is invoked when node label is changed. Should be used together\n * with `<TreeNodeRenameAction />` to enter label editing mode.\n */\n onLabelChanged: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\n/** @internal */\nexport interface RenameParameters {\n nodeId: string;\n commit: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\ninterface TreeNodeRenameContext {\n renameParameters?: RenameParameters;\n startRename: (node: TreeNode) => void;\n canRename: (node: TreeNode) => boolean;\n cancelRename: () => void;\n}\n\nconst treeNodeRenameContext = createContext<TreeNodeRenameContext | undefined>(undefined);\n\n/** @internal */\nexport const useTreeNodeRenameContext = () => {\n return useContext(treeNodeRenameContext);\n};\n\n/** @internal */\nexport function TreeNodeRenameContextProvider({\n value,\n children,\n}: PropsWithChildren<{ value: TreeNodeRenameContext }>) {\n return <treeNodeRenameContext.Provider value={value}>{children}</treeNodeRenameContext.Provider>;\n}\n\n/** @internal */\nexport function useTreeNodeRenameContextValue({\n getEditingProps,\n}: {\n getEditingProps?: (node: TreeNode) => TreeNodeEditingProps | undefined;\n}) {\n const [renameParameters, setRenameParameters] = useState<RenameParameters | undefined>(undefined);\n\n const startRename = useCallback(\n (node: TreeNode) => {\n const { onLabelChanged, labelValidationHint, validate } = getEditingProps?.(node) ?? {};\n if (onLabelChanged) {\n setRenameParameters({\n nodeId: node.id,\n commit: (newLabel) => {\n onLabelChanged(newLabel);\n setRenameParameters(undefined);\n },\n labelValidationHint,\n validate,\n });\n }\n },\n [getEditingProps],\n );\n\n const cancelRename = useCallback(() => {\n setRenameParameters(undefined);\n }, []);\n\n const canRename = useCallback(\n (node: TreeNode) => {\n return getEditingProps?.(node)?.onLabelChanged !== undefined;\n },\n [getEditingProps],\n );\n\n return useMemo(\n () => ({ renameParameters, cancelRename, startRename, canRename }),\n [renameParameters, canRename, startRename, cancelRename],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,MAAaa,uBAA4FZ,KACvG,SAAAY,qBAAAE,IAAA;CAAA,MAAAC,IAAAC,EAAA,
|
|
1
|
+
{"version":3,"file":"TreeNodeRenameAction.js","names":["createContext","memo","useCallback","useContext","useMemo","useState","useTranslation","TreeActionBase","renameSvg","NamedExoticComponent","PropsWithChildren","TreeNode","TreeActionBaseAttributes","TreeNodeRenameAction","node","t0","$","_c","actionAttributes","translate","context","useTreeNodeRenameContext","t1","rename","t2","canRename","startRename","t3","handleClick","t4","t5","TreeNodeEditingProps","onLabelChanged","newLabel","labelValidationHint","validate","RenameParameters","nodeId","commit","TreeNodeRenameContext","renameParameters","cancelRename","treeNodeRenameContext","undefined","TreeNodeRenameContextProvider","value","children","useTreeNodeRenameContextValue","getEditingProps","setRenameParameters","id","Symbol","for","node_0"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.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 { createContext, memo, useCallback, useContext, useMemo, useState } from \"react\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\n\nimport renameSvg from \"@stratakit/icons/rename.svg\";\n\nimport type { NamedExoticComponent, PropsWithChildren } from \"react\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/**\n * React component that renders a rename action for a tree item.\n *\n * The tree component must have `getEditingProps.onLabelChanged` prop set to enable renaming functionality. When\n * rename is completed, the `onLabelChanged` function is called to make the actual data update.\n *\n * @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action\n * to tree items.\n *\n * @alpha\n */\nexport const TreeNodeRenameAction: NamedExoticComponent<TreeActionBaseAttributes & { node: TreeNode }> = memo(\n function TreeNodeRenameAction({ node, ...actionAttributes }: TreeActionBaseAttributes & { node: TreeNode }) {\n const translate = useTranslation();\n const context = useTreeNodeRenameContext();\n const rename = translate(\"rename\");\n\n const canRename = context?.canRename(node) ?? false;\n const startRename = context?.startRename;\n const handleClick = useCallback(() => {\n startRename?.(node);\n }, [startRename, node]);\n\n return (\n <TreeActionBase {...actionAttributes} label={rename} onClick={handleClick} icon={renameSvg} hide={!canRename} />\n );\n },\n);\n\n/** @alpha */\nexport interface TreeNodeEditingProps {\n /**\n * A callback that is invoked when node label is changed. Should be used together\n * with `<TreeNodeRenameAction />` to enter label editing mode.\n */\n onLabelChanged: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\n/** @internal */\nexport interface RenameParameters {\n nodeId: string;\n commit: (newLabel: string) => void;\n labelValidationHint?: string;\n validate?: (newLabel: string) => boolean;\n}\n\ninterface TreeNodeRenameContext {\n renameParameters?: RenameParameters;\n startRename: (node: TreeNode) => void;\n canRename: (node: TreeNode) => boolean;\n cancelRename: () => void;\n}\n\nconst treeNodeRenameContext = createContext<TreeNodeRenameContext | undefined>(undefined);\n\n/** @internal */\nexport const useTreeNodeRenameContext = () => {\n return useContext(treeNodeRenameContext);\n};\n\n/** @internal */\nexport function TreeNodeRenameContextProvider({\n value,\n children,\n}: PropsWithChildren<{ value: TreeNodeRenameContext }>) {\n return <treeNodeRenameContext.Provider value={value}>{children}</treeNodeRenameContext.Provider>;\n}\n\n/** @internal */\nexport function useTreeNodeRenameContextValue({\n getEditingProps,\n}: {\n getEditingProps?: (node: TreeNode) => TreeNodeEditingProps | undefined;\n}) {\n const [renameParameters, setRenameParameters] = useState<RenameParameters | undefined>(undefined);\n\n const startRename = useCallback(\n (node: TreeNode) => {\n const { onLabelChanged, labelValidationHint, validate } = getEditingProps?.(node) ?? {};\n if (onLabelChanged) {\n setRenameParameters({\n nodeId: node.id,\n commit: (newLabel) => {\n onLabelChanged(newLabel);\n setRenameParameters(undefined);\n },\n labelValidationHint,\n validate,\n });\n }\n },\n [getEditingProps],\n );\n\n const cancelRename = useCallback(() => {\n setRenameParameters(undefined);\n }, []);\n\n const canRename = useCallback(\n (node: TreeNode) => {\n return getEditingProps?.(node)?.onLabelChanged !== undefined;\n },\n [getEditingProps],\n );\n\n return useMemo(\n () => ({ renameParameters, cancelRename, startRename, canRename }),\n [renameParameters, canRename, startRename, cancelRename],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,MAAaa,uBAA4FZ,KACvG,SAAAY,qBAAAE,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAJ;CAAA,IAAAE,EAAA,OAAAD,IAAA;EAA8B,CAAA,CAAAD,SAAAI,oBAAAH;EAA4EC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAF;CAAA,OAAA;EAAAI,mBAAAF,EAAA;EAAAF,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W,KAAAA;EACpD3B,EAAA,KAAAgC;EAAAhC,EAAA,KAAAW;CAAA,OAAAA,KAAAX,EAAA;CAHH,MAAAS,YAAkBE;CAKhB,IAAAE;CAAA,IAAAb,EAAA,OAAAS,aAAAT,EAAA,OAAAwB,oBAAAxB,EAAA,OAAAU,aAAA;EAGOG,KAAA;GAAAW;GAAAC;GAAAf;GAAAD;EAAyD;EAACT,EAAA,KAAAS;EAAAT,EAAA,KAAAwB;EAAAxB,EAAA,KAAAU;EAAAV,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,OAA1Da;AAA0D"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import "../TreeNode.js";
|
|
2
|
+
import "../Renderers.js";
|
|
1
3
|
import { ComponentPropsWithoutRef, FC, ReactNode, RefAttributes } from "react";
|
|
2
4
|
import { Tree } from "@stratakit/structures";
|
|
5
|
+
import "./TreeNodeRenderer.css";
|
|
3
6
|
//#region src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts
|
|
4
7
|
/** @alpha */
|
|
5
8
|
type StrataKitTreeItemProps = Omit<ComponentPropsWithoutRef<typeof Tree.Item>, "actions" | "inlineActions" | "expanded" | "onExpandedChange" | "icon" | "unstable_decorations" | "error"> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeNodeRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx"],"mappings":";;;;;;;KA0DY,yBAAyB,KACnC,gCAAgC,KAAK;;;;;EAOrC,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeRenderer.js","names":["cloneElement","forwardRef","isValidElement","memo","useCallback","useEffect","useId","useMemo","useRef","useState","CircularProgress","FormHelperText","IconButton","Menu","TextField","Typography","Icon","unstable_Popover","Popover","Tree","useTranslation","TreeActionBase","useTreeNodeRenameContext","checkmarkSvg","dismissSvg","refreshSvg","ComponentPropsWithoutRef","FC","PropsWithRef","ReactNode","RefAttributes","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeRendererOwnProps","Pick","node","menuActions","inlineActions","contextMenuActions","StrataKitTreeItemProps","Omit","Item","decorations","TreeNodeRendererProps","StrataKitTreeNodeRenderer","HTMLElement","HierarchyNode","props","forwardedRef","$","_c","expandNode","reloadTree","treeItemProps","translate","renameContext","contextMenuProps","setContextMenuProps","undefined","label","t0","bb0","errors","some","_temp","t1","t2","id","parentNodeId","state","t3","injectActionVariant","inlineActionItems","bb1","menuActionItems","bb2","_temp2","children","length","isExpanded","expanded","renameParameters","cancelRename","t4","commit","t5","labelValidationHint","t6","validate","t7","labelEditor","t8","nodeId","t9","t10","t11","t12","e_1","onContextMenu","e","preventDefault","actions","position","x","clientX","y","clientY","t13","t14","t15","t16","t17","Symbol","for","e_2","t18","top","left","t19","t20","t21","t22","t23","PlaceholderNode","LabelEditor","initialLabel","onChange","onCancel","inputRef","newLabelValue","setNewLabelValue","hasError","setHasError","handleLabelChange","cancelLabelChange","current","focus","select","canRename","inputId","htmlInput","event","target","value","event_0","key","display","variant","filter","action","map","type","e_0","isNodeExpandable"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.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 \"./TreeNodeRenderer.css\";\n\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n memo,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { CircularProgress, FormHelperText, IconButton, Menu, TextField, Typography } from \"@mui/material\";\nimport { Icon } from \"@stratakit/mui\";\nimport { unstable_Popover as Popover, Tree } from \"@stratakit/structures\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\nimport { useTreeNodeRenameContext } from \"./TreeNodeRenameAction.js\";\n\nimport checkmarkSvg from \"@stratakit/icons/checkmark.svg\";\nimport dismissSvg from \"@stratakit/icons/dismiss.svg\";\nimport refreshSvg from \"@stratakit/icons/refresh.svg\";\n\nimport type { ComponentPropsWithoutRef, FC, PropsWithRef, ReactNode, RefAttributes } from \"react\";\nimport type { TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @internal */\ninterface TreeNodeRendererOwnProps extends Pick<TreeRendererProps, \"expandNode\" | \"reloadTree\"> {\n /** Node that is rendered. */\n node: TreeNode;\n /**\n * Menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n menuActions?: ReactNode[];\n /**\n * Inline actions for tree item.\n * Must be an array of `<TreeActionBase />` elements.\n * Max 2 items.\n */\n inlineActions?: ReactNode[];\n /**\n * Context menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n contextMenuActions?: ReactNode[];\n}\n\n/** @alpha */\nexport type StrataKitTreeItemProps = Omit<\n ComponentPropsWithoutRef<typeof Tree.Item>,\n \"actions\" | \"inlineActions\" | \"expanded\" | \"onExpandedChange\" | \"icon\" | \"unstable_decorations\" | \"error\"\n> & {\n /**\n * Used to render elements between expander and label.\n * E.g. icons, color picker, etc.\n */\n decorations?: ReactNode;\n};\n\n/** @internal */\nexport type TreeNodeRendererProps = StrataKitTreeItemProps & TreeNodeRendererOwnProps;\n\n/**\n * A component that renders a given `TreeNode` using the `Tree.Item` component from `@stratakit/structures`.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const StrataKitTreeNodeRenderer: FC<PropsWithRef<TreeNodeRendererProps & RefAttributes<HTMLElement>>> = memo(\n forwardRef<HTMLElement, TreeNodeRendererProps>(function HierarchyNode(props, forwardedRef) {\n const {\n node,\n decorations,\n inlineActions,\n menuActions,\n contextMenuActions,\n expandNode,\n reloadTree,\n ...treeItemProps\n } = props;\n const translate = useTranslation();\n const renameContext = useTreeNodeRenameContext();\n const [contextMenuProps, setContextMenuProps] = useState<\n { position: { x: number; y: number }; actions: ReactNode[] } | undefined\n >(undefined);\n\n const label = treeItemProps.label ?? node.label;\n const inlineActionItems = useMemo(() => {\n if (node.errors.some((e) => e.type === \"ChildrenLoad\")) {\n return [\n <TreeActionBase\n key=\"retry\"\n label={translate(\"retry\")}\n onClick={() => reloadTree({ parentNodeId: node.id, state: \"reset\" })}\n visible={true}\n icon={refreshSvg}\n variant=\"inline\"\n />,\n ];\n }\n if (!inlineActions) {\n return undefined;\n }\n return injectActionVariant(inlineActions, \"inline\");\n }, [node, inlineActions, translate, reloadTree]);\n\n const menuActionItems = useMemo(() => {\n if (!menuActions) {\n return undefined;\n }\n return injectActionVariant(menuActions, \"default\");\n }, [menuActions]);\n\n const expanded = useMemo(() => {\n if (node.errors.some((e) => e.type !== \"Unknown\" || !e.isNodeExpandable)) {\n return undefined;\n }\n\n // this is a leaf node\n if (node.children !== true && node.children.length === 0) {\n return undefined;\n }\n\n return node.isExpanded;\n }, [node]);\n\n const { renameParameters, cancelRename } = renameContext ?? {};\n const labelEditor = (\n <LabelEditor\n initialLabel={node.label}\n onChange={renameParameters?.commit}\n onCancel={cancelRename}\n labelValidationHint={renameParameters?.labelValidationHint}\n validate={renameParameters?.validate}\n />\n );\n\n return (\n <>\n <Popover\n content={labelEditor}\n placement=\"bottom\"\n open={renameParameters?.nodeId === node.id}\n setOpen={cancelRename}\n unmountOnHide\n >\n <Tree.Item\n {...treeItemProps}\n ref={forwardedRef}\n label={label}\n expanded={expanded}\n onExpandedChange={useCallback(\n (isExpanded: boolean) => {\n expandNode(node.id, isExpanded);\n },\n [node, expandNode],\n )}\n inlineActions={inlineActionItems}\n actions={menuActionItems}\n unstable_decorations={decorations}\n error={node.errors.length > 0 ? node.errors[0].id : undefined}\n onContextMenu={(e) => {\n if (treeItemProps.onContextMenu) {\n treeItemProps.onContextMenu(e);\n }\n\n if (!contextMenuActions) {\n return;\n }\n\n e.preventDefault();\n const actions = injectActionVariant(contextMenuActions, \"context-menu\");\n if (actions.length === 0) {\n return;\n }\n\n setContextMenuProps({ position: { x: e.clientX, y: e.clientY }, actions });\n }}\n />\n </Popover>\n <Menu\n open={!!contextMenuProps}\n onClose={() => setContextMenuProps(undefined)}\n onContextMenu={(e) => {\n e.preventDefault();\n setContextMenuProps(undefined);\n }}\n anchorReference=\"anchorPosition\"\n anchorPosition={\n contextMenuProps ? { top: contextMenuProps.position.y, left: contextMenuProps.position.x } : undefined\n }\n aria-label={translate(\"more\")}\n onClick={() => setContextMenuProps(undefined)}\n >\n {contextMenuProps?.actions}\n </Menu>\n </>\n );\n }),\n);\n\nexport const PlaceholderNode: FC<\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n PropsWithRef<\n Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\"> & RefAttributes<HTMLElement>\n >\n> = memo(\n forwardRef<HTMLElement, Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\">>(\n function PlaceholderNode({ ...props }, forwardedRef) {\n const translate = useTranslation();\n return (\n <Tree.Item\n {...props}\n ref={forwardedRef}\n label={translate(\"loading\")}\n unstable_decorations={<CircularProgress size={16} title={translate(\"loading\")} />}\n />\n );\n },\n ),\n);\n\nfunction LabelEditor({\n initialLabel,\n labelValidationHint,\n onChange,\n onCancel,\n validate,\n}: {\n initialLabel: string;\n labelValidationHint?: string;\n onChange?: (newLabel: string) => void;\n onCancel?: () => void;\n validate?: (newLabel: string) => boolean;\n}) {\n const translate = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const [newLabelValue, setNewLabelValue] = useState(initialLabel);\n const [hasError, setHasError] = useState<boolean>(false);\n const handleLabelChange = () => {\n if (validate && !validate(newLabelValue)) {\n setHasError(true);\n return;\n }\n\n if (initialLabel !== newLabelValue) {\n onChange?.(newLabelValue);\n return;\n }\n onCancel?.();\n };\n\n const cancelLabelChange = () => {\n setNewLabelValue(initialLabel);\n onCancel?.();\n };\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, []);\n\n const canRename = newLabelValue && newLabelValue !== initialLabel && !hasError;\n const inputId = useId();\n\n return (\n <div key={initialLabel} className=\"phr-node-label-editor\">\n <div className=\"phr-node-label-editor-input-row\">\n <TextField\n fullWidth\n error={hasError}\n size=\"small\"\n id={inputId}\n inputRef={inputRef}\n slotProps={{ htmlInput: { \"aria-label\": translate(\"newLabel\") } }}\n value={newLabelValue}\n onChange={(event) => {\n setNewLabelValue(event.target.value);\n setHasError(false);\n }}\n onKeyUp={(event) => {\n if (event.key === \"Enter\") {\n handleLabelChange();\n } else if (event.key === \"Escape\") {\n cancelLabelChange();\n }\n }}\n />\n <IconButton aria-label={translate(\"cancel\")} onClick={cancelLabelChange} size=\"small\">\n <Icon href={dismissSvg} />\n </IconButton>\n <IconButton aria-label={translate(\"confirm\")} onClick={handleLabelChange} disabled={!canRename} size=\"small\">\n <Icon href={checkmarkSvg} />\n </IconButton>\n </div>\n {labelValidationHint !== undefined ? (\n <FormHelperText error={hasError} style={{ display: \"flex\" }}>\n <Typography variant=\"caption\">{labelValidationHint}</Typography>\n </FormHelperText>\n ) : undefined}\n </div>\n );\n}\n\nfunction injectActionVariant(actions: ReactNode[], variant: TreeActionBaseAttributes[\"variant\"]) {\n return actions\n .filter((action) => isValidElement<TreeActionBaseAttributes>(action))\n .map((action) => cloneElement<TreeActionBaseAttributes>(action, { variant }));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8EA,MAAa6C,4BAAkG1C,KAC7GF,WAA+C,SAAA8C,cAAAC,OAAAC,cAAA;CAAA,MAAAC,IAAA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AAAA5E,IAAA,MAAA8D;AAAA9D,IAAA,MAAAkE;AAAAlE,IAAA,MAAAqE;OAAAA,OAAArE,EAAA;AAAA,QAlCNqE;;AAsCJ,SAAS/C,oBAAoB8B,SAAsB8C,SAA8C;AAC/F,QAAO9C,QACJ+C,QAAQC,WAAWpJ,eAAyCoJ,OAAO,CAAC,CACpEC,KAAKD,WAAWtJ,aAAuCsJ,QAAQ,EAAEF,SAAS,CAAC,CAAC;;AAhPhC,SAAAnF,MAAAmC,GAAA;AAAA,QAmBfA,EAACoD,SAAU;;AAnBI,SAAA3E,OAAA4E,KAAA;AAAA,QA6CfrD,IAACoD,SAAU,aAAX,CAAyBpD,IAACsD"}
|
|
1
|
+
{"version":3,"file":"TreeNodeRenderer.js","names":["cloneElement","forwardRef","isValidElement","memo","useCallback","useEffect","useId","useMemo","useRef","useState","CircularProgress","FormHelperText","IconButton","Menu","TextField","Typography","Icon","unstable_Popover","Popover","Tree","useTranslation","TreeActionBase","useTreeNodeRenameContext","checkmarkSvg","dismissSvg","refreshSvg","ComponentPropsWithoutRef","FC","PropsWithRef","ReactNode","RefAttributes","TreeRendererProps","TreeNode","TreeActionBaseAttributes","TreeNodeRendererOwnProps","Pick","node","menuActions","inlineActions","contextMenuActions","StrataKitTreeItemProps","Omit","Item","decorations","TreeNodeRendererProps","StrataKitTreeNodeRenderer","HTMLElement","HierarchyNode","props","forwardedRef","$","_c","expandNode","reloadTree","treeItemProps","translate","renameContext","contextMenuProps","setContextMenuProps","undefined","label","t0","bb0","errors","some","_temp","t1","t2","id","parentNodeId","state","t3","injectActionVariant","inlineActionItems","bb1","menuActionItems","bb2","_temp2","children","length","isExpanded","expanded","renameParameters","cancelRename","t4","commit","t5","labelValidationHint","t6","validate","t7","labelEditor","t8","nodeId","t9","t10","t11","t12","e_1","onContextMenu","e","preventDefault","actions","position","x","clientX","y","clientY","t13","t14","t15","t16","t17","Symbol","for","e_2","t18","top","left","t19","t20","t21","t22","t23","PlaceholderNode","LabelEditor","initialLabel","onChange","onCancel","inputRef","newLabelValue","setNewLabelValue","hasError","setHasError","handleLabelChange","cancelLabelChange","current","focus","select","canRename","inputId","htmlInput","event","target","value","event_0","key","display","variant","filter","action","map","type","e_0","isNodeExpandable"],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.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 \"./TreeNodeRenderer.css\";\n\nimport {\n cloneElement,\n forwardRef,\n isValidElement,\n memo,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { CircularProgress, FormHelperText, IconButton, Menu, TextField, Typography } from \"@mui/material\";\nimport { Icon } from \"@stratakit/mui\";\nimport { unstable_Popover as Popover, Tree } from \"@stratakit/structures\";\nimport { useTranslation } from \"../LocalizationContext.js\";\nimport { TreeActionBase } from \"./TreeAction.js\";\nimport { useTreeNodeRenameContext } from \"./TreeNodeRenameAction.js\";\n\nimport checkmarkSvg from \"@stratakit/icons/checkmark.svg\";\nimport dismissSvg from \"@stratakit/icons/dismiss.svg\";\nimport refreshSvg from \"@stratakit/icons/refresh.svg\";\n\nimport type { ComponentPropsWithoutRef, FC, PropsWithRef, ReactNode, RefAttributes } from \"react\";\nimport type { TreeRendererProps } from \"../Renderers.js\";\nimport type { TreeNode } from \"../TreeNode.js\";\nimport type { TreeActionBaseAttributes } from \"./TreeAction.js\";\n\n/** @internal */\ninterface TreeNodeRendererOwnProps extends Pick<TreeRendererProps, \"expandNode\" | \"reloadTree\"> {\n /** Node that is rendered. */\n node: TreeNode;\n /**\n * Menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n menuActions?: ReactNode[];\n /**\n * Inline actions for tree item.\n * Must be an array of `<TreeActionBase />` elements.\n * Max 2 items.\n */\n inlineActions?: ReactNode[];\n /**\n * Context menu actions for tree item.\n * Must be an array of `<TreeActionBase />` or `<Divider />` elements.\n */\n contextMenuActions?: ReactNode[];\n}\n\n/** @alpha */\nexport type StrataKitTreeItemProps = Omit<\n ComponentPropsWithoutRef<typeof Tree.Item>,\n \"actions\" | \"inlineActions\" | \"expanded\" | \"onExpandedChange\" | \"icon\" | \"unstable_decorations\" | \"error\"\n> & {\n /**\n * Used to render elements between expander and label.\n * E.g. icons, color picker, etc.\n */\n decorations?: ReactNode;\n};\n\n/** @internal */\nexport type TreeNodeRendererProps = StrataKitTreeItemProps & TreeNodeRendererOwnProps;\n\n/**\n * A component that renders a given `TreeNode` using the `Tree.Item` component from `@stratakit/structures`.\n *\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport const StrataKitTreeNodeRenderer: FC<PropsWithRef<TreeNodeRendererProps & RefAttributes<HTMLElement>>> = memo(\n forwardRef<HTMLElement, TreeNodeRendererProps>(function HierarchyNode(props, forwardedRef) {\n const {\n node,\n decorations,\n inlineActions,\n menuActions,\n contextMenuActions,\n expandNode,\n reloadTree,\n ...treeItemProps\n } = props;\n const translate = useTranslation();\n const renameContext = useTreeNodeRenameContext();\n const [contextMenuProps, setContextMenuProps] = useState<\n { position: { x: number; y: number }; actions: ReactNode[] } | undefined\n >(undefined);\n\n const label = treeItemProps.label ?? node.label;\n const inlineActionItems = useMemo(() => {\n if (node.errors.some((e) => e.type === \"ChildrenLoad\")) {\n return [\n <TreeActionBase\n key=\"retry\"\n label={translate(\"retry\")}\n onClick={() => reloadTree({ parentNodeId: node.id, state: \"reset\" })}\n visible={true}\n icon={refreshSvg}\n variant=\"inline\"\n />,\n ];\n }\n if (!inlineActions) {\n return undefined;\n }\n return injectActionVariant(inlineActions, \"inline\");\n }, [node, inlineActions, translate, reloadTree]);\n\n const menuActionItems = useMemo(() => {\n if (!menuActions) {\n return undefined;\n }\n return injectActionVariant(menuActions, \"default\");\n }, [menuActions]);\n\n const expanded = useMemo(() => {\n if (node.errors.some((e) => e.type !== \"Unknown\" || !e.isNodeExpandable)) {\n return undefined;\n }\n\n // this is a leaf node\n if (node.children !== true && node.children.length === 0) {\n return undefined;\n }\n\n return node.isExpanded;\n }, [node]);\n\n const { renameParameters, cancelRename } = renameContext ?? {};\n const labelEditor = (\n <LabelEditor\n initialLabel={node.label}\n onChange={renameParameters?.commit}\n onCancel={cancelRename}\n labelValidationHint={renameParameters?.labelValidationHint}\n validate={renameParameters?.validate}\n />\n );\n\n return (\n <>\n <Popover\n content={labelEditor}\n placement=\"bottom\"\n open={renameParameters?.nodeId === node.id}\n setOpen={cancelRename}\n unmountOnHide\n >\n <Tree.Item\n {...treeItemProps}\n ref={forwardedRef}\n label={label}\n expanded={expanded}\n onExpandedChange={useCallback(\n (isExpanded: boolean) => {\n expandNode(node.id, isExpanded);\n },\n [node, expandNode],\n )}\n inlineActions={inlineActionItems}\n actions={menuActionItems}\n unstable_decorations={decorations}\n error={node.errors.length > 0 ? node.errors[0].id : undefined}\n onContextMenu={(e) => {\n if (treeItemProps.onContextMenu) {\n treeItemProps.onContextMenu(e);\n }\n\n if (!contextMenuActions) {\n return;\n }\n\n e.preventDefault();\n const actions = injectActionVariant(contextMenuActions, \"context-menu\");\n if (actions.length === 0) {\n return;\n }\n\n setContextMenuProps({ position: { x: e.clientX, y: e.clientY }, actions });\n }}\n />\n </Popover>\n <Menu\n open={!!contextMenuProps}\n onClose={() => setContextMenuProps(undefined)}\n onContextMenu={(e) => {\n e.preventDefault();\n setContextMenuProps(undefined);\n }}\n anchorReference=\"anchorPosition\"\n anchorPosition={\n contextMenuProps ? { top: contextMenuProps.position.y, left: contextMenuProps.position.x } : undefined\n }\n aria-label={translate(\"more\")}\n onClick={() => setContextMenuProps(undefined)}\n >\n {contextMenuProps?.actions}\n </Menu>\n </>\n );\n }),\n);\n\nexport const PlaceholderNode: FC<\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n PropsWithRef<\n Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\"> & RefAttributes<HTMLElement>\n >\n> = memo(\n forwardRef<HTMLElement, Pick<StrataKitTreeItemProps, \"style\" | \"aria-level\" | \"aria-posinset\" | \"aria-setsize\">>(\n function PlaceholderNode({ ...props }, forwardedRef) {\n const translate = useTranslation();\n return (\n <Tree.Item\n {...props}\n ref={forwardedRef}\n label={translate(\"loading\")}\n unstable_decorations={<CircularProgress size={16} title={translate(\"loading\")} />}\n />\n );\n },\n ),\n);\n\nfunction LabelEditor({\n initialLabel,\n labelValidationHint,\n onChange,\n onCancel,\n validate,\n}: {\n initialLabel: string;\n labelValidationHint?: string;\n onChange?: (newLabel: string) => void;\n onCancel?: () => void;\n validate?: (newLabel: string) => boolean;\n}) {\n const translate = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const [newLabelValue, setNewLabelValue] = useState(initialLabel);\n const [hasError, setHasError] = useState<boolean>(false);\n const handleLabelChange = () => {\n if (validate && !validate(newLabelValue)) {\n setHasError(true);\n return;\n }\n\n if (initialLabel !== newLabelValue) {\n onChange?.(newLabelValue);\n return;\n }\n onCancel?.();\n };\n\n const cancelLabelChange = () => {\n setNewLabelValue(initialLabel);\n onCancel?.();\n };\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, []);\n\n const canRename = newLabelValue && newLabelValue !== initialLabel && !hasError;\n const inputId = useId();\n\n return (\n <div key={initialLabel} className=\"phr-node-label-editor\">\n <div className=\"phr-node-label-editor-input-row\">\n <TextField\n fullWidth\n error={hasError}\n size=\"small\"\n id={inputId}\n inputRef={inputRef}\n slotProps={{ htmlInput: { \"aria-label\": translate(\"newLabel\") } }}\n value={newLabelValue}\n onChange={(event) => {\n setNewLabelValue(event.target.value);\n setHasError(false);\n }}\n onKeyUp={(event) => {\n if (event.key === \"Enter\") {\n handleLabelChange();\n } else if (event.key === \"Escape\") {\n cancelLabelChange();\n }\n }}\n />\n <IconButton aria-label={translate(\"cancel\")} onClick={cancelLabelChange} size=\"small\">\n <Icon href={dismissSvg} />\n </IconButton>\n <IconButton aria-label={translate(\"confirm\")} onClick={handleLabelChange} disabled={!canRename} size=\"small\">\n <Icon href={checkmarkSvg} />\n </IconButton>\n </div>\n {labelValidationHint !== undefined ? (\n <FormHelperText error={hasError} style={{ display: \"flex\" }}>\n <Typography variant=\"caption\">{labelValidationHint}</Typography>\n </FormHelperText>\n ) : undefined}\n </div>\n );\n}\n\nfunction injectActionVariant(actions: ReactNode[], variant: TreeActionBaseAttributes[\"variant\"]) {\n return actions\n .filter((action) => isValidElement<TreeActionBaseAttributes>(action))\n .map((action) => cloneElement<TreeActionBaseAttributes>(action, { variant }));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8EA,MAAa6C,4BAAkG1C,KAC7GF,WAA+C,SAAA8C,cAAAC,OAAAC,cAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAZ;CAAA,IAAAI;CAAA,IAAAS;CAAA,IAAAd;CAAA,IAAAD;CAAA,IAAAD;CAAA,IAAAiB;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAF,OAAA;EAC7C,CAAA,CAAAZ,MAAAO,aAAAL,eAAAD,aAAAE,oBAAAa,YAAAC,eAAAC,iBASIN;EAAME,EAAA,KAAAF;EAAAE,EAAA,KAAAX;EAAAW,EAAA,KAAAP;EAAAO,EAAA,KAAAE;EAAAF,EAAA,KAAAZ;EAAAY,EAAA,KAAAb;EAAAa,EAAA,KAAAd;EAAAc,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAf,qBAAAW,EAAA;EAAAP,cAAAO,EAAA;EAAAE,aAAAF,EAAA;EAAAZ,gBAAAY,EAAA;EAAAb,cAAAa,EAAA;EAAAd,OAAAc,EAAA;EAAAG,aAAAH,EAAA;EAAAI,gBAAAJ,EAAA;CAAA;CACV,MAAAK,YAAkBnC,eAAe;CACjC,MAAAoC,gBAAsBlC,yBAAyB;CAC/C,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AQ,EAAEF,QAAQ,CAAC,CAAC;AAChF;AAjPiD,SAAAnF,MAAAmC,GAAA;CAAA,OAmBfA,EAACoD,SAAU;AAAc;AAnBV,SAAA3E,OAAA4E,KAAA;CAAA,OA6CfrD,IAACoD,SAAU,aAAX,CAAyBpD,IAACsD;AAAiB"}
|
|
@@ -6,7 +6,6 @@ import { TreeErrorRendererProps } from "./TreeErrorRenderer.js";
|
|
|
6
6
|
import { StrataKitTreeItemProps } from "./TreeNodeRenderer.js";
|
|
7
7
|
import { ComponentProps, FC, PropsWithoutRef, ReactElement, ReactNode, RefAttributes } from "react";
|
|
8
8
|
import { Tree } from "@stratakit/structures";
|
|
9
|
-
|
|
10
9
|
//#region src/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts
|
|
11
10
|
/** @alpha */
|
|
12
11
|
interface TreeRendererOwnProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeRenderer.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeRenderer.tsx"],"mappings":";;;;;;;;;;UAyBU;EACR;;;;;EAKA;;EAEA,gBAAgB;;EAEhB,iBAAiB,OAAO,2BAA2B;;EAEnD,mBAAmB,MAAM,aAAa;;EAGtC,gBAAgB,QAAQ,KAAK,sBAAsB,KAAK;;EAGxD,oBACE,MAAM,aACH,QAAQ,KAAK;;;;;EAMlB,kBAAkB;IAAS,YAAY;IAAU,eAAe;QAAiB;;;;;;EAMjF,oBAAoB;IAAS,YAAY;IAAU,eAAe;QAAiB;;;;;EAKnF,yBAAyB;IAAS,YAAY;IAAU,eAAe;QAAiB;;;UAIzE;;;;;;;EAOf,aAAa,gBAAgB,MAAM;;;KAIhC,6BAA6B,oBAChC,KAAK,kDACL;;;;;;cAOW,uBAAuB,GAClC,gBAAgB,8BAA8B,cAAc"}
|