@itwin/presentation-hierarchies-react 2.0.0-alpha.52 → 2.0.0-alpha.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/lib/esm/presentation-hierarchies-react/Renderers.d.ts +62 -55
  3. package/lib/esm/presentation-hierarchies-react/Renderers.d.ts.map +1 -1
  4. package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts +33 -29
  5. package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts.map +1 -1
  6. package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts +27 -16
  7. package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts.map +1 -1
  8. package/lib/esm/presentation-hierarchies-react/UseIModelTree.js +181 -54
  9. package/lib/esm/presentation-hierarchies-react/UseIModelTree.js.map +1 -1
  10. package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.d.ts +12 -6
  11. package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +1 -1
  12. package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.js +54 -49
  13. package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -1
  14. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts +7 -30
  15. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -1
  16. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js +116 -74
  17. package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -1
  18. package/lib/esm/presentation-hierarchies-react/UseTree.d.ts +67 -54
  19. package/lib/esm/presentation-hierarchies-react/UseTree.d.ts.map +1 -1
  20. package/lib/esm/presentation-hierarchies-react/UseTree.js +283 -226
  21. package/lib/esm/presentation-hierarchies-react/UseTree.js.map +1 -1
  22. package/lib/esm/presentation-hierarchies-react/Utils.js +44 -27
  23. package/lib/esm/presentation-hierarchies-react/Utils.js.map +1 -1
  24. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js +6 -7
  25. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.js.map +1 -1
  26. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js +271 -298
  27. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js.map +1 -1
  28. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js +91 -82
  29. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -1
  30. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts +3 -47
  31. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js +114 -151
  32. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js.map +1 -1
  33. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +32 -37
  34. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -1
  35. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js +128 -101
  36. package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -1
  37. package/lib/esm/presentation-hierarchies-react/internal/Utils.js +29 -44
  38. package/lib/esm/presentation-hierarchies-react/internal/Utils.js.map +1 -1
  39. package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts +24 -13
  40. package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +1 -1
  41. package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js +344 -67
  42. package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -1
  43. package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts +16 -15
  44. package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts.map +1 -1
  45. package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.js +78 -60
  46. package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.js.map +1 -1
  47. package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts +122 -117
  48. package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts.map +1 -1
  49. package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.js +59 -38
  50. package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.js.map +1 -1
  51. package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts +16 -5
  52. package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -1
  53. package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.js +161 -35
  54. package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -1
  55. package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.d.ts +21 -17
  56. package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +1 -1
  57. package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.js +84 -31
  58. package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -1
  59. package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts +22 -14
  60. package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -1
  61. package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js +61 -26
  62. package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -1
  63. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts +15 -6
  64. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -1
  65. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js +75 -25
  66. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -1
  67. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts +16 -40
  68. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -1
  69. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js +140 -61
  70. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -1
  71. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts +14 -42
  72. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -1
  73. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js +489 -121
  74. package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -1
  75. package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts +58 -55
  76. package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +1 -1
  77. package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.js +412 -181
  78. package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -1
  79. package/lib/esm/presentation-hierarchies-react.d.ts +17 -17
  80. package/lib/esm/presentation-hierarchies-react.js +15 -18
  81. package/package.json +17 -14
  82. package/lib/esm/presentation-hierarchies-react/Renderers.js +0 -6
  83. package/lib/esm/presentation-hierarchies-react/Renderers.js.map +0 -1
  84. package/lib/esm/presentation-hierarchies-react/TreeNode.js +0 -6
  85. package/lib/esm/presentation-hierarchies-react/TreeNode.js.map +0 -1
  86. package/lib/esm/presentation-hierarchies-react/Utils.d.ts +0 -8
  87. package/lib/esm/presentation-hierarchies-react/Utils.d.ts.map +0 -1
  88. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts +0 -2
  89. package/lib/esm/presentation-hierarchies-react/internal/DisposePolyfill.d.ts.map +0 -1
  90. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts +0 -53
  91. package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts.map +0 -1
  92. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts +0 -62
  93. package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts.map +0 -1
  94. package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts.map +0 -1
  95. package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts +0 -23
  96. package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts.map +0 -1
  97. package/lib/esm/presentation-hierarchies-react.d.ts.map +0 -1
  98. package/lib/esm/presentation-hierarchies-react.js.map +0 -1
@@ -1,42 +1,168 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
1
+ import { useLocalizationContext } from "./LocalizationContext.js";
2
+ import { c } from "react-compiler-runtime";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
6
4
  import { Button, Text } from "@stratakit/bricks";
7
5
  import { Icon } from "@stratakit/foundations";
8
6
  import errorSvg from "@stratakit/icons/status-error.svg";
