@itwin/appui-abstract 4.1.0-dev.4 → 4.1.0-dev.40
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 +20 -1
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts +31 -0
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js +80 -0
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -0
- package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts +114 -0
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/UiItemsManager.js +194 -0
- package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -0
- package/lib/cjs/appui-abstract/UiItemsProvider.d.ts +30 -0
- package/lib/cjs/appui-abstract/UiItemsProvider.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/UiItemsProvider.js +10 -0
- package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts +92 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItem.js +71 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +1 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.d.ts +39 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js +134 -0
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js.map +1 -0
- package/lib/cjs/appui-abstract/common/KeyboardKey.js.map +1 -1
- package/lib/cjs/appui-abstract/content/ContentLayoutProps.js.map +1 -1
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/items/AbstractItemProps.js.map +1 -1
- package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
- package/lib/cjs/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
- package/lib/cjs/appui-abstract/items/BadgeType.js.map +1 -1
- package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
- package/lib/cjs/appui-abstract/items/ConditionalStringValue.js.map +1 -1
- package/lib/cjs/appui-abstract/items/ProvidedItem.d.ts +12 -0
- package/lib/cjs/appui-abstract/items/ProvidedItem.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/items/ProvidedItem.js +10 -0
- package/lib/cjs/appui-abstract/items/ProvidedItem.js.map +1 -0
- package/lib/cjs/appui-abstract/items/RelativePosition.js.map +1 -1
- package/lib/cjs/appui-abstract/items/StageUsage.d.ts +17 -0
- package/lib/cjs/appui-abstract/items/StageUsage.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/items/StageUsage.js +25 -0
- package/lib/cjs/appui-abstract/items/StageUsage.js.map +1 -0
- package/lib/cjs/appui-abstract/notification/MessagePresenter.js.map +1 -1
- package/lib/cjs/appui-abstract/notification/MessageSeverity.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/Description.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/EditorParams.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/Record.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/StandardEditorNames.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/StandardTypeNames.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/Value.js.map +1 -1
- package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts +129 -0
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js +88 -0
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +1 -0
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.d.ts +40 -0
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js +136 -0
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -0
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts +27 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js +23 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.d.ts +46 -0
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js +236 -0
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -0
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/PointProps.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiError.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiEvent.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/callbacks.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/charCode.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/filters.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/map.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/strings.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/isLetter.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/misc.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts +87 -0
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js +10 -0
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +1 -0
- package/lib/cjs/appui-abstract/widget/StagePanel.d.ts +37 -0
- package/lib/cjs/appui-abstract/widget/StagePanel.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/widget/StagePanel.js +47 -0
- package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -0
- package/lib/cjs/appui-abstract/widget/WidgetState.d.ts +20 -0
- package/lib/cjs/appui-abstract/widget/WidgetState.d.ts.map +1 -0
- package/lib/cjs/appui-abstract/widget/WidgetState.js +28 -0
- package/lib/cjs/appui-abstract/widget/WidgetState.js.map +1 -0
- package/lib/cjs/appui-abstract.d.ts +31 -0
- package/lib/cjs/appui-abstract.d.ts.map +1 -1
- package/lib/cjs/appui-abstract.js +31 -0
- package/lib/cjs/appui-abstract.js.map +1 -1
- package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts +31 -0
- package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -0
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js +76 -0
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -0
- package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.d.ts +114 -0
- package/lib/esm/appui-abstract/UiItemsManager.d.ts.map +1 -0
- package/lib/esm/appui-abstract/UiItemsManager.js +191 -0
- package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -0
- package/lib/esm/appui-abstract/UiItemsProvider.d.ts +30 -0
- package/lib/esm/appui-abstract/UiItemsProvider.d.ts.map +1 -0
- package/lib/esm/appui-abstract/UiItemsProvider.js +9 -0
- package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -0
- package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts +92 -0
- package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts.map +1 -0
- package/lib/esm/appui-abstract/backstage/BackstageItem.js +66 -0
- package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +1 -0
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.d.ts +39 -0
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.d.ts.map +1 -0
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js +130 -0
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js.map +1 -0
- package/lib/esm/appui-abstract/common/KeyboardKey.js.map +1 -1
- package/lib/esm/appui-abstract/content/ContentLayoutProps.js.map +1 -1
- package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
- package/lib/esm/appui-abstract/items/AbstractItemProps.js.map +1 -1
- package/lib/esm/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
- package/lib/esm/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
- package/lib/esm/appui-abstract/items/BadgeType.js.map +1 -1
- package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
- package/lib/esm/appui-abstract/items/ConditionalStringValue.js.map +1 -1
- package/lib/esm/appui-abstract/items/ProvidedItem.d.ts +12 -0
- package/lib/esm/appui-abstract/items/ProvidedItem.d.ts.map +1 -0
- package/lib/esm/appui-abstract/items/ProvidedItem.js +9 -0
- package/lib/esm/appui-abstract/items/ProvidedItem.js.map +1 -0
- package/lib/esm/appui-abstract/items/RelativePosition.js.map +1 -1
- package/lib/esm/appui-abstract/items/StageUsage.d.ts +17 -0
- package/lib/esm/appui-abstract/items/StageUsage.d.ts.map +1 -0
- package/lib/esm/appui-abstract/items/StageUsage.js +22 -0
- package/lib/esm/appui-abstract/items/StageUsage.js.map +1 -0
- package/lib/esm/appui-abstract/notification/MessagePresenter.js.map +1 -1
- package/lib/esm/appui-abstract/notification/MessageSeverity.js.map +1 -1
- package/lib/esm/appui-abstract/properties/Description.js.map +1 -1
- package/lib/esm/appui-abstract/properties/EditorParams.js.map +1 -1
- package/lib/esm/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
- package/lib/esm/appui-abstract/properties/Record.js.map +1 -1
- package/lib/esm/appui-abstract/properties/StandardEditorNames.js.map +1 -1
- package/lib/esm/appui-abstract/properties/StandardTypeNames.js.map +1 -1
- package/lib/esm/appui-abstract/properties/Value.js.map +1 -1
- package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts +129 -0
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts.map +1 -0
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.js +82 -0
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +1 -0
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.d.ts +40 -0
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.d.ts.map +1 -0
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js +132 -0
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -0
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts +27 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.js +22 -0
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.d.ts +46 -0
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.d.ts.map +1 -0
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js +232 -0
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -0
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/esm/appui-abstract/utils/PointProps.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiError.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiEvent.js.map +1 -1
- package/lib/esm/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
- package/lib/esm/appui-abstract/utils/callbacks.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/charCode.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/filters.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/map.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/strings.js.map +1 -1
- package/lib/esm/appui-abstract/utils/isLetter.js.map +1 -1
- package/lib/esm/appui-abstract/utils/misc.js.map +1 -1
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts +87 -0
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -0
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js +9 -0
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +1 -0
- package/lib/esm/appui-abstract/widget/StagePanel.d.ts +37 -0
- package/lib/esm/appui-abstract/widget/StagePanel.d.ts.map +1 -0
- package/lib/esm/appui-abstract/widget/StagePanel.js +44 -0
- package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -0
- package/lib/esm/appui-abstract/widget/WidgetState.d.ts +20 -0
- package/lib/esm/appui-abstract/widget/WidgetState.d.ts.map +1 -0
- package/lib/esm/appui-abstract/widget/WidgetState.js +25 -0
- package/lib/esm/appui-abstract/widget/WidgetState.js.map +1 -0
- package/lib/esm/appui-abstract.d.ts +31 -0
- package/lib/esm/appui-abstract.d.ts.map +1 -1
- package/lib/esm/appui-abstract.js +31 -0
- package/lib/esm/appui-abstract.js.map +1 -1
- package/package.json +15 -36
package/CHANGELOG.md
CHANGED
@@ -1,6 +1,25 @@
|
|
1
1
|
# Change Log - @itwin/appui-abstract
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 22 May 2023 15:34:14 GMT and should not be manually modified.
|
4
|
+
|
5
|
+
## 4.0.0
|
6
|
+
Mon, 22 May 2023 15:34:14 GMT
|
7
|
+
|
8
|
+
### Updates
|
9
|
+
|
10
|
+
- Update to eslint@8
|
11
|
+
- Promote `PropertyDescription.hideCompositePropertyLabel` to `@public`
|
12
|
+
- Update @deprecated comments.
|
13
|
+
|
14
|
+
## 3.7.6
|
15
|
+
Mon, 15 May 2023 18:23:40 GMT
|
16
|
+
|
17
|
+
_Version update only_
|
18
|
+
|
19
|
+
## 3.7.5
|
20
|
+
Thu, 04 May 2023 19:43:18 GMT
|
21
|
+
|
22
|
+
_Version update only_
|
4
23
|
|
5
24
|
## 3.7.4
|
6
25
|
Tue, 25 Apr 2023 17:50:35 GMT
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/** @packageDocumentation
|
2
|
+
* @module UiItemsProvider
|
3
|
+
*/
|
4
|
+
import { BackstageItem } from "./backstage/BackstageItem";
|
5
|
+
import { CommonStatusBarItem } from "./statusbar/StatusBarItem";
|
6
|
+
import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem";
|
7
|
+
import { AbstractWidgetProps } from "./widget/AbstractWidgetProps";
|
8
|
+
import { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from "./widget/StagePanel";
|
9
|
+
import { UiItemsProvider } from "./UiItemsProvider";
|
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
|
+
* active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
|
12
|
+
* @deprecated in 3.6. Use [BaseUiItemsProvider]($appui-react) instead.
|
13
|
+
* @public
|
14
|
+
*/
|
15
|
+
export declare class BaseUiItemsProvider implements UiItemsProvider {
|
16
|
+
protected _providerId: string;
|
17
|
+
isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider) => boolean) | undefined;
|
18
|
+
constructor(_providerId: string, isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider) => boolean) | undefined);
|
19
|
+
get id(): string;
|
20
|
+
onUnregister(): void;
|
21
|
+
unregister(): void;
|
22
|
+
/** Backstage items are not stage specific so no callback is used */
|
23
|
+
provideBackstageItems(): BackstageItem[];
|
24
|
+
provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[];
|
25
|
+
provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[];
|
26
|
+
provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[];
|
27
|
+
provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[];
|
28
|
+
provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, _stageAppData?: any): AbstractWidgetProps[];
|
29
|
+
provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps>;
|
30
|
+
}
|
31
|
+
//# sourceMappingURL=BaseUiItemsProvider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BaseUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAA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EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,oBAAoB,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAI5M,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAClH,aAAa,CAAC,EAAE,oBAAoB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAWhG"}
|
@@ -0,0 +1,80 @@
|
|
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
|
+
/* eslint-disable deprecation/deprecation */
|
7
|
+
/** @packageDocumentation
|
8
|
+
* @module UiItemsProvider
|
9
|
+
*/
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
11
|
+
exports.BaseUiItemsProvider = void 0;
|
12
|
+
const StageUsage_1 = require("./items/StageUsage");
|
13
|
+
const UiItemsManager_1 = require("./UiItemsManager");
|
14
|
+
/** Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
|
15
|
+
* active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
|
16
|
+
* @deprecated in 3.6. Use [BaseUiItemsProvider]($appui-react) instead.
|
17
|
+
* @public
|
18
|
+
*/
|
19
|
+
class BaseUiItemsProvider {
|
20
|
+
/*
|
21
|
+
* @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want
|
22
|
+
* to set up custom stage with their own subset of standard tools.
|
23
|
+
* @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and
|
24
|
+
* the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.
|
25
|
+
*/
|
26
|
+
constructor(_providerId, isSupportedStage) {
|
27
|
+
this._providerId = _providerId;
|
28
|
+
this.isSupportedStage = isSupportedStage;
|
29
|
+
}
|
30
|
+
get id() { return this._providerId; }
|
31
|
+
onUnregister() { }
|
32
|
+
unregister() {
|
33
|
+
UiItemsManager_1.UiItemsManager.unregister(this._providerId);
|
34
|
+
}
|
35
|
+
/** Backstage items are not stage specific so no callback is used */
|
36
|
+
provideBackstageItems() {
|
37
|
+
return [];
|
38
|
+
}
|
39
|
+
provideToolbarButtonItemsInternal(_stageId, _stageUsage, _toolbarUsage, _toolbarOrientation, _stageAppData) {
|
40
|
+
return [];
|
41
|
+
}
|
42
|
+
provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) {
|
43
|
+
let provideToStage = false;
|
44
|
+
if (this.isSupportedStage) {
|
45
|
+
provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
provideToStage = (stageUsage === StageUsage_1.StageUsage.General);
|
49
|
+
}
|
50
|
+
return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];
|
51
|
+
}
|
52
|
+
provideStatusBarItemsInternal(_stageId, _stageUsage, _stageAppData) {
|
53
|
+
return [];
|
54
|
+
}
|
55
|
+
provideStatusBarItems(stageId, stageUsage, stageAppData) {
|
56
|
+
let provideToStage = false;
|
57
|
+
if (this.isSupportedStage) {
|
58
|
+
provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
provideToStage = (stageUsage === StageUsage_1.StageUsage.General);
|
62
|
+
}
|
63
|
+
return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];
|
64
|
+
}
|
65
|
+
provideWidgetsInternal(_stageId, _stageUsage, _location, _section, _zoneLocation, _stageAppData) {
|
66
|
+
return [];
|
67
|
+
}
|
68
|
+
provideWidgets(stageId, stageUsage, location, section, _zoneLocation, stageAppData) {
|
69
|
+
let provideToStage = false;
|
70
|
+
if (this.isSupportedStage) {
|
71
|
+
provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
provideToStage = (stageUsage === StageUsage_1.StageUsage.General);
|
75
|
+
}
|
76
|
+
return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, _zoneLocation, stageAppData) : [];
|
77
|
+
}
|
78
|
+
}
|
79
|
+
exports.BaseUiItemsProvider = BaseUiItemsProvider;
|
80
|
+
//# sourceMappingURL=BaseUiItemsProvider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BaseUiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAOH,mDAAgD;AAEhD,qDAAkD;AAElD;;;;GAIG;AACH,MAAa,mBAAmB;IAC9B;;;;;OAKG;IACH,YAAsB,WAAmB,EAAS,gBAAmH;QAA/I,gBAAW,GAAX,WAAW,CAAQ;QAAS,qBAAgB,GAAhB,gBAAgB,CAAmG;IAAI,CAAC;IAE1K,IAAW,EAAE,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,YAAY,KAAW,CAAC;IAExB,UAAU;QACf,+BAAc,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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AG,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,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChI,CAAC;CACF;AAnED,kDAmEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable deprecation/deprecation */\n/** @packageDocumentation\n * @module UiItemsProvider\n */\n\nimport { BackstageItem } from \"./backstage/BackstageItem\";\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\nimport { StageUsage } from \"./items/StageUsage\";\nimport { UiItemsProvider } from \"./UiItemsProvider\";\nimport { UiItemsManager } from \"./UiItemsManager\";\n\n/** Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the\n * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.\n * @deprecated in 3.6. Use [BaseUiItemsProvider]($appui-react) instead.\n * @public\n */\nexport class BaseUiItemsProvider implements UiItemsProvider {\n /*\n * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want\n * to set up custom stage with their own subset of standard tools.\n * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and\n * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.\n */\n constructor(protected _providerId: string, public isSupportedStage?: (stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider) => boolean) { }\n\n public get id(): string { return this._providerId; }\n public onUnregister(): void { }\n\n public unregister() {\n UiItemsManager.unregister(this._providerId);\n }\n\n /** Backstage items are not stage specific so no callback is used */\n public provideBackstageItems(): BackstageItem[] {\n return [];\n }\n\n public provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[] {\n return [];\n }\n public provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\n let provideToStage = false;\n\n if (this.isSupportedStage) {\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\n } else {\n provideToStage = (stageUsage === StageUsage.General);\n }\n\n return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];\n }\n\n public provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[] {\n return [];\n }\n public provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\n let provideToStage = false;\n\n if (this.isSupportedStage) {\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\n } else {\n provideToStage = (stageUsage === StageUsage.General);\n }\n\n return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];\n }\n\n public provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, _stageAppData?: any): AbstractWidgetProps[] {\n return [];\n }\n\n public provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection,\n _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\n let provideToStage = false;\n\n if (this.isSupportedStage) {\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\n } else {\n provideToStage = (stageUsage === StageUsage.General);\n }\n\n return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, _zoneLocation, stageAppData) : [];\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"UiAdmin.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiAdmin.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAWhD,uCAA8C;AAE9C,6CAA0C;AA+B1C;;GAEG;AACH,MAAa,cAAe,SAAQ,wBAA6B;CAAI;AAArE,wCAAqE;AAUrE;;GAEG;AACH,MAAa,OAAO;IAApB;QACU,kBAAa,GAAY,EAAE,CAAC;IA+OtC,CAAC;IA5OC,qDAAqD;IAC9C,MAAM,KAAK,gBAAgB;QAChC,IAAI,CAAC,OAAO,CAAC,iBAAiB;YAC5B,MAAM,IAAI,iBAAO,CAAC,IAAA,qBAAc,EAAC,IAAI,CAAC,EAAE,kCAAkC,CAAC,CAAC;QAC9E,OAAO,OAAO,CAAC,iBAAiB,CAAC;IACnC,CAAC;IACM,MAAM,KAAK,gBAAgB,CAAC,EAAoB;QACrD,OAAO,CAAC,iBAAiB,GAAG,EAAE,CAAC;IACjC,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,kDAAkD;IACtF,CAAC;IAEM,kBAAkB,CAAC,OAAgB;QACxC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7D,CAAC;IAED,gBAAgB;IACT,aAAa,KAAK,CAAC;IAE1B,uCAAuC;IACvC,IAAW,cAAc,KAAiB,OAAO,EAAE,CAAC,EAAE,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,CAAC,IAAwB;QAChD,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAID;;;;;;;OAOG;IACI,UAAU,CAAC,eAAyC,EAAE,MAAc,EAAE,QAAiB,EAAE,GAAW,EACzG,cAA4B;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yCAAyC;IAClC,WAAW,CAAC,SAAiB,IAAa,OAAO,KAAK,CAAC,CAAC,CAAC;;AAjBhE,sBAAsB;AACC,wBAAgB,GAAG,IAAI,cAAc,EAAE,AAAvB,CAAwB;AA/NpD,0BAAO","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 UiAdmin\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\nimport { AbstractMenuItemProps } from \"./items/AbstractMenuItemProps\";\r\nimport { AbstractToolbarProps } from \"./items/AbstractToolbarProps\";\r\nimport { RelativePosition } from \"./items/RelativePosition\";\r\nimport { PropertyDescription } from \"./properties/Description\";\r\nimport { Primitives } from \"./properties/PrimitiveTypes\";\r\nimport { OnCancelFunc, OnItemExecutedFunc, OnNumberCommitFunc, OnValueCommitFunc } from \"./utils/callbacks\";\r\nimport { PropertyRecord } from \"./properties/Record\";\r\nimport { UiDataProvider } from \"./dialogs/UiDataProvider\";\r\nimport { DialogLayoutDataProvider } from \"./dialogs/UiLayoutDataProvider\";\r\nimport { PointProps } from \"./utils/PointProps\";\r\nimport { loggerCategory } from \"./utils/misc\";\r\nimport { MessagePresenter } from \"./notification/MessagePresenter\";\r\nimport { UiError } from \"./utils/UiError\";\r\n\r\n/** The Generic UI Event args contains information useful for any UI message\r\n * @public\r\n */\r\nexport interface GenericUiEventArgs {\r\n uiComponentId: string;\r\n}\r\n\r\n/** Optional props to pass to the Dialog control that is generated.\r\n * @public\r\n */\r\nexport interface DialogProps {\r\n /** Indicates whether the user can resize dialog with cursor. */\r\n resizable?: boolean;\r\n /** Indicates whether the user can move dialog with cursor.*/\r\n movable?: boolean;\r\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n width?: string | number;\r\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n height?: string | number;\r\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n minWidth?: string | number;\r\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n minHeight?: string | number;\r\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxWidth?: string | number;\r\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxHeight?: string | number;\r\n}\r\n\r\n/** The GenericUiEvent is the base event class for UI events that target a specific component, as identified in uiComponentId.\r\n * @public\r\n */\r\nexport class GenericUiEvent extends BeUiEvent<GenericUiEventArgs> { }\r\n\r\n/** Flags that control enabling/disabling certain UI features\r\n * @public\r\n */\r\nexport interface UiFlags {\r\n /** if true then Ctrl+F2 will show popup key-in palette */\r\n allowKeyinPalette?: boolean;\r\n}\r\n\r\n/** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.\r\n * @public\r\n */\r\nexport class UiAdmin {\r\n private _featureFlags: UiFlags = {};\r\n private static _messagePresenter?: MessagePresenter;\r\n\r\n /** The MessagePresenter used to display messages. */\r\n public static get messagePresenter(): MessagePresenter {\r\n if (!UiAdmin._messagePresenter)\r\n throw new UiError(loggerCategory(this), \"UiAdmin.messagePresenter not set\");\r\n return UiAdmin._messagePresenter;\r\n }\r\n public static set messagePresenter(mp: MessagePresenter) {\r\n UiAdmin._messagePresenter = mp;\r\n }\r\n\r\n public get featureFlags(): UiFlags {\r\n return { ...this._featureFlags }; // return copy so no direct access to modify value\r\n }\r\n\r\n public updateFeatureFlags(uiFlags: UiFlags) {\r\n this._featureFlags = { ...this._featureFlags, ...uiFlags };\r\n }\r\n\r\n /** @internal */\r\n public onInitialized() { }\r\n\r\n /** Get the cursor X and Y position. */\r\n public get cursorPosition(): PointProps { return { x: 0, y: 0 }; }\r\n\r\n /** Create a PointProps object. */\r\n public createXAndY(x: number, y: number): PointProps { return { x, y }; }\r\n\r\n /** Determines if focus is set to Home */\r\n public get isFocusOnHome(): boolean { return false; }\r\n\r\n /** Sets focus to Home */\r\n public setFocusToHome(): void { }\r\n\r\n /** Show a context menu at a particular location.\r\n * @param _menuItemsProps Properties of the menu items to display.\r\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the menu was displayed, false if the menu could not be displayed.\r\n */\r\n public showContextMenu(_menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show a Toolbar at a particular location.\r\n * @param _toolbarProps Properties of the Toolbar to display.\r\n * @param _location Location of the Toolbar, relative to the origin of htmlElement or the window.\r\n * @param _offset Offset of the Toolbar from the location.\r\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\r\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\r\n */\r\n public showToolbar(\r\n _toolbarProps: AbstractToolbarProps, _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the toolbar. */\r\n public hideToolbar(): boolean { return false; }\r\n\r\n /** Show a menu button at a particular location. A menu button opens a context menu.\r\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\r\n * @param _menuItemsProps Properties of the menu items to display.\r\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the button was displayed, false if the button could not be displayed.\r\n */\r\n public showMenuButton(_id: string, _menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides a menu button.\r\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\r\n * @return true if the menu was hidden, false if the menu could not be hidden.\r\n */\r\n public hideMenuButton(_id: string): boolean { return false; }\r\n\r\n /** Show a calculator at a particular location.\r\n * @param _initialValue Value initially displayed in the calculator.\r\n * @param _resultIcon Icon displayed to the left of the value.\r\n * @param _location Location of the calculator, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the calculator was displayed, false if the calculator could not be displayed.\r\n */\r\n public showCalculator(_initialValue: number, _resultIcon: string, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the calculator. */\r\n public hideCalculator(): boolean { return false; }\r\n\r\n /** Show an input editor for an angle value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showAngleEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show an input editor for a length value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showLengthEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show an input editor for a height value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showHeightEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show an input editor for a primitive value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _propertyDescription Description of the primitive value property.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showInputEditor(_initialValue: Primitives.Value, _propertyDescription: PropertyDescription, _location: PointProps, _onCommit: OnValueCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the input editor. */\r\n public hideInputEditor(): boolean { return false; }\r\n\r\n /** Show an HTML element at a particular location.\r\n * @param _displayElement The HTMLElement to display\r\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\r\n * @param _offset Offset of the display element from the location\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\r\n * @return true if the display element was displayed, false if the display element could not be displayed.\r\n */\r\n public showHTMLElement(\r\n _displayElement: HTMLElement, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the HTML Element. */\r\n public hideHTMLElement(): boolean { return false; }\r\n\r\n /** Show a Card containing content, a title and a toolbar at a particular location.\r\n * @param _content The HTMLElement of the content to display\r\n * @param _title Title to display at the top of the card.\r\n * @param _toolbarProps Properties of the Toolbar to display.\r\n * @param _location Location of the Card, relative to the origin of anchorElement or the window.\r\n * @param _offset Offset of the Card from the location.\r\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\r\n * @return true if the Card was displayed, false if the Card could not be displayed.\r\n */\r\n public showCard(\r\n _content: HTMLElement, _title: string | PropertyRecord | undefined, _toolbarProps: AbstractToolbarProps | undefined,\r\n _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the Card. */\r\n public hideCard(): boolean { return false; }\r\n\r\n /** Opens a Tool Settings Ui popup at a particular location.\r\n * @param _dataProvider The UiDataProvider for the tool settings\r\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\r\n * @param _offset Offset of the tool settings from the location\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\r\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\r\n */\r\n public openToolSettingsPopup(\r\n _dataProvider: UiDataProvider, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Closes the Tool Settings Ui popup. */\r\n public closeToolSettingsPopup(): boolean { return false; }\r\n\r\n /** Show the Keyin Palette to display all support Tool key-ins.\r\n * @param _htmlElement The HTMLElement that anchors the Keyin Palette. If undefined, the location is relative to the overall window.\r\n * @return true if the Keyin Palette was displayed, false if it could not be displayed.\r\n */\r\n public showKeyinPalette(_htmlElement?: HTMLElement): boolean { return false; }\r\n\r\n /** Hides the Keyin Palette. */\r\n public hideKeyinPalette(): boolean { return false; }\r\n\r\n /** Send a UI event */\r\n public static sendUiEvent(args: GenericUiEventArgs) {\r\n UiAdmin.onGenericUiEvent.emit(args);\r\n }\r\n /** GenericUiEvent */\r\n public static readonly onGenericUiEvent = new GenericUiEvent();\r\n\r\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\r\n * @param _uiDataProvider The DialogLayoutDataProvider for the dialog\r\n * @param _title Specify title for dialog.\r\n * @param _isModal Specify if the dialog is opened as a modal or modeless.\r\n * @param _id Id of the dialog that is used to close it.\r\n * @param _optionalProps Optional props for Dialog construction.\r\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\r\n */\r\n public openDialog(_uiDataProvider: DialogLayoutDataProvider, _title: string, _isModal: boolean, _id: string,\r\n _optionalProps?: DialogProps): boolean {\r\n return false;\r\n }\r\n\r\n /** Closes the Dialog with a given Id. */\r\n public closeDialog(_dialogId: string): boolean { return false; }\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"UiAdmin.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiAdmin.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAWhD,uCAA8C;AAE9C,6CAA0C;AA+B1C;;GAEG;AACH,MAAa,cAAe,SAAQ,wBAA6B;CAAI;AAArE,wCAAqE;AAUrE;;GAEG;AACH,MAAa,OAAO;IAApB;QACU,kBAAa,GAAY,EAAE,CAAC;IA+OtC,CAAC;IA5OC,qDAAqD;IAC9C,MAAM,KAAK,gBAAgB;QAChC,IAAI,CAAC,OAAO,CAAC,iBAAiB;YAC5B,MAAM,IAAI,iBAAO,CAAC,IAAA,qBAAc,EAAC,IAAI,CAAC,EAAE,kCAAkC,CAAC,CAAC;QAC9E,OAAO,OAAO,CAAC,iBAAiB,CAAC;IACnC,CAAC;IACM,MAAM,KAAK,gBAAgB,CAAC,EAAoB;QACrD,OAAO,CAAC,iBAAiB,GAAG,EAAE,CAAC;IACjC,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,kDAAkD;IACtF,CAAC;IAEM,kBAAkB,CAAC,OAAgB;QACxC,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7D,CAAC;IAED,gBAAgB;IACT,aAAa,KAAK,CAAC;IAE1B,uCAAuC;IACvC,IAAW,cAAc,KAAiB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAElE,kCAAkC;IAC3B,WAAW,CAAC,CAAS,EAAE,CAAS,IAAgB,OAAO,EAAE,CAAC,EAAE,CAA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c,EAAE,QAAiB,EAAE,GAAW,EACzG,cAA4B;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yCAAyC;IAClC,WAAW,CAAC,SAAiB,IAAa,OAAO,KAAK,CAAC,CAAC,CAAC;;AAjBhE,sBAAsB;AACC,wBAAgB,GAAG,IAAI,cAAc,EAAE,AAAvB,CAAwB;AA/NpD,0BAAO","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UiAdmin\n */\n\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport { AbstractMenuItemProps } from \"./items/AbstractMenuItemProps\";\nimport { AbstractToolbarProps } from \"./items/AbstractToolbarProps\";\nimport { RelativePosition } from \"./items/RelativePosition\";\nimport { PropertyDescription } from \"./properties/Description\";\nimport { Primitives } from \"./properties/PrimitiveTypes\";\nimport { OnCancelFunc, OnItemExecutedFunc, OnNumberCommitFunc, OnValueCommitFunc } from \"./utils/callbacks\";\nimport { PropertyRecord } from \"./properties/Record\";\nimport { UiDataProvider } from \"./dialogs/UiDataProvider\";\nimport { DialogLayoutDataProvider } from \"./dialogs/UiLayoutDataProvider\";\nimport { PointProps } from \"./utils/PointProps\";\nimport { loggerCategory } from \"./utils/misc\";\nimport { MessagePresenter } from \"./notification/MessagePresenter\";\nimport { UiError } from \"./utils/UiError\";\n\n/** The Generic UI Event args contains information useful for any UI message\n * @public\n */\nexport interface GenericUiEventArgs {\n uiComponentId: string;\n}\n\n/** Optional props to pass to the Dialog control that is generated.\n * @public\n */\nexport interface DialogProps {\n /** Indicates whether the user can resize dialog with cursor. */\n resizable?: boolean;\n /** Indicates whether the user can move dialog with cursor.*/\n movable?: boolean;\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n width?: string | number;\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n height?: string | number;\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n minWidth?: string | number;\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n minHeight?: string | number;\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxWidth?: string | number;\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxHeight?: string | number;\n}\n\n/** The GenericUiEvent is the base event class for UI events that target a specific component, as identified in uiComponentId.\n * @public\n */\nexport class GenericUiEvent extends BeUiEvent<GenericUiEventArgs> { }\n\n/** Flags that control enabling/disabling certain UI features\n * @public\n */\nexport interface UiFlags {\n /** if true then Ctrl+F2 will show popup key-in palette */\n allowKeyinPalette?: boolean;\n}\n\n/** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.\n * @public\n */\nexport class UiAdmin {\n private _featureFlags: UiFlags = {};\n private static _messagePresenter?: MessagePresenter;\n\n /** The MessagePresenter used to display messages. */\n public static get messagePresenter(): MessagePresenter {\n if (!UiAdmin._messagePresenter)\n throw new UiError(loggerCategory(this), \"UiAdmin.messagePresenter not set\");\n return UiAdmin._messagePresenter;\n }\n public static set messagePresenter(mp: MessagePresenter) {\n UiAdmin._messagePresenter = mp;\n }\n\n public get featureFlags(): UiFlags {\n return { ...this._featureFlags }; // return copy so no direct access to modify value\n }\n\n public updateFeatureFlags(uiFlags: UiFlags) {\n this._featureFlags = { ...this._featureFlags, ...uiFlags };\n }\n\n /** @internal */\n public onInitialized() { }\n\n /** Get the cursor X and Y position. */\n public get cursorPosition(): PointProps { return { x: 0, y: 0 }; }\n\n /** Create a PointProps object. */\n public createXAndY(x: number, y: number): PointProps { return { x, y }; }\n\n /** Determines if focus is set to Home */\n public get isFocusOnHome(): boolean { return false; }\n\n /** Sets focus to Home */\n public setFocusToHome(): void { }\n\n /** Show a context menu at a particular location.\n * @param _menuItemsProps Properties of the menu items to display.\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public showContextMenu(_menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show a Toolbar at a particular location.\n * @param _toolbarProps Properties of the Toolbar to display.\n * @param _location Location of the Toolbar, relative to the origin of htmlElement or the window.\n * @param _offset Offset of the Toolbar from the location.\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public showToolbar(\n _toolbarProps: AbstractToolbarProps, _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the toolbar. */\n public hideToolbar(): boolean { return false; }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\n * @param _menuItemsProps Properties of the menu items to display.\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the button was displayed, false if the button could not be displayed.\n */\n public showMenuButton(_id: string, _menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides a menu button.\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public hideMenuButton(_id: string): boolean { return false; }\n\n /** Show a calculator at a particular location.\n * @param _initialValue Value initially displayed in the calculator.\n * @param _resultIcon Icon displayed to the left of the value.\n * @param _location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the calculator was displayed, false if the calculator could not be displayed.\n */\n public showCalculator(_initialValue: number, _resultIcon: string, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the calculator. */\n public hideCalculator(): boolean { return false; }\n\n /** Show an input editor for an angle value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showAngleEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showLengthEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showHeightEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _propertyDescription Description of the primitive value property.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showInputEditor(_initialValue: Primitives.Value, _propertyDescription: PropertyDescription, _location: PointProps, _onCommit: OnValueCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the input editor. */\n public hideInputEditor(): boolean { return false; }\n\n /** Show an HTML element at a particular location.\n * @param _displayElement The HTMLElement to display\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param _offset Offset of the display element from the location\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public showHTMLElement(\n _displayElement: HTMLElement, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the HTML Element. */\n public hideHTMLElement(): boolean { return false; }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param _content The HTMLElement of the content to display\n * @param _title Title to display at the top of the card.\n * @param _toolbarProps Properties of the Toolbar to display.\n * @param _location Location of the Card, relative to the origin of anchorElement or the window.\n * @param _offset Offset of the Card from the location.\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showCard(\n _content: HTMLElement, _title: string | PropertyRecord | undefined, _toolbarProps: AbstractToolbarProps | undefined,\n _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the Card. */\n public hideCard(): boolean { return false; }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param _dataProvider The UiDataProvider for the tool settings\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param _offset Offset of the tool settings from the location\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public openToolSettingsPopup(\n _dataProvider: UiDataProvider, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Closes the Tool Settings Ui popup. */\n public closeToolSettingsPopup(): boolean { return false; }\n\n /** Show the Keyin Palette to display all support Tool key-ins.\n * @param _htmlElement The HTMLElement that anchors the Keyin Palette. If undefined, the location is relative to the overall window.\n * @return true if the Keyin Palette was displayed, false if it could not be displayed.\n */\n public showKeyinPalette(_htmlElement?: HTMLElement): boolean { return false; }\n\n /** Hides the Keyin Palette. */\n public hideKeyinPalette(): boolean { return false; }\n\n /** Send a UI event */\n public static sendUiEvent(args: GenericUiEventArgs) {\n UiAdmin.onGenericUiEvent.emit(args);\n }\n /** GenericUiEvent */\n public static readonly onGenericUiEvent = new GenericUiEvent();\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param _uiDataProvider The DialogLayoutDataProvider for the dialog\n * @param _title Specify title for dialog.\n * @param _isModal Specify if the dialog is opened as a modal or modeless.\n * @param _id Id of the dialog that is used to close it.\n * @param _optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public openDialog(_uiDataProvider: DialogLayoutDataProvider, _title: string, _isModal: boolean, _id: string,\n _optionalProps?: DialogProps): boolean {\n return false;\n }\n\n /** Closes the Dialog with a given Id. */\n public closeDialog(_dialogId: string): boolean { return false; }\n}\n"]}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
/** @packageDocumentation
|
2
|
+
* @module UiItemsProvider
|
3
|
+
*/
|
4
|
+
import { BeEvent, MarkRequired } from "@itwin/core-bentley";
|
5
|
+
import { BackstageItem } from "./backstage/BackstageItem";
|
6
|
+
import { CommonStatusBarItem } from "./statusbar/StatusBarItem";
|
7
|
+
import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem";
|
8
|
+
import { AbstractWidgetProps } from "./widget/AbstractWidgetProps";
|
9
|
+
import { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from "./widget/StagePanel";
|
10
|
+
import { UiItemsProvider } from "./UiItemsProvider";
|
11
|
+
/** Action taken by the application on item provided by a UiItemsProvider
|
12
|
+
* @public @deprecated in 3.2. This was only used by the previously removed UiItemsArbiter.
|
13
|
+
*/
|
14
|
+
export declare enum UiItemsApplicationAction {
|
15
|
+
/** Allow the change to the item */
|
16
|
+
Allow = 0,
|
17
|
+
/** Disallow the change to the item */
|
18
|
+
Disallow = 1,
|
19
|
+
/** Update the item during the change */
|
20
|
+
Update = 2
|
21
|
+
}
|
22
|
+
/** UIProvider Registered Event Args interface.
|
23
|
+
* @deprecated in 3.6. Use [UiItemsProviderRegisteredEventArgs]($appui-react) instead.
|
24
|
+
* @public
|
25
|
+
*/
|
26
|
+
export interface UiItemProviderRegisteredEventArgs {
|
27
|
+
providerId: string;
|
28
|
+
}
|
29
|
+
/** UiItemProviderOverrides allows the application that registers a provider to limit when it is allowed to provide items
|
30
|
+
* @deprecated in 3.6. Use [AllowedUiItemsProviderOverrides]($appui-react) instead.
|
31
|
+
* @public
|
32
|
+
*/
|
33
|
+
export interface AllowedUiItemProviderOverrides {
|
34
|
+
/** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages
|
35
|
+
* @beta
|
36
|
+
*/
|
37
|
+
providerId?: string;
|
38
|
+
/** if specified then the current stage's Usage will be compared before allowing any items to be provided
|
39
|
+
* @beta
|
40
|
+
*/
|
41
|
+
stageUsages?: string[];
|
42
|
+
/** if specified then the current stage's Id will be compared before allowing any items to be provided
|
43
|
+
* @beta
|
44
|
+
*/
|
45
|
+
stageIds?: string[];
|
46
|
+
}
|
47
|
+
/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.
|
48
|
+
* Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's
|
49
|
+
* items are allowed.
|
50
|
+
* @deprecated in 3.6. Use [UiItemsProviderOverrides]($appui-react) instead.
|
51
|
+
* @public
|
52
|
+
*/
|
53
|
+
export type UiItemProviderOverrides = MarkRequired<AllowedUiItemProviderOverrides, "providerId" | "stageUsages"> | MarkRequired<AllowedUiItemProviderOverrides, "providerId" | "stageIds"> | // eslint-disable-line @typescript-eslint/indent
|
54
|
+
MarkRequired<AllowedUiItemProviderOverrides, "stageIds"> | // eslint-disable-line @typescript-eslint/indent
|
55
|
+
MarkRequired<AllowedUiItemProviderOverrides, "stageUsages"> | // eslint-disable-line @typescript-eslint/indent
|
56
|
+
MarkRequired<AllowedUiItemProviderOverrides, "providerId" | "stageUsages" | "stageIds">;
|
57
|
+
/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.
|
58
|
+
* @deprecated in 3.6. Use [UiItemsManager]($appui-react) instead.
|
59
|
+
* @public
|
60
|
+
*/
|
61
|
+
export declare class UiItemsManager {
|
62
|
+
private static _registeredUiItemsProviders;
|
63
|
+
/** For use in unit testing
|
64
|
+
* @internal */
|
65
|
+
static clearAllProviders(): void;
|
66
|
+
/** Event raised any time a UiProvider is registered or unregistered. */
|
67
|
+
static readonly onUiProviderRegisteredEvent: BeEvent<(ev: UiItemProviderRegisteredEventArgs) => void>;
|
68
|
+
/** Return number of registered UiProvider. */
|
69
|
+
static get registeredProviderIds(): string[];
|
70
|
+
/** Return true if there is any registered UiProvider. */
|
71
|
+
static get hasRegisteredProviders(): boolean;
|
72
|
+
/**
|
73
|
+
* Retrieves a previously loaded UiItemsProvider.
|
74
|
+
* @param providerId id of the UiItemsProvider to get
|
75
|
+
*/
|
76
|
+
static getUiItemsProvider(providerId: string): UiItemsProvider | undefined;
|
77
|
+
private static sendRegisteredEvent;
|
78
|
+
/**
|
79
|
+
* Registers a UiItemsProvider with the UiItemsManager.
|
80
|
+
* @param uiProvider the UI items provider to register.
|
81
|
+
*/
|
82
|
+
static register(uiProvider: UiItemsProvider, overrides?: UiItemProviderOverrides): void;
|
83
|
+
/** Remove a specific UiItemsProvider from the list of available providers. */
|
84
|
+
static unregister(uiProviderId: string): void;
|
85
|
+
private static allowItemsFromProvider;
|
86
|
+
/** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute
|
87
|
+
* an action or specify a registered ToolId into toolbar.
|
88
|
+
* @param stageId a string identifier the active stage.
|
89
|
+
* @param stageUsage the StageUsage of the active stage.
|
90
|
+
* @param toolbarUsage usage of the toolbar
|
91
|
+
* @param toolbarOrientation orientation of the toolbar
|
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
|
+
*/
|
94
|
+
static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[];
|
95
|
+
/** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
|
96
|
+
* @param stageId a string identifier the active stage.
|
97
|
+
* @param stageUsage the StageUsage of the active stage.
|
98
|
+
* @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.
|
99
|
+
*/
|
100
|
+
static getStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[];
|
101
|
+
/** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
|
102
|
+
* @returns An array of BackstageItem that will be used to create controls for the backstage menu.
|
103
|
+
*/
|
104
|
+
static getBackstageItems(): BackstageItem[];
|
105
|
+
/** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets
|
106
|
+
* @param stageId a string identifier the active stage.
|
107
|
+
* @param stageUsage the StageUsage of the active stage.
|
108
|
+
* @param location the location within the stage.
|
109
|
+
* @param section the section within location.
|
110
|
+
* @returns An array of AbstractWidgetProps that will be used to create widgets.
|
111
|
+
*/
|
112
|
+
static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps>;
|
113
|
+
}
|
114
|
+
//# sourceMappingURL=UiItemsManager.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"UiItemsManager.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAU,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpE,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,8B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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,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE;IAsBlF;;;;OAIG;WACW,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAwB/G;;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,EAAE,YAAY,CAAC,EAAE,oBAAoB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAuBtN"}
|
@@ -0,0 +1,194 @@
|
|
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
|
+
/* eslint-disable deprecation/deprecation */
|
7
|
+
/** @packageDocumentation
|
8
|
+
* @module UiItemsProvider
|
9
|
+
*/
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
11
|
+
exports.UiItemsManager = exports.UiItemsApplicationAction = void 0;
|
12
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
13
|
+
const misc_1 = require("./utils/misc");
|
14
|
+
/** Action taken by the application on item provided by a UiItemsProvider
|
15
|
+
* @public @deprecated in 3.2. This was only used by the previously removed UiItemsArbiter.
|
16
|
+
*/
|
17
|
+
var UiItemsApplicationAction;
|
18
|
+
(function (UiItemsApplicationAction) {
|
19
|
+
/** Allow the change to the item */
|
20
|
+
UiItemsApplicationAction[UiItemsApplicationAction["Allow"] = 0] = "Allow";
|
21
|
+
/** Disallow the change to the item */
|
22
|
+
UiItemsApplicationAction[UiItemsApplicationAction["Disallow"] = 1] = "Disallow";
|
23
|
+
/** Update the item during the change */
|
24
|
+
UiItemsApplicationAction[UiItemsApplicationAction["Update"] = 2] = "Update";
|
25
|
+
})(UiItemsApplicationAction = exports.UiItemsApplicationAction || (exports.UiItemsApplicationAction = {}));
|
26
|
+
/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.
|
27
|
+
* @deprecated in 3.6. Use [UiItemsManager]($appui-react) instead.
|
28
|
+
* @public
|
29
|
+
*/
|
30
|
+
class UiItemsManager {
|
31
|
+
/** For use in unit testing
|
32
|
+
* @internal */
|
33
|
+
static clearAllProviders() {
|
34
|
+
UiItemsManager._registeredUiItemsProviders.clear();
|
35
|
+
}
|
36
|
+
/** Return number of registered UiProvider. */
|
37
|
+
static get registeredProviderIds() {
|
38
|
+
const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];
|
39
|
+
return ids;
|
40
|
+
}
|
41
|
+
/** Return true if there is any registered UiProvider. */
|
42
|
+
static get hasRegisteredProviders() {
|
43
|
+
return this._registeredUiItemsProviders.size > 0;
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* Retrieves a previously loaded UiItemsProvider.
|
47
|
+
* @param providerId id of the UiItemsProvider to get
|
48
|
+
*/
|
49
|
+
static getUiItemsProvider(providerId) {
|
50
|
+
return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;
|
51
|
+
}
|
52
|
+
static sendRegisteredEvent(ev) {
|
53
|
+
UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(ev);
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
* Registers a UiItemsProvider with the UiItemsManager.
|
57
|
+
* @param uiProvider the UI items provider to register.
|
58
|
+
*/
|
59
|
+
static register(uiProvider, overrides) {
|
60
|
+
const providerId = overrides?.providerId ?? uiProvider.id;
|
61
|
+
if (UiItemsManager.getUiItemsProvider(providerId)) {
|
62
|
+
core_bentley_1.Logger.logInfo((0, misc_1.loggerCategory)(this), `UiItemsProvider (${providerId}) is already loaded`);
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });
|
66
|
+
core_bentley_1.Logger.logInfo((0, misc_1.loggerCategory)(this), `UiItemsProvider ${uiProvider.id} registered as ${providerId} `);
|
67
|
+
UiItemsManager.sendRegisteredEvent({ providerId });
|
68
|
+
}
|
69
|
+
}
|
70
|
+
/** Remove a specific UiItemsProvider from the list of available providers. */
|
71
|
+
static unregister(uiProviderId) {
|
72
|
+
const provider = UiItemsManager.getUiItemsProvider(uiProviderId);
|
73
|
+
if (!provider)
|
74
|
+
return;
|
75
|
+
provider.onUnregister && provider.onUnregister();
|
76
|
+
UiItemsManager._registeredUiItemsProviders.delete(uiProviderId);
|
77
|
+
core_bentley_1.Logger.logInfo((0, misc_1.loggerCategory)(this), `UiItemsProvider (${uiProviderId}) unloaded`);
|
78
|
+
// trigger a refresh of the ui
|
79
|
+
UiItemsManager.sendRegisteredEvent({ providerId: uiProviderId });
|
80
|
+
}
|
81
|
+
static allowItemsFromProvider(entry, stageId, stageUsage) {
|
82
|
+
// istanbul ignore else
|
83
|
+
const overrides = entry.overrides;
|
84
|
+
if (undefined !== stageId && overrides?.stageIds && !(overrides.stageIds.some((value) => value === stageId)))
|
85
|
+
return false;
|
86
|
+
if (undefined !== stageUsage && overrides?.stageUsages && !(overrides.stageUsages.some((value) => value === stageUsage)))
|
87
|
+
return false;
|
88
|
+
return true;
|
89
|
+
}
|
90
|
+
/** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute
|
91
|
+
* an action or specify a registered ToolId into toolbar.
|
92
|
+
* @param stageId a string identifier the active stage.
|
93
|
+
* @param stageUsage the StageUsage of the active stage.
|
94
|
+
* @param toolbarUsage usage of the toolbar
|
95
|
+
* @param toolbarOrientation orientation of the toolbar
|
96
|
+
* @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.
|
97
|
+
*/
|
98
|
+
static getToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) {
|
99
|
+
const buttonItems = [];
|
100
|
+
if (0 === UiItemsManager._registeredUiItemsProviders.size)
|
101
|
+
return buttonItems;
|
102
|
+
UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
|
103
|
+
const uiProvider = entry.provider;
|
104
|
+
const providerId = entry.overrides?.providerId ?? uiProvider.id;
|
105
|
+
// istanbul ignore else
|
106
|
+
if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
|
107
|
+
uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)
|
108
|
+
.forEach((spec) => {
|
109
|
+
// ignore duplicate ids
|
110
|
+
if (-1 === buttonItems.findIndex((existingItem) => spec.id === existingItem.id))
|
111
|
+
buttonItems.push({ ...spec, providerId });
|
112
|
+
});
|
113
|
+
}
|
114
|
+
});
|
115
|
+
return buttonItems;
|
116
|
+
}
|
117
|
+
/** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
|
118
|
+
* @param stageId a string identifier the active stage.
|
119
|
+
* @param stageUsage the StageUsage of the active stage.
|
120
|
+
* @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.
|
121
|
+
*/
|
122
|
+
static getStatusBarItems(stageId, stageUsage, stageAppData) {
|
123
|
+
const statusBarItems = [];
|
124
|
+
if (0 === UiItemsManager._registeredUiItemsProviders.size)
|
125
|
+
return statusBarItems;
|
126
|
+
UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
|
127
|
+
const uiProvider = entry.provider;
|
128
|
+
const providerId = entry.overrides?.providerId ?? uiProvider.id;
|
129
|
+
// istanbul ignore else
|
130
|
+
if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
|
131
|
+
uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)
|
132
|
+
.forEach((item) => {
|
133
|
+
// ignore duplicate ids
|
134
|
+
if (-1 === statusBarItems.findIndex((existingItem) => item.id === existingItem.id))
|
135
|
+
statusBarItems.push({ ...item, providerId });
|
136
|
+
});
|
137
|
+
}
|
138
|
+
});
|
139
|
+
return statusBarItems;
|
140
|
+
}
|
141
|
+
/** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields
|
142
|
+
* @returns An array of BackstageItem that will be used to create controls for the backstage menu.
|
143
|
+
*/
|
144
|
+
static getBackstageItems() {
|
145
|
+
const backstageItems = [];
|
146
|
+
if (0 === UiItemsManager._registeredUiItemsProviders.size)
|
147
|
+
return backstageItems;
|
148
|
+
UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
|
149
|
+
const uiProvider = entry.provider;
|
150
|
+
const providerId = entry.overrides?.providerId ?? uiProvider.id;
|
151
|
+
// istanbul ignore else
|
152
|
+
if (uiProvider.provideBackstageItems) { // Note: We do not call this.allowItemsFromProvider here as backstage items
|
153
|
+
uiProvider.provideBackstageItems() // should not be considered stage specific. If they need to be hidden
|
154
|
+
.forEach((item) => {
|
155
|
+
// ignore duplicate ids
|
156
|
+
if (-1 === backstageItems.findIndex((existingItem) => item.id === existingItem.id))
|
157
|
+
backstageItems.push({ ...item, providerId });
|
158
|
+
});
|
159
|
+
}
|
160
|
+
});
|
161
|
+
return backstageItems;
|
162
|
+
}
|
163
|
+
/** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets
|
164
|
+
* @param stageId a string identifier the active stage.
|
165
|
+
* @param stageUsage the StageUsage of the active stage.
|
166
|
+
* @param location the location within the stage.
|
167
|
+
* @param section the section within location.
|
168
|
+
* @returns An array of AbstractWidgetProps that will be used to create widgets.
|
169
|
+
*/
|
170
|
+
static getWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData) {
|
171
|
+
const widgets = [];
|
172
|
+
if (0 === UiItemsManager._registeredUiItemsProviders.size)
|
173
|
+
return widgets;
|
174
|
+
UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
|
175
|
+
const uiProvider = entry.provider;
|
176
|
+
const providerId = entry.overrides?.providerId ?? uiProvider.id;
|
177
|
+
// istanbul ignore else
|
178
|
+
if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
|
179
|
+
uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)
|
180
|
+
.forEach((widget) => {
|
181
|
+
// ignore duplicate ids
|
182
|
+
if (-1 === widgets.findIndex((existingItem) => widget.id === existingItem.id))
|
183
|
+
widgets.push({ ...widget, providerId });
|
184
|
+
});
|
185
|
+
}
|
186
|
+
});
|
187
|
+
return widgets;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
UiItemsManager._registeredUiItemsProviders = new Map();
|
191
|
+
/** Event raised any time a UiProvider is registered or unregistered. */
|
192
|
+
UiItemsManager.onUiProviderRegisteredEvent = new core_bentley_1.BeEvent();
|
193
|
+
exports.UiItemsManager = UiItemsManager;
|
194
|
+
//# sourceMappingURL=UiItemsManager.js.map
|
@@ -0,0 +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,wBAA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,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;;AA9Lc,0CAA2B,GAAqC,IAAI,GAAG,EAA+B,CAAC;AAQtH,wEAAwE;AACjD,0CAA2B,GAAG,IAAI,sBAAO,EAAmD,CAAC;AAVzG,wCAAc","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable deprecation/deprecation */\n/** @packageDocumentation\n * @module UiItemsProvider\n */\n\nimport { BeEvent, Logger, MarkRequired } from \"@itwin/core-bentley\";\nimport { BackstageItem } from \"./backstage/BackstageItem\";\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\nimport { loggerCategory } from \"./utils/misc\";\nimport { UiItemsProvider } from \"./UiItemsProvider\";\n\n/** Action taken by the application on item provided by a UiItemsProvider\n * @public @deprecated in 3.2. This was only used by the previously removed UiItemsArbiter.\n */\nexport enum UiItemsApplicationAction {\n /** Allow the change to the item */\n Allow,\n /** Disallow the change to the item */\n Disallow,\n /** Update the item during the change */\n Update,\n}\n\n/** UIProvider Registered Event Args interface.\n * @deprecated in 3.6. Use [UiItemsProviderRegisteredEventArgs]($appui-react) instead.\n * @public\n */\nexport interface UiItemProviderRegisteredEventArgs {\n providerId: string;\n}\n\n/** UiItemProviderOverrides allows the application that registers a provider to limit when it is allowed to provide items\n * @deprecated in 3.6. Use [AllowedUiItemsProviderOverrides]($appui-react) instead.\n * @public\n */\nexport interface AllowedUiItemProviderOverrides {\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages\n * @beta\n */\n providerId?: string;\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided\n * @beta\n */\n stageUsages?: string[];\n /** if specified then the current stage's Id will be compared before allowing any items to be provided\n * @beta\n */\n stageIds?: string[];\n}\n\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\n * items are allowed.\n * @deprecated in 3.6. Use [UiItemsProviderOverrides]($appui-react) instead.\n * @public\n */\nexport type UiItemProviderOverrides = MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\n MarkRequired<AllowedUiItemProviderOverrides, \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\n MarkRequired<AllowedUiItemProviderOverrides, \"stageUsages\"> | // eslint-disable-line @typescript-eslint/indent\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\" | \"stageIds\">; // eslint-disable-line @typescript-eslint/indent\n\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\ninterface UiItemProviderEntry {\n provider: UiItemsProvider;\n overrides?: UiItemProviderOverrides;\n}\n\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\n * @deprecated in 3.6. Use [UiItemsManager]($appui-react) instead.\n * @public\n */\nexport class UiItemsManager {\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> = new Map<string, UiItemProviderEntry>();\n\n /** For use in unit testing\n * @internal */\n public static clearAllProviders() {\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n public static readonly onUiProviderRegisteredEvent = new BeEvent<(ev: UiItemProviderRegisteredEventArgs) => void>();\n\n /** Return number of registered UiProvider. */\n public static get registeredProviderIds() {\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\n return ids;\n }\n\n /** Return true if there is any registered UiProvider. */\n public static get hasRegisteredProviders(): boolean {\n return this._registeredUiItemsProviders.size > 0;\n }\n\n /**\n * Retrieves a previously loaded UiItemsProvider.\n * @param providerId id of the UiItemsProvider to get\n */\n public static getUiItemsProvider(providerId: string): UiItemsProvider | undefined {\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\n }\n\n private static sendRegisteredEvent(ev: UiItemProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(ev);\n }\n\n /**\n * Registers a UiItemsProvider with the UiItemsManager.\n * @param uiProvider the UI items provider to register.\n */\n public static register(uiProvider: UiItemsProvider, overrides?: UiItemProviderOverrides): void {\n const providerId = overrides?.providerId ?? uiProvider.id;\n\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${providerId}) is already loaded`);\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });\n Logger.logInfo(loggerCategory(this), `UiItemsProvider ${uiProvider.id} registered as ${providerId} `);\n\n UiItemsManager.sendRegisteredEvent({ providerId } as UiItemProviderRegisteredEventArgs);\n }\n }\n\n /** Remove a specific UiItemsProvider from the list of available providers. */\n public static unregister(uiProviderId: string): void {\n const provider = UiItemsManager.getUiItemsProvider(uiProviderId);\n if (!provider)\n return;\n\n provider.onUnregister && provider.onUnregister();\n\n UiItemsManager._registeredUiItemsProviders.delete(uiProviderId);\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProviderId}) unloaded`);\n\n // trigger a refresh of the ui\n UiItemsManager.sendRegisteredEvent({ providerId: uiProviderId } as UiItemProviderRegisteredEventArgs);\n }\n\n private static allowItemsFromProvider(entry: UiItemProviderEntry, stageId?: string, stageUsage?: string) {\n // istanbul ignore else\n const overrides = entry.overrides;\n if (undefined !== stageId && overrides?.stageIds && !(overrides.stageIds.some((value: string) => value === stageId)))\n return false;\n if (undefined !== stageUsage && overrides?.stageUsages && !(overrides.stageUsages.some((value: string) => value === stageUsage)))\n return false;\n return true;\n }\n\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\n * an action or specify a registered ToolId into toolbar.\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param toolbarUsage usage of the toolbar\n * @param toolbarOrientation orientation of the toolbar\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.\n */\n public static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\n const buttonItems: CommonToolbarItem[] = [];\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return buttonItems;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n // istanbul ignore else\n if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\n uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)\n .forEach((spec: CommonToolbarItem) => {\n // ignore duplicate ids\n if (-1 === buttonItems.findIndex((existingItem)=> spec.id === existingItem.id ))\n buttonItems.push({ ...spec, providerId });\n });\n }\n });\n\n return buttonItems;\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\n */\n public static getStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\n const statusBarItems: CommonStatusBarItem[] = [];\n\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return statusBarItems;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\n uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)\n .forEach((item: CommonStatusBarItem) => {\n // ignore duplicate ids\n if (-1 === statusBarItems.findIndex((existingItem)=> item.id === existingItem.id ))\n statusBarItems.push({ ...item, providerId });\n });\n }\n });\n\n return statusBarItems;\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\n */\n public static getBackstageItems(): BackstageItem[] {\n const backstageItems: BackstageItem[] = [];\n\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return backstageItems;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (uiProvider.provideBackstageItems) { // Note: We do not call this.allowItemsFromProvider here as backstage items\n uiProvider.provideBackstageItems() // should not be considered stage specific. If they need to be hidden\n .forEach((item: BackstageItem) => { // the isHidden property should be set to a ConditionalBooleanValue\n // ignore duplicate ids\n if (-1 === backstageItems.findIndex((existingItem)=> item.id === existingItem.id ))\n backstageItems.push({ ...item, providerId });\n });\n }\n });\n return backstageItems;\n }\n\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param location the location within the stage.\n * @param section the section within location.\n * @returns An array of AbstractWidgetProps that will be used to create widgets.\n */\n public static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\n const widgets: AbstractWidgetProps[] = [];\n\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return widgets;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\n uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)\n .forEach((widget: AbstractWidgetProps) => {\n // ignore duplicate ids\n if (-1 === widgets.findIndex((existingItem)=> widget.id === existingItem.id ))\n widgets.push({ ...widget, providerId });\n });\n }\n });\n return widgets;\n }\n\n}\n"]}
|