@itwin/tree-widget-react 1.0.0-dev.8 → 1.1.0

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 (96) hide show
  1. package/CHANGELOG.md +77 -181
  2. package/lib/cjs/TreeWidget.d.ts +1 -0
  3. package/lib/cjs/TreeWidget.js +10 -3
  4. package/lib/cjs/TreeWidget.js.map +1 -1
  5. package/lib/cjs/components/SelectableTree.scss +0 -1
  6. package/lib/cjs/components/trees/VisibilityTreeBase.scss +55 -84
  7. package/lib/cjs/components/trees/VisibilityTreeRenderer.d.ts +4 -3
  8. package/lib/cjs/components/trees/VisibilityTreeRenderer.js +5 -4
  9. package/lib/cjs/components/trees/VisibilityTreeRenderer.js.map +1 -1
  10. package/lib/cjs/components/trees/category-tree/CategoriesTree.d.ts +1 -1
  11. package/lib/cjs/components/trees/category-tree/CategoriesTree.js +13 -1
  12. package/lib/cjs/components/trees/category-tree/CategoriesTree.js.map +1 -1
  13. package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.d.ts +2 -2
  14. package/lib/cjs/components/trees/common/ContextMenu.d.ts +39 -0
  15. package/lib/cjs/components/trees/common/ContextMenu.js +44 -0
  16. package/lib/cjs/components/trees/common/ContextMenu.js.map +1 -0
  17. package/lib/cjs/components/trees/common/TreeNodeRenderer.d.ts +61 -0
  18. package/lib/cjs/components/trees/common/TreeNodeRenderer.js +50 -0
  19. package/lib/cjs/components/trees/common/TreeNodeRenderer.js.map +1 -0
  20. package/lib/cjs/components/trees/common/TreeRenderer.d.ts +26 -0
  21. package/lib/cjs/components/trees/common/TreeRenderer.js +41 -0
  22. package/lib/cjs/components/trees/common/TreeRenderer.js.map +1 -0
  23. package/lib/cjs/components/trees/common/TreeRenderer.scss +102 -0
  24. package/lib/cjs/components/trees/{Common.d.ts → common/Types.d.ts} +3 -2
  25. package/lib/cjs/components/trees/{Common.js → common/Types.js} +1 -1
  26. package/lib/cjs/components/trees/common/Types.js.map +1 -0
  27. package/lib/cjs/components/trees/common/Utils.d.ts +11 -0
  28. package/lib/cjs/components/trees/common/Utils.js +49 -0
  29. package/lib/cjs/components/trees/common/Utils.js.map +1 -0
  30. package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +1 -1
  31. package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js +9 -4
  32. package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
  33. package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +7 -1
  34. package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +1 -4
  35. package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
  36. package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.d.ts +1 -1
  37. package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js +8 -2
  38. package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
  39. package/lib/cjs/components/trees/index.d.ts +4 -2
  40. package/lib/cjs/components/trees/index.js +4 -2
  41. package/lib/cjs/components/trees/index.js.map +1 -1
  42. package/lib/cjs/components/trees/models-tree/ModelsTree.d.ts +6 -4
  43. package/lib/cjs/components/trees/models-tree/ModelsTree.js +25 -10
  44. package/lib/cjs/components/trees/models-tree/ModelsTree.js.map +1 -1
  45. package/lib/cjs/components/trees/models-tree/Utils.d.ts +2 -2
  46. package/lib/cjs/components/trees/models-tree/Utils.js +269 -335
  47. package/lib/cjs/components/trees/models-tree/Utils.js.map +1 -1
  48. package/lib/esm/TreeWidget.d.ts +1 -0
  49. package/lib/esm/TreeWidget.js +10 -3
  50. package/lib/esm/TreeWidget.js.map +1 -1
  51. package/lib/esm/components/SelectableTree.scss +0 -1
  52. package/lib/esm/components/trees/VisibilityTreeBase.scss +55 -84
  53. package/lib/esm/components/trees/VisibilityTreeRenderer.d.ts +4 -3
  54. package/lib/esm/components/trees/VisibilityTreeRenderer.js +6 -5
  55. package/lib/esm/components/trees/VisibilityTreeRenderer.js.map +1 -1
  56. package/lib/esm/components/trees/category-tree/CategoriesTree.d.ts +1 -1
  57. package/lib/esm/components/trees/category-tree/CategoriesTree.js +10 -1
  58. package/lib/esm/components/trees/category-tree/CategoriesTree.js.map +1 -1
  59. package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.d.ts +2 -2
  60. package/lib/esm/components/trees/common/ContextMenu.d.ts +39 -0
  61. package/lib/esm/components/trees/common/ContextMenu.js +39 -0
  62. package/lib/esm/components/trees/common/ContextMenu.js.map +1 -0
  63. package/lib/esm/components/trees/common/TreeNodeRenderer.d.ts +61 -0
  64. package/lib/esm/components/trees/common/TreeNodeRenderer.js +44 -0
  65. package/lib/esm/components/trees/common/TreeNodeRenderer.js.map +1 -0
  66. package/lib/esm/components/trees/common/TreeRenderer.d.ts +26 -0
  67. package/lib/esm/components/trees/common/TreeRenderer.js +34 -0
  68. package/lib/esm/components/trees/common/TreeRenderer.js.map +1 -0
  69. package/lib/esm/components/trees/common/TreeRenderer.scss +102 -0
  70. package/lib/esm/components/trees/{Common.d.ts → common/Types.d.ts} +3 -2
  71. package/lib/esm/components/trees/{Common.js → common/Types.js} +1 -1
  72. package/lib/esm/components/trees/common/Types.js.map +1 -0
  73. package/lib/esm/components/trees/common/Utils.d.ts +11 -0
  74. package/lib/esm/components/trees/common/Utils.js +42 -0
  75. package/lib/esm/components/trees/common/Utils.js.map +1 -0
  76. package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +1 -1
  77. package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js +9 -4
  78. package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -1
  79. package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +7 -1
  80. package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +1 -4
  81. package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -1
  82. package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.d.ts +1 -1
  83. package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js +8 -2
  84. package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -1
  85. package/lib/esm/components/trees/index.d.ts +4 -2
  86. package/lib/esm/components/trees/index.js +4 -2
  87. package/lib/esm/components/trees/index.js.map +1 -1
  88. package/lib/esm/components/trees/models-tree/ModelsTree.d.ts +6 -4
  89. package/lib/esm/components/trees/models-tree/ModelsTree.js +19 -7
  90. package/lib/esm/components/trees/models-tree/ModelsTree.js.map +1 -1
  91. package/lib/esm/components/trees/models-tree/Utils.d.ts +2 -2
  92. package/lib/esm/components/trees/models-tree/Utils.js +267 -333
  93. package/lib/esm/components/trees/models-tree/Utils.js.map +1 -1
  94. package/package.json +1 -2
  95. package/lib/cjs/components/trees/Common.js.map +0 -1
  96. package/lib/esm/components/trees/Common.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,55 @@
