@itwin/presentation-frontend 5.0.0-dev.1 → 5.0.0-dev.100
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 +75 -1
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +3 -3
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +11 -9
- package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-frontend/IModelConnectionInitialization.d.ts +13 -0
- package/lib/cjs/presentation-frontend/IModelConnectionInitialization.d.ts.map +1 -0
- package/lib/cjs/presentation-frontend/IModelConnectionInitialization.js +22 -0
- package/lib/cjs/presentation-frontend/IModelConnectionInitialization.js.map +1 -0
- package/lib/cjs/presentation-frontend/InternalSymbols.d.ts +6 -0
- package/lib/cjs/presentation-frontend/InternalSymbols.d.ts.map +1 -0
- package/lib/cjs/presentation-frontend/InternalSymbols.js +17 -0
- package/lib/cjs/presentation-frontend/InternalSymbols.js.map +1 -0
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +12 -3
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +7 -7
- package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +1 -1
- package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/LocalizationHelper.js +7 -6
- package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.d.ts +15 -14
- package/lib/cjs/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/Presentation.js +31 -45
- package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts +12 -23
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.js +81 -78
- package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.js +2 -4
- package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +2 -4
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +6 -4
- package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.d.ts +1 -1
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js +1 -0
- package/lib/cjs/presentation-frontend/StreamedResponseGenerator.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +9 -19
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +163 -153
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +4 -5
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +27 -29
- package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +3 -0
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +10 -4
- package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +2 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +1 -0
- package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +5 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +3 -0
- package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +8 -5
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +35 -13
- package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +2 -0
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +3 -1
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +31 -15
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js +218 -120
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +11 -9
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +6 -11
- package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/cjs/presentation-frontend.d.ts +15 -15
- package/lib/cjs/presentation-frontend.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend.js +30 -29
- package/lib/cjs/presentation-frontend.js.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +3 -3
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +11 -9
- package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-frontend/IModelConnectionInitialization.d.ts +13 -0
- package/lib/esm/presentation-frontend/IModelConnectionInitialization.d.ts.map +1 -0
- package/lib/esm/presentation-frontend/IModelConnectionInitialization.js +17 -0
- package/lib/esm/presentation-frontend/IModelConnectionInitialization.js.map +1 -0
- package/lib/esm/presentation-frontend/InternalSymbols.d.ts +6 -0
- package/lib/esm/presentation-frontend/InternalSymbols.d.ts.map +1 -0
- package/lib/esm/presentation-frontend/InternalSymbols.js +14 -0
- package/lib/esm/presentation-frontend/InternalSymbols.js.map +1 -0
- package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +12 -3
- package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js +8 -8
- package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +1 -1
- package/lib/esm/presentation-frontend/LocalizationHelper.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/LocalizationHelper.js +3 -2
- package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.d.ts +15 -14
- package/lib/esm/presentation-frontend/Presentation.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/Presentation.js +24 -38
- package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.d.ts +12 -23
- package/lib/esm/presentation-frontend/PresentationManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.js +67 -64
- package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.js +2 -4
- package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +2 -4
- package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js +6 -4
- package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.d.ts +1 -1
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.js +1 -0
- package/lib/esm/presentation-frontend/StreamedResponseGenerator.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +9 -19
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +164 -154
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +4 -5
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +27 -29
- package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +3 -0
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +9 -3
- package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +2 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +1 -0
- package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +5 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +3 -0
- package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +8 -5
- package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js +35 -13
- package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +2 -0
- package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js +3 -1
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +31 -15
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.js +204 -106
- package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +11 -9
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +7 -11
- package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
- package/lib/esm/presentation-frontend.d.ts +15 -15
- package/lib/esm/presentation-frontend.d.ts.map +1 -1
- package/lib/esm/presentation-frontend.js +12 -15
- package/lib/esm/presentation-frontend.js.map +1 -1
- package/package.json +43 -43
package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritePropertiesManager.d.ts","sourceRoot":"","sources":["../../../../src/presentation-frontend/favorite-properties/FavoritePropertiesManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"FavoritePropertiesManager.d.ts","sourceRoot":"","sources":["../../../../src/presentation-frontend/favorite-properties/FavoritePropertiesManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAA+B,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAW,KAAK,EAAuC,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAG5E;;;GAGG;AACH,oBAAY,uBAAuB;IACjC,MAAM,IAAA;IACN,KAAK,IAAA;IACL,MAAM,IAAA;CACP;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,IAAI,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,UAAU;IAC1D,2DAA2D;IACpD,kBAAkB,gBAAqB,IAAI,EAAI;IAEtD,SAAgB,OAAO,EAAE,0BAA0B,CAAC;IAEpD,OAAO,CAAC,iBAAiB,CAAoC;IAC7D,OAAO,CAAC,gBAAgB,CAAqC;IAC7D,OAAO,CAAC,iBAAiB,CAAqC;IAC9D,OAAO,CAAC,yBAAyB,CAAiD;IAClF,OAAO,CAAC,6BAA6B,CAAuC;IAC5E,OAAO,CAAC,4BAA4B,CAAwC;IAE5E,mDAAmD;IACnD,OAAO,CAAC,gBAAgB,CAA6C;gBAElD,KAAK,EAAE,8BAA8B;IAejD,CAAC,MAAM,CAAC,OAAO,CAAC;IAWvB,uDAAuD;IAEhD,OAAO;IAId;;;OAGG;IACI,oBAAoB,WAAkB,gBAAgB,mBAoB3D;IAEF;;;OAGG;IACH,OAAO,CAAC,yBAAyB,CA4B/B;IAEF,OAAO,CAAC,aAAa;IAMrB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,6BAA6B;YAOvB,iBAAiB;IAoB/B;;;;;OAKG;IACU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCvG;;;;;OAKG;IACU,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8C1G;;;;OAIG;IACU,KAAK,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiC3F;;;;;;;OAOG;IACI,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO;IAa3F;;;;;OAKG;IACU,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC;IAM/G;;;;;;;OAOG;IACI,UAAU,WAAY,gBAAgB,UAAU,KAAK,EAAE,KAAG,KAAK,EAAE,CAuBtE;IAEF;;;;;OAKG;IACU,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAMzF,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,sBAAsB,CAuC5B;IAEF;;;;;OAKG;IACU,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,GAAG,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE;CAgI/H;AAqDD,gBAAgB;AAChB,eAAO,MAAM,aAAa,UAAW,KAAK,KAAG,GAAG,CAAC,gBAAgB,CAUhE,CAAC;AAgCF,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,UAAW,KAAK,KAAG,2BAA2B,EA4B/E,CAAC"}
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Core
|
|
7
7
|
*/
|
|
8
|
-
import { BeEvent, isIDisposable } from "@itwin/core-bentley";
|
|
8
|
+
import { BeEvent, isDisposable, isIDisposable } from "@itwin/core-bentley";
|
|
9
9
|
import { QueryRowFormat } from "@itwin/core-common";
|
|
10
|
+
import { imodelInitializationHandlers } from "../IModelConnectionInitialization.js";
|
|
10
11
|
/**
|
|
11
12
|
* Scopes that favorite properties can be stored in.
|
|
12
13
|
* @public
|
|
@@ -24,139 +25,95 @@ export var FavoritePropertiesScope;
|
|
|
24
25
|
* @public
|
|
25
26
|
*/
|
|
26
27
|
export class FavoritePropertiesManager {
|
|
28
|
+
/** Event raised after favorite properties have changed. */
|
|
29
|
+
onFavoritesChanged = new BeEvent();
|
|
30
|
+
storage;
|
|
31
|
+
_globalProperties;
|
|
32
|
+
_iTwinProperties;
|
|
33
|
+
_imodelProperties;
|
|
34
|
+
_imodelBaseClassesByClass;
|
|
35
|
+
_imodelInitializationPromises;
|
|
36
|
+
_imodelInitializationHandler;
|
|
37
|
+
/** Property order is saved only in iModel scope */
|
|
38
|
+
_propertiesOrder;
|
|
27
39
|
constructor(props) {
|
|
28
|
-
|
|
29
|
-
this.onFavoritesChanged = new BeEvent();
|
|
30
|
-
/**
|
|
31
|
-
* Initialize favorite properties for the provided IModelConnection.
|
|
32
|
-
* @deprecated in 4.5. Initialization is performed automatically by all async methods and only needed for deprecated [[FavoritePropertiesManager.has]] and [[FavoritePropertiesManager.sortFields]].
|
|
33
|
-
*/
|
|
34
|
-
this.initializeConnection = async (imodel) => {
|
|
35
|
-
const imodelId = imodel.iModelId;
|
|
36
|
-
const iTwinId = imodel.iTwinId;
|
|
37
|
-
if (this._globalProperties === undefined) {
|
|
38
|
-
this._globalProperties = (await this._storage.loadProperties()) || new Set();
|
|
39
|
-
}
|
|
40
|
-
if (!this._iTwinProperties.has(iTwinId)) {
|
|
41
|
-
const iTwinProperties = (await this._storage.loadProperties(iTwinId)) || new Set();
|
|
42
|
-
this._iTwinProperties.set(iTwinId, iTwinProperties);
|
|
43
|
-
}
|
|
44
|
-
if (!this._imodelProperties.has(getiModelInfo(iTwinId, imodelId))) {
|
|
45
|
-
const imodelProperties = (await this._storage.loadProperties(iTwinId, imodelId)) || new Set();
|
|
46
|
-
this._imodelProperties.set(getiModelInfo(iTwinId, imodelId), imodelProperties);
|
|
47
|
-
}
|
|
48
|
-
const propertiesOrder = (await this._storage.loadPropertiesOrder(iTwinId, imodelId)) || [];
|
|
49
|
-
this._propertiesOrder.set(getiModelInfo(iTwinId, imodelId), propertiesOrder);
|
|
50
|
-
await this._adjustPropertyOrderInfos(iTwinId, imodelId);
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Function that removes order information of properties that are no longer
|
|
54
|
-
* favorited and adds missing order information for favorited properties.
|
|
55
|
-
*/
|
|
56
|
-
this._adjustPropertyOrderInfos = async (iTwinId, imodelId) => {
|
|
57
|
-
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
58
|
-
const globalProperties = this._globalProperties;
|
|
59
|
-
const iTwinProperties = this._iTwinProperties.get(iTwinId);
|
|
60
|
-
const imodelProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
61
|
-
// favorite property infos that need to be added to the propertiesOrder array
|
|
62
|
-
const infosToAdd = new Set([...globalProperties, ...iTwinProperties, ...imodelProperties]);
|
|
63
|
-
for (let i = propertiesOrder.length - 1; i >= 0; i--) {
|
|
64
|
-
if (infosToAdd.has(propertiesOrder[i].name)) {
|
|
65
|
-
infosToAdd.delete(propertiesOrder[i].name);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
propertiesOrder.splice(i, 1);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
infosToAdd.forEach((info) => propertiesOrder.push({
|
|
72
|
-
name: info,
|
|
73
|
-
parentClassName: getPropertyClassName(info),
|
|
74
|
-
orderedTimestamp: new Date(),
|
|
75
|
-
priority: 0,
|
|
76
|
-
}));
|
|
77
|
-
let priority = propertiesOrder.length;
|
|
78
|
-
propertiesOrder.forEach((oi) => (oi.priority = priority--));
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Sorts an array of fields with respect to favorite property order.
|
|
82
|
-
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
83
|
-
* @param imodel IModelConnection.
|
|
84
|
-
* @param fields Array of Field's that needs to be sorted.
|
|
85
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
86
|
-
* @deprecated in 4.5. Use [[FavoritePropertiesManager.sortFieldsAsync]] instead. This method is not async, therefore it requires early initialization by calling [[FavoritePropertiesManager.initializeConnection]].
|
|
87
|
-
*/
|
|
88
|
-
this.sortFields = (imodel, fields) => {
|
|
89
|
-
this.validateInitialization(imodel);
|
|
90
|
-
const iTwinId = imodel.iTwinId;
|
|
91
|
-
const imodelId = imodel.iModelId;
|
|
92
|
-
const fieldPriority = new Map();
|
|
93
|
-
fields.forEach((field) => fieldPriority.set(field, this.getFieldPriority(field, iTwinId, imodelId)));
|
|
94
|
-
const sortFunction = (left, right) => {
|
|
95
|
-
const lp = fieldPriority.get(left);
|
|
96
|
-
const rp = fieldPriority.get(right);
|
|
97
|
-
return lp < rp
|
|
98
|
-
? 1
|
|
99
|
-
: lp > rp
|
|
100
|
-
? -1
|
|
101
|
-
: left.priority < right.priority
|
|
102
|
-
? 1 // if favorite fields have equal priorities, sort by field priority
|
|
103
|
-
: left.priority > right.priority
|
|
104
|
-
? -1
|
|
105
|
-
: left.name.localeCompare(right.name);
|
|
106
|
-
};
|
|
107
|
-
return fields.sort(sortFunction);
|
|
108
|
-
};
|
|
109
|
-
this._getBaseClassesByClass = async (imodel, neededClasses) => {
|
|
110
|
-
const iTwinId = imodel.iTwinId;
|
|
111
|
-
const imodelId = imodel.iModelId;
|
|
112
|
-
const imodelInfo = getiModelInfo(iTwinId, imodelId);
|
|
113
|
-
let baseClasses;
|
|
114
|
-
if (this._imodelBaseClassesByClass.has(imodelInfo)) {
|
|
115
|
-
baseClasses = this._imodelBaseClassesByClass.get(imodelInfo);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
this._imodelBaseClassesByClass.set(imodelInfo, (baseClasses = {}));
|
|
119
|
-
}
|
|
120
|
-
const missingClasses = new Set();
|
|
121
|
-
neededClasses.forEach((className) => {
|
|
122
|
-
if (!baseClasses.hasOwnProperty(className)) {
|
|
123
|
-
missingClasses.add(className);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
if (missingClasses.size === 0) {
|
|
127
|
-
return baseClasses;
|
|
128
|
-
}
|
|
129
|
-
const query = `
|
|
130
|
-
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
131
|
-
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
132
|
-
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
133
|
-
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
134
|
-
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
135
|
-
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
136
|
-
WHERE (derivedSchema.Name || ':' || derivedClass.Name) IN (${[...missingClasses].map((className) => `'${className}'`).join(",")})`;
|
|
137
|
-
const reader = imodel.createQueryReader(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames });
|
|
138
|
-
while (await reader.step()) {
|
|
139
|
-
const row = reader.current.toRow();
|
|
140
|
-
if (!(row.classFullName in baseClasses)) {
|
|
141
|
-
baseClasses[row.classFullName] = [];
|
|
142
|
-
}
|
|
143
|
-
baseClasses[row.classFullName].push(row.baseClassFullName);
|
|
144
|
-
}
|
|
145
|
-
return baseClasses;
|
|
146
|
-
};
|
|
147
|
-
this._storage = props.storage;
|
|
40
|
+
this.storage = props.storage;
|
|
148
41
|
this._iTwinProperties = new Map();
|
|
149
42
|
this._imodelProperties = new Map();
|
|
150
43
|
this._propertiesOrder = new Map();
|
|
151
44
|
this._imodelBaseClassesByClass = new Map();
|
|
152
45
|
this._imodelInitializationPromises = new Map();
|
|
46
|
+
imodelInitializationHandlers.add((this._imodelInitializationHandler = {
|
|
47
|
+
startInitialization: (imodel) => this.startConnectionInitialization(imodel),
|
|
48
|
+
ensureInitialized: async (imodel) => this.ensureInitialized(imodel),
|
|
49
|
+
}));
|
|
153
50
|
}
|
|
154
|
-
dispose() {
|
|
155
|
-
|
|
156
|
-
if (
|
|
157
|
-
this.
|
|
51
|
+
[Symbol.dispose]() {
|
|
52
|
+
imodelInitializationHandlers.delete(this._imodelInitializationHandler);
|
|
53
|
+
if (isDisposable(this.storage)) {
|
|
54
|
+
this.storage[Symbol.dispose]();
|
|
55
|
+
/* c8 ignore next 4 */
|
|
56
|
+
/* eslint-disable-next-line @typescript-eslint/no-deprecated */
|
|
57
|
+
}
|
|
58
|
+
else if (isIDisposable(this.storage)) {
|
|
59
|
+
this.storage.dispose();
|
|
158
60
|
}
|
|
159
61
|
}
|
|
62
|
+
/** @deprecated in 5.0 Use [Symbol.dispose] instead. */
|
|
63
|
+
/* c8 ignore next 3 */
|
|
64
|
+
dispose() {
|
|
65
|
+
this[Symbol.dispose]();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Initialize favorite properties for the provided IModelConnection.
|
|
69
|
+
* @deprecated in 4.5. Initialization is performed automatically by all async methods and only needed for deprecated [[FavoritePropertiesManager.has]] and [[FavoritePropertiesManager.sortFields]].
|
|
70
|
+
*/
|
|
71
|
+
initializeConnection = async (imodel) => {
|
|
72
|
+
const imodelId = imodel.iModelId;
|
|
73
|
+
const iTwinId = imodel.iTwinId;
|
|
74
|
+
if (this._globalProperties === undefined) {
|
|
75
|
+
this._globalProperties = (await this.storage.loadProperties()) || new Set();
|
|
76
|
+
}
|
|
77
|
+
if (!this._iTwinProperties.has(iTwinId)) {
|
|
78
|
+
const iTwinProperties = (await this.storage.loadProperties(iTwinId)) || new Set();
|
|
79
|
+
this._iTwinProperties.set(iTwinId, iTwinProperties);
|
|
80
|
+
}
|
|
81
|
+
if (!this._imodelProperties.has(getiModelInfo(iTwinId, imodelId))) {
|
|
82
|
+
const imodelProperties = (await this.storage.loadProperties(iTwinId, imodelId)) || new Set();
|
|
83
|
+
this._imodelProperties.set(getiModelInfo(iTwinId, imodelId), imodelProperties);
|
|
84
|
+
}
|
|
85
|
+
const propertiesOrder = (await this.storage.loadPropertiesOrder(iTwinId, imodelId)) || [];
|
|
86
|
+
this._propertiesOrder.set(getiModelInfo(iTwinId, imodelId), propertiesOrder);
|
|
87
|
+
await this._adjustPropertyOrderInfos(iTwinId, imodelId);
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Function that removes order information of properties that are no longer
|
|
91
|
+
* favorited and adds missing order information for favorited properties.
|
|
92
|
+
*/
|
|
93
|
+
_adjustPropertyOrderInfos = async (iTwinId, imodelId) => {
|
|
94
|
+
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
95
|
+
const globalProperties = this._globalProperties;
|
|
96
|
+
const iTwinProperties = this._iTwinProperties.get(iTwinId);
|
|
97
|
+
const imodelProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
98
|
+
// favorite property infos that need to be added to the propertiesOrder array
|
|
99
|
+
const infosToAdd = new Set([...globalProperties, ...iTwinProperties, ...imodelProperties]);
|
|
100
|
+
for (let i = propertiesOrder.length - 1; i >= 0; i--) {
|
|
101
|
+
if (infosToAdd.has(propertiesOrder[i].name)) {
|
|
102
|
+
infosToAdd.delete(propertiesOrder[i].name);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
propertiesOrder.splice(i, 1);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
infosToAdd.forEach((info) => propertiesOrder.push({
|
|
109
|
+
name: info,
|
|
110
|
+
parentClassName: getPropertyClassName(info),
|
|
111
|
+
orderedTimestamp: new Date(),
|
|
112
|
+
priority: 0,
|
|
113
|
+
}));
|
|
114
|
+
let priority = propertiesOrder.length;
|
|
115
|
+
propertiesOrder.forEach((oi) => (oi.priority = priority--));
|
|
116
|
+
};
|
|
160
117
|
isInitialized(imodel) {
|
|
161
118
|
const iTwinId = imodel.iTwinId;
|
|
162
119
|
const imodelId = imodel.iModelId;
|
|
@@ -173,20 +130,12 @@ export class FavoritePropertiesManager {
|
|
|
173
130
|
throw Error(`Favorite properties are not initialized for iModel: '${imodelId}', in iTwin: '${iTwinId}'. Call initializeConnection() with an IModelConnection to initialize.`);
|
|
174
131
|
}
|
|
175
132
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Calls [[FavoritePropertiesManager.initializeConnection]] and caches the promise which should be awaited by calling [[FavoritePropertiesManager.ensureInitialized]].
|
|
178
|
-
* @internal
|
|
179
|
-
*/
|
|
180
133
|
startConnectionInitialization(imodel) {
|
|
181
134
|
if (!this.isInitialized(imodel) && !this._imodelInitializationPromises.has(imodel)) {
|
|
182
135
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
183
136
|
this._imodelInitializationPromises.set(imodel, this.initializeConnection(imodel));
|
|
184
137
|
}
|
|
185
138
|
}
|
|
186
|
-
/**
|
|
187
|
-
* Performs the initialization process or finishes the one that was started by [[FavoritePropertiesManager.startConnectionInitialization]].
|
|
188
|
-
* @internal
|
|
189
|
-
*/
|
|
190
139
|
async ensureInitialized(imodel) {
|
|
191
140
|
if (this.isInitialized(imodel)) {
|
|
192
141
|
return;
|
|
@@ -217,15 +166,15 @@ export class FavoritePropertiesManager {
|
|
|
217
166
|
switch (scope) {
|
|
218
167
|
case FavoritePropertiesScope.Global:
|
|
219
168
|
favoriteProperties = this._globalProperties;
|
|
220
|
-
saveProperties = async (properties) => this.
|
|
169
|
+
saveProperties = async (properties) => this.storage.saveProperties(properties);
|
|
221
170
|
break;
|
|
222
171
|
case FavoritePropertiesScope.ITwin:
|
|
223
172
|
favoriteProperties = this._iTwinProperties.get(iTwinId);
|
|
224
|
-
saveProperties = async (properties) => this.
|
|
173
|
+
saveProperties = async (properties) => this.storage.saveProperties(properties, iTwinId);
|
|
225
174
|
break;
|
|
226
175
|
default:
|
|
227
176
|
favoriteProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
228
|
-
saveProperties = async (properties) => this.
|
|
177
|
+
saveProperties = async (properties) => this.storage.saveProperties(properties, iTwinId, imodelId);
|
|
229
178
|
}
|
|
230
179
|
const countBefore = favoriteProperties.size;
|
|
231
180
|
const fieldInfos = getFieldInfos(field);
|
|
@@ -235,7 +184,7 @@ export class FavoritePropertiesManager {
|
|
|
235
184
|
saves.push(saveProperties(favoriteProperties));
|
|
236
185
|
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
237
186
|
addOrderInfos(propertiesOrder, createFieldOrderInfos(field));
|
|
238
|
-
saves.push(this.
|
|
187
|
+
saves.push(this.storage.savePropertiesOrder(propertiesOrder, iTwinId, imodelId));
|
|
239
188
|
await Promise.all(saves);
|
|
240
189
|
this.onFavoritesChanged.raiseEvent();
|
|
241
190
|
}
|
|
@@ -254,18 +203,18 @@ export class FavoritePropertiesManager {
|
|
|
254
203
|
const workingScopes = [];
|
|
255
204
|
workingScopes.push({
|
|
256
205
|
properties: this._globalProperties,
|
|
257
|
-
save: async (properties) => this.
|
|
206
|
+
save: async (properties) => this.storage.saveProperties(properties),
|
|
258
207
|
});
|
|
259
208
|
if (scope === FavoritePropertiesScope.ITwin || scope === FavoritePropertiesScope.IModel) {
|
|
260
209
|
workingScopes.push({
|
|
261
210
|
properties: this._iTwinProperties.get(iTwinId),
|
|
262
|
-
save: async (properties) => this.
|
|
211
|
+
save: async (properties) => this.storage.saveProperties(properties, iTwinId),
|
|
263
212
|
});
|
|
264
213
|
}
|
|
265
214
|
if (scope === FavoritePropertiesScope.IModel) {
|
|
266
215
|
workingScopes.push({
|
|
267
216
|
properties: this._imodelProperties.get(getiModelInfo(iTwinId, imodelId)),
|
|
268
|
-
save: async (properties) => this.
|
|
217
|
+
save: async (properties) => this.storage.saveProperties(properties, iTwinId, imodelId),
|
|
269
218
|
});
|
|
270
219
|
}
|
|
271
220
|
const saves = [];
|
|
@@ -283,7 +232,7 @@ export class FavoritePropertiesManager {
|
|
|
283
232
|
}
|
|
284
233
|
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
285
234
|
removeOrderInfos(propertiesOrder, createFieldOrderInfos(field));
|
|
286
|
-
saves.push(this.
|
|
235
|
+
saves.push(this.storage.savePropertiesOrder(propertiesOrder, iTwinId, imodelId));
|
|
287
236
|
await Promise.all(saves);
|
|
288
237
|
this.onFavoritesChanged.raiseEvent();
|
|
289
238
|
}
|
|
@@ -301,15 +250,15 @@ export class FavoritePropertiesManager {
|
|
|
301
250
|
switch (scope) {
|
|
302
251
|
case FavoritePropertiesScope.Global:
|
|
303
252
|
favoriteProperties = this._globalProperties;
|
|
304
|
-
saveProperties = async () => this.
|
|
253
|
+
saveProperties = async () => this.storage.saveProperties(new Set());
|
|
305
254
|
break;
|
|
306
255
|
case FavoritePropertiesScope.ITwin:
|
|
307
256
|
favoriteProperties = this._iTwinProperties.get(iTwinId);
|
|
308
|
-
saveProperties = async () => this.
|
|
257
|
+
saveProperties = async () => this.storage.saveProperties(new Set(), iTwinId);
|
|
309
258
|
break;
|
|
310
259
|
default:
|
|
311
260
|
favoriteProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
312
|
-
saveProperties = async () => this.
|
|
261
|
+
saveProperties = async () => this.storage.saveProperties(new Set(), iTwinId, imodelId);
|
|
313
262
|
}
|
|
314
263
|
if (favoriteProperties.size === 0) {
|
|
315
264
|
return;
|
|
@@ -349,6 +298,35 @@ export class FavoritePropertiesManager {
|
|
|
349
298
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
350
299
|
return this.has(field, imodel, scope);
|
|
351
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Sorts an array of fields with respect to favorite property order.
|
|
303
|
+
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
304
|
+
* @param imodel IModelConnection.
|
|
305
|
+
* @param fields Array of Field's that needs to be sorted.
|
|
306
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
307
|
+
* @deprecated in 4.5. Use [[FavoritePropertiesManager.sortFieldsAsync]] instead. This method is not async, therefore it requires early initialization by calling [[FavoritePropertiesManager.initializeConnection]].
|
|
308
|
+
*/
|
|
309
|
+
sortFields = (imodel, fields) => {
|
|
310
|
+
this.validateInitialization(imodel);
|
|
311
|
+
const iTwinId = imodel.iTwinId;
|
|
312
|
+
const imodelId = imodel.iModelId;
|
|
313
|
+
const fieldPriority = new Map();
|
|
314
|
+
fields.forEach((field) => fieldPriority.set(field, this.getFieldPriority(field, iTwinId, imodelId)));
|
|
315
|
+
const sortFunction = (left, right) => {
|
|
316
|
+
const lp = fieldPriority.get(left);
|
|
317
|
+
const rp = fieldPriority.get(right);
|
|
318
|
+
return lp < rp
|
|
319
|
+
? 1
|
|
320
|
+
: lp > rp
|
|
321
|
+
? -1
|
|
322
|
+
: left.priority < right.priority
|
|
323
|
+
? 1 // if favorite fields have equal priorities, sort by field priority
|
|
324
|
+
: left.priority > right.priority
|
|
325
|
+
? -1
|
|
326
|
+
: left.name.localeCompare(right.name);
|
|
327
|
+
};
|
|
328
|
+
return fields.sort(sortFunction);
|
|
329
|
+
};
|
|
352
330
|
/**
|
|
353
331
|
* Sorts an array of fields with respect to favorite property order.
|
|
354
332
|
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
@@ -369,6 +347,44 @@ export class FavoritePropertiesManager {
|
|
|
369
347
|
const mostRecent = getMostRecentOrderInfo(fieldOrderInfos);
|
|
370
348
|
return mostRecent.priority;
|
|
371
349
|
}
|
|
350
|
+
_getBaseClassesByClass = async (imodel, neededClasses) => {
|
|
351
|
+
const iTwinId = imodel.iTwinId;
|
|
352
|
+
const imodelId = imodel.iModelId;
|
|
353
|
+
const imodelInfo = getiModelInfo(iTwinId, imodelId);
|
|
354
|
+
let baseClasses;
|
|
355
|
+
if (this._imodelBaseClassesByClass.has(imodelInfo)) {
|
|
356
|
+
baseClasses = this._imodelBaseClassesByClass.get(imodelInfo);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
this._imodelBaseClassesByClass.set(imodelInfo, (baseClasses = {}));
|
|
360
|
+
}
|
|
361
|
+
const missingClasses = new Set();
|
|
362
|
+
neededClasses.forEach((className) => {
|
|
363
|
+
if (!baseClasses.hasOwnProperty(className)) {
|
|
364
|
+
missingClasses.add(className);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
if (missingClasses.size === 0) {
|
|
368
|
+
return baseClasses;
|
|
369
|
+
}
|
|
370
|
+
const query = `
|
|
371
|
+
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
372
|
+
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
373
|
+
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
374
|
+
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
375
|
+
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
376
|
+
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
377
|
+
WHERE (derivedSchema.Name || ':' || derivedClass.Name) IN (${[...missingClasses].map((className) => `'${className}'`).join(",")})`;
|
|
378
|
+
const reader = imodel.createQueryReader(query, undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames });
|
|
379
|
+
while (await reader.step()) {
|
|
380
|
+
const row = reader.current.toRow();
|
|
381
|
+
if (!(row.classFullName in baseClasses)) {
|
|
382
|
+
baseClasses[row.classFullName] = [];
|
|
383
|
+
}
|
|
384
|
+
baseClasses[row.classFullName].push(row.baseClassFullName);
|
|
385
|
+
}
|
|
386
|
+
return baseClasses;
|
|
387
|
+
};
|
|
372
388
|
/** Changes field properties priorities to lower than another fields priority
|
|
373
389
|
* @param imodel IModelConnection.
|
|
374
390
|
* @param field Field that priority is being changed.
|
|
@@ -478,15 +494,10 @@ export class FavoritePropertiesManager {
|
|
|
478
494
|
// reassign priority numbers
|
|
479
495
|
let priority = allOrderInfos.length;
|
|
480
496
|
allOrderInfos.forEach((oi) => (oi.priority = priority--));
|
|
481
|
-
await this.
|
|
497
|
+
await this.storage.savePropertiesOrder(allOrderInfos, iTwinId, imodelId);
|
|
482
498
|
this.onFavoritesChanged.raiseEvent();
|
|
483
499
|
}
|
|
484
500
|
}
|
|
485
|
-
/**
|
|
486
|
-
* Used in tests to avoid collisions between multiple runs using the same storage
|
|
487
|
-
* @internal
|
|
488
|
-
*/
|
|
489
|
-
FavoritePropertiesManager.FAVORITES_IDENTIFIER_PREFIX = "";
|
|
490
501
|
var Direction;
|
|
491
502
|
(function (Direction) {
|
|
492
503
|
Direction[Direction["Up"] = -1] = "Up";
|
|
@@ -495,11 +506,11 @@ var Direction;
|
|
|
495
506
|
const getiModelInfo = (iTwinId, imodelId) => `${iTwinId}/${imodelId}`;
|
|
496
507
|
const getPropertiesFieldPropertyNames = (field) => {
|
|
497
508
|
const nestingPrefix = getNestingPrefix(field.parent);
|
|
498
|
-
return field.properties.map((property) => `${
|
|
509
|
+
return field.properties.map((property) => `${nestingPrefix}${property.property.classInfo.name}:${property.property.name}`);
|
|
499
510
|
};
|
|
500
511
|
const getNestedContentFieldPropertyName = (field) => {
|
|
501
512
|
const nestingPrefix = getNestingPrefix(field);
|
|
502
|
-
return `${
|
|
513
|
+
return `${nestingPrefix}${field.contentClassInfo.name}`;
|
|
503
514
|
};
|
|
504
515
|
const getNestingPrefix = (field) => {
|
|
505
516
|
const path = [];
|
|
@@ -542,7 +553,7 @@ export const getFieldInfos = (field) => {
|
|
|
542
553
|
fieldInfos.add(getNestedContentFieldPropertyName(field));
|
|
543
554
|
}
|
|
544
555
|
else {
|
|
545
|
-
fieldInfos.add(
|
|
556
|
+
fieldInfos.add(field.name);
|
|
546
557
|
}
|
|
547
558
|
return fieldInfos;
|
|
548
559
|
};
|
|
@@ -568,7 +579,6 @@ const addOrderInfos = (dest, source) => {
|
|
|
568
579
|
const removeOrderInfos = (container, toRemove) => {
|
|
569
580
|
toRemove.forEach((roi) => {
|
|
570
581
|
const index = container.findIndex((oi) => oi.name === roi.name);
|
|
571
|
-
/* istanbul ignore else */
|
|
572
582
|
if (index >= 0) {
|
|
573
583
|
container.splice(index, 1);
|
|
574
584
|
}
|