@itwin/presentation-frontend 3.5.0-dev.63 → 3.5.0-dev.66
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 +16 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +47 -47
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/Diagnostics.d.ts +14 -14
- package/lib/cjs/presentation-frontend/Diagnostics.js +61 -61
- package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +20 -20
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +42 -42
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +10 -10
- package/lib/cjs/presentation-frontend/LocalizationHelper.js +31 -31
- package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.d.ts +75 -75
- package/lib/cjs/presentation-frontend/Presentation.js +162 -162
- package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts +180 -180
- package/lib/cjs/presentation-frontend/PresentationManager.js +419 -419
- package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.d.ts +60 -60
- package/lib/cjs/presentation-frontend/RulesetManager.js +85 -85
- package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +195 -195
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/StateTracker.d.ts +23 -23
- package/lib/cjs/presentation-frontend/StateTracker.js +74 -74
- package/lib/cjs/presentation-frontend/StateTracker.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +525 -525
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +293 -293
- 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 +52 -52
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +97 -97
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +9 -9
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +33 -33
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +108 -108
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +14 -14
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +37 -37
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +139 -139
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js +414 -414
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +91 -91
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend.d.ts +34 -34
- package/lib/cjs/presentation-frontend.js +50 -50
- package/lib/cjs/presentation-frontend.js.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +43 -43
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/Diagnostics.d.ts +14 -14
- package/lib/esm/presentation-frontend/Diagnostics.js +56 -56
- package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +17 -17
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js +38 -38
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +10 -10
- package/lib/esm/presentation-frontend/LocalizationHelper.js +27 -27
- package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.d.ts +75 -75
- package/lib/esm/presentation-frontend/Presentation.js +158 -158
- package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.d.ts +180 -180
- package/lib/esm/presentation-frontend/PresentationManager.js +414 -414
- package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.d.ts +60 -60
- package/lib/esm/presentation-frontend/RulesetManager.js +81 -81
- package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js +191 -191
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/StateTracker.d.ts +23 -23
- package/lib/esm/presentation-frontend/StateTracker.js +70 -70
- package/lib/esm/presentation-frontend/StateTracker.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +519 -519
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +285 -285
- 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 +52 -52
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +93 -93
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +8 -8
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +29 -29
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js +104 -104
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +14 -14
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js +33 -33
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +139 -139
- package/lib/esm/presentation-frontend/selection/SelectionManager.js +409 -409
- package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +85 -85
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/esm/presentation-frontend.d.ts +34 -34
- package/lib/esm/presentation-frontend.js +38 -38
- package/lib/esm/presentation-frontend.js.map +1 -1
- package/package.json +14 -14
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Core
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.StateTracker = void 0;
|
|
11
|
-
/** @internal */
|
|
12
|
-
class StateTracker {
|
|
13
|
-
constructor(ipcRequestsHandler) {
|
|
14
|
-
this._ipcRequestsHandler = ipcRequestsHandler;
|
|
15
|
-
this._expandedHierarchies = new Map();
|
|
16
|
-
}
|
|
17
|
-
async updateHierarchyStateIfNeeded(imodelKey, rulesetId, changeType, nodeKeys) {
|
|
18
|
-
if (nodeKeys.length === 0)
|
|
19
|
-
return;
|
|
20
|
-
await this._ipcRequestsHandler.updateHierarchyState({ imodelKey, rulesetId, changeType, nodeKeys });
|
|
21
|
-
}
|
|
22
|
-
async onHierarchyClosed(imodel, rulesetId, sourceId) {
|
|
23
|
-
const hierarchy = this._expandedHierarchies.get(rulesetId);
|
|
24
|
-
if (!hierarchy)
|
|
25
|
-
return;
|
|
26
|
-
const removedKeys = [];
|
|
27
|
-
for (const [nodeId, expandedNode] of hierarchy) {
|
|
28
|
-
expandedNode.expandedIn.delete(sourceId);
|
|
29
|
-
// if there are other sources that have this node expanded leave it.
|
|
30
|
-
if (expandedNode.expandedIn.size !== 0)
|
|
31
|
-
continue;
|
|
32
|
-
hierarchy.delete(nodeId);
|
|
33
|
-
removedKeys.push(expandedNode.key);
|
|
34
|
-
}
|
|
35
|
-
if (hierarchy.size === 0)
|
|
36
|
-
this._expandedHierarchies.delete(rulesetId);
|
|
37
|
-
await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, "nodesCollapsed", removedKeys);
|
|
38
|
-
}
|
|
39
|
-
async onExpandedNodesChanged(imodel, rulesetId, sourceId, expandedNodes) {
|
|
40
|
-
let hierarchy = this._expandedHierarchies.get(rulesetId);
|
|
41
|
-
if (expandedNodes.length === 0 && !hierarchy)
|
|
42
|
-
return;
|
|
43
|
-
if (!hierarchy) {
|
|
44
|
-
hierarchy = new Map();
|
|
45
|
-
this._expandedHierarchies.set(rulesetId, hierarchy);
|
|
46
|
-
}
|
|
47
|
-
const removedKeys = [];
|
|
48
|
-
const addedKeys = [];
|
|
49
|
-
for (const [key, existingNode] of hierarchy) {
|
|
50
|
-
// existing node is in new expanded nodes list. Add current source
|
|
51
|
-
if (expandedNodes.find((expandedNode) => expandedNode.id === key)) {
|
|
52
|
-
existingNode.expandedIn.add(sourceId);
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
// node was not found in expanded nodes list. Remove current source
|
|
56
|
-
existingNode.expandedIn.delete(sourceId);
|
|
57
|
-
if (existingNode.expandedIn.size !== 0)
|
|
58
|
-
continue;
|
|
59
|
-
removedKeys.push(existingNode.key);
|
|
60
|
-
hierarchy.delete(key);
|
|
61
|
-
}
|
|
62
|
-
// add any new nodes that were not in expanded nodes hierarchy already
|
|
63
|
-
for (const expandedNode of expandedNodes) {
|
|
64
|
-
const existingNode = hierarchy.get(expandedNode.id);
|
|
65
|
-
if (existingNode)
|
|
66
|
-
continue;
|
|
67
|
-
hierarchy.set(expandedNode.id, { key: expandedNode.key, expandedIn: new Set([sourceId]) });
|
|
68
|
-
addedKeys.push(expandedNode.key);
|
|
69
|
-
}
|
|
70
|
-
await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, "nodesCollapsed", removedKeys);
|
|
71
|
-
await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, "nodesExpanded", addedKeys);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.StateTracker = StateTracker;
|
|
1
|
+
"use strict";
|
|
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
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Core
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StateTracker = void 0;
|
|
11
|
+
/** @internal */
|
|
12
|
+
class StateTracker {
|
|
13
|
+
constructor(ipcRequestsHandler) {
|
|
14
|
+
this._ipcRequestsHandler = ipcRequestsHandler;
|
|
15
|
+
this._expandedHierarchies = new Map();
|
|
16
|
+
}
|
|
17
|
+
async updateHierarchyStateIfNeeded(imodelKey, rulesetId, changeType, nodeKeys) {
|
|
18
|
+
if (nodeKeys.length === 0)
|
|
19
|
+
return;
|
|
20
|
+
await this._ipcRequestsHandler.updateHierarchyState({ imodelKey, rulesetId, changeType, nodeKeys });
|
|
21
|
+
}
|
|
22
|
+
async onHierarchyClosed(imodel, rulesetId, sourceId) {
|
|
23
|
+
const hierarchy = this._expandedHierarchies.get(rulesetId);
|
|
24
|
+
if (!hierarchy)
|
|
25
|
+
return;
|
|
26
|
+
const removedKeys = [];
|
|
27
|
+
for (const [nodeId, expandedNode] of hierarchy) {
|
|
28
|
+
expandedNode.expandedIn.delete(sourceId);
|
|
29
|
+
// if there are other sources that have this node expanded leave it.
|
|
30
|
+
if (expandedNode.expandedIn.size !== 0)
|
|
31
|
+
continue;
|
|
32
|
+
hierarchy.delete(nodeId);
|
|
33
|
+
removedKeys.push(expandedNode.key);
|
|
34
|
+
}
|
|
35
|
+
if (hierarchy.size === 0)
|
|
36
|
+
this._expandedHierarchies.delete(rulesetId);
|
|
37
|
+
await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, "nodesCollapsed", removedKeys);
|
|
38
|
+
}
|
|
39
|
+
async onExpandedNodesChanged(imodel, rulesetId, sourceId, expandedNodes) {
|
|
40
|
+
let hierarchy = this._expandedHierarchies.get(rulesetId);
|
|
41
|
+
if (expandedNodes.length === 0 && !hierarchy)
|
|
42
|
+
return;
|
|
43
|
+
if (!hierarchy) {
|
|
44
|
+
hierarchy = new Map();
|
|
45
|
+
this._expandedHierarchies.set(rulesetId, hierarchy);
|
|
46
|
+
}
|
|
47
|
+
const removedKeys = [];
|
|
48
|
+
const addedKeys = [];
|
|
49
|
+
for (const [key, existingNode] of hierarchy) {
|
|
50
|
+
// existing node is in new expanded nodes list. Add current source
|
|
51
|
+
if (expandedNodes.find((expandedNode) => expandedNode.id === key)) {
|
|
52
|
+
existingNode.expandedIn.add(sourceId);
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
// node was not found in expanded nodes list. Remove current source
|
|
56
|
+
existingNode.expandedIn.delete(sourceId);
|
|
57
|
+
if (existingNode.expandedIn.size !== 0)
|
|
58
|
+
continue;
|
|
59
|
+
removedKeys.push(existingNode.key);
|
|
60
|
+
hierarchy.delete(key);
|
|
61
|
+
}
|
|
62
|
+
// add any new nodes that were not in expanded nodes hierarchy already
|
|
63
|
+
for (const expandedNode of expandedNodes) {
|
|
64
|
+
const existingNode = hierarchy.get(expandedNode.id);
|
|
65
|
+
if (existingNode)
|
|
66
|
+
continue;
|
|
67
|
+
hierarchy.set(expandedNode.id, { key: expandedNode.key, expandedIn: new Set([sourceId]) });
|
|
68
|
+
addedKeys.push(expandedNode.key);
|
|
69
|
+
}
|
|
70
|
+
await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, "nodesCollapsed", removedKeys);
|
|
71
|
+
await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, "nodesExpanded", addedKeys);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.StateTracker = StateTracker;
|
|
75
75
|
//# sourceMappingURL=StateTracker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTracker.js","sourceRoot":"","sources":["../../../src/presentation-frontend/StateTracker.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA2BH,gBAAgB;AAChB,MAAa,YAAY;IAIvB,YAAY,kBAAsC;QAChD,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAC;QAC9C,IAAI,CAAC,oBAAoB,GAAG,IAAI,GAAG,EAA6B,CAAC;IACnE,CAAC;IAEO,KAAK,CAAC,4BAA4B,CAAC,SAAiB,EAAE,SAAiB,EAAE,UAA8C,EAAE,QAAmB;QAClJ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO;QACT,MAAM,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtG,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,MAAwB,EAAE,SAAiB,EAAE,QAAgB;QAC1F,MAAM,SAAS,GAAG,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,SAAS,CA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AC,YAAY,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE;gBACjE,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBACtC,SAAS;aACV;YAED,mEAAmE;YACnE,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACzC,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;gBACpC,SAAS;YAEX,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YACnC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;QAED,sEAAsE;QACtE,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;YACxC,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;YACpD,IAAI,YAAY;gBACd,SAAS;YAEX,SAAS,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,GAAG,CAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC;YACnG,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;SAClC;QAED,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;QAC9F,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;IAC7F,CAAC;CACF;AA7ED,oCA6EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"StateTracker.js","sourceRoot":"","sources":["../../../src/presentation-frontend/StateTracker.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA2BH,gBAAgB;AAChB,MAAa,YAAY;IAIvB,YAAY,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AE,CAAC,CAAC;YACnG,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;SAClC;QAED,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;QAC9F,MAAM,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;IAC7F,CAAC;CACF;AA7ED,oCA6EC","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/** @packageDocumentation\n * @module Core\n */\n\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { NodeKey } from \"@itwin/presentation-common\";\nimport { IpcRequestsHandler } from \"./IpcRequestsHandler\";\n\n/**\n * Data structure that describes information used by [[StateTracker]] to identify node.\n * @internal\n */\nexport interface NodeIdentifier {\n id: string;\n key: NodeKey;\n}\n\n/**\n * Data structure that describes expanded node.\n */\ninterface ExpandedNode {\n key: NodeKey;\n /** Set of source ids in which this node is expanded. */\n expandedIn: Set<string>;\n}\n\n/** Maps node ids to expanded nodes. */\ntype ExpandedHierarchy = Map<string, ExpandedNode>;\n\n/** @internal */\nexport class StateTracker {\n private _expandedHierarchies: Map<string, ExpandedHierarchy>;\n private _ipcRequestsHandler: IpcRequestsHandler;\n\n constructor(ipcRequestsHandler: IpcRequestsHandler) {\n this._ipcRequestsHandler = ipcRequestsHandler;\n this._expandedHierarchies = new Map<string, ExpandedHierarchy>();\n }\n\n private async updateHierarchyStateIfNeeded(imodelKey: string, rulesetId: string, changeType: \"nodesExpanded\" | \"nodesCollapsed\", nodeKeys: NodeKey[]) {\n if (nodeKeys.length === 0)\n return;\n await this._ipcRequestsHandler.updateHierarchyState({ imodelKey, rulesetId, changeType, nodeKeys });\n }\n\n public async onHierarchyClosed(imodel: IModelConnection, rulesetId: string, sourceId: string) {\n const hierarchy = this._expandedHierarchies.get(rulesetId);\n if (!hierarchy)\n return;\n\n const removedKeys: NodeKey[] = [];\n for (const [nodeId, expandedNode] of hierarchy) {\n expandedNode.expandedIn.delete(sourceId);\n // if there are other sources that have this node expanded leave it.\n if (expandedNode.expandedIn.size !== 0)\n continue;\n\n hierarchy.delete(nodeId);\n removedKeys.push(expandedNode.key);\n }\n\n if (hierarchy.size === 0)\n this._expandedHierarchies.delete(rulesetId);\n\n await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, \"nodesCollapsed\", removedKeys);\n }\n\n public async onExpandedNodesChanged(imodel: IModelConnection, rulesetId: string, sourceId: string, expandedNodes: NodeIdentifier[]) {\n let hierarchy = this._expandedHierarchies.get(rulesetId);\n if (expandedNodes.length === 0 && !hierarchy)\n return;\n if (!hierarchy) {\n hierarchy = new Map<string, ExpandedNode>();\n this._expandedHierarchies.set(rulesetId, hierarchy);\n }\n\n const removedKeys: NodeKey[] = [];\n const addedKeys: NodeKey[] = [];\n for (const [key, existingNode] of hierarchy) {\n // existing node is in new expanded nodes list. Add current source\n if (expandedNodes.find((expandedNode) => expandedNode.id === key)) {\n existingNode.expandedIn.add(sourceId);\n continue;\n }\n\n // node was not found in expanded nodes list. Remove current source\n existingNode.expandedIn.delete(sourceId);\n if (existingNode.expandedIn.size !== 0)\n continue;\n\n removedKeys.push(existingNode.key);\n hierarchy.delete(key);\n }\n\n // add any new nodes that were not in expanded nodes hierarchy already\n for (const expandedNode of expandedNodes) {\n const existingNode = hierarchy.get(expandedNode.id);\n if (existingNode)\n continue;\n\n hierarchy.set(expandedNode.id, { key: expandedNode.key, expandedIn: new Set<string>([sourceId]) });\n addedKeys.push(expandedNode.key);\n }\n\n await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, \"nodesCollapsed\", removedKeys);\n await this.updateHierarchyStateIfNeeded(imodel.key, rulesetId, \"nodesExpanded\", addedKeys);\n }\n}\n"]}
|
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Core
|
|
3
|
-
*/
|
|
4
|
-
import { BeEvent, IDisposable } from "@itwin/core-bentley";
|
|
5
|
-
import { IModelConnection } from "@itwin/core-frontend";
|
|
6
|
-
import { Field } from "@itwin/presentation-common";
|
|
7
|
-
import { IFavoritePropertiesStorage } from "./FavoritePropertiesStorage";
|
|
8
|
-
/**
|
|
9
|
-
* Scopes that favorite properties can be stored in.
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare enum FavoritePropertiesScope {
|
|
13
|
-
Global = 0,
|
|
14
|
-
ITwin = 1,
|
|
15
|
-
IModel = 2
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Format:
|
|
19
|
-
* Regular property - [{path from parent class}-]{schema name}:{class name}:{property name}.
|
|
20
|
-
* Nested property - [{path from parent class}-]{content class schema name}:{content class name}.
|
|
21
|
-
* Primitive property - {field name}.
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
export declare type PropertyFullName = string;
|
|
25
|
-
/**
|
|
26
|
-
* Holds the information of favorite properties ordering.
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
29
|
-
export interface FavoritePropertiesOrderInfo {
|
|
30
|
-
parentClassName: string | undefined;
|
|
31
|
-
name: PropertyFullName;
|
|
32
|
-
priority: number;
|
|
33
|
-
orderedTimestamp: Date;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Properties for initializing [[FavoritePropertiesManager]]
|
|
37
|
-
* @public
|
|
38
|
-
*/
|
|
39
|
-
export interface FavoritePropertiesManagerProps {
|
|
40
|
-
/**
|
|
41
|
-
* Implementation of a persistence layer for storing favorite properties and their order.
|
|
42
|
-
* @public
|
|
43
|
-
*/
|
|
44
|
-
storage: IFavoritePropertiesStorage;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The favorite property manager which lets to store favorite properties
|
|
48
|
-
* and check if field contains favorite properties.
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
export declare class FavoritePropertiesManager implements IDisposable {
|
|
53
|
-
/**
|
|
54
|
-
* Used in tests to avoid collisions between multiple runs using the same storage
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
57
|
-
static FAVORITES_IDENTIFIER_PREFIX: string;
|
|
58
|
-
/** Event raised after favorite properties have changed. */
|
|
59
|
-
onFavoritesChanged: BeEvent<() => void>;
|
|
60
|
-
private _storage;
|
|
61
|
-
private _globalProperties;
|
|
62
|
-
private _iTwinProperties;
|
|
63
|
-
private _imodelProperties;
|
|
64
|
-
private _imodelBaseClassesByClass;
|
|
65
|
-
/** Property order is saved only in iModel scope */
|
|
66
|
-
private _propertiesOrder;
|
|
67
|
-
constructor(props: FavoritePropertiesManagerProps);
|
|
68
|
-
dispose(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Initialize favorite properties for the provided IModelConnection.
|
|
71
|
-
*/
|
|
72
|
-
initializeConnection: (imodel: IModelConnection) => Promise<void>;
|
|
73
|
-
/**
|
|
74
|
-
* Function that removes order information of properties that are no longer
|
|
75
|
-
* favorited and adds missing order information for favorited properties.
|
|
76
|
-
*/
|
|
77
|
-
private _adjustPropertyOrderInfos;
|
|
78
|
-
private validateInitialization;
|
|
79
|
-
/**
|
|
80
|
-
* Adds favorite properties into a certain scope.
|
|
81
|
-
* @param field Field that contains properties. If field contains multiple properties, all of them will be favorited.
|
|
82
|
-
* @param imodel IModelConnection.
|
|
83
|
-
* @param scope FavoritePropertiesScope to put the favorite properties into.
|
|
84
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
85
|
-
*/
|
|
86
|
-
add(field: Field, imodel: IModelConnection, scope: FavoritePropertiesScope): Promise<void>;
|
|
87
|
-
/**
|
|
88
|
-
* Removes favorite properties from a scope specified and all the more general scopes.
|
|
89
|
-
* @param field Field that contains properties. If field contains multiple properties, all of them will be un-favorited.
|
|
90
|
-
* @param imodel IModelConnection.
|
|
91
|
-
* @param scope FavoritePropertiesScope to remove the favorite properties from. It also removes from more general scopes.
|
|
92
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
93
|
-
*/
|
|
94
|
-
remove(field: Field, imodel: IModelConnection, scope: FavoritePropertiesScope): Promise<void>;
|
|
95
|
-
/**
|
|
96
|
-
* Removes all favorite properties from a certain scope.
|
|
97
|
-
* @param imodel IModelConnection.
|
|
98
|
-
* @param scope FavoritePropertiesScope to remove the favorite properties from.
|
|
99
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
100
|
-
*/
|
|
101
|
-
clear(imodel: IModelConnection, scope: FavoritePropertiesScope): Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Check if field contains at least one favorite property.
|
|
104
|
-
* @param field Field that contains properties.
|
|
105
|
-
* @param imodel IModelConnection.
|
|
106
|
-
* @param scope FavoritePropertiesScope to check for favorite properties. It also checks the more general scopes.
|
|
107
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
108
|
-
*/
|
|
109
|
-
has(field: Field, imodel: IModelConnection, scope: FavoritePropertiesScope): boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Sorts an array of fields with respect to favorite property order.
|
|
112
|
-
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
113
|
-
* @param imodel IModelConnection.
|
|
114
|
-
* @param fields Array of Field's that needs to be sorted.
|
|
115
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
116
|
-
*/
|
|
117
|
-
sortFields: (imodel: IModelConnection, fields: Field[]) => Field[];
|
|
118
|
-
private getFieldPriority;
|
|
119
|
-
private _getBaseClassesByClass;
|
|
120
|
-
/** Changes field properties priorities to lower than another fields priority
|
|
121
|
-
* @param imodel IModelConnection.
|
|
122
|
-
* @param field Field that priority is being changed.
|
|
123
|
-
* @param afterField Field that goes before the moved field. If undefined the moving field is changed to the highest priority (to the top).
|
|
124
|
-
* @param visibleFields Array of fields to move the field in.
|
|
125
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
126
|
-
*/
|
|
127
|
-
changeFieldPriority(imodel: IModelConnection, field: Field, afterField: Field | undefined, visibleFields: Field[]): Promise<void>;
|
|
128
|
-
}
|
|
129
|
-
/** @internal */
|
|
130
|
-
export declare const getFieldInfos: (field: Field) => Set<PropertyFullName>;
|
|
131
|
-
/** @internal */
|
|
132
|
-
export declare const createFieldOrderInfos: (field: Field) => FavoritePropertiesOrderInfo[];
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Core
|
|
3
|
+
*/
|
|
4
|
+
import { BeEvent, IDisposable } from "@itwin/core-bentley";
|
|
5
|
+
import { IModelConnection } from "@itwin/core-frontend";
|
|
6
|
+
import { Field } from "@itwin/presentation-common";
|
|
7
|
+
import { IFavoritePropertiesStorage } from "./FavoritePropertiesStorage";
|
|
8
|
+
/**
|
|
9
|
+
* Scopes that favorite properties can be stored in.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare enum FavoritePropertiesScope {
|
|
13
|
+
Global = 0,
|
|
14
|
+
ITwin = 1,
|
|
15
|
+
IModel = 2
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Format:
|
|
19
|
+
* Regular property - [{path from parent class}-]{schema name}:{class name}:{property name}.
|
|
20
|
+
* Nested property - [{path from parent class}-]{content class schema name}:{content class name}.
|
|
21
|
+
* Primitive property - {field name}.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare type PropertyFullName = string;
|
|
25
|
+
/**
|
|
26
|
+
* Holds the information of favorite properties ordering.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export interface FavoritePropertiesOrderInfo {
|
|
30
|
+
parentClassName: string | undefined;
|
|
31
|
+
name: PropertyFullName;
|
|
32
|
+
priority: number;
|
|
33
|
+
orderedTimestamp: Date;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Properties for initializing [[FavoritePropertiesManager]]
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export interface FavoritePropertiesManagerProps {
|
|
40
|
+
/**
|
|
41
|
+
* Implementation of a persistence layer for storing favorite properties and their order.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
storage: IFavoritePropertiesStorage;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The favorite property manager which lets to store favorite properties
|
|
48
|
+
* and check if field contains favorite properties.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare class FavoritePropertiesManager implements IDisposable {
|
|
53
|
+
/**
|
|
54
|
+
* Used in tests to avoid collisions between multiple runs using the same storage
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
static FAVORITES_IDENTIFIER_PREFIX: string;
|
|
58
|
+
/** Event raised after favorite properties have changed. */
|
|
59
|
+
onFavoritesChanged: BeEvent<() => void>;
|
|
60
|
+
private _storage;
|
|
61
|
+
private _globalProperties;
|
|
62
|
+
private _iTwinProperties;
|
|
63
|
+
private _imodelProperties;
|
|
64
|
+
private _imodelBaseClassesByClass;
|
|
65
|
+
/** Property order is saved only in iModel scope */
|
|
66
|
+
private _propertiesOrder;
|
|
67
|
+
constructor(props: FavoritePropertiesManagerProps);
|
|
68
|
+
dispose(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Initialize favorite properties for the provided IModelConnection.
|
|
71
|
+
*/
|
|
72
|
+
initializeConnection: (imodel: IModelConnection) => Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Function that removes order information of properties that are no longer
|
|
75
|
+
* favorited and adds missing order information for favorited properties.
|
|
76
|
+
*/
|
|
77
|
+
private _adjustPropertyOrderInfos;
|
|
78
|
+
private validateInitialization;
|
|
79
|
+
/**
|
|
80
|
+
* Adds favorite properties into a certain scope.
|
|
81
|
+
* @param field Field that contains properties. If field contains multiple properties, all of them will be favorited.
|
|
82
|
+
* @param imodel IModelConnection.
|
|
83
|
+
* @param scope FavoritePropertiesScope to put the favorite properties into.
|
|
84
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
85
|
+
*/
|
|
86
|
+
add(field: Field, imodel: IModelConnection, scope: FavoritePropertiesScope): Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Removes favorite properties from a scope specified and all the more general scopes.
|
|
89
|
+
* @param field Field that contains properties. If field contains multiple properties, all of them will be un-favorited.
|
|
90
|
+
* @param imodel IModelConnection.
|
|
91
|
+
* @param scope FavoritePropertiesScope to remove the favorite properties from. It also removes from more general scopes.
|
|
92
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
93
|
+
*/
|
|
94
|
+
remove(field: Field, imodel: IModelConnection, scope: FavoritePropertiesScope): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Removes all favorite properties from a certain scope.
|
|
97
|
+
* @param imodel IModelConnection.
|
|
98
|
+
* @param scope FavoritePropertiesScope to remove the favorite properties from.
|
|
99
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
100
|
+
*/
|
|
101
|
+
clear(imodel: IModelConnection, scope: FavoritePropertiesScope): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Check if field contains at least one favorite property.
|
|
104
|
+
* @param field Field that contains properties.
|
|
105
|
+
* @param imodel IModelConnection.
|
|
106
|
+
* @param scope FavoritePropertiesScope to check for favorite properties. It also checks the more general scopes.
|
|
107
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
108
|
+
*/
|
|
109
|
+
has(field: Field, imodel: IModelConnection, scope: FavoritePropertiesScope): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Sorts an array of fields with respect to favorite property order.
|
|
112
|
+
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
113
|
+
* @param imodel IModelConnection.
|
|
114
|
+
* @param fields Array of Field's that needs to be sorted.
|
|
115
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
116
|
+
*/
|
|
117
|
+
sortFields: (imodel: IModelConnection, fields: Field[]) => Field[];
|
|
118
|
+
private getFieldPriority;
|
|
119
|
+
private _getBaseClassesByClass;
|
|
120
|
+
/** Changes field properties priorities to lower than another fields priority
|
|
121
|
+
* @param imodel IModelConnection.
|
|
122
|
+
* @param field Field that priority is being changed.
|
|
123
|
+
* @param afterField Field that goes before the moved field. If undefined the moving field is changed to the highest priority (to the top).
|
|
124
|
+
* @param visibleFields Array of fields to move the field in.
|
|
125
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
126
|
+
*/
|
|
127
|
+
changeFieldPriority(imodel: IModelConnection, field: Field, afterField: Field | undefined, visibleFields: Field[]): Promise<void>;
|
|
128
|
+
}
|
|
129
|
+
/** @internal */
|
|
130
|
+
export declare const getFieldInfos: (field: Field) => Set<PropertyFullName>;
|
|
131
|
+
/** @internal */
|
|
132
|
+
export declare const createFieldOrderInfos: (field: Field) => FavoritePropertiesOrderInfo[];
|
|
133
133
|
//# sourceMappingURL=FavoritePropertiesManager.d.ts.map
|