@itwin/appui-abstract 4.0.0-dev.8 → 4.0.0-dev.9
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1 -90
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts +3 -3
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js +3 -4
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts +5 -5
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.js +7 -8
- package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsProvider.d.ts +4 -5
- package/lib/cjs/appui-abstract/UiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/DialogItem.d.ts +1 -1
- package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts +0 -12
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js +0 -19
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts +6 -23
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/StagePanel.d.ts +4 -19
- package/lib/cjs/appui-abstract/widget/StagePanel.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/widget/StagePanel.js +5 -21
- package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -1
- package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts +3 -3
- package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js +3 -4
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.d.ts +5 -5
- package/lib/esm/appui-abstract/UiItemsManager.d.ts.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.js +7 -8
- package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsProvider.d.ts +4 -5
- package/lib/esm/appui-abstract/UiItemsProvider.d.ts.map +1 -1
- package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/DialogItem.d.ts +1 -1
- package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts +0 -12
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.js +0 -19
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts +6 -23
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -1
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
- package/lib/esm/appui-abstract/widget/StagePanel.d.ts +4 -19
- package/lib/esm/appui-abstract/widget/StagePanel.d.ts.map +1 -1
- package/lib/esm/appui-abstract/widget/StagePanel.js +4 -20
- package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -1
- package/package.json +14 -22
package/CHANGELOG.md
CHANGED
@@ -1,95 +1,6 @@
|
|
1
1
|
# Change Log - @itwin/appui-abstract
|
2
2
|
|
3
|
-
This log was last generated on Thu,
|
4
|
-
|
5
|
-
## 3.5.5
|
6
|
-
Thu, 26 Jan 2023 22:53:27 GMT
|
7
|
-
|
8
|
-
_Version update only_
|
9
|
-
|
10
|
-
## 3.5.4
|
11
|
-
Wed, 18 Jan 2023 15:27:15 GMT
|
12
|
-
|
13
|
-
_Version update only_
|
14
|
-
|
15
|
-
## 3.5.3
|
16
|
-
Fri, 13 Jan 2023 17:23:07 GMT
|
17
|
-
|
18
|
-
_Version update only_
|
19
|
-
|
20
|
-
## 3.5.2
|
21
|
-
Wed, 11 Jan 2023 16:46:29 GMT
|
22
|
-
|
23
|
-
_Version update only_
|
24
|
-
|
25
|
-
## 3.5.1
|
26
|
-
Thu, 15 Dec 2022 16:38:28 GMT
|
27
|
-
|
28
|
-
_Version update only_
|
29
|
-
|
30
|
-
## 3.5.0
|
31
|
-
Wed, 07 Dec 2022 19:12:36 GMT
|
32
|
-
|
33
|
-
### Updates
|
34
|
-
|
35
|
-
- Expose allowedPanelTargets to apps in AbstractWidgetProps.
|
36
|
-
|
37
|
-
## 3.4.7
|
38
|
-
Wed, 30 Nov 2022 14:28:19 GMT
|
39
|
-
|
40
|
-
_Version update only_
|
41
|
-
|
42
|
-
## 3.4.6
|
43
|
-
Tue, 22 Nov 2022 14:24:19 GMT
|
44
|
-
|
45
|
-
_Version update only_
|
46
|
-
|
47
|
-
## 3.4.5
|
48
|
-
Thu, 17 Nov 2022 21:32:49 GMT
|
49
|
-
|
50
|
-
_Version update only_
|
51
|
-
|
52
|
-
## 3.4.4
|
53
|
-
Thu, 10 Nov 2022 19:32:17 GMT
|
54
|
-
|
55
|
-
_Version update only_
|
56
|
-
|
57
|
-
## 3.4.3
|
58
|
-
Fri, 28 Oct 2022 13:34:57 GMT
|
59
|
-
|
60
|
-
_Version update only_
|
61
|
-
|
62
|
-
## 3.4.2
|
63
|
-
Mon, 24 Oct 2022 13:23:45 GMT
|
64
|
-
|
65
|
-
_Version update only_
|
66
|
-
|
67
|
-
## 3.4.1
|
68
|
-
Mon, 17 Oct 2022 20:06:51 GMT
|
69
|
-
|
70
|
-
_Version update only_
|
71
|
-
|
72
|
-
## 3.4.0
|
73
|
-
Thu, 13 Oct 2022 20:24:47 GMT
|
74
|
-
|
75
|
-
### Updates
|
76
|
-
|
77
|
-
- Updated Node types declaration to support latest v16
|
78
|
-
|
79
|
-
## 3.3.5
|
80
|
-
Tue, 27 Sep 2022 11:50:59 GMT
|
81
|
-
|
82
|
-
_Version update only_
|
83
|
-
|
84
|
-
## 3.3.4
|
85
|
-
Thu, 08 Sep 2022 19:00:04 GMT
|
86
|
-
|
87
|
-
_Version update only_
|
88
|
-
|
89
|
-
## 3.3.3
|
90
|
-
Tue, 06 Sep 2022 20:54:19 GMT
|
91
|
-
|
92
|
-
_Version update only_
|
3
|
+
This log was last generated on Thu, 01 Sep 2022 14:37:22 GMT and should not be manually modified.
|
93
4
|
|
94
5
|
## 3.3.2
|
95
6
|
Thu, 01 Sep 2022 14:37:22 GMT
|
@@ -5,7 +5,7 @@ import { BackstageItem } from "./backstage/BackstageItem";
|
|
5
5
|
import { CommonStatusBarItem } from "./statusbar/StatusBarItem";
|
6
6
|
import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem";
|
7
7
|
import { AbstractWidgetProps } from "./widget/AbstractWidgetProps";
|
8
|
-
import {
|
8
|
+
import { StagePanelLocation, StagePanelSection } from "./widget/StagePanel";
|
9
9
|
import { UiItemsProvider } from "./UiItemsProvider";
|
10
10
|
/** Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
|
11
11
|
* active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
|
@@ -25,7 +25,7 @@ export declare class BaseUiItemsProvider implements UiItemsProvider {
|
|
25
25
|
provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[];
|
26
26
|
provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[];
|
27
27
|
provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[];
|
28
|
-
provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection,
|
29
|
-
provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection,
|
28
|
+
provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _stageAppData?: any): AbstractWidgetProps[];
|
29
|
+
provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, stageAppData?: any): ReadonlyArray<AbstractWidgetProps>;
|
30
30
|
}
|
31
31
|
//# sourceMappingURL=BaseUiItemsProvider.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"BaseUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IAO7C,SAAS,CAAC,WAAW,EAAE,MAAM;IAAS,gBAAgB,CAAC,aAAY,MAAM,cAAc,MAAM,iBAAiB,GAAG,6CAAiC,OAAO;gBAA/I,WAAW,EAAE,MAAM,EAAS,gBAAgB,CAAC,aAAY,MAAM,cAAc,MAAM,iBAAiB,GAAG,6CAAiC,OAAO,aAAA;IAErK,IAAW,EAAE,IAAI,MAAM,CAA6B;IAC7C,YAAY,IAAI,IAAI;IAEpB,UAAU;IAIjB,oEAAoE;IAC7D,qBAAqB,IAAI,aAAa,EAAE;IAIxC,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE;IAGxL,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE;IAY3K,6BAA6B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAGhH,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAYrG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAItK,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAW9K"}
|
@@ -3,7 +3,6 @@
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
6
|
-
/* eslint-disable deprecation/deprecation */
|
7
6
|
/** @packageDocumentation
|
8
7
|
* @module UiItemsProvider
|
9
8
|
*/
|
@@ -62,10 +61,10 @@ class BaseUiItemsProvider {
|
|
62
61
|
}
|
63
62
|
return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];
|
64
63
|
}
|
65
|
-
provideWidgetsInternal(_stageId, _stageUsage, _location, _section,
|
64
|
+
provideWidgetsInternal(_stageId, _stageUsage, _location, _section, _stageAppData) {
|
66
65
|
return [];
|
67
66
|
}
|
68
|
-
provideWidgets(stageId, stageUsage, location, section,
|
67
|
+
provideWidgets(stageId, stageUsage, location, section, stageAppData) {
|
69
68
|
let provideToStage = false;
|
70
69
|
if (this.isSupportedStage) {
|
71
70
|
provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
|
@@ -73,7 +72,7 @@ class BaseUiItemsProvider {
|
|
73
72
|
else {
|
74
73
|
provideToStage = (stageUsage === StageUsage_1.StageUsage.General);
|
75
74
|
}
|
76
|
-
return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section,
|
75
|
+
return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, stageAppData) : [];
|
77
76
|
}
|
78
77
|
}
|
79
78
|
exports.BaseUiItemsProvider = BaseUiItemsProvider;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseUiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F
|
1
|
+
{"version":3,"file":"BaseUiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH,mDAAgD;AAEhD,qDAAkD;AAElD;;;;GAIG;AACH,MAAa,mBAAmB;IAC9B;;;;;OAKG;IACH,YAAsB,WAAmB,EAAS,gBAAmH;QAA/I,gBAAW,GAAX,WAAW,CAAQ;Q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C;SACjF;aAAM;YACL,cAAc,GAAG,CAAC,UAAU,KAAK,uBAAU,CAAC,OAAO,CAAC,CAAC;SACtD;QAED,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrG,CAAC;IAEM,sBAAsB,CAAC,QAAgB,EAAE,WAAmB,EAAE,SAA6B,EAAE,QAA4B,EAAE,aAAmB;QACnJ,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,cAAc,CAAC,OAAe,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B,EAAE,YAAkB;QACtI,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SACjF;aAAM;YACL,cAAc,GAAG,CAAC,UAAU,KAAK,uBAAU,CAAC,OAAO,CAAC,CAAC;SACtD;QAED,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACjH,CAAC;CACF;AAlED,kDAkEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\nimport { StageUsage } from \"./items/StageUsage\";\r\nimport { UiItemsProvider } from \"./UiItemsProvider\";\r\nimport { UiItemsManager } from \"./UiItemsManager\";\r\n\r\n/** Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the\r\n * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.\r\n * @deprecated in 3.6. Use [BaseUiItemsProvider]($appui-react) instead.\r\n * @public\r\n */\r\nexport class BaseUiItemsProvider implements UiItemsProvider {\r\n /*\r\n * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want\r\n * to set up custom stage with their own subset of standard tools.\r\n * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and\r\n * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.\r\n */\r\n constructor(protected _providerId: string, public isSupportedStage?: (stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider) => boolean) { }\r\n\r\n public get id(): string { return this._providerId; }\r\n public onUnregister(): void { }\r\n\r\n public unregister() {\r\n UiItemsManager.unregister(this._providerId);\r\n }\r\n\r\n /** Backstage items are not stage specific so no callback is used */\r\n public provideBackstageItems(): BackstageItem[] {\r\n return [];\r\n }\r\n\r\n public provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[] {\r\n return [];\r\n }\r\n public provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];\r\n }\r\n\r\n public provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[] {\r\n return [];\r\n }\r\n public provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];\r\n }\r\n\r\n public provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _stageAppData?: any): AbstractWidgetProps[] {\r\n return [];\r\n }\r\n\r\n public provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, stageAppData) : [];\r\n }\r\n}\r\n"]}
|
@@ -6,10 +6,10 @@ import { BackstageItem } from "./backstage/BackstageItem";
|
|
6
6
|
import { CommonStatusBarItem } from "./statusbar/StatusBarItem";
|
7
7
|
import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem";
|
8
8
|
import { AbstractWidgetProps } from "./widget/AbstractWidgetProps";
|
9
|
-
import {
|
9
|
+
import { StagePanelLocation, StagePanelSection } from "./widget/StagePanel";
|
10
10
|
import { UiItemsProvider } from "./UiItemsProvider";
|
11
11
|
/** Action taken by the application on item provided by a UiItemsProvider
|
12
|
-
* @public @deprecated
|
12
|
+
* @public @deprecated this was only used by the previously removed UiItemsArbiter.
|
13
13
|
*/
|
14
14
|
export declare enum UiItemsApplicationAction {
|
15
15
|
/** Allow the change to the item */
|
@@ -91,13 +91,13 @@ export declare class UiItemsManager {
|
|
91
91
|
* @param toolbarOrientation orientation of the toolbar
|
92
92
|
* @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.
|
93
93
|
*/
|
94
|
-
static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation
|
94
|
+
static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation): CommonToolbarItem[];
|
95
95
|
/** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
|
96
96
|
* @param stageId a string identifier the active stage.
|
97
97
|
* @param stageUsage the StageUsage of the active stage.
|
98
98
|
* @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.
|
99
99
|
*/
|
100
|
-
static getStatusBarItems(stageId: string, stageUsage: string
|
100
|
+
static getStatusBarItems(stageId: string, stageUsage: string): CommonStatusBarItem[];
|
101
101
|
/** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
|
102
102
|
* @returns An array of BackstageItem that will be used to create controls for the backstage menu.
|
103
103
|
*/
|
@@ -109,6 +109,6 @@ export declare class UiItemsManager {
|
|
109
109
|
* @param section the section within location.
|
110
110
|
* @returns An array of AbstractWidgetProps that will be used to create widgets.
|
111
111
|
*/
|
112
|
-
static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection
|
112
|
+
static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection): ReadonlyArray<AbstractWidgetProps>;
|
113
113
|
}
|
114
114
|
//# sourceMappingURL=UiItemsManager.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UiItemsManager.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"UiItemsManager.d.ts","sourceRoot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aAAa,GAAG,UAAU,CAAC,CAAC;AAQ1F;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAA4E;IAEtH;mBACe;WACD,iBAAiB;IAI/B,wEAAwE;IACxE,gBAAuB,2BAA2B,eAAoB,iCAAiC,KAAK,IAAI,EAAI;IAEpH,8CAA8C;IAC9C,WAAkB,qBAAqB,aAGtC;IAED,yDAAyD;IACzD,WAAkB,sBAAsB,IAAI,OAAO,CAElD;IAED;;;OAGG;WACW,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIjF,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAIlC;;;OAGG;WACW,QAAQ,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,uBAAuB,GAAG,IAAI;IAa9F,8EAA8E;WAChE,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAcpD,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAUrC;;;;;;;OAOG;WACW,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EACjG,kBAAkB,EAAE,kBAAkB,GAAG,iBAAiB,EAAE;IAsB9D;;;;OAIG;WACW,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,mBAAmB,EAAE;IAwB3F;;OAEG;WACW,iBAAiB,IAAI,aAAa,EAAE;IAuBlD;;;;;;OAMG;WACW,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAuB7J"}
|
@@ -3,7 +3,6 @@
|
|
3
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
6
|
-
/* eslint-disable deprecation/deprecation */
|
7
6
|
/** @packageDocumentation
|
8
7
|
* @module UiItemsProvider
|
9
8
|
*/
|
@@ -12,7 +11,7 @@ exports.UiItemsManager = exports.UiItemsApplicationAction = void 0;
|
|
12
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
13
12
|
const misc_1 = require("./utils/misc");
|
14
13
|
/** Action taken by the application on item provided by a UiItemsProvider
|
15
|
-
* @public @deprecated
|
14
|
+
* @public @deprecated this was only used by the previously removed UiItemsArbiter.
|
16
15
|
*/
|
17
16
|
var UiItemsApplicationAction;
|
18
17
|
(function (UiItemsApplicationAction) {
|
@@ -97,7 +96,7 @@ class UiItemsManager {
|
|
97
96
|
* @param toolbarOrientation orientation of the toolbar
|
98
97
|
* @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.
|
99
98
|
*/
|
100
|
-
static getToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation
|
99
|
+
static getToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation) {
|
101
100
|
const buttonItems = [];
|
102
101
|
if (0 === UiItemsManager._registeredUiItemsProviders.size)
|
103
102
|
return buttonItems;
|
@@ -107,7 +106,7 @@ class UiItemsManager {
|
|
107
106
|
const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
|
108
107
|
// istanbul ignore else
|
109
108
|
if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
|
110
|
-
uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation
|
109
|
+
uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation)
|
111
110
|
.forEach((spec) => {
|
112
111
|
// ignore duplicate ids
|
113
112
|
if (-1 === buttonItems.findIndex((existingItem) => spec.id === existingItem.id))
|
@@ -122,7 +121,7 @@ class UiItemsManager {
|
|
122
121
|
* @param stageUsage the StageUsage of the active stage.
|
123
122
|
* @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.
|
124
123
|
*/
|
125
|
-
static getStatusBarItems(stageId, stageUsage
|
124
|
+
static getStatusBarItems(stageId, stageUsage) {
|
126
125
|
const statusBarItems = [];
|
127
126
|
if (0 === UiItemsManager._registeredUiItemsProviders.size)
|
128
127
|
return statusBarItems;
|
@@ -132,7 +131,7 @@ class UiItemsManager {
|
|
132
131
|
const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
|
133
132
|
// istanbul ignore else
|
134
133
|
if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
|
135
|
-
uiProvider.provideStatusBarItems(stageId, stageUsage
|
134
|
+
uiProvider.provideStatusBarItems(stageId, stageUsage)
|
136
135
|
.forEach((item) => {
|
137
136
|
// ignore duplicate ids
|
138
137
|
if (-1 === statusBarItems.findIndex((existingItem) => item.id === existingItem.id))
|
@@ -172,7 +171,7 @@ class UiItemsManager {
|
|
172
171
|
* @param section the section within location.
|
173
172
|
* @returns An array of AbstractWidgetProps that will be used to create widgets.
|
174
173
|
*/
|
175
|
-
static getWidgets(stageId, stageUsage, location, section
|
174
|
+
static getWidgets(stageId, stageUsage, location, section) {
|
176
175
|
const widgets = [];
|
177
176
|
if (0 === UiItemsManager._registeredUiItemsProviders.size)
|
178
177
|
return widgets;
|
@@ -182,7 +181,7 @@ class UiItemsManager {
|
|
182
181
|
const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
|
183
182
|
// istanbul ignore else
|
184
183
|
if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
|
185
|
-
uiProvider.provideWidgets(stageId, stageUsage, location, section
|
184
|
+
uiProvider.provideWidgets(stageId, stageUsage, location, section)
|
186
185
|
.forEach((widget) => {
|
187
186
|
// ignore duplicate ids
|
188
187
|
if (-1 === widgets.findIndex((existingItem) => widget.id === existingItem.id))
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,sDAAoE;AAMpE,uCAA8C;AAG9C;;GAEG;AACH,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IAClC,mCAAmC;IACnC,yEAAK,CAAA;IACL,sCAAsC;IACtC,+EAAQ,CAAA;IACR,wCAAwC;IACxC,2EAAM,CAAA;AACR,CAAC,EAPW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAOnC;AA+CD;;;GAGG;AACH,MAAa,cAAc;IAGzB;mBACe;IACR,MAAM,CAAC,iBAAiB;QAC7B,cAAc,CAAC,2BAA2B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAKD,8CAA8C;IACvC,MAAM,KAAK,qBAAqB;QACrC,MAAM,GAAG,GAAG,CAAC,GAAG,cAAc,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC,CAAC;QACnE,OAAO,GAAG,CAAC;IACb,CAAC;IAED,yDAAyD;IAClD,MAAM,KAAK,sBAAsB;QACtC,OAAO,IAAI,CAAC,2BAA2B,CAAC,IAAI,GAAG,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,kBAAkB,CAAC,UAAkB;;QACjD,OAAO,MAAA,cAAc,CAAC,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,0CAAE,QAAQ,CAAC;IAC9E,CAAC;IAEO,MAAM,CAAC,mBAAmB,CAAC,EAAqC;QACtE,cAAc,CAAC,2BAA2B,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAC,UAA2B,EAA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C;YAClC,MAAM,UAAU,GAAG,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,UAAU,mCAAI,UAAU,CAAC,EAAE,CAAC;YAEhE,uBAAuB;YACvB,IAAI,UAAU,CAAC,cAAc,IAAI,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE;gBACxF,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC;qBAC1F,OAAO,CAAC,CAAC,MAA2B,EAAE,EAAE;oBACvC,uBAAuB;oBACvB,IAAI,CAAC,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,EAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAE;wBAC3E,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;aACN;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA/LH,wCAiMC;AAhMgB,0CAA2B,GAAqC,IAAI,GAAG,EAA+B,CAAC;AAQtH,wEAAwE;AACjD,0CAA2B,GAAG,IAAI,sBAAO,EAAmD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BeEvent, Logger, MarkRequired } from \"@itwin/core-bentley\";\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\nimport { loggerCategory } from \"./utils/misc\";\r\nimport { UiItemsProvider } from \"./UiItemsProvider\";\r\n\r\n/** Action taken by the application on item provided by a UiItemsProvider\r\n * @public @deprecated in 3.2. This was only used by the previously removed UiItemsArbiter.\r\n */\r\nexport enum UiItemsApplicationAction {\r\n /** Allow the change to the item */\r\n Allow,\r\n /** Disallow the change to the item */\r\n Disallow,\r\n /** Update the item during the change */\r\n Update,\r\n}\r\n\r\n/** UIProvider Registered Event Args interface.\r\n * @deprecated in 3.6. Use [UiItemsProviderRegisteredEventArgs]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface UiItemProviderRegisteredEventArgs {\r\n providerId: string;\r\n}\r\n\r\n/** UiItemProviderOverrides allows the application that registers a provider to limit when it is allowed to provide items\r\n * @deprecated in 3.6. Use [AllowedUiItemsProviderOverrides]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface AllowedUiItemProviderOverrides {\r\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages\r\n * @beta\r\n */\r\n providerId?: string;\r\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided\r\n * @beta\r\n */\r\n stageUsages?: string[];\r\n /** if specified then the current stage's Id will be compared before allowing any items to be provided\r\n * @beta\r\n */\r\n stageIds?: string[];\r\n}\r\n\r\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\r\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\r\n * items are allowed.\r\n * @deprecated in 3.6. Use [UiItemsProviderOverrides]($appui-react) instead.\r\n * @public\r\n */\r\nexport type UiItemProviderOverrides = MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\"> |\r\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"stageUsages\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\" | \"stageIds\">; // eslint-disable-line @typescript-eslint/indent\r\n\r\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\r\ninterface UiItemProviderEntry {\r\n provider: UiItemsProvider;\r\n overrides?: UiItemProviderOverrides;\r\n}\r\n\r\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\r\n * @deprecated in 3.6. Use [UiItemsManager]($appui-react) instead.\r\n * @public\r\n */\r\nexport class UiItemsManager {\r\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> = new Map<string, UiItemProviderEntry>();\r\n\r\n /** For use in unit testing\r\n * @internal */\r\n public static clearAllProviders() {\r\n UiItemsManager._registeredUiItemsProviders.clear();\r\n }\r\n\r\n /** Event raised any time a UiProvider is registered or unregistered. */\r\n public static readonly onUiProviderRegisteredEvent = new BeEvent<(ev: UiItemProviderRegisteredEventArgs) => void>();\r\n\r\n /** Return number of registered UiProvider. */\r\n public static get registeredProviderIds() {\r\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\r\n return ids;\r\n }\r\n\r\n /** Return true if there is any registered UiProvider. */\r\n public static get hasRegisteredProviders(): boolean {\r\n return this._registeredUiItemsProviders.size > 0;\r\n }\r\n\r\n /**\r\n * Retrieves a previously loaded UiItemsProvider.\r\n * @param providerId id of the UiItemsProvider to get\r\n */\r\n public static getUiItemsProvider(providerId: string): UiItemsProvider | undefined {\r\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\r\n }\r\n\r\n private static sendRegisteredEvent(ev: UiItemProviderRegisteredEventArgs) {\r\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(ev);\r\n }\r\n\r\n /**\r\n * Registers a UiItemsProvider with the UiItemsManager.\r\n * @param uiProvider the UI items provider to register.\r\n */\r\n public static register(uiProvider: UiItemsProvider, overrides?: UiItemProviderOverrides): void {\r\n const providerId = overrides?.providerId ?? uiProvider.id;\r\n\r\n if (UiItemsManager.getUiItemsProvider(providerId)) {\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${providerId}) is already loaded`);\r\n } else {\r\n UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider ${uiProvider.id} registered as ${providerId} `);\r\n\r\n UiItemsManager.sendRegisteredEvent({ providerId } as UiItemProviderRegisteredEventArgs);\r\n }\r\n }\r\n\r\n /** Remove a specific UiItemsProvider from the list of available providers. */\r\n public static unregister(uiProviderId: string): void {\r\n const provider = UiItemsManager.getUiItemsProvider(uiProviderId);\r\n if (!provider)\r\n return;\r\n\r\n provider.onUnregister && provider.onUnregister();\r\n\r\n UiItemsManager._registeredUiItemsProviders.delete(uiProviderId);\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProviderId}) unloaded`);\r\n\r\n // trigger a refresh of the ui\r\n UiItemsManager.sendRegisteredEvent({ providerId: uiProviderId } as UiItemProviderRegisteredEventArgs);\r\n }\r\n\r\n private static allowItemsFromProvider(entry: UiItemProviderEntry, stageId?: string, stageUsage?: string) {\r\n // istanbul ignore else\r\n const overrides = entry.overrides;\r\n if (undefined !== stageId && overrides?.stageIds && !(overrides.stageIds.some((value: string) => value === stageId)))\r\n return false;\r\n if (undefined !== stageUsage && overrides?.stageUsages && !(overrides.stageUsages.some((value: string) => value === stageUsage)))\r\n return false;\r\n return true;\r\n }\r\n\r\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\r\n * an action or specify a registered ToolId into toolbar.\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @param toolbarUsage usage of the toolbar\r\n * @param toolbarOrientation orientation of the toolbar\r\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\r\n */\r\n public static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage,\r\n toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\r\n const buttonItems: CommonToolbarItem[] = [];\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return buttonItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n // istanbul ignore else\r\n if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)\r\n .forEach((spec: CommonToolbarItem) => {\r\n // ignore duplicate ids\r\n if (-1 === buttonItems.findIndex((existingItem)=> spec.id === existingItem.id ))\r\n buttonItems.push({ ...spec, providerId });\r\n });\r\n }\r\n });\r\n\r\n return buttonItems;\r\n }\r\n\r\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\r\n */\r\n public static getStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\r\n const statusBarItems: CommonStatusBarItem[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return statusBarItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)\r\n .forEach((item: CommonStatusBarItem) => {\r\n // ignore duplicate ids\r\n if (-1 === statusBarItems.findIndex((existingItem)=> item.id === existingItem.id ))\r\n statusBarItems.push({ ...item, providerId });\r\n });\r\n }\r\n });\r\n\r\n return statusBarItems;\r\n }\r\n\r\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\r\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\r\n */\r\n public static getBackstageItems(): BackstageItem[] {\r\n const backstageItems: BackstageItem[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return backstageItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideBackstageItems) { // Note: We do not call this.allowItemsFromProvider here as backstage items\r\n uiProvider.provideBackstageItems() // should not be considered stage specific. If they need to be hidden\r\n .forEach((item: BackstageItem) => { // the isHidden property should be set to a ConditionalBooleanValue\r\n // ignore duplicate ids\r\n if (-1 === backstageItems.findIndex((existingItem)=> item.id === existingItem.id ))\r\n backstageItems.push({ ...item, providerId });\r\n });\r\n }\r\n });\r\n return backstageItems;\r\n }\r\n\r\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @param location the location within the stage.\r\n * @param section the section within location.\r\n * @returns An array of AbstractWidgetProps that will be used to create widgets.\r\n */\r\n public static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\r\n const widgets: AbstractWidgetProps[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return widgets;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)\r\n .forEach((widget: AbstractWidgetProps) => {\r\n // ignore duplicate ids\r\n if (-1 === widgets.findIndex((existingItem)=> widget.id === existingItem.id ))\r\n widgets.push({ ...widget, providerId });\r\n });\r\n }\r\n });\r\n return widgets;\r\n }\r\n\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoE;AAMpE,uCAA8C;AAG9C;;GAEG;AACH,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IAClC,mCAAmC;IACnC,yEAAK,CAAA;IACL,sCAAsC;IACtC,+EAAQ,CAAA;IACR,wCAAwC;IACxC,2EAAM,CAAA;AACR,CAAC,EAPW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAOnC;AA+CD;;;GAGG;AACH,MAAa,cAAc;IAGzB;mBACe;IACR,MAAM,CAAC,iBAAiB;QAC7B,cAAc,CAAC,2BAA2B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAKD,8CAA8C;IACvC,MAAM,KAAK,qBAAqB;QACrC,MAAM,GAAG,GAAG,CAAC,GAAG,cAAc,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC,CAAC;QACnE,OAAO,GAAG,CAAC;IACb,CAAC;IAED,yDAAyD;IAClD,MAAM,KAAK,sBAAsB;QACtC,OAAO,IAAI,CAAC,2BAA2B,CAAC,IAAI,GAAG,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,kBAAkB,CAAC,UAAkB;;QACjD,OAAO,MAAA,cAAc,CAAC,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,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AAC;QAEjB,cAAc,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC,KAA0B,EAAE,EAAE;;YAChF,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;YAClC,MAAM,UAAU,GAAG,MAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,UAAU,mCAAI,UAAU,CAAC,EAAE,CAAC;YAEhE,uBAAuB;YACvB,IAAI,UAAU,CAAC,cAAc,IAAI,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE;gBACxF,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;qBAC9D,OAAO,CAAC,CAAC,MAA2B,EAAE,EAAE;oBACvC,uBAAuB;oBACvB,IAAI,CAAC,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC;wBAC3E,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;aACN;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA/LH,wCAiMC;AAhMgB,0CAA2B,GAAqC,IAAI,GAAG,EAA+B,CAAC;AAQtH,wEAAwE;AACjD,0CAA2B,GAAG,IAAI,sBAAO,EAAmD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BeEvent, Logger, MarkRequired } from \"@itwin/core-bentley\";\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\nimport { loggerCategory } from \"./utils/misc\";\r\nimport { UiItemsProvider } from \"./UiItemsProvider\";\r\n\r\n/** Action taken by the application on item provided by a UiItemsProvider\r\n * @public @deprecated this was only used by the previously removed UiItemsArbiter.\r\n */\r\nexport enum UiItemsApplicationAction {\r\n /** Allow the change to the item */\r\n Allow,\r\n /** Disallow the change to the item */\r\n Disallow,\r\n /** Update the item during the change */\r\n Update,\r\n}\r\n\r\n/** UIProvider Registered Event Args interface.\r\n * @deprecated in 3.6. Use [UiItemsProviderRegisteredEventArgs]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface UiItemProviderRegisteredEventArgs {\r\n providerId: string;\r\n}\r\n\r\n/** UiItemProviderOverrides allows the application that registers a provider to limit when it is allowed to provide items\r\n * @deprecated in 3.6. Use [AllowedUiItemsProviderOverrides]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface AllowedUiItemProviderOverrides {\r\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages\r\n * @beta\r\n */\r\n providerId?: string;\r\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided\r\n * @beta\r\n */\r\n stageUsages?: string[];\r\n /** if specified then the current stage's Id will be compared before allowing any items to be provided\r\n * @beta\r\n */\r\n stageIds?: string[];\r\n}\r\n\r\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\r\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\r\n * items are allowed.\r\n * @deprecated in 3.6. Use [UiItemsProviderOverrides]($appui-react) instead.\r\n * @public\r\n */\r\nexport type UiItemProviderOverrides = MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\"> |\r\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"stageUsages\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\" | \"stageIds\">; // eslint-disable-line @typescript-eslint/indent\r\n\r\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\r\ninterface UiItemProviderEntry {\r\n provider: UiItemsProvider;\r\n overrides?: UiItemProviderOverrides;\r\n}\r\n\r\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\r\n * @deprecated in 3.6. Use [UiItemsManager]($appui-react) instead.\r\n * @public\r\n */\r\nexport class UiItemsManager {\r\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> = new Map<string, UiItemProviderEntry>();\r\n\r\n /** For use in unit testing\r\n * @internal */\r\n public static clearAllProviders() {\r\n UiItemsManager._registeredUiItemsProviders.clear();\r\n }\r\n\r\n /** Event raised any time a UiProvider is registered or unregistered. */\r\n public static readonly onUiProviderRegisteredEvent = new BeEvent<(ev: UiItemProviderRegisteredEventArgs) => void>();\r\n\r\n /** Return number of registered UiProvider. */\r\n public static get registeredProviderIds() {\r\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\r\n return ids;\r\n }\r\n\r\n /** Return true if there is any registered UiProvider. */\r\n public static get hasRegisteredProviders(): boolean {\r\n return this._registeredUiItemsProviders.size > 0;\r\n }\r\n\r\n /**\r\n * Retrieves a previously loaded UiItemsProvider.\r\n * @param providerId id of the UiItemsProvider to get\r\n */\r\n public static getUiItemsProvider(providerId: string): UiItemsProvider | undefined {\r\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\r\n }\r\n\r\n private static sendRegisteredEvent(ev: UiItemProviderRegisteredEventArgs) {\r\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(ev);\r\n }\r\n\r\n /**\r\n * Registers a UiItemsProvider with the UiItemsManager.\r\n * @param uiProvider the UI items provider to register.\r\n */\r\n public static register(uiProvider: UiItemsProvider, overrides?: UiItemProviderOverrides): void {\r\n const providerId = overrides?.providerId ?? uiProvider.id;\r\n\r\n if (UiItemsManager.getUiItemsProvider(providerId)) {\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${providerId}) is already loaded`);\r\n } else {\r\n UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider ${uiProvider.id} registered as ${providerId} `);\r\n\r\n UiItemsManager.sendRegisteredEvent({ providerId } as UiItemProviderRegisteredEventArgs);\r\n }\r\n }\r\n\r\n /** Remove a specific UiItemsProvider from the list of available providers. */\r\n public static unregister(uiProviderId: string): void {\r\n const provider = UiItemsManager.getUiItemsProvider(uiProviderId);\r\n if (!provider)\r\n return;\r\n\r\n provider.onUnregister && provider.onUnregister();\r\n\r\n UiItemsManager._registeredUiItemsProviders.delete(uiProviderId);\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProviderId}) unloaded`);\r\n\r\n // trigger a refresh of the ui\r\n UiItemsManager.sendRegisteredEvent({ providerId: uiProviderId } as UiItemProviderRegisteredEventArgs);\r\n }\r\n\r\n private static allowItemsFromProvider(entry: UiItemProviderEntry, stageId?: string, stageUsage?: string) {\r\n // istanbul ignore else\r\n const overrides = entry.overrides;\r\n if (undefined !== stageId && overrides?.stageIds && !(overrides.stageIds.some((value: string) => value === stageId)))\r\n return false;\r\n if (undefined !== stageUsage && overrides?.stageUsages && !(overrides.stageUsages.some((value: string) => value === stageUsage)))\r\n return false;\r\n return true;\r\n }\r\n\r\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\r\n * an action or specify a registered ToolId into toolbar.\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @param toolbarUsage usage of the toolbar\r\n * @param toolbarOrientation orientation of the toolbar\r\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\r\n */\r\n public static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage,\r\n toolbarOrientation: ToolbarOrientation): CommonToolbarItem[] {\r\n const buttonItems: CommonToolbarItem[] = [];\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return buttonItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n // istanbul ignore else\r\n if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation)\r\n .forEach((spec: CommonToolbarItem) => {\r\n // ignore duplicate ids\r\n if (-1 === buttonItems.findIndex((existingItem) => spec.id === existingItem.id))\r\n buttonItems.push({ ...spec, providerId });\r\n });\r\n }\r\n });\r\n\r\n return buttonItems;\r\n }\r\n\r\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\r\n */\r\n public static getStatusBarItems(stageId: string, stageUsage: string): CommonStatusBarItem[] {\r\n const statusBarItems: CommonStatusBarItem[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return statusBarItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideStatusBarItems(stageId, stageUsage)\r\n .forEach((item: CommonStatusBarItem) => {\r\n // ignore duplicate ids\r\n if (-1 === statusBarItems.findIndex((existingItem) => item.id === existingItem.id))\r\n statusBarItems.push({ ...item, providerId });\r\n });\r\n }\r\n });\r\n\r\n return statusBarItems;\r\n }\r\n\r\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\r\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\r\n */\r\n public static getBackstageItems(): BackstageItem[] {\r\n const backstageItems: BackstageItem[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return backstageItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideBackstageItems) { // Note: We do not call this.allowItemsFromProvider here as backstage items\r\n uiProvider.provideBackstageItems() // should not be considered stage specific. If they need to be hidden\r\n .forEach((item: BackstageItem) => { // the isHidden property should be set to a ConditionalBooleanValue\r\n // ignore duplicate ids\r\n if (-1 === backstageItems.findIndex((existingItem) => item.id === existingItem.id))\r\n backstageItems.push({ ...item, providerId });\r\n });\r\n }\r\n });\r\n return backstageItems;\r\n }\r\n\r\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @param location the location within the stage.\r\n * @param section the section within location.\r\n * @returns An array of AbstractWidgetProps that will be used to create widgets.\r\n */\r\n public static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection): ReadonlyArray<AbstractWidgetProps> {\r\n const widgets: AbstractWidgetProps[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return widgets;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideWidgets(stageId, stageUsage, location, section)\r\n .forEach((widget: AbstractWidgetProps) => {\r\n // ignore duplicate ids\r\n if (-1 === widgets.findIndex((existingItem) => widget.id === existingItem.id))\r\n widgets.push({ ...widget, providerId });\r\n });\r\n }\r\n });\r\n return widgets;\r\n }\r\n\r\n}\r\n"]}
|
@@ -5,7 +5,7 @@ import { BackstageItem } from "./backstage/BackstageItem";
|
|
5
5
|
import { CommonStatusBarItem } from "./statusbar/StatusBarItem";
|
6
6
|
import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem";
|
7
7
|
import { AbstractWidgetProps } from "./widget/AbstractWidgetProps";
|
8
|
-
import {
|
8
|
+
import { StagePanelLocation, StagePanelSection } from "./widget/StagePanel";
|
9
9
|
/** Describes interface of objects that want to provide UI component to the running IModelApp.
|
10
10
|
* @deprecated in 3.6. Use [UiItemsProvider]($appui-react) instead.
|
11
11
|
* @public
|
@@ -14,16 +14,15 @@ export interface UiItemsProvider {
|
|
14
14
|
/** id of provider */
|
15
15
|
readonly id: string;
|
16
16
|
/** UiItemsManager calls following method to get items to populate specific toolbars */
|
17
|
-
provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation
|
17
|
+
provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation) => CommonToolbarItem[];
|
18
18
|
/** UiItemsManager calls following method to augment base statusbar for stages that allow it. */
|
19
|
-
provideStatusBarItems?: (stageId: string, stageUsage: string
|
19
|
+
provideStatusBarItems?: (stageId: string, stageUsage: string) => CommonStatusBarItem[];
|
20
20
|
/** UiItemsManager calls following method to augment backstage items. */
|
21
21
|
provideBackstageItems?: () => BackstageItem[];
|
22
22
|
/** UiItemsManager calls following method to augment Widget lists.
|
23
23
|
* @note Returned widgets must provide unique `AbstractWidgetProps["id"]` to correctly save/restore App layout.
|
24
24
|
*/
|
25
|
-
provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection
|
26
|
-
zoneLocation?: AbstractZoneLocation, stageAppData?: any) => ReadonlyArray<AbstractWidgetProps>;
|
25
|
+
provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) => ReadonlyArray<AbstractWidgetProps>;
|
27
26
|
/** Function called when the provider is unregistered via `ItemsManager.unregister` to allow provider to do cleanup. */
|
28
27
|
onUnregister?: () => void;
|
29
28
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"UiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,uFAAuF;IACvF,yBAAyB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,KAAK,iBAAiB,EAAE,CAAC;IAC7J,gGAAgG;IAChG,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,mBAAmB,EAAE,CAAC;IACvF,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,MAAM,aAAa,EAAE,CAAC;IAC9C;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACxJ,uHAAuH;IACvH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport {
|
1
|
+
{"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\n\r\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\r\n * @deprecated in 3.6. Use [UiItemsProvider]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface UiItemsProvider {\r\n /** id of provider */\r\n readonly id: string;\r\n\r\n /** UiItemsManager calls following method to get items to populate specific toolbars */\r\n provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation) => CommonToolbarItem[];\r\n /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */\r\n provideStatusBarItems?: (stageId: string, stageUsage: string) => CommonStatusBarItem[];\r\n /** UiItemsManager calls following method to augment backstage items. */\r\n provideBackstageItems?: () => BackstageItem[]; // eslint-disable-line deprecation/deprecation\r\n /** UiItemsManager calls following method to augment Widget lists.\r\n * @note Returned widgets must provide unique `AbstractWidgetProps[\"id\"]` to correctly save/restore App layout.\r\n */\r\n provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) => ReadonlyArray<AbstractWidgetProps>;\r\n /** Function called when the provider is unregistered via `ItemsManager.unregister` to allow provider to do cleanup. */\r\n onUnregister?: () => void;\r\n}\r\n"]}
|
@@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C,aAAa;aACd,CAAC;QACvB,uBAAuB;QACvB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED,IAAW,eAAe,CAAC,GAAoB;QAC7C,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,KAAqB,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,YAAY,CAAC;IACxC,CAAC;IAED,IAAW,QAAQ;QACjB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9E,CAAC;IAED,IAAW,IAAI;QACb,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;IAClE,CAAC;IAEM,YAAY,CAAC,cAA8B,EAAE,YAAyB;QAC3E,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC;IACjI,CAAC;CACF;AA3DD,wCA2DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Dialog\r\n */\r\n\r\nimport { PropertyDescription } from \"../properties/Description\";\r\n\r\n/** [[DialogItemValue]] Interface of PrimitiveValue types that have type editor support for use in dialogs.\r\n * @public\r\n */\r\nexport interface DialogItemValue {\r\n value?: number | string | boolean | Date;\r\n displayValue?: string;\r\n}\r\n/** [[EditorPosition]] Interface used to identify the location of the item a DialogItem property value.\r\n * @public\r\n */\r\nexport interface EditorPosition {\r\n /** Determine the order the row is shown in UI */\r\n rowPriority: number;\r\n /** Determines the column position for the type editor */\r\n columnIndex: number;\r\n /** Number of columns to occupy. Defaults to 1\r\n * @deprecated
|
1
|
+
{"version":3,"file":"DialogItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/DialogItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA0DH;;GAEG;AACH,MAAa,cAAc;IACzB,YAAmB,WAAgC,EAAU,MAAS,EAAU,aAAsB,EAAU,WAAqB;QAAlH,gBAAW,GAAX,WAAW,CAAqB;QAAU,WAAM,GAAN,MAAM,CAAG;QAAU,kBAAa,GAAb,aAAa,CAAS;QAAU,gBAAW,GAAX,WAAW,CAAU;IAAI,CAAC;IAE1I,IAAW,UAAU;QACnB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,GAAY;QAChC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAW,KAAK,CAAC,GAAM;QACrB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED,IAAW,YAAY,CAAC,GAAuB;QAC7C,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC;IAC3B,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,eAAe;QACxB,uBAAuB;QACvB,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,WAAW,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,YAAY,IAAI;YAC7K,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,MAAM;gBAClB,YAAY,EAAE,IAAI,CAAC,aAAa;aACd,CAAC;QACvB,uBAAuB;QACvB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED,IAAW,eAAe,CAAC,GAAoB;QAC7C,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,KAAqB,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,YAAY,CAAC;IACxC,CAAC;IAED,IAAW,QAAQ;QACjB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9E,CAAC;IAED,IAAW,IAAI;QACb,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;IAClE,CAAC;IAEM,YAAY,CAAC,cAA8B,EAAE,YAAyB;QAC3E,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC;IACjI,CAAC;CACF;AA3DD,wCA2DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Dialog\r\n */\r\n\r\nimport { PropertyDescription } from \"../properties/Description\";\r\n\r\n/** [[DialogItemValue]] Interface of PrimitiveValue types that have type editor support for use in dialogs.\r\n * @public\r\n */\r\nexport interface DialogItemValue {\r\n value?: number | string | boolean | Date;\r\n displayValue?: string;\r\n}\r\n/** [[EditorPosition]] Interface used to identify the location of the item a DialogItem property value.\r\n * @public\r\n */\r\nexport interface EditorPosition {\r\n /** Determine the order the row is shown in UI */\r\n rowPriority: number;\r\n /** Determines the column position for the type editor */\r\n columnIndex: number;\r\n /** Number of columns to occupy. Defaults to 1\r\n * @deprecated\r\n */\r\n columnSpan?: number;\r\n}\r\n\r\n/** [[BaseDialogItem]] contains only the members necessary to create a PropertyRecord.\r\n * @public\r\n */\r\nexport interface BaseDialogItem {\r\n readonly value: DialogItemValue;\r\n readonly property: PropertyDescription;\r\n readonly isDisabled?: boolean;\r\n}\r\n/** [[DialogItem]] is the specification that the display engine turns into a UI item.\r\n * @see See learning documentation [DialogItem]($docs/learning/ui/abstract/dialogitem.md)\r\n * @public\r\n */\r\nexport interface DialogItem extends BaseDialogItem {\r\n readonly editorPosition: EditorPosition;\r\n readonly lockProperty?: BaseDialogItem;\r\n}\r\n\r\n/** [[DialogPropertyItem]] us the specification to use if you are defining the components directly, e.g., in React\r\n * @public\r\n */\r\nexport interface DialogPropertyItem {\r\n readonly value: DialogItemValue;\r\n readonly propertyName: string;\r\n}\r\n\r\n/** [[DialogPropertySyncItem]] is used to pass sync messages for DialogPropertyItems\r\n * @public\r\n */\r\nexport interface DialogPropertySyncItem extends DialogPropertyItem {\r\n readonly isDisabled?: boolean;\r\n readonly property?: PropertyDescription;\r\n}\r\n\r\n/** [[DialogProperty]] is a generic helper class that assists working with properties used by UiLayoutDataProvider implementations (i.e. Tool Settings and Dynamic Dialogs).\r\n * @public\r\n */\r\nexport class DialogProperty<T> {\r\n constructor(public description: PropertyDescription, private _value: T, private _displayValue?: string, private _isDisabled?: boolean) { }\r\n\r\n public get isDisabled() {\r\n return !!this._isDisabled;\r\n }\r\n\r\n public set isDisabled(val: boolean) {\r\n this._isDisabled = val;\r\n }\r\n\r\n public get value() {\r\n return this._value;\r\n }\r\n\r\n public set value(val: T) {\r\n this._value = val;\r\n }\r\n\r\n public get name() {\r\n return this.description.name;\r\n }\r\n\r\n public set displayValue(val: string | undefined) {\r\n this._displayValue = val;\r\n }\r\n\r\n public get displayValue() {\r\n return this._displayValue;\r\n }\r\n\r\n public get dialogItemValue() {\r\n // istanbul ignore else\r\n if (typeof this._value === \"string\" || typeof this._value === \"number\" || typeof this._value === \"undefined\" || typeof this._value === \"boolean\" || this._value instanceof Date)\r\n return {\r\n value: this._value,\r\n displayValue: this._displayValue,\r\n } as DialogItemValue;\r\n // istanbul ignore next\r\n throw new Error(\"Not valid primitive type\");\r\n }\r\n\r\n public set dialogItemValue(val: DialogItemValue) {\r\n this._value = val.value as unknown as T;\r\n this._displayValue = val.displayValue;\r\n }\r\n\r\n public get syncItem(): DialogPropertySyncItem {\r\n const isDisabled = this._isDisabled;\r\n return { propertyName: this.name, value: this.dialogItemValue, isDisabled };\r\n }\r\n\r\n public get item(): DialogPropertyItem {\r\n return { propertyName: this.name, value: this.dialogItemValue };\r\n }\r\n\r\n public toDialogItem(editorPosition: EditorPosition, lockProperty?: DialogItem): DialogItem {\r\n return { value: this.dialogItemValue, property: this.description, editorPosition, isDisabled: this._isDisabled, lockProperty };\r\n }\r\n}\r\n"]}
|
@@ -5,23 +5,11 @@
|
|
5
5
|
* @public
|
6
6
|
*/
|
7
7
|
export declare class IconSpecUtilities {
|
8
|
-
/** Prefix for an SVG IconSpec loaded with the Sprite loader */
|
9
|
-
static readonly SVG_PREFIX = "svg:";
|
10
8
|
static readonly WEB_COMPONENT_PREFIX = "webSvg:";
|
11
|
-
/** Create an IconSpec for an SVG loaded into web component with sprite loader
|
12
|
-
* This method is deprecated -- use createWebComponentIconSpec()
|
13
|
-
* @public @deprecated in 3.2.
|
14
|
-
*/
|
15
|
-
static createSvgIconSpec(svgSrc: string): string;
|
16
9
|
/** Create an IconSpec for an SVG loaded into web component with svg-loader
|
17
10
|
* @public
|
18
11
|
*/
|
19
12
|
static createWebComponentIconSpec(srcString: string): string;
|
20
|
-
/** Get the SVG Source from an sprite IconSpec
|
21
|
-
* This method is deprecated -- use getWebComponentSource()
|
22
|
-
* @public @deprecated in 3.2.
|
23
|
-
*/
|
24
|
-
static getSvgSource(iconSpec: string): string | undefined;
|
25
13
|
/** Get the SVG Source from an svg-loader IconSpec
|
26
14
|
* @public
|
27
15
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IconSpecUtilities.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,qBAAa,iBAAiB;IAC5B
|
1
|
+
{"version":3,"file":"IconSpecUtilities.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,gBAAuB,oBAAoB,aAAa;IAExD;;MAEE;WACY,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAInE;;MAEE;WAEY,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAQ1E"}
|
@@ -12,29 +12,12 @@ exports.IconSpecUtilities = void 0;
|
|
12
12
|
* @public
|
13
13
|
*/
|
14
14
|
class IconSpecUtilities {
|
15
|
-
/** Create an IconSpec for an SVG loaded into web component with sprite loader
|
16
|
-
* This method is deprecated -- use createWebComponentIconSpec()
|
17
|
-
* @public @deprecated in 3.2.
|
18
|
-
*/
|
19
|
-
static createSvgIconSpec(svgSrc) {
|
20
|
-
return `${IconSpecUtilities.SVG_PREFIX}${svgSrc}`;
|
21
|
-
}
|
22
15
|
/** Create an IconSpec for an SVG loaded into web component with svg-loader
|
23
16
|
* @public
|
24
17
|
*/
|
25
18
|
static createWebComponentIconSpec(srcString) {
|
26
19
|
return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;
|
27
20
|
}
|
28
|
-
/** Get the SVG Source from an sprite IconSpec
|
29
|
-
* This method is deprecated -- use getWebComponentSource()
|
30
|
-
* @public @deprecated in 3.2.
|
31
|
-
*/
|
32
|
-
static getSvgSource(iconSpec) {
|
33
|
-
if (iconSpec.startsWith(IconSpecUtilities.SVG_PREFIX) && iconSpec.length > 4) {
|
34
|
-
return iconSpec.slice(4);
|
35
|
-
}
|
36
|
-
return undefined;
|
37
|
-
}
|
38
21
|
/** Get the SVG Source from an svg-loader IconSpec
|
39
22
|
* @public
|
40
23
|
*/
|
@@ -46,7 +29,5 @@ class IconSpecUtilities {
|
|
46
29
|
}
|
47
30
|
}
|
48
31
|
exports.IconSpecUtilities = IconSpecUtilities;
|
49
|
-
/** Prefix for an SVG IconSpec loaded with the Sprite loader */
|
50
|
-
IconSpecUtilities.SVG_PREFIX = "svg:";
|
51
32
|
IconSpecUtilities.WEB_COMPONENT_PREFIX = "webSvg:";
|
52
33
|
//# sourceMappingURL=IconSpecUtilities.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"IconSpecUtilities.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,MAAa,iBAAiB;
|
1
|
+
{"version":3,"file":"IconSpecUtilities.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,MAAa,iBAAiB;IAG5B;;MAEE;IACK,MAAM,CAAC,0BAA0B,CAAC,SAAiB;QACxD,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACjE,CAAC;IAED;;MAEE;IAEK,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YACtF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC;IAEnB,CAAC;;AArBH,8CAsBC;AArBwB,sCAAoB,GAAG,SAAS,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/** Creates an IconSpec with an SVG source and gets the SVG source from an IconSpec.\r\n * @public\r\n */\r\nexport class IconSpecUtilities {\r\n public static readonly WEB_COMPONENT_PREFIX = \"webSvg:\";\r\n\r\n /** Create an IconSpec for an SVG loaded into web component with svg-loader\r\n * @public\r\n */\r\n public static createWebComponentIconSpec(srcString: string): string {\r\n return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;\r\n }\r\n\r\n /** Get the SVG Source from an svg-loader IconSpec\r\n * @public\r\n */\r\n\r\n public static getWebComponentSource(iconSpec: string): string | undefined {\r\n if (iconSpec.startsWith(IconSpecUtilities.WEB_COMPONENT_PREFIX) && iconSpec.length > 7) {\r\n return iconSpec.slice(7);\r\n }\r\n\r\n return undefined;\r\n\r\n }\r\n}\r\n"]}
|