1
1
  # Change Log - @itwin/tree-widget-react
2
2
 
3
- This log was last generated on Tue, 23 May 2023 13:16:11 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 07 Aug 2023 13:36:23 GMT and should not be manually modified.
4
+
5
+ ## 1.1.0
6
+ Mon, 07 Aug 2023 13:36:23 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Trees: Added ability to increase node size in order to make tree more user friendly on touch devices.
11
+ - Trees: Added ability to customize tree node label
12
+ - `ModelsTree`: Added ability to show models without elements.
13
+ - Added context menu support.
14
+
15
+ ### Patches
16
+
17
+ - Removed `@itwin/itwinui-variables` from dependencies.
18
+
19
+ ## 1.0.0
20
+ Mon, 31 Jul 2023 14:10:09 GMT
21
+
22
+ ### Breaking changes
23
+
24
+ - Trees: Make eye checkboxes static on horizontal scroll.
25
+ - `createVisibilityTreeNodeRenderer` now takes a `props` object of type `VisibilityTreeNodeRendererProps`. It contains two new configuration options: `levelOffset`, and `disableRootNodeCollapse`.
26
+ - Rename `useVisibilityTreeRenderer` to `createVisibilityTreeRenderer`. It now takes a `props` object of type `VisibilityTreeRendererProps`
27
+ - Bumped AppUI peer dependencies to `^4.3.0`.
28
+ - Renamed `TreeWidgetComponent` to `SelectableTree`.
29
+ - Widget: Reworked the way trees are provided to the widget. Instead of having separate configuration properties for hiding default trees and adding additional trees now there is only one property for supplying a list of trees to show.
30
+ - Refactored `IModelContentTreeProps` to not inherit `HTMLDivElement` props.
31
+ - `IVisibilityHandler`: Methods `getVisibilityStatus` and `changeVisibility` don't take `NodeKey` argument anymore.
32
+ - Models tree: `ModelsTreeProps.enableElementsClassGrouping` has been moved to `ModelsTreeProps.hierarchyConfig.enableElementsClassGrouping`.
33
+
34
+ ### Minor changes
35
+
36
+ - Models tree: Removed expansion toggle for root node.
37
+ - Widget: Added ability to conditionally show trees.
38
+ - Trees: Decrease whitespace size between the node label and eye checkbox.
39
+ - Added base tree props interface for props shared between trees.
40
+ - External sources tree: Add `ExternalSourcesTreeComponent` (currently `@alpha`).
41
+ - Models tree: Added an option to specialize the class of geometric elements loaded into the hierarchy (see `ModelsTreeHierarchyConfiguration.elementClassSpecification`).
42
+ - Trees: Use search box from the `@itwin/itwinui-react` library.
43
+
44
+ ### Patches
45
+
46
+ - Trees: Keep child nodes state the same after parent node re-expands.
47
+ - Categories tree: Fixed behavior of the Invert button. Previously, only categories were affected, now sub-categories are affected as well.
48
+ - Handle errors thrown from tree components.
49
+ - Persist tree scroll position when switching between widgets.
50
+ - `Tree Header`: Fixed dropdown buttons menu not theming correctly.
51
+ - `ModelsTree`: Refactor ruleset to not use deprecated `ImageIdOverride` rule.
52
+ - `ModelsTree`: Always render checkbox to avoid UI shifting when checkbox appear.
4
53
 
5
54
  ## 0.10.0
6
55
  Tue, 23 May 2023 13:16:11 GMT
@@ -12,33 +61,33 @@ Tue, 02 May 2023 16:12:17 GMT
12
61
 
13
62
  ### Minor changes