9
- import { useLocalizationContext } from "./LocalizationContext.js";
7
+
8
+ //#region src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx
10
9
  /**
11
- * A component that renders root node error state.
12
- *
13
- * @alpha
14
- */
15
- export function StrataKitRootErrorRenderer({ error, getHierarchyLevelDetails, reloadTree }) {
16
- const { localizedStrings } = useLocalizationContext();
17
- if (error.type === "ResultSetTooLarge") {
18
- const onOverrideLimit = () => getHierarchyLevelDetails(undefined)?.setSizeLimit("unbounded");
19
- return (_jsx(RootErrorContainer, { message: localizedStrings.rootResultLimitExceeded.replace("{{limit}}", error.resultSetSizeLimit.toString()), actions: [
20
- {
21
- action: onOverrideLimit,
22
- label: localizedStrings.increaseHierarchyLimitToUnlimited,
23
- condition: () => true,
24
- },
25
- ] }));
26
- }
27
- return (_jsx(RootErrorContainer, { message: localizedStrings.failedToCreateRootHierarchy, actions: [
28
- {
29
- action: () => reloadTree({ parentNodeId: undefined, state: "reset" }),
30
- label: localizedStrings.retry,
31
- condition: () => true,
32
- },
33
- ] }));
10
+ * A component that renders root node error state.
11
+ *
12
+ * @alpha
13
+ */
14
+ function StrataKitRootErrorRenderer(t0) {
15
+ const $ = c(19);
16
+ const { error, getHierarchyLevelDetails, reloadTree } = t0;
17
+ const { localizedStrings } = useLocalizationContext();
18
+ if (error.type === "ResultSetTooLarge") {
19
+ let t1;
20
+ if ($[0] !== getHierarchyLevelDetails) {
21
+ t1 = () => getHierarchyLevelDetails(void 0)?.setSizeLimit("unbounded");
22
+ $[0] = getHierarchyLevelDetails;
23
+ $[1] = t1;
24
+ } else t1 = $[1];
25
+ const onOverrideLimit = t1;
26
+ let t2;
27
+ if ($[2] !== error.resultSetSizeLimit || $[3] !== localizedStrings.rootResultLimitExceeded) {
28
+ t2 = localizedStrings.rootResultLimitExceeded.replace("{{limit}}", error.resultSetSizeLimit.toString());
29
+ $[2] = error.resultSetSizeLimit;
30
+ $[3] = localizedStrings.rootResultLimitExceeded;
31
+ $[4] = t2;
32
+ } else t2 = $[4];
33
+ let t3;
34
+ if ($[5] !== localizedStrings.increaseHierarchyLimitToUnlimited || $[6] !== onOverrideLimit) {
35
+ t3 = [{
36
+ action: onOverrideLimit,
37
+ label: localizedStrings.increaseHierarchyLimitToUnlimited,
38
+ condition: _temp
39
+ }];
40
+ $[5] = localizedStrings.increaseHierarchyLimitToUnlimited;
41
+ $[6] = onOverrideLimit;
42
+ $[7] = t3;
43
+ } else t3 = $[7];
44
+ let t4;
45
+ if ($[8] !== t2 || $[9] !== t3) {
46
+ t4 = /* @__PURE__ */ jsx(RootErrorContainer, {
47
+ message: t2,
48
+ actions: t3
49
+ });
50
+ $[8] = t2;
51
+ $[9] = t3;
52
+ $[10] = t4;
53
+ } else t4 = $[10];
54
+ return t4;
55
+ }
56
+ let t1;
57
+ if ($[11] !== reloadTree) {
58
+ t1 = () => reloadTree({
59
+ parentNodeId: void 0,
60
+ state: "reset"
61
+ });
62
+ $[11] = reloadTree;
63
+ $[12] = t1;
64
+ } else t1 = $[12];
65
+ let t2;
66
+ if ($[13] !== localizedStrings.retry || $[14] !== t1) {
67
+ t2 = [{
68
+ action: t1,
69
+ label: localizedStrings.retry,
70
+ condition: _temp2
71
+ }];
72
+ $[13] = localizedStrings.retry;
73
+ $[14] = t1;
74
+ $[15] = t2;
75
+ } else t2 = $[15];
76
+ let t3;
77
+ if ($[16] !== localizedStrings.failedToCreateRootHierarchy || $[17] !== t2) {
78
+ t3 = /* @__PURE__ */ jsx(RootErrorContainer, {
79
+ message: localizedStrings.failedToCreateRootHierarchy,
80
+ actions: t2
81
+ });
82
+ $[16] = localizedStrings.failedToCreateRootHierarchy;
83
+ $[17] = t2;
84
+ $[18] = t3;
85
+ } else t3 = $[18];
86
+ return t3;
87
+ }
88
+ function _temp2() {
89
+ return true;
90
+ }
91
+ function _temp() {
92
+ return true;
93
+ }
94
+ function RootErrorContainer(t0) {
95
+ const $ = c(10);
96
+ const { actions, message } = t0;
97
+ let t1;
98
+ let t2;
99
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
100
+ t1 = {
101
+ height: "100%",
102
+ display: "flex",
103
+ flexDirection: "column",
104
+ justifyContent: "center",
105
+ alignItems: "center",
106
+ gap: "0.5rem"
107
+ };
108
+ t2 = /* @__PURE__ */ jsx(Icon, {
109
+ href: errorSvg,
110
+ size: "large"
111
+ });
112
+ $[0] = t1;
113
+ $[1] = t2;
114
+ } else {
115
+ t1 = $[0];
116
+ t2 = $[1];
117
+ }
118
+ let t3;
119
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
120
+ t3 = { textAlign: "center" };
121
+ $[2] = t3;
122
+ } else t3 = $[2];
123
+ let t4;
124
+ if ($[3] !== message) {
125
+ t4 = /* @__PURE__ */ jsx(Text, {
126
+ variant: "body-sm",
127
+ style: t3,
128
+ children: message
129
+ });
130
+ $[3] = message;
131
+ $[4] = t4;
132
+ } else t4 = $[4];
133
+ let t5;
134
+ if ($[5] !== actions) {
135
+ t5 = actions?.filter(_temp3).map(_temp4);
136
+ $[5] = actions;
137
+ $[6] = t5;
138
+ } else t5 = $[6];
139
+ let t6;
140
+ if ($[7] !== t4 || $[8] !== t5) {
141
+ t6 = /* @__PURE__ */ jsxs("div", {
142
+ style: t1,
143
+ children: [
144
+ t2,
145
+ t4,
146
+ t5
147
+ ]
148
+ });
149
+ $[7] = t4;
150
+ $[8] = t5;
151
+ $[9] = t6;
152
+ } else t6 = $[9];
153
+ return t6;
154
+ }
155
+ function _temp4(action) {
156
+ return /* @__PURE__ */ jsx(Button, {
157
+ onClick: () => action.action(),
158
+ children: action.label
159
+ }, action.label);
34
160
  }
