@itwin/appui-abstract 3.0.0-dev.98 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -2
- package/LICENSE.md +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts +23 -8
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.js +72 -2
- package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/common/KeyboardKey.d.ts +1 -1
- package/lib/cjs/appui-abstract/common/KeyboardKey.js +1 -1
- package/lib/cjs/appui-abstract/common/KeyboardKey.js.map +1 -1
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.d.ts +1 -1
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.js +2 -2
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/cjs/appui-abstract/notification/MessageSeverity.d.ts +2 -1
- package/lib/cjs/appui-abstract/notification/MessageSeverity.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/notification/MessageSeverity.js +1 -0
- package/lib/cjs/appui-abstract/notification/MessageSeverity.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiError.d.ts +1 -1
- package/lib/cjs/appui-abstract/utils/UiError.js +1 -1
- package/lib/cjs/appui-abstract/utils/UiError.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiEvent.d.ts +10 -0
- package/lib/cjs/appui-abstract/utils/UiEvent.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/utils/UiEvent.js +18 -0
- package/lib/cjs/appui-abstract/utils/UiEvent.js.map +1 -0
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.d.ts +47 -0
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js +132 -0
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js.map +1 -0
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts +2 -2
- 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 +1 -1
- package/lib/cjs/appui-abstract/widget/StagePanel.js +1 -1
- package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -1
- package/lib/cjs/appui-abstract.d.ts +2 -8
- package/lib/cjs/appui-abstract.d.ts.map +1 -1
- package/lib/cjs/appui-abstract.js +2 -8
- package/lib/cjs/appui-abstract.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.d.ts +23 -8
- package/lib/esm/appui-abstract/UiItemsManager.d.ts.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.js +70 -1
- package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/common/KeyboardKey.d.ts +1 -1
- package/lib/esm/appui-abstract/common/KeyboardKey.js +1 -1
- package/lib/esm/appui-abstract/common/KeyboardKey.js.map +1 -1
- package/lib/esm/appui-abstract/content/StandardContentLayouts.d.ts +1 -1
- package/lib/esm/appui-abstract/content/StandardContentLayouts.d.ts.map +1 -1
- package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/esm/appui-abstract/notification/MessageSeverity.d.ts +2 -1
- package/lib/esm/appui-abstract/notification/MessageSeverity.d.ts.map +1 -1
- package/lib/esm/appui-abstract/notification/MessageSeverity.js +1 -0
- package/lib/esm/appui-abstract/notification/MessageSeverity.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiError.d.ts +1 -1
- package/lib/esm/appui-abstract/utils/UiError.js +1 -1
- package/lib/esm/appui-abstract/utils/UiError.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiEvent.d.ts +10 -0
- package/lib/esm/appui-abstract/utils/UiEvent.d.ts.map +1 -0
- package/lib/esm/appui-abstract/utils/UiEvent.js +14 -0
- package/lib/esm/appui-abstract/utils/UiEvent.js.map +1 -0
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.d.ts +47 -0
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.d.ts.map +1 -0
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.js +127 -0
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.js.map +1 -0
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts +2 -2
- 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 +1 -1
- package/lib/esm/appui-abstract/widget/StagePanel.js +1 -1
- package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -1
- package/lib/esm/appui-abstract.d.ts +2 -8
- package/lib/esm/appui-abstract.d.ts.map +1 -1
- package/lib/esm/appui-abstract.js +2 -8
- package/lib/esm/appui-abstract.js.map +1 -1
- package/package.json +13 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,112 @@
|
|
|
1
1
|
# Change Log - @itwin/appui-abstract
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 24 Jan 2022 14:00:52 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.0.0
|
|
6
|
+
Mon, 24 Jan 2022 14:00:52 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Add onUnregister function to UiItemsProviderInterface to allow provider to do cleanup.
|
|
11
|
+
- Upgrade target to ES2019 and deliver both a CommonJs and ESModule version of package
|
|
12
|
+
- rename to @itwin/appui-abstract
|
|
13
|
+
- remove ClientRequestContext and its subclasses
|
|
14
|
+
- Replace usage of I18N with generic Localization interface.
|
|
15
|
+
- Remove UiItemsArbiter.
|
|
16
|
+
- remove ClientRequestContext.current
|
|
17
|
+
- Add non-static class to handle UiSync messages.
|
|
18
|
+
- Refactored part of AccuDraw UI & Providing AccuDraw UI documentation
|
|
19
|
+
- Create empty frontstage and UiItemsProviders to populate it and update how ContentGroups are defined.
|
|
20
|
+
- Deprecate and promote apis
|
|
21
|
+
- Deprecate obsolete APIs. Publish beta APIs from last release.
|
|
22
|
+
- Deprecate UI 1.0 props
|
|
23
|
+
- Add comment about isPressed property.
|
|
24
|
+
- Allow widgets supplied by a UiItemsProvider to specify a default state of floating.
|
|
25
|
+
- Incorporating iTwinUI-CSS and iTwinUI-React into iModel.js
|
|
26
|
+
- Rename ui directories to match new package names.
|
|
27
|
+
- Fix bug that sets the icon on MessageBox.NoSymbol the Success icon.
|
|
28
|
+
- Update to React 17
|
|
29
|
+
- Created imodel-components folder & package and moved color, lineweight, navigationaids, quantity, timeline & viewport. Deprecated MessageSeverity in ui-core & added it ui-abstract. Added MessagePresenter interface to ui-abstract.
|
|
30
|
+
- UiFramework and UiIModelComponent initialize method no longer take localization argument, uses IModelApp.localization internally.
|
|
31
|
+
- Remove old aribiter related functions that are not used.
|
|
32
|
+
- Add BaseUiItemsProvider class
|
|
33
|
+
- Replaced ui-core Slider with one from iTwinUi-react.
|
|
34
|
+
- Add support for widget tab icons in UI-2
|
|
35
|
+
|
|
36
|
+
## 2.19.28
|
|
37
|
+
Wed, 12 Jan 2022 14:52:38 GMT
|
|
38
|
+
|
|
39
|
+
_Version update only_
|
|
40
|
+
|
|
41
|
+
## 2.19.27
|
|
42
|
+
Wed, 05 Jan 2022 20:07:20 GMT
|
|
43
|
+
|
|
44
|
+
_Version update only_
|
|
45
|
+
|
|
46
|
+
## 2.19.26
|
|
47
|
+
Wed, 08 Dec 2021 20:54:53 GMT
|
|
48
|
+
|
|
49
|
+
_Version update only_
|
|
50
|
+
|
|
51
|
+
## 2.19.25
|
|
52
|
+
Fri, 03 Dec 2021 20:05:49 GMT
|
|
53
|
+
|
|
54
|
+
_Version update only_
|
|
55
|
+
|
|
56
|
+
## 2.19.24
|
|
57
|
+
Mon, 29 Nov 2021 18:44:31 GMT
|
|
58
|
+
|
|
59
|
+
_Version update only_
|
|
60
|
+
|
|
61
|
+
## 2.19.23
|
|
62
|
+
Mon, 22 Nov 2021 20:41:40 GMT
|
|
63
|
+
|
|
64
|
+
_Version update only_
|
|
65
|
+
|
|
66
|
+
## 2.19.22
|
|
67
|
+
Wed, 17 Nov 2021 01:23:26 GMT
|
|
68
|
+
|
|
69
|
+
_Version update only_
|
|
70
|
+
|
|
71
|
+
## 2.19.21
|
|
72
|
+
Wed, 10 Nov 2021 10:58:24 GMT
|
|
73
|
+
|
|
74
|
+
_Version update only_
|
|
75
|
+
|
|
76
|
+
## 2.19.20
|
|
77
|
+
Fri, 29 Oct 2021 16:14:22 GMT
|
|
78
|
+
|
|
79
|
+
_Version update only_
|
|
80
|
+
|
|
81
|
+
## 2.19.19
|
|
82
|
+
Mon, 25 Oct 2021 16:16:25 GMT
|
|
83
|
+
|
|
84
|
+
_Version update only_
|
|
85
|
+
|
|
86
|
+
## 2.19.18
|
|
87
|
+
Thu, 21 Oct 2021 20:59:44 GMT
|
|
88
|
+
|
|
89
|
+
_Version update only_
|
|
90
|
+
|
|
91
|
+
## 2.19.17
|
|
92
|
+
Thu, 14 Oct 2021 21:19:43 GMT
|
|
93
|
+
|
|
94
|
+
_Version update only_
|
|
95
|
+
|
|
96
|
+
## 2.19.16
|
|
97
|
+
Mon, 11 Oct 2021 17:37:46 GMT
|
|
98
|
+
|
|
99
|
+
_Version update only_
|
|
100
|
+
|
|
101
|
+
## 2.19.15
|
|
102
|
+
Fri, 08 Oct 2021 16:44:23 GMT
|
|
103
|
+
|
|
104
|
+
_Version update only_
|
|
105
|
+
|
|
106
|
+
## 2.19.14
|
|
107
|
+
Fri, 01 Oct 2021 13:07:03 GMT
|
|
108
|
+
|
|
109
|
+
_Version update only_
|
|
4
110
|
|
|
5
111
|
## 2.19.13
|
|
6
112
|
Tue, 21 Sep 2021 21:06:40 GMT
|
|
@@ -587,7 +693,7 @@ Wed, 06 May 2020 13:17:49 GMT
|
|
|
587
693
|
- In source documentation. Some learning docs & API changes.
|
|
588
694
|
- TOC for UI 2.0 Docs, @alpha to @beta, Components Examples
|
|
589
695
|
- Started ui-components Learning doc section
|
|
590
|
-
- Update doc tags for automatic UI creation
|
|
696
|
+
- Update doc tags for automatic UI creation
|
|
591
697
|
- Refactor to remove duplicate ComponentGenerator instantiation. Rename files and components to remove React reference.
|
|
592
698
|
- Update auto-generated dialog items to work with the Tool Settings Bar.
|
|
593
699
|
- Add ConditionalBoolean support for isHidden and isDisabled properties.
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2017-
|
|
3
|
+
Copyright © 2017-2022 Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
|
@@ -34,14 +34,29 @@ export interface UiItemsProvider {
|
|
|
34
34
|
* @note Returned widgets must provide unique `AbstractWidgetProps["id"]` to correctly save/restore App layout.
|
|
35
35
|
*/
|
|
36
36
|
provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation, stageAppData?: any) => ReadonlyArray<AbstractWidgetProps>;
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
/** Function called when the provider is unregistered via `ItemsManager.unregister` to allow provider to do cleanup. */
|
|
38
|
+
onUnregister?: () => void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
|
|
42
|
+
* active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare class BaseUiItemsProvider implements UiItemsProvider {
|
|
46
|
+
protected _providerId: string;
|
|
47
|
+
isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any) => boolean) | undefined;
|
|
48
|
+
constructor(_providerId: string, isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any) => boolean) | undefined);
|
|
49
|
+
get id(): string;
|
|
50
|
+
onUnregister(): void;
|
|
51
|
+
unregister(): void;
|
|
52
|
+
/** Backstage items are not stage specific so no callback is used */
|
|
53
|
+
provideBackstageItems(): BackstageItem[];
|
|
54
|
+
provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[];
|
|
55
|
+
provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[];
|
|
56
|
+
provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[];
|
|
57
|
+
provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[];
|
|
58
|
+
provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _stageAppData?: any): AbstractWidgetProps[];
|
|
59
|
+
provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps>;
|
|
45
60
|
}
|
|
46
61
|
/** UIProvider Registered Event Args interface.
|
|
47
62
|
* @public
|
|
@@ -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":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,qBAAqB,CAAC;AACtD,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,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIlG;;GAEG;AACH,oBAAY,wBAAwB;IAClC,mCAAmC;IACnC,KAAK,IAAA;IACL,sCAAsC;IACtC,QAAQ,IAAA;IACR,wCAAwC;IACxC,MAAM,IAAA;CACP;AAED;;GAEG;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,EAAE,YAAY,CAAC,EAAE,GAAG,KAAK,iBAAiB,EAAE,CAAC;IACjL,gGAAgG;IAChG,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,GAAG,KAAK,mBAAmB,EAAE,CAAC;IAC3G,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,MAAM,aAAa,EAAE,CAAC;IAC9C;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM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mBAAmB,EAAE;IAgB/G;;OAEG;WACW,iBAAiB,IAAI,aAAa,EAAE;IAgBlD;;;;;;OAMG;WACW,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,oBAAoB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAgBtN"}
|
|
@@ -3,13 +3,15 @@
|
|
|
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 */
|
|
6
7
|
/** @packageDocumentation
|
|
7
8
|
* @module UiItemsProvider
|
|
8
9
|
*/
|
|
9
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.UiItemsManager = exports.UiItemsApplicationAction = void 0;
|
|
11
|
+
exports.UiItemsManager = exports.BaseUiItemsProvider = exports.UiItemsApplicationAction = void 0;
|
|
11
12
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
13
|
const misc_1 = require("./utils/misc");
|
|
14
|
+
const StageUsage_1 = require("./items/StageUsage");
|
|
13
15
|
/** Action taken by the application on item provided by a UiItemsProvider
|
|
14
16
|
* @public
|
|
15
17
|
*/
|
|
@@ -22,6 +24,72 @@ var UiItemsApplicationAction;
|
|
|
22
24
|
/** Update the item during the change */
|
|
23
25
|
UiItemsApplicationAction[UiItemsApplicationAction["Update"] = 2] = "Update";
|
|
24
26
|
})(UiItemsApplicationAction = exports.UiItemsApplicationAction || (exports.UiItemsApplicationAction = {}));
|
|
27
|
+
/**
|
|
28
|
+
* Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
|
|
29
|
+
* active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
class BaseUiItemsProvider {
|
|
33
|
+
/*
|
|
34
|
+
* @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want
|
|
35
|
+
* to set up custom stage with their own subset of standard tools.
|
|
36
|
+
* @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and
|
|
37
|
+
* the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.
|
|
38
|
+
*/
|
|
39
|
+
constructor(_providerId, isSupportedStage) {
|
|
40
|
+
this._providerId = _providerId;
|
|
41
|
+
this.isSupportedStage = isSupportedStage;
|
|
42
|
+
}
|
|
43
|
+
get id() { return this._providerId; }
|
|
44
|
+
onUnregister() { }
|
|
45
|
+
unregister() {
|
|
46
|
+
UiItemsManager.unregister(this._providerId);
|
|
47
|
+
}
|
|
48
|
+
/** Backstage items are not stage specific so no callback is used */
|
|
49
|
+
provideBackstageItems() {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
provideToolbarButtonItemsInternal(_stageId, _stageUsage, _toolbarUsage, _toolbarOrientation, _stageAppData) {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) {
|
|
56
|
+
let provideToStage = false;
|
|
57
|
+
if (this.isSupportedStage) {
|
|
58
|
+
provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
provideToStage = (stageUsage === StageUsage_1.StageUsage.General);
|
|
62
|
+
}
|
|
63
|
+
return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];
|
|
64
|
+
}
|
|
65
|
+
provideStatusBarItemsInternal(_stageId, _stageUsage, _stageAppData) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
provideStatusBarItems(stageId, stageUsage, stageAppData) {
|
|
69
|
+
let provideToStage = false;
|
|
70
|
+
if (this.isSupportedStage) {
|
|
71
|
+
provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
provideToStage = (stageUsage === StageUsage_1.StageUsage.General);
|
|
75
|
+
}
|
|
76
|
+
return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];
|
|
77
|
+
}
|
|
78
|
+
provideWidgetsInternal(_stageId, _stageUsage, _location, _section, _stageAppData) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
provideWidgets(stageId, stageUsage, location, section, _zoneLocation, stageAppData) {
|
|
82
|
+
let provideToStage = false;
|
|
83
|
+
if (this.isSupportedStage) {
|
|
84
|
+
provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
provideToStage = (stageUsage === StageUsage_1.StageUsage.General);
|
|
88
|
+
}
|
|
89
|
+
return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, stageAppData) : [];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.BaseUiItemsProvider = BaseUiItemsProvider;
|
|
25
93
|
/**
|
|
26
94
|
* Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.
|
|
27
95
|
* @public
|
|
@@ -62,8 +130,10 @@ class UiItemsManager {
|
|
|
62
130
|
}
|
|
63
131
|
/** Remove a specific UiItemsProvider from the list of available providers. */
|
|
64
132
|
static unregister(uiProviderId) {
|
|
65
|
-
|
|
133
|
+
const provider = UiItemsManager.getUiItemsProvider(uiProviderId);
|
|
134
|
+
if (!provider)
|
|
66
135
|
return;
|
|
136
|
+
provider.onUnregister && provider.onUnregister();
|
|
67
137
|
UiItemsManager._registeredUiItemsProviders.delete(uiProviderId);
|
|
68
138
|
core_bentley_1.Logger.logInfo((0, misc_1.loggerCategory)(this), `UiItemsProvider (${uiProviderId}) unloaded`);
|
|
69
139
|
// trigger a refresh of the ui
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAsD;AAMtD,uCAA8C;AAE9C;;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;AAqCD;;;GAGG;AACH,MAAa,cAAc;IAMzB,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,cAAc,CAAC,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACpE,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;QAChD,IAAI,cAAc,CAAC,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE;YACpD,qBAAM,CAAC,OAAO,CAAC,IAAA,qBAAc,EAAC,IAAI,CAAC,EAAE,oBAAoB,UAAU,CAAC,EAAE,qBAAqB,CAAC,CAAC;SAC9F;aAAM;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H,OAAO,cAAc,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,UAAU,CAAC,OAAe,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B,EAAE,YAAmC,EAAE,YAAkB;QAC9K,MAAM,OAAO,GAA0B,EAAE,CAAC;QAE1C,IAAI,CAAC,KAAK,cAAc,CAAC,2BAA2B,CAAC,IAAI;YACvD,OAAO,OAAO,CAAC;QAEjB,cAAc,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC,UAA2B,EAAE,EAAE;YACjF,uBAAuB;YACvB,IAAI,UAAU,CAAC,cAAc,EAAE;gBAC7B,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC;qBAC1F,OAAO,CAAC,CAAC,MAA2B,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;aACrG;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA9IH,wCAgJC;AA/IgB,0CAA2B,GAAiC,IAAI,GAAG,EAA2B,CAAC;AAE9G,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 } 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\n\r\n/** Action taken by the application on item provided by a UiItemsProvider\r\n * @public\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/** Describes interface of objects that want to provide UI component to the running IModelApp.\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, stageAppData?: any) => CommonToolbarItem[];\r\n /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */\r\n provideStatusBarItems?: (stageId: string, stageUsage: string, stageAppData?: any) => CommonStatusBarItem[];\r\n /** UiItemsManager calls following method to augment backstage items. */\r\n provideBackstageItems?: () => BackstageItem[];\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,\r\n zoneLocation?: AbstractZoneLocation, stageAppData?: any) => ReadonlyArray<AbstractWidgetProps>;\r\n /** Called if the application changed the Toolbar button item */\r\n onToolbarButtonItemArbiterChange?: (item: CommonToolbarItem, action: UiItemsApplicationAction) => void;\r\n /** Called if the application changed the StatusBar item */\r\n onStatusBarItemArbiterChange?: (item: CommonStatusBarItem, action: UiItemsApplicationAction) => void;\r\n /** Called if the application changed the Backstage item */\r\n onBackstageItemArbiterChange?: (item: BackstageItem, action: UiItemsApplicationAction) => void;\r\n /** Called if the application changed the Widget */\r\n onWidgetArbiterChange?: (widget: AbstractWidgetProps, action: UiItemsApplicationAction) => void;\r\n}\r\n\r\n/** UIProvider Registered Event Args interface.\r\n * @public\r\n */\r\nexport interface UiItemProviderRegisteredEventArgs {\r\n providerId: string;\r\n}\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 * @public\r\n */\r\nexport class UiItemsManager {\r\n private static _registeredUiItemsProviders: Map<string, UiItemsProvider> = new Map<string, UiItemsProvider>();\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);\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): void {\r\n if (UiItemsManager.getUiItemsProvider(uiProvider.id)) {\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProvider.id}) is already loaded`);\r\n } else {\r\n UiItemsManager._registeredUiItemsProviders.set(uiProvider.id, uiProvider);\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProvider.id}) loaded`);\r\n\r\n UiItemsManager.sendRegisteredEvent({ providerId: uiProvider.id } 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 if (!UiItemsManager.getUiItemsProvider(uiProviderId))\r\n return;\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 /** 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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideToolbarButtonItems) {\r\n uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)\r\n .forEach((spec: CommonToolbarItem) => buttonItems.push({ ...spec, providerId: uiProvider.id }));\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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideStatusBarItems) {\r\n uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)\r\n .forEach((item: CommonStatusBarItem) => statusBarItems.push({ ...item, providerId: uiProvider.id }));\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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideBackstageItems) {\r\n uiProvider.provideBackstageItems()\r\n .forEach((item: BackstageItem) => backstageItems.push({ ...item, providerId: uiProvider.id }));\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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideWidgets) {\r\n uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)\r\n .forEach((widget: AbstractWidgetProps) => widgets.push({ ...widget, providerId: uiProvider.id }));\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,4CAA4C;AAC5C;;GAEG;;;AAEH,sDAAsD;AAMtD,uCAA8C;AAC9C,mDAAgD;AAEhD;;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;AAwBD;;;;GAIG;AACH,MAAa,mBAAmB;IAC9B;;;;;OAKG;IACH,YAAsB,WAAmB,EAAS,gBAAuF;QAAnH,gBAAW,GAAX,WAAW,CAAQ;QAAS,qBAAgB,GAAhB,gBAAgB,CAAuE;IAAI,CAAC;IAE9I,IAAW,EAAE,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,YAAY,KAAW,CAAC;IAExB,UAAU;QACf,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;IAED,oEAAoE;IAC7D,qBAAqB;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,iCAAiC,CAAC,QAAgB,EAAE,WAAmB,EAAE,aAA2B,EAAE,mBAAuC,EAAE,aAAmB;QACvK,OAAO,EAAE,CAAC;IACZ,CAAC;IACM,yBAAyB,CAAC,OAAe,EAAE,UAAkB,EAAE,YAA0B,EAAE,kBAAsC,EAAE,YAAkB;QAC1J,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,IAAI,IAAI,CAAC,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ED;;;;;;OAMG;IACI,MAAM,CAAC,UAAU,CAAC,OAAe,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B,EAAE,YAAmC,EAAE,YAAkB;QAC9K,MAAM,OAAO,GAA0B,EAAE,CAAC;QAE1C,IAAI,CAAC,KAAK,cAAc,CAAC,2BAA2B,CAAC,IAAI;YACvD,OAAO,OAAO,CAAC;QAEjB,cAAc,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC,UAA2B,EAAE,EAAE;YACjF,uBAAuB;YACvB,IAAI,UAAU,CAAC,cAAc,EAAE;gBAC7B,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC;qBAC1F,OAAO,CAAC,CAAC,MAA2B,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;aACrG;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AAjJH,wCAmJC;AAlJgB,0CAA2B,GAAiC,IAAI,GAAG,EAA2B,CAAC;AAE9G,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 } 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 { StageUsage } from \"./items/StageUsage\";\r\n\r\n/** Action taken by the application on item provided by a UiItemsProvider\r\n * @public\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/** Describes interface of objects that want to provide UI component to the running IModelApp.\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, stageAppData?: any) => CommonToolbarItem[];\r\n /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */\r\n provideStatusBarItems?: (stageId: string, stageUsage: string, stageAppData?: any) => CommonStatusBarItem[];\r\n /** UiItemsManager calls following method to augment backstage items. */\r\n provideBackstageItems?: () => BackstageItem[];\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,\r\n zoneLocation?: AbstractZoneLocation, stageAppData?: any) => 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\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 * @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) => 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);\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);\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,\r\n _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData);\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\r\n/** UIProvider Registered Event Args interface.\r\n * @public\r\n */\r\nexport interface UiItemProviderRegisteredEventArgs {\r\n providerId: string;\r\n}\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 * @public\r\n */\r\nexport class UiItemsManager {\r\n private static _registeredUiItemsProviders: Map<string, UiItemsProvider> = new Map<string, UiItemsProvider>();\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);\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): void {\r\n if (UiItemsManager.getUiItemsProvider(uiProvider.id)) {\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProvider.id}) is already loaded`);\r\n } else {\r\n UiItemsManager._registeredUiItemsProviders.set(uiProvider.id, uiProvider);\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProvider.id}) loaded`);\r\n\r\n UiItemsManager.sendRegisteredEvent({ providerId: uiProvider.id } 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 /** 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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideToolbarButtonItems) {\r\n uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)\r\n .forEach((spec: CommonToolbarItem) => buttonItems.push({ ...spec, providerId: uiProvider.id }));\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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideStatusBarItems) {\r\n uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)\r\n .forEach((item: CommonStatusBarItem) => statusBarItems.push({ ...item, providerId: uiProvider.id }));\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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideBackstageItems) {\r\n uiProvider.provideBackstageItems()\r\n .forEach((item: BackstageItem) => backstageItems.push({ ...item, providerId: uiProvider.id }));\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((uiProvider: UiItemsProvider) => {\r\n // istanbul ignore else\r\n if (uiProvider.provideWidgets) {\r\n uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)\r\n .forEach((widget: AbstractWidgetProps) => widgets.push({ ...widget, providerId: uiProvider.id }));\r\n }\r\n });\r\n return widgets;\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
|
-
* @module
|
|
7
|
+
* @module Utilities
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.isArrowKey = exports.SpecialKey = exports.FunctionKey = void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardKey.js","sourceRoot":"","sources":["../../../../src/appui-abstract/common/KeyboardKey.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;AACb,CAAC,EAbW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAatB;AAED;;GAEG;AACH,IAAY,UAuBX;AAvBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;IACzB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,8BAAgB,CAAA;IAChB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;IACrB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAvBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAuBrB;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,CAAC,GAAG,KAAK,UAAU,CAAC,SAAS,IAAI,GAAG,KAAK,UAAU,CAAC,UAAU,IAAI,GAAG,KAAK,UAAU,CAAC,OAAO,IAAI,GAAG,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC;AACvI,CAAC;AAFD,gCAEC","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
|
|
1
|
+
{"version":3,"file":"KeyboardKey.js","sourceRoot":"","sources":["../../../../src/appui-abstract/common/KeyboardKey.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;AACb,CAAC,EAbW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAatB;AAED;;GAEG;AACH,IAAY,UAuBX;AAvBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;IACzB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,8BAAgB,CAAA;IAChB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;IACrB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAvBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAuBrB;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,CAAC,GAAG,KAAK,UAAU,CAAC,SAAS,IAAI,GAAG,KAAK,UAAU,CAAC,UAAU,IAAI,GAAG,KAAK,UAAU,CAAC,OAAO,IAAI,GAAG,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC;AACvI,CAAC;AAFD,gCAEC","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/** Enumeration for Function Keys\r\n * @public\r\n */\r\nexport enum FunctionKey {\r\n F1 = \"F1\",\r\n F2 = \"F2\",\r\n F3 = \"F3\",\r\n F4 = \"F4\",\r\n F5 = \"F5\",\r\n F6 = \"F6\",\r\n F7 = \"F7\",\r\n F8 = \"F8\",\r\n F9 = \"F9\",\r\n F10 = \"F10\",\r\n F11 = \"F11\",\r\n F12 = \"F12\",\r\n}\r\n\r\n/** Enumeration for Special Keys\r\n * @public\r\n */\r\nexport enum SpecialKey {\r\n Home = \"Home\",\r\n End = \"End\",\r\n PageUp = \"PageUp\",\r\n PageDown = \"PageDown\",\r\n Escape = \"Escape\",\r\n Delete = \"Delete\",\r\n Insert = \"Insert\",\r\n Tab = \"Tab\",\r\n ArrowLeft = \"ArrowLeft\",\r\n ArrowRight = \"ArrowRight\",\r\n ArrowUp = \"ArrowUp\",\r\n ArrowDown = \"ArrowDown\",\r\n Enter = \"Enter\",\r\n Return = \"Enter\",\r\n Space = \" \",\r\n Backspace = \"Backspace\",\r\n Clear = \"Clear\",\r\n Divide = \"Divide\",\r\n Multiply = \"Multiply\",\r\n Subtract = \"Subtract\",\r\n Add = \"Add\",\r\n Decimal = \"Decimal\",\r\n}\r\n\r\n/** Determines if a KeyboardEvent.key is an Arrow key\r\n * @public\r\n */\r\nexport function isArrowKey(key: string): boolean {\r\n return (key === SpecialKey.ArrowLeft || key === SpecialKey.ArrowRight || key === SpecialKey.ArrowUp || key === SpecialKey.ArrowDown);\r\n}\r\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ContentLayoutProps } from "./ContentLayoutProps";
|
|
2
1
|
/** @packageDocumentation
|
|
3
2
|
* @module ContentView
|
|
4
3
|
*/
|
|
4
|
+
import { ContentLayoutProps } from "./ContentLayoutProps";
|
|
5
5
|
/**
|
|
6
6
|
* Class that define Standard Content Layouts that can be used to specify how the content is arranged in a frontstage.
|
|
7
7
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardContentLayouts.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/content/StandardContentLayouts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StandardContentLayouts.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/content/StandardContentLayouts.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;GAGG;AACH,qBAAa,sBAAsB;IACjC,gBAAuB,UAAU,EAAE,kBAAkB,CAGnD;IAEF,gBAAuB,aAAa,EAAE,kBAAkB,CAYtD;IAEF,gBAAuB,gBAAgB,EAAE,kBAAkB,CASzD;IACF,gBAAuB,kBAAkB,EAAE,kBAAkB,CAU3D;IAEF,gBAAuB,mBAAmB,EAAE,kBAAkB,CAS5D;IAEF,gBAAuB,oBAAoB,EAAE,kBAAkB,CAS7D;IAEF,gBAAuB,qBAAqB,EAAE,kBAAkB,CAU9D;IAEF,gBAAuB,kBAAkB,EAAE,kBAAkB,CAU3D;IAGF,gBAAuB,gBAAgB,EAAE,kBAAkB,EAAE,CAS3D;CAEH"}
|
|
@@ -3,11 +3,11 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.StandardContentLayouts = void 0;
|
|
8
6
|
/** @packageDocumentation
|
|
9
7
|
* @module ContentView
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StandardContentLayouts = void 0;
|
|
11
11
|
/**
|
|
12
12
|
* Class that define Standard Content Layouts that can be used to specify how the content is arranged in a frontstage.
|
|
13
13
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardContentLayouts.js","sourceRoot":"","sources":["../../../../src/appui-abstract/content/StandardContentLayouts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F
|
|
1
|
+
{"version":3,"file":"StandardContentLayouts.js","sourceRoot":"","sources":["../../../../src/appui-abstract/content/StandardContentLayouts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;;GAGG;AACH,MAAa,sBAAsB;;AAAnC,wDAoGC;AAnGwB,iCAAU,GAAuB;IACtD,EAAE,EAAE,gBAAgB;IACpB,WAAW,EAAE,qBAAqB;CACnC,CAAC;AAEqB,oCAAa,GAAuB;IACzD,EAAE,EAAE,mBAAmB;IACvB,WAAW,EAAE,+DAA+D;IAC5E,aAAa,EAAE;QACb,EAAE,EAAE,+BAA+B;QACnC,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,GAAG;QAChB,YAAY,EAAE,GAAG;QACjB,IAAI,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE;QACzJ,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE;KAC5J;CACF,CAAC;AAEqB,uCAAgB,GAAuB;IAC5D,EAAE,EAAE,sBAAsB;IAC1B,WAAW,EAAE,yBAAyB;IACtC,aAAa,EAAE;QACb,EAAE,EAAE,2BAA2B;QAC/B,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;KACT;CACF,CAAC;AACqB,yCAAkB,GAAuB;IAC9D,EAAE,EAAE,wBAAwB;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AAE,8BAA8B,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE;KACvJ;CACF,CAAC;AAEqB,yCAAkB,GAAuB;IAC9D,EAAE,EAAE,wBAAwB;IAC5B,WAAW,EAAE,4DAA4D;IACzE,eAAe,EAAE;QACf,EAAE,EAAE,6BAA6B;QACjC,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,2BAA2B,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE;QAChJ,MAAM,EAAE,CAAC;KACV;CACF,CAAC;AAEF,yDAAyD;AAClC,uCAAgB,GAAyB;IAC9D,sBAAsB,CAAC,UAAU;IACjC,sBAAsB,CAAC,aAAa;IACpC,sBAAsB,CAAC,gBAAgB;IACvC,sBAAsB,CAAC,kBAAkB;IACzC,sBAAsB,CAAC,mBAAmB;IAC1C,sBAAsB,CAAC,oBAAoB;IAC3C,sBAAsB,CAAC,qBAAqB;IAC5C,sBAAsB,CAAC,kBAAkB;CAC1C,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 ContentView\r\n */\r\n\r\nimport { ContentLayoutProps } from \"./ContentLayoutProps\";\r\n\r\n/**\r\n * Class that define Standard Content Layouts that can be used to specify how the content is arranged in a frontstage.\r\n * @public\r\n */\r\nexport class StandardContentLayouts {\r\n public static readonly singleView: ContentLayoutProps = {\r\n id: \"uia:singleView\",\r\n description: \"Single Content View\",\r\n };\r\n\r\n public static readonly fourQuadrants: ContentLayoutProps = {\r\n id: \"uia:fourQuadrants\",\r\n description: \"Four Views, two stacked on the left, two stacked on the right\",\r\n verticalSplit: {\r\n id: \"uia:fourQuadrantVerticalSplit\",\r\n percentage: 0.50,\r\n lock: false,\r\n minSizeLeft: 100,\r\n minSizeRight: 100,\r\n left: { horizontalSplit: { id: \"uia:fourQuadrantsLeftHorizontal\", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n right: { horizontalSplit: { id: \"uia:fourQuadrantsRightHorizontal\", percentage: 0.50, top: 2, bottom: 3, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n },\r\n };\r\n\r\n public static readonly twoVerticalSplit: ContentLayoutProps = {\r\n id: \"uia:twoVerticalSplit\",\r\n description: \"Two Views, side by side\",\r\n verticalSplit: {\r\n id: \"uia:twoViewsVerticalSplit\",\r\n percentage: 0.50,\r\n left: 0,\r\n right: 1,\r\n },\r\n };\r\n public static readonly twoHorizontalSplit: ContentLayoutProps = {\r\n id: \"uia:twoHorizontalSplit\",\r\n description: \"Two views, stack one on top of the other\",\r\n horizontalSplit: {\r\n id: \"uia:twoViewsHorizontalSplit\",\r\n percentage: 0.50,\r\n lock: false,\r\n top: 0,\r\n bottom: 1,\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnLeft: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnLeft\",\r\n description: \"Three views, one on the right with the two on the left stacked one of top of the other\",\r\n verticalSplit: {\r\n id: \"uia:twoViewsOnLeftSplit\",\r\n percentage: 0.50,\r\n left: { horizontalSplit: { id: \"uia:twoViewsOnLeftHorizontal\", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n right: 2,\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnRight: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnRight\",\r\n description: \"Three views, one on the left with the two on the right stacked one of top of the other\",\r\n verticalSplit: {\r\n id: \"uia:twoViewsOnRightSplit\",\r\n percentage: 0.50,\r\n left: 0,\r\n right: { horizontalSplit: { id: \"uia:twoViewsOnRightHorizontal\", percentage: 0.50, top: 1, bottom: 2, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnBottom: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnBottom\",\r\n description: \"Three Views, one on top and two side by side on the bottom\",\r\n horizontalSplit: {\r\n id: \"uia:threeViewsTwoOnBottomHorizontal\",\r\n percentage: 0.50,\r\n lock: false,\r\n top: 0,\r\n bottom: { verticalSplit: { id: \"uia:twoViewsOnBottomVertical\", percentage: 0.50, left: 1, right: 2, lock: false, minSizeLeft: 50, minSizeRight: 50 } },\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnTop: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnTop\",\r\n description: \"Three Views, two side by side on top and one on the bottom\",\r\n horizontalSplit: {\r\n id: \"uia:twoViewsOnTopHorizontal\",\r\n percentage: 0.50,\r\n lock: false,\r\n top: { verticalSplit: { id: \"uia:twoViewsOnTopVertical\", percentage: 0.50, left: 0, right: 1, lock: false, minSizeLeft: 50, minSizeRight: 50 } },\r\n bottom: 2,\r\n },\r\n };\r\n\r\n // provides and iterable list of standard content layouts\r\n public static readonly availableLayouts: ContentLayoutProps[] = [\r\n StandardContentLayouts.singleView,\r\n StandardContentLayouts.fourQuadrants,\r\n StandardContentLayouts.twoVerticalSplit,\r\n StandardContentLayouts.twoHorizontalSplit,\r\n StandardContentLayouts.threeViewsTwoOnLeft,\r\n StandardContentLayouts.threeViewsTwoOnRight,\r\n StandardContentLayouts.threeViewsTwoOnBottom,\r\n StandardContentLayouts.threeViewsTwoOnTop,\r\n ];\r\n\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageSeverity.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/notification/MessageSeverity.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;IAEI;AACJ,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,WAAW,IAAI;IACf,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"MessageSeverity.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/notification/MessageSeverity.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;IAEI;AACJ,oBAAY,eAAe;IACzB,IAAI,IAAI;IACR,WAAW,IAAI;IACf,QAAQ,IAAI;IACZ,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,IAAI;IACT,OAAO,IAAI;CACZ"}
|
|
@@ -19,5 +19,6 @@ var MessageSeverity;
|
|
|
19
19
|
MessageSeverity[MessageSeverity["Warning"] = 3] = "Warning";
|
|
20
20
|
MessageSeverity[MessageSeverity["Error"] = 4] = "Error";
|
|
21
21
|
MessageSeverity[MessageSeverity["Fatal"] = 5] = "Fatal";
|
|
22
|
+
MessageSeverity[MessageSeverity["Success"] = 6] = "Success";
|
|
22
23
|
})(MessageSeverity = exports.MessageSeverity || (exports.MessageSeverity = {}));
|
|
23
24
|
//# sourceMappingURL=MessageSeverity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageSeverity.js","sourceRoot":"","sources":["../../../../src/appui-abstract/notification/MessageSeverity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;IAEI;AACJ,IAAY,
|
|
1
|
+
{"version":3,"file":"MessageSeverity.js","sourceRoot":"","sources":["../../../../src/appui-abstract/notification/MessageSeverity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;IAEI;AACJ,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,mEAAe,CAAA;IACf,6DAAY,CAAA;IACZ,2DAAW,CAAA;IACX,uDAAS,CAAA;IACT,uDAAS,CAAA;IACT,2DAAW,CAAA;AACb,CAAC,EARW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAQ1B","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 Notification\r\n */\r\n\r\n/** Message Severity enum for display messages.\r\n * @public\r\n */\r\nexport enum MessageSeverity {\r\n None = 0,\r\n Information = 1,\r\n Question = 2,\r\n Warning = 3,\r\n Error = 4,\r\n Fatal = 5,\r\n Success = 6,\r\n}\r\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Utilities
|
|
3
3
|
*/
|
|
4
4
|
import { BentleyError, GetMetaDataFunction } from "@itwin/core-bentley";
|
|
5
|
-
/**
|
|
5
|
+
/** iTwin.js UI UiError class is a subclass of BentleyError. Errors are logged.
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export declare class UiError extends BentleyError {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.UiError = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
-
/**
|
|
12
|
+
/** iTwin.js UI UiError class is a subclass of BentleyError. Errors are logged.
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
15
|
class UiError extends core_bentley_1.BentleyError {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiError.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiError.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuF;AAEvF;;GAEG;AACH,MAAa,OAAQ,SAAQ,2BAAY;IAEvC,6CAA6C;IAC7C,YAA0B,QAAgB,EAAE,OAAe,EAAE,cAAsB,4BAAa,CAAC,KAAK,EAAE,WAAiC;QACvI,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QADjB,aAAQ,GAAR,QAAQ,CAAQ;IAE1C,CAAC;CACF;AAND,0BAMC","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\nimport { BentleyError, BentleyStatus, GetMetaDataFunction } from \"@itwin/core-bentley\";\r\n\r\n/**
|
|
1
|
+
{"version":3,"file":"UiError.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiError.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuF;AAEvF;;GAEG;AACH,MAAa,OAAQ,SAAQ,2BAAY;IAEvC,6CAA6C;IAC7C,YAA0B,QAAgB,EAAE,OAAe,EAAE,cAAsB,4BAAa,CAAC,KAAK,EAAE,WAAiC;QACvI,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QADjB,aAAQ,GAAR,QAAQ,CAAQ;IAE1C,CAAC;CACF;AAND,0BAMC","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\nimport { BentleyError, BentleyStatus, GetMetaDataFunction } from \"@itwin/core-bentley\";\r\n\r\n/** iTwin.js UI UiError class is a subclass of BentleyError. Errors are logged.\r\n * @public\r\n */\r\nexport class UiError extends BentleyError {\r\n\r\n /** Constructs UiError using BentleyError. */\r\n public constructor(public category: string, message: string, errorNumber: number = BentleyStatus.ERROR, getMetaData?: GetMetaDataFunction) {\r\n super(errorNumber, message, getMetaData);\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Utilities
|
|
3
|
+
*/
|
|
4
|
+
import { BeUiEvent } from "@itwin/core-bentley";
|
|
5
|
+
/** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class UiEvent<TEventArgs> extends BeUiEvent<TEventArgs> {
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=UiEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiEvent.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiEvent.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;GAEG;AACH,qBAAa,OAAO,CAAC,UAAU,CAAE,SAAQ,SAAS,CAAC,UAAU,CAAC;CAAI"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 Utilities
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.UiEvent = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
/** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
class UiEvent extends core_bentley_1.BeUiEvent {
|
|
16
|
+
}
|
|
17
|
+
exports.UiEvent = UiEvent;
|
|
18
|
+
//# sourceMappingURL=UiEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiEvent.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAEhD;;GAEG;AACH,MAAa,OAAoB,SAAQ,wBAAqB;CAAI;AAAlE,0BAAkE","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\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\n\r\n/** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.\r\n * @public\r\n */\r\nexport class UiEvent<TEventArgs> extends BeUiEvent<TEventArgs> { }\r\n"]}
|