@itwin/presentation-hierarchies-react 2.0.0-alpha.5 → 2.0.0-alpha.51
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 +902 -7
- package/README.md +28 -70
- package/lib/esm/presentation-hierarchies-react/Renderers.d.ts +85 -0
- package/lib/esm/presentation-hierarchies-react/Renderers.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/Renderers.js +6 -0
- package/lib/esm/presentation-hierarchies-react/Renderers.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts +28 -29
- package/lib/esm/presentation-hierarchies-react/TreeNode.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/TreeNode.js +1 -7
- package/lib/esm/presentation-hierarchies-react/TreeNode.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts +7 -5
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.js +6 -6
- package/lib/esm/presentation-hierarchies-react/UseIModelTree.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.d.ts +24 -0
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.js +53 -0
- package/lib/esm/presentation-hierarchies-react/UseNodeHighlighting.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts +12 -10
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js +7 -22
- package/lib/esm/presentation-hierarchies-react/UseSelectionHandler.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.d.ts +33 -71
- package/lib/esm/presentation-hierarchies-react/UseTree.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/UseTree.js +63 -64
- package/lib/esm/presentation-hierarchies-react/UseTree.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/Utils.d.ts +8 -0
- package/lib/esm/presentation-hierarchies-react/Utils.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/Utils.js +39 -0
- package/lib/esm/presentation-hierarchies-react/Utils.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts +2 -2
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js +31 -16
- package/lib/esm/presentation-hierarchies-react/internal/TreeActions.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts +24 -6
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js +29 -33
- package/lib/esm/presentation-hierarchies-react/internal/TreeLoader.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts +6 -29
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js +31 -27
- package/lib/esm/presentation-hierarchies-react/internal/TreeModel.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts +23 -9
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js +16 -29
- package/lib/esm/presentation-hierarchies-react/internal/UseUnifiedSelection.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/internal/Utils.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts +27 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js +74 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/ErrorItemRenderer.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts +48 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.js +73 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/FlatTreeNode.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts +133 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/{itwinui → stratakit}/LocalizationContext.js +17 -5
- package/lib/esm/presentation-hierarchies-react/stratakit/LocalizationContext.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts +16 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.js +42 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/RootErrorRenderer.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.d.ts +45 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.js +36 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeAction.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts +30 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js +30 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeErrorRenderer.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts +20 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js +29 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeFilterAction.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts +57 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js +71 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenameAction.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.css +25 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts +46 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js +132 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeNodeRenderer.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts +75 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.js +193 -0
- package/lib/esm/presentation-hierarchies-react/stratakit/TreeRenderer.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react.d.ts +14 -10
- package/lib/esm/presentation-hierarchies-react.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react.js +11 -9
- package/lib/esm/presentation-hierarchies-react.js.map +1 -1
- package/package.json +55 -47
- 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/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.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,708 @@
|
|
|
1
1
|
# @itwin/presentation-hierarchies-react
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.51
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#1185](https://github.com/iTwin/presentation/pull/1185): Bumped peer dependencies:
|
|
8
|
+
- `@stratakit/bricks`: `^0.5.4`
|
|
9
|
+
- `@stratakit/foundations`: `^0.4.5`
|
|
10
|
+
- `@stratakit/icons`: `^0.2.2`
|
|
11
|
+
- `@stratakit/structures`: `^0.5.4`
|
|
12
|
+
|
|
13
|
+
## 2.0.0-alpha.50
|
|
14
|
+
|
|
15
|
+
### Major Changes
|
|
16
|
+
|
|
17
|
+
- [#1184](https://github.com/iTwin/presentation/pull/1184): Fixed selection handling in `StrataKitTreeRenderer`. Mouse double clicks are now correctly ignored to prevent rapid selection toggling. Keyboard selection using `Space` and `Enter` keys is working.
|
|
18
|
+
|
|
19
|
+
**Breaking changes**
|
|
20
|
+
- `useSelectionHandler` is no longer exported. This function is an internal implementation detail of `StrataKitTreeRenderer` and should not be used directly.
|
|
21
|
+
|
|
22
|
+
- [#1181](https://github.com/iTwin/presentation/pull/1181): **Breaking change:** Rename `PresentationHierarchyNode` to `TreeNode` for clarity.
|
|
23
|
+
|
|
24
|
+
We already have a `HierarchyNode` type in `@itwin/presentation-hierarchies`, so having a `PresentationHierarchyNode` in `@itwin/presentation-hierarchies-react` was causing confusion. Additionally, this change aligns with the naming convention that we try to keep, where "hierarchy" refers to data and "tree" refers to UI components.
|
|
25
|
+
|
|
26
|
+
- [#1183](https://github.com/iTwin/presentation/pull/1183): Clean up `TreeErrorRenderer` and `ErrorItemRenderer`.
|
|
27
|
+
|
|
28
|
+
**Breaking changes:**
|
|
29
|
+
- Replaced `useErrorList` hook with `useErrorNodes` hook that returns error nodes (`TreeNode[]`) instead of error items. The `expandTo` function became unnecessary, because expanding to error nodes is now handled internally. As a result, the whole `ErrorItem` type (result of `useErrorList`) was removed. Reacting to this, the following other breaking changes were made:
|
|
30
|
+
- Renamed `errorItem` -> `errorNode` in `ErrorItemRenderer` component and changed the type from removed `ErrorItem` to `TreeNode`.
|
|
31
|
+
- Renamed `errorList` -> `errorNodes` in `TreeErrorRenderer` component and changed the type from `ErrorItem[]` to `TreeNode[]`.
|
|
32
|
+
- The `reloadTree` function prop in `ErrorItemRenderer` and `TreeErrorRenderer` components no longer takes the `state` option. The option was required and always had the same value, so it was redundant.
|
|
33
|
+
- Renamed `onFilterClick` -> `filterHierarchyLevel` in `ErrorItemRenderer`, `TreeErrorRenderer` and `StrataKitTreeRenderer` components. This makes its name consistent with other function props ("do something" vs "on something happened").
|
|
34
|
+
- Renamed `scrollToElement` -> `scrollToNode` in `ErrorItemRenderer` and `TreeErrorRenderer`, and changed its type to take `TreeNode` instead of an error item returned by `useErrorList` hook.
|
|
35
|
+
|
|
36
|
+
## 2.0.0-alpha.49
|
|
37
|
+
|
|
38
|
+
### Major Changes
|
|
39
|
+
|
|
40
|
+
- [#1166](https://github.com/iTwin/presentation/pull/1166): Added ability to enter node rename mode programmatically through `StrataKitTreeRenderer` ref. The `renameNode` method accepts a predicate function to identify the target node. If the node is not visible (because its parent is collapsed), all parents will be expanded automatically to make it visible and the node will be scrolled into view.
|
|
41
|
+
|
|
42
|
+
Example:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { StrataKitTreeRenderer, StrataKitTreeRendererAttributes } from "@itwin/presentation-hierarchies-react";
|
|
46
|
+
|
|
47
|
+
function MyTree() {
|
|
48
|
+
const treeRef = useRef<StrataKitTreeRendererAttributes>(null);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
<div className="tree-header">
|
|
53
|
+
<button
|
|
54
|
+
onClick={() => {
|
|
55
|
+
treeRef.current?.renameNode((node) => node.label === "Node to rename");
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
Rename node
|
|
59
|
+
</button>
|
|
60
|
+
</div>
|
|
61
|
+
<StrataKitTreeRenderer ref={treeRef} />
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Breaking changes**
|
|
68
|
+
- `StrataKitTreeNodeRenderer` is no longer exported.
|
|
69
|
+
- `RenameContextProvider` is no longer exported. It is not necessary when using `StrataKitTreeRenderer`.
|
|
70
|
+
- `RenameAction` now requires a `node` prop.
|
|
71
|
+
|
|
72
|
+
- [#1179](https://github.com/iTwin/presentation/pull/1179): **Breaking change:** Rename tree node action components for clarity.
|
|
73
|
+
- `FilterAction` -> `TreeNodeFilterAction`
|
|
74
|
+
- `RenameAction` -> `TreeNodeRenameAction`
|
|
75
|
+
|
|
76
|
+
- [#1178](https://github.com/iTwin/presentation/pull/1178): Updated tree node rename UI to show input in popover instead of inline. Additionally added ability to show hint for supported characters and validate new label.
|
|
77
|
+
|
|
78
|
+
Example:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
type TreeRendererProps = ComponentProps<typeof StrataKitTreeRenderer>;
|
|
82
|
+
|
|
83
|
+
const getEditingProps = useCallback<Required<TreeRendererProps>["getEditingProps"]>((node) => {
|
|
84
|
+
return {
|
|
85
|
+
onLabelChanged: (newLabel: string) => {
|
|
86
|
+
// Handle label change
|
|
87
|
+
},
|
|
88
|
+
labelValidationHint: `Allowed are A to Z, 0 to 9, "-" and "_"`,
|
|
89
|
+
validate: (newLabel: string) => /^[A-Za-z0-9\- ]+$/.test(newLabel),
|
|
90
|
+
};
|
|
91
|
+
}, []);
|
|
92
|
+
|
|
93
|
+
return <StrataKitTreeRenderer {...treeProps} getEditingProps={getEditingProps} />;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Breaking changes**
|
|
97
|
+
- `getEditingProps` callback was changed to require `onLabelChanged`. If node does not support renaming `getEditingProps` should return `undefined`.
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- Updated dependencies:
|
|
102
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.10
|
|
103
|
+
- @itwin/presentation-shared@2.0.0-alpha.6
|
|
104
|
+
- @itwin/unified-selection@1.6.6-alpha.0
|
|
105
|
+
|
|
106
|
+
## 2.0.0-alpha.48
|
|
107
|
+
|
|
108
|
+
### Minor Changes
|
|
109
|
+
|
|
110
|
+
- [#1159](https://github.com/iTwin/presentation/pull/1159): Introduced `getTreeItemProps` and `treeRootProps` to `StrataKitTreeRenderer`. This allows passing props to underlying `Tree.Item` and `Tree.Root` components.
|
|
111
|
+
|
|
112
|
+
**Breaking changes**
|
|
113
|
+
|
|
114
|
+
`StrataKitTreeNodeRenderer` props changes:
|
|
115
|
+
- `getMenuActions` callback changed to `menuActions` prop (type: `ReactNode[]`)
|
|
116
|
+
- `getInlineActions` callback changed to `inlineActions` prop (type: `ReactNode[]`)
|
|
117
|
+
- `getContextMenuActions` callback changed to `contextMenuActions` prop (type: `ReactNode[]`)
|
|
118
|
+
- `getLabel` callback removed - use `label` prop instead
|
|
119
|
+
- `getSublabel` callback removed - use `description` prop instead
|
|
120
|
+
- `getDecorations` callback removed - use `decorations` prop instead
|
|
121
|
+
- `getClassName` callback removed - use `className` prop instead
|
|
122
|
+
- `onNodeClick` and `onNodeKeyDown` callbacks removed - use `onClick` and `onKeyDown` props instead
|
|
123
|
+
|
|
124
|
+
`StrataKitTreeRenderer` props changes:
|
|
125
|
+
- Props previously passed to `StrataKitTreeNodeRenderer` are no longer accepted
|
|
126
|
+
- Use `getTreeItemProps` callback to provide props to specific `Tree.Item` components
|
|
127
|
+
- Use `getMenuActions`, `getInlineActions`, and `getContextMenuActions` on `StrataKitTreeRenderer` to provide actions for nodes
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- Updated dependencies:
|
|
132
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.9
|
|
133
|
+
|
|
134
|
+
## 2.0.0-alpha.47
|
|
135
|
+
|
|
136
|
+
### Patch Changes
|
|
137
|
+
|
|
138
|
+
- [#1142](https://github.com/iTwin/presentation/pull/1142): Bump dependencies.
|
|
139
|
+
- [#1142](https://github.com/iTwin/presentation/pull/1142): Fix `StrataKitTreeRenderer` getting into infinite React render loop.
|
|
140
|
+
- Updated dependencies:
|
|
141
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.8
|
|
142
|
+
- @itwin/presentation-shared@2.0.0-alpha.5
|
|
143
|
+
|
|
144
|
+
## 2.0.0-alpha.46
|
|
145
|
+
|
|
146
|
+
### Minor Changes
|
|
147
|
+
|
|
148
|
+
- [#1011](https://github.com/iTwin/presentation/pull/1011): Renamed `getFilteredPaths` prop to `getSearchPaths` in tree hooks: `useTree`, `useUnifiedSelectionTree`, `useIModelTree`, `useIModelUnifiedSelectionTree`.
|
|
149
|
+
|
|
150
|
+
### Patch Changes
|
|
151
|
+
|
|
152
|
+
- Updated dependencies:
|
|
153
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.7
|
|
154
|
+
|
|
155
|
+
## 2.0.0-alpha.45
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- [#1134](https://github.com/iTwin/presentation/pull/1134): Fixed expanded tree nodes showing expander when tree is reloaded and child nodes are removed.
|
|
160
|
+
|
|
161
|
+
## 2.0.0-alpha.44
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- Updated dependencies:
|
|
166
|
+
- @itwin/unified-selection@1.6.3-alpha.0
|
|
167
|
+
|
|
168
|
+
## 2.0.0-alpha.43
|
|
169
|
+
|
|
170
|
+
### Patch Changes
|
|
171
|
+
|
|
172
|
+
- cc836290199b9ff778773b03ab578f90043e95f0: Do not open tree context menu is there is no actions.
|
|
173
|
+
- Updated dependencies:
|
|
174
|
+
- @itwin/presentation-shared@2.0.0-alpha.4
|
|
175
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.6
|
|
176
|
+
|
|
177
|
+
## 2.0.0-alpha.42
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- [#1118](https://github.com/iTwin/presentation/pull/1118): Fixed first hidden inline action causing second action to be focused when navigating using keyboard.
|
|
182
|
+
|
|
183
|
+
## 2.0.0-alpha.41
|
|
184
|
+
|
|
185
|
+
### Major Changes
|
|
186
|
+
|
|
187
|
+
- [#1113](https://github.com/iTwin/presentation/pull/1113): Pass selected nodes to tree node action getters to support actions that should be applied on all selected nodes.
|
|
188
|
+
|
|
189
|
+
**Breaking changes**
|
|
190
|
+
- `StrataKitTreeRenderer.getInlineActions` callback receives `{ targetNode: PresentationHierarchyNode; selectedNodes: PresentationHierarchyNode[] }` props instead of `PresentationHierarchyNode`.
|
|
191
|
+
- `StrataKitTreeRenderer.getMenuActions` callback receives `{ targetNode: PresentationHierarchyNode; selectedNodes: PresentationHierarchyNode[] }` props instead of `PresentationHierarchyNode`.
|
|
192
|
+
|
|
193
|
+
Before
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
return <StrataKitTreeRenderer getInlineActions={(node) => [<InlineAction node={node} />]} getMenuActions={(node) => [<MenuAction node={node} />]} />;
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
After
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
return (
|
|
203
|
+
<StrataKitTreeRenderer
|
|
204
|
+
getInlineActions={({ targetNode }) => [<InlineAction node={targetNode} />]}
|
|
205
|
+
getMenuActions={({ targetNode }) => [<MenuAction node={targetNode} />]}
|
|
206
|
+
/>
|
|
207
|
+
);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
- [#1115](https://github.com/iTwin/presentation/pull/1115): Unified tree actions handling to make it easier defining actions that could be reused in different contexts: inline, context menu and actions dropdown.
|
|
211
|
+
|
|
212
|
+
**Breaking changes**
|
|
213
|
+
- Removed `reserveSpace` property from `<RenameAction />` and `<FilterAction />`. These actions now automatically infer the context they're used in.
|
|
214
|
+
- Added requirement to render newly introduced `<TreeActionBase />` component instead of `<Tree.ItemAction />` when rendering custom tree actions.
|
|
215
|
+
|
|
216
|
+
### Minor Changes
|
|
217
|
+
|
|
218
|
+
- [#1115](https://github.com/iTwin/presentation/pull/1115): Added `getContextMenuActions` callback for rendering tree actions in context menu.
|
|
219
|
+
|
|
220
|
+
## 2.0.0-alpha.40
|
|
221
|
+
|
|
222
|
+
### Patch Changes
|
|
223
|
+
|
|
224
|
+
- [#1110](https://github.com/iTwin/presentation/pull/1110): Bump dependencies.
|
|
225
|
+
- Updated dependencies:
|
|
226
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.5
|
|
227
|
+
- @itwin/presentation-shared@2.0.0-alpha.3
|
|
228
|
+
- @itwin/unified-selection@1.6.2-alpha.0
|
|
229
|
+
|
|
230
|
+
## 2.0.0-alpha.39
|
|
231
|
+
|
|
232
|
+
### Minor Changes
|
|
233
|
+
|
|
234
|
+
- [#1106](https://github.com/iTwin/presentation/pull/1106): Added an `id` property to `StrataKitTreeRenderer` that is passed to it's scroll wrapper.
|
|
235
|
+
- [#1107](https://github.com/iTwin/presentation/pull/1107): Introduced new `getClassName` callback to `StrataKitTreeRenderer` and `StrataKitTreeNodeRenderer` for providing class to tree node HTML element.
|
|
236
|
+
|
|
237
|
+
### Patch Changes
|
|
238
|
+
|
|
239
|
+
- [#1109](https://github.com/iTwin/presentation/pull/1109): Fixed error item Anchor font size.
|
|
240
|
+
|
|
241
|
+
## 2.0.0-alpha.38
|
|
242
|
+
|
|
243
|
+
### Patch Changes
|
|
244
|
+
|
|
245
|
+
- [#1102](https://github.com/iTwin/presentation/pull/1102): Updated tree error item renderer to render error actions as buttons based on StrataKit docs JSDoc suggestion.
|
|
246
|
+
|
|
247
|
+
## 2.0.0-alpha.37
|
|
248
|
+
|
|
249
|
+
### Major Changes
|
|
250
|
+
|
|
251
|
+
- [#1100](https://github.com/iTwin/presentation/pull/1100): Bumped StrataKit peer dependencies to:
|
|
252
|
+
- `@stratakit/structures`: ^0.5.0
|
|
253
|
+
- `@stratakit/icons`: ^0.2.0
|
|
254
|
+
- `@stratakit/foundations`: ^0.4.0
|
|
255
|
+
- `@stratakit/bricks`: ^0.5.0
|
|
256
|
+
|
|
257
|
+
## 2.0.0-alpha.36
|
|
258
|
+
|
|
259
|
+
### Major Changes
|
|
260
|
+
|
|
261
|
+
- [#1094](https://github.com/iTwin/presentation/pull/1094): Improve custom errors rendering API:
|
|
262
|
+
- Separated `ChildrenLoad` error from the `Unknown` error. All expected tree errors have dedicated type and `Unknown` error can be used to handle custom errors encountered outside of tree.
|
|
263
|
+
- Exposed `ErrorItemRenderer` that renders all error types supported by the tree.
|
|
264
|
+
- Updated `TreeErrorRenderer` to pass all props necessary to render `ErrorItemRenderer` into `renderError` callback.
|
|
265
|
+
|
|
266
|
+
These changes makes it easier to customize only some types of errors and leave default handling for others.
|
|
267
|
+
|
|
268
|
+
Example:
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
<StrataKitTreeRenderer
|
|
272
|
+
{...treeProps}
|
|
273
|
+
errorRenderer={(errorProps) => {
|
|
274
|
+
return (
|
|
275
|
+
<TreeErrorRenderer
|
|
276
|
+
{...errorProps}
|
|
277
|
+
renderError={(errorItemProps) => {
|
|
278
|
+
if (errorItemProps.errorItem.errorNode.error.type === "Unknown") {
|
|
279
|
+
return <ErrorRegion.Item message="Custom error" messageId={errorItemProps.errorItem.errorNode.id} />;
|
|
280
|
+
}
|
|
281
|
+
return <ErrorItemRenderer {...errorItemProps} />;
|
|
282
|
+
}}
|
|
283
|
+
/>
|
|
284
|
+
);
|
|
285
|
+
}}
|
|
286
|
+
/>
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## 2.0.0-alpha.35
|
|
290
|
+
|
|
291
|
+
### Patch Changes
|
|
292
|
+
|
|
293
|
+
- [#1075](https://github.com/iTwin/presentation/pull/1075): Fix accessibility issues in `<TreeErrorRenderer />`.
|
|
294
|
+
|
|
295
|
+
This involves a few localized string changes:
|
|
296
|
+
- Added `issuesForTree`, defaulting to "Issues for {{tree_label}}.", used as a region landmark label for the error message container.
|
|
297
|
+
- Added `noIssuesFound`, defaulting to "No issues found.", used as a label for errors' list when there are no issues.
|
|
298
|
+
- Changed `issuesFound` to default to "{{number_of_issues}} issue(s) found.", and updated its usage to inject the number of issues found into the string instead of prefixing it before the string, which allows to place the number at any place in the string (may be a requirement for some languages). This is **a breaking change** for anyone, supplying their own localized strings.
|
|
299
|
+
|
|
300
|
+
Also, **a new required prop** `treeLabel` was added to `<TreeErrorRenderer />` and `<StrataKitTreeRenderer />` components. The label is used to uniquely identify a tree in the application, which is required for accessibility purposes.
|
|
301
|
+
|
|
302
|
+
## 2.0.0-alpha.34
|
|
303
|
+
|
|
304
|
+
### Patch Changes
|
|
305
|
+
|
|
306
|
+
- [#1068](https://github.com/iTwin/presentation/pull/1068): Extend `@stratakit` peer dependency range to support the latest versions
|
|
307
|
+
|
|
308
|
+
## 2.0.0-alpha.33
|
|
309
|
+
|
|
310
|
+
### Patch Changes
|
|
311
|
+
|
|
312
|
+
- [#1057](https://github.com/iTwin/presentation/pull/1057): Change `useNodeHighlighting` hook to only highlight nodes that are filter targets.
|
|
313
|
+
|
|
314
|
+
## 2.0.0-alpha.32
|
|
315
|
+
|
|
316
|
+
### Patch Changes
|
|
317
|
+
|
|
318
|
+
- [#1045](https://github.com/iTwin/presentation/pull/1045): Fix highlight matching in `useNodeHighlighting` hook. Highlighting now works when the `highlightText` contains special characters (`[`, `+`, `*`, etc.).
|
|
319
|
+
|
|
320
|
+
## 2.0.0-alpha.31
|
|
321
|
+
|
|
322
|
+
### Patch Changes
|
|
323
|
+
|
|
324
|
+
- [#1042](https://github.com/iTwin/presentation/pull/1042): Version bump
|
|
325
|
+
- [#1040](https://github.com/iTwin/presentation/pull/1040): Added a react hook `useNodeHighlighting` that helps create highlighted node labels based on provided text that should be highlighted.
|
|
326
|
+
|
|
327
|
+
Example usage:
|
|
328
|
+
|
|
329
|
+
```ts
|
|
330
|
+
import { StrataKitTreeRenderer, useNodeHighlighting } from "@itwin/presentation-hierarchies-react";
|
|
331
|
+
|
|
332
|
+
type BaseTreeRendererProps = React.ComponentPropsWithoutRef<typeof StrataKitTreeRenderer>;
|
|
333
|
+
|
|
334
|
+
function MyComponent(props: BaseTreeRendererProps & { searchText: string }) {
|
|
335
|
+
// Create highlight based on searchText
|
|
336
|
+
const highlightText = props.searchText !== "" ? props.searchText : undefined;
|
|
337
|
+
const { getLabel } = useNodeHighlighting({ highlightText });
|
|
338
|
+
|
|
339
|
+
// Provide getLabel function to tree renderer
|
|
340
|
+
return <StrataKitTreeRenderer {...props} getLabel={getLabel} />;
|
|
341
|
+
}
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
- Updated dependencies:
|
|
345
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.4
|
|
346
|
+
- @itwin/presentation-shared@2.0.0-alpha.2
|
|
347
|
+
- @itwin/unified-selection@1.5.1-alpha.1
|
|
348
|
+
|
|
349
|
+
## 2.0.0-alpha.30
|
|
350
|
+
|
|
351
|
+
### Patch Changes
|
|
352
|
+
|
|
353
|
+
- [#1037](https://github.com/iTwin/presentation/pull/1037): Added additional documentation for `RenameAction`
|
|
354
|
+
|
|
355
|
+
## 2.0.0-alpha.29
|
|
356
|
+
|
|
357
|
+
### Patch Changes
|
|
358
|
+
|
|
359
|
+
- [#1035](https://github.com/iTwin/presentation/pull/1035): Version bump after merge from `master`.
|
|
360
|
+
|
|
361
|
+
## 2.0.0-alpha.28
|
|
362
|
+
|
|
363
|
+
### Patch Changes
|
|
364
|
+
|
|
365
|
+
- [#1031](https://github.com/iTwin/presentation/pull/1031): Version bump
|
|
366
|
+
- Updated dependencies:
|
|
367
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.3
|
|
368
|
+
- @itwin/unified-selection@1.5.1-alpha.0
|
|
369
|
+
|
|
370
|
+
## 2.0.0-alpha.27
|
|
371
|
+
|
|
372
|
+
### Patch Changes
|
|
373
|
+
|
|
374
|
+
- [#1026](https://github.com/iTwin/presentation/pull/1026): Fix `reserveSpace` property being required instead of optional for `FilterAction` and `RenameAction`.
|
|
375
|
+
|
|
376
|
+
## 2.0.0-alpha.26
|
|
377
|
+
|
|
378
|
+
### Major Changes
|
|
379
|
+
|
|
380
|
+
- [#1023](https://github.com/iTwin/presentation/pull/1023): Split `getActions` into `getMenuActions` & `getInlineActions` for `StrataKitTreeRenderer` and `StrataKitTreeNodeRenderer`.
|
|
381
|
+
|
|
382
|
+
Updated peer dependencies:
|
|
383
|
+
- @stratakit/bricks@0.3.3
|
|
384
|
+
- @stratakit/foundations@0.2.2
|
|
385
|
+
- @stratakit/structures@0.3.1
|
|
386
|
+
|
|
387
|
+
Added `reserveSpace` property to `FilterAction` and `RenameAction`, which reserves space for the action when it is not available
|
|
388
|
+
|
|
389
|
+
### Minor Changes
|
|
390
|
+
|
|
391
|
+
- [#1007](https://github.com/iTwin/presentation/pull/1007): Renames:
|
|
392
|
+
`FlatNode` => `FlatTreeNodeItem`
|
|
393
|
+
`FlatTreeNode` => `FlatTreeItem`
|
|
394
|
+
`PlaceholderNode` => `PlaceholderItem`
|
|
395
|
+
`useFlatTreeNodeList` => `useFlatTreeItems`
|
|
396
|
+
|
|
397
|
+
Changed `FlatTreeNodeItem` (previously `FlatNode`) to have property `node: PresentationHierarchyNode` instead of extending `PresentationHierarchyNode`.
|
|
398
|
+
|
|
399
|
+
### Patch Changes
|
|
400
|
+
|
|
401
|
+
- Updated dependencies:
|
|
402
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.2
|
|
403
|
+
|
|
404
|
+
## 2.0.0-alpha.25
|
|
405
|
+
|
|
406
|
+
### Patch Changes
|
|
407
|
+
|
|
408
|
+
- Updated dependencies:
|
|
409
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.1
|
|
410
|
+
- @itwin/presentation-shared@2.0.0-alpha.1
|
|
411
|
+
- @itwin/unified-selection@1.4.3-alpha.0
|
|
412
|
+
|
|
413
|
+
## 2.0.0-alpha.24
|
|
414
|
+
|
|
415
|
+
### Patch Changes
|
|
416
|
+
|
|
417
|
+
- [#975](https://github.com/iTwin/presentation/pull/975): Associate tree nodes rendered by `<StrataKitTreeNodeRenderer />` component with error messages rendered in `<TreeErrorRenderer />`. This improves accessibility by linking error information to the node.
|
|
418
|
+
- [#979](https://github.com/iTwin/presentation/pull/979): Adjust how `useTree` and other variants of it determines `isReloading` value. `isReloading` is now set to `true` if root nodes are being loaded.
|
|
419
|
+
|
|
420
|
+
## 2.0.0-alpha.23
|
|
421
|
+
|
|
422
|
+
### Minor Changes
|
|
423
|
+
|
|
424
|
+
- [#972](https://github.com/iTwin/presentation/pull/972): Added `getEditingProps` prop to `<StrataKitTreeRenderer />` component that allows to make node labels editable. In order to enter label editing mode `<RenameAction />` component was added.
|
|
425
|
+
|
|
426
|
+
## 2.0.0-alpha.22
|
|
427
|
+
|
|
428
|
+
### Minor Changes
|
|
429
|
+
|
|
430
|
+
- [#970](https://github.com/iTwin/presentation/pull/970): Exposed the type of tree state hooks' result `treeRendererProps` attribute - `TreeRendererProps`. The type can be useful when creating custom tree renderers.
|
|
431
|
+
|
|
432
|
+
## 2.0.0-alpha.21
|
|
433
|
+
|
|
434
|
+
### Major Changes
|
|
435
|
+
|
|
436
|
+
- [#961](https://github.com/iTwin/presentation/pull/961): **Breaking changes** to tree state hooks `useTree`, `useUnifiedSelectionTree`, `useIModelTree`, `useIModelUnifiedSelectionTree`:
|
|
437
|
+
- All tree rendering props have been moved under `treeRendererProps`. The value can be passed to `<StrataKitTreeRenderer />` component.
|
|
438
|
+
- In case an error occurs while loading the root hierarchy level, instead of `treeRendererProps`, the `rootErrorRendererProps` are set, which can be passed to `<StrataKitRootErrorRenderer />` component to render the error state.
|
|
439
|
+
- The `isLoading` attribute has been renamed to `isReloading`.
|
|
440
|
+
- Errors are no longer defined as children of `PresentationHierarchyNode` and instead are now included as `error` attribute for more fluent API.
|
|
441
|
+
|
|
442
|
+
When rendering tree state, the recommended order of checks is:
|
|
443
|
+
1. If `rootErrorRendererProps` is defined, there was an error - render error state.
|
|
444
|
+
2. If `treeRendererProps` is not defined, the component is doing the initial load - render loading state.
|
|
445
|
+
3. If `treeRendererProps` is defined, the hierarchy is loaded - render the tree component.
|
|
446
|
+
|
|
447
|
+
The `isReloading` attribute may also be set at the same time, indicating that the hierarchy is being reloaded in the background. Consumers may want to render an overlay in this case, or not render the tree at all.
|
|
448
|
+
|
|
449
|
+
Example:
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
function MyComponent () {
|
|
453
|
+
const useTreeResult = useIModelUnifiedSelectionTree({...});
|
|
454
|
+
|
|
455
|
+
// handle possible root errors with our provided component or your own custom implementation
|
|
456
|
+
if (treeProps.rootErrorRendererProps) {
|
|
457
|
+
return <StrataKitRootErrorRenderer {...useTreeResult.rootErrorRendererProps} />;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// handle loading state
|
|
461
|
+
if (!treeProps.treeRendererProps) {
|
|
462
|
+
return <MyLoadingComponent />;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// handle loaded hierarchy
|
|
466
|
+
return <StrataKitTreeRenderer {...useTreeResult.treeProps} />;
|
|
467
|
+
}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
## 2.0.0-alpha.20
|
|
471
|
+
|
|
472
|
+
### Major Changes
|
|
473
|
+
|
|
474
|
+
- [#965](https://github.com/iTwin/presentation/pull/965): Added `@stratakit/structures` as a peer dependency.
|
|
475
|
+
|
|
476
|
+
## 2.0.0-alpha.19
|
|
477
|
+
|
|
478
|
+
### Major Changes
|
|
479
|
+
|
|
480
|
+
- [#954](https://github.com/iTwin/presentation/pull/954): Add additional requirements for types in `EC` metadata namespace, whose objects are returned by `ECSchemaProvider`.
|
|
481
|
+
- `EC.Schema`, `EC.Class` and `EC.Property` now all have an async `getCustomAttributes()` method that returns an `EC.CustomAttributeSet`, allowing consumers to access custom attributes of these schema items.
|
|
482
|
+
- `EC.Class` now additionally has these members:
|
|
483
|
+
- `baseClass: Promise<Class | undefined>`
|
|
484
|
+
- `getDerivedClasses(): Promise<Class[]>`
|
|
485
|
+
|
|
486
|
+
While this is an addition, it's considered a breaking change, because objects of the updated types are expected to be supplied to us by consumers.
|
|
487
|
+
|
|
488
|
+
In reality, consumers will likely use `@itwin/presentation-core-interop` package for creating them, and the package has been updated to handle the change, so reacting to the breaking change is as simple as bumping the version of `@itwin/presentation-core-interop` package in the consumer's `package.json`.
|
|
489
|
+
|
|
490
|
+
### Patch Changes
|
|
491
|
+
|
|
492
|
+
- [#957](https://github.com/iTwin/presentation/pull/957): Avoid leaking custom props to the `PlaceholderNode` that are causing console errors.
|
|
493
|
+
- Updated dependencies:
|
|
494
|
+
- @itwin/presentation-hierarchies@2.0.0-alpha.0
|
|
495
|
+
- @itwin/presentation-shared@2.0.0-alpha.0
|
|
496
|
+
- @itwin/unified-selection@1.4.2-alpha.0
|
|
497
|
+
|
|
498
|
+
## 2.0.0-alpha.18
|
|
499
|
+
|
|
500
|
+
### Major Changes
|
|
501
|
+
|
|
502
|
+
- [#951](https://github.com/iTwin/presentation/pull/951): Move from `@itwin/itwinui-react@5.0.0-alpha` to `@stratakit/*` packages.
|
|
503
|
+
|
|
504
|
+
## 2.0.0-alpha.17
|
|
505
|
+
|
|
506
|
+
### Patch Changes
|
|
507
|
+
|
|
508
|
+
- [#949](https://github.com/iTwin/presentation/pull/949): Use default imports instead of `URL` constructor for icons.
|
|
509
|
+
|
|
510
|
+
## 2.0.0-alpha.16
|
|
511
|
+
|
|
512
|
+
### Minor Changes
|
|
513
|
+
|
|
514
|
+
- [#945](https://github.com/iTwin/presentation/pull/945): Re-export `getLogger` and `setLogger` functions from `@itwin/presentation-hierarchies` to allow setting a logger.
|
|
515
|
+
|
|
516
|
+
## 2.0.0-alpha.15
|
|
517
|
+
|
|
518
|
+
### Major Changes
|
|
519
|
+
|
|
520
|
+
- [#942](https://github.com/iTwin/presentation/pull/942): Unified selection API cleanup.
|
|
521
|
+
- Remove deprecated `UnifiedSelectionProvider`.
|
|
522
|
+
- Make `selectionStorage` prop required for unified selection - enabled tree state hooks (`useUnifiedSelectionTree` and `useIModelUnifiedSelectionTree`).
|
|
523
|
+
|
|
524
|
+
Previously, the `selectionStorage` prop was optional, and if not provided, the hooks used unified selection React context (provided by `UnifiedSelectionProvider`) as fallback. Finally, if the context was not provided either, the hooks acted as regular non-unified selection hooks.
|
|
525
|
+
|
|
526
|
+
This didn't make much sense, as the hooks were designed to work with unified selection, as their name suggests. So it makes sense to require the selection storage to be provided to them, and at that point the context becomes redundant.
|
|
527
|
+
|
|
528
|
+
- [#936](https://github.com/iTwin/presentation/pull/936): Replaced `actions` property on `TreeNodeRenderer` with `getActions` to match how decorations are handled. Removed `useFilterAction` hook and replaced it with `FilterAction` component.
|
|
529
|
+
|
|
530
|
+
Before:
|
|
531
|
+
|
|
532
|
+
```tsx
|
|
533
|
+
import { TreeNodeRenderer, useFilterAction } from "@itwin/presentation-hierarchies-react";
|
|
534
|
+
|
|
535
|
+
const filterAction = useFilterAction({ onFilter, getHierarchyLevelDetails });
|
|
536
|
+
return (
|
|
537
|
+
<TreeNodeRenderer
|
|
538
|
+
actions={useMemo(
|
|
539
|
+
() => [
|
|
540
|
+
filterAction,
|
|
541
|
+
(node) => ({
|
|
542
|
+
label: "Custom Action",
|
|
543
|
+
actions: () => log(node.label),
|
|
544
|
+
icon: customIconHref,
|
|
545
|
+
}),
|
|
546
|
+
],
|
|
547
|
+
[filterAction],
|
|
548
|
+
)}
|
|
549
|
+
/>
|
|
550
|
+
);
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
After:
|
|
554
|
+
|
|
555
|
+
```tsx
|
|
556
|
+
import { Icon, Tree } from "@itwin/itwinui-react";
|
|
557
|
+
import { FilterAction, TreeNodeRenderer } from "@itwin/presentation-hierarchies-react";
|
|
558
|
+
|
|
559
|
+
return (
|
|
560
|
+
<TreeNodeRenderer
|
|
561
|
+
getActions={useCallback(
|
|
562
|
+
(node) => [
|
|
563
|
+
<FilterAction key="filter" node={node} onFilter={onFilter} getHierarchyLevelDetails={getHierarchyLevelDetails} />,
|
|
564
|
+
<Tree.ItemAction key="customAction" label="Custom action" onClick={() => log(node.label)} icon={<Icon href={customIconHref} />} />,
|
|
565
|
+
],
|
|
566
|
+
[onFilter, getHierarchyLevelDetails],
|
|
567
|
+
)}
|
|
568
|
+
/>
|
|
569
|
+
);
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
### Minor Changes
|
|
573
|
+
|
|
574
|
+
- [#930](https://github.com/iTwin/presentation/pull/930): Exposed `TreeErrorRenderer`, which takes `renderError` property to render custom error messages.
|
|
575
|
+
`TreeRenderer` now takes `errorRenderer` to render a custom error display component.
|
|
576
|
+
|
|
577
|
+
Custom error display component example:
|
|
578
|
+
|
|
579
|
+
```ts
|
|
580
|
+
<TreeRenderer
|
|
581
|
+
{...treeProps}
|
|
582
|
+
errorRenderer={(errorsRendererProps) => (
|
|
583
|
+
<MyErrorRenderer {...errorsRendererProps} />
|
|
584
|
+
)}
|
|
585
|
+
/>
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
Custom error message example:
|
|
589
|
+
|
|
590
|
+
```ts
|
|
591
|
+
<TreeRenderer
|
|
592
|
+
{...treeProps}
|
|
593
|
+
errorRenderer={(errorsRendererProps) => (
|
|
594
|
+
<TreeErrorRenderer
|
|
595
|
+
{...errorsRendererProps}
|
|
596
|
+
renderError={(errorProps) => {
|
|
597
|
+
return <unstable_ErrorRegion.Item message={...} />;
|
|
598
|
+
}}
|
|
599
|
+
/>
|
|
600
|
+
)}
|
|
601
|
+
/>
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
- [#937](https://github.com/iTwin/presentation/pull/937): `TreeRenderer` now takes `rootErrorRenderer` to render a custom root error display component.
|
|
605
|
+
|
|
606
|
+
Custom error display component example:
|
|
607
|
+
|
|
608
|
+
```ts
|
|
609
|
+
<TreeRenderer
|
|
610
|
+
{...treeProps}
|
|
611
|
+
rootErrorRenderer={(rootErrorRendererProps) => (
|
|
612
|
+
<MyRootErrorRenderer {...rootErrorRendererProps} />
|
|
613
|
+
)}
|
|
614
|
+
/>
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
- [#930](https://github.com/iTwin/presentation/pull/930): Changed flat tree building functions to hooks:
|
|
618
|
+
- `flattenNodes` => `useFlatTreeNodeList`.
|
|
619
|
+
- `getErrors` => `useErrorList`.
|
|
620
|
+
|
|
621
|
+
### Patch Changes
|
|
622
|
+
|
|
623
|
+
- [#930](https://github.com/iTwin/presentation/pull/930): Fix `ResultSetTooLarge` error suggesting filtering when parent node is not filterable.
|
|
624
|
+
|
|
625
|
+
## 2.0.0-alpha.14
|
|
626
|
+
|
|
627
|
+
### Patch Changes
|
|
628
|
+
|
|
629
|
+
- [#928](https://github.com/iTwin/presentation/pull/928): Memoize tree components to reduce the amount of renders.
|
|
630
|
+
|
|
631
|
+
## 2.0.0-alpha.13
|
|
632
|
+
|
|
633
|
+
### Patch Changes
|
|
634
|
+
|
|
635
|
+
- [#924](https://github.com/iTwin/presentation/pull/924): Fix tree error dropdown not applying actions.
|
|
636
|
+
|
|
637
|
+
## 2.0.0-alpha.12
|
|
638
|
+
|
|
639
|
+
### Patch Changes
|
|
640
|
+
|
|
641
|
+
- [#922](https://github.com/iTwin/presentation/pull/922): Fix tree displaying aditional scrollbars, when scrolling to the last element with low tree width.
|
|
642
|
+
|
|
643
|
+
## 2.0.0-alpha.11
|
|
644
|
+
|
|
645
|
+
### Patch Changes
|
|
646
|
+
|
|
647
|
+
- [#916](https://github.com/iTwin/presentation/pull/916): Fix tree nodes overlapping when nodes with and without sublabel are rendered alongside.
|
|
648
|
+
- [#920](https://github.com/iTwin/presentation/pull/920): Changed error display for node errors to match new design system.
|
|
649
|
+
|
|
650
|
+
## 2.0.0-alpha.10
|
|
651
|
+
|
|
652
|
+
### Patch Changes
|
|
653
|
+
|
|
654
|
+
- [#913](https://github.com/iTwin/presentation/pull/913): Removed outline showed after node expander is clicked.
|
|
655
|
+
|
|
656
|
+
## 2.0.0-alpha.9
|
|
657
|
+
|
|
658
|
+
### Patch Changes
|
|
659
|
+
|
|
660
|
+
- [#906](https://github.com/iTwin/presentation/pull/906): Replaced `TreeNodeRenderer.getIcon` prop with `getDecorations` prop.
|
|
661
|
+
|
|
662
|
+
The `getIcon` prop took either an icon URI, or a `ReactElement`. The new `getDecorations` prop allows passing multiple React elements, allowing consumers to render not just the icon, but also addition components like a tag or a color swatch. Migration:
|
|
663
|
+
|
|
664
|
+
```ts
|
|
665
|
+
// previously, when `getIcon` returned a `ReactElement`:
|
|
666
|
+
function myGetIcon(node: PresentationHierarchyNode): React.ReactElement {
|
|
667
|
+
// implementation...
|
|
668
|
+
}
|
|
669
|
+
<TreeNodeRenderer getIcon={myGetIcon} />
|
|
670
|
+
|
|
671
|
+
// now:
|
|
672
|
+
<TreeNodeRenderer getDecorations={myGetIcon} />
|
|
673
|
+
|
|
674
|
+
// previously, when `getIcon` returned an icon URI:
|
|
675
|
+
function myGetIconUri(node: PresentationHierarchyNode): string {
|
|
676
|
+
// implementation...
|
|
677
|
+
}
|
|
678
|
+
<TreeNodeRenderer getIcon={myGetIconUri} />
|
|
679
|
+
|
|
680
|
+
// now:
|
|
681
|
+
<TreeNodeRenderer getDecorations={(node) => <Icon href={myGetIconUri(node)} />} />
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
- [#911](https://github.com/iTwin/presentation/pull/911): Fix incorrect left padding on tree items
|
|
685
|
+
|
|
686
|
+
## 2.0.0-alpha.8
|
|
687
|
+
|
|
688
|
+
### Patch Changes
|
|
689
|
+
|
|
690
|
+
- [#903](https://github.com/iTwin/presentation/pull/903): Added `activeDescription` optional property to TreeItemAction interface, which when provided a value will display a dot above the button indicating an active state. The provided value is used to set accesible description and should explain why the action item is active.
|
|
691
|
+
- [#903](https://github.com/iTwin/presentation/pull/903): Changed `createFilterAction` function to a React hook and renamed it to `useFilterAction`.
|
|
692
|
+
|
|
693
|
+
## 2.0.0-alpha.7
|
|
694
|
+
|
|
695
|
+
### Patch Changes
|
|
696
|
+
|
|
697
|
+
- [#892](https://github.com/iTwin/presentation/pull/892): Fix focus outline for tree items not being visible on action items click.
|
|
698
|
+
- [#894](https://github.com/iTwin/presentation/pull/894): Fix `treeRenderer` property `getSublabel` not being used.
|
|
699
|
+
|
|
700
|
+
## 2.0.0-alpha.6
|
|
701
|
+
|
|
702
|
+
### Patch Changes
|
|
703
|
+
|
|
704
|
+
- [#890](https://github.com/iTwin/presentation/pull/890): Fix alpha peer dependencies to no longer have caret.
|
|
705
|
+
|
|
3
706
|
## 2.0.0-alpha.5
|
|
4
707
|
|
|
5
708
|
### Minor Changes
|
|
@@ -11,13 +714,11 @@
|
|
|
11
714
|
### Minor Changes
|
|
12
715
|
|
|
13
716
|
- [#878](https://github.com/iTwin/presentation/pull/878): Tree node renderer now uses `Tree.ItemAction`. `Show` property now takes in undefined values, values behave like this:
|
|
14
|
-
|
|
15
717
|
- `undefined` - visible on hover/focus,
|
|
16
718
|
- `true` - visible at all times,
|
|
17
719
|
- `false` - hidden at all times.
|
|
18
720
|
|
|
19
721
|
Updated peer dependencies:
|
|
20
|
-
|
|
21
722
|
- itwinui-icons to 5.0.0-alpha.3,
|
|
22
723
|
- itwinui-react to 5.0.0-alpha.6,
|
|
23
724
|
|
|
@@ -26,7 +727,6 @@
|
|
|
26
727
|
### Patch Changes
|
|
27
728
|
|
|
28
729
|
- [#870](https://github.com/iTwin/presentation/pull/870): `TreeRenderer` and `TreeNodeRenderer` now take actions as specification function array.
|
|
29
|
-
|
|
30
730
|
- `label`: Action item's label.
|
|
31
731
|
- `action`: The action performed when the button is clicked.
|
|
32
732
|
- `show` A boolean determining whether the button should be displayed.
|
|
@@ -48,7 +748,6 @@
|
|
|
48
748
|
- [#862](https://github.com/iTwin/presentation/pull/862): Update `@itwin/itwinui-react` dependency to `5.0.0-alpha.3`.
|
|
49
749
|
|
|
50
750
|
This fixes the following issues:
|
|
51
|
-
|
|
52
751
|
- nodes being selected on expand,
|
|
53
752
|
- node action buttons being rendered incorrectly.
|
|
54
753
|
|
|
@@ -58,6 +757,205 @@
|
|
|
58
757
|
|
|
59
758
|
- [#847](https://github.com/iTwin/presentation/pull/847): Moving tree rendering components to a new design systems.
|
|
60
759
|
|
|
760
|
+
## 1.9.10
|
|
761
|
+
|
|
762
|
+
### Patch Changes
|
|
763
|
+
|
|
764
|
+
- [#1168](https://github.com/iTwin/presentation/pull/1168): Bump dependencies.
|
|
765
|
+
- [#1167](https://github.com/iTwin/presentation/pull/1167): Fix a greedy regular expression in `TreeNodeRenderer` that renders a "result set too large" error node.
|
|
766
|
+
- [#1161](https://github.com/iTwin/presentation/pull/1161): Bump iTwin.js dependencies to `^5.5.0`.
|
|
767
|
+
- Updated dependencies:
|
|
768
|
+
- @itwin/presentation-hierarchies@1.7.8
|
|
769
|
+
- @itwin/presentation-shared@1.2.7
|
|
770
|
+
- @itwin/unified-selection@1.6.5
|
|
771
|
+
|
|
772
|
+
## 1.9.9
|
|
773
|
+
|
|
774
|
+
### Patch Changes
|
|
775
|
+
|
|
776
|
+
- [#1160](https://github.com/iTwin/presentation/pull/1160): Fixed tree placeholder node spinner size to match tree node icons.
|
|
777
|
+
|
|
778
|
+
## 1.9.8
|
|
779
|
+
|
|
780
|
+
### Patch Changes
|
|
781
|
+
|
|
782
|
+
- [#1152](https://github.com/iTwin/presentation/pull/1152): Bump dependencies.
|
|
783
|
+
- Updated dependencies:
|
|
784
|
+
- @itwin/presentation-hierarchies@1.7.7
|
|
785
|
+
- @itwin/presentation-shared@1.2.6
|
|
786
|
+
- @itwin/unified-selection@1.6.4
|
|
787
|
+
|
|
788
|
+
## 1.9.7
|
|
789
|
+
|
|
790
|
+
### Patch Changes
|
|
791
|
+
|
|
792
|
+
- [#1139](https://github.com/iTwin/presentation/pull/1139): Bump dependencies.
|
|
793
|
+
- Updated dependencies:
|
|
794
|
+
- @itwin/presentation-hierarchies@1.7.6
|
|
795
|
+
- @itwin/presentation-shared@1.2.5
|
|
796
|
+
- @itwin/unified-selection@1.6.3
|
|
797
|
+
|
|
798
|
+
## 1.9.6
|
|
799
|
+
|
|
800
|
+
### Patch Changes
|
|
801
|
+
|
|
802
|
+
- [#1124](https://github.com/iTwin/presentation/pull/1124): Bump dependencies.
|
|
803
|
+
- Updated dependencies:
|
|
804
|
+
- @itwin/unified-selection@1.6.2
|
|
805
|
+
- @itwin/presentation-hierarchies@1.7.5
|
|
806
|
+
- @itwin/presentation-shared@1.2.4
|
|
807
|
+
|
|
808
|
+
## 1.9.5
|
|
809
|
+
|
|
810
|
+
### Patch Changes
|
|
811
|
+
|
|
812
|
+
- [#1079](https://github.com/iTwin/presentation/pull/1079): Fixed tree node actions background color when node is selected and hovered.
|
|
813
|
+
|
|
814
|
+
## 1.9.4
|
|
815
|
+
|
|
816
|
+
### Patch Changes
|
|
817
|
+
|
|
818
|
+
- [#1063](https://github.com/iTwin/presentation/pull/1063): Make sure tree node actions are properly sticking to the right side when scrolling tree horizontally.
|
|
819
|
+
|
|
820
|
+
## 1.9.3
|
|
821
|
+
|
|
822
|
+
### Patch Changes
|
|
823
|
+
|
|
824
|
+
- [#1054](https://github.com/iTwin/presentation/pull/1054): Show tooltip with full label on tree nodes.
|
|
825
|
+
|
|
826
|
+
## 1.9.2
|
|
827
|
+
|
|
828
|
+
### Patch Changes
|
|
829
|
+
|
|
830
|
+
- [#1039](https://github.com/iTwin/presentation/pull/1039): Bump iTwin.js core dependencies to `^5.1.1`.
|
|
831
|
+
- Updated dependencies:
|
|
832
|
+
- @itwin/presentation-hierarchies@1.7.2
|
|
833
|
+
- @itwin/presentation-shared@1.2.3
|
|
834
|
+
- @itwin/unified-selection@1.5.1
|
|
835
|
+
|
|
836
|
+
## 1.9.1
|
|
837
|
+
|
|
838
|
+
### Patch Changes
|
|
839
|
+
|
|
840
|
+
- [#1033](https://github.com/iTwin/presentation/pull/1033): Fix unified selection tree state hooks `useUnifiedSelectionTree` and `useIModelUnifiedSelectionTree` not handling the recently added `createSelectableForGenericNode` prop.
|
|
841
|
+
|
|
842
|
+
## 1.9.0
|
|
843
|
+
|
|
844
|
+
### Minor Changes
|
|
845
|
+
|
|
846
|
+
- [#1027](https://github.com/iTwin/presentation/pull/1027): Added `getActions` property to `TreeRenderer` and `TreeNodeRenderer` to allow providing custom actions for tree nodes.
|
|
847
|
+
|
|
848
|
+
## 1.8.1
|
|
849
|
+
|
|
850
|
+
### Patch Changes
|
|
851
|
+
|
|
852
|
+
- Updated dependencies:
|
|
853
|
+
- @itwin/presentation-hierarchies@1.7.1
|
|
854
|
+
|
|
855
|
+
## 1.8.0
|
|
856
|
+
|
|
857
|
+
### Minor Changes
|
|
858
|
+
|
|
859
|
+
- [#1019](https://github.com/iTwin/presentation/pull/1019): Add ability to customize `Selectable` objects that are added to unified selection, when a generic node in a unified selection-driven tree component is selected.
|
|
860
|
+
|
|
861
|
+
By default, when a generic node is selected in a unified selection-driven tree component, the `Selectable` that is created for it gets a per-tree unique identifier. This means that a similar generic node somewhere else in the tree or a different tree will not be considered the same. However, in some cases we do want generic nodes to be treated as the same, and for that matter unified selection-enabling tree state hooks now have a new `createSelectableForGenericNode` option:
|
|
862
|
+
|
|
863
|
+
```tsx
|
|
864
|
+
import { useUnifiedSelectionTree } from "@itwin/presentation-hierarchies-react";
|
|
865
|
+
|
|
866
|
+
const treeState = useUnifiedSelectionTree({
|
|
867
|
+
selectionStorage,
|
|
868
|
+
createSelectableForGenericNode: useCallback<NonNullable<Props<typeof useUnifiedSelectionTree>["createSelectableForGenericNode"]>>(
|
|
869
|
+
(node, uniqueId) => ({ identifier: node.key.id, data: node, async *loadInstanceKeys() {} }),
|
|
870
|
+
[],
|
|
871
|
+
),
|
|
872
|
+
// ...other options
|
|
873
|
+
});
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
### Patch Changes
|
|
877
|
+
|
|
878
|
+
- Updated dependencies:
|
|
879
|
+
- @itwin/unified-selection@1.5.0
|
|
880
|
+
|
|
881
|
+
## 1.7.2
|
|
882
|
+
|
|
883
|
+
### Patch Changes
|
|
884
|
+
|
|
885
|
+
- Updated dependencies:
|
|
886
|
+
- @itwin/presentation-hierarchies@1.7.0
|
|
887
|
+
|
|
888
|
+
## 1.7.1
|
|
889
|
+
|
|
890
|
+
### Patch Changes
|
|
891
|
+
|
|
892
|
+
- Updated dependencies:
|
|
893
|
+
- @itwin/presentation-hierarchies@1.6.1
|
|
894
|
+
|
|
895
|
+
## 1.7.0
|
|
896
|
+
|
|
897
|
+
### Minor Changes
|
|
898
|
+
|
|
899
|
+
- 64e80beaeb87e5797d8238c14fa9cd8dbfcee7c3: Added `abortSignal` to `getFilteredPaths` callback used by `UseTree` hook. This allows to cancel ongoing requests when component is unmounted or new request is started.
|
|
900
|
+
|
|
901
|
+
### Patch Changes
|
|
902
|
+
|
|
903
|
+
- Updated dependencies:
|
|
904
|
+
- @itwin/presentation-hierarchies@1.6.0
|
|
905
|
+
|
|
906
|
+
## 1.6.9
|
|
907
|
+
|
|
908
|
+
### Patch Changes
|
|
909
|
+
|
|
910
|
+
- [#1000](https://github.com/iTwin/presentation/pull/1000): Made sure `Apply filter` button becomes focused after hierarchy level filter is applied.
|
|
911
|
+
|
|
912
|
+
## 1.6.8
|
|
913
|
+
|
|
914
|
+
### Patch Changes
|
|
915
|
+
|
|
916
|
+
- [#982](https://github.com/iTwin/presentation/pull/982): Update itwinjs-core dependencies to v5.0.0
|
|
917
|
+
- Updated dependencies:
|
|
918
|
+
- @itwin/presentation-hierarchies@1.5.1
|
|
919
|
+
- @itwin/presentation-shared@1.2.2
|
|
920
|
+
- @itwin/unified-selection@1.4.2
|
|
921
|
+
|
|
922
|
+
## 1.6.7
|
|
923
|
+
|
|
924
|
+
### Patch Changes
|
|
925
|
+
|
|
926
|
+
- [#974](https://github.com/iTwin/presentation/pull/974): Removed tree node outline on mobile devices.
|
|
927
|
+
- Updated dependencies:
|
|
928
|
+
- @itwin/presentation-hierarchies@1.5.0
|
|
929
|
+
|
|
930
|
+
## 1.6.6
|
|
931
|
+
|
|
932
|
+
### Patch Changes
|
|
933
|
+
|
|
934
|
+
- [#944](https://github.com/iTwin/presentation/pull/944): Fixed `extended` selection mode not replacing existing selection when selected node is clicked.
|
|
935
|
+
|
|
936
|
+
## 1.6.5
|
|
937
|
+
|
|
938
|
+
### Patch Changes
|
|
939
|
+
|
|
940
|
+
- [#938](https://github.com/iTwin/presentation/pull/938): Fixed hierarchy level size exceeded message that suggest applying filtering on hierarchy levels that do not support filtering.
|
|
941
|
+
|
|
942
|
+
## 1.6.4
|
|
943
|
+
|
|
944
|
+
### Patch Changes
|
|
945
|
+
|
|
946
|
+
- [#909](https://github.com/iTwin/presentation/pull/909): Do not use `dev` versions of `@itwin/*` packages.
|
|
947
|
+
- Updated dependencies:
|
|
948
|
+
- @itwin/unified-selection@1.4.1
|
|
949
|
+
- @itwin/presentation-hierarchies@1.4.2
|
|
950
|
+
- @itwin/presentation-shared@1.2.1
|
|
951
|
+
|
|
952
|
+
## 1.6.3
|
|
953
|
+
|
|
954
|
+
### Patch Changes
|
|
955
|
+
|
|
956
|
+
- Updated dependencies:
|
|
957
|
+
- @itwin/unified-selection@1.4.0
|
|
958
|
+
|
|
61
959
|
## 1.6.2
|
|
62
960
|
|
|
63
961
|
### Patch Changes
|
|
@@ -76,7 +974,6 @@
|
|
|
76
974
|
### Minor Changes
|
|
77
975
|
|
|
78
976
|
- [#841](https://github.com/iTwin/presentation/pull/841): Changed how tree state hooks access unified selection storage.
|
|
79
|
-
|
|
80
977
|
- The tree state hooks that hook into unified selection system now accept a `selectionStorage` prop. At the moment the prop is optional, but will be made required in the next major release of the package.
|
|
81
978
|
- The `UnifiedSelectionProvider` React context provider is now deprecated. The context is still used by tree state hooks if the selection storage is not provided through prop.
|
|
82
979
|
|
|
@@ -122,7 +1019,6 @@
|
|
|
122
1019
|
### Minor Changes
|
|
123
1020
|
|
|
124
1021
|
- [#840](https://github.com/iTwin/presentation/pull/840): Added `filterButtonsVisibility` to `treeNodeRenderer`. Which allows configuring filter buttons visibility for the whole tree.
|
|
125
|
-
|
|
126
1022
|
- `show-on-hover` - default value, shows filter buttons on node hover or focus.
|
|
127
1023
|
- `hide` - hides filter buttons on focus and hover, but will continue to show buttons on nodes in which filter is applied. Reaching hierarchy limit will continue to provide a way to filter nodes.
|
|
128
1024
|
|
|
@@ -333,7 +1229,6 @@
|
|
|
333
1229
|
See "Basic example" section in README learning page for the full example.
|
|
334
1230
|
|
|
335
1231
|
- [#717](https://github.com/iTwin/presentation/pull/717): **BREAKING:** Add support for non-iModel-driven trees.
|
|
336
|
-
|
|
337
1232
|
- `useTree` and `useUnifiedSelectionTree` hooks have been changed to support non-iModel-driven trees. The hooks take a `getHierarchyProvider` prop, which returns a `HierarchyProvider`. The provider can return data from any data source.
|
|
338
1233
|
- New `useIModelTree` and `useIModelUnifiedSelectionTree` hooks have been added to cover the most common case, where a tree is created from a iModel's data. The API of these hooks is exactly the same as of the old `useTree` and `useUnifiedSelectionTree` hooks.
|
|
339
1234
|
|