14
63
 
15
- - Updated to AppUI 4.0 and Presentation 4.0
64
+ - Updated to AppUI 4.0 and Presentation 4.0.
16
65
 
17
66
  ## 0.8.0
18
67
  Mon, 03 Apr 2023 15:34:07 GMT
19
68
 
20
69
  ### Minor changes
21
70
 
22
- - Removed `SpatialTree` and related components in favor of the ones in `@itwin/breakdown-trees-react`
23
- - Updated dependencies (`itwinui@2`, `appui@4`, `presentation-components@4`, `itwinjs-core@3.7`)
71
+ - Removed `SpatialTree` and related components in favor of the ones in `@itwin/breakdown-trees-react`.
72
+ - Updated dependencies (`itwinui@2`, `appui@4`, `presentation-components@4`, `itwinjs-core@3.7`).
24
73
 
25
74
  ### Patches
26
75
 
27
- - Use iTwin UI components instead of custom ones and CSS variables from `@itwin/itwinui-variables` instead of `@itwin/core-react`
76
+ - Use iTwin UI components instead of custom ones and CSS variables from `@itwin/itwinui-variables` instead of `@itwin/core-react`.
28
77
 
29
78
  ## 0.7.2
30
79
  Fri, 24 Mar 2023 10:46:34 GMT
31
80
 
32
81
  ### Patches
33
82
 
34
- - Fixed tree filtering not being removed when search box is closed
83
+ - Fixed tree filtering not being removed when search box is closed.
35
84
 
36
85
  ## 0.7.1
37
86
  Thu, 23 Mar 2023 15:12:36 GMT
38
87
 
39
88
  ### Patches
40
89
 
41
- - 'ModelsTree': Restored 'HideAll' button behavior to hide only models
90
+ - 'ModelsTree': Restored 'HideAll' button behavior to hide only models.
42
91
 
43
92
  ## 0.7.0
44
93
  Mon, 20 Mar 2023 14:48:35 GMT
@@ -46,12 +95,12 @@ Mon, 20 Mar 2023 14:48:35 GMT
46
95
  ### Minor changes
47
96
 
48
97
  - Add an option to control what buttons are available in tree toolbars.
49
- - Upgrade `itwinjs-core` dependencies to `^3.6.0`
50
- - Upgrade `typescript` to `~4.4.0`
98
+ - Upgrade `itwinjs-core` dependencies to `^3.6.0`.
99
+ - Upgrade `typescript` to `~4.4.0`.
51
100
 
52
101
  ### Patches
53
102
 
54
- - ModelsTree: ensure that the "Show all" button is going to show all elements when there are elements with an "exclusive" flag
103
+ - ModelsTree: ensure that the "Show all" button is going to show all elements when there are elements with an "exclusive" flag.
55
104
  - '2d' and '3d' buttons react to visibility changes in the viewport. The '2d' button will be disabled if no models with the PlanProjection flag are present in the model.
56
105
 
57
106
  ## 0.6.2
@@ -59,30 +108,30 @@ Thu, 09 Mar 2023 20:08:53 GMT
59
108
 
60
109
  ### Patches
61
110
 
62
- - `ModelsTreeComponent`: ensure that the "show all" and "hide all" buttons affect all iModel content
63
- - Models Tree: Remove unused feature of filtering the tree by element ids
111
+ - `ModelsTreeComponent`: ensure that the "show all" and "hide all" buttons affect all iModel content.
112
+ - `ModelsTree`: Remove unused feature of filtering the tree by element ids.
64
113
 
65
114
  ## 0.6.1
66
115
  Thu, 19 Jan 2023 10:29:18 GMT
67
116
 
68
117
  ### Patches
69
118
 
70
- - CategoriesTree: Updated ruleset to not show private SubCategories
71
- - Bug fix for changing visibility of multiple nodes at once
119
+ - `CategoryTree`: Updated ruleset to not show private SubCategories.
120
+ - Bug fix for changing visibility of multiple nodes at once.
72
121
 
73
122
  ## 0.6.0
74
123
  Tue, 20 Dec 2022 15:12:29 GMT
75
124
 
76
125
  ### Minor changes
77
126
 
78
- - Moved core trees implementation from @itwin/appui-react package to @itwin/tree-widget-react
127
+ - Moved core trees implementation from `@itwin/appui-react` package to `@itwin/tree-widget-react`.
79
128
 
80
129
  ## 0.5.0
81
130
  Mon, 12 Sep 2022 19:50:36 GMT
82
131
 
83
132
  ### Minor changes
84
133
 
85
- - Add new `defaultTreeId` prop to specify default tree for TreeWidgetUiItemsProvider
134
+ - Add new `defaultTreeId` prop to specify default tree for `TreeWidgetUiItemsProvider`.
86
135
 
87
136
  ## 0.4.7
88
137
  Mon, 30 May 2022 12:44:10 GMT
@@ -96,28 +145,28 @@ Thu, 26 May 2022 15:54:07 GMT
96
145
 
97
146
  ### Patches
98
147
 
99
- - Allow a caller to specify a default priority for Tree Widget item provider.
148
+ - Allow a caller to specify a default priority for `TreeWidgetUiItemsProvider`.
100
149
 
101
150
  ## 0.4.5
102
151
  Mon, 09 May 2022 18:04:58 GMT
103
152
 
