@itwin/tree-widget-react 0.10.0-dev.1 → 1.0.0-dev.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.
- package/CHANGELOG.md +331 -0
- package/README.md +146 -29
- package/lib/cjs/TreeWidget.d.ts +0 -1
- package/lib/cjs/TreeWidget.js +1 -6
- package/lib/cjs/TreeWidget.js.map +1 -1
- package/lib/cjs/components/TreeFilteringState.d.ts +3 -1
- package/lib/cjs/components/TreeFilteringState.js +19 -40
- package/lib/cjs/components/TreeFilteringState.js.map +1 -1
- package/lib/cjs/components/TreeWidgetComponent.d.ts +29 -5
- package/lib/cjs/components/TreeWidgetComponent.js +85 -29
- package/lib/cjs/components/TreeWidgetComponent.js.map +1 -1
- package/lib/cjs/components/TreeWidgetComponent.scss +4 -24
- package/lib/cjs/components/TreeWidgetUiItemsProvider.d.ts +25 -2
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js +31 -46
- package/lib/cjs/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/cjs/components/tree-header/TreeHeader.d.ts +26 -0
- package/lib/cjs/components/tree-header/TreeHeader.js +43 -0
- package/lib/cjs/components/tree-header/TreeHeader.js.map +1 -0
- package/lib/cjs/components/tree-header/TreeHeader.scss +69 -0
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.d.ts +12 -6
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.js +10 -4
- package/lib/cjs/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/cjs/components/trees/Common.d.ts +2 -2
- package/lib/cjs/components/trees/Common.js +1 -1
- package/lib/cjs/components/trees/Common.js.map +1 -1
- package/lib/cjs/components/trees/VisibilityTreeBase.scss +66 -10
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.d.ts +13 -12
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js +6 -17
- package/lib/cjs/components/trees/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/cjs/components/trees/VisibilityTreeRenderer.d.ts +38 -14
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js +35 -41
- package/lib/cjs/components/trees/VisibilityTreeRenderer.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTree.d.ts +12 -11
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js +17 -41
- package/lib/cjs/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.d.ts +67 -6
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js +61 -72
- package/lib/cjs/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.d.ts +30 -8
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js +61 -34
- package/lib/cjs/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/cjs/components/trees/external-sources-tree/ExternalSources.json +230 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +27 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js +61 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +20 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +39 -0
- package/lib/cjs/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.d.ts +30 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js +39 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +26 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.js +35 -0
- package/lib/cjs/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -0
- package/lib/cjs/components/trees/index.d.ts +5 -1
- package/lib/cjs/components/trees/index.js +10 -2
- package/lib/cjs/components/trees/index.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTree.d.ts +26 -18
- package/lib/cjs/components/trees/models-tree/ModelsTree.js +22 -50
- package/lib/cjs/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.d.ts +70 -2
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js +68 -105
- package/lib/cjs/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.d.ts +40 -12
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js +65 -5
- package/lib/cjs/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/cjs/components/trees/models-tree/Utils.d.ts +12 -0
- package/lib/cjs/components/trees/models-tree/Utils.js +625 -1
- package/lib/cjs/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/cjs/components/utils/AutoSizer.d.ts +6 -3
- package/lib/cjs/components/utils/AutoSizer.js +9 -29
- package/lib/cjs/components/utils/AutoSizer.js.map +1 -1
- package/lib/cjs/components/utils/IsPromiseLike.d.ts +4 -1
- package/lib/cjs/components/utils/IsPromiseLike.js +6 -3
- package/lib/cjs/components/utils/IsPromiseLike.js.map +1 -1
- package/lib/cjs/tree-widget-react.d.ts +0 -1
- package/lib/cjs/tree-widget-react.js +5 -2
- package/lib/cjs/tree-widget-react.js.map +1 -1
- package/lib/esm/TreeWidget.d.ts +0 -1
- package/lib/esm/TreeWidget.js +2 -7
- package/lib/esm/TreeWidget.js.map +1 -1
- package/lib/esm/components/TreeFilteringState.d.ts +3 -1
- package/lib/esm/components/TreeFilteringState.js +17 -19
- package/lib/esm/components/TreeFilteringState.js.map +1 -1
- package/lib/esm/components/TreeWidgetComponent.d.ts +29 -5
- package/lib/esm/components/TreeWidgetComponent.js +82 -7
- package/lib/esm/components/TreeWidgetComponent.js.map +1 -1
- package/lib/esm/components/TreeWidgetComponent.scss +4 -24
- package/lib/esm/components/TreeWidgetUiItemsProvider.d.ts +25 -2
- package/lib/esm/components/TreeWidgetUiItemsProvider.js +29 -41
- package/lib/esm/components/TreeWidgetUiItemsProvider.js.map +1 -1
- package/lib/esm/components/tree-header/TreeHeader.d.ts +26 -0
- package/lib/esm/components/tree-header/TreeHeader.js +36 -0
- package/lib/esm/components/tree-header/TreeHeader.js.map +1 -0
- package/lib/esm/components/tree-header/TreeHeader.scss +69 -0
- package/lib/esm/components/trees/CategoriesVisibilityUtils.d.ts +12 -6
- package/lib/esm/components/trees/CategoriesVisibilityUtils.js +10 -4
- package/lib/esm/components/trees/CategoriesVisibilityUtils.js.map +1 -1
- package/lib/esm/components/trees/Common.d.ts +2 -2
- package/lib/esm/components/trees/Common.js +1 -1
- package/lib/esm/components/trees/Common.js.map +1 -1
- package/lib/esm/components/trees/VisibilityTreeBase.scss +66 -10
- package/lib/esm/components/trees/VisibilityTreeEventHandler.d.ts +13 -12
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js +6 -17
- package/lib/esm/components/trees/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/esm/components/trees/VisibilityTreeRenderer.d.ts +38 -14
- package/lib/esm/components/trees/VisibilityTreeRenderer.js +29 -19
- package/lib/esm/components/trees/VisibilityTreeRenderer.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTree.d.ts +12 -11
- package/lib/esm/components/trees/category-tree/CategoriesTree.js +16 -21
- package/lib/esm/components/trees/category-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.d.ts +67 -6
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js +60 -52
- package/lib/esm/components/trees/category-tree/CategoriesTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.d.ts +30 -8
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js +57 -14
- package/lib/esm/components/trees/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/esm/components/trees/external-sources-tree/ExternalSources.json +230 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.d.ts +27 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js +34 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTree.js.map +1 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.d.ts +20 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js +35 -0
- package/lib/esm/components/trees/external-sources-tree/ExternalSourcesTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.d.ts +30 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js +32 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTree.js.map +1 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.d.ts +26 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.js +31 -0
- package/lib/esm/components/trees/imodel-content-tree/IModelContentTreeComponent.js.map +1 -0
- package/lib/esm/components/trees/index.d.ts +5 -1
- package/lib/esm/components/trees/index.js +5 -1
- package/lib/esm/components/trees/index.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTree.d.ts +26 -18
- package/lib/esm/components/trees/models-tree/ModelsTree.js +23 -32
- package/lib/esm/components/trees/models-tree/ModelsTree.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.d.ts +70 -2
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js +66 -84
- package/lib/esm/components/trees/models-tree/ModelsTreeComponent.js.map +1 -1
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.d.ts +40 -12
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js +60 -5
- package/lib/esm/components/trees/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/esm/components/trees/models-tree/Utils.d.ts +12 -0
- package/lib/esm/components/trees/models-tree/Utils.js +622 -0
- package/lib/esm/components/trees/models-tree/Utils.js.map +1 -1
- package/lib/esm/components/utils/AutoSizer.d.ts +6 -3
- package/lib/esm/components/utils/AutoSizer.js +9 -10
- package/lib/esm/components/utils/AutoSizer.js.map +1 -1
- package/lib/esm/components/utils/IsPromiseLike.d.ts +4 -1
- package/lib/esm/components/utils/IsPromiseLike.js +4 -1
- package/lib/esm/components/utils/IsPromiseLike.js.map +1 -1
- package/lib/esm/tree-widget-react.d.ts +0 -1
- package/lib/esm/tree-widget-react.js +0 -1
- package/lib/esm/tree-widget-react.js.map +1 -1
- package/lib/public/locales/en/TreeWidget.json +13 -4
- package/package.json +61 -66
- package/lib/cjs/components/rulesets/ClassificationSystems.json +0 -122
- package/lib/cjs/components/search-bar/SearchBar.d.ts +0 -48
- package/lib/cjs/components/search-bar/SearchBar.js +0 -86
- package/lib/cjs/components/search-bar/SearchBar.js.map +0 -1
- package/lib/cjs/components/search-bar/SearchBar.scss +0 -118
- package/lib/cjs/components/search-bar/SearchBox.d.ts +0 -70
- package/lib/cjs/components/search-bar/SearchBox.js +0 -186
- package/lib/cjs/components/search-bar/SearchBox.js.map +0 -1
- package/lib/cjs/components/search-bar/SearchBox.scss +0 -70
- package/lib/cjs/components/trees/IModelContentTree.d.ts +0 -4
- package/lib/cjs/components/trees/IModelContentTree.js +0 -50
- package/lib/cjs/components/trees/IModelContentTree.js.map +0 -1
- package/lib/cjs/components/trees/models-tree/Hierarchy.GroupedByClass.json +0 -391
- package/lib/cjs/components/trees/models-tree/Hierarchy.json +0 -386
- package/lib/cjs/components/trees/models-tree/ModelsTreeSearch.json +0 -239
- package/lib/cjs/types.d.ts +0 -44
- package/lib/cjs/types.js +0 -11
- package/lib/cjs/types.js.map +0 -1
- package/lib/esm/components/rulesets/ClassificationSystems.json +0 -122
- package/lib/esm/components/search-bar/SearchBar.d.ts +0 -48
- package/lib/esm/components/search-bar/SearchBar.js +0 -60
- package/lib/esm/components/search-bar/SearchBar.js.map +0 -1
- package/lib/esm/components/search-bar/SearchBar.scss +0 -118
- package/lib/esm/components/search-bar/SearchBox.d.ts +0 -70
- package/lib/esm/components/search-bar/SearchBox.js +0 -160
- package/lib/esm/components/search-bar/SearchBox.js.map +0 -1
- package/lib/esm/components/search-bar/SearchBox.scss +0 -70
- package/lib/esm/components/trees/IModelContentTree.d.ts +0 -4
- package/lib/esm/components/trees/IModelContentTree.js +0 -24
- package/lib/esm/components/trees/IModelContentTree.js.map +0 -1
- package/lib/esm/components/trees/models-tree/Hierarchy.GroupedByClass.json +0 -391
- package/lib/esm/components/trees/models-tree/Hierarchy.json +0 -386
- package/lib/esm/components/trees/models-tree/ModelsTreeSearch.json +0 -239
- package/lib/esm/types.d.ts +0 -44
- package/lib/esm/types.js +0 -8
- package/lib/esm/types.js.map +0 -1
- /package/lib/cjs/components/{rulesets → trees/imodel-content-tree}/IModelContent.json +0 -0
- /package/lib/esm/components/{rulesets → trees/imodel-content-tree}/IModelContent.json +0 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../../node_modules/@itwin/presentation-common/Ruleset.schema.json",
|
|
3
|
+
"id": "tree-widget-react/ExternalSources",
|
|
4
|
+
"requiredSchemas": [
|
|
5
|
+
{
|
|
6
|
+
"name": "BisCore",
|
|
7
|
+
"minVersion": "1.0.13"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"rules": [
|
|
11
|
+
{
|
|
12
|
+
"ruleType": "RootNodes",
|
|
13
|
+
"specifications": [
|
|
14
|
+
{
|
|
15
|
+
"specType": "InstanceNodesOfSpecificClasses",
|
|
16
|
+
"classes": [
|
|
17
|
+
{
|
|
18
|
+
"schemaName": "BisCore",
|
|
19
|
+
"classNames": [
|
|
20
|
+
"ExternalSource"
|
|
21
|
+
],
|
|
22
|
+
"arePolymorphic": false
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"relatedInstances": [
|
|
26
|
+
{
|
|
27
|
+
"relationshipPath": [
|
|
28
|
+
{
|
|
29
|
+
"relationship": {
|
|
30
|
+
"schemaName": "BisCore",
|
|
31
|
+
"className": "SynchronizationConfigSpecifiesRootSources"
|
|
32
|
+
},
|
|
33
|
+
"direction": "Backward"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"isRequired": true,
|
|
37
|
+
"alias": "configRoot"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"relationshipPath": [
|
|
41
|
+
{
|
|
42
|
+
"relationship": {
|
|
43
|
+
"schemaName": "BisCore",
|
|
44
|
+
"className": "ExternalSourceIsInRepository"
|
|
45
|
+
},
|
|
46
|
+
"direction": "Forward"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"isRequired": true,
|
|
50
|
+
"alias": "repo"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"instanceFilter": "configRoot.ECInstanceId <> NULL",
|
|
54
|
+
"groupByClass": false,
|
|
55
|
+
"groupByLabel": false
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"autoExpand": true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"ruleType": "ChildNodes",
|
|
62
|
+
"condition": "ParentNode.IsOfClass(\"ExternalSourceGroup\", \"BisCore\")",
|
|
63
|
+
"specifications": [
|
|
64
|
+
{
|
|
65
|
+
"specType": "RelatedInstanceNodes",
|
|
66
|
+
"relationshipPaths": [
|
|
67
|
+
[
|
|
68
|
+
{
|
|
69
|
+
"relationship": {
|
|
70
|
+
"schemaName": "BisCore",
|
|
71
|
+
"className": "ExternalSourceGroupGroupsSources"
|
|
72
|
+
},
|
|
73
|
+
"direction": "Forward"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
],
|
|
77
|
+
"groupByClass": false,
|
|
78
|
+
"groupByLabel": false
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"ruleType": "ChildNodes",
|
|
84
|
+
"condition": "ParentNode.IsOfClass(\"ExternalSource\", \"BisCore\")",
|
|
85
|
+
"specifications": [
|
|
86
|
+
{
|
|
87
|
+
"specType": "RelatedInstanceNodes",
|
|
88
|
+
"relationshipPaths": [
|
|
89
|
+
[
|
|
90
|
+
{
|
|
91
|
+
"relationship": {
|
|
92
|
+
"schemaName": "BisCore",
|
|
93
|
+
"className": "ExternalSourceOwnsAttachments"
|
|
94
|
+
},
|
|
95
|
+
"direction": "Forward"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"relationship": {
|
|
99
|
+
"schemaName": "BisCore",
|
|
100
|
+
"className": "ExternalSourceAttachmentAttachesSource"
|
|
101
|
+
},
|
|
102
|
+
"direction": "Forward"
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
],
|
|
106
|
+
"groupByClass": false,
|
|
107
|
+
"groupByLabel": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"specType": "CustomNode",
|
|
111
|
+
"type": "T_ExternalSource_Elements",
|
|
112
|
+
"label": "Elements",
|
|
113
|
+
"hideIfNoChildren": true,
|
|
114
|
+
"nestedRules": [
|
|
115
|
+
{
|
|
116
|
+
"ruleType": "ChildNodes",
|
|
117
|
+
"specifications": [
|
|
118
|
+
{
|
|
119
|
+
"specType": "RelatedInstanceNodes",
|
|
120
|
+
"relationshipPaths": [
|
|
121
|
+
[
|
|
122
|
+
{
|
|
123
|
+
"relationship": {
|
|
124
|
+
"schemaName": "BisCore",
|
|
125
|
+
"className": "ElementIsFromSource"
|
|
126
|
+
},
|
|
127
|
+
"direction": "Backward",
|
|
128
|
+
"targetClass": {
|
|
129
|
+
"schemaName": "BisCore",
|
|
130
|
+
"className": "ExternalSourceAspect"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"relationship": {
|
|
135
|
+
"schemaName": "BisCore",
|
|
136
|
+
"className": "ElementOwnsMultiAspects"
|
|
137
|
+
},
|
|
138
|
+
"direction": "Backward",
|
|
139
|
+
"targetClass": {
|
|
140
|
+
"schemaName": "BisCore",
|
|
141
|
+
"className": "GeometricElement"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
],
|
|
146
|
+
"groupByClass": true,
|
|
147
|
+
"groupByLabel": false
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"ruleType": "InstanceLabelOverride",
|
|
157
|
+
"class": {
|
|
158
|
+
"schemaName": "BisCore",
|
|
159
|
+
"className": "RepositoryLink"
|
|
160
|
+
},
|
|
161
|
+
"values": [
|
|
162
|
+
{
|
|
163
|
+
"specType": "Property",
|
|
164
|
+
"propertyName": "UserLabel"
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"ruleType": "InstanceLabelOverride",
|
|
170
|
+
"class": {
|
|
171
|
+
"schemaName": "BisCore",
|
|
172
|
+
"className": "ExternalSource"
|
|
173
|
+
},
|
|
174
|
+
"values": [
|
|
175
|
+
{
|
|
176
|
+
"specType": "Composite",
|
|
177
|
+
"separator": " - ",
|
|
178
|
+
"parts": [
|
|
179
|
+
{
|
|
180
|
+
"spec": {
|
|
181
|
+
"specType": "RelatedInstanceLabel",
|
|
182
|
+
"pathToRelatedInstance": {
|
|
183
|
+
"relationship": {
|
|
184
|
+
"schemaName": "BisCore",
|
|
185
|
+
"className": "ExternalSourceIsInRepository"
|
|
186
|
+
},
|
|
187
|
+
"direction": "Forward"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"spec": {
|
|
193
|
+
"specType": "Property",
|
|
194
|
+
"propertyName": "UserLabel"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"ruleType": "ExtendedData",
|
|
203
|
+
"condition": "ThisNode.IsInstanceNode ANDALSO this.IsOfClass(\"ExternalSource\", \"BisCore\")",
|
|
204
|
+
"items": {
|
|
205
|
+
"imageId": "\"icon-document\""
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"ruleType": "ExtendedData",
|
|
210
|
+
"condition": "ThisNode.Type = \"T_ExternalSource_Elements\"",
|
|
211
|
+
"items": {
|
|
212
|
+
"imageId": "\"icon-ec-schema\""
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"ruleType": "ExtendedData",
|
|
217
|
+
"condition": "ThisNode.IsClassGroupingNode",
|
|
218
|
+
"items": {
|
|
219
|
+
"imageId": "\"icon-ec-class\""
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"ruleType": "ExtendedData",
|
|
224
|
+
"condition": "ThisNode.IsInstanceNode ANDALSO ThisNode.IsOfClass(\"GeometricElement\", \"BisCore\")",
|
|
225
|
+
"items": {
|
|
226
|
+
"imageId": "\"icon-item\""
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "../VisibilityTreeBase.scss";
|
|
3
|
+
import type { IModelConnection } from "@itwin/core-frontend";
|
|
4
|
+
import type { Ruleset } from "@itwin/presentation-common";
|
|
5
|
+
/**
|
|
6
|
+
* Presentation rules used by ControlledCategoriesTree
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const RULESET_EXTERNAL_SOURCES: Ruleset;
|
|
10
|
+
/**
|
|
11
|
+
* Props for the [[ExternalSourcesTree]] component
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export interface ExternalSourcesTreeProps {
|
|
15
|
+
/** An IModel to pull data from */
|
|
16
|
+
iModel: IModelConnection;
|
|
17
|
+
/** Width of the component */
|
|
18
|
+
width: number;
|
|
19
|
+
/** Height of the component */
|
|
20
|
+
height: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Tree which displays a hierarchy of ExternalSources and their elements.
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
26
|
+
export declare function ExternalSourcesTree(props: ExternalSourcesTreeProps): JSX.Element;
|
|
27
|
+
//# sourceMappingURL=ExternalSourcesTree.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import "../VisibilityTreeBase.scss";
|
|
7
|
+
import { ControlledTree, SelectionMode, useTreeModel } from "@itwin/components-react";
|
|
8
|
+
import { usePresentationTreeNodeLoader, useUnifiedSelectionTreeEventHandler } from "@itwin/presentation-components";
|
|
9
|
+
import * as RULESET_EXTERNAL_SOURCES_IMPORT from "./ExternalSources.json";
|
|
10
|
+
/**
|
|
11
|
+
* Presentation rules used by ControlledCategoriesTree
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export const RULESET_EXTERNAL_SOURCES = RULESET_EXTERNAL_SOURCES_IMPORT;
|
|
15
|
+
const PAGING_SIZE = 20;
|
|
16
|
+
/**
|
|
17
|
+
* Tree which displays a hierarchy of ExternalSources and their elements.
|
|
18
|
+
* @alpha
|
|
19
|
+
*/
|
|
20
|
+
export function ExternalSourcesTree(props) {
|
|
21
|
+
const { nodeLoader } = usePresentationTreeNodeLoader({
|
|
22
|
+
imodel: props.iModel,
|
|
23
|
+
ruleset: RULESET_EXTERNAL_SOURCES,
|
|
24
|
+
pagingSize: PAGING_SIZE,
|
|
25
|
+
customizeTreeNodeItem,
|
|
26
|
+
});
|
|
27
|
+
const eventsHandler = useUnifiedSelectionTreeEventHandler({ nodeLoader });
|
|
28
|
+
const treeModel = useTreeModel(nodeLoader.modelSource);
|
|
29
|
+
return (_jsx("div", { className: "tree-widget-visibility-tree-base", children: _jsx(ControlledTree, { nodeLoader: nodeLoader, model: treeModel, selectionMode: SelectionMode.Extended, eventsHandler: eventsHandler, width: props.width, height: props.height, iconsEnabled: true }) }));
|
|
30
|
+
}
|
|
31
|
+
function customizeTreeNodeItem(item, node) {
|
|
32
|
+
item.icon = node.extendedData?.imageId;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=ExternalSourcesTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalSourcesTree.js","sourceRoot":"","sources":["../../../../../src/components/trees/external-sources-tree/ExternalSourcesTree.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAE/F,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,6BAA6B,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AACpH,OAAO,KAAK,+BAA+B,MAAM,wBAAwB,CAAC;AAM1E;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,+BAA0C,CAAC;AAEnF,MAAM,WAAW,GAAG,EAAE,CAAC;AAevB;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,UAAU,EAAE,GAAG,6BAA6B,CAAC;QACnD,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,wBAAwB;QACjC,UAAU,EAAE,WAAW;QACvB,qBAAqB;KACtB,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,mCAAmC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;IAC1E,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACvD,OAAO,CACL,cAAK,SAAS,EAAC,kCAAkC,YAC/C,KAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,aAAa,CAAC,QAAQ,EACrC,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,YAAY,EAAE,IAAI,GAClB,GACE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAsC,EAAE,IAAmB;IACxF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC;AACzC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport \"../VisibilityTreeBase.scss\";\nimport { ControlledTree, SelectionMode, useTreeModel } from \"@itwin/components-react\";\nimport { usePresentationTreeNodeLoader, useUnifiedSelectionTreeEventHandler } from \"@itwin/presentation-components\";\nimport * as RULESET_EXTERNAL_SOURCES_IMPORT from \"./ExternalSources.json\";\n\nimport type { DelayLoadedTreeNodeItem } from \"@itwin/components-react\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { Node, Ruleset } from \"@itwin/presentation-common\";\n\n/**\n * Presentation rules used by ControlledCategoriesTree\n * @internal\n */\nexport const RULESET_EXTERNAL_SOURCES = RULESET_EXTERNAL_SOURCES_IMPORT as Ruleset;\n\nconst PAGING_SIZE = 20;\n\n/**\n * Props for the [[ExternalSourcesTree]] component\n * @alpha\n */\nexport interface ExternalSourcesTreeProps {\n /** An IModel to pull data from */\n iModel: IModelConnection;\n /** Width of the component */\n width: number;\n /** Height of the component */\n height: number;\n}\n\n/**\n * Tree which displays a hierarchy of ExternalSources and their elements.\n * @alpha\n */\nexport function ExternalSourcesTree(props: ExternalSourcesTreeProps) {\n const { nodeLoader } = usePresentationTreeNodeLoader({\n imodel: props.iModel,\n ruleset: RULESET_EXTERNAL_SOURCES,\n pagingSize: PAGING_SIZE,\n customizeTreeNodeItem,\n });\n const eventsHandler = useUnifiedSelectionTreeEventHandler({ nodeLoader });\n const treeModel = useTreeModel(nodeLoader.modelSource);\n return (\n <div className=\"tree-widget-visibility-tree-base\">\n <ControlledTree\n nodeLoader={nodeLoader}\n model={treeModel}\n selectionMode={SelectionMode.Extended}\n eventsHandler={eventsHandler}\n width={props.width}\n height={props.height}\n iconsEnabled={true}\n />\n </div>\n );\n}\n\nfunction customizeTreeNodeItem(item: Partial<DelayLoadedTreeNodeItem>, node: Partial<Node>) {\n item.icon = node.extendedData?.imageId;\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "../VisibilityTreeBase.scss";
|
|
3
|
+
/**
|
|
4
|
+
* A component that displays an External Sources tree and any necessary "chrome".
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export declare const ExternalSourcesTreeComponent: {
|
|
8
|
+
(props: {}): JSX.Element | null;
|
|
9
|
+
/**
|
|
10
|
+
* Id of the component. May be used when a creating a [[TreeDefinition]] for [[ExternalSourcesTreeComponent]].
|
|
11
|
+
* @alpha
|
|
12
|
+
*/
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* Label of the component. May be used when a creating a [[TreeDefinition]] for [[ExternalSourcesTreeComponent]].
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
getLabel(): string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=ExternalSourcesTreeComponent.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import "../VisibilityTreeBase.scss";
|
|
7
|
+
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
8
|
+
import { TreeWidget } from "../../../TreeWidget";
|
|
9
|
+
import { AutoSizer } from "../../utils/AutoSizer";
|
|
10
|
+
import { ExternalSourcesTree } from "./ExternalSourcesTree";
|
|
11
|
+
/**
|
|
12
|
+
* A component that displays an External Sources tree and any necessary "chrome".
|
|
13
|
+
* @alpha
|
|
14
|
+
*/
|
|
15
|
+
export const ExternalSourcesTreeComponent = (props) => {
|
|
16
|
+
const iModel = useActiveIModelConnection();
|
|
17
|
+
if (!iModel) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return (_jsx(ExternalSourcesTreeComponentImpl, { ...props, iModel: iModel }));
|
|
21
|
+
};
|
|
22
|
+
function ExternalSourcesTreeComponentImpl(props) {
|
|
23
|
+
return (_jsx(AutoSizer, { children: ({ width, height }) => (_jsx(ExternalSourcesTree, { ...props, width: width, height: height })) }));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Id of the component. May be used when a creating a [[TreeDefinition]] for [[ExternalSourcesTreeComponent]].
|
|
27
|
+
* @alpha
|
|
28
|
+
*/
|
|
29
|
+
ExternalSourcesTreeComponent.id = "external-sources-tree";
|
|
30
|
+
/**
|
|
31
|
+
* Label of the component. May be used when a creating a [[TreeDefinition]] for [[ExternalSourcesTreeComponent]].
|
|
32
|
+
* @alpha
|
|
33
|
+
*/
|
|
34
|
+
ExternalSourcesTreeComponent.getLabel = () => TreeWidget.translate("externalSources");
|
|
35
|
+
//# sourceMappingURL=ExternalSourcesTreeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalSourcesTreeComponent.js","sourceRoot":"","sources":["../../../../../src/components/trees/external-sources-tree/ExternalSourcesTreeComponent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAE/F,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAS,EAAE,EAAE;IACxD,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAC3C,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,KAAC,gCAAgC,OAAK,KAAK,EAAE,MAAM,EAAE,MAAM,GAAI,CAChE,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,gCAAgC,CAAC,KAAmC;IAC3E,OAAO,CACL,KAAC,SAAS,cACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACtB,KAAC,mBAAmB,OACd,KAAK,EACT,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,GACd,CACH,GACS,CACb,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,4BAA4B,CAAC,EAAE,GAAG,uBAAuB,CAAC;AAE1D;;;GAGG;AACH,4BAA4B,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport \"../VisibilityTreeBase.scss\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { TreeWidget } from \"../../../TreeWidget\";\nimport { AutoSizer } from \"../../utils/AutoSizer\";\nimport { ExternalSourcesTree } from \"./ExternalSourcesTree\";\n\nimport type { IModelConnection } from \"@itwin/core-frontend\";\n\n/**\n * A component that displays an External Sources tree and any necessary \"chrome\".\n * @alpha\n */\nexport const ExternalSourcesTreeComponent = (props: {}) => {\n const iModel = useActiveIModelConnection();\n if (!iModel) {\n return null;\n }\n return (\n <ExternalSourcesTreeComponentImpl {...props} iModel={iModel} />\n );\n};\n\nfunction ExternalSourcesTreeComponentImpl(props: { iModel: IModelConnection }) {\n return (\n <AutoSizer>\n {({ width, height }) => (\n <ExternalSourcesTree\n {...props}\n width={width}\n height={height}\n />\n )}\n </AutoSizer>\n );\n}\n\n/**\n * Id of the component. May be used when a creating a [[TreeDefinition]] for [[ExternalSourcesTreeComponent]].\n * @alpha\n */\nExternalSourcesTreeComponent.id = \"external-sources-tree\";\n\n/**\n * Label of the component. May be used when a creating a [[TreeDefinition]] for [[ExternalSourcesTreeComponent]].\n * @alpha\n */\nExternalSourcesTreeComponent.getLabel = () => TreeWidget.translate(\"externalSources\");\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectionMode } from "@itwin/components-react";
|
|
3
|
+
import type { IModelConnection } from "@itwin/core-frontend";
|
|
4
|
+
import type { Ruleset } from "@itwin/presentation-common";
|
|
5
|
+
/**
|
|
6
|
+
* Presentation rules used by IModelContentTree
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const RULESET_IMODEL_CONTENT: Ruleset;
|
|
10
|
+
/**
|
|
11
|
+
* Props for [[IModelContentTree]]
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface IModelContentTreeProps extends Omit<React.HTMLProps<HTMLDivElement>, "children"> {
|
|
15
|
+
/** An IModel to pull data from */
|
|
16
|
+
iModel: IModelConnection;
|
|
17
|
+
/** Width of the component */
|
|
18
|
+
width: number;
|
|
19
|
+
/** Height of the component */
|
|
20
|
+
height: number;
|
|
21
|
+
/** Selection mode in the tree */
|
|
22
|
+
selectionMode?: SelectionMode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A tree that shows all iModel content starting from the root Subject, then the hierarchy of child
|
|
26
|
+
* Subjects, their Models and Elements contained in those Models.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export declare const IModelContentTree: (props: IModelContentTreeProps) => JSX.Element;
|
|
30
|
+
//# sourceMappingURL=IModelContentTree.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
import { useMemo } from "react";
|
|
8
|
+
import { ControlledTree, SelectionMode, useTreeEventsHandler, useTreeModel } from "@itwin/components-react";
|
|
9
|
+
import { usePresentationTreeNodeLoader } from "@itwin/presentation-components";
|
|
10
|
+
/**
|
|
11
|
+
* Presentation rules used by IModelContentTree
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export const RULESET_IMODEL_CONTENT = require("./IModelContent.json"); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
15
|
+
/**
|
|
16
|
+
* A tree that shows all iModel content starting from the root Subject, then the hierarchy of child
|
|
17
|
+
* Subjects, their Models and Elements contained in those Models.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export const IModelContentTree = (props) => {
|
|
21
|
+
const { iModel, className, width, height, ...divProps } = props;
|
|
22
|
+
const { nodeLoader } = usePresentationTreeNodeLoader({
|
|
23
|
+
imodel: iModel,
|
|
24
|
+
ruleset: RULESET_IMODEL_CONTENT,
|
|
25
|
+
pagingSize: 20,
|
|
26
|
+
appendChildrenCountForGroupingNodes: true,
|
|
27
|
+
});
|
|
28
|
+
const eventHandler = useTreeEventsHandler(useMemo(() => ({ nodeLoader, modelSource: nodeLoader.modelSource }), [nodeLoader]));
|
|
29
|
+
const treeModel = useTreeModel(nodeLoader.modelSource);
|
|
30
|
+
return (_jsx("div", { ...divProps, className: classNames("imodel-content-tree", className), children: _jsx(ControlledTree, { width: width, height: height, nodeLoader: nodeLoader, selectionMode: props.selectionMode ? /* istanbul ignore next */ props.selectionMode : SelectionMode.None, eventsHandler: eventHandler, model: treeModel, iconsEnabled: true }) }));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=IModelContentTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IModelContentTree.js","sourceRoot":"","sources":["../../../../../src/components/trees/imodel-content-tree/IModelContentTree.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAE/F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5G,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAK/E;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAY,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,yDAAyD;AAiBzI;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IACjE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEhE,MAAM,EAAE,UAAU,EAAE,GAAG,6BAA6B,CAAC;QACnD,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,sBAAsB;QAC/B,UAAU,EAAE,EAAE;QACd,mCAAmC,EAAE,IAAI;KAC1C,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,oBAAoB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAE9H,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAEvD,OAAO,CACL,iBAAS,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,SAAS,CAAC,YACxE,KAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,EACxG,aAAa,EAAE,YAAY,EAC3B,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,IAAI,GAClB,GACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport classNames from \"classnames\";\nimport { useMemo } from \"react\";\nimport { ControlledTree, SelectionMode, useTreeEventsHandler, useTreeModel } from \"@itwin/components-react\";\nimport { usePresentationTreeNodeLoader } from \"@itwin/presentation-components\";\n\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { Ruleset } from \"@itwin/presentation-common\";\n\n/**\n * Presentation rules used by IModelContentTree\n * @internal\n */\nexport const RULESET_IMODEL_CONTENT: Ruleset = require(\"./IModelContent.json\"); // eslint-disable-line @typescript-eslint/no-var-requires\n\n/**\n * Props for [[IModelContentTree]]\n * @public\n */\nexport interface IModelContentTreeProps extends Omit<React.HTMLProps<HTMLDivElement>, \"children\"> {\n /** An IModel to pull data from */\n iModel: IModelConnection;\n /** Width of the component */\n width: number;\n /** Height of the component */\n height: number;\n /** Selection mode in the tree */\n selectionMode?: SelectionMode;\n}\n\n/**\n * A tree that shows all iModel content starting from the root Subject, then the hierarchy of child\n * Subjects, their Models and Elements contained in those Models.\n * @public\n */\nexport const IModelContentTree = (props: IModelContentTreeProps) => {\n const { iModel, className, width, height, ...divProps } = props;\n\n const { nodeLoader } = usePresentationTreeNodeLoader({\n imodel: iModel,\n ruleset: RULESET_IMODEL_CONTENT,\n pagingSize: 20,\n appendChildrenCountForGroupingNodes: true,\n });\n const eventHandler = useTreeEventsHandler(useMemo(() => ({ nodeLoader, modelSource: nodeLoader.modelSource }), [nodeLoader]));\n\n const treeModel = useTreeModel(nodeLoader.modelSource);\n\n return (\n <div {...divProps} className={classNames(\"imodel-content-tree\", className)}>\n <ControlledTree\n width={width}\n height={height}\n nodeLoader={nodeLoader}\n selectionMode={props.selectionMode ? /* istanbul ignore next */ props.selectionMode : SelectionMode.None}\n eventsHandler={eventHandler}\n model={treeModel}\n iconsEnabled={true}\n />\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "../VisibilityTreeBase.scss";
|
|
3
|
+
import type { IModelContentTreeProps } from "./IModelContentTree";
|
|
4
|
+
/**
|
|
5
|
+
* Props for [[IModelContentTreeComponent]].
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type IModelContentTreeComponentProps = Omit<IModelContentTreeProps, "iModel" | "width" | "height">;
|
|
9
|
+
/**
|
|
10
|
+
* A component that renders [[IModelContentTree]]
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export declare const IModelContentTreeComponent: {
|
|
14
|
+
(props: IModelContentTreeComponentProps): JSX.Element | null;
|
|
15
|
+
/**
|
|
16
|
+
* Id of the component. May be used when a creating a [[TreeDefinition]] for [[TreeWidgetComponent]].
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* Label of the component. May be used when a creating a [[TreeDefinition]] for [[TreeWidgetComponent]].
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
getLabel(): string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=IModelContentTreeComponent.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
import "../VisibilityTreeBase.scss";
|
|
7
|
+
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
8
|
+
import { TreeWidget } from "../../../TreeWidget";
|
|
9
|
+
import { AutoSizer } from "../../utils/AutoSizer";
|
|
10
|
+
import { IModelContentTree } from "./IModelContentTree";
|
|
11
|
+
/**
|
|
12
|
+
* A component that renders [[IModelContentTree]]
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export const IModelContentTreeComponent = (props) => {
|
|
16
|
+
const iModel = useActiveIModelConnection();
|
|
17
|
+
if (!iModel)
|
|
18
|
+
return null;
|
|
19
|
+
return (_jsx(AutoSizer, { children: ({ width, height }) => (_jsx(IModelContentTree, { ...props, iModel: iModel, width: width, height: height })) }));
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Id of the component. May be used when a creating a [[TreeDefinition]] for [[TreeWidgetComponent]].
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
IModelContentTreeComponent.id = "imodel-content-tree";
|
|
26
|
+
/**
|
|
27
|
+
* Label of the component. May be used when a creating a [[TreeDefinition]] for [[TreeWidgetComponent]].
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
IModelContentTreeComponent.getLabel = () => TreeWidget.translate("imodelContent");
|
|
31
|
+
//# sourceMappingURL=IModelContentTreeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IModelContentTreeComponent.js","sourceRoot":"","sources":["../../../../../src/components/trees/imodel-content-tree/IModelContentTreeComponent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAE/F,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAUxD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAsC,EAAE,EAAE;IACnF,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAE3C,IAAI,CAAC,MAAM;QACT,OAAO,IAAI,CAAC;IAEd,OAAO,CACL,KAAC,SAAS,cACP,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACtB,KAAC,iBAAiB,OACZ,KAAK,EACT,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,GACd,CACH,GACS,CACb,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACH,0BAA0B,CAAC,EAAE,GAAG,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,0BAA0B,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport \"../VisibilityTreeBase.scss\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport { TreeWidget } from \"../../../TreeWidget\";\nimport { AutoSizer } from \"../../utils/AutoSizer\";\nimport { IModelContentTree } from \"./IModelContentTree\";\n\nimport type { IModelContentTreeProps } from \"./IModelContentTree\";\n\n/**\n * Props for [[IModelContentTreeComponent]].\n * @public\n */\nexport type IModelContentTreeComponentProps = Omit<IModelContentTreeProps, \"iModel\" | \"width\" | \"height\">;\n\n/**\n * A component that renders [[IModelContentTree]]\n * @public\n */\nexport const IModelContentTreeComponent = (props: IModelContentTreeComponentProps) => {\n const iModel = useActiveIModelConnection();\n\n if (!iModel)\n return null;\n\n return (\n <AutoSizer>\n {({ width, height }) => (\n <IModelContentTree\n {...props}\n iModel={iModel}\n width={width}\n height={height}\n />\n )}\n </AutoSizer>\n );\n};\n\n/**\n * Id of the component. May be used when a creating a [[TreeDefinition]] for [[TreeWidgetComponent]].\n * @public\n */\nIModelContentTreeComponent.id = \"imodel-content-tree\";\n\n/**\n * Label of the component. May be used when a creating a [[TreeDefinition]] for [[TreeWidgetComponent]].\n * @public\n */\nIModelContentTreeComponent.getLabel = () => TreeWidget.translate(\"imodelContent\");\n"]}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export * from "./Common";
|
|
2
|
-
export * from "./IModelContentTree";
|
|
3
2
|
export * from "./VisibilityTreeEventHandler";
|
|
4
3
|
export * from "./VisibilityTreeRenderer";
|
|
4
|
+
export * from "./imodel-content-tree/IModelContentTree";
|
|
5
|
+
export * from "./imodel-content-tree/IModelContentTreeComponent";
|
|
5
6
|
export * from "./category-tree/CategoriesTree";
|
|
6
7
|
export * from "./category-tree/CategoriesTreeComponent";
|
|
7
8
|
export * from "./category-tree/CategoryVisibilityHandler";
|
|
9
|
+
export * from "./external-sources-tree/ExternalSourcesTree";
|
|
10
|
+
export * from "./external-sources-tree/ExternalSourcesTreeComponent";
|
|
8
11
|
export * from "./models-tree/ModelsTree";
|
|
9
12
|
export * from "./models-tree/ModelsTreeComponent";
|
|
10
13
|
export * from "./models-tree/ModelsVisibilityHandler";
|
|
14
|
+
export * from "./models-tree/Utils";
|
|
11
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
export * from "./Common";
|
|
6
|
-
export * from "./IModelContentTree";
|
|
7
6
|
export * from "./VisibilityTreeEventHandler";
|
|
8
7
|
export * from "./VisibilityTreeRenderer";
|
|
8
|
+
export * from "./imodel-content-tree/IModelContentTree";
|
|
9
|
+
export * from "./imodel-content-tree/IModelContentTreeComponent";
|
|
9
10
|
export * from "./category-tree/CategoriesTree";
|
|
10
11
|
export * from "./category-tree/CategoriesTreeComponent";
|
|
11
12
|
export * from "./category-tree/CategoryVisibilityHandler";
|
|
13
|
+
export * from "./external-sources-tree/ExternalSourcesTree";
|
|
14
|
+
export * from "./external-sources-tree/ExternalSourcesTreeComponent";
|
|
12
15
|
export * from "./models-tree/ModelsTree";
|
|
13
16
|
export * from "./models-tree/ModelsTreeComponent";
|
|
14
17
|
export * from "./models-tree/ModelsVisibilityHandler";
|
|
18
|
+
export * from "./models-tree/Utils";
|
|
15
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/trees/index.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/trees/index.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,cAAc,UAAU,CAAC;AACzB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AAEzC,cAAc,yCAAyC,CAAC;AACxD,cAAc,kDAAkD,CAAC;AAEjE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAE1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sDAAsD,CAAC;AAErE,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport * from \"./Common\";\nexport * from \"./VisibilityTreeEventHandler\";\nexport * from \"./VisibilityTreeRenderer\";\n\nexport * from \"./imodel-content-tree/IModelContentTree\";\nexport * from \"./imodel-content-tree/IModelContentTreeComponent\";\n\nexport * from \"./category-tree/CategoriesTree\";\nexport * from \"./category-tree/CategoriesTreeComponent\";\nexport * from \"./category-tree/CategoryVisibilityHandler\";\n\nexport * from \"./external-sources-tree/ExternalSourcesTree\";\nexport * from \"./external-sources-tree/ExternalSourcesTreeComponent\";\n\nexport * from \"./models-tree/ModelsTree\";\nexport * from \"./models-tree/ModelsTreeComponent\";\nexport * from \"./models-tree/ModelsVisibilityHandler\";\nexport * from \"./models-tree/Utils\";\n"]}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import "../VisibilityTreeBase.scss";
|
|
2
|
-
import * as React from "react";
|
|
3
3
|
import { SelectionMode } from "@itwin/components-react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { ClassGroupingOption } from "../Common";
|
|
5
|
+
import { ModelsVisibilityHandler } from "./ModelsVisibilityHandler";
|
|
6
|
+
import type { IModelConnection, Viewport } from "@itwin/core-frontend";
|
|
7
|
+
import type { SingleSchemaClassSpecification } from "@itwin/presentation-common";
|
|
8
|
+
import type { IPresentationTreeDataProvider } from "@itwin/presentation-components";
|
|
9
|
+
import type { VisibilityTreeFilterInfo } from "../Common";
|
|
10
|
+
import type { ModelsTreeSelectionPredicate } from "./ModelsVisibilityHandler";
|
|
11
|
+
/**
|
|
12
|
+
* Props for configuring the hierarchy in [[ModelsTree]].
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface ModelsTreeHierarchyConfiguration {
|
|
16
|
+
/** Should the tree group displayed element nodes by class. Defaults to `ClassGroupingOption.No`. */
|
|
17
|
+
enableElementsClassGrouping?: ClassGroupingOption;
|
|
18
|
+
/**
|
|
19
|
+
* Defines the `bis.GeometricElement3d` sub-class that should be used to load element nodes.
|
|
20
|
+
* Defaults to `bis.GeometricElement3d`. It's expected for the given class to derive from it.
|
|
21
|
+
*/
|
|
22
|
+
elementClassSpecification?: SingleSchemaClassSpecification;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for [[ModelsTree]] component
|
|
14
26
|
* @public
|
|
15
27
|
*/
|
|
16
28
|
export interface ModelsTreeProps {
|
|
@@ -28,20 +40,18 @@ export interface ModelsTreeProps {
|
|
|
28
40
|
selectionMode?: SelectionMode;
|
|
29
41
|
/**
|
|
30
42
|
* Predicate which indicates whether node can be selected or no
|
|
31
|
-
* @alpha
|
|
32
43
|
*/
|
|
33
44
|
selectionPredicate?: ModelsTreeSelectionPredicate;
|
|
34
45
|
/**
|
|
35
46
|
* Active view used to determine and control visibility
|
|
36
47
|
*/
|
|
37
|
-
activeView
|
|
48
|
+
activeView: Viewport;
|
|
38
49
|
/**
|
|
39
50
|
* Ref to the root HTML element used by this component
|
|
40
51
|
*/
|
|
41
52
|
rootElementRef?: React.Ref<HTMLDivElement>;
|
|
42
53
|
/**
|
|
43
54
|
* Information for tree filtering.
|
|
44
|
-
* @alpha
|
|
45
55
|
*/
|
|
46
56
|
filterInfo?: VisibilityTreeFilterInfo;
|
|
47
57
|
/**
|
|
@@ -49,10 +59,9 @@ export interface ModelsTreeProps {
|
|
|
49
59
|
*/
|
|
50
60
|
onFilterApplied?: (filteredDataProvider: IPresentationTreeDataProvider, matchesCount: number) => void;
|
|
51
61
|
/**
|
|
52
|
-
*
|
|
53
|
-
* @beta
|
|
62
|
+
* Configuration options for the hierarchy loaded in the component.
|
|
54
63
|
*/
|
|
55
|
-
|
|
64
|
+
hierarchyConfig?: ModelsTreeHierarchyConfiguration;
|
|
56
65
|
/**
|
|
57
66
|
* Auto-update the hierarchy when data in the iModel changes.
|
|
58
67
|
* @alpha
|
|
@@ -60,7 +69,6 @@ export interface ModelsTreeProps {
|
|
|
60
69
|
enableHierarchyAutoUpdate?: boolean;
|
|
61
70
|
/**
|
|
62
71
|
* Custom visibility handler.
|
|
63
|
-
* @alpha
|
|
64
72
|
*/
|
|
65
73
|
modelsVisibilityHandler?: ModelsVisibilityHandler;
|
|
66
74
|
}
|