@itwin/presentation-frontend 4.5.0-dev.0 → 4.5.0-dev.16
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 +20 -1
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +10 -6
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/Diagnostics.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/Diagnostics.js +18 -13
- package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +3 -3
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +3 -3
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/LocalizationHelper.js +3 -3
- package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.js +24 -14
- package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.js +57 -30
- package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.js +11 -7
- package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +53 -31
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +111 -66
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +54 -25
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteRules.json +172 -172
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +16 -10
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +3 -3
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +3 -3
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +15 -9
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +7 -5
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js +31 -16
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +25 -14
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend.js +3 -3
- package/lib/cjs/presentation-frontend.js.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +10 -6
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/Diagnostics.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/Diagnostics.js +18 -13
- package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +3 -3
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js +3 -3
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/LocalizationHelper.js +3 -3
- package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.js +24 -14
- package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.js +57 -30
- package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.js +11 -7
- package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js +53 -31
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +111 -66
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +54 -25
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteRules.json +172 -172
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +17 -11
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +3 -3
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +3 -3
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js +15 -9
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js +7 -5
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.js +31 -16
- package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +25 -14
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/esm/presentation-frontend.js +3 -3
- package/lib/esm/presentation-frontend.js.map +1 -1
- package/package.json +19 -16
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../../node_modules/@itwin/presentation-common/Ruleset.schema.json",
|
|
3
|
-
"id": "presentation-frontend/HiliteRules",
|
|
4
|
-
"rules": [
|
|
5
|
-
{
|
|
6
|
-
"ruleType": "Content",
|
|
7
|
-
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Subject\", \"BisCore\")",
|
|
8
|
-
"onlyIfNotHandled": true,
|
|
9
|
-
"specifications": [
|
|
10
|
-
{
|
|
11
|
-
"specType": "ContentRelatedInstances",
|
|
12
|
-
"relationshipPaths": [
|
|
13
|
-
[
|
|
14
|
-
{
|
|
15
|
-
"relationship": {
|
|
16
|
-
"schemaName": "BisCore",
|
|
17
|
-
"className": "ElementOwnsChildElements"
|
|
18
|
-
},
|
|
19
|
-
"direction": "Forward",
|
|
20
|
-
"targetClass": {
|
|
21
|
-
"schemaName": "BisCore",
|
|
22
|
-
"className": "Subject"
|
|
23
|
-
},
|
|
24
|
-
"count": "*"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"relationship": {
|
|
28
|
-
"schemaName": "BisCore",
|
|
29
|
-
"className": "ElementOwnsChildElements"
|
|
30
|
-
},
|
|
31
|
-
"direction": "Forward",
|
|
32
|
-
"targetClass": {
|
|
33
|
-
"schemaName": "BisCore",
|
|
34
|
-
"className": "PhysicalPartition"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"ruleType": "Content",
|
|
44
|
-
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Model\", \"BisCore\")",
|
|
45
|
-
"onlyIfNotHandled": true,
|
|
46
|
-
"specifications": [
|
|
47
|
-
{
|
|
48
|
-
"specType": "SelectedNodeInstances"
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"ruleType": "ExtendedData",
|
|
54
|
-
"condition": "ThisNode.IsOfClass(\"Model\", \"BisCore\") ORELSE ThisNode.IsOfClass(\"PhysicalPartition\", \"BisCore\")",
|
|
55
|
-
"items": {
|
|
56
|
-
"isModel": "true"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"ruleType": "Content",
|
|
61
|
-
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Category\", \"BisCore\")",
|
|
62
|
-
"onlyIfNotHandled": true,
|
|
63
|
-
"specifications": [
|
|
64
|
-
{
|
|
65
|
-
"specType": "ContentRelatedInstances",
|
|
66
|
-
"relationshipPaths": [
|
|
67
|
-
{
|
|
68
|
-
"relationship": {
|
|
69
|
-
"schemaName": "BisCore",
|
|
70
|
-
"className": "CategoryOwnsSubCategories"
|
|
71
|
-
},
|
|
72
|
-
"direction": "Forward"
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"ruleType": "Content",
|
|
80
|
-
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"SubCategory\", \"BisCore\")",
|
|
81
|
-
"onlyIfNotHandled": true,
|
|
82
|
-
"specifications": [
|
|
83
|
-
{
|
|
84
|
-
"specType": "SelectedNodeInstances"
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"ruleType": "ExtendedData",
|
|
90
|
-
"condition": "ThisNode.IsOfClass(\"SubCategory\", \"BisCore\")",
|
|
91
|
-
"items": {
|
|
92
|
-
"isSubCategory": "true"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"ruleType": "Content",
|
|
97
|
-
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"GroupInformationElement\", \"BisCore\")",
|
|
98
|
-
"onlyIfNotHandled": true,
|
|
99
|
-
"specifications": [
|
|
100
|
-
{
|
|
101
|
-
"specType": "ContentRelatedInstances",
|
|
102
|
-
"relationshipPaths": [
|
|
103
|
-
[
|
|
104
|
-
{
|
|
105
|
-
"relationship": {
|
|
106
|
-
"schemaName": "BisCore",
|
|
107
|
-
"className": "ElementGroupsMembers"
|
|
108
|
-
},
|
|
109
|
-
"direction": "Forward"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"relationship": {
|
|
113
|
-
"schemaName": "BisCore",
|
|
114
|
-
"className": "ElementOwnsChildElements"
|
|
115
|
-
},
|
|
116
|
-
"direction": "Forward",
|
|
117
|
-
"count": "*"
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
],
|
|
121
|
-
"instanceFilter": "this.IsOfClass(\"GeometricElement\", \"BisCore\")"
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"ruleType": "Content",
|
|
127
|
-
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"GeometricElement\", \"BisCore\")",
|
|
128
|
-
"onlyIfNotHandled": true,
|
|
129
|
-
"specifications": [
|
|
130
|
-
{
|
|
131
|
-
"specType": "ContentRelatedInstances",
|
|
132
|
-
"relationshipPaths": [
|
|
133
|
-
{
|
|
134
|
-
"relationship": {
|
|
135
|
-
"schemaName": "BisCore",
|
|
136
|
-
"className": "ElementOwnsChildElements"
|
|
137
|
-
},
|
|
138
|
-
"direction": "Forward",
|
|
139
|
-
"count": "*"
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
"instanceFilter": "this.IsOfClass(\"GeometricElement\", \"BisCore\")"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"specType": "SelectedNodeInstances"
|
|
146
|
-
}
|
|
147
|
-
]
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
"ruleType": "Content",
|
|
151
|
-
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Element\", \"BisCore\")",
|
|
152
|
-
"priority": 0,
|
|
153
|
-
"onlyIfNotHandled": true,
|
|
154
|
-
"specifications": [
|
|
155
|
-
{
|
|
156
|
-
"specType": "ContentRelatedInstances",
|
|
157
|
-
"relationshipPaths": [
|
|
158
|
-
{
|
|
159
|
-
"relationship": {
|
|
160
|
-
"schemaName": "BisCore",
|
|
161
|
-
"className": "ElementOwnsChildElements"
|
|
162
|
-
},
|
|
163
|
-
"direction": "Forward",
|
|
164
|
-
"count": "*"
|
|
165
|
-
}
|
|
166
|
-
],
|
|
167
|
-
"instanceFilter": "this.IsOfClass(\"GeometricElement\", \"BisCore\")"
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
-
]
|
|
172
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/@itwin/presentation-common/Ruleset.schema.json",
|
|
3
|
+
"id": "presentation-frontend/HiliteRules",
|
|
4
|
+
"rules": [
|
|
5
|
+
{
|
|
6
|
+
"ruleType": "Content",
|
|
7
|
+
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Subject\", \"BisCore\")",
|
|
8
|
+
"onlyIfNotHandled": true,
|
|
9
|
+
"specifications": [
|
|
10
|
+
{
|
|
11
|
+
"specType": "ContentRelatedInstances",
|
|
12
|
+
"relationshipPaths": [
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
"relationship": {
|
|
16
|
+
"schemaName": "BisCore",
|
|
17
|
+
"className": "ElementOwnsChildElements"
|
|
18
|
+
},
|
|
19
|
+
"direction": "Forward",
|
|
20
|
+
"targetClass": {
|
|
21
|
+
"schemaName": "BisCore",
|
|
22
|
+
"className": "Subject"
|
|
23
|
+
},
|
|
24
|
+
"count": "*"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"relationship": {
|
|
28
|
+
"schemaName": "BisCore",
|
|
29
|
+
"className": "ElementOwnsChildElements"
|
|
30
|
+
},
|
|
31
|
+
"direction": "Forward",
|
|
32
|
+
"targetClass": {
|
|
33
|
+
"schemaName": "BisCore",
|
|
34
|
+
"className": "PhysicalPartition"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"ruleType": "Content",
|
|
44
|
+
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Model\", \"BisCore\")",
|
|
45
|
+
"onlyIfNotHandled": true,
|
|
46
|
+
"specifications": [
|
|
47
|
+
{
|
|
48
|
+
"specType": "SelectedNodeInstances"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"ruleType": "ExtendedData",
|
|
54
|
+
"condition": "ThisNode.IsOfClass(\"Model\", \"BisCore\") ORELSE ThisNode.IsOfClass(\"PhysicalPartition\", \"BisCore\")",
|
|
55
|
+
"items": {
|
|
56
|
+
"isModel": "true"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"ruleType": "Content",
|
|
61
|
+
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Category\", \"BisCore\")",
|
|
62
|
+
"onlyIfNotHandled": true,
|
|
63
|
+
"specifications": [
|
|
64
|
+
{
|
|
65
|
+
"specType": "ContentRelatedInstances",
|
|
66
|
+
"relationshipPaths": [
|
|
67
|
+
{
|
|
68
|
+
"relationship": {
|
|
69
|
+
"schemaName": "BisCore",
|
|
70
|
+
"className": "CategoryOwnsSubCategories"
|
|
71
|
+
},
|
|
72
|
+
"direction": "Forward"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"ruleType": "Content",
|
|
80
|
+
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"SubCategory\", \"BisCore\")",
|
|
81
|
+
"onlyIfNotHandled": true,
|
|
82
|
+
"specifications": [
|
|
83
|
+
{
|
|
84
|
+
"specType": "SelectedNodeInstances"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"ruleType": "ExtendedData",
|
|
90
|
+
"condition": "ThisNode.IsOfClass(\"SubCategory\", \"BisCore\")",
|
|
91
|
+
"items": {
|
|
92
|
+
"isSubCategory": "true"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"ruleType": "Content",
|
|
97
|
+
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"GroupInformationElement\", \"BisCore\")",
|
|
98
|
+
"onlyIfNotHandled": true,
|
|
99
|
+
"specifications": [
|
|
100
|
+
{
|
|
101
|
+
"specType": "ContentRelatedInstances",
|
|
102
|
+
"relationshipPaths": [
|
|
103
|
+
[
|
|
104
|
+
{
|
|
105
|
+
"relationship": {
|
|
106
|
+
"schemaName": "BisCore",
|
|
107
|
+
"className": "ElementGroupsMembers"
|
|
108
|
+
},
|
|
109
|
+
"direction": "Forward"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"relationship": {
|
|
113
|
+
"schemaName": "BisCore",
|
|
114
|
+
"className": "ElementOwnsChildElements"
|
|
115
|
+
},
|
|
116
|
+
"direction": "Forward",
|
|
117
|
+
"count": "*"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
],
|
|
121
|
+
"instanceFilter": "this.IsOfClass(\"GeometricElement\", \"BisCore\")"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"ruleType": "Content",
|
|
127
|
+
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"GeometricElement\", \"BisCore\")",
|
|
128
|
+
"onlyIfNotHandled": true,
|
|
129
|
+
"specifications": [
|
|
130
|
+
{
|
|
131
|
+
"specType": "ContentRelatedInstances",
|
|
132
|
+
"relationshipPaths": [
|
|
133
|
+
{
|
|
134
|
+
"relationship": {
|
|
135
|
+
"schemaName": "BisCore",
|
|
136
|
+
"className": "ElementOwnsChildElements"
|
|
137
|
+
},
|
|
138
|
+
"direction": "Forward",
|
|
139
|
+
"count": "*"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"instanceFilter": "this.IsOfClass(\"GeometricElement\", \"BisCore\")"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"specType": "SelectedNodeInstances"
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"ruleType": "Content",
|
|
151
|
+
"condition": "ContentDisplayType = \"Graphics\" ANDALSO SelectedNode.IsOfClass(\"Element\", \"BisCore\")",
|
|
152
|
+
"priority": 0,
|
|
153
|
+
"onlyIfNotHandled": true,
|
|
154
|
+
"specifications": [
|
|
155
|
+
{
|
|
156
|
+
"specType": "ContentRelatedInstances",
|
|
157
|
+
"relationshipPaths": [
|
|
158
|
+
{
|
|
159
|
+
"relationship": {
|
|
160
|
+
"schemaName": "BisCore",
|
|
161
|
+
"className": "ElementOwnsChildElements"
|
|
162
|
+
},
|
|
163
|
+
"direction": "Forward",
|
|
164
|
+
"count": "*"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"instanceFilter": "this.IsOfClass(\"GeometricElement\", \"BisCore\")"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiliteSetProvider.d.ts","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"HiliteSetProvider.d.ts","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAqG,MAAM,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAIhK,gBAAgB;AAEhB,eAAO,MAAM,cAAc,EAAE,OAAuC,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,MAAM,CAAsE;IAEpF,OAAO;IAIP;;OAEG;WACW,MAAM,CAAC,KAAK,EAAE,sBAAsB;IAIlD;;;;;;OAMG;IACU,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAmB1E;;;OAGG;IACI,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC;YAWxC,uBAAuB;IA+BtC,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,mBAAmB;CAgB5B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module UnifiedSelection
|
|
7
7
|
*/
|
|
8
8
|
import { from, shareReplay } from "rxjs";
|
|
9
9
|
import { eachValueFrom } from "rxjs-for-await";
|
|
10
|
-
import { ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, Key, KeySet
|
|
10
|
+
import { ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, Key, KeySet } from "@itwin/presentation-common";
|
|
11
11
|
import { Presentation } from "../Presentation";
|
|
12
12
|
import { TRANSIENT_ELEMENT_CLASSNAME } from "./SelectionManager";
|
|
13
13
|
/** @internal */
|
|
@@ -27,7 +27,9 @@ export class HiliteSetProvider {
|
|
|
27
27
|
/**
|
|
28
28
|
* Create a hilite set provider for the specified iModel.
|
|
29
29
|
*/
|
|
30
|
-
static create(props) {
|
|
30
|
+
static create(props) {
|
|
31
|
+
return new HiliteSetProvider(props);
|
|
32
|
+
}
|
|
31
33
|
/**
|
|
32
34
|
* Get hilite set for instances and/or nodes whose keys are specified in the
|
|
33
35
|
* given KeySet.
|
|
@@ -41,9 +43,9 @@ export class HiliteSetProvider {
|
|
|
41
43
|
const elementIds = new Array();
|
|
42
44
|
const iterator = this.getHiliteSetIterator(selection);
|
|
43
45
|
for await (const set of iterator) {
|
|
44
|
-
modelIds.push(...set.models ?? []);
|
|
45
|
-
subCategoryIds.push(...set.subCategories ?? []);
|
|
46
|
-
elementIds.push(...set.elements ?? []);
|
|
46
|
+
modelIds.push(...(set.models ?? []));
|
|
47
|
+
subCategoryIds.push(...(set.subCategories ?? []));
|
|
48
|
+
elementIds.push(...(set.elements ?? []));
|
|
47
49
|
}
|
|
48
50
|
return {
|
|
49
51
|
models: modelIds.length ? modelIds : undefined,
|
|
@@ -73,7 +75,11 @@ export class HiliteSetProvider {
|
|
|
73
75
|
for (const batch of keyBatches) {
|
|
74
76
|
let loadedItems = 0;
|
|
75
77
|
while (true) {
|
|
76
|
-
const content = await Presentation.presentation.getContentAndSize({
|
|
78
|
+
const content = await Presentation.presentation.getContentAndSize({
|
|
79
|
+
...options,
|
|
80
|
+
paging: { start: loadedItems, size: CONTENT_SET_PAGE_SIZE },
|
|
81
|
+
keys: batch,
|
|
82
|
+
});
|
|
77
83
|
if (!content) {
|
|
78
84
|
break;
|
|
79
85
|
}
|
|
@@ -137,6 +143,6 @@ export class HiliteSetProvider {
|
|
|
137
143
|
}
|
|
138
144
|
}
|
|
139
145
|
const CONTENT_SET_PAGE_SIZE = 1000;
|
|
140
|
-
const isModelRecord = (rec) =>
|
|
141
|
-
const isSubCategoryRecord = (rec) =>
|
|
146
|
+
const isModelRecord = (rec) => rec.extendedData && rec.extendedData.isModel;
|
|
147
|
+
const isSubCategoryRecord = (rec) => rec.extendedData && rec.extendedData.isSubCategory;
|
|
142
148
|
//# sourceMappingURL=HiliteSetProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,WAAW,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EACL,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,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ourcesContent":["/*---------------------------------------------------------------------------------------------\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/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { from, Observable, shareReplay } from \"rxjs\";\nimport { eachValueFrom } from \"rxjs-for-await\";\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport {\n ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, DescriptorOverrides, Item, Key, KeySet, Ruleset,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"../Presentation\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./SelectionManager\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const HILITE_RULESET: Ruleset = require(\"./HiliteRules.json\");\n\n/**\n * A set of model, subcategory and element ids that can be used for specifying\n * viewport hilite.\n *\n * @public\n */\nexport interface HiliteSet {\n models?: Id64String[];\n subCategories?: Id64String[];\n elements?: Id64String[];\n}\n\n/**\n * Properties for creating a `HiliteSetProvider` instance.\n * @public\n */\nexport interface HiliteSetProviderProps {\n imodel: IModelConnection;\n}\n\n/**\n * Presentation-based provider which uses presentation ruleset to determine\n * what `HiliteSet` should be hilited in the graphics viewport based on the\n * supplied `KeySet`.\n *\n * @public\n */\nexport class HiliteSetProvider {\n private _imodel: IModelConnection;\n private _cache: undefined | { keysGuid: string, observable: Observable<HiliteSet> };\n\n private constructor(props: HiliteSetProviderProps) {\n this._imodel = props.imodel;\n }\n\n /**\n * Create a hilite set provider for the specified iModel.\n */\n public static create(props: HiliteSetProviderProps) { return new HiliteSetProvider(props); }\n\n /**\n * Get hilite set for instances and/or nodes whose keys are specified in the\n * given KeySet.\n *\n * Note: The provider caches result of the last request, so subsequent requests\n * for the same input doesn't cost.\n */\n public async getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet> {\n const modelIds = new Array<Id64String>();\n const subCategoryIds = new Array<Id64String>();\n const elementIds = new Array<Id64String>();\n\n const iterator = this.getHiliteSetIterator(selection);\n for await (const set of iterator) {\n modelIds.push(...set.models ?? []);\n subCategoryIds.push(...set.subCategories ?? []);\n elementIds.push(...set.elements ?? []);\n }\n\n return {\n models: modelIds.length ? modelIds : undefined,\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\n elements: elementIds.length ? elementIds : undefined,\n };\n }\n\n /**\n * Get hilite set iterator for provided keys. It loads content in batches and\n * yields hilite set created from each batch after it is loaded.\n */\n public getHiliteSetIterator(selection: Readonly<KeySet>) {\n if (!this._cache || this._cache.keysGuid !== selection.guid) {\n this._cache = {\n keysGuid: selection.guid,\n observable: from(this.createHiliteSetIterator(selection)).pipe(shareReplay({ refCount: true })),\n };\n }\n\n return eachValueFrom(this._cache.observable);\n }\n\n private async * createHiliteSetIterator(selection: Readonly<KeySet>) {\n const {keys, transientIds} = this.handleTransientKeys(selection);\n const {options, keyBatches} = this.getContentOptions(keys);\n\n if (transientIds.length !== 0) {\n yield { elements: transientIds };\n }\n\n for (const batch of keyBatches) {\n let loadedItems = 0;\n while (true) {\n const content = await Presentation.presentation.getContentAndSize({...options, paging: {start: loadedItems, size: CONTENT_SET_PAGE_SIZE}, keys: batch});\n if (!content) {\n break;\n }\n\n const result = this.createHiliteSet(content.content.contentSet);\n yield result;\n\n loadedItems += content.content.contentSet.length;\n if (loadedItems >= content.size) {\n break;\n }\n }\n }\n }\n\n private createHiliteSet(records: Item[]): HiliteSet {\n const modelIds = new Array<Id64String>();\n const subCategoryIds = new Array<Id64String>();\n const elementIds = new Array<Id64String>();\n records.forEach((rec) => {\n const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;\n rec.primaryKeys.forEach((pk) => ids.push(pk.id));\n });\n return {\n models: modelIds.length ? modelIds : undefined,\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\n elements: elementIds.length ? elementIds : undefined,\n };\n }\n\n private getContentOptions(keys: KeySet) {\n const descriptor: DescriptorOverrides = {\n displayType: DefaultContentDisplayTypes.Viewport,\n contentFlags: ContentFlags.KeysOnly,\n };\n const options = {\n imodel: this._imodel,\n rulesetOrId: HILITE_RULESET,\n descriptor,\n };\n const keyBatches = new Array<KeySet>();\n keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch: KeySet) => {\n keyBatches.push(batch);\n });\n return {\n options,\n keyBatches,\n };\n }\n\n private handleTransientKeys(selection: Readonly<KeySet>) {\n // need to create a new set without transients\n const transientIds = new Array<Id64String>();\n const keys = new KeySet();\n keys.add(selection, (key: Key) => {\n if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {\n transientIds.push(key.id);\n return false;\n }\n return true;\n });\n return {\n transientIds,\n keys,\n };\n }\n}\n\nconst CONTENT_SET_PAGE_SIZE = 1000;\n\nconst isModelRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isModel);\n\nconst isSubCategoryRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isSubCategory);\n"]}
|
|
1
|
+
{"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,WAAW,EAAE,MAAM,MAAM,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,EAA6B,GAAG,EAAE,MAAM,EAAW,MAAM,4BAA4B,CAAC;AAChK,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEjE,gBAAgB;AAChB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAY,OAAO,CAAC,oBAAoB,CAAC,CA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KAAK,EAAU,CAAC;QACvC,IAAI,CAAC,YAAY,CAAC,uBAAuB,EAAE,CAAC,KAAa,EAAE,EAAE;YAC3D,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,OAAO;YACL,OAAO;YACP,UAAU;SACX,CAAC;IACJ,CAAC;IAEO,mBAAmB,CAAC,SAA2B;QACrD,8CAA8C;QAC9C,MAAM,YAAY,GAAG,IAAI,KAAK,EAAc,CAAC;QAC7C,MAAM,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,GAAQ,EAAE,EAAE;YAC/B,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,SAAS,KAAK,2BAA2B,EAAE;gBAC3E,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAC1B,OAAO,KAAK,CAAC;aACd;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QACH,OAAO;YACL,YAAY;YACZ,IAAI;SACL,CAAC;IACJ,CAAC;CACF;AAED,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,MAAM,aAAa,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC;AAElF,MAAM,mBAAmB,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { from, Observable, shareReplay } from \"rxjs\";\r\nimport { eachValueFrom } from \"rxjs-for-await\";\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, DescriptorOverrides, Item, Key, KeySet, Ruleset } from \"@itwin/presentation-common\";\r\nimport { Presentation } from \"../Presentation\";\r\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./SelectionManager\";\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nexport const HILITE_RULESET: Ruleset = require(\"./HiliteRules.json\");\r\n\r\n/**\r\n * A set of model, subcategory and element ids that can be used for specifying\r\n * viewport hilite.\r\n *\r\n * @public\r\n */\r\nexport interface HiliteSet {\r\n models?: Id64String[];\r\n subCategories?: Id64String[];\r\n elements?: Id64String[];\r\n}\r\n\r\n/**\r\n * Properties for creating a `HiliteSetProvider` instance.\r\n * @public\r\n */\r\nexport interface HiliteSetProviderProps {\r\n imodel: IModelConnection;\r\n}\r\n\r\n/**\r\n * Presentation-based provider which uses presentation ruleset to determine\r\n * what `HiliteSet` should be hilited in the graphics viewport based on the\r\n * supplied `KeySet`.\r\n *\r\n * @public\r\n */\r\nexport class HiliteSetProvider {\r\n private _imodel: IModelConnection;\r\n private _cache: undefined | { keysGuid: string; observable: Observable<HiliteSet> };\r\n\r\n private constructor(props: HiliteSetProviderProps) {\r\n this._imodel = props.imodel;\r\n }\r\n\r\n /**\r\n * Create a hilite set provider for the specified iModel.\r\n */\r\n public static create(props: HiliteSetProviderProps) {\r\n return new HiliteSetProvider(props);\r\n }\r\n\r\n /**\r\n * Get hilite set for instances and/or nodes whose keys are specified in the\r\n * given KeySet.\r\n *\r\n * Note: The provider caches result of the last request, so subsequent requests\r\n * for the same input doesn't cost.\r\n */\r\n public async getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet> {\r\n const modelIds = new Array<Id64String>();\r\n const subCategoryIds = new Array<Id64String>();\r\n const elementIds = new Array<Id64String>();\r\n\r\n const iterator = this.getHiliteSetIterator(selection);\r\n for await (const set of iterator) {\r\n modelIds.push(...(set.models ?? []));\r\n subCategoryIds.push(...(set.subCategories ?? []));\r\n elementIds.push(...(set.elements ?? []));\r\n }\r\n\r\n return {\r\n models: modelIds.length ? modelIds : undefined,\r\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\r\n elements: elementIds.length ? elementIds : undefined,\r\n };\r\n }\r\n\r\n /**\r\n * Get hilite set iterator for provided keys. It loads content in batches and\r\n * yields hilite set created from each batch after it is loaded.\r\n */\r\n public getHiliteSetIterator(selection: Readonly<KeySet>) {\r\n if (!this._cache || this._cache.keysGuid !== selection.guid) {\r\n this._cache = {\r\n keysGuid: selection.guid,\r\n observable: from(this.createHiliteSetIterator(selection)).pipe(shareReplay({ refCount: true })),\r\n };\r\n }\r\n\r\n return eachValueFrom(this._cache.observable);\r\n }\r\n\r\n private async *createHiliteSetIterator(selection: Readonly<KeySet>) {\r\n const { keys, transientIds } = this.handleTransientKeys(selection);\r\n const { options, keyBatches } = this.getContentOptions(keys);\r\n\r\n if (transientIds.length !== 0) {\r\n yield { elements: transientIds };\r\n }\r\n\r\n for (const batch of keyBatches) {\r\n let loadedItems = 0;\r\n while (true) {\r\n const content = await Presentation.presentation.getContentAndSize({\r\n ...options,\r\n paging: { start: loadedItems, size: CONTENT_SET_PAGE_SIZE },\r\n keys: batch,\r\n });\r\n if (!content) {\r\n break;\r\n }\r\n\r\n const result = this.createHiliteSet(content.content.contentSet);\r\n yield result;\r\n\r\n loadedItems += content.content.contentSet.length;\r\n if (loadedItems >= content.size) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n private createHiliteSet(records: Item[]): HiliteSet {\r\n const modelIds = new Array<Id64String>();\r\n const subCategoryIds = new Array<Id64String>();\r\n const elementIds = new Array<Id64String>();\r\n records.forEach((rec) => {\r\n const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;\r\n rec.primaryKeys.forEach((pk) => ids.push(pk.id));\r\n });\r\n return {\r\n models: modelIds.length ? modelIds : undefined,\r\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\r\n elements: elementIds.length ? elementIds : undefined,\r\n };\r\n }\r\n\r\n private getContentOptions(keys: KeySet) {\r\n const descriptor: DescriptorOverrides = {\r\n displayType: DefaultContentDisplayTypes.Viewport,\r\n contentFlags: ContentFlags.KeysOnly,\r\n };\r\n const options = {\r\n imodel: this._imodel,\r\n rulesetOrId: HILITE_RULESET,\r\n descriptor,\r\n };\r\n const keyBatches = new Array<KeySet>();\r\n keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch: KeySet) => {\r\n keyBatches.push(batch);\r\n });\r\n return {\r\n options,\r\n keyBatches,\r\n };\r\n }\r\n\r\n private handleTransientKeys(selection: Readonly<KeySet>) {\r\n // need to create a new set without transients\r\n const transientIds = new Array<Id64String>();\r\n const keys = new KeySet();\r\n keys.add(selection, (key: Key) => {\r\n if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {\r\n transientIds.push(key.id);\r\n return false;\r\n }\r\n return true;\r\n });\r\n return {\r\n transientIds,\r\n keys,\r\n };\r\n }\r\n}\r\n\r\nconst CONTENT_SET_PAGE_SIZE = 1000;\r\n\r\nconst isModelRecord = (rec: Item) => rec.extendedData && rec.extendedData.isModel;\r\n\r\nconst isSubCategoryRecord = (rec: Item) => rec.extendedData && rec.extendedData.isSubCategory;\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module UnifiedSelection
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { KeySet } from \"@itwin/presentation-common\";\r\nimport { SelectionChangeEvent } from \"./SelectionChangeEvent\";\r\n\r\n/**\r\n * Selection provider interface which provides main selection and sub-selection.\r\n * @public\r\n */\r\nexport interface ISelectionProvider {\r\n /** An event that's fired when selection changes */\r\n selectionChange: SelectionChangeEvent;\r\n\r\n /** Get the selection stored in the provider.\r\n * @param imodel iModel connection which the selection is associated with.\r\n * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))\r\n */\r\n getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionChangeEvent.d.ts","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,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AgB,CAAC;IAEzB,0DAA0D;IAC1D,SAAS,EAAE,IAAI,CAAC;IAEhB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module UnifiedSelection
|
|
7
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAW9C;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAiC;CAAG;AAE9E;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,0BAA0B;IAC1B,2DAAG,CAAA;IAEH,8BAA8B;IAC9B,iEAAM,CAAA;IAEN,8BAA8B;IAC9B,mEAAO,CAAA;IAEP,6BAA6B;IAC7B,+DAAK,CAAA;AACP,CAAC,EAZW,mBAAmB,KAAnB,mBAAmB,QAY9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { KeySet } from \"@itwin/presentation-common\";\r\nimport { ISelectionProvider } from \"./ISelectionProvider\";\r\n\r\n/**\r\n * An interface for selection change listeners.\r\n * @public\r\n */\r\nexport declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;\r\n\r\n/**\r\n * An event broadcasted on selection changes\r\n * @public\r\n */\r\nexport class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {}\r\n\r\n/**\r\n * The type of selection change\r\n * @public\r\n */\r\nexport enum SelectionChangeType {\r\n /** Added to selection. */\r\n Add,\r\n\r\n /** Removed from selection. */\r\n Remove,\r\n\r\n /** Selection was replaced. */\r\n Replace,\r\n\r\n /** Selection was cleared. */\r\n Clear,\r\n}\r\n\r\n/**\r\n * The event object that's sent when the selection changes.\r\n * @public\r\n */\r\nexport interface SelectionChangeEventArgs {\r\n /** The name of the selection source which caused the selection change. */\r\n source: string;\r\n\r\n /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */\r\n level: number;\r\n\r\n /** The selection change type. */\r\n changeType: SelectionChangeType;\r\n\r\n /** Set of keys affected by this selection change event. */\r\n keys: Readonly<KeySet>;\r\n\r\n /** iModel connection with which the selection is associated with. */\r\n imodel: IModelConnection;\r\n\r\n /** The timestamp of when the selection change happened */\r\n timestamp: Date;\r\n\r\n /** Id of the ruleset associated with the selection change. */\r\n rulesetId?: string;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionHandler.d.ts","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAkB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,uEAAuE;IACvE,MAAM,EAAE,gBAAgB,CAAC;IACzB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,wBAAwB,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,YAAY,CAAiB;IAErC,iEAAiE;IACjE,SAAgB,OAAO,EAAE,gBAAgB,CAAC;IAC1C,0FAA0F;IACnF,IAAI,EAAE,MAAM,CAAC;IACpB,8CAA8C;IACvC,MAAM,EAAE,gBAAgB,CAAC;IAChC;;;OAGG;IACI,SAAS,CAAC,EAAE,MAAM,CAAC;IAC1B,sDAAsD;IAC/C,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IAE3C;;OAEG;gBACS,KAAK,EAAE,qBAAqB;IAWxC;;;OAGG;IACI,OAAO,IAAI,IAAI;IAItB;;;OAGG;IAEH,SAAS,CAAC,kBAAkB,QAAS,wBAAwB,YAAY,kBAAkB,KAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"SelectionHandler.d.ts","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,O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OAAO;IAO9D,kEAAkE;IAC3D,kBAAkB,IAAI,MAAM,EAAE;IAIrC;;;OAGG;IACI,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAIrD;;;;OAIG;IACI,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAE,MAAU,GAAG,IAAI;IAQ1D;;;;OAIG;IACI,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAE,MAAU,GAAG,IAAI;IAQ/D;;;;OAIG;IACI,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,GAAE,MAAU,GAAG,IAAI;IAQ5D;;;OAGG;IACI,cAAc,CAAC,KAAK,GAAE,MAAU,GAAG,IAAI;CAO/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module UnifiedSelection
|
|
7
7
|
*/
|
|
@@ -23,8 +23,9 @@ export class SelectionHandler {
|
|
|
23
23
|
*/
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
25
|
this.onSelectionChanged = (evt, provider) => {
|
|
26
|
-
if (!this.onSelect || !this.shouldHandle(evt))
|
|
26
|
+
if (!this.onSelect || !this.shouldHandle(evt)) {
|
|
27
27
|
return;
|
|
28
|
+
}
|
|
28
29
|
this._inSelect = true;
|
|
29
30
|
this.onSelect(evt, provider);
|
|
30
31
|
this._inSelect = false;
|
|
@@ -47,8 +48,9 @@ export class SelectionHandler {
|
|
|
47
48
|
}
|
|
48
49
|
/** Called to check whether the event should be handled by this handler */
|
|
49
50
|
shouldHandle(evt) {
|
|
50
|
-
if (this.name === evt.source)
|
|
51
|
+
if (this.name === evt.source) {
|
|
51
52
|
return false;
|
|
53
|
+
}
|
|
52
54
|
return true;
|
|
53
55
|
}
|
|
54
56
|
/** Get selection levels for the imodel managed by this handler */
|
|
@@ -68,8 +70,9 @@ export class SelectionHandler {
|
|
|
68
70
|
* @param level Level of the selection.
|
|
69
71
|
*/
|
|
70
72
|
addToSelection(keys, level = 0) {
|
|
71
|
-
if (this._inSelect)
|
|
73
|
+
if (this._inSelect) {
|
|
72
74
|
return;
|
|
75
|
+
}
|
|
73
76
|
return this.manager.addToSelection(this.name, this.imodel, keys, level, this.rulesetId);
|
|
74
77
|
}
|
|
75
78
|
/**
|
|
@@ -78,8 +81,9 @@ export class SelectionHandler {
|
|
|
78
81
|
* @param level Level of the selection.
|
|
79
82
|
*/
|
|
80
83
|
removeFromSelection(keys, level = 0) {
|
|
81
|
-
if (this._inSelect)
|
|
84
|
+
if (this._inSelect) {
|
|
82
85
|
return;
|
|
86
|
+
}
|
|
83
87
|
return this.manager.removeFromSelection(this.name, this.imodel, keys, level, this.rulesetId);
|
|
84
88
|
}
|
|
85
89
|
/**
|
|
@@ -88,8 +92,9 @@ export class SelectionHandler {
|
|
|
88
92
|
* @param level Level of the selection.
|
|
89
93
|
*/
|
|
90
94
|
replaceSelection(keys, level = 0) {
|
|
91
|
-
if (this._inSelect)
|
|
95
|
+
if (this._inSelect) {
|
|
92
96
|
return;
|
|
97
|
+
}
|
|
93
98
|
return this.manager.replaceSelection(this.name, this.imodel, keys, level, this.rulesetId);
|
|
94
99
|
}
|
|
95
100
|
/**
|
|
@@ -97,8 +102,9 @@ export class SelectionHandler {
|
|
|
97
102
|
* @param level Level of the selection.
|
|
98
103
|
*/
|
|
99
104
|
clearSelection(level = 0) {
|
|
100
|
-
if (this._inSelect)
|
|
105
|
+
if (this._inSelect) {
|
|
101
106
|
return;
|
|
107
|
+
}
|
|
102
108
|
return this.manager.clearSelection(this.name, this.imodel, level, this.rulesetId);
|
|
103
109
|
}
|
|
104
110
|
}
|