@itwin/presentation-hierarchies-react 2.0.0-alpha.6 → 2.0.0-alpha.60
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 +1137 -11
- package/README.md +93 -160
- package/lib/presentation-hierarchies-react/FlatTreeNode.d.ts +49 -0
- package/lib/presentation-hierarchies-react/FlatTreeNode.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/FlatTreeNode.js +93 -0
- package/lib/presentation-hierarchies-react/FlatTreeNode.js.map +1 -0
- package/lib/presentation-hierarchies-react/LocalizationContext.d.ts +24 -0
- package/lib/presentation-hierarchies-react/LocalizationContext.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/LocalizationContext.js +40 -0
- package/lib/presentation-hierarchies-react/LocalizationContext.js.map +1 -0
- package/lib/presentation-hierarchies-react/Renderers.d.ts +92 -0
- package/lib/presentation-hierarchies-react/Renderers.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/TreeNode.d.ts +80 -0
- package/lib/presentation-hierarchies-react/TreeNode.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies-react → presentation-hierarchies-react}/UseIModelTree.d.ts +28 -15
- package/lib/presentation-hierarchies-react/UseIModelTree.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/UseIModelTree.js +183 -0
- package/lib/presentation-hierarchies-react/UseIModelTree.js.map +1 -0
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.d.ts +30 -0
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.js +57 -0
- package/lib/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -0
- package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts +23 -0
- package/lib/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/UseSelectionHandler.js +124 -0
- package/lib/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -0
- package/lib/presentation-hierarchies-react/UseTree.d.ts +112 -0
- package/lib/presentation-hierarchies-react/UseTree.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/UseTree.js +297 -0
- package/lib/presentation-hierarchies-react/UseTree.js.map +1 -0
- package/lib/presentation-hierarchies-react/Utils.js +56 -0
- package/lib/presentation-hierarchies-react/Utils.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js +10 -0
- package/lib/presentation-hierarchies-react/internal/DisposePolyfill.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.d.ts +9 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js +12 -0
- package/lib/presentation-hierarchies-react/internal/LocalizedStrings.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/TreeActions.js +294 -0
- package/lib/presentation-hierarchies-react/internal/TreeActions.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/TreeLoader.js +98 -0
- package/lib/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/TreeModel.d.ts +1 -0
- package/lib/presentation-hierarchies-react/internal/TreeModel.js +120 -0
- package/lib/presentation-hierarchies-react/internal/TreeModel.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +35 -0
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js +141 -0
- package/lib/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -0
- package/lib/presentation-hierarchies-react/internal/Utils.js +42 -0
- package/lib/presentation-hierarchies-react/internal/Utils.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts +38 -0
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js +380 -0
- package/lib/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts +27 -0
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js +185 -0
- package/lib/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.d.ts +49 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.js +88 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts +38 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js +63 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts +29 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js +91 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts +31 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js +155 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.css +25 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts +14 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js +534 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts +75 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +1 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js +417 -0
- package/lib/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -0
- package/lib/presentation-hierarchies-react-extract.d.ts +17 -0
- package/lib/presentation-hierarchies-react-extract.js +16 -0
- package/lib/presentation-hierarchies-react-stratakit.d.ts +8 -0
- package/lib/presentation-hierarchies-react-stratakit.js +8 -0
- package/lib/presentation-hierarchies-react.d.ts +11 -0
- package/lib/presentation-hierarchies-react.js +8 -0
- package/lib/public/locales/en/PresentationHierarchies_1.0.json +26 -0
- package/package.json +78 -56
- package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts +0 -75
- package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/TreeNode.js +0 -12
- package/lib/esm/presentation-hierarchies-react/TreeNode.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.d.ts +0 -15
- package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.js +0 -22
- package/lib/esm/presentation-hierarchies-react/UnifiedSelectionContext.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.js +0 -62
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts +0 -46
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js +0 -98
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.d.ts +0 -132
- package/lib/esm/presentation-hierarchies-react/UseTree.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.js +0 -242
- package/lib/esm/presentation-hierarchies-react/UseTree.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts +0 -2
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js +0 -11
- package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts +0 -53
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js +0 -307
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts +0 -44
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js +0 -94
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts +0 -70
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js +0 -153
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +0 -28
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js +0 -128
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts +0 -23
- package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/internal/Utils.js +0 -58
- package/lib/esm/presentation-hierarchies-react/internal/Utils.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.d.ts +0 -21
- package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.js +0 -30
- package/lib/esm/presentation-hierarchies-react/itwinui/FlatTreeNode.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.d.ts +0 -73
- package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.js +0 -34
- package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.d.ts +0 -25
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.js +0 -40
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeActionButton.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.d.ts +0 -23
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.js +0 -72
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeErrorRenderer.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.d.ts +0 -40
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js +0 -80
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts +0 -30
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.js +0 -48
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react.d.ts +0 -13
- package/lib/esm/presentation-hierarchies-react.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react.js +0 -16
- package/lib/esm/presentation-hierarchies-react.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"mappings":";;;;;;AAeA;;;UAAiB,wBAAA;EAaX;AAIN;;;;;;EATE,OAAA;EASiG;;;;EAJjG,IAAA;AAAA;;KAIU,mBAAA,GAAsB,cAAA,QAAsB,IAAA,CAAK,UAAA,IAAc,wBAAA;;;;;;;;;;;;;;;;;;;;cAqB9D,cAAA,EAAgB,oBAAA,CAAqB,mBAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { c } from "react-compiler-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { DropdownMenu, Tree } from "@stratakit/structures";
|
|
5
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeAction.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.
|
|
8
|
+
* Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.
|
|
9
|
+
*
|
|
10
|
+
* When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example:
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* interface MyCustomTreeActionProps extends TreeActionBaseAttributes {
|
|
14
|
+
* myProp: string
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) {
|
|
18
|
+
* // custom button logic goes here
|
|
19
|
+
* return <TreeActionBase {...attributes} icon={...} onClick={...} />
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @alpha
|
|
24
|
+
*/
|
|
25
|
+
const TreeActionBase = memo(function TreeActionBase(t0) {
|
|
26
|
+
const $ = c(15);
|
|
27
|
+
let actionProps;
|
|
28
|
+
let dot;
|
|
29
|
+
let hide;
|
|
30
|
+
let t1;
|
|
31
|
+
let visible;
|
|
32
|
+
if ($[0] !== t0) {
|
|
33
|
+
({hide, variant: t1, dot, visible, ...actionProps} = t0);
|
|
34
|
+
$[0] = t0;
|
|
35
|
+
$[1] = actionProps;
|
|
36
|
+
$[2] = dot;
|
|
37
|
+
$[3] = hide;
|
|
38
|
+
$[4] = t1;
|
|
39
|
+
$[5] = visible;
|
|
40
|
+
} else {
|
|
41
|
+
actionProps = $[1];
|
|
42
|
+
dot = $[2];
|
|
43
|
+
hide = $[3];
|
|
44
|
+
t1 = $[4];
|
|
45
|
+
visible = $[5];
|
|
46
|
+
}
|
|
47
|
+
const variant = t1 === void 0 ? "default" : t1;
|
|
48
|
+
if (hide) {
|
|
49
|
+
let t2;
|
|
50
|
+
if ($[6] !== actionProps || $[7] !== variant) {
|
|
51
|
+
t2 = variant === "inline" ? /* @__PURE__ */ jsx(Tree.ItemAction, {
|
|
52
|
+
...actionProps,
|
|
53
|
+
visible: false
|
|
54
|
+
}) : void 0;
|
|
55
|
+
$[6] = actionProps;
|
|
56
|
+
$[7] = variant;
|
|
57
|
+
$[8] = t2;
|
|
58
|
+
} else t2 = $[8];
|
|
59
|
+
return t2;
|
|
60
|
+
}
|
|
61
|
+
if (variant === "context-menu") {
|
|
62
|
+
let t2;
|
|
63
|
+
if ($[9] !== actionProps) {
|
|
64
|
+
t2 = /* @__PURE__ */ jsx(DropdownMenu.Item, { ...actionProps });
|
|
65
|
+
$[9] = actionProps;
|
|
66
|
+
$[10] = t2;
|
|
67
|
+
} else t2 = $[10];
|
|
68
|
+
return t2;
|
|
69
|
+
}
|
|
70
|
+
const t2 = variant === "inline" ? visible : void 0;
|
|
71
|
+
let t3;
|
|
72
|
+
if ($[11] !== actionProps || $[12] !== dot || $[13] !== t2) {
|
|
73
|
+
t3 = /* @__PURE__ */ jsx(Tree.ItemAction, {
|
|
74
|
+
...actionProps,
|
|
75
|
+
dot,
|
|
76
|
+
visible: t2
|
|
77
|
+
});
|
|
78
|
+
$[11] = actionProps;
|
|
79
|
+
$[12] = dot;
|
|
80
|
+
$[13] = t2;
|
|
81
|
+
$[14] = t3;
|
|
82
|
+
} else t3 = $[14];
|
|
83
|
+
return t3;
|
|
84
|
+
});
|
|
85
|
+
//#endregion
|
|
86
|
+
export { TreeActionBase };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=TreeAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeAction.js","names":["memo","DropdownMenu","Tree","ComponentProps","NamedExoticComponent","TreeActionBaseAttributes","variant","hide","TreeActionBaseProps","ItemAction","TreeActionBase","t0","$","_c","actionProps","dot","t1","visible","undefined","t2","t3"],"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 { DropdownMenu, Tree } from \"@stratakit/structures\";\n\nimport type { ComponentProps, 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 = ComponentProps<typeof Tree.ItemAction> & TreeActionBaseAttributes;\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 return <DropdownMenu.Item {...actionProps} />;\n }\n\n return <Tree.ItemAction {...actionProps} dot={dot} visible={variant === \"inline\" ? visible : undefined} />;\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAaU,iBAA4DV,KAAK,SAAAU,eAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAR;CAAA,IAAAS;CAAA,IAAAC;AAAA,KAAAL,EAAA,OAAAD,IAAA;AAAwB,GAAA,CAAAJ,MAAAD,SAAAU,IAAAD,KAAAE,YAAAH,eAAAH;AAMhFC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAL;AAAAK,IAAA,KAAAI;AAAAJ,IAAA,KAAAK;QAAA;AAAAH,gBAAAF,EAAA;AAAAG,QAAAH,EAAA;AAAAL,SAAAK,EAAA;AAAAI,OAAAJ,EAAA;AAAAK,YAAAL,EAAA;;CAJpB,MAAAN,UAAAU,OAAAE,KAAAA,IAAA,YAAAF;AAKA,KAAIT,MAAI;EAAA,IAAAY;AAAA,MAAAP,EAAA,OAAAE,eAAAF,EAAA,OAAAN,SAAA;AACCa,QAAAb,YAAY,WAAW,oBAAA,KAAA,YAAA;IAAA,GAAqBQ;IAAsB,SAAA;IAAqB,CAAA,GAAvFI,KAAAA;AAAuFN,KAAA,KAAAE;AAAAF,KAAA,KAAAN;AAAAM,KAAA,KAAAO;QAAAA,MAAAP,EAAA;AAAA,SAAvFO;;AAGT,KAAIb,YAAY,gBAAc;EAAA,IAAAa;AAAA,MAAAP,EAAA,OAAAE,aAAA;AACrBK,QAAA,oBAAA,aAAA,MAAA,EAAA,GAAuBL,aAAe,CAAA;AAAAF,KAAA,KAAAE;AAAAF,KAAA,MAAAO;QAAAA,MAAAP,EAAA;AAAA,SAAtCO;;CAGmD,MAAAA,KAAAb,YAAY,WAAZW,UAAAC,KAAAA;CAA0C,IAAAE;AAAA,KAAAR,EAAA,QAAAE,eAAAF,EAAA,QAAAG,OAAAH,EAAA,QAAAO,IAAA;AAA/FC,OAAA,oBAAA,KAAA,YAAA;GAAA,GAAqBN;GAAkBC;GAAc,SAAAI;GAA8C,CAAA;AAAAP,IAAA,MAAAE;AAAAF,IAAA,MAAAG;AAAAH,IAAA,MAAAO;AAAAP,IAAA,MAAAQ;OAAAA,MAAAR,EAAA;AAAA,QAAnGQ;EACP"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useErrorNodes } from "../FlatTreeNode.js";
|
|
2
|
+
import { ErrorItemRendererProps } from "./ErrorItemRenderer.js";
|
|
3
|
+
import { JSX, ReactElement } from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Interface containing building blocks for `TreeErrorRenderer`.
|
|
8
|
+
*
|
|
9
|
+
* @alpha
|
|
10
|
+
*/
|
|
11
|
+
interface TreeErrorRendererOwnProps {
|
|
12
|
+
/**
|
|
13
|
+
* A user friendly display label of the tree. Should be unique within the consuming application,
|
|
14
|
+
* as it's used for creating a unique accessible label for the error region.
|
|
15
|
+
*/
|
|
16
|
+
treeLabel: string;
|
|
17
|
+
/** List of error nodes to render errors for. */
|
|
18
|
+
errorNodes: ReturnType<typeof useErrorNodes>;
|
|
19
|
+
/** Callback to render custom error messages. Component should be wrapped in `unstable_ErrorRegion.Item` from `@stratakit/structures` package. */
|
|
20
|
+
renderError?: (props: ErrorItemRendererProps) => ReactElement;
|
|
21
|
+
}
|
|
22
|
+
/** @alpha */
|
|
23
|
+
type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRendererProps, "errorNode">;
|
|
24
|
+
/**
|
|
25
|
+
* A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@stratakit/structures`.
|
|
26
|
+
* As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorNodes` hook.
|
|
27
|
+
*
|
|
28
|
+
* @alpha
|
|
29
|
+
*/
|
|
30
|
+
declare function TreeErrorRenderer({
|
|
31
|
+
treeLabel,
|
|
32
|
+
errorNodes,
|
|
33
|
+
renderError,
|
|
34
|
+
...errorItemRendererProps
|
|
35
|
+
}: TreeErrorRendererProps): JSX.Element;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { TreeErrorRenderer, TreeErrorRendererProps };
|
|
38
|
+
//# sourceMappingURL=TreeErrorRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeErrorRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"mappings":";;;;;;;AAYqE;;;UAO3D,yBAAA;EAOI;;;;EAFZ,SAAA;EAAA;EAEA,UAAA,EAAY,UAAA,QAAkB,aAAA;EAAlB;EAEZ,WAAA,IAAe,KAAA,EAAO,sBAAA,KAA2B,YAAA;AAAA;;KAIvC,sBAAA,GAAyB,yBAAA,GAA4B,IAAA,CAAK,sBAAA;;;;AAAtE;;;iBAQgB,iBAAA,CAAA;EACd,SAAA;EACA,UAAA;EACA,WAAA;EAAA,GACG;AAAA,GACF,sBAAA,GAAyB,GAAA,CAAI,OAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useTranslation } from "../LocalizationContext.js";
|
|
2
|
+
import { ErrorItemRenderer } from "./ErrorItemRenderer.js";
|
|
3
|
+
import { c } from "react-compiler-runtime";
|
|
4
|
+
import { cloneElement } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { unstable_ErrorRegion } from "@stratakit/structures";
|
|
7
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@stratakit/structures`.
|
|
10
|
+
* As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorNodes` hook.
|
|
11
|
+
*
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
function TreeErrorRenderer(t0) {
|
|
15
|
+
const $ = c(11);
|
|
16
|
+
const { treeLabel, errorNodes, renderError, ...errorItemRendererProps } = t0;
|
|
17
|
+
const translate = useTranslation();
|
|
18
|
+
const errorItems = errorNodes.map((errorNode) => {
|
|
19
|
+
const errorRendererProps = {
|
|
20
|
+
errorNode,
|
|
21
|
+
...errorItemRendererProps
|
|
22
|
+
};
|
|
23
|
+
if (renderError) return cloneElement(renderError(errorRendererProps), { key: errorNode.id });
|
|
24
|
+
return /* @__PURE__ */ jsx(ErrorItemRenderer, { ...errorRendererProps }, errorNode.id);
|
|
25
|
+
});
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
28
|
+
t1 = { width: "100%" };
|
|
29
|
+
$[0] = t1;
|
|
30
|
+
} else t1 = $[0];
|
|
31
|
+
let t2;
|
|
32
|
+
if ($[1] !== translate || $[2] !== treeLabel) {
|
|
33
|
+
t2 = translate("issuesForTree").replace("{{tree_label}}", treeLabel);
|
|
34
|
+
$[1] = translate;
|
|
35
|
+
$[2] = treeLabel;
|
|
36
|
+
$[3] = t2;
|
|
37
|
+
} else t2 = $[3];
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[4] !== errorNodes.length || $[5] !== translate) {
|
|
40
|
+
t3 = errorNodes.length === 0 ? translate("noIssuesFound") : translate("issuesFound").replace("{{number_of_issues}}", errorNodes.length.toString());
|
|
41
|
+
$[4] = errorNodes.length;
|
|
42
|
+
$[5] = translate;
|
|
43
|
+
$[6] = t3;
|
|
44
|
+
} else t3 = $[6];
|
|
45
|
+
let t4;
|
|
46
|
+
if ($[7] !== errorItems || $[8] !== t2 || $[9] !== t3) {
|
|
47
|
+
t4 = /* @__PURE__ */ jsx(unstable_ErrorRegion.Root, {
|
|
48
|
+
style: t1,
|
|
49
|
+
"aria-label": t2,
|
|
50
|
+
label: t3,
|
|
51
|
+
items: errorItems
|
|
52
|
+
});
|
|
53
|
+
$[7] = errorItems;
|
|
54
|
+
$[8] = t2;
|
|
55
|
+
$[9] = t3;
|
|
56
|
+
$[10] = t4;
|
|
57
|
+
} else t4 = $[10];
|
|
58
|
+
return t4;
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { TreeErrorRenderer };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=TreeErrorRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeErrorRenderer.js","names":["cloneElement","unstable_ErrorRegion","ErrorRegion","useTranslation","ErrorItemRenderer","JSX","ReactElement","useErrorNodes","ErrorItemRendererProps","TreeErrorRendererOwnProps","treeLabel","errorNodes","ReturnType","renderError","props","TreeErrorRendererProps","Omit","TreeErrorRenderer","t0","$","_c","errorItemRendererProps","translate","errorItems","map","errorNode","errorRendererProps","key","id","t1","Symbol","for","width","t2","replace","t3","length","toString","t4"],"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 } 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, \"errorNode\">;\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.map((errorNode) => {\n const errorRendererProps: ErrorItemRendererProps = { errorNode, ...errorItemRendererProps };\n\n if (renderError) {\n return cloneElement(renderError(errorRendererProps), { key: errorNode.id });\n }\n\n return <ErrorItemRenderer key={errorNode.id} {...errorRendererProps} />;\n });\n\n return (\n <ErrorRegion.Root\n style={{ width: \"100%\" }}\n aria-label={translate(\"issuesForTree\").replace(\"{{tree_label}}\", treeLabel)}\n label={\n errorNodes.length === 0\n ? translate(\"noIssuesFound\")\n : translate(\"issuesFound\").replace(\"{{number_of_issues}}\", errorNodes.length.toString())\n }\n items={errorItems}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAwCA,SAAOiB,kBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAA2B,MAAA,EAAAV,WAAAC,YAAAE,aAAA,GAAAQ,2BAAAH;CAMhC,MAAAI,YAAkBnB,gBAAgB;CAClC,MAAAoB,aAAmBZ,WAAUa,KAAKC,cAAA;EAChC,MAAAC,qBAAmD;GAAAD;GAAA,GAAgBJ;GAAwB;AAE3F,MAAIR,YAAW,QACNb,aAAaa,YAAYa,mBAAmB,EAAE,EAAAC,KAAOF,UAASG,IAAK,CAAC;AAC5E,SAEM,oBAAC,mBAAD,EAAoC,GAAMF,oBAAsB,EAAxCD,UAASG,GAA+B;GACvE;CAAC,IAAAC;AAAA,KAAAV,EAAA,OAAAW,OAAAC,IAAA,4BAAA,EAAA;AAIQF,OAAA,EAAAG,OAAS,QAAQ;AAAAb,IAAA,KAAAU;OAAAA,MAAAV,EAAA;CAAA,IAAAc;AAAA,KAAAd,EAAA,OAAAG,aAAAH,EAAA,OAAAT,WAAA;AACZuB,OAAAX,UAAU,gBAAgB,CAAAY,QAAS,kBAAkBxB,UAAU;AAAAS,IAAA,KAAAG;AAAAH,IAAA,KAAAT;AAAAS,IAAA,KAAAc;OAAAA,MAAAd,EAAA;CAAA,IAAAgB;AAAA,KAAAhB,EAAA,OAAAR,WAAAyB,UAAAjB,EAAA,OAAAG,WAAA;AAEzEa,OAAAxB,WAAUyB,WAAY,IAClBd,UAAU,gBAC4E,GAAtFA,UAAU,cAAc,CAAAY,QAAS,wBAAwBvB,WAAUyB,OAAOC,UAAW,CAAC;AAAAlB,IAAA,KAAAR,WAAAyB;AAAAjB,IAAA,KAAAG;AAAAH,IAAA,KAAAgB;OAAAA,MAAAhB,EAAA;CAAA,IAAAmB;AAAA,KAAAnB,EAAA,OAAAI,cAAAJ,EAAA,OAAAc,MAAAd,EAAA,OAAAgB,IAAA;AAN9FG,OAAA,oBAAA,qBAAA,MAAA;GACS,OAAAT;GACK,cAAAI;GAEV,OAAAE;GAIKZ,OAAAA;GACP,CAAA;AAAAJ,IAAA,KAAAI;AAAAJ,IAAA,KAAAc;AAAAd,IAAA,KAAAgB;AAAAhB,IAAA,MAAAmB;OAAAA,MAAAnB,EAAA;AAAA,QATFmB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TreeNode } from "../TreeNode.js";
|
|
2
|
+
import { HierarchyLevelDetails, TreeRendererProps } from "../Renderers.js";
|
|
3
|
+
import { TreeActionBaseAttributes } from "./TreeAction.js";
|
|
4
|
+
import { NamedExoticComponent } from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts
|
|
7
|
+
/** @alpha */
|
|
8
|
+
type TreeNodeFilterActionProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Action to perform when the filter button is clicked for this node.
|
|
11
|
+
*/
|
|
12
|
+
onFilter?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;
|
|
13
|
+
} & TreeActionBaseAttributes & Pick<TreeRendererProps, "getHierarchyLevelDetails">;
|
|
14
|
+
/**
|
|
15
|
+
* React component that renders a filter action for a tree item.
|
|
16
|
+
*
|
|
17
|
+
* The action calls the `onFilter` callback prop when clicked.
|
|
18
|
+
*
|
|
19
|
+
* @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action
|
|
20
|
+
* to tree items.
|
|
21
|
+
*
|
|
22
|
+
* @alpha
|
|
23
|
+
*/
|
|
24
|
+
declare const TreeNodeFilterAction: NamedExoticComponent<TreeNodeFilterActionProps & {
|
|
25
|
+
node: TreeNode;
|
|
26
|
+
}>;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { TreeNodeFilterAction };
|
|
29
|
+
//# sourceMappingURL=TreeNodeFilterAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeNodeFilterAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx"],"mappings":";;;;;;;KAiBK,yBAAA;EAAA;;;EAIH,QAAA,IAAY,qBAAA,EAAuB,qBAAA;AAAA,IACjC,wBAAA,GACF,IAAA,CAAK,iBAAA;;;;;;;;;;;cAYM,oBAAA,EAAsB,oBAAA,CAAqB,yBAAA;EAA8B,IAAA,EAAM,QAAA;AAAA"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useTranslation } from "../LocalizationContext.js";
|
|
2
|
+
import { TreeActionBase } from "./TreeAction.js";
|
|
3
|
+
import { c } from "react-compiler-runtime";
|
|
4
|
+
import { memo } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import filterSvg from "@stratakit/icons/filter.svg";
|
|
7
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.tsx
|
|
8
|
+
/**
|
|
9
|
+
* React component that renders a filter action for a tree item.
|
|
10
|
+
*
|
|
11
|
+
* The action calls the `onFilter` callback prop when clicked.
|
|
12
|
+
*
|
|
13
|
+
* @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action
|
|
14
|
+
* to tree items.
|
|
15
|
+
*
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
const TreeNodeFilterAction = memo(function TreeNodeFilterAction(t0) {
|
|
19
|
+
const $ = c(20);
|
|
20
|
+
let actionAttributes;
|
|
21
|
+
let getHierarchyLevelDetails;
|
|
22
|
+
let node;
|
|
23
|
+
let onFilter;
|
|
24
|
+
if ($[0] !== t0) {
|
|
25
|
+
({node, onFilter, getHierarchyLevelDetails, ...actionAttributes} = t0);
|
|
26
|
+
$[0] = t0;
|
|
27
|
+
$[1] = actionAttributes;
|
|
28
|
+
$[2] = getHierarchyLevelDetails;
|
|
29
|
+
$[3] = node;
|
|
30
|
+
$[4] = onFilter;
|
|
31
|
+
} else {
|
|
32
|
+
actionAttributes = $[1];
|
|
33
|
+
getHierarchyLevelDetails = $[2];
|
|
34
|
+
node = $[3];
|
|
35
|
+
onFilter = $[4];
|
|
36
|
+
}
|
|
37
|
+
const translate = useTranslation();
|
|
38
|
+
let t1;
|
|
39
|
+
if ($[5] !== translate) {
|
|
40
|
+
t1 = translate("filterHierarchyLevel");
|
|
41
|
+
$[5] = translate;
|
|
42
|
+
$[6] = t1;
|
|
43
|
+
} else t1 = $[6];
|
|
44
|
+
const filterHierarchyLevel = t1;
|
|
45
|
+
let t2;
|
|
46
|
+
if ($[7] !== translate) {
|
|
47
|
+
t2 = translate("filterHierarchyLevelActiveDescription");
|
|
48
|
+
$[7] = translate;
|
|
49
|
+
$[8] = t2;
|
|
50
|
+
} else t2 = $[8];
|
|
51
|
+
const filterHierarchyLevelActiveDescription = t2;
|
|
52
|
+
let t3;
|
|
53
|
+
if ($[9] !== getHierarchyLevelDetails || $[10] !== node.id || $[11] !== onFilter) {
|
|
54
|
+
t3 = () => {
|
|
55
|
+
const hierarchyLevelDetails = getHierarchyLevelDetails(node.id);
|
|
56
|
+
hierarchyLevelDetails && onFilter?.(hierarchyLevelDetails);
|
|
57
|
+
};
|
|
58
|
+
$[9] = getHierarchyLevelDetails;
|
|
59
|
+
$[10] = node.id;
|
|
60
|
+
$[11] = onFilter;
|
|
61
|
+
$[12] = t3;
|
|
62
|
+
} else t3 = $[12];
|
|
63
|
+
const handleClick = t3;
|
|
64
|
+
const t4 = node.isFiltered ? true : void 0;
|
|
65
|
+
const t5 = node.isFiltered ? filterHierarchyLevelActiveDescription : void 0;
|
|
66
|
+
const t6 = !onFilter || !node.isFilterable;
|
|
67
|
+
let t7;
|
|
68
|
+
if ($[13] !== actionAttributes || $[14] !== filterHierarchyLevel || $[15] !== handleClick || $[16] !== t4 || $[17] !== t5 || $[18] !== t6) {
|
|
69
|
+
t7 = /* @__PURE__ */ jsx(TreeActionBase, {
|
|
70
|
+
...actionAttributes,
|
|
71
|
+
label: filterHierarchyLevel,
|
|
72
|
+
onClick: handleClick,
|
|
73
|
+
icon: filterSvg,
|
|
74
|
+
visible: t4,
|
|
75
|
+
dot: t5,
|
|
76
|
+
hide: t6
|
|
77
|
+
});
|
|
78
|
+
$[13] = actionAttributes;
|
|
79
|
+
$[14] = filterHierarchyLevel;
|
|
80
|
+
$[15] = handleClick;
|
|
81
|
+
$[16] = t4;
|
|
82
|
+
$[17] = t5;
|
|
83
|
+
$[18] = t6;
|
|
84
|
+
$[19] = t7;
|
|
85
|
+
} else t7 = $[19];
|
|
86
|
+
return t7;
|
|
87
|
+
});
|
|
88
|
+
//#endregion
|
|
89
|
+
export { TreeNodeFilterAction };
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=TreeNodeFilterAction.js.map
|
|
@@ -0,0 +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,GAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL;CAAA,IAAAJ;AAAA,KAAAM,EAAA,OAAAD,IAAA;AAA8B,GAAA,CAAAD,MAAAJ,UAAAS,6BAAAD,oBAAAH;AAKmBC,IAAA,KAAAD;AAAAC,IAAA,KAAAE;AAAAF,IAAA,KAAAG;AAAAH,IAAA,KAAAF;AAAAE,IAAA,KAAAN;QAAA;AAAAQ,qBAAAF,EAAA;AAAAG,6BAAAH,EAAA;AAAAF,SAAAE,EAAA;AAAAN,aAAAM,EAAA;;CAC/C,MAAAI,YAAkBnB,gBAAgB;CAAC,IAAAoB;AAAA,KAAAL,EAAA,OAAAI,WAAA;AACNC,OAAAD,UAAU,uBAAuB;AAAAJ,IAAA,KAAAI;AAAAJ,IAAA,KAAAK;OAAAA,MAAAL,EAAA;CAA9D,MAAAM,uBAA6BD;CAAkC,IAAAE;AAAA,KAAAP,EAAA,OAAAI,WAAA;AACjBG,OAAAH,UAAU,wCAAwC;AAAAJ,IAAA,KAAAI;AAAAJ,IAAA,KAAAO;OAAAA,MAAAP,EAAA;CAAhG,MAAAQ,wCAA8CD;CAAmD,IAAAE;AAAA,KAAAT,EAAA,OAAAG,4BAAAH,EAAA,QAAAF,KAAAY,MAAAV,EAAA,QAAAN,UAAA;AAEjEe,aAAA;GAC9B,MAAAd,wBAA8BQ,yBAAyBL,KAAIY,GAAI;AAC/Df,4BAAyBD,WAAWC,sBAAsB;;AAC3DK,IAAA,KAAAG;AAAAH,IAAA,MAAAF,KAAAY;AAAAV,IAAA,MAAAN;AAAAM,IAAA,MAAAS;OAAAA,MAAAT,EAAA;CAHD,MAAAW,cAAoBF;CAWP,MAAAG,KAAAd,KAAIe,aAAJ,OAAAC,KAAAA;CACJ,MAAAC,KAAAjB,KAAIe,aAAJL,wCAAAM,KAAAA;CACC,MAAAE,KAAA,CAACtB,YAAD,CAAcI,KAAImB;CAAa,IAAAC;AAAA,KAAAlB,EAAA,QAAAE,oBAAAF,EAAA,QAAAM,wBAAAN,EAAA,QAAAW,eAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAe,MAAAf,EAAA,QAAAgB,IAAA;AAPvCE,OAAA,oBAAC,gBAAD;GAAe,GACThB;GACGI,OAAAA;GACEK,SAAAA;GACHxB,MAAAA;GACG,SAAAyB;GACJ,KAAAG;GACC,MAAAC;GACN,CAAA;AAAAhB,IAAA,MAAAE;AAAAF,IAAA,MAAAM;AAAAN,IAAA,MAAAW;AAAAX,IAAA,MAAAY;AAAAZ,IAAA,MAAAe;AAAAf,IAAA,MAAAgB;AAAAhB,IAAA,MAAAkB;OAAAA,MAAAlB,EAAA;AAAA,QARFkB;EAWL"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TreeNode } from "../TreeNode.js";
|
|
2
|
+
import { TreeActionBaseAttributes } from "./TreeAction.js";
|
|
3
|
+
import { NamedExoticComponent, PropsWithChildren } from "react";
|
|
4
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* React component that renders a rename action for a tree item.
|
|
7
|
+
*
|
|
8
|
+
* The tree component must have `getEditingProps.onLabelChanged` prop set to enable renaming functionality. When
|
|
9
|
+
* rename is completed, the `onLabelChanged` function is called to make the actual data update.
|
|
10
|
+
*
|
|
11
|
+
* @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action
|
|
12
|
+
* to tree items.
|
|
13
|
+
*
|
|
14
|
+
* @alpha
|
|
15
|
+
*/
|
|
16
|
+
declare const TreeNodeRenameAction: NamedExoticComponent<TreeActionBaseAttributes & {
|
|
17
|
+
node: TreeNode;
|
|
18
|
+
}>;
|
|
19
|
+
/** @alpha */
|
|
20
|
+
interface TreeNodeEditingProps {
|
|
21
|
+
/**
|
|
22
|
+
* A callback that is invoked when node label is changed. Should be used together
|
|
23
|
+
* with `<TreeNodeRenameAction />` to enter label editing mode.
|
|
24
|
+
*/
|
|
25
|
+
onLabelChanged: (newLabel: string) => void;
|
|
26
|
+
labelValidationHint?: string;
|
|
27
|
+
validate?: (newLabel: string) => boolean;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { TreeNodeEditingProps, TreeNodeRenameAction };
|
|
31
|
+
//# sourceMappingURL=TreeNodeRenameAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeNodeRenameAction.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx"],"mappings":";;;;;;;AA0BA;;;;;;;;cAAa,oBAAA,EAAsB,oBAAA,CAAqB,wBAAA;EAA6B,IAAA,EAAM,QAAA;AAAA;;UAmB1E,oBAAA;EAnBkF;AAmBnG;;;EAKE,cAAA,GAAiB,QAAA;EACjB,mBAAA;EACA,QAAA,IAAY,QAAA;AAAA"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { useTranslation } from "../LocalizationContext.js";
|
|
2
|
+
import { TreeActionBase } from "./TreeAction.js";
|
|
3
|
+
import { c } from "react-compiler-runtime";
|
|
4
|
+
import { createContext, memo, useContext, useState } from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import renameSvg from "@stratakit/icons/rename.svg";
|
|
7
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.tsx
|
|
8
|
+
/**
|
|
9
|
+
* React component that renders a rename action for a tree item.
|
|
10
|
+
*
|
|
11
|
+
* The tree component must have `getEditingProps.onLabelChanged` prop set to enable renaming functionality. When
|
|
12
|
+
* rename is completed, the `onLabelChanged` function is called to make the actual data update.
|
|
13
|
+
*
|
|
14
|
+
* @see `getMenuActions`, `getInlineActions`, `getContextMenuActions` props of `TreeRenderer` to add this action
|
|
15
|
+
* to tree items.
|
|
16
|
+
*
|
|
17
|
+
* @alpha
|
|
18
|
+
*/
|
|
19
|
+
const TreeNodeRenameAction = memo(function TreeNodeRenameAction(t0) {
|
|
20
|
+
const $ = c(16);
|
|
21
|
+
let actionAttributes;
|
|
22
|
+
let node;
|
|
23
|
+
if ($[0] !== t0) {
|
|
24
|
+
({node, ...actionAttributes} = t0);
|
|
25
|
+
$[0] = t0;
|
|
26
|
+
$[1] = actionAttributes;
|
|
27
|
+
$[2] = node;
|
|
28
|
+
} else {
|
|
29
|
+
actionAttributes = $[1];
|
|
30
|
+
node = $[2];
|
|
31
|
+
}
|
|
32
|
+
const translate = useTranslation();
|
|
33
|
+
const context = useTreeNodeRenameContext();
|
|
34
|
+
let t1;
|
|
35
|
+
if ($[3] !== translate) {
|
|
36
|
+
t1 = translate("rename");
|
|
37
|
+
$[3] = translate;
|
|
38
|
+
$[4] = t1;
|
|
39
|
+
} else t1 = $[4];
|
|
40
|
+
const rename = t1;
|
|
41
|
+
let t2;
|
|
42
|
+
if ($[5] !== context || $[6] !== node) {
|
|
43
|
+
t2 = context?.canRename(node) ?? false;
|
|
44
|
+
$[5] = context;
|
|
45
|
+
$[6] = node;
|
|
46
|
+
$[7] = t2;
|
|
47
|
+
} else t2 = $[7];
|
|
48
|
+
const canRename = t2;
|
|
49
|
+
const startRename = context?.startRename;
|
|
50
|
+
let t3;
|
|
51
|
+
if ($[8] !== node || $[9] !== startRename) {
|
|
52
|
+
t3 = () => {
|
|
53
|
+
startRename?.(node);
|
|
54
|
+
};
|
|
55
|
+
$[8] = node;
|
|
56
|
+
$[9] = startRename;
|
|
57
|
+
$[10] = t3;
|
|
58
|
+
} else t3 = $[10];
|
|
59
|
+
const handleClick = t3;
|
|
60
|
+
const t4 = !canRename;
|
|
61
|
+
let t5;
|
|
62
|
+
if ($[11] !== actionAttributes || $[12] !== handleClick || $[13] !== rename || $[14] !== t4) {
|
|
63
|
+
t5 = /* @__PURE__ */ jsx(TreeActionBase, {
|
|
64
|
+
...actionAttributes,
|
|
65
|
+
label: rename,
|
|
66
|
+
onClick: handleClick,
|
|
67
|
+
icon: renameSvg,
|
|
68
|
+
hide: t4
|
|
69
|
+
});
|
|
70
|
+
$[11] = actionAttributes;
|
|
71
|
+
$[12] = handleClick;
|
|
72
|
+
$[13] = rename;
|
|
73
|
+
$[14] = t4;
|
|
74
|
+
$[15] = t5;
|
|
75
|
+
} else t5 = $[15];
|
|
76
|
+
return t5;
|
|
77
|
+
});
|
|
78
|
+
const treeNodeRenameContext = createContext(void 0);
|
|
79
|
+
/** @internal */
|
|
80
|
+
const useTreeNodeRenameContext = () => {
|
|
81
|
+
return useContext(treeNodeRenameContext);
|
|
82
|
+
};
|
|
83
|
+
/** @internal */
|
|
84
|
+
function TreeNodeRenameContextProvider(t0) {
|
|
85
|
+
const $ = c(3);
|
|
86
|
+
const { value, children } = t0;
|
|
87
|
+
let t1;
|
|
88
|
+
if ($[0] !== children || $[1] !== value) {
|
|
89
|
+
t1 = /* @__PURE__ */ jsx(treeNodeRenameContext.Provider, {
|
|
90
|
+
value,
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
$[0] = children;
|
|
94
|
+
$[1] = value;
|
|
95
|
+
$[2] = t1;
|
|
96
|
+
} else t1 = $[2];
|
|
97
|
+
return t1;
|
|
98
|
+
}
|
|
99
|
+
/** @internal */
|
|
100
|
+
function useTreeNodeRenameContextValue(t0) {
|
|
101
|
+
const $ = c(9);
|
|
102
|
+
const { getEditingProps } = t0;
|
|
103
|
+
const [renameParameters, setRenameParameters] = useState(void 0);
|
|
104
|
+
let t1;
|
|
105
|
+
if ($[0] !== getEditingProps) {
|
|
106
|
+
t1 = (node) => {
|
|
107
|
+
const { onLabelChanged, labelValidationHint, validate } = getEditingProps?.(node) ?? {};
|
|
108
|
+
if (onLabelChanged) setRenameParameters({
|
|
109
|
+
nodeId: node.id,
|
|
110
|
+
commit: (newLabel) => {
|
|
111
|
+
onLabelChanged(newLabel);
|
|
112
|
+
setRenameParameters(void 0);
|
|
113
|
+
},
|
|
114
|
+
labelValidationHint,
|
|
115
|
+
validate
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
$[0] = getEditingProps;
|
|
119
|
+
$[1] = t1;
|
|
120
|
+
} else t1 = $[1];
|
|
121
|
+
const startRename = t1;
|
|
122
|
+
let t2;
|
|
123
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
124
|
+
t2 = () => {
|
|
125
|
+
setRenameParameters(void 0);
|
|
126
|
+
};
|
|
127
|
+
$[2] = t2;
|
|
128
|
+
} else t2 = $[2];
|
|
129
|
+
const cancelRename = t2;
|
|
130
|
+
let t3;
|
|
131
|
+
if ($[3] !== getEditingProps) {
|
|
132
|
+
t3 = (node_0) => getEditingProps?.(node_0)?.onLabelChanged !== void 0;
|
|
133
|
+
$[3] = getEditingProps;
|
|
134
|
+
$[4] = t3;
|
|
135
|
+
} else t3 = $[4];
|
|
136
|
+
const canRename = t3;
|
|
137
|
+
let t4;
|
|
138
|
+
if ($[5] !== canRename || $[6] !== renameParameters || $[7] !== startRename) {
|
|
139
|
+
t4 = {
|
|
140
|
+
renameParameters,
|
|
141
|
+
cancelRename,
|
|
142
|
+
startRename,
|
|
143
|
+
canRename
|
|
144
|
+
};
|
|
145
|
+
$[5] = canRename;
|
|
146
|
+
$[6] = renameParameters;
|
|
147
|
+
$[7] = startRename;
|
|
148
|
+
$[8] = t4;
|
|
149
|
+
} else t4 = $[8];
|
|
150
|
+
return t4;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { TreeNodeRenameAction, TreeNodeRenameContextProvider, useTreeNodeRenameContext, useTreeNodeRenameContextValue };
|
|
154
|
+
|
|
155
|
+
//# sourceMappingURL=TreeNodeRenameAction.js.map
|
|
@@ -0,0 +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":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
.phr-node-label-editor {
|
|
7
|
+
padding: var(--stratakit-space-x1);
|
|
8
|
+
width: 300px;
|
|
9
|
+
display: grid;
|
|
10
|
+
gap: var(--stratakit-space-x1);
|
|
11
|
+
grid-template-rows: auto auto;
|
|
12
|
+
|
|
13
|
+
.phr-node-label-editor-input-row {
|
|
14
|
+
display: grid;
|
|
15
|
+
gap: var(--stratakit-space-x1);
|
|
16
|
+
grid-template-columns: 1fr auto auto;
|
|
17
|
+
|
|
18
|
+
.with-error {
|
|
19
|
+
outline-color: var(--stratakit-color-border-critical-base);
|
|
20
|
+
&::before {
|
|
21
|
+
border-color: var(--stratakit-color-border-critical-base);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, FC, ReactNode, RefAttributes } from "react";
|
|
2
|
+
import { Tree } from "@stratakit/structures";
|
|
3
|
+
//#region src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts
|
|
4
|
+
/** @alpha */
|
|
5
|
+
type StrataKitTreeItemProps = Omit<ComponentPropsWithoutRef<typeof Tree.Item>, "actions" | "inlineActions" | "expanded" | "onExpandedChange" | "icon" | "unstable_decorations" | "error"> & {
|
|
6
|
+
/**
|
|
7
|
+
* Used to render elements between expander and label.
|
|
8
|
+
* E.g. icons, color picker, etc.
|
|
9
|
+
*/
|
|
10
|
+
decorations?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { StrataKitTreeItemProps };
|
|
14
|
+
//# sourceMappingURL=TreeNodeRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeNodeRenderer.d.ts","names":[],"sources":["../../../src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx"],"mappings":";;;;KAyDY,sBAAA,GAAyB,IAAA,CACnC,wBAAA,QAAgC,IAAA,CAAK,IAAA;;;;;EAOrC,WAAA,GAAc,SAAA;AAAA"}
|