104
153
  ### Patches
105
154
 
106
- - set restore transient state in tree widget ui items provider to restore state when remounted
155
+ - Set restore transient state in `TreeWidgetUiItemsProvider` to restore state when remounted.
107
156
 
108
157
  ## 0.4.4
109
158
  Thu, 05 May 2022 12:21:21 GMT
110
159
 
111
160
  ### Patches
112
161
 
113
- - set tree-widget-search-bar-button-container z-index to 1
162
+ - Set tree-widget-search-bar-button-container z-index to 1.
114
163
 
115
164
  ## 0.4.3
116
165
  Thu, 21 Apr 2022 18:47:53 GMT
117
166
 
118
167
  ### Patches
119
168
 
120
- - Do not unmount children in AutoSizer when height or width is 0 to avoid losing children state
169
+ - Do not unmount children in `AutoSizer` when height or width is 0 to avoid losing children state.
121
170
 
122
171
  ## 0.4.2
123
172
  Tue, 19 Apr 2022 14:15:57 GMT
@@ -131,201 +180,48 @@ Wed, 06 Apr 2022 13:48:44 GMT
131
180
 
132
181
  ### Patches
133
182
 
134
- - Updates to allow specification of default panel location.
135
- - Add transitive peers as dev deps
136
- - added tree icon to tree widget tab
183
+ - Allow specifying default panel location.
184
+ - Added tree icon to tree widget tab.
137
185
 
138
186
  ## 0.4.0
139
187
  Fri, 18 Mar 2022 13:31:19 GMT
140
188
 
141
189
  ### Minor changes
142
190
 
143
- - Remove deprecated WidgetControl, update UiItemsProvider init
191
+ - Remove deprecated `WidgetControl`, update `UiItemsProvider` initialization.
144
192
 
145
193
  ## 0.3.0
146
194
  Wed, 02 Mar 2022 21:38:51 GMT
147
195
 
148
196
  ### Minor changes
149
197
 
150
- - Add `IModelContentTree`
198
+ - Add `IModelContentTree`.
151
199
 
152
200
  ## 0.2.1
153
201
  Fri, 04 Feb 2022 00:43:35 GMT
154
202
 
155
203
  ### Patches
156
204
 
157
- - Update scss to be pulled from cjs dir
205
+ - Update scss to be pulled from cjs dir.
158
206
 
159
207
  ## 0.2.0
160
208
  Mon, 24 Jan 2022 19:14:37 GMT
161
209
 
162
210
  ### Minor changes
163
211
 
164
- - Bump to official iTwin.js 3.0 release
212
+ - Bump to official iTwin.js 3.0 release.
165
213
 
166
214
  ## 0.1.2
167
215
  Wed, 19 Jan 2022 17:39:40 GMT
168
216
 
169
217
  ### Patches
170
218
 
171
- - updated to latest rc, dev-185, and updated deps
219
+ - Updated to latest rc, dev-185, and updated deps.
172
220
 
173
221
  ## 0.1.1
174
222
  Wed, 12 Jan 2022 13:59:35 GMT
175
223
 
176
224
  ### Patches
177
225
 