35
- function RootErrorContainer({ actions, message }) {
36
- return (_jsxs("div", { style: { height: "100%", display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", gap: "0.5rem" }, children: [_jsx(Icon, { href: errorSvg, size: "large" }), _jsx(Text, { variant: "body-sm", style: { textAlign: "center" }, children: message }), actions
37
- ?.filter(({ condition }) => condition())
38
- .map((action) => {
39
- return (_jsx(Button, { onClick: () => action.action(), children: action.label }, action.label));
40
- })] }));
161
+ function _temp3(t0) {
162
+ const { condition } = t0;
163
+ return condition();
41
164
  }
165
+
166
+ //#endregion
167
+ export { StrataKitRootErrorRenderer };
42
168
  //# sourceMappingURL=RootErrorRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RootErrorRenderer.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,QAAQ,MAAM,mCAAmC,CAAC;AAGzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAUlE;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,EAAE,KAAK,EAAE,wBAA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IAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YACrD,OAAO,GACH,EACN,OAAO;gBACN,EAAE,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC;iBACvC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;gBACd,OAAO,CACL,KAAC,MAAM,IAAoB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,YACtD,MAAM,CAAC,KAAK,IADF,MAAM,CAAC,KAAK,CAEhB,CACV,CAAC;YACJ,CAAC,CAAC,IACA,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Button, Text } from \"@stratakit/bricks\";\nimport { Icon } from \"@stratakit/foundations\";\nimport errorSvg from \"@stratakit/icons/status-error.svg\";\nimport { RootErrorRendererProps } from \"../Renderers.js\";\nimport { ErrorInfo } from \"../TreeNode.js\";\nimport { useLocalizationContext } from \"./LocalizationContext.js\";\n\n/**\n * @alpha\n */\nexport type StrataKitRootErrorRendererProps = {\n /** Root error to be displayed */\n error: ErrorInfo;\n} & RootErrorRendererProps;\n\n/**\n * A component that renders root node error state.\n *\n * @alpha\n */\nexport function StrataKitRootErrorRenderer({ error, getHierarchyLevelDetails, reloadTree }: StrataKitRootErrorRendererProps) {\n const { localizedStrings } = useLocalizationContext();\n\n if (error.type === \"ResultSetTooLarge\") {\n const onOverrideLimit = () => getHierarchyLevelDetails(undefined)?.setSizeLimit(\"unbounded\");\n return (\n <RootErrorContainer\n message={localizedStrings.rootResultLimitExceeded.replace(\"{{limit}}\", error.resultSetSizeLimit.toString())}\n actions={[\n {\n action: onOverrideLimit,\n label: localizedStrings.increaseHierarchyLimitToUnlimited,\n condition: () => true,\n },\n ]}\n />\n );\n }\n\n return (\n <RootErrorContainer\n message={localizedStrings.failedToCreateRootHierarchy}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: undefined, state: \"reset\" }),\n label: localizedStrings.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 style={{ height: \"100%\", display: \"flex\", flexDirection: \"column\", justifyContent: \"center\", alignItems: \"center\", gap: \"0.5rem\" }}>\n <Icon href={errorSvg} size=\"large\" />\n <Text variant={\"body-sm\"} style={{ textAlign: \"center\" }}>\n {message}\n </Text>\n {actions\n ?.filter(({ condition }) => condition())\n .map((action) => {\n return (\n <Button key={action.label} onClick={() => action.action()}>\n {action.label}\n </Button>\n );\n })}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"RootErrorRenderer.js","names":["Button","Text","Icon","errorSvg","useLocalizationContext","JSX","RootErrorRendererProps","ErrorInfo","StrataKitRootErrorRendererProps","error","StrataKitRootErrorRenderer","t0","$","_c","getHierarchyLevelDetails","reloadTree","localizedStrings","type","t1","undefined","setSizeLimit","onOverrideLimit","t2","resultSetSizeLimit","rootResultLimitExceeded","replace","toString","t3","increaseHierarchyLimitToUnlimited","action","label","condition","_temp","t4","parentNodeId","state","retry","_temp2","failedToCreateRootHierarchy","RootErrorContainerProps","message","actions","RootErrorContainer","Symbol","for","height","display","flexDirection","justifyContent","alignItems","gap","textAlign","t5","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, Text } from \"@stratakit/bricks\";\nimport { Icon } from \"@stratakit/foundations\";\nimport errorSvg from \"@stratakit/icons/status-error.svg\";\nimport { useLocalizationContext } from \"./LocalizationContext.js\";\n\nimport type { JSX } from \"react\";\nimport type { RootErrorRendererProps } from \"../Renderers.js\";\nimport type { ErrorInfo } from \"../TreeNode.js\";\n\n/**\n * @alpha\n */\nexport type StrataKitRootErrorRendererProps = {\n /**\n * Root error to be displayed\n */\n error: ErrorInfo;\n} & RootErrorRendererProps;\n\n/**\n * A component that renders root node error state.\n *\n * @alpha\n */\nexport function StrataKitRootErrorRenderer({ error, getHierarchyLevelDetails, reloadTree }: StrataKitRootErrorRendererProps): JSX.Element {\n const { localizedStrings } = useLocalizationContext();\n\n if (error.type === \"ResultSetTooLarge\") {\n const onOverrideLimit = () => getHierarchyLevelDetails(undefined)?.setSizeLimit(\"unbounded\");\n return (\n <RootErrorContainer\n message={localizedStrings.rootResultLimitExceeded.replace(\"{{limit}}\", error.resultSetSizeLimit.toString())}\n actions={[\n {\n action: onOverrideLimit,\n label: localizedStrings.increaseHierarchyLimitToUnlimited,\n condition: () => true,\n },\n ]}\n />\n );\n }\n\n return (\n <RootErrorContainer\n message={localizedStrings.failedToCreateRootHierarchy}\n actions={[\n {\n action: () => reloadTree({ parentNodeId: undefined, state: \"reset\" }),\n label: localizedStrings.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 style={{ height: \"100%\", display: \"flex\", flexDirection: \"column\", justifyContent: \"center\", alignItems: \"center\", gap: \"0.5rem\" }}>\n <Icon href={errorSvg} size=\"large\" />\n <Text variant={\"body-sm\"} style={{ textAlign: \"center\" }}>\n {message}\n </Text>\n {actions\n ?.filter(({ condition }) => condition())\n .map((action) => {\n return (\n <Button key={action.label} onClick={() => action.action()}>\n {action.label}\n </Button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6BA,SAAOU,2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,oBAAC;GAAc,SAAA;GAAkB,OAAAN;aAC9Ba;IACI;AAAA5B,IAAA,KAAA4B;AAAA5B,IAAA,KAAAqB;OAAAA,MAAArB,EAAA;CAAA,IAAAwC;AAAA,KAAAxC,EAAA,OAAA6B,SAAA;AACNW,OAAAX,SAAOY,OACGC,OACL,CAAAC,IAACC,OAMH;AAAA5C,IAAA,KAAA6B;AAAA7B,IAAA,KAAAwC;OAAAA,MAAAxC,EAAA;CAAA,IAAA6C;AAAA,KAAA7C,EAAA,OAAAqB,MAAArB,EAAA,OAAAwC,IAAA;AAbNK,OAAA,qBAAA;GAAY,OAAAvC;;IACVI;IACAW;IAGCmB;;IASG;AAAAxC,IAAA,KAAAqB;AAAArB,IAAA,KAAAwC;AAAAxC,IAAA,KAAA6C;OAAAA,MAAA7C,EAAA;AAAA,QAdN6C;;AAFJ,SAAAD,OAAA3B,QAAA;AAAA,QAWY,oBAAC;EAAmC,eAAMA,OAAMA,QAAQ;YACrDA,OAAMC;IADID,OAAMC,MAEV;;AAbrB,SAAAwB,OAAA3C,IAAA;CAQkB,MAAA,EAAAoB,cAAApB;AAAa,QAAKoB,WAAW"}
@@ -1,27 +1,29 @@
1
- import { ComponentProps } from "react";
1
+ import { ComponentProps, NamedExoticComponent } from "react";
2
2
  import { Tree } from "@stratakit/structures";
3
+
4
+ //#region src/presentation-hierarchies-react/stratakit/TreeAction.d.ts
3
5
  /**
4
6
  * Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context
5
7
  * where that action is used.
6
8
  * @alpha
7
9
  */
8
- export interface TreeActionBaseAttributes {
9
- /**
10
- * Specifies action variant supported by tree nodes:
11
- *
12
- * - "default" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node.
13
- * - "inline" - actions displayed directly on the tree node.
14
- * - "context-menu" - actions displayed in the context menu opened by right-clicking the tree node.
15
- */
16
- variant?: "default" | "inline" | "context-menu";
17
- /**
18
- * Indicates that the actions is not applicable for current tree node and should be hidden.
19
- * When set to true, the action will not be rendered at all.
20
- */
21
- hide?: boolean;
10
+ interface TreeActionBaseAttributes {
11
+ /**
12
+ * Specifies action variant supported by tree nodes:
13
+ *
14
+ * - "default" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node.
15
+ * - "inline" - actions displayed directly on the tree node.
16
+ * - "context-menu" - actions displayed in the context menu opened by right-clicking the tree node.
17
+ */
18
+ variant?: "default" | "inline" | "context-menu";
19
+ /**
20
+ * Indicates that the actions is not applicable for current tree node and should be hidden.
21
+ * When set to true, the action will not be rendered at all.
22
+ */
23
+ hide?: boolean;
22
24
  }
23
25
  /** @alpha */
24
- export type TreeActionBaseProps = ComponentProps<typeof Tree.ItemAction> & TreeActionBaseAttributes;
26
+ type TreeActionBaseProps = ComponentProps<typeof Tree.ItemAction> & TreeActionBaseAttributes;
25
27
  /**
26
28
  * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.
27
29
  * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.
@@ -41,5 +43,7 @@ export type TreeActionBaseProps = ComponentProps<typeof Tree.ItemAction> & TreeA
41
43
  *
42
44
  * @alpha
43
45
  */
44
- export declare const TreeActionBase: import("react").NamedExoticComponent<TreeActionBaseProps>;
46
+ declare const TreeActionBase: NamedExoticComponent<TreeActionBaseProps>;
47
+ //#endregion
48
+ export { TreeActionBase, TreeActionBaseAttributes };
45
49
  //# sourceMappingURL=TreeAction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeAction.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAQ,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAgB,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;IAChD;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,aAAa;AACb,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,wBAAwB,CAAC;AAEpG;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,2DAUzB,CAAC"}
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"}
@@ -1,36 +1,89 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
1
+ import { c } from "react-compiler-runtime";
6
2
  import { memo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
7
4
  import { DropdownMenu, Tree } from "@stratakit/structures";
5
+
6
+ //#region src/presentation-hierarchies-react/stratakit/TreeAction.tsx
8
7
  /**
9
- * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.
10
- * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.
11
- *
12
- * When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example:
13
- *
14
- * ```tsx
15
- * interface MyCustomTreeActionProps extends TreeActionBaseAttributes {
16
- * myProp: string
17
- * }
18
- *
19
- * function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) {
20
- * // custom button logic goes here
21
- * return <TreeActionBase {...attributes} icon={...} onClick={...} />
22
- * }
23
- * ```
24
- *
25
- * @alpha
26
- */
27
- export const TreeActionBase = memo(function TreeActionBase({ hide, variant = "default", dot, visible, ...actionProps }) {
28
- if (hide) {
29
- return variant === "inline" ? _jsx(Tree.ItemAction, { ...actionProps, visible: false }) : undefined;
30
- }
31
- if (variant === "context-menu") {
32
- return _jsx(DropdownMenu.Item, { ...actionProps });
33
- }
34
- return _jsx(Tree.ItemAction, { ...actionProps, dot: dot, visible: variant === "inline" ? visible : undefined });
8
+ * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.
9
+ * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.
10
+ *
11
+ * When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example:
12
+ *
13
+ * ```tsx
14
+ * interface MyCustomTreeActionProps extends TreeActionBaseAttributes {
15
+ * myProp: string
16
+ * }
17
+ *
18
+ * function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) {
19
+ * // custom button logic goes here
20
+ * return <TreeActionBase {...attributes} icon={...} onClick={...} />
21
+ * }
22
+ * ```
23
+ *
24
+ * @alpha
25
+ */
26
+ const TreeActionBase = memo(function TreeActionBase(t0) {
27
+ const $ = c(15);
28
+ let actionProps;
29
+ let dot;
30
+ let hide;
31
+ let t1;
32
+ let visible;
33
+ if ($[0] !== t0) {
34
+ ({hide, variant: t1, dot, visible, ...actionProps} = t0);
35
+ $[0] = t0;
36
+ $[1] = actionProps;
37
+ $[2] = dot;
38
+ $[3] = hide;
39
+ $[4] = t1;
40
+ $[5] = visible;
41
+ } else {
42
+ actionProps = $[1];
43
+ dot = $[2];
44
+ hide = $[3];
45
+ t1 = $[4];
46
+ visible = $[5];
47
+ }
48
+ const variant = t1 === void 0 ? "default" : t1;
49
+ if (hide) {
50
+ let t2;
51
+ if ($[6] !== actionProps || $[7] !== variant) {
52
+ t2 = variant === "inline" ? /* @__PURE__ */ jsx(Tree.ItemAction, {
53
+ ...actionProps,
54
+ visible: false
55
+ }) : void 0;
56
+ $[6] = actionProps;
57
+ $[7] = variant;
58
+ $[8] = t2;
59
+ } else t2 = $[8];
60
+ return t2;
61
+ }
62
+ if (variant === "context-menu") {
63
+ let t2;
64
+ if ($[9] !== actionProps) {
65
+ t2 = /* @__PURE__ */ jsx(DropdownMenu.Item, { ...actionProps });
66
+ $[9] = actionProps;
67
+ $[10] = t2;
68
+ } else t2 = $[10];
69
+ return t2;
70
+ }
71
+ const t2 = variant === "inline" ? visible : void 0;
72
+ let t3;
73
+ if ($[11] !== actionProps || $[12] !== dot || $[13] !== t2) {
74
+ t3 = /* @__PURE__ */ jsx(Tree.ItemAction, {
75
+ ...actionProps,
76
+ dot,
77
+ visible: t2
78
+ });
79
+ $[11] = actionProps;
80
+ $[12] = dot;
81
+ $[13] = t2;
82
+ $[14] = t3;
83
+ } else t3 = $[14];
84
+ return t3;
35
85
  });
86
+
87
+ //#endregion
88
+ export { TreeActionBase };
36
89
  //# sourceMappingURL=TreeAction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeAction.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAkB,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AA0B3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,cAAc,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,WAAW,EAAuB;IACzI,IAAI,IAAI,EAAE,CAAC;QACT,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,CAAC,UAAU,OAAK,WAAW,EAAE,OAAO,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACjG,CAAC;IAED,IAAI,OAAO,KAAK,cAAc,EAAE,CAAC;QAC/B,OAAO,KAAC,YAAY,CAAC,IAAI,OAAK,WAAW,GAAI,CAAC;IAChD,CAAC;IAED,OAAO,KAAC,IAAI,CAAC,UAAU,OAAK,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,GAAI,CAAC;AAC7G,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ComponentProps, memo } from \"react\";\nimport { DropdownMenu, Tree } from \"@stratakit/structures\";\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 = memo(function TreeActionBase({ hide, variant = \"default\", dot, visible, ...actionProps }: 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"]}
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,SAAA,YAAAF;AAKA,KAAIT,MAAI;EAAA,IAAAY;AAAA,MAAAP,EAAA,OAAAE,eAAAF,EAAA,OAAAN,SAAA;AACCa,QAAAb,YAAY,WAAW,oBAAA,KAAA;IAAA,GAAqBQ;IAAsB,SAAA;KAAqB,GAAvFI;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,QAAA,GAAuBL,cAAe;AAAAF,KAAA,KAAAE;AAAAF,KAAA,MAAAO;QAAAA,MAAAP,EAAA;AAAA,SAAtCO;;CAGmD,MAAAA,KAAAb,YAAY,WAAZW,UAAAC;CAA0C,IAAAE;AAAA,KAAAR,EAAA,QAAAE,eAAAF,EAAA,QAAAG,OAAAH,EAAA,QAAAO,IAAA;AAA/FC,OAAA,oBAAA,KAAA;GAAA,GAAqBN;GAAkBC;GAAc,SAAAI;IAA8C;AAAAP,IAAA,MAAAE;AAAAF,IAAA,MAAAG;AAAAH,IAAA,MAAAO;AAAAP,IAAA,MAAAQ;OAAAA,MAAAR,EAAA;AAAA,QAAnGQ;EACP"}
@@ -1,30 +1,38 @@
1
- import { ReactElement } from "react";
2
- import { ErrorItemRendererProps } from "./ErrorItemRenderer.js";
3
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
4
6
  /**
5
7
  * Interface containing building blocks for `TreeErrorRenderer`.
6
8
  *
7
9
  * @alpha
8
10
  */
9
11
  interface TreeErrorRendererOwnProps {
10
- /**
11
- * A user friendly display label of the tree. Should be unique within the consuming application,
12
- * as it's used for creating a unique accessible label for the error region.
13
- */
14
- treeLabel: string;
15
- /** List of error nodes to render errors for. */
16
- errorNodes: ReturnType<typeof useErrorNodes>;
17
- /** Callback to render custom error messages. Component should be wrapped in `ErrorRegion.Item` from `@itwin/itwinui-react` package. */
18
- renderError?: (props: ErrorItemRendererProps) => ReactElement;
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 `ErrorRegion.Item` from `@itwin/itwinui-react` package. */
20
+ renderError?: (props: ErrorItemRendererProps) => ReactElement;
19
21
  }
20
22
  /** @alpha */
21
- export type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRendererProps, "errorNode">;
23
+ type TreeErrorRendererProps = TreeErrorRendererOwnProps & Omit<ErrorItemRendererProps, "errorNode">;
22
24
  /**
23
25
  * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@itwin/itwinui-react`.
24
26
  * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorList` hook.
25
27
  *
26
28
  * @alpha
27
29
  */
28
- export declare function TreeErrorRenderer({ treeLabel, errorNodes, renderError, ...errorItemRendererProps }: TreeErrorRendererProps): import("react/jsx-runtime").JSX.Element;
29
- export {};
30
+ declare function TreeErrorRenderer({
31
+ treeLabel,
32
+ errorNodes,
33
+ renderError,
34
+ ...errorItemRendererProps
35
+ }: TreeErrorRendererProps): JSX.Element;
36
+ //#endregion
37
+ export { TreeErrorRenderer, TreeErrorRendererProps };
30
38
  //# sourceMappingURL=TreeErrorRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeErrorRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAgB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAqB,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;;GAIG;AACH,UAAU,yBAAyB;IACjC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,UAAU,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;IAC7C,uIAAuI;IACvI,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,YAAY,CAAC;CAC/D;AAED,aAAa;AACb,MAAM,MAAM,sBAAsB,GAAG,yBAAyB,GAAG,IAAI,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;AAE3G;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,sBAAsB,EAAE,EAAE,sBAAsB,2CAyB1H"}
1
+ {"version":3,"file":"TreeErrorRenderer.d.ts","names":[],"sources":["../../../../src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx"],"mappings":";;;;;;;AAYuD;;;UAO7C,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;EAAoB,SAAA;EAAW,UAAA;EAAY,WAAA;EAAA,GAAgB;AAAA,GAA0B,sBAAA,GAAyB,GAAA,CAAI,OAAA"}
@@ -1,30 +1,65 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- import { cloneElement } from "react";
7
- import { unstable_ErrorRegion as ErrorRegion } from "@stratakit/structures";
8
- import { ErrorItemRenderer } from "./ErrorItemRenderer.js";
9
1
  import { useLocalizationContext } 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
+
8
+ //#region src/presentation-hierarchies-react/stratakit/TreeErrorRenderer.tsx
10
9
  /**
11
- * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@itwin/itwinui-react`.
12
- * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorList` hook.
13
- *
14
- * @alpha
15
- */
16
- export function TreeErrorRenderer({ treeLabel, errorNodes, renderError, ...errorItemRendererProps }) {
17
- const { localizedStrings } = useLocalizationContext();
18
- const errorItems = errorNodes.map((errorNode) => {
19
- const errorRendererProps = {
20
- errorNode,
21
- ...errorItemRendererProps,
22
- };
23
- if (renderError) {
24
- return cloneElement(renderError(errorRendererProps), { key: errorNode.id });
25
- }
26
- return _jsx(ErrorItemRenderer, { ...errorRendererProps }, errorNode.id);
27
- });
28
- return (_jsx(ErrorRegion.Root, { style: { width: "100%" }, "aria-label": localizedStrings.issuesForTree.replace("{{tree_label}}", treeLabel), label: errorNodes.length === 0 ? localizedStrings.noIssuesFound : localizedStrings.issuesFound.replace("{{number_of_issues}}", errorNodes.length.toString()), items: errorItems }));
10
+ * A component that renders error display dropdown using the `unstable_ErrorRegion` component from `@itwin/itwinui-react`.
11
+ * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorList` hook.
12
+ *
13
+ * @alpha
14
+ */
15
+ function TreeErrorRenderer(t0) {
16
+ const $ = c(12);
17
+ const { treeLabel, errorNodes, renderError, ...errorItemRendererProps } = t0;
18
+ const { localizedStrings } = useLocalizationContext();
19
+ const errorItems = errorNodes.map((errorNode) => {
20
+ const errorRendererProps = {
21
+ errorNode,
22
+ ...errorItemRendererProps
23
+ };
24
+ if (renderError) return cloneElement(renderError(errorRendererProps), { key: errorNode.id });
25
+ return /* @__PURE__ */ jsx(ErrorItemRenderer, { ...errorRendererProps }, errorNode.id);
26
+ });
27
+ let t1;
28
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
29
+ t1 = { width: "100%" };
30
+ $[0] = t1;
31
+ } else t1 = $[0];
32
+ let t2;
33
+ if ($[1] !== localizedStrings.issuesForTree || $[2] !== treeLabel) {
34
+ t2 = localizedStrings.issuesForTree.replace("{{tree_label}}", treeLabel);
35
+ $[1] = localizedStrings.issuesForTree;
36
+ $[2] = treeLabel;
37
+ $[3] = t2;
38
+ } else t2 = $[3];
39
+ let t3;
40
+ if ($[4] !== errorNodes.length || $[5] !== localizedStrings.issuesFound || $[6] !== localizedStrings.noIssuesFound) {
41
+ t3 = errorNodes.length === 0 ? localizedStrings.noIssuesFound : localizedStrings.issuesFound.replace("{{number_of_issues}}", errorNodes.length.toString());
42
+ $[4] = errorNodes.length;
43
+ $[5] = localizedStrings.issuesFound;
44
+ $[6] = localizedStrings.noIssuesFound;
45
+ $[7] = t3;
46
+ } else t3 = $[7];
47
+ let t4;
48
+ if ($[8] !== errorItems || $[9] !== t2 || $[10] !== t3) {
49
+ t4 = /* @__PURE__ */ jsx(unstable_ErrorRegion.Root, {
50
+ style: t1,
51
+ "aria-label": t2,
52
+ label: t3,
53
+ items: errorItems
54
+ });
55
+ $[8] = errorItems;
56
+ $[9] = t2;
57
+ $[10] = t3;
58
+ $[11] = t4;
59
+ } else t4 = $[11];
60
+ return t4;
29
61
  }
62
+
63
+ //#endregion
64
+ export { TreeErrorRenderer };
30
65
  //# sourceMappingURL=TreeErrorRenderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeErrorRenderer.js","sourceRoot":"","sources":["../../../../src/presentation-h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,KAAK,EAAE,UAAU,GACjB,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { cloneElement, ReactElement } from \"react\";\nimport { unstable_ErrorRegion as ErrorRegion } from \"@stratakit/structures\";\nimport { ErrorItemRenderer, ErrorItemRendererProps } from \"./ErrorItemRenderer.js\";\nimport { useErrorNodes } from \"./FlatTreeNode.js\";\nimport { useLocalizationContext } from \"./LocalizationContext.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 `ErrorRegion.Item` from `@itwin/itwinui-react` 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 `@itwin/itwinui-react`.\n * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorList` hook.\n *\n * @alpha\n */\nexport function TreeErrorRenderer({ treeLabel, errorNodes, renderError, ...errorItemRendererProps }: TreeErrorRendererProps) {\n const { localizedStrings } = useLocalizationContext();\n const errorItems = errorNodes.map((errorNode) => {\n const errorRendererProps: ErrorItemRendererProps = {\n errorNode,\n ...errorItemRendererProps,\n };\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={localizedStrings.issuesForTree.replace(\"{{tree_label}}\", treeLabel)}\n label={\n errorNodes.length === 0 ? localizedStrings.noIssuesFound : localizedStrings.issuesFound.replace(\"{{number_of_issues}}\", errorNodes.length.toString())\n }\n items={errorItems}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"TreeErrorRenderer.js","names":["cloneElement","unstable_ErrorRegion","ErrorRegion","ErrorItemRenderer","useLocalizationContext","JSX","ReactElement","ErrorItemRendererProps","useErrorNodes","TreeErrorRendererOwnProps","treeLabel","errorNodes","ReturnType","renderError","props","TreeErrorRendererProps","Omit","TreeErrorRenderer","t0","$","_c","errorItemRendererProps","localizedStrings","errorItems","map","errorNode","errorRendererProps","key","id","t1","Symbol","for","width","t2","issuesForTree","replace","t3","length","issuesFound","noIssuesFound","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 { ErrorItemRenderer } from \"./ErrorItemRenderer.js\";\nimport { useLocalizationContext } from \"./LocalizationContext.js\";\n\nimport type { JSX, ReactElement } from \"react\";\nimport type { ErrorItemRendererProps } from \"./ErrorItemRenderer.js\";\nimport type { useErrorNodes } from \"./FlatTreeNode.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 `ErrorRegion.Item` from `@itwin/itwinui-react` 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 `@itwin/itwinui-react`.\n * As input, the component uses a list of `ErrorNode` objects, which are generally created using the `useErrorList` hook.\n *\n * @alpha\n */\nexport function TreeErrorRenderer({ treeLabel, errorNodes, renderError, ...errorItemRendererProps }: TreeErrorRendererProps): JSX.Element {\n const { localizedStrings } = useLocalizationContext();\n const errorItems = errorNodes.map((errorNode) => {\n const errorRendererProps: ErrorItemRendererProps = {\n errorNode,\n ...errorItemRendererProps,\n };\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={localizedStrings.issuesForTree.replace(\"{{tree_label}}\", treeLabel)}\n label={\n errorNodes.length === 0 ? localizedStrings.noIssuesFound : localizedStrings.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;CAChC,MAAA,EAAAI,qBAA6BlB,wBAAwB;CACrD,MAAAmB,aAAmBZ,WAAUa,KAAKC,cAAA;EAChC,MAAAC,qBAAmD;GAAAD;GAAA,GAE9CJ;GACJ;AAED,MAAIR,YAAW,QACNb,aAAaa,YAAYa,mBAAmB,EAAE,EAAAC,KAAOF,UAASG,IAAK,CAAC;AAC5E,SAEM,oBAAC,qBAAmC,GAAMF,sBAAlBD,UAASG,GAA+B;GACvE;CAAC,IAAAC;AAAA,KAAAV,EAAA,OAAAW,OAAAC,IAAA,4BAAA,EAAA;AAIQF,OAAA,EAAAG,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