@itwin/presentation-frontend 4.0.0-dev.21 → 4.0.0-dev.23
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/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 +41 -41
- 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 +73 -73
- package/lib/cjs/presentation-frontend/Presentation.js +160 -160
- package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
- package/lib/cjs/presentation-frontend/PresentationManager.d.ts +186 -186
- package/lib/cjs/presentation-frontend/PresentationManager.js +436 -436
- package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/cjs/presentation-frontend/RulesetManager.d.ts +63 -63
- 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 +38 -38
- package/lib/cjs/presentation-frontend/StateTracker.js +129 -129
- 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 +17 -17
- package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +40 -40
- 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 +37 -37
- 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 +73 -73
- package/lib/esm/presentation-frontend/Presentation.js +156 -156
- package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
- package/lib/esm/presentation-frontend/PresentationManager.d.ts +186 -186
- package/lib/esm/presentation-frontend/PresentationManager.js +431 -431
- package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
- package/lib/esm/presentation-frontend/RulesetManager.d.ts +63 -63
- 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 +38 -38
- package/lib/esm/presentation-frontend/StateTracker.js +125 -125
- 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 +17 -17
- package/lib/esm/presentation-frontend/selection/SelectionHelper.js +36 -36
- 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,98 +1,98 @@
|
|
|
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 UnifiedSelection
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.HiliteSetProvider = exports.HILITE_RULESET = void 0;
|
|
11
|
-
const presentation_common_1 = require("@itwin/presentation-common");
|
|
12
|
-
const Presentation_1 = require("../Presentation");
|
|
13
|
-
const SelectionManager_1 = require("./SelectionManager");
|
|
14
|
-
/** @internal */
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
16
|
-
exports.HILITE_RULESET = require("./HiliteRules.json");
|
|
17
|
-
/**
|
|
18
|
-
* Presentation-based provider which uses presentation ruleset to determine
|
|
19
|
-
* what `HiliteSet` should be hilited in the graphics viewport based on the
|
|
20
|
-
* supplied `KeySet`.
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
class HiliteSetProvider {
|
|
25
|
-
constructor(props) {
|
|
26
|
-
this._imodel = props.imodel;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create a hilite set provider for the specified iModel.
|
|
30
|
-
*/
|
|
31
|
-
static create(props) { return new HiliteSetProvider(props); }
|
|
32
|
-
async getRecords(keys) {
|
|
33
|
-
const descriptor = {
|
|
34
|
-
displayType: presentation_common_1.DefaultContentDisplayTypes.Viewport,
|
|
35
|
-
contentFlags: presentation_common_1.ContentFlags.KeysOnly,
|
|
36
|
-
};
|
|
37
|
-
const options = {
|
|
38
|
-
imodel: this._imodel,
|
|
39
|
-
rulesetOrId: exports.HILITE_RULESET,
|
|
40
|
-
descriptor,
|
|
41
|
-
};
|
|
42
|
-
const contentPromises = new Array();
|
|
43
|
-
keys.forEachBatch(presentation_common_1.DEFAULT_KEYS_BATCH_SIZE, (batch) => {
|
|
44
|
-
contentPromises.push(Presentation_1.Presentation.presentation.getContent({ ...options, keys: batch }));
|
|
45
|
-
});
|
|
46
|
-
return (await Promise.all(contentPromises)).reduce((items, content) => {
|
|
47
|
-
if (content)
|
|
48
|
-
items.push(...content.contentSet);
|
|
49
|
-
return items;
|
|
50
|
-
}, new Array());
|
|
51
|
-
}
|
|
52
|
-
createHiliteSet(records, transientIds) {
|
|
53
|
-
if (!records.length)
|
|
54
|
-
return { elements: transientIds };
|
|
55
|
-
const modelIds = new Array();
|
|
56
|
-
const subCategoryIds = new Array();
|
|
57
|
-
const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
|
|
58
|
-
records.forEach((rec) => {
|
|
59
|
-
const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
|
|
60
|
-
rec.primaryKeys.forEach((pk) => ids.push(pk.id));
|
|
61
|
-
});
|
|
62
|
-
return {
|
|
63
|
-
models: modelIds.length ? modelIds : undefined,
|
|
64
|
-
subCategories: subCategoryIds.length ? subCategoryIds : undefined,
|
|
65
|
-
elements: elementIds.length ? elementIds : undefined,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Get hilite set for instances and/or nodes whose keys are specified in the
|
|
70
|
-
* given KeySet.
|
|
71
|
-
*
|
|
72
|
-
* Note: The provider caches result of the last request, so subsequent requests
|
|
73
|
-
* for the same input doesn't cost.
|
|
74
|
-
*/
|
|
75
|
-
async getHiliteSet(selection) {
|
|
76
|
-
const selectionGuid = selection.guid;
|
|
77
|
-
if (!this._cached || this._cached.keysGuid !== selectionGuid) {
|
|
78
|
-
// need to create a new set without transients
|
|
79
|
-
const transientIds = new Array();
|
|
80
|
-
const keys = new presentation_common_1.KeySet();
|
|
81
|
-
keys.add(selection, (key) => {
|
|
82
|
-
if (presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME) {
|
|
83
|
-
transientIds.push(key.id);
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
return true;
|
|
87
|
-
});
|
|
88
|
-
const records = await this.getRecords(keys);
|
|
89
|
-
const result = this.createHiliteSet(records, transientIds);
|
|
90
|
-
this._cached = { keysGuid: selectionGuid, result };
|
|
91
|
-
}
|
|
92
|
-
return this._cached.result;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.HiliteSetProvider = HiliteSetProvider;
|
|
96
|
-
const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
|
|
97
|
-
const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
|
|
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 UnifiedSelection
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.HiliteSetProvider = exports.HILITE_RULESET = void 0;
|
|
11
|
+
const presentation_common_1 = require("@itwin/presentation-common");
|
|
12
|
+
const Presentation_1 = require("../Presentation");
|
|
13
|
+
const SelectionManager_1 = require("./SelectionManager");
|
|
14
|
+
/** @internal */
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
16
|
+
exports.HILITE_RULESET = require("./HiliteRules.json");
|
|
17
|
+
/**
|
|
18
|
+
* Presentation-based provider which uses presentation ruleset to determine
|
|
19
|
+
* what `HiliteSet` should be hilited in the graphics viewport based on the
|
|
20
|
+
* supplied `KeySet`.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
class HiliteSetProvider {
|
|
25
|
+
constructor(props) {
|
|
26
|
+
this._imodel = props.imodel;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create a hilite set provider for the specified iModel.
|
|
30
|
+
*/
|
|
31
|
+
static create(props) { return new HiliteSetProvider(props); }
|
|
32
|
+
async getRecords(keys) {
|
|
33
|
+
const descriptor = {
|
|
34
|
+
displayType: presentation_common_1.DefaultContentDisplayTypes.Viewport,
|
|
35
|
+
contentFlags: presentation_common_1.ContentFlags.KeysOnly,
|
|
36
|
+
};
|
|
37
|
+
const options = {
|
|
38
|
+
imodel: this._imodel,
|
|
39
|
+
rulesetOrId: exports.HILITE_RULESET,
|
|
40
|
+
descriptor,
|
|
41
|
+
};
|
|
42
|
+
const contentPromises = new Array();
|
|
43
|
+
keys.forEachBatch(presentation_common_1.DEFAULT_KEYS_BATCH_SIZE, (batch) => {
|
|
44
|
+
contentPromises.push(Presentation_1.Presentation.presentation.getContent({ ...options, keys: batch }));
|
|
45
|
+
});
|
|
46
|
+
return (await Promise.all(contentPromises)).reduce((items, content) => {
|
|
47
|
+
if (content)
|
|
48
|
+
items.push(...content.contentSet);
|
|
49
|
+
return items;
|
|
50
|
+
}, new Array());
|
|
51
|
+
}
|
|
52
|
+
createHiliteSet(records, transientIds) {
|
|
53
|
+
if (!records.length)
|
|
54
|
+
return { elements: transientIds };
|
|
55
|
+
const modelIds = new Array();
|
|
56
|
+
const subCategoryIds = new Array();
|
|
57
|
+
const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
|
|
58
|
+
records.forEach((rec) => {
|
|
59
|
+
const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
|
|
60
|
+
rec.primaryKeys.forEach((pk) => ids.push(pk.id));
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
models: modelIds.length ? modelIds : undefined,
|
|
64
|
+
subCategories: subCategoryIds.length ? subCategoryIds : undefined,
|
|
65
|
+
elements: elementIds.length ? elementIds : undefined,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get hilite set for instances and/or nodes whose keys are specified in the
|
|
70
|
+
* given KeySet.
|
|
71
|
+
*
|
|
72
|
+
* Note: The provider caches result of the last request, so subsequent requests
|
|
73
|
+
* for the same input doesn't cost.
|
|
74
|
+
*/
|
|
75
|
+
async getHiliteSet(selection) {
|
|
76
|
+
const selectionGuid = selection.guid;
|
|
77
|
+
if (!this._cached || this._cached.keysGuid !== selectionGuid) {
|
|
78
|
+
// need to create a new set without transients
|
|
79
|
+
const transientIds = new Array();
|
|
80
|
+
const keys = new presentation_common_1.KeySet();
|
|
81
|
+
keys.add(selection, (key) => {
|
|
82
|
+
if (presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME) {
|
|
83
|
+
transientIds.push(key.id);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
});
|
|
88
|
+
const records = await this.getRecords(keys);
|
|
89
|
+
const result = this.createHiliteSet(records, transientIds);
|
|
90
|
+
this._cached = { keysGuid: selectionGuid, result };
|
|
91
|
+
}
|
|
92
|
+
return this._cached.result;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.HiliteSetProvider = HiliteSetProvider;
|
|
96
|
+
const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
|
|
97
|
+
const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
|
|
98
98
|
//# sourceMappingURL=HiliteSetProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,oEAEoC;AACpC,kDAA+C;AAC/C,yDAAiE;AAEjE,gBAAgB;AAChB,8DAA8D;AACjD,QAAA,cAAc,GAAY,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAsBrE;;;;;;GAMG;AACH,MAAa,iBAAiB;IAI5B,YAAoB,KAA6B;QAC/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,KAA6B,IAAI,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEpF,KAAK,CAAC,UAAU,CAAC,IAAY;QACnC,MAAM,UAAU,GAAwB;YACtC,WAAW,EAAE,gDAA0B,CAAC,QAAQ;YAChD,YAAY,EAAE,kCAAY,CAAC,QAAQ;SACpC,CAAC;QACF,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,WAAW,EAAE,sBAAc;YAC3B,UAAU;SACX,CAAC;QACF,MAAM,eAAe,GAAG,IAAI,KAAK,EAAgC,CAAC;QAClE,IAAI,CAAC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AG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAEpF,MAAM,mBAAmB,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,oEAEoC;AACpC,kDAA+C;AAC/C,yDAAiE;AAEjE,gBAAgB;AAChB,8DAA8D;AACjD,QAAA,cAAc,GAAY,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAsBrE;;;;;;GAMG;AACH,MAAa,iBAAiB;IAI5B,YAAoB,KAA6B;QAC/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,KAA6B,IAAI,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEpF,KAAK,CAAC,UAAU,CAAC,IAAY;QACnC,MAAM,UAAU,GAAwB;YACtC,WAAW,EAAE,gDAA0B,CAAC,QAAQ;YAChD,YAAY,EAAE,kCAAY,CAAC,QAAQ;SACpC,CAAC;QACF,MAAM,OAAO,GAAG;YACd,MAAM,EAAE,IAAI,CAAC,OAAO;YACpB,WAAW,EAAE,sBAAc;YAC3B,UAAU;SACX,CAAC;QACF,MAAM,eAAe,GAAG,IAAI,KAAK,EAAgC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,6CAAuB,EAAE,CAAC,KAAa,EAAE,EAAE;YAC3D,eAAe,CAAC,IAAI,CAAC,2BAAY,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QAC1F,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------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport {\n Content, ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, DescriptorOverrides, Item, Key, KeySet, Ruleset,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"../Presentation\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./SelectionManager\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const HILITE_RULESET: Ruleset = require(\"./HiliteRules.json\");\n\n/**\n * A set of model, subcategory and element ids that can be used for specifying\n * viewport hilite.\n *\n * @public\n */\nexport interface HiliteSet {\n models?: Id64String[];\n subCategories?: Id64String[];\n elements?: Id64String[];\n}\n\n/**\n * Properties for creating a `HiliteSetProvider` instance.\n * @public\n */\nexport interface HiliteSetProviderProps {\n imodel: IModelConnection;\n}\n\n/**\n * Presentation-based provider which uses presentation ruleset to determine\n * what `HiliteSet` should be hilited in the graphics viewport based on the\n * supplied `KeySet`.\n *\n * @public\n */\nexport class HiliteSetProvider {\n private _imodel: IModelConnection;\n private _cached: undefined | { keysGuid: string, result: HiliteSet };\n\n private constructor(props: HiliteSetProviderProps) {\n this._imodel = props.imodel;\n }\n\n /**\n * Create a hilite set provider for the specified iModel.\n */\n public static create(props: HiliteSetProviderProps) { return new HiliteSetProvider(props); }\n\n private async getRecords(keys: KeySet): Promise<Item[]> {\n const descriptor: DescriptorOverrides = {\n displayType: DefaultContentDisplayTypes.Viewport,\n contentFlags: ContentFlags.KeysOnly,\n };\n const options = {\n imodel: this._imodel,\n rulesetOrId: HILITE_RULESET,\n descriptor,\n };\n const contentPromises = new Array<Promise<Content | undefined>>();\n keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch: KeySet) => {\n contentPromises.push(Presentation.presentation.getContent({ ...options, keys: batch }));\n });\n return (await Promise.all(contentPromises)).reduce((items, content) => {\n if (content)\n items.push(...content.contentSet);\n return items;\n }, new Array<Item>());\n }\n\n private createHiliteSet(records: Item[], transientIds: Id64String[]) {\n if (!records.length)\n return { elements: transientIds };\n\n const modelIds = new Array<Id64String>();\n const subCategoryIds = new Array<Id64String>();\n const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway\n records.forEach((rec) => {\n const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;\n rec.primaryKeys.forEach((pk) => ids.push(pk.id));\n });\n return {\n models: modelIds.length ? modelIds : undefined,\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\n elements: elementIds.length ? elementIds : undefined,\n };\n }\n\n /**\n * Get hilite set for instances and/or nodes whose keys are specified in the\n * given KeySet.\n *\n * Note: The provider caches result of the last request, so subsequent requests\n * for the same input doesn't cost.\n */\n public async getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet> {\n const selectionGuid = selection.guid;\n if (!this._cached || this._cached.keysGuid !== selectionGuid) {\n // need to create a new set without transients\n const transientIds = new Array<Id64String>();\n const keys = new KeySet();\n keys.add(selection, (key: Key) => {\n if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {\n transientIds.push(key.id);\n return false;\n }\n return true;\n });\n const records = await this.getRecords(keys);\n const result = this.createHiliteSet(records, transientIds);\n this._cached = { keysGuid: selectionGuid, result };\n }\n return this._cached.result;\n }\n}\n\nconst isModelRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isModel);\n\nconst isSubCategoryRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isSubCategory);\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module UnifiedSelection
|
|
3
|
-
*/
|
|
4
|
-
import { IModelConnection } from "@itwin/core-frontend";
|
|
5
|
-
import { KeySet } from "@itwin/presentation-common";
|
|
6
|
-
import { SelectionChangeEvent } from "./SelectionChangeEvent";
|
|
7
|
-
/**
|
|
8
|
-
* Selection provider interface which provides main selection and sub-selection.
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export interface ISelectionProvider {
|
|
12
|
-
/** An event that's fired when selection changes */
|
|
13
|
-
selectionChange: SelectionChangeEvent;
|
|
14
|
-
/** Get the selection stored in the provider.
|
|
15
|
-
* @param imodel iModel connection which the selection is associated with.
|
|
16
|
-
* @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))
|
|
17
|
-
*/
|
|
18
|
-
getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;
|
|
19
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module UnifiedSelection
|
|
3
|
+
*/
|
|
4
|
+
import { IModelConnection } from "@itwin/core-frontend";
|
|
5
|
+
import { KeySet } from "@itwin/presentation-common";
|
|
6
|
+
import { SelectionChangeEvent } from "./SelectionChangeEvent";
|
|
7
|
+
/**
|
|
8
|
+
* Selection provider interface which provides main selection and sub-selection.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface ISelectionProvider {
|
|
12
|
+
/** An event that's fired when selection changes */
|
|
13
|
+
selectionChange: SelectionChangeEvent;
|
|
14
|
+
/** Get the selection stored in the provider.
|
|
15
|
+
* @param imodel iModel connection which the selection is associated with.
|
|
16
|
+
* @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))
|
|
17
|
+
*/
|
|
18
|
+
getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;
|
|
19
|
+
}
|
|
20
20
|
//# sourceMappingURL=ISelectionProvider.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
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 UnifiedSelection
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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 UnifiedSelection
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
//# sourceMappingURL=ISelectionProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","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 UnifiedSelection\n */\n\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { SelectionChangeEvent } from \"./SelectionChangeEvent\";\n\n/**\n * Selection provider interface which provides main selection and sub-selection.\n * @public\n */\nexport interface ISelectionProvider {\n /** An event that's fired when selection changes */\n selectionChange: SelectionChangeEvent;\n\n /** Get the selection stored in the provider.\n * @param imodel iModel connection which the selection is associated with.\n * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))\n */\n getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;\n}\n"]}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module UnifiedSelection
|
|
3
|
-
*/
|
|
4
|
-
import { BeEvent } from "@itwin/core-bentley";
|
|
5
|
-
import { IModelConnection } from "@itwin/core-frontend";
|
|
6
|
-
import { KeySet } from "@itwin/presentation-common";
|
|
7
|
-
import { ISelectionProvider } from "./ISelectionProvider";
|
|
8
|
-
/**
|
|
9
|
-
* An interface for selection change listeners.
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
|
|
13
|
-
/**
|
|
14
|
-
* An event broadcasted on selection changes
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
export declare class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The type of selection change
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
export declare enum SelectionChangeType {
|
|
24
|
-
/** Added to selection. */
|
|
25
|
-
Add = 0,
|
|
26
|
-
/** Removed from selection. */
|
|
27
|
-
Remove = 1,
|
|
28
|
-
/** Selection was replaced. */
|
|
29
|
-
Replace = 2,
|
|
30
|
-
/** Selection was cleared. */
|
|
31
|
-
Clear = 3
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* The event object that's sent when the selection changes.
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export interface SelectionChangeEventArgs {
|
|
38
|
-
/** The name of the selection source which caused the selection change. */
|
|
39
|
-
source: string;
|
|
40
|
-
/** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */
|
|
41
|
-
level: number;
|
|
42
|
-
/** The selection change type. */
|
|
43
|
-
changeType: SelectionChangeType;
|
|
44
|
-
/** Set of keys affected by this selection change event. */
|
|
45
|
-
keys: Readonly<KeySet>;
|
|
46
|
-
/** iModel connection with which the selection is associated with. */
|
|
47
|
-
imodel: IModelConnection;
|
|
48
|
-
/** The timestamp of when the selection change happened */
|
|
49
|
-
timestamp: Date;
|
|
50
|
-
/** Id of the ruleset associated with the selection change. */
|
|
51
|
-
rulesetId?: string;
|
|
52
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module UnifiedSelection
|
|
3
|
+
*/
|
|
4
|
+
import { BeEvent } from "@itwin/core-bentley";
|
|
5
|
+
import { IModelConnection } from "@itwin/core-frontend";
|
|
6
|
+
import { KeySet } from "@itwin/presentation-common";
|
|
7
|
+
import { ISelectionProvider } from "./ISelectionProvider";
|
|
8
|
+
/**
|
|
9
|
+
* An interface for selection change listeners.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
|
|
13
|
+
/**
|
|
14
|
+
* An event broadcasted on selection changes
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The type of selection change
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare enum SelectionChangeType {
|
|
24
|
+
/** Added to selection. */
|
|
25
|
+
Add = 0,
|
|
26
|
+
/** Removed from selection. */
|
|
27
|
+
Remove = 1,
|
|
28
|
+
/** Selection was replaced. */
|
|
29
|
+
Replace = 2,
|
|
30
|
+
/** Selection was cleared. */
|
|
31
|
+
Clear = 3
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The event object that's sent when the selection changes.
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export interface SelectionChangeEventArgs {
|
|
38
|
+
/** The name of the selection source which caused the selection change. */
|
|
39
|
+
source: string;
|
|
40
|
+
/** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */
|
|
41
|
+
level: number;
|
|
42
|
+
/** The selection change type. */
|
|
43
|
+
changeType: SelectionChangeType;
|
|
44
|
+
/** Set of keys affected by this selection change event. */
|
|
45
|
+
keys: Readonly<KeySet>;
|
|
46
|
+
/** iModel connection with which the selection is associated with. */
|
|
47
|
+
imodel: IModelConnection;
|
|
48
|
+
/** The timestamp of when the selection change happened */
|
|
49
|
+
timestamp: Date;
|
|
50
|
+
/** Id of the ruleset associated with the selection change. */
|
|
51
|
+
rulesetId?: string;
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=SelectionChangeEvent.d.ts.map
|
|
@@ -1,34 +1,34 @@
|
|
|
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 UnifiedSelection
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.SelectionChangeType = exports.SelectionChangeEvent = void 0;
|
|
11
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
-
/**
|
|
13
|
-
* An event broadcasted on selection changes
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
class SelectionChangeEvent extends core_bentley_1.BeEvent {
|
|
17
|
-
}
|
|
18
|
-
exports.SelectionChangeEvent = SelectionChangeEvent;
|
|
19
|
-
/**
|
|
20
|
-
* The type of selection change
|
|
21
|
-
* @public
|
|
22
|
-
*/
|
|
23
|
-
var SelectionChangeType;
|
|
24
|
-
(function (SelectionChangeType) {
|
|
25
|
-
/** Added to selection. */
|
|
26
|
-
SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
|
|
27
|
-
/** Removed from selection. */
|
|
28
|
-
SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
|
|
29
|
-
/** Selection was replaced. */
|
|
30
|
-
SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
|
|
31
|
-
/** Selection was cleared. */
|
|
32
|
-
SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
|
|
33
|
-
})(SelectionChangeType = exports.SelectionChangeType || (exports.SelectionChangeType = {}));
|
|
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 UnifiedSelection
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SelectionChangeType = exports.SelectionChangeEvent = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
/**
|
|
13
|
+
* An event broadcasted on selection changes
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
class SelectionChangeEvent extends core_bentley_1.BeEvent {
|
|
17
|
+
}
|
|
18
|
+
exports.SelectionChangeEvent = SelectionChangeEvent;
|
|
19
|
+
/**
|
|
20
|
+
* The type of selection change
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
var SelectionChangeType;
|
|
24
|
+
(function (SelectionChangeType) {
|
|
25
|
+
/** Added to selection. */
|
|
26
|
+
SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
|
|
27
|
+
/** Removed from selection. */
|
|
28
|
+
SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
|
|
29
|
+
/** Selection was replaced. */
|
|
30
|
+
SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
|
|
31
|
+
/** Selection was cleared. */
|
|
32
|
+
SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
|
|
33
|
+
})(SelectionChangeType = exports.SelectionChangeType || (exports.SelectionChangeType = {}));
|
|
34
34
|
//# sourceMappingURL=SelectionChangeEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAW9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,sBAAiC;CAAI;AAA/E,oDAA+E;AAE/E;;;GAGG;AACH,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,0BAA0B;IAC1B,2DAAG,CAAA;IAEH,8BAA8B;IAC9B,iEAAM,CAAA;IAEN,8BAA8B;IAC9B,mEAAO,CAAA;IAEP,6BAA6B;IAC7B,+DAAK,CAAA;AACP,CAAC,EAZW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAY9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAW9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,sBAAiC;CAAI;AAA/E,oDAA+E;AAE/E;;;GAGG;AACH,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,0BAA0B;IAC1B,2DAAG,CAAA;IAEH,8BAA8B;IAC9B,iEAAM,CAAA;IAEN,8BAA8B;IAC9B,mEAAO,CAAA;IAEP,6BAA6B;IAC7B,+DAAK,CAAA;AACP,CAAC,EAZW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAY9B","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 UnifiedSelection\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { ISelectionProvider } from \"./ISelectionProvider\";\n\n/**\n * An interface for selection change listeners.\n * @public\n */\nexport declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;\n\n/**\n * An event broadcasted on selection changes\n * @public\n */\nexport class SelectionChangeEvent extends BeEvent<SelectionChangesListener> { }\n\n/**\n * The type of selection change\n * @public\n */\nexport enum SelectionChangeType {\n /** Added to selection. */\n Add,\n\n /** Removed from selection. */\n Remove,\n\n /** Selection was replaced. */\n Replace,\n\n /** Selection was cleared. */\n Clear,\n}\n\n/**\n * The event object that's sent when the selection changes.\n * @public\n */\nexport interface SelectionChangeEventArgs {\n /** The name of the selection source which caused the selection change. */\n source: string;\n\n /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */\n level: number;\n\n /** The selection change type. */\n changeType: SelectionChangeType;\n\n /** Set of keys affected by this selection change event. */\n keys: Readonly<KeySet>;\n\n /** iModel connection with which the selection is associated with. */\n imodel: IModelConnection;\n\n /** The timestamp of when the selection change happened */\n timestamp: Date;\n\n /** Id of the ruleset associated with the selection change. */\n rulesetId?: string;\n}\n"]}
|