178
- - iTwin.js 3.0 first rc
179
-
180
- ## 1.4.6
181
- Tue, 11 Jan 2022 16:25:27 GMT
182
-
183
- ### Patches
184
-
185
- - Fix hide all button blocked by search bar
186
-
187
- ## 1.4.5
188
- Tue, 23 Nov 2021 21:19:42 GMT
189
-
190
- ### Patches
191
-
192
- - Fix an issue where ModelsTree Component could lose its state
193
-
194
- ## 1.4.4
195
- Thu, 16 Sep 2021 17:55:54 GMT
196
-
197
- ### Patches
198
-
199
- - Stop delivering psuedo-localized strings
200
-
201
- ## 1.4.3
202
- Thu, 26 Aug 2021 14:00:14 GMT
203
-
204
- ### Patches
205
-
206
- - Search bar was not sized correctly, and alignment was not centered.
207
-
208
- ## 1.4.2
209
- Mon, 09 Aug 2021 20:24:55 GMT
210
-
211
- ### Patches
212
-
213
- - Updated tree widget barrel file to include UiProvider
214
-
215
- ## 1.4.1
216
- Mon, 19 Jul 2021 18:07:24 GMT
217
-
218
- ### Patches
219
-
220
- - Model/Category tree was not resizing properly, missing flex=1.
221
-
222
- ## 1.4.0
223
- Tue, 13 Jul 2021 17:43:28 GMT
224
-
225
- ### Minor changes
226
-
227
- - Added a UiProvider that implements the existing tree widget
228
-
229
- ## 1.3.1
230
- Tue, 08 Jun 2021 21:23:59 GMT
231
-
232
- ### Patches
233
-
234
- - bump classnames dep
235
-
236
- ## 1.3.0
237
- Thu, 13 May 2021 21:15:14 GMT
238
-
239
- ### Minor changes
240
-
241
- - update imjs to 2.15.2 to resolve breaking change in usePResentationTreeNodeLoader
242
-
243
- ## 1.2.8
244
- Wed, 24 Mar 2021 21:09:25 GMT
245
-
246
- ### Patches
247
-
248
- - Avoid Nested ScrollBars in Tree View widget
249
-
250
- ## 1.2.7
251
- Tue, 23 Mar 2021 16:17:57 GMT
252
-
253
- ### Patches
254
-
255
- - Change .component-selectable-content to block to display to fix resize flicker.
256
-
257
- ## 1.2.6
258
- Fri, 26 Feb 2021 18:43:33 GMT
259
-
260
- ### Patches
261
-
262
- - Fixes for models tree not loading models when using show all, invert and other toggles
263
-
264
- ## 1.2.5
265
- Tue, 15 Dec 2020 13:51:37 GMT
266
-
267
- ### Patches
268
-
269
- - Fix styling issues in search bar
270
-
271
- ## 1.2.4
272
- Wed, 09 Dec 2020 19:09:13 GMT
273
-
274
- ### Patches
275
-
276
- - Fixing resizing issues with the SearchBox in Model tree
277
-
278
- ## 1.2.3
279
- Tue, 25 Aug 2020 16:57:36 GMT
280
-
281
- ### Patches
282
-
283
- - rm unecessary dep on react-scripts
284
-
285
- ## 1.2.2
286
- Mon, 24 Aug 2020 17:39:24 GMT
287
-
288
- ### Patches
289
-
290
- - alphabetize package.json
291
-
292
- ## 1.2.1
293
- Fri, 21 Aug 2020 21:17:48 GMT
294
-
295
- ### Patches
296
-
297
- - readme update
298
- - support replacing model/category/spatial trees in TreeWidgetControl
299
-
300
- ## 1.2.0
301
- Tue, 11 Aug 2020 14:24:07 GMT
302
-
303
- ### Minor changes
304
-
305
- - Added 2D / 3D toggle to tree view header
306
-
307
- ### Patches
308
-
309
- - Decouple tree header for using in other widgets
310
-
311
- ## 1.1.1
312
- Tue, 28 Jul 2020 22:10:32 GMT
313
-
314
- ### Patches
315
-
316
- - Fixes for tree widgets consistency: Category tree invert functionality, tooltips on buttons and fix for iFrame height of tree not defined properly
317
-
318
- ## 1.1.0
319
- Tue, 14 Jul 2020 22:54:18 GMT
320
-
321
- ### Minor changes
322
-
323
- - "Add classifications tree."
324
- - Added in tree-widget package
325
- - Replacing ThemedSelect component with SelectableContent component
326
-
327
- ### Patches
328
-
329
- - Functional component.
330
- - Model tree search box will now properly clear itself in addition to closing when its "X" icon is hit
226
+ - iTwin.js 3.0 first rc.
331
227
 
