@itwin/presentation-frontend 5.0.0-dev.10 → 5.0.0-dev.102
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 +58 -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/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 +77 -74
- 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 +8 -2
- 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 -13
- package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/cjs/presentation-frontend/selection/SelectionManager.js +216 -116
- 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/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 +66 -63
- 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 +8 -2
- 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 -13
- package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts.map +1 -1
- package/lib/esm/presentation-frontend/selection/SelectionManager.js +202 -102
- 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 +42 -42
package/lib/cjs/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":"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"}
|
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.createFieldOrderInfos = exports.getFieldInfos = exports.FavoritePropertiesManager = exports.FavoritePropertiesScope = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const core_common_1 = require("@itwin/core-common");
|
|
13
|
+
const IModelConnectionInitialization_js_1 = require("../IModelConnectionInitialization.js");
|
|
13
14
|
/**
|
|
14
15
|
* Scopes that favorite properties can be stored in.
|
|
15
16
|
* @public
|
|
@@ -27,139 +28,95 @@ var FavoritePropertiesScope;
|
|
|
27
28
|
* @public
|
|
28
29
|
*/
|
|
29
30
|
class FavoritePropertiesManager {
|
|
31
|
+
/** Event raised after favorite properties have changed. */
|
|
32
|
+
onFavoritesChanged = new core_bentley_1.BeEvent();
|
|
33
|
+
storage;
|
|
34
|
+
_globalProperties;
|
|
35
|
+
_iTwinProperties;
|
|
36
|
+
_imodelProperties;
|
|
37
|
+
_imodelBaseClassesByClass;
|
|
38
|
+
_imodelInitializationPromises;
|
|
39
|
+
_imodelInitializationHandler;
|
|
40
|
+
/** Property order is saved only in iModel scope */
|
|
41
|
+
_propertiesOrder;
|
|
30
42
|
constructor(props) {
|
|
31
|
-
|
|
32
|
-
this.onFavoritesChanged = new core_bentley_1.BeEvent();
|
|
33
|
-
/**
|
|
34
|
-
* Initialize favorite properties for the provided IModelConnection.
|
|
35
|
-
* @deprecated in 4.5. Initialization is performed automatically by all async methods and only needed for deprecated [[FavoritePropertiesManager.has]] and [[FavoritePropertiesManager.sortFields]].
|
|
36
|
-
*/
|
|
37
|
-
this.initializeConnection = async (imodel) => {
|
|
38
|
-
const imodelId = imodel.iModelId;
|
|
39
|
-
const iTwinId = imodel.iTwinId;
|
|
40
|
-
if (this._globalProperties === undefined) {
|
|
41
|
-
this._globalProperties = (await this._storage.loadProperties()) || new Set();
|
|
42
|
-
}
|
|
43
|
-
if (!this._iTwinProperties.has(iTwinId)) {
|
|
44
|
-
const iTwinProperties = (await this._storage.loadProperties(iTwinId)) || new Set();
|
|
45
|
-
this._iTwinProperties.set(iTwinId, iTwinProperties);
|
|
46
|
-
}
|
|
47
|
-
if (!this._imodelProperties.has(getiModelInfo(iTwinId, imodelId))) {
|
|
48
|
-
const imodelProperties = (await this._storage.loadProperties(iTwinId, imodelId)) || new Set();
|
|
49
|
-
this._imodelProperties.set(getiModelInfo(iTwinId, imodelId), imodelProperties);
|
|
50
|
-
}
|
|
51
|
-
const propertiesOrder = (await this._storage.loadPropertiesOrder(iTwinId, imodelId)) || [];
|
|
52
|
-
this._propertiesOrder.set(getiModelInfo(iTwinId, imodelId), propertiesOrder);
|
|
53
|
-
await this._adjustPropertyOrderInfos(iTwinId, imodelId);
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Function that removes order information of properties that are no longer
|
|
57
|
-
* favorited and adds missing order information for favorited properties.
|
|
58
|
-
*/
|
|
59
|
-
this._adjustPropertyOrderInfos = async (iTwinId, imodelId) => {
|
|
60
|
-
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
61
|
-
const globalProperties = this._globalProperties;
|
|
62
|
-
const iTwinProperties = this._iTwinProperties.get(iTwinId);
|
|
63
|
-
const imodelProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
64
|
-
// favorite property infos that need to be added to the propertiesOrder array
|
|
65
|
-
const infosToAdd = new Set([...globalProperties, ...iTwinProperties, ...imodelProperties]);
|
|
66
|
-
for (let i = propertiesOrder.length - 1; i >= 0; i--) {
|
|
67
|
-
if (infosToAdd.has(propertiesOrder[i].name)) {
|
|
68
|
-
infosToAdd.delete(propertiesOrder[i].name);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
propertiesOrder.splice(i, 1);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
infosToAdd.forEach((info) => propertiesOrder.push({
|
|
75
|
-
name: info,
|
|
76
|
-
parentClassName: getPropertyClassName(info),
|
|
77
|
-
orderedTimestamp: new Date(),
|
|
78
|
-
priority: 0,
|
|
79
|
-
}));
|
|
80
|
-
let priority = propertiesOrder.length;
|
|
81
|
-
propertiesOrder.forEach((oi) => (oi.priority = priority--));
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Sorts an array of fields with respect to favorite property order.
|
|
85
|
-
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
86
|
-
* @param imodel IModelConnection.
|
|
87
|
-
* @param fields Array of Field's that needs to be sorted.
|
|
88
|
-
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
89
|
-
* @deprecated in 4.5. Use [[FavoritePropertiesManager.sortFieldsAsync]] instead. This method is not async, therefore it requires early initialization by calling [[FavoritePropertiesManager.initializeConnection]].
|
|
90
|
-
*/
|
|
91
|
-
this.sortFields = (imodel, fields) => {
|
|
92
|
-
this.validateInitialization(imodel);
|
|
93
|
-
const iTwinId = imodel.iTwinId;
|
|
94
|
-
const imodelId = imodel.iModelId;
|
|
95
|
-
const fieldPriority = new Map();
|
|
96
|
-
fields.forEach((field) => fieldPriority.set(field, this.getFieldPriority(field, iTwinId, imodelId)));
|
|
97
|
-
const sortFunction = (left, right) => {
|
|
98
|
-
const lp = fieldPriority.get(left);
|
|
99
|
-
const rp = fieldPriority.get(right);
|
|
100
|
-
return lp < rp
|
|
101
|
-
? 1
|
|
102
|
-
: lp > rp
|
|
103
|
-
? -1
|
|
104
|
-
: left.priority < right.priority
|
|
105
|
-
? 1 // if favorite fields have equal priorities, sort by field priority
|
|
106
|
-
: left.priority > right.priority
|
|
107
|
-
? -1
|
|
108
|
-
: left.name.localeCompare(right.name);
|
|
109
|
-
};
|
|
110
|
-
return fields.sort(sortFunction);
|
|
111
|
-
};
|
|
112
|
-
this._getBaseClassesByClass = async (imodel, neededClasses) => {
|
|
113
|
-
const iTwinId = imodel.iTwinId;
|
|
114
|
-
const imodelId = imodel.iModelId;
|
|
115
|
-
const imodelInfo = getiModelInfo(iTwinId, imodelId);
|
|
116
|
-
let baseClasses;
|
|
117
|
-
if (this._imodelBaseClassesByClass.has(imodelInfo)) {
|
|
118
|
-
baseClasses = this._imodelBaseClassesByClass.get(imodelInfo);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
this._imodelBaseClassesByClass.set(imodelInfo, (baseClasses = {}));
|
|
122
|
-
}
|
|
123
|
-
const missingClasses = new Set();
|
|
124
|
-
neededClasses.forEach((className) => {
|
|
125
|
-
if (!baseClasses.hasOwnProperty(className)) {
|
|
126
|
-
missingClasses.add(className);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
if (missingClasses.size === 0) {
|
|
130
|
-
return baseClasses;
|
|
131
|
-
}
|
|
132
|
-
const query = `
|
|
133
|
-
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
134
|
-
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
135
|
-
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
136
|
-
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
137
|
-
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
138
|
-
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
139
|
-
WHERE (derivedSchema.Name || ':' || derivedClass.Name) IN (${[...missingClasses].map((className) => `'${className}'`).join(",")})`;
|
|
140
|
-
const reader = imodel.createQueryReader(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames });
|
|
141
|
-
while (await reader.step()) {
|
|
142
|
-
const row = reader.current.toRow();
|
|
143
|
-
if (!(row.classFullName in baseClasses)) {
|
|
144
|
-
baseClasses[row.classFullName] = [];
|
|
145
|
-
}
|
|
146
|
-
baseClasses[row.classFullName].push(row.baseClassFullName);
|
|
147
|
-
}
|
|
148
|
-
return baseClasses;
|
|
149
|
-
};
|
|
150
|
-
this._storage = props.storage;
|
|
43
|
+
this.storage = props.storage;
|
|
151
44
|
this._iTwinProperties = new Map();
|
|
152
45
|
this._imodelProperties = new Map();
|
|
153
46
|
this._propertiesOrder = new Map();
|
|
154
47
|
this._imodelBaseClassesByClass = new Map();
|
|
155
48
|
this._imodelInitializationPromises = new Map();
|
|
49
|
+
IModelConnectionInitialization_js_1.imodelInitializationHandlers.add((this._imodelInitializationHandler = {
|
|
50
|
+
startInitialization: (imodel) => this.startConnectionInitialization(imodel),
|
|
51
|
+
ensureInitialized: async (imodel) => this.ensureInitialized(imodel),
|
|
52
|
+
}));
|
|
156
53
|
}
|
|
157
|
-
dispose() {
|
|
158
|
-
|
|
159
|
-
if ((0, core_bentley_1.
|
|
160
|
-
this.
|
|
54
|
+
[Symbol.dispose]() {
|
|
55
|
+
IModelConnectionInitialization_js_1.imodelInitializationHandlers.delete(this._imodelInitializationHandler);
|
|
56
|
+
if ((0, core_bentley_1.isDisposable)(this.storage)) {
|
|
57
|
+
this.storage[Symbol.dispose]();
|
|
58
|
+
/* c8 ignore next 4 */
|
|
59
|
+
/* eslint-disable-next-line @typescript-eslint/no-deprecated */
|
|
60
|
+
}
|
|
61
|
+
else if ((0, core_bentley_1.isIDisposable)(this.storage)) {
|
|
62
|
+
this.storage.dispose();
|
|
161
63
|
}
|
|
162
64
|
}
|
|
65
|
+
/** @deprecated in 5.0 Use [Symbol.dispose] instead. */
|
|
66
|
+
/* c8 ignore next 3 */
|
|
67
|
+
dispose() {
|
|
68
|
+
this[Symbol.dispose]();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Initialize favorite properties for the provided IModelConnection.
|
|
72
|
+
* @deprecated in 4.5. Initialization is performed automatically by all async methods and only needed for deprecated [[FavoritePropertiesManager.has]] and [[FavoritePropertiesManager.sortFields]].
|
|
73
|
+
*/
|
|
74
|
+
initializeConnection = async (imodel) => {
|
|
75
|
+
const imodelId = imodel.iModelId;
|
|
76
|
+
const iTwinId = imodel.iTwinId;
|
|
77
|
+
if (this._globalProperties === undefined) {
|
|
78
|
+
this._globalProperties = (await this.storage.loadProperties()) || new Set();
|
|
79
|
+
}
|
|
80
|
+
if (!this._iTwinProperties.has(iTwinId)) {
|
|
81
|
+
const iTwinProperties = (await this.storage.loadProperties(iTwinId)) || new Set();
|
|
82
|
+
this._iTwinProperties.set(iTwinId, iTwinProperties);
|
|
83
|
+
}
|
|
84
|
+
if (!this._imodelProperties.has(getiModelInfo(iTwinId, imodelId))) {
|
|
85
|
+
const imodelProperties = (await this.storage.loadProperties(iTwinId, imodelId)) || new Set();
|
|
86
|
+
this._imodelProperties.set(getiModelInfo(iTwinId, imodelId), imodelProperties);
|
|
87
|
+
}
|
|
88
|
+
const propertiesOrder = (await this.storage.loadPropertiesOrder(iTwinId, imodelId)) || [];
|
|
89
|
+
this._propertiesOrder.set(getiModelInfo(iTwinId, imodelId), propertiesOrder);
|
|
90
|
+
await this._adjustPropertyOrderInfos(iTwinId, imodelId);
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Function that removes order information of properties that are no longer
|
|
94
|
+
* favorited and adds missing order information for favorited properties.
|
|
95
|
+
*/
|
|
96
|
+
_adjustPropertyOrderInfos = async (iTwinId, imodelId) => {
|
|
97
|
+
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
98
|
+
const globalProperties = this._globalProperties;
|
|
99
|
+
const iTwinProperties = this._iTwinProperties.get(iTwinId);
|
|
100
|
+
const imodelProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
101
|
+
// favorite property infos that need to be added to the propertiesOrder array
|
|
102
|
+
const infosToAdd = new Set([...globalProperties, ...iTwinProperties, ...imodelProperties]);
|
|
103
|
+
for (let i = propertiesOrder.length - 1; i >= 0; i--) {
|
|
104
|
+
if (infosToAdd.has(propertiesOrder[i].name)) {
|
|
105
|
+
infosToAdd.delete(propertiesOrder[i].name);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
propertiesOrder.splice(i, 1);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
infosToAdd.forEach((info) => propertiesOrder.push({
|
|
112
|
+
name: info,
|
|
113
|
+
parentClassName: getPropertyClassName(info),
|
|
114
|
+
orderedTimestamp: new Date(),
|
|
115
|
+
priority: 0,
|
|
116
|
+
}));
|
|
117
|
+
let priority = propertiesOrder.length;
|
|
118
|
+
propertiesOrder.forEach((oi) => (oi.priority = priority--));
|
|
119
|
+
};
|
|
163
120
|
isInitialized(imodel) {
|
|
164
121
|
const iTwinId = imodel.iTwinId;
|
|
165
122
|
const imodelId = imodel.iModelId;
|
|
@@ -176,20 +133,12 @@ class FavoritePropertiesManager {
|
|
|
176
133
|
throw Error(`Favorite properties are not initialized for iModel: '${imodelId}', in iTwin: '${iTwinId}'. Call initializeConnection() with an IModelConnection to initialize.`);
|
|
177
134
|
}
|
|
178
135
|
}
|
|
179
|
-
/**
|
|
180
|
-
* Calls [[FavoritePropertiesManager.initializeConnection]] and caches the promise which should be awaited by calling [[FavoritePropertiesManager.ensureInitialized]].
|
|
181
|
-
* @internal
|
|
182
|
-
*/
|
|
183
136
|
startConnectionInitialization(imodel) {
|
|
184
137
|
if (!this.isInitialized(imodel) && !this._imodelInitializationPromises.has(imodel)) {
|
|
185
138
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
186
139
|
this._imodelInitializationPromises.set(imodel, this.initializeConnection(imodel));
|
|
187
140
|
}
|
|
188
141
|
}
|
|
189
|
-
/**
|
|
190
|
-
* Performs the initialization process or finishes the one that was started by [[FavoritePropertiesManager.startConnectionInitialization]].
|
|
191
|
-
* @internal
|
|
192
|
-
*/
|
|
193
142
|
async ensureInitialized(imodel) {
|
|
194
143
|
if (this.isInitialized(imodel)) {
|
|
195
144
|
return;
|
|
@@ -220,15 +169,15 @@ class FavoritePropertiesManager {
|
|
|
220
169
|
switch (scope) {
|
|
221
170
|
case FavoritePropertiesScope.Global:
|
|
222
171
|
favoriteProperties = this._globalProperties;
|
|
223
|
-
saveProperties = async (properties) => this.
|
|
172
|
+
saveProperties = async (properties) => this.storage.saveProperties(properties);
|
|
224
173
|
break;
|
|
225
174
|
case FavoritePropertiesScope.ITwin:
|
|
226
175
|
favoriteProperties = this._iTwinProperties.get(iTwinId);
|
|
227
|
-
saveProperties = async (properties) => this.
|
|
176
|
+
saveProperties = async (properties) => this.storage.saveProperties(properties, iTwinId);
|
|
228
177
|
break;
|
|
229
178
|
default:
|
|
230
179
|
favoriteProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
231
|
-
saveProperties = async (properties) => this.
|
|
180
|
+
saveProperties = async (properties) => this.storage.saveProperties(properties, iTwinId, imodelId);
|
|
232
181
|
}
|
|
233
182
|
const countBefore = favoriteProperties.size;
|
|
234
183
|
const fieldInfos = (0, exports.getFieldInfos)(field);
|
|
@@ -238,7 +187,7 @@ class FavoritePropertiesManager {
|
|
|
238
187
|
saves.push(saveProperties(favoriteProperties));
|
|
239
188
|
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
240
189
|
addOrderInfos(propertiesOrder, (0, exports.createFieldOrderInfos)(field));
|
|
241
|
-
saves.push(this.
|
|
190
|
+
saves.push(this.storage.savePropertiesOrder(propertiesOrder, iTwinId, imodelId));
|
|
242
191
|
await Promise.all(saves);
|
|
243
192
|
this.onFavoritesChanged.raiseEvent();
|
|
244
193
|
}
|
|
@@ -257,18 +206,18 @@ class FavoritePropertiesManager {
|
|
|
257
206
|
const workingScopes = [];
|
|
258
207
|
workingScopes.push({
|
|
259
208
|
properties: this._globalProperties,
|
|
260
|
-
save: async (properties) => this.
|
|
209
|
+
save: async (properties) => this.storage.saveProperties(properties),
|
|
261
210
|
});
|
|
262
211
|
if (scope === FavoritePropertiesScope.ITwin || scope === FavoritePropertiesScope.IModel) {
|
|
263
212
|
workingScopes.push({
|
|
264
213
|
properties: this._iTwinProperties.get(iTwinId),
|
|
265
|
-
save: async (properties) => this.
|
|
214
|
+
save: async (properties) => this.storage.saveProperties(properties, iTwinId),
|
|
266
215
|
});
|
|
267
216
|
}
|
|
268
217
|
if (scope === FavoritePropertiesScope.IModel) {
|
|
269
218
|
workingScopes.push({
|
|
270
219
|
properties: this._imodelProperties.get(getiModelInfo(iTwinId, imodelId)),
|
|
271
|
-
save: async (properties) => this.
|
|
220
|
+
save: async (properties) => this.storage.saveProperties(properties, iTwinId, imodelId),
|
|
272
221
|
});
|
|
273
222
|
}
|
|
274
223
|
const saves = [];
|
|
@@ -286,7 +235,7 @@ class FavoritePropertiesManager {
|
|
|
286
235
|
}
|
|
287
236
|
const propertiesOrder = this._propertiesOrder.get(getiModelInfo(iTwinId, imodelId));
|
|
288
237
|
removeOrderInfos(propertiesOrder, (0, exports.createFieldOrderInfos)(field));
|
|
289
|
-
saves.push(this.
|
|
238
|
+
saves.push(this.storage.savePropertiesOrder(propertiesOrder, iTwinId, imodelId));
|
|
290
239
|
await Promise.all(saves);
|
|
291
240
|
this.onFavoritesChanged.raiseEvent();
|
|
292
241
|
}
|
|
@@ -304,15 +253,15 @@ class FavoritePropertiesManager {
|
|
|
304
253
|
switch (scope) {
|
|
305
254
|
case FavoritePropertiesScope.Global:
|
|
306
255
|
favoriteProperties = this._globalProperties;
|
|
307
|
-
saveProperties = async () => this.
|
|
256
|
+
saveProperties = async () => this.storage.saveProperties(new Set());
|
|
308
257
|
break;
|
|
309
258
|
case FavoritePropertiesScope.ITwin:
|
|
310
259
|
favoriteProperties = this._iTwinProperties.get(iTwinId);
|
|
311
|
-
saveProperties = async () => this.
|
|
260
|
+
saveProperties = async () => this.storage.saveProperties(new Set(), iTwinId);
|
|
312
261
|
break;
|
|
313
262
|
default:
|
|
314
263
|
favoriteProperties = this._imodelProperties.get(getiModelInfo(iTwinId, imodelId));
|
|
315
|
-
saveProperties = async () => this.
|
|
264
|
+
saveProperties = async () => this.storage.saveProperties(new Set(), iTwinId, imodelId);
|
|
316
265
|
}
|
|
317
266
|
if (favoriteProperties.size === 0) {
|
|
318
267
|
return;
|
|
@@ -352,6 +301,35 @@ class FavoritePropertiesManager {
|
|
|
352
301
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
353
302
|
return this.has(field, imodel, scope);
|
|
354
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Sorts an array of fields with respect to favorite property order.
|
|
306
|
+
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
307
|
+
* @param imodel IModelConnection.
|
|
308
|
+
* @param fields Array of Field's that needs to be sorted.
|
|
309
|
+
* @note `initializeConnection` must be called with the `imodel` before calling this function.
|
|
310
|
+
* @deprecated in 4.5. Use [[FavoritePropertiesManager.sortFieldsAsync]] instead. This method is not async, therefore it requires early initialization by calling [[FavoritePropertiesManager.initializeConnection]].
|
|
311
|
+
*/
|
|
312
|
+
sortFields = (imodel, fields) => {
|
|
313
|
+
this.validateInitialization(imodel);
|
|
314
|
+
const iTwinId = imodel.iTwinId;
|
|
315
|
+
const imodelId = imodel.iModelId;
|
|
316
|
+
const fieldPriority = new Map();
|
|
317
|
+
fields.forEach((field) => fieldPriority.set(field, this.getFieldPriority(field, iTwinId, imodelId)));
|
|
318
|
+
const sortFunction = (left, right) => {
|
|
319
|
+
const lp = fieldPriority.get(left);
|
|
320
|
+
const rp = fieldPriority.get(right);
|
|
321
|
+
return lp < rp
|
|
322
|
+
? 1
|
|
323
|
+
: lp > rp
|
|
324
|
+
? -1
|
|
325
|
+
: left.priority < right.priority
|
|
326
|
+
? 1 // if favorite fields have equal priorities, sort by field priority
|
|
327
|
+
: left.priority > right.priority
|
|
328
|
+
? -1
|
|
329
|
+
: left.name.localeCompare(right.name);
|
|
330
|
+
};
|
|
331
|
+
return fields.sort(sortFunction);
|
|
332
|
+
};
|
|
355
333
|
/**
|
|
356
334
|
* Sorts an array of fields with respect to favorite property order.
|
|
357
335
|
* Non-favorited fields get sorted by their default priority and always have lower priority than favorited fields.
|
|
@@ -372,6 +350,44 @@ class FavoritePropertiesManager {
|
|
|
372
350
|
const mostRecent = getMostRecentOrderInfo(fieldOrderInfos);
|
|
373
351
|
return mostRecent.priority;
|
|
374
352
|
}
|
|
353
|
+
_getBaseClassesByClass = async (imodel, neededClasses) => {
|
|
354
|
+
const iTwinId = imodel.iTwinId;
|
|
355
|
+
const imodelId = imodel.iModelId;
|
|
356
|
+
const imodelInfo = getiModelInfo(iTwinId, imodelId);
|
|
357
|
+
let baseClasses;
|
|
358
|
+
if (this._imodelBaseClassesByClass.has(imodelInfo)) {
|
|
359
|
+
baseClasses = this._imodelBaseClassesByClass.get(imodelInfo);
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
this._imodelBaseClassesByClass.set(imodelInfo, (baseClasses = {}));
|
|
363
|
+
}
|
|
364
|
+
const missingClasses = new Set();
|
|
365
|
+
neededClasses.forEach((className) => {
|
|
366
|
+
if (!baseClasses.hasOwnProperty(className)) {
|
|
367
|
+
missingClasses.add(className);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
if (missingClasses.size === 0) {
|
|
371
|
+
return baseClasses;
|
|
372
|
+
}
|
|
373
|
+
const query = `
|
|
374
|
+
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
375
|
+
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
376
|
+
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
377
|
+
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
378
|
+
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
379
|
+
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
380
|
+
WHERE (derivedSchema.Name || ':' || derivedClass.Name) IN (${[...missingClasses].map((className) => `'${className}'`).join(",")})`;
|
|
381
|
+
const reader = imodel.createQueryReader(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames });
|
|
382
|
+
while (await reader.step()) {
|
|
383
|
+
const row = reader.current.toRow();
|
|
384
|
+
if (!(row.classFullName in baseClasses)) {
|
|
385
|
+
baseClasses[row.classFullName] = [];
|
|
386
|
+
}
|
|
387
|
+
baseClasses[row.classFullName].push(row.baseClassFullName);
|
|
388
|
+
}
|
|
389
|
+
return baseClasses;
|
|
390
|
+
};
|
|
375
391
|
/** Changes field properties priorities to lower than another fields priority
|
|
376
392
|
* @param imodel IModelConnection.
|
|
377
393
|
* @param field Field that priority is being changed.
|
|
@@ -481,16 +497,11 @@ class FavoritePropertiesManager {
|
|
|
481
497
|
// reassign priority numbers
|
|
482
498
|
let priority = allOrderInfos.length;
|
|
483
499
|
allOrderInfos.forEach((oi) => (oi.priority = priority--));
|
|
484
|
-
await this.
|
|
500
|
+
await this.storage.savePropertiesOrder(allOrderInfos, iTwinId, imodelId);
|
|
485
501
|
this.onFavoritesChanged.raiseEvent();
|
|
486
502
|
}
|
|
487
503
|
}
|
|
488
504
|
exports.FavoritePropertiesManager = FavoritePropertiesManager;
|
|
489
|
-
/**
|
|
490
|
-
* Used in tests to avoid collisions between multiple runs using the same storage
|
|
491
|
-
* @internal
|
|
492
|
-
*/
|
|
493
|
-
FavoritePropertiesManager.FAVORITES_IDENTIFIER_PREFIX = "";
|
|
494
505
|
var Direction;
|
|
495
506
|
(function (Direction) {
|
|
496
507
|
Direction[Direction["Up"] = -1] = "Up";
|
|
@@ -499,11 +510,11 @@ var Direction;
|
|
|
499
510
|
const getiModelInfo = (iTwinId, imodelId) => `${iTwinId}/${imodelId}`;
|
|
500
511
|
const getPropertiesFieldPropertyNames = (field) => {
|
|
501
512
|
const nestingPrefix = getNestingPrefix(field.parent);
|
|
502
|
-
return field.properties.map((property) => `${
|
|
513
|
+
return field.properties.map((property) => `${nestingPrefix}${property.property.classInfo.name}:${property.property.name}`);
|
|
503
514
|
};
|
|
504
515
|
const getNestedContentFieldPropertyName = (field) => {
|
|
505
516
|
const nestingPrefix = getNestingPrefix(field);
|
|
506
|
-
return `${
|
|
517
|
+
return `${nestingPrefix}${field.contentClassInfo.name}`;
|
|
507
518
|
};
|
|
508
519
|
const getNestingPrefix = (field) => {
|
|
509
520
|
const path = [];
|
|
@@ -546,7 +557,7 @@ const getFieldInfos = (field) => {
|
|
|
546
557
|
fieldInfos.add(getNestedContentFieldPropertyName(field));
|
|
547
558
|
}
|
|
548
559
|
else {
|
|
549
|
-
fieldInfos.add(
|
|
560
|
+
fieldInfos.add(field.name);
|
|
550
561
|
}
|
|
551
562
|
return fieldInfos;
|
|
552
563
|
};
|
|
@@ -573,7 +584,6 @@ const addOrderInfos = (dest, source) => {
|
|
|
573
584
|
const removeOrderInfos = (container, toRemove) => {
|
|
574
585
|
toRemove.forEach((roi) => {
|
|
575
586
|
const index = container.findIndex((oi) => oi.name === roi.name);
|
|
576
|
-
/* istanbul ignore else */
|
|
577
587
|
if (index >= 0) {
|
|
578
588
|
container.splice(index, 1);
|
|
579
589
|
}
|