@@ -7,6 +7,7 @@ import type { LocalizationOptions } from "@itwin/core-i18n";
7
7
  export declare class TreeWidget {
8
8
  private static _i18n?;
9
9
  private static _initialized?;
10
+ private static _dispose?;
10
11
  /**
11
12
  * Called by IModelApp to initialize the Tree Widget
12
13
  * @param i18n - The internationalization service created by the IModelApp.
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.TreeWidget = void 0;
8
8
  const appui_abstract_1 = require("@itwin/appui-abstract");
9
9
  const core_frontend_1 = require("@itwin/core-frontend");
10
+ const Utils_1 = require("./components/trees/common/Utils");
10
11
  /**
11
12
  * Entry point for static initialization required by various components used in the package.
12
13
  * @public
@@ -21,13 +22,19 @@ class TreeWidget {
21
22
  return;
22
23
  TreeWidget._initialized = true;
23
24
  TreeWidget._i18n = i18n ?? core_frontend_1.IModelApp.localization;
25
+ TreeWidget._dispose = (0, Utils_1.registerRenderers)();
24
26
  return TreeWidget._i18n.registerNamespace(TreeWidget.i18nNamespace);
25
27
  }
26
28
  /** Unregisters the TreeWidget internationalization service namespace */
27
29
  static terminate() {
28
- if (TreeWidget._i18n)
29
- TreeWidget._i18n.unregisterNamespace(TreeWidget.i18nNamespace); // eslint-disable-line @itwin/no-internal
30
- TreeWidget._i18n = undefined;
30
+ if (TreeWidget._i18n) {
31
+ TreeWidget._i18n.unregisterNamespace(TreeWidget.i18nNamespace);
32
+ TreeWidget._i18n = undefined;
33
+ }
34
+ if (TreeWidget._dispose) {
35
+ TreeWidget._dispose();
36
+ TreeWidget._dispose = undefined;
37
+ }
31
38
  TreeWidget._initialized = false;
32
39
  }
33
40
  /** The internationalization service created by the IModelApp. */
@@ -1 +1 @@
1
- {"version":3,"file":"TreeWidget.js","sourceRoot":"","sources":["../../src/TreeWidget.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAAgD;AAChD,wDAAiD;AAKjD;;;GAGG;AACH,MAAa,UAAU;IAIrB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAmB;QAChD,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAE9B,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC;QAC/B,UAAU,CAAC,KAAK,GAAG,IAAI,IAAI,yBAAS,CAAC,YAAY,CAAC;QAElD,OAAO,UAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,wEAAwE;IACjE,MAAM,CAAC,SAAS;QACrB,IAAI,UAAU,CAAC,KAAK;YAClB,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,yCAAyC;QAC3G,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC;QAC7B,UAAU,CAAC,YAAY,GAAG,KAAK,CAAC;IAClC,CAAC;IAED,iEAAiE;IAC1D,MAAM,KAAK,IAAI;QACpB,IAAI,CAAC,UAAU,CAAC,KAAK;YACnB,MAAM,IAAI,wBAAO,CACf,UAAU,CAAC,WAAW,EACtB,4BAA4B,CAC7B,CAAC;QACJ,OAAO,UAAU,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,aAAa;QAC7B,OAAO,YAAY,CAAC;IACtB,CAAC;IAEM,MAAM,KAAK,WAAW;QAC3B,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED;OACG;IACI,MAAM,CAAC,SAAS,CACrB,GAAsB,EACtB,OAA6B;QAE7B,MAAM,SAAS,GAAG,GAAG,UAAU,CAAC,aAAa,IAAI,GAAG,EAAE,CAAC;QACvD,OAAO,UAAU,CAAC,IAAI,CAAC,kBAAkB,CACvC,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAxDD,gCAwDC","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 { UiError } from \"@itwin/appui-abstract\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\nimport type { Localization } from \"@itwin/core-common\";\nimport type { LocalizationOptions } from \"@itwin/core-i18n\";\n\n/**\n * Entry point for static initialization required by various components used in the package.\n * @public\n */\nexport class TreeWidget {\n private static _i18n?: Localization;\n private static _initialized?: boolean;\n\n /**\n * Called by IModelApp to initialize the Tree Widget\n * @param i18n - The internationalization service created by the IModelApp.\n */\n public static async initialize(i18n?: Localization): Promise<void> {\n if (this._initialized) return;\n\n TreeWidget._initialized = true;\n TreeWidget._i18n = i18n ?? IModelApp.localization;\n\n return TreeWidget._i18n.registerNamespace(TreeWidget.i18nNamespace);\n }\n\n /** Unregisters the TreeWidget internationalization service namespace */\n public static terminate() {\n if (TreeWidget._i18n)\n TreeWidget._i18n.unregisterNamespace(TreeWidget.i18nNamespace); // eslint-disable-line @itwin/no-internal\n TreeWidget._i18n = undefined;\n TreeWidget._initialized = false;\n }\n\n /** The internationalization service created by the IModelApp. */\n public static get i18n(): Localization {\n if (!TreeWidget._i18n)\n throw new UiError(\n TreeWidget.packageName,\n \"TreeWidget not initialized\"\n );\n return TreeWidget._i18n;\n }\n\n /** The internationalization service namespace. */\n public static get i18nNamespace(): string {\n return \"TreeWidget\";\n }\n\n public static get packageName(): string {\n return \"tree-widget-react\";\n }\n\n /** Calls i18n.translateWithNamespace with the \"TreeWidget\" namespace. Do NOT include the namespace in the key.\n */\n public static translate(\n key: string | string[],\n options?: LocalizationOptions\n ): string {\n const stringKey = `${TreeWidget.i18nNamespace}:${key}`;\n return TreeWidget.i18n.getLocalizedString(\n stringKey,\n options\n );\n }\n}\n"]}
1
+ {"version":3,"file":"TreeWidget.js","sourceRoot":"","sources":["../../src/TreeWidget.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,0DAAgD;AAChD,wDAAiD;AACjD,2DAAoE;AAKpE;;;GAGG;AACH,MAAa,UAAU;IAKrB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAmB;QAChD,IAAI,IAAI,CAAC,YAAY;YAAE,OAAO;QAE9B,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC;QAC/B,UAAU,CAAC,KAAK,GAAG,IAAI,IAAI,yBAAS,CAAC,YAAY,CAAC;QAClD,UAAU,CAAC,QAAQ,GAAG,IAAA,yBAAiB,GAAE,CAAC;QAC1C,OAAO,UAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACtE,CAAC;IAED,wEAAwE;IACjE,MAAM,CAAC,SAAS;QACrB,IAAI,UAAU,CAAC,KAAK,EAAE;YACpB,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAC/D,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC;SAC9B;QAED,IAAI,UAAU,CAAC,QAAQ,EAAE;YACvB,UAAU,CAAC,QAAQ,EAAE,CAAC;YACtB,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC;SACjC;QAED,UAAU,CAAC,YAAY,GAAG,KAAK,CAAC;IAClC,CAAC;IAED,iEAAiE;IAC1D,MAAM,KAAK,IAAI;QACpB,IAAI,CAAC,UAAU,CAAC,KAAK;YACnB,MAAM,IAAI,wBAAO,CACf,UAAU,CAAC,WAAW,EACtB,4BAA4B,CAC7B,CAAC;QACJ,OAAO,UAAU,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,kDAAkD;IAC3C,MAAM,KAAK,aAAa;QAC7B,OAAO,YAAY,CAAC;IACtB,CAAC;IAEM,MAAM,KAAK,WAAW;QAC3B,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED;OACG;IACI,MAAM,CAAC,SAAS,CACrB,GAAsB,EACtB,OAA6B;QAE7B,MAAM,SAAS,GAAG,GAAG,UAAU,CAAC,aAAa,IAAI,GAAG,EAAE,CAAC;QACvD,OAAO,UAAU,CAAC,IAAI,CAAC,kBAAkB,CACvC,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAhED,gCAgEC","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 { UiError } from \"@itwin/appui-abstract\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { registerRenderers } from \"./components/trees/common/Utils\";\n\nimport type { Localization } from \"@itwin/core-common\";\nimport type { LocalizationOptions } from \"@itwin/core-i18n\";\n\n/**\n * Entry point for static initialization required by various components used in the package.\n * @public\n */\nexport class TreeWidget {\n private static _i18n?: Localization;\n private static _initialized?: boolean;\n private static _dispose?: () => void;\n\n /**\n * Called by IModelApp to initialize the Tree Widget\n * @param i18n - The internationalization service created by the IModelApp.\n */\n public static async initialize(i18n?: Localization): Promise<void> {\n if (this._initialized) return;\n\n TreeWidget._initialized = true;\n TreeWidget._i18n = i18n ?? IModelApp.localization;\n TreeWidget._dispose = registerRenderers();\n return TreeWidget._i18n.registerNamespace(TreeWidget.i18nNamespace);\n }\n\n /** Unregisters the TreeWidget internationalization service namespace */\n public static terminate() {\n if (TreeWidget._i18n) {\n TreeWidget._i18n.unregisterNamespace(TreeWidget.i18nNamespace);\n TreeWidget._i18n = undefined;\n }\n\n if (TreeWidget._dispose) {\n TreeWidget._dispose();\n TreeWidget._dispose = undefined;\n }\n\n TreeWidget._initialized = false;\n }\n\n /** The internationalization service created by the IModelApp. */\n public static get i18n(): Localization {\n if (!TreeWidget._i18n)\n throw new UiError(\n TreeWidget.packageName,\n \"TreeWidget not initialized\"\n );\n return TreeWidget._i18n;\n }\n\n /** The internationalization service namespace. */\n public static get i18nNamespace(): string {\n return \"TreeWidget\";\n }\n\n public static get packageName(): string {\n return \"tree-widget-react\";\n }\n\n /** Calls i18n.translateWithNamespace with the \"TreeWidget\" namespace. Do NOT include the namespace in the key.\n */\n public static translate(\n key: string | string[],\n options?: LocalizationOptions\n ): string {\n const stringKey = `${TreeWidget.i18nNamespace}:${key}`;\n return TreeWidget.i18n.getLocalizedString(\n stringKey,\n options\n );\n }\n}\n"]}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
- @import "~@itwin/itwinui-variables";
6
5
 
7
6
  .tree-widget-selectable-tree {
8
7
  padding: var(--iui-size-xs);
@@ -3,109 +3,80 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
 
6
- .tree-widget-tree-with-header {
7
- width: 100%;
8
- height: 100%;
9
-
10
- .tree-widget-tree-header {
11
- height: var(--iui-size-xl);
12
- }
13
-
14
- .tree-widget-tree-content {
15
- height: calc(100% - var(--iui-size-xl));
16
- }
17
- }
18
-
19
6
  .tree-widget-visibility-tree-base {
20
- height: 100%;
21
- width: 100%;
22
- display: flex;
23
- flex-direction: column;
24
- position: relative;
25
-
26
- .ReactWindow__VariableSizeList {
27
- >div {
28
- min-width: max-content !important; // to override inline class
29
- }
30
- }
31
- .core-tree-node {
32
- &.with-checkbox {
33
- >.contents {
34
- padding-left: calc(var(--iui-size-3xs) / 2);
7
+ .tree-widget-tree-nodes-list {
8
+ .core-tree-node {
9
+ &.with-checkbox {
10
+ >.contents {
11
+ padding-left: calc(var(--iui-size-3xs) / 2);
12
+ }
35
13
  }
36
- }
37
14
 
38
- &.disable-expander {
39
- >.contents {
40
- >.core-tree-expansionToggle {
41
- display: none;
15
+ &.disable-expander {
16
+ >.contents {
17
+ >.core-tree-expansionToggle {
18
+ display: none;
19
+ }
42
20
  }
43
21
  }
44
- }
45
22
 
46
- &.is-selected {
47
- >.contents {
48
- >.visibility-tree-checkbox-container {
49
- background-color: var(--iui-color-background-accent-muted)
23
+ &.is-selected {
24
+ >.contents {
25
+ >.visibility-tree-checkbox-container {
26
+ background-color: var(--iui-color-background-accent-muted)
27
+ }
50
28
  }
51
29
  }
52
- }
53
- }
54
30
 
55
- .contents {
56
- &:hover {
57
- > .visibility-tree-checkbox-container {
58
- background-color: var(--iui-color-background-hover);
31
+ .contents {
32
+ &:hover {
33
+ .visibility-tree-checkbox-container {
34
+ background-color: var(--iui-color-background-hover);
35
+ }
36
+ }
59
37
  }
60
- }
61
38
 
62
- > .visibility-tree-checkbox-container {
63
- height: var(--iui-size-l);
64
- width: var(--iui-size-l);
65
- position: sticky;
66
- order: -1;
67
- left: 0;
68
- background-color: var(--iui-color-background);
69
- z-index: 1;
70
- display: flex;
71
- align-items: center;
72
- justify-content: center;
39
+ .visibility-tree-checkbox-container {
40
+ height: var(--iui-size-l);
41
+ width: var(--iui-size-l);
42
+ position: sticky;
43
+ order: -1;
44
+ left: 0;
45
+ background-color: var(--iui-color-background);
46
+ z-index: 1;
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: center;
73
50
 
74
- .visibility-tree-checkbox {
75
- &:disabled {
76
- background-color: transparent;
77
- }
51
+ .visibility-tree-checkbox {
52
+ &:disabled {
53
+ background-color: transparent;
54
+ }
78
55
 
79
- &:hover {
80
- background-color: transparent;
56
+ &:hover {
57
+ background-color: transparent;
58
+ }
81
59
  }
82
60
  }
83
61
  }
84
- }
85
62
 
86
- .filteredTreeOverlay {
87
- position: absolute;
88
- top: 0;
89
- left: 0;
90
- width: 100%;
91
- height: 100%;
92
- z-index: 9999;
93
- background-color: hsl(var(--iui-color-background) / var(--iui-opacity-2));
94
- }
63
+ &.enlarge {
64
+ .core-tree-node {
65
+ .visibility-tree-checkbox-container {
66
+ height: var(--enlarged-node-height);
67
+ width: var(--enlarged-node-height);
95
68
 
96
- .components-tree-errormessage {
97
- position: absolute;
98
- top: 40%;
99
- left: 50%;
100
- width: 75%;
101
- text-align: center;
102
- transform: translate(-50%, -50%);
103
- font-style: italic;
104
- color: var(--iui-color-text-muted);
69
+ .visibility-tree-checkbox {
70
+ --iui-checkbox-target-size: var(--enlarged-node-height);
71
+ }
72
+ }
73
+ }
105
74
 
106
- .errormessage-header {
107
- display: block;
108
- font-weight: bold;
75
+ .without-expander {
76
+ .visibility-tree-checkbox-container+* {
77
+ margin-left: var(--enlarged-node-expander-additional-padding);
78
+ }
79
+ }
109
80
  }
110
81
  }
111
82
  }
@@ -1,13 +1,14 @@
1
1
  /// <reference types="react" />
2
+ import type { TreeRendererBaseProps } from "./common/TreeRenderer";
2
3
  import type { AbstractTreeNodeLoaderWithProvider, TreeNodeRendererProps, TreeRendererProps } from "@itwin/components-react";
3
4
  import type { NodeCheckboxRenderProps } from "@itwin/core-react";
4
5
  import type { IPresentationTreeDataProvider } from "@itwin/presentation-components";
5
- import type { VisibilityTreeFilterInfo } from "./Common";
6
+ import type { VisibilityTreeFilterInfo } from "./common/Types";
6
7
  /**
7
8
  * Props for visibility tree renderer.
8
9
  * @public
9
10
  */
10
- export interface VisibilityTreeRendererProps {
11
+ export interface VisibilityTreeRendererProps extends TreeRendererBaseProps {
11
12
  /** Props for single node renderer. */
12
13
  nodeRendererProps: VisibilityTreeNodeRendererProps;
13
14
  }
@@ -39,7 +40,7 @@ export interface VisibilityTreeNodeRendererProps {
39
40
  * Creates Visibility tree renderer which renders nodes with eye checkbox.
40
41
  * @public
41
42
  */
42
- export declare function createVisibilityTreeRenderer({ nodeRendererProps }: VisibilityTreeRendererProps): (props: TreeRendererProps) => JSX.Element;
43
+ export declare function createVisibilityTreeRenderer({ nodeRendererProps, ...restProps }: VisibilityTreeRendererProps): (treeProps: TreeRendererProps) => JSX.Element;
43
44
  /**
44
45
  * Creates node renderer which renders node with eye checkbox.
45
46
  * @public
@@ -9,11 +9,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
9
9
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
10
10
  * See LICENSE.md in the project root for license terms and full copyright notice.
11
11
  *--------------------------------------------------------------------------------------------*/
12
+ const classnames_1 = __importDefault(require("classnames"));
12
13
  const react_1 = require("react");
13
14
  const components_react_1 = require("@itwin/components-react");
14
15
  const itwinui_react_1 = require("@itwin/itwinui-react");
15
16
  const presentation_components_1 = require("@itwin/presentation-components");
16
- const classnames_1 = __importDefault(require("classnames"));
17
+ const TreeRenderer_1 = require("./common/TreeRenderer");
17
18
  /**
18
19
  * This constant is taken from `@itwin/core-react`.
19
20
  * Defines the size in pixels of the expansion toggle.
@@ -25,9 +26,9 @@ const EXPANSION_TOGGLE_WIDTH = 24;
25
26
  * Creates Visibility tree renderer which renders nodes with eye checkbox.
26
27
  * @public
27
28
  */
28
- function createVisibilityTreeRenderer({ nodeRendererProps }) {
29
- return function VisibilityTreeRenderer(props) {
30
- return ((0, jsx_runtime_1.jsx)(components_react_1.TreeRenderer, { ...props, nodeRenderer: createVisibilityTreeNodeRenderer(nodeRendererProps) }));
29
+ function createVisibilityTreeRenderer({ nodeRendererProps, ...restProps }) {
30
+ return function VisibilityTreeRenderer(treeProps) {
31
+ return (0, jsx_runtime_1.jsx)(TreeRenderer_1.TreeRenderer, { ...treeProps, ...restProps, nodeRenderer: createVisibilityTreeNodeRenderer(nodeRendererProps) });
31
32
  };
32
33
  }
33
34
  exports.createVisibilityTreeRenderer = createVisibilityTreeRenderer;