@itwin/appui-abstract 5.0.0-dev.4 → 5.0.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/lib/cjs/appui-abstract/UiAdmin.js +2 -2
  3. package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
  4. package/lib/cjs/appui-abstract/UiItemsManager.js +3 -3
  5. package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
  6. package/lib/cjs/appui-abstract/backstage/BackstageItem.js +24 -24
  7. package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +1 -1
  8. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js +91 -91
  9. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  10. package/lib/cjs/appui-abstract/dialogs/DialogItem.d.ts +0 -4
  11. package/lib/cjs/appui-abstract/dialogs/DialogItem.d.ts.map +1 -1
  12. package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
  13. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js +7 -7
  14. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  15. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js +14 -14
  16. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  17. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js +14 -14
  18. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  19. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js +3 -3
  20. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  21. package/lib/esm/appui-abstract/UiAdmin.js +2 -2
  22. package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
  23. package/lib/esm/appui-abstract/UiItemsManager.js +3 -3
  24. package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
  25. package/lib/esm/appui-abstract/backstage/BackstageItem.js +24 -24
  26. package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +1 -1
  27. package/lib/esm/appui-abstract/content/StandardContentLayouts.js +91 -91
  28. package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  29. package/lib/esm/appui-abstract/dialogs/DialogItem.d.ts +0 -4
  30. package/lib/esm/appui-abstract/dialogs/DialogItem.d.ts.map +1 -1
  31. package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
  32. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js +7 -7
  33. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  34. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js +14 -14
  35. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  36. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js +14 -14
  37. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  38. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js +3 -3
  39. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  40. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"DialogItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/DialogItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAyDH;;GAEG;AACH,MAAa,cAAc;IACzB,YAAmB,WAAgC,EAAU,MAAS,EAAU,aAAsB,EAAU,WAAqB;QAAlH,gBAAW,GAAX,WAAW,CAAqB;QAAU,WAAM,GAAN,MAAM,CAAG;QAAU,kBAAa,GAAb,aAAa,CAAS;QAAU,gBAAW,GAAX,WAAW,CAAU;IAAI,CAAC;IAE1I,IAAW,UAAU;QACnB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,GAAY;QAChC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,C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AC,eAAe,EAAE,CAAC;IAClE,CAAC;IAEM,YAAY,CAAC,cAA8B,EAAE,YAAyB;QAC3E,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC;IACjI,CAAC;CACF;AA3DD,wCA2DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 Dialog\n */\n\nimport { PropertyDescription } from \"../properties/Description\";\n\n/** [[DialogItemValue]] Interface of PrimitiveValue types that have type editor support for use in dialogs.\n * @public\n */\nexport interface DialogItemValue {\n value?: number | string | boolean | Date;\n displayValue?: string;\n}\n/** [[EditorPosition]] Interface used to identify the location of the item a DialogItem property value.\n * @public\n */\nexport interface EditorPosition {\n /** Determine the order the row is shown in UI */\n rowPriority: number;\n /** Determines the column position for the type editor */\n columnIndex: number;\n /** Number of columns to occupy. Defaults to 1\n * @deprecated in 2.19. No longer necessary, ignored.\n */\n columnSpan?: number;\n}\n\n/** [[BaseDialogItem]] contains only the members necessary to create a PropertyRecord.\n * @public\n */\nexport interface BaseDialogItem {\n readonly value: DialogItemValue;\n readonly property: PropertyDescription;\n readonly isDisabled?: boolean;\n}\n/** [[DialogItem]] is the specification that the display engine turns into a UI item.\n * @public\n */\nexport interface DialogItem extends BaseDialogItem {\n readonly editorPosition: EditorPosition;\n readonly lockProperty?: BaseDialogItem;\n}\n\n/** [[DialogPropertyItem]] us the specification to use if you are defining the components directly, e.g., in React\n * @public\n */\nexport interface DialogPropertyItem {\n readonly value: DialogItemValue;\n readonly propertyName: string;\n}\n\n/** [[DialogPropertySyncItem]] is used to pass sync messages for DialogPropertyItems\n * @public\n */\nexport interface DialogPropertySyncItem extends DialogPropertyItem {\n readonly isDisabled?: boolean;\n readonly property?: PropertyDescription;\n}\n\n/** [[DialogProperty]] is a generic helper class that assists working with properties used by UiLayoutDataProvider implementations (i.e. Tool Settings and Dynamic Dialogs).\n * @public\n */\nexport class DialogProperty<T> {\n constructor(public description: PropertyDescription, private _value: T, private _displayValue?: string, private _isDisabled?: boolean) { }\n\n public get isDisabled() {\n return !!this._isDisabled;\n }\n\n public set isDisabled(val: boolean) {\n this._isDisabled = val;\n }\n\n public get value() {\n return this._value;\n }\n\n public set value(val: T) {\n this._value = val;\n }\n\n public get name() {\n return this.description.name;\n }\n\n public set displayValue(val: string | undefined) {\n this._displayValue = val;\n }\n\n public get displayValue() {\n return this._displayValue;\n }\n\n public get dialogItemValue() {\n // istanbul ignore else\n if (typeof this._value === \"string\" || typeof this._value === \"number\" || typeof this._value === \"undefined\" || typeof this._value === \"boolean\" || this._value instanceof Date)\n return {\n value: this._value,\n displayValue: this._displayValue,\n } as DialogItemValue;\n // istanbul ignore next\n throw new Error(\"Not valid primitive type\");\n }\n\n public set dialogItemValue(val: DialogItemValue) {\n this._value = val.value as unknown as T;\n this._displayValue = val.displayValue;\n }\n\n public get syncItem(): DialogPropertySyncItem {\n const isDisabled = this._isDisabled;\n return { propertyName: this.name, value: this.dialogItemValue, isDisabled };\n }\n\n public get item(): DialogPropertyItem {\n return { propertyName: this.name, value: this.dialogItemValue };\n }\n\n public toDialogItem(editorPosition: EditorPosition, lockProperty?: DialogItem): DialogItem {\n return { value: this.dialogItemValue, property: this.description, editorPosition, isDisabled: this._isDisabled, lockProperty };\n }\n}\n"]}
1
+ {"version":3,"file":"DialogItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/DialogItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAqDH;;GAEG;AACH,MAAa,cAAc;IACzB,YAAmB,WAAgC,EAAU,MAAS,EAAU,aAAsB,EAAU,WAAqB;QAAlH,gBAAW,GAAX,WAAW,CAAqB;QAA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QACjB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9E,CAAC;IAED,IAAW,IAAI;QACb,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;IAClE,CAAC;IAEM,YAAY,CAAC,cAA8B,EAAE,YAAyB;QAC3E,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC;IACjI,CAAC;CACF;AA3DD,wCA2DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 Dialog\n */\n\nimport { PropertyDescription } from \"../properties/Description\";\n\n/** [[DialogItemValue]] Interface of PrimitiveValue types that have type editor support for use in dialogs.\n * @public\n */\nexport interface DialogItemValue {\n value?: number | string | boolean | Date;\n displayValue?: string;\n}\n/** [[EditorPosition]] Interface used to identify the location of the item a DialogItem property value.\n * @public\n */\nexport interface EditorPosition {\n /** Determine the order the row is shown in UI */\n rowPriority: number;\n /** Determines the column position for the type editor */\n columnIndex: number;\n}\n\n/** [[BaseDialogItem]] contains only the members necessary to create a PropertyRecord.\n * @public\n */\nexport interface BaseDialogItem {\n readonly value: DialogItemValue;\n readonly property: PropertyDescription;\n readonly isDisabled?: boolean;\n}\n/** [[DialogItem]] is the specification that the display engine turns into a UI item.\n * @public\n */\nexport interface DialogItem extends BaseDialogItem {\n readonly editorPosition: EditorPosition;\n readonly lockProperty?: BaseDialogItem;\n}\n\n/** [[DialogPropertyItem]] us the specification to use if you are defining the components directly, e.g., in React\n * @public\n */\nexport interface DialogPropertyItem {\n readonly value: DialogItemValue;\n readonly propertyName: string;\n}\n\n/** [[DialogPropertySyncItem]] is used to pass sync messages for DialogPropertyItems\n * @public\n */\nexport interface DialogPropertySyncItem extends DialogPropertyItem {\n readonly isDisabled?: boolean;\n readonly property?: PropertyDescription;\n}\n\n/** [[DialogProperty]] is a generic helper class that assists working with properties used by UiLayoutDataProvider implementations (i.e. Tool Settings and Dynamic Dialogs).\n * @public\n */\nexport class DialogProperty<T> {\n constructor(public description: PropertyDescription, private _value: T, private _displayValue?: string, private _isDisabled?: boolean) { }\n\n public get isDisabled() {\n return !!this._isDisabled;\n }\n\n public set isDisabled(val: boolean) {\n this._isDisabled = val;\n }\n\n public get value() {\n return this._value;\n }\n\n public set value(val: T) {\n this._value = val;\n }\n\n public get name() {\n return this.description.name;\n }\n\n public set displayValue(val: string | undefined) {\n this._displayValue = val;\n }\n\n public get displayValue() {\n return this._displayValue;\n }\n\n public get dialogItemValue() {\n // istanbul ignore else\n if (typeof this._value === \"string\" || typeof this._value === \"number\" || typeof this._value === \"undefined\" || typeof this._value === \"boolean\" || this._value instanceof Date)\n return {\n value: this._value,\n displayValue: this._displayValue,\n } as DialogItemValue;\n // istanbul ignore next\n throw new Error(\"Not valid primitive type\");\n }\n\n public set dialogItemValue(val: DialogItemValue) {\n this._value = val.value as unknown as T;\n this._displayValue = val.displayValue;\n }\n\n public get syncItem(): DialogPropertySyncItem {\n const isDisabled = this._isDisabled;\n return { propertyName: this.name, value: this.dialogItemValue, isDisabled };\n }\n\n public get item(): DialogPropertyItem {\n return { propertyName: this.name, value: this.dialogItemValue };\n }\n\n public toDialogItem(editorPosition: EditorPosition, lockProperty?: DialogItem): DialogItem {\n return { value: this.dialogItemValue, property: this.description, editorPosition, isDisabled: this._isDisabled, lockProperty };\n }\n}\n"]}
@@ -131,6 +131,13 @@ class UiLayoutDataProvider extends UiDataProvider_1.UiDataProvider {
131
131
  return !!baseDialogItem.isDisabled;
132
132
  return !value.value;
133
133
  }
134
+ /** Gets a property record for a given dialog item */
135
+ static { this.getPropertyRecord = (dialogItem) => {
136
+ const propertyValue = { valueFormat: Value_1.PropertyValueFormat.Primitive, value: dialogItem.value.value, displayValue: dialogItem.value.displayValue };
137
+ const record = new Record_1.PropertyRecord(propertyValue, dialogItem.property);
138
+ record.isDisabled = UiLayoutDataProvider.getItemDisabledState(dialogItem);
139
+ return record;
140
+ }; }
134
141
  /** Determines if a dialog row only contains button group editors */
135
142
  static onlyContainButtonGroupEditors(row) {
136
143
  for (const item of row.items) {
@@ -142,13 +149,6 @@ class UiLayoutDataProvider extends UiDataProvider_1.UiDataProvider {
142
149
  }
143
150
  }
144
151
  exports.UiLayoutDataProvider = UiLayoutDataProvider;
145
- /** Gets a property record for a given dialog item */
146
- UiLayoutDataProvider.getPropertyRecord = (dialogItem) => {
147
- const propertyValue = { valueFormat: Value_1.PropertyValueFormat.Primitive, value: dialogItem.value.value, displayValue: dialogItem.value.displayValue };
148
- const record = new Record_1.PropertyRecord(propertyValue, dialogItem.property);
149
- record.isDisabled = UiLayoutDataProvider.getItemDisabledState(dialogItem);
150
- return record;
151
- };
152
152
  /** [[DialogLayoutDataProvider]] Abstract class that allows property values to be passed between hosting API and Dialog that generates and arranges components dynamically
153
153
  * including the buttons at the bottom of the dialog.
154
154
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"UiLayoutDataProvider.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/UiLayoutDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAChD,6DAAuH;AACvH,iDAAsD;AACtD,+CAA0E;AAE1E,qDAA8F;AAE9F;;GAEG;AACH,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,qCAAiB,CAAA;IACjB,+BAAW,CAAA;IACX,6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AG,CAAC,EAAE,CAAC,CAAC;QAChE,uBAAuB;QACvB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACpE,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAjBD,4DAiBC","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 Dialog\n */\n\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport { PropertyEditorParams, PropertyEditorParamTypes, SuppressLabelEditorParams } from \"../properties/EditorParams\";\nimport { PropertyRecord } from \"../properties/Record\";\nimport { PrimitiveValue, PropertyValueFormat } from \"../properties/Value\";\nimport { BaseDialogItem, DialogItem, DialogPropertyItem, DialogPropertySyncItem } from \"./DialogItem\";\nimport { PropertyChangeResult, PropertyChangeStatus, UiDataProvider } from \"./UiDataProvider\";\n\n/** Enum for button types. Determines button label, and default button style.\n * @public\n */\nexport enum DialogButtonType {\n None = \"\",\n Close = \"close\",\n OK = \"ok\",\n Cancel = \"cancel\",\n Yes = \"yes\",\n No = \"no\",\n Retry = \"retry\",\n Next = \"next\",\n Previous = \"previous\"\n}\n\n/** Enum for button style.\n * @public\n */\nexport enum DialogButtonStyle {\n None = \"\",\n Primary = \"iui-cta\",\n Hollow = \"iui-default\",\n Blue = \"iui-high-visibility\",\n}\n\n/** Interface for a dialog button in a button cluster\n * @public\n */\nexport interface DialogButtonDef {\n /** type of button */\n type: DialogButtonType;\n /** Triggered on button click */\n onClick: () => void;\n /** Which button style to decorate button width */\n buttonStyle?: DialogButtonStyle;\n /** Disable the button */\n disabled?: boolean;\n /** Custom label */\n label?: string;\n /** Custom CSS class */\n className?: string;\n}\n\n/** [[DialogRow]] is the interface that groups dialog items into rows for building UI\n * @public\n */\nexport interface DialogRow {\n priority: number;\n items: DialogItem[];\n}\n\n/**\n * @public\n */\nexport abstract class UiLayoutDataProvider extends UiDataProvider {\n private _items: ReadonlyArray<DialogItem> | undefined;\n\n /** Applies changes from one or more properties - some dialogs will use this to send a bulk set of changes back to the provider */\n public override processChangesInUi(properties: DialogPropertyItem[]): PropertyChangeResult {\n // Default implementation is to just pass each property to applyUiPropertyChange\n properties.forEach((property) => this.applyUiPropertyChange(property));\n return { status: PropertyChangeStatus.Success };\n }\n\n /** Applies change of a single property - this is the default method used when property editors are dynamically generated. */\n // istanbul ignore next\n public applyUiPropertyChange = (_updatedValue: DialogPropertySyncItem): void => {\n throw (new Error(\"Derived UiDataProvider should implement this to apply change to a single property.\"));\n };\n\n private _rows: DialogRow[] | undefined;\n\n /** Array of dialog rows */\n public get rows(): DialogRow[] {\n if (!this._rows) {\n this._rows = this.layoutDialogRows();\n }\n return this._rows;\n }\n\n protected loadItemsInternal(items: ReadonlyArray<DialogItem> | undefined) {\n this._items = items ? items : [];\n this._rows = this.layoutDialogRows();\n }\n\n /** Called by UI to request available properties that can be bound to user supplied UI components (See Tool1UiProvider for example). */\n // istanbul ignore next\n public supplyDialogItems(): DialogItem[] | undefined {\n throw (new Error(\"Derived UiDataProvider must implement this method to supply set of properties.\"));\n }\n\n public get items(): ReadonlyArray<DialogItem> {\n if (undefined === this._items) {\n this.loadItemsInternal(this.supplyDialogItems());\n }\n return this._items!;\n }\n\n /** Called to inform listeners that new properties are ready for display in UI. */\n public reloadDialogItems(emitEvent = true) {\n this.loadItemsInternal(this.supplyDialogItems());\n // istanbul ignore else\n if (emitEvent)\n this.fireItemsReloadedEvent();\n }\n\n /**\n * @internal\n */\n public layoutDialogRows(): DialogRow[] {\n const rows: DialogRow[] = [];\n\n this.items.forEach((item) => {\n const row = rows.find((value) => value.priority === item.editorPosition.rowPriority);\n if (row) {\n row.items.push(item);\n } else {\n rows.push({ priority: item.editorPosition.rowPriority, items: [item] });\n }\n });\n\n // sort rows\n rows.sort((a: DialogRow, b: DialogRow) => a.priority - b.priority);\n // sort records\n rows.forEach((row: DialogRow) => row.items.sort((a: DialogItem, b: DialogItem) => a.editorPosition.columnIndex - b.editorPosition.columnIndex));\n return rows;\n }\n\n /** Determines if a dialog item editor wants a label */\n public static editorWantsLabel(item: DialogItem): boolean {\n if (item.property.editor && item.property.editor.params) {\n const params = item.property.editor.params.find((param: PropertyEditorParams) => param.type === PropertyEditorParamTypes.SuppressEditorLabel) as SuppressLabelEditorParams;\n // istanbul ignore else\n if (params)\n return false;\n }\n return true;\n }\n\n /** Determines if a dialog items has an associated lock property */\n public static hasAssociatedLockProperty(item: DialogItem): boolean {\n return !!item.lockProperty;\n }\n\n /** Gets the disabled state for a given dialog item */\n public static getItemDisabledState(baseDialogItem: BaseDialogItem): boolean {\n const dialogItem = baseDialogItem as DialogItem;\n // istanbul ignore else\n if (dialogItem === undefined || dialogItem.lockProperty === undefined)\n return !!baseDialogItem.isDisabled;\n const value = dialogItem.lockProperty.value;\n // istanbul ignore next\n if (value === undefined)\n return !!baseDialogItem.isDisabled;\n\n return !value.value;\n }\n\n /** Gets a property record for a given dialog item */\n public static getPropertyRecord = (dialogItem: BaseDialogItem): PropertyRecord => {\n const propertyValue = { valueFormat: PropertyValueFormat.Primitive, value: dialogItem.value.value, displayValue: dialogItem.value.displayValue };\n const record = new PropertyRecord(propertyValue as PrimitiveValue, dialogItem.property);\n record.isDisabled = UiLayoutDataProvider.getItemDisabledState(dialogItem);\n return record;\n };\n\n /** Determines if a dialog row only contains button group editors */\n public static onlyContainButtonGroupEditors(row: DialogRow): boolean {\n for (const item of row.items) {\n // istanbul ignore else\n if (UiLayoutDataProvider.hasAssociatedLockProperty(item) || undefined === item.property.editor || \"enum-buttongroup\" !== item.property.editor.name || UiLayoutDataProvider.editorWantsLabel(item))\n return false;\n }\n return true;\n }\n}\n\n/** [[DialogLayoutDataProvider]] Abstract class that allows property values to be passed between hosting API and Dialog that generates and arranges components dynamically\n * including the buttons at the bottom of the dialog.\n * @public\n */\nexport abstract class DialogLayoutDataProvider extends UiLayoutDataProvider {\n public onButtonsReloadedEvent = new BeUiEvent<void>();\n\n /** Called to inform listeners that modal dialog button data needs to be refreshed. */\n public fireDialogButtonsReloadEvent() {\n this.onButtonsReloadedEvent.emit();\n }\n\n public supplyButtonData(): DialogButtonDef[] | undefined {\n // Derived class should override\n const buttons: DialogButtonDef[] = [];\n // istanbul ignore next\n buttons.push({ type: DialogButtonType.OK, onClick: () => { } });\n // istanbul ignore next\n buttons.push({ type: DialogButtonType.Cancel, onClick: () => { } });\n return buttons;\n }\n}\n"]}
1
+ {"version":3,"file":"UiLayoutDataProvider.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/UiLayoutDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAChD,6DAAuH;AACvH,iDAAsD;AACtD,+CAA0E;AAE1E,qDAA8F;AAE9F;;GAEG;AACH,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,qCAAiB,CAAA;IACjB,+BAAW,CAAA;IACX,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,iCAAa,CAAA;IACb,yCAAqB,CAAA;AACvB,CAAC,EAVW,gBAAgB,gCAAhB,gBAAgB,QAU3B;AAED;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,iDAA4B,CAAA;AAC9B,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AA4BD;;GAEG;AACH,MAAsB,oBAAqB,SAAQ,+BAAc;IAAjE;;QAUE,6HAA6H;QAC7H,uBAAuB;QAChB,0BAAqB,GAAG,CAAC,aAAqC,EAAQ,EAAE;YAC7E,MAAM,CAAC,IAAI,KAAK,CAAC,oFAAoF,CAA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AAI,GAAG,CAAC,KAAK,EAAE,CAAC;YAC7B,uBAAuB;YACvB,IAAI,oBAAoB,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,kBAAkB,KAAK,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,oBAAoB,CAAC,gBAAgB,CAAC,IAAI,CAAC;gBAC/L,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AAxHH,oDAyHC;AAED;;;GAGG;AACH,MAAsB,wBAAyB,SAAQ,oBAAoB;IAA3E;;QACS,2BAAsB,GAAG,IAAI,wBAAS,EAAQ,CAAC;IAgBxD,CAAC;IAdC,sFAAsF;IAC/E,4BAA4B;QACjC,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC;IACrC,CAAC;IAEM,gBAAgB;QACrB,gCAAgC;QAChC,MAAM,OAAO,GAAsB,EAAE,CAAC;QACtC,uBAAuB;QACvB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QAChE,uBAAuB;QACvB,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACpE,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAjBD,4DAiBC","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 Dialog\n */\n\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport { PropertyEditorParams, PropertyEditorParamTypes, SuppressLabelEditorParams } from \"../properties/EditorParams\";\nimport { PropertyRecord } from \"../properties/Record\";\nimport { PrimitiveValue, PropertyValueFormat } from \"../properties/Value\";\nimport { BaseDialogItem, DialogItem, DialogPropertyItem, DialogPropertySyncItem } from \"./DialogItem\";\nimport { PropertyChangeResult, PropertyChangeStatus, UiDataProvider } from \"./UiDataProvider\";\n\n/** Enum for button types. Determines button label, and default button style.\n * @public\n */\nexport enum DialogButtonType {\n None = \"\",\n Close = \"close\",\n OK = \"ok\",\n Cancel = \"cancel\",\n Yes = \"yes\",\n No = \"no\",\n Retry = \"retry\",\n Next = \"next\",\n Previous = \"previous\"\n}\n\n/** Enum for button style.\n * @public\n */\nexport enum DialogButtonStyle {\n None = \"\",\n Primary = \"iui-cta\",\n Hollow = \"iui-default\",\n Blue = \"iui-high-visibility\",\n}\n\n/** Interface for a dialog button in a button cluster\n * @public\n */\nexport interface DialogButtonDef {\n /** type of button */\n type: DialogButtonType;\n /** Triggered on button click */\n onClick: () => void;\n /** Which button style to decorate button width */\n buttonStyle?: DialogButtonStyle;\n /** Disable the button */\n disabled?: boolean;\n /** Custom label */\n label?: string;\n /** Custom CSS class */\n className?: string;\n}\n\n/** [[DialogRow]] is the interface that groups dialog items into rows for building UI\n * @public\n */\nexport interface DialogRow {\n priority: number;\n items: DialogItem[];\n}\n\n/**\n * @public\n */\nexport abstract class UiLayoutDataProvider extends UiDataProvider {\n private _items: ReadonlyArray<DialogItem> | undefined;\n\n /** Applies changes from one or more properties - some dialogs will use this to send a bulk set of changes back to the provider */\n public override processChangesInUi(properties: DialogPropertyItem[]): PropertyChangeResult {\n // Default implementation is to just pass each property to applyUiPropertyChange\n properties.forEach((property) => this.applyUiPropertyChange(property));\n return { status: PropertyChangeStatus.Success };\n }\n\n /** Applies change of a single property - this is the default method used when property editors are dynamically generated. */\n // istanbul ignore next\n public applyUiPropertyChange = (_updatedValue: DialogPropertySyncItem): void => {\n throw (new Error(\"Derived UiDataProvider should implement this to apply change to a single property.\"));\n };\n\n private _rows: DialogRow[] | undefined;\n\n /** Array of dialog rows */\n public get rows(): DialogRow[] {\n if (!this._rows) {\n this._rows = this.layoutDialogRows();\n }\n return this._rows;\n }\n\n protected loadItemsInternal(items: ReadonlyArray<DialogItem> | undefined) {\n this._items = items ? items : [];\n this._rows = this.layoutDialogRows();\n }\n\n /** Called by UI to request available properties that can be bound to user supplied UI components (See Tool1UiProvider for example). */\n // istanbul ignore next\n public supplyDialogItems(): DialogItem[] | undefined {\n throw (new Error(\"Derived UiDataProvider must implement this method to supply set of properties.\"));\n }\n\n public get items(): ReadonlyArray<DialogItem> {\n if (undefined === this._items) {\n this.loadItemsInternal(this.supplyDialogItems());\n }\n return this._items!;\n }\n\n /** Called to inform listeners that new properties are ready for display in UI. */\n public reloadDialogItems(emitEvent = true) {\n this.loadItemsInternal(this.supplyDialogItems());\n // istanbul ignore else\n if (emitEvent)\n this.fireItemsReloadedEvent();\n }\n\n /**\n * @internal\n */\n public layoutDialogRows(): DialogRow[] {\n const rows: DialogRow[] = [];\n\n this.items.forEach((item) => {\n const row = rows.find((value) => value.priority === item.editorPosition.rowPriority);\n if (row) {\n row.items.push(item);\n } else {\n rows.push({ priority: item.editorPosition.rowPriority, items: [item] });\n }\n });\n\n // sort rows\n rows.sort((a: DialogRow, b: DialogRow) => a.priority - b.priority);\n // sort records\n rows.forEach((row: DialogRow) => row.items.sort((a: DialogItem, b: DialogItem) => a.editorPosition.columnIndex - b.editorPosition.columnIndex));\n return rows;\n }\n\n /** Determines if a dialog item editor wants a label */\n public static editorWantsLabel(item: DialogItem): boolean {\n if (item.property.editor && item.property.editor.params) {\n const params = item.property.editor.params.find((param: PropertyEditorParams) => param.type === PropertyEditorParamTypes.SuppressEditorLabel) as SuppressLabelEditorParams;\n // istanbul ignore else\n if (params)\n return false;\n }\n return true;\n }\n\n /** Determines if a dialog items has an associated lock property */\n public static hasAssociatedLockProperty(item: DialogItem): boolean {\n return !!item.lockProperty;\n }\n\n /** Gets the disabled state for a given dialog item */\n public static getItemDisabledState(baseDialogItem: BaseDialogItem): boolean {\n const dialogItem = baseDialogItem as DialogItem;\n // istanbul ignore else\n if (dialogItem === undefined || dialogItem.lockProperty === undefined)\n return !!baseDialogItem.isDisabled;\n const value = dialogItem.lockProperty.value;\n // istanbul ignore next\n if (value === undefined)\n return !!baseDialogItem.isDisabled;\n\n return !value.value;\n }\n\n /** Gets a property record for a given dialog item */\n public static getPropertyRecord = (dialogItem: BaseDialogItem): PropertyRecord => {\n const propertyValue = { valueFormat: PropertyValueFormat.Primitive, value: dialogItem.value.value, displayValue: dialogItem.value.displayValue };\n const record = new PropertyRecord(propertyValue as PrimitiveValue, dialogItem.property);\n record.isDisabled = UiLayoutDataProvider.getItemDisabledState(dialogItem);\n return record;\n };\n\n /** Determines if a dialog row only contains button group editors */\n public static onlyContainButtonGroupEditors(row: DialogRow): boolean {\n for (const item of row.items) {\n // istanbul ignore else\n if (UiLayoutDataProvider.hasAssociatedLockProperty(item) || undefined === item.property.editor || \"enum-buttongroup\" !== item.property.editor.name || UiLayoutDataProvider.editorWantsLabel(item))\n return false;\n }\n return true;\n }\n}\n\n/** [[DialogLayoutDataProvider]] Abstract class that allows property values to be passed between hosting API and Dialog that generates and arranges components dynamically\n * including the buttons at the bottom of the dialog.\n * @public\n */\nexport abstract class DialogLayoutDataProvider extends UiLayoutDataProvider {\n public onButtonsReloadedEvent = new BeUiEvent<void>();\n\n /** Called to inform listeners that modal dialog button data needs to be refreshed. */\n public fireDialogButtonsReloadEvent() {\n this.onButtonsReloadedEvent.emit();\n }\n\n public supplyButtonData(): DialogButtonDef[] | undefined {\n // Derived class should override\n const buttons: DialogButtonDef[] = [];\n // istanbul ignore next\n buttons.push({ type: DialogButtonType.OK, onClick: () => { } });\n // istanbul ignore next\n buttons.push({ type: DialogButtonType.Cancel, onClick: () => { } });\n return buttons;\n }\n}\n"]}
@@ -69,20 +69,20 @@ exports.isAbstractStatusBarCustomItem = isAbstractStatusBarCustomItem;
69
69
  * @public
70
70
  */
71
71
  class AbstractStatusBarItemUtilities {
72
+ /** Creates a StatusBar item to perform an action */
73
+ static { this.createActionItem = (id, section, itemPriority, icon, tooltip, execute, overrides) => ({
74
+ id, section, itemPriority,
75
+ icon, tooltip,
76
+ execute,
77
+ ...overrides,
78
+ }); }
79
+ /** Creates a StatusBar item to display a label */
80
+ static { this.createLabelItem = (id, section, itemPriority, icon, label, labelSide = StatusBarLabelSide.Right, overrides) => ({
81
+ id, section, itemPriority,
82
+ icon, label,
83
+ labelSide,
84
+ ...overrides,
85
+ }); }
72
86
  }
73
87
  exports.AbstractStatusBarItemUtilities = AbstractStatusBarItemUtilities;
74
- /** Creates a StatusBar item to perform an action */
75
- AbstractStatusBarItemUtilities.createActionItem = (id, section, itemPriority, icon, tooltip, execute, overrides) => ({
76
- id, section, itemPriority,
77
- icon, tooltip,
78
- execute,
79
- ...overrides,
80
- });
81
- /** Creates a StatusBar item to display a label */
82
- AbstractStatusBarItemUtilities.createLabelItem = (id, section, itemPriority, icon, label, labelSide = StatusBarLabelSide.Right, overrides) => ({
83
- id, section, itemPriority,
84
- icon, label,
85
- labelSide,
86
- ...overrides,
87
- });
88
88
  //# sourceMappingURL=StatusBarItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IAC1B,4CAA4C;IAC5C,6DAAW,CAAA;IACX,4CAA4C;IAC5C,uDAAQ,CAAA;IACR,mCAAmC;IACnC,yDAAS,CAAA;IACT,mCAAmC;IACnC,2DAAU,CAAA;IACV,sCAAsC;IACtC,iEAAa,CAAA;IACb,sCAAsC;IACtC,yDAAS,CAAA;IACT,4CAA4C;IAC5C,6DAAW,CAAA;AACb,CAAC,EAfW,gBAAgB,gCAAhB,gBAAgB,QAe3B;AAED;;;GAGG;AACH,IAAY,kBAKX;A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ACzB,IAAI,EAAE,KAAK;IACX,SAAS;IACT,GAAG,SAAS;CACb,CAAC,CAAC","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 StatusBar\n */\n\nimport { BadgeType } from \"../items/BadgeType\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { ProvidedItem } from \"../items/ProvidedItem\";\n\n/** Status bar Groups/Sections from Left to Right\n * @deprecated in 3.6. Use [StatusBarSection]($appui-react) instead.\n * @public\n */\nexport enum StatusBarSection {\n /** area for tool assistance and messages */\n Message = 0,\n /** area for tool assistance and messages */\n Left = 0, // eslint-disable-line @typescript-eslint/no-duplicate-enum-values\n /** items specific to stage/task */\n Stage = 1,\n /** items specific to stage/task */\n Center = 1, // eslint-disable-line @typescript-eslint/no-duplicate-enum-values\n /** Select scope and selection info */\n Selection = 2,\n /** Select scope and selection info */\n Right = 2, // eslint-disable-line @typescript-eslint/no-duplicate-enum-values\n /** items that only show based on context */\n Context = 3,\n}\n\n/** Defines which side of Icon where label is placed\n * @deprecated in 3.6. Use [StatusBarLabelSide]($appui-react) instead.\n * @public\n */\nexport enum StatusBarLabelSide {\n /** Label is placed left side of icon. This is the default if not specified */\n Left,\n /** Label is placed on right side of icon. */\n Right,\n}\n\n/** Type for StatusBar Item Id\n * @deprecated in 3.6. Please use `CommonStatusBarItem[\"id\"]` from @itwin/appui-react.\n * @public\n */\nexport type StatusBarItemId = CommonStatusBarItem[\"id\"];\n\n/** Describes the data needed to insert a button into the status bar.\n * @deprecated in 3.6. Use [CommonStatusBarItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarItem extends ProvidedItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** can be used by application to store miscellaneous data. */\n applicationData?: any;\n /** Describes badge. Renders no badge if not specified. */\n readonly badgeType?: BadgeType;\n /** Required unique id of the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** optional data to used by item implementor. */\n readonly internalData?: Map<string, any>;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Priority within a section (recommend using values 1 through 100). */\n readonly itemPriority: number;\n /** status bar section */\n readonly section: StatusBarSection; // eslint-disable-line @typescript-eslint/no-deprecated\n}\n\n/** Describes the data needed to insert an action item into the status bar.\n * @deprecated in 3.6. Use [StatusBarActionItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarActionItem extends AbstractStatusBarItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** method to execute when icon is pressed */\n readonly execute: () => void;\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** Label. */\n readonly label?: string | ConditionalStringValue;\n /** tooltip. */\n readonly tooltip?: string | ConditionalStringValue;\n}\n\n/** Describes the data needed to insert a label item with an optional icon into the status bar.\n * @deprecated in 3.6. Use [StatusBarLabelItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarLabelItem extends AbstractStatusBarItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** Label. */\n readonly label: string | ConditionalStringValue;\n /** Defines which side of icon to display label if icon is defined. */\n readonly labelSide?: StatusBarLabelSide; // eslint-disable-line @typescript-eslint/no-deprecated\n}\n\n/** Describes the data needed to insert a custom item into the status bar. This is used to allow extension\n * implementer to create a framework specific component.\n * @deprecated in 3.6. Use [StatusBarCustomItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarCustomItem extends AbstractStatusBarItem { // eslint-disable-line @typescript-eslint/no-deprecated\n readonly isCustom: true;\n}\n\n/** Describes the data needed to insert a button into the status bar.\n * @deprecated in 3.6. Use [StatusBarItem]($appui-react) instead.\n * @public\n */\nexport type CommonStatusBarItem = AbstractStatusBarActionItem | AbstractStatusBarLabelItem | AbstractStatusBarCustomItem; // eslint-disable-line @typescript-eslint/no-deprecated\n\n/** AbstractStatusBarActionItem type guard.\n * @deprecated in 3.6. Use [isStatusBarActionItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarActionItem = (item: CommonStatusBarItem): item is AbstractStatusBarActionItem => { // eslint-disable-line @typescript-eslint/no-deprecated\n return (item as AbstractStatusBarActionItem).execute !== undefined; // eslint-disable-line @typescript-eslint/no-deprecated\n};\n\n/** AbstractStatusBarLabelItem type guard.\n * @deprecated in 3.6. Use [isStatusBarLabelItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarLabelItem = (item: CommonStatusBarItem): item is AbstractStatusBarLabelItem => { // eslint-disable-line @typescript-eslint/no-deprecated\n return (item as AbstractStatusBarLabelItem).label !== undefined && (item as AbstractStatusBarActionItem).execute === undefined; // eslint-disable-line @typescript-eslint/no-deprecated\n};\n\n/** AbstractStatusBarCustomItem type guard.\n * @deprecated in 3.6. Use [isStatusBarCustomItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarCustomItem = (item: CommonStatusBarItem): item is AbstractStatusBarCustomItem => { // eslint-disable-line @typescript-eslint/no-deprecated\n return !!(item as AbstractStatusBarCustomItem).isCustom; // eslint-disable-line @typescript-eslint/no-deprecated\n};\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @deprecated in 3.6. Use [StatusBarItemUtilities]($appui-react) instead.\n * @public\n */\nexport class AbstractStatusBarItemUtilities {\n /** Creates a StatusBar item to perform an action */\n public static createActionItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, tooltip: string | ConditionalStringValue, execute: () => void, overrides?: Partial<AbstractStatusBarCustomItem>): AbstractStatusBarActionItem => ({ // eslint-disable-line @typescript-eslint/no-deprecated\n id, section, itemPriority,\n icon, tooltip,\n execute,\n ...overrides,\n });\n\n /** Creates a StatusBar item to display a label */\n public static createLabelItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, labelSide = StatusBarLabelSide.Right, overrides?: Partial<AbstractStatusBarLabelItem>): AbstractStatusBarLabelItem => ({ // eslint-disable-line @typescript-eslint/no-deprecated\n id, section, itemPriority,\n icon, label,\n labelSide,\n ...overrides,\n });\n}\n"]}
1
+ {"version":3,"file":"StatusBarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IAC1B,4CAA4C;IAC5C,6DAAW,CAAA;IACX,4CAA4C;IAC5C,uDAAQ,CAAA;IACR,mCAAmC;IACnC,yDAAS,CAAA;IACT,mCAAmC;IACnC,2DAAU,CAAA;IACV,sCAAsC;IACtC,iEAAa,CAAA;IACb,sCAAsC;IACtC,yDAAS,CAAA;IACT,4CAA4C;IAC5C,6DAAW,CAAA;AACb,CAAC,EAfW,gBAAgB,gCAAhB,gBAAgB,QAe3B;AAED;;;GAGG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,8EAA8E;IAC9E,2DAAI,CAAA;IACJ,6CAA6C;IAC7C,6DAAK,CAAA;AACP,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AA0ED;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,IAAyB,EAAuC,EAAE;IAC9G,OAAQ,IAAoC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,uDAAuD;AAC7H,CAAC,CAAC;AAFW,QAAA,6BAA6B,iCAExC;AAEF;;;GAGG;AACI,MAAM,4BAA4B,GAAG,CAAC,IAAyB,EAAsC,EAAE;IAC5G,OAAQ,IAAmC,CAAC,KAAK,KAAK,SAAS,IAAK,IAAoC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,uDAAuD;AACzL,CAAC,CAAC;AAFW,QAAA,4BAA4B,gCAEvC;AAEF;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,IAAyB,EAAuC,EAAE;IAC9G,OAAO,CAAC,CAAE,IAAoC,CAAC,QAAQ,CAAC,CAAC,uDAAuD;AAClH,CAAC,CAAC;AAFW,QAAA,6BAA6B,iCAExC;AAEF;;;GAGG;AACH,MAAa,8BAA8B;IACzC,oDAAoD;aACtC,qBAAgB,GAAG,CAAC,EAAU,EAAE,OAAyB,EAAE,YAAoB,EAAE,IAAqC,EAAE,OAAwC,EAAE,OAAmB,EAAE,SAAgD,EAA+B,EAAE,CAAC,CAAC;QACtR,EAAE,EAAE,OAAO,EAAE,YAAY;QACzB,IAAI,EAAE,OAAO;QACb,OAAO;QACP,GAAG,SAAS;KACb,CAAC,CAAC;IAEH,kDAAkD;aACpC,oBAAe,GAAG,CAAC,EAAU,EAAE,OAAyB,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,SAAS,GAAG,kBAAkB,CAAC,KAAK,EAAE,SAA+C,EAA8B,EAAE,CAAC,CAAC;QAClS,EAAE,EAAE,OAAO,EAAE,YAAY;QACzB,IAAI,EAAE,KAAK;QACX,SAAS;QACT,GAAG,SAAS;KACb,CAAC,CAAC;;AAfL,wEAgBC","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 StatusBar\n */\n\nimport { BadgeType } from \"../items/BadgeType\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { ProvidedItem } from \"../items/ProvidedItem\";\n\n/** Status bar Groups/Sections from Left to Right\n * @deprecated in 3.6. Use [StatusBarSection]($appui-react) instead.\n * @public\n */\nexport enum StatusBarSection {\n /** area for tool assistance and messages */\n Message = 0,\n /** area for tool assistance and messages */\n Left = 0, // eslint-disable-line @typescript-eslint/no-duplicate-enum-values\n /** items specific to stage/task */\n Stage = 1,\n /** items specific to stage/task */\n Center = 1, // eslint-disable-line @typescript-eslint/no-duplicate-enum-values\n /** Select scope and selection info */\n Selection = 2,\n /** Select scope and selection info */\n Right = 2, // eslint-disable-line @typescript-eslint/no-duplicate-enum-values\n /** items that only show based on context */\n Context = 3,\n}\n\n/** Defines which side of Icon where label is placed\n * @deprecated in 3.6. Use [StatusBarLabelSide]($appui-react) instead.\n * @public\n */\nexport enum StatusBarLabelSide {\n /** Label is placed left side of icon. This is the default if not specified */\n Left,\n /** Label is placed on right side of icon. */\n Right,\n}\n\n/** Type for StatusBar Item Id\n * @deprecated in 3.6. Please use `CommonStatusBarItem[\"id\"]` from @itwin/appui-react.\n * @public\n */\nexport type StatusBarItemId = CommonStatusBarItem[\"id\"];\n\n/** Describes the data needed to insert a button into the status bar.\n * @deprecated in 3.6. Use [CommonStatusBarItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarItem extends ProvidedItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** can be used by application to store miscellaneous data. */\n applicationData?: any;\n /** Describes badge. Renders no badge if not specified. */\n readonly badgeType?: BadgeType;\n /** Required unique id of the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** optional data to used by item implementor. */\n readonly internalData?: Map<string, any>;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Priority within a section (recommend using values 1 through 100). */\n readonly itemPriority: number;\n /** status bar section */\n readonly section: StatusBarSection; // eslint-disable-line @typescript-eslint/no-deprecated\n}\n\n/** Describes the data needed to insert an action item into the status bar.\n * @deprecated in 3.6. Use [StatusBarActionItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarActionItem extends AbstractStatusBarItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** method to execute when icon is pressed */\n readonly execute: () => void;\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** Label. */\n readonly label?: string | ConditionalStringValue;\n /** tooltip. */\n readonly tooltip?: string | ConditionalStringValue;\n}\n\n/** Describes the data needed to insert a label item with an optional icon into the status bar.\n * @deprecated in 3.6. Use [StatusBarLabelItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarLabelItem extends AbstractStatusBarItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** Label. */\n readonly label: string | ConditionalStringValue;\n /** Defines which side of icon to display label if icon is defined. */\n readonly labelSide?: StatusBarLabelSide; // eslint-disable-line @typescript-eslint/no-deprecated\n}\n\n/** Describes the data needed to insert a custom item into the status bar. This is used to allow extension\n * implementer to create a framework specific component.\n * @deprecated in 3.6. Use [StatusBarCustomItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarCustomItem extends AbstractStatusBarItem { // eslint-disable-line @typescript-eslint/no-deprecated\n readonly isCustom: true;\n}\n\n/** Describes the data needed to insert a button into the status bar.\n * @deprecated in 3.6. Use [StatusBarItem]($appui-react) instead.\n * @public\n */\nexport type CommonStatusBarItem = AbstractStatusBarActionItem | AbstractStatusBarLabelItem | AbstractStatusBarCustomItem; // eslint-disable-line @typescript-eslint/no-deprecated\n\n/** AbstractStatusBarActionItem type guard.\n * @deprecated in 3.6. Use [isStatusBarActionItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarActionItem = (item: CommonStatusBarItem): item is AbstractStatusBarActionItem => { // eslint-disable-line @typescript-eslint/no-deprecated\n return (item as AbstractStatusBarActionItem).execute !== undefined; // eslint-disable-line @typescript-eslint/no-deprecated\n};\n\n/** AbstractStatusBarLabelItem type guard.\n * @deprecated in 3.6. Use [isStatusBarLabelItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarLabelItem = (item: CommonStatusBarItem): item is AbstractStatusBarLabelItem => { // eslint-disable-line @typescript-eslint/no-deprecated\n return (item as AbstractStatusBarLabelItem).label !== undefined && (item as AbstractStatusBarActionItem).execute === undefined; // eslint-disable-line @typescript-eslint/no-deprecated\n};\n\n/** AbstractStatusBarCustomItem type guard.\n * @deprecated in 3.6. Use [isStatusBarCustomItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarCustomItem = (item: CommonStatusBarItem): item is AbstractStatusBarCustomItem => { // eslint-disable-line @typescript-eslint/no-deprecated\n return !!(item as AbstractStatusBarCustomItem).isCustom; // eslint-disable-line @typescript-eslint/no-deprecated\n};\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @deprecated in 3.6. Use [StatusBarItemUtilities]($appui-react) instead.\n * @public\n */\nexport class AbstractStatusBarItemUtilities {\n /** Creates a StatusBar item to perform an action */\n public static createActionItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, tooltip: string | ConditionalStringValue, execute: () => void, overrides?: Partial<AbstractStatusBarCustomItem>): AbstractStatusBarActionItem => ({ // eslint-disable-line @typescript-eslint/no-deprecated\n id, section, itemPriority,\n icon, tooltip,\n execute,\n ...overrides,\n });\n\n /** Creates a StatusBar item to display a label */\n public static createLabelItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, labelSide = StatusBarLabelSide.Right, overrides?: Partial<AbstractStatusBarLabelItem>): AbstractStatusBarLabelItem => ({ // eslint-disable-line @typescript-eslint/no-deprecated\n id, section, itemPriority,\n icon, label,\n labelSide,\n ...overrides,\n });\n}\n"]}
@@ -34,6 +34,20 @@ var ToolbarOrientation;
34
34
  * @public
35
35
  */
36
36
  class ToolbarItemUtilities {
37
+ /** Creates an Action Button */
38
+ static { this.createActionButton = (id, itemPriority, icon, label, execute, overrides) => ({
39
+ id, itemPriority,
40
+ icon, label,
41
+ execute,
42
+ ...overrides,
43
+ }); }
44
+ /** Creates a Group button. */
45
+ static { this.createGroupButton = (id, itemPriority, icon, label, items, overrides) => ({
46
+ id, itemPriority,
47
+ icon, label,
48
+ items,
49
+ ...overrides,
50
+ }); }
37
51
  /** ActionButton type guard. */
38
52
  static isActionButton(item) {
39
53
  return item.execute !== undefined;
@@ -48,18 +62,4 @@ class ToolbarItemUtilities {
48
62
  }
49
63
  }
50
64
  exports.ToolbarItemUtilities = ToolbarItemUtilities;
51
- /** Creates an Action Button */
52
- ToolbarItemUtilities.createActionButton = (id, itemPriority, icon, label, execute, overrides) => ({
53
- id, itemPriority,
54
- icon, label,
55
- execute,
56
- ...overrides,
57
- });
58
- /** Creates a Group button. */
59
- ToolbarItemUtilities.createGroupButton = (id, itemPriority, icon, label, items, overrides) => ({
60
- id, itemPriority,
61
- icon, label,
62
- items,
63
- ...overrides,
64
- });
65
65
  //# sourceMappingURL=ToolbarItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,4GAA4G;IAC5G,6EAAuB,CAAA;IACvB,iFAAiF;IACjF,mEAAkB,CAAA;AACpB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED;;;GAGG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,0BAA0B;IAC1B,uEAAc,CAAA;IACd,wBAAwB;IACxB,mEAAY,CAAA;AACd,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AAuFD;;GAEG;AACH,MAAa,oBAAoB;IAiB/B,+BAA+B;IACxB,MAAM,CAAC,cAAc,CAAC,IAAuB;QAClD,OAAQ,IAAqB,CAAC,OAAO,KAAK,SAAS,CAAC;IACtD,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,aAAa,CAAC,IAAuB;QACjD,OAAQ,IAAoB,CAAC,KAAK,KAAK,SAAS,CAAC;IACnD,CAAC;IAED,yCAAyC;IAClC,MAAM,CAAC,kBAAkB,CAAC,IAAuB;QACtD,OAAO,CAAC,CAAE,IAA+B,CAAC,QAAQ,CAAC;IACrD,CAAC;;AA9BH,oDA+BC;AA9BC,+BAA+B;AACjB,uCAAkB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,OAAmB,EAAE,SAAiC,EAAgB,EAAE,CAAC,CAAC;IAC7N,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,KAAK;IACX,OAAO;IACP,GAAG,SAAS;CACb,CAAC,CAAC;AAEH,8BAA8B;AAChB,sCAAiB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,KAAgD,EAAE,SAAgC,EAAe,EAAE,CAAC,CAAC;IACvP,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,KAAK;IACX,KAAK;IACL,GAAG,SAAS;CACb,CAAC,CAAC","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 Toolbar\n */\n\nimport { BadgeType } from \"../items/BadgeType\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { ProvidedItem } from \"../items/ProvidedItem\";\n\n/** Used to specify the usage of the toolbar which determine the toolbar position.\n * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.\n * @public\n */\nexport enum ToolbarUsage {\n /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */\n ContentManipulation = 0,\n /** Manipulate view/camera - in ninezone this is in top right of content area. */\n ViewNavigation = 1,\n}\n\n/** Used to specify the orientation of the toolbar.\n * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.\n * @public\n */\nexport enum ToolbarOrientation {\n /** Horizontal toolbar. */\n Horizontal = 0,\n /** Vertical toolbar. */\n Vertical = 1,\n}\n\n/** Describes the data needed to insert a UI items into an existing set of UI items.\n * @public\n */\nexport interface ToolbarItem extends ProvidedItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** can be used by application to store miscellaneous data. */\n readonly applicationData?: any;\n /** Describes badge. Renders no badge if not specified. */\n readonly badgeType?: BadgeType;\n /** Optional description */\n readonly description?: string | ConditionalStringValue;\n /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** optional data to used by item implementor. */\n readonly internalData?: Map<string, any>;\n /** Defines if the item is active (shown with an active stripe/bar). */\n readonly isActive?: boolean;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Describes if the item should appear pressed (used for displaying toggle state). This property is NOT used by Toolbars\n * constructed using the `ToolbarWithOverflow` component, which are used in AppUi 2.0 and later. For these later toolbars\n * the icon is usually changed to denote the state of a toggle.\n */\n readonly isPressed?: boolean;\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\n * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.\n */\n readonly groupPriority?: number;\n /** Priority within a toolbar or group. */\n readonly itemPriority: number;\n /** Optional parent tool group to add tool. */\n readonly parentToolGroupId?: string;\n}\n\n/** Describes the data needed to insert an action button into a toolbar.\n * @public\n */\nexport interface ActionButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on a button or an item label in a group. */\n readonly label: string | ConditionalStringValue;\n /** function to run when the button is pressed. */\n readonly execute: () => void;\n}\n\n/** Describes the data needed to insert a group button into a toolbar.\n * @public\n */\nexport interface GroupButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label: string | ConditionalStringValue;\n /** label shown as the title in at top of group panel. */\n readonly panelLabel?: string | ConditionalStringValue;\n /** children of the group */\n readonly items: ReadonlyArray<ActionButton | GroupButton>;\n}\n\n/** Describes the data needed to insert a custom button into a toolbar.\n * @public\n */\nexport interface CustomButtonDefinition extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label?: string | ConditionalStringValue;\n /** parameter that marks data as being a custom definition. */\n readonly isCustom: true;\n}\n\n/** Any Button Type that can be inserted into a toolbar.\n * @public\n */\nexport type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;\n\n/** Type for Toolbar Item Id\n * @deprecated in 3.6. Please use `ToolbarItem[\"id\"]` from @itwin/appui-react.\n * @public\n */\nexport type ToolbarItemId = CommonToolbarItem[\"id\"];\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @public\n */\nexport class ToolbarItemUtilities {\n /** Creates an Action Button */\n public static createActionButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton>): ActionButton => ({\n id, itemPriority,\n icon, label,\n execute,\n ...overrides,\n });\n\n /** Creates a Group button. */\n public static createGroupButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton>): GroupButton => ({\n id, itemPriority,\n icon, label,\n items,\n ...overrides,\n });\n\n /** ActionButton type guard. */\n public static isActionButton(item: CommonToolbarItem): item is ActionButton {\n return (item as ActionButton).execute !== undefined;\n }\n\n /** GroupButton type guard. */\n public static isGroupButton(item: CommonToolbarItem): item is GroupButton {\n return (item as GroupButton).items !== undefined;\n }\n\n /** CustomButtonDefinition type guard. */\n public static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition {\n return !!(item as CustomButtonDefinition).isCustom;\n }\n}\n"]}
1
+ {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,4GAA4G;IAC5G,6EAAuB,CAAA;IACvB,iFAAiF;IACjF,mEAAkB,CAAA;AACpB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AAED;;;GAGG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,0BAA0B;IAC1B,uEAAc,CAAA;IACd,wBAAwB;IACxB,mEAAY,CAAA;AACd,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AAuFD;;GAEG;AACH,MAAa,oBAAoB;IAC/B,+BAA+B;aACjB,uBAAkB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,OAAmB,EAAE,SAAiC,EAAgB,EAAE,CAAC,CAAC;QAC7N,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,KAAK;QACX,OAAO;QACP,GAAG,SAAS;KACb,CAAC,CAAC;IAEH,8BAA8B;aAChB,sBAAiB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,KAAgD,EAAE,SAAgC,EAAe,EAAE,CAAC,CAAC;QACvP,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,KAAK;QACX,KAAK;QACL,GAAG,SAAS;KACb,CAAC,CAAC;IAEH,+BAA+B;IACxB,MAAM,CAAC,cAAc,CAAC,IAAuB;QAClD,OAAQ,IAAqB,CAAC,OAAO,KAAK,SAAS,CAAC;IACtD,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,aAAa,CAAC,IAAuB;QACjD,OAAQ,IAAoB,CAAC,KAAK,KAAK,SAAS,CAAC;IACnD,CAAC;IAED,yCAAyC;IAClC,MAAM,CAAC,kBAAkB,CAAC,IAAuB;QACtD,OAAO,CAAC,CAAE,IAA+B,CAAC,QAAQ,CAAC;IACrD,CAAC;;AA9BH,oDA+BC","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 Toolbar\n */\n\nimport { BadgeType } from \"../items/BadgeType\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { ProvidedItem } from \"../items/ProvidedItem\";\n\n/** Used to specify the usage of the toolbar which determine the toolbar position.\n * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.\n * @public\n */\nexport enum ToolbarUsage {\n /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */\n ContentManipulation = 0,\n /** Manipulate view/camera - in ninezone this is in top right of content area. */\n ViewNavigation = 1,\n}\n\n/** Used to specify the orientation of the toolbar.\n * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.\n * @public\n */\nexport enum ToolbarOrientation {\n /** Horizontal toolbar. */\n Horizontal = 0,\n /** Vertical toolbar. */\n Vertical = 1,\n}\n\n/** Describes the data needed to insert a UI items into an existing set of UI items.\n * @public\n */\nexport interface ToolbarItem extends ProvidedItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** can be used by application to store miscellaneous data. */\n readonly applicationData?: any;\n /** Describes badge. Renders no badge if not specified. */\n readonly badgeType?: BadgeType;\n /** Optional description */\n readonly description?: string | ConditionalStringValue;\n /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** optional data to used by item implementor. */\n readonly internalData?: Map<string, any>;\n /** Defines if the item is active (shown with an active stripe/bar). */\n readonly isActive?: boolean;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Describes if the item should appear pressed (used for displaying toggle state). This property is NOT used by Toolbars\n * constructed using the `ToolbarWithOverflow` component, which are used in AppUi 2.0 and later. For these later toolbars\n * the icon is usually changed to denote the state of a toggle.\n */\n readonly isPressed?: boolean;\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\n * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.\n */\n readonly groupPriority?: number;\n /** Priority within a toolbar or group. */\n readonly itemPriority: number;\n /** Optional parent tool group to add tool. */\n readonly parentToolGroupId?: string;\n}\n\n/** Describes the data needed to insert an action button into a toolbar.\n * @public\n */\nexport interface ActionButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on a button or an item label in a group. */\n readonly label: string | ConditionalStringValue;\n /** function to run when the button is pressed. */\n readonly execute: () => void;\n}\n\n/** Describes the data needed to insert a group button into a toolbar.\n * @public\n */\nexport interface GroupButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label: string | ConditionalStringValue;\n /** label shown as the title in at top of group panel. */\n readonly panelLabel?: string | ConditionalStringValue;\n /** children of the group */\n readonly items: ReadonlyArray<ActionButton | GroupButton>;\n}\n\n/** Describes the data needed to insert a custom button into a toolbar.\n * @public\n */\nexport interface CustomButtonDefinition extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label?: string | ConditionalStringValue;\n /** parameter that marks data as being a custom definition. */\n readonly isCustom: true;\n}\n\n/** Any Button Type that can be inserted into a toolbar.\n * @public\n */\nexport type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;\n\n/** Type for Toolbar Item Id\n * @deprecated in 3.6. Please use `ToolbarItem[\"id\"]` from @itwin/appui-react.\n * @public\n */\nexport type ToolbarItemId = CommonToolbarItem[\"id\"];\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @public\n */\nexport class ToolbarItemUtilities {\n /** Creates an Action Button */\n public static createActionButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton>): ActionButton => ({\n id, itemPriority,\n icon, label,\n execute,\n ...overrides,\n });\n\n /** Creates a Group button. */\n public static createGroupButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton>): GroupButton => ({\n id, itemPriority,\n icon, label,\n items,\n ...overrides,\n });\n\n /** ActionButton type guard. */\n public static isActionButton(item: CommonToolbarItem): item is ActionButton {\n return (item as ActionButton).execute !== undefined;\n }\n\n /** GroupButton type guard. */\n public static isGroupButton(item: CommonToolbarItem): item is GroupButton {\n return (item as GroupButton).items !== undefined;\n }\n\n /** CustomButtonDefinition type guard. */\n public static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition {\n return !!(item as CustomButtonDefinition).isCustom;\n }\n}\n"]}
@@ -13,6 +13,9 @@ exports.IconSpecUtilities = void 0;
13
13
  * @public @deprecated in 4.3. AppUI libraries >= 4.7.x support loading SVGs sources without prefixes, eliminating the need for these utilities.
14
14
  */
15
15
  class IconSpecUtilities {
16
+ /** Prefix for an SVG IconSpec loaded with the Sprite loader */
17
+ static { this.SVG_PREFIX = "svg:"; }
18
+ static { this.WEB_COMPONENT_PREFIX = "webSvg:"; }
16
19
  /** Create an IconSpec for an SVG loaded into web component with sprite loader
17
20
  * This method is deprecated -- use createWebComponentIconSpec()
18
21
  * @public @deprecated in 3.2. Please avoid using the Sprite loader and use IconSpecUtilities.createWebComponentIconSpec() instead.
@@ -47,7 +50,4 @@ class IconSpecUtilities {
47
50
  }
48
51
  }
49
52
  exports.IconSpecUtilities = IconSpecUtilities;
50
- /** Prefix for an SVG IconSpec loaded with the Sprite loader */
51
- IconSpecUtilities.SVG_PREFIX = "svg:";
52
- IconSpecUtilities.WEB_COMPONENT_PREFIX = "webSvg:";
53
53
  //# sourceMappingURL=IconSpecUtilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconSpecUtilities.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qDAAqD;AAErD;;GAEG;AACH,MAAa,iBAAiB;IAK5B;;;MAGE;IACK,MAAM,CAAC,iBAAiB,CAAC,MAAc;QAC5C,OAAO,GAAG,iBAAiB,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC;IACpD,CAAC;IACD;;MAEE;IACK,MAAM,CAAC,0BAA0B,CAAC,SAAiB;QACxD,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACjE,CAAC;IAED;;;MAGE;IACK,MAAM,CAAC,YAAY,CAAC,QAAgB;QACzC,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7E,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;MAEE;IAEK,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IAEnB,CAAC;;AAzCH,8CA0CC;AAzCC,+DAA+D;AACxC,4BAAU,GAAG,MAAM,CAAC;AACpB,sCAAoB,GAAG,SAAS,CAAC","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 Utilities\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Creates an IconSpec with an SVG source and gets the SVG source from an IconSpec.\n * @public @deprecated in 4.3. AppUI libraries >= 4.7.x support loading SVGs sources without prefixes, eliminating the need for these utilities.\n */\nexport class IconSpecUtilities {\n /** Prefix for an SVG IconSpec loaded with the Sprite loader */\n public static readonly SVG_PREFIX = \"svg:\";\n public static readonly WEB_COMPONENT_PREFIX = \"webSvg:\";\n\n /** Create an IconSpec for an SVG loaded into web component with sprite loader\n * This method is deprecated -- use createWebComponentIconSpec()\n * @public @deprecated in 3.2. Please avoid using the Sprite loader and use IconSpecUtilities.createWebComponentIconSpec() instead.\n */\n public static createSvgIconSpec(svgSrc: string): string {\n return `${IconSpecUtilities.SVG_PREFIX}${svgSrc}`;\n }\n /** Create an IconSpec for an SVG loaded into web component with svg-loader\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n public static createWebComponentIconSpec(srcString: string): string {\n return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;\n }\n\n /** Get the SVG Source from an sprite IconSpec\n * This method is deprecated -- use getWebComponentSource()\n * @public @deprecated in 3.2. avoid using the Sprite loader and use IconSpecUtilities.getWebComponentSource() instead.\n */\n public static getSvgSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(IconSpecUtilities.SVG_PREFIX) && iconSpec.length > 4) {\n return iconSpec.slice(4);\n }\n\n return undefined;\n }\n /** Get the SVG Source from an svg-loader IconSpec\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n\n public static getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(IconSpecUtilities.WEB_COMPONENT_PREFIX) && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n\n }\n}\n"]}
1
+ {"version":3,"file":"IconSpecUtilities.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qDAAqD;AAErD;;GAEG;AACH,MAAa,iBAAiB;IAC5B,+DAA+D;aACxC,eAAU,GAAG,MAAM,CAAC;aACpB,yBAAoB,GAAG,SAAS,CAAC;IAExD;;;MAGE;IACK,MAAM,CAAC,iBAAiB,CAAC,MAAc;QAC5C,OAAO,GAAG,iBAAiB,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC;IACpD,CAAC;IACD;;MAEE;IACK,MAAM,CAAC,0BAA0B,CAAC,SAAiB;QACxD,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACjE,CAAC;IAED;;;MAGE;IACK,MAAM,CAAC,YAAY,CAAC,QAAgB;QACzC,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7E,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;MAEE;IAEK,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IAEnB,CAAC;;AAzCH,8CA0CC","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 Utilities\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Creates an IconSpec with an SVG source and gets the SVG source from an IconSpec.\n * @public @deprecated in 4.3. AppUI libraries >= 4.7.x support loading SVGs sources without prefixes, eliminating the need for these utilities.\n */\nexport class IconSpecUtilities {\n /** Prefix for an SVG IconSpec loaded with the Sprite loader */\n public static readonly SVG_PREFIX = \"svg:\";\n public static readonly WEB_COMPONENT_PREFIX = \"webSvg:\";\n\n /** Create an IconSpec for an SVG loaded into web component with sprite loader\n * This method is deprecated -- use createWebComponentIconSpec()\n * @public @deprecated in 3.2. Please avoid using the Sprite loader and use IconSpecUtilities.createWebComponentIconSpec() instead.\n */\n public static createSvgIconSpec(svgSrc: string): string {\n return `${IconSpecUtilities.SVG_PREFIX}${svgSrc}`;\n }\n /** Create an IconSpec for an SVG loaded into web component with svg-loader\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n public static createWebComponentIconSpec(srcString: string): string {\n return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;\n }\n\n /** Get the SVG Source from an sprite IconSpec\n * This method is deprecated -- use getWebComponentSource()\n * @public @deprecated in 3.2. avoid using the Sprite loader and use IconSpecUtilities.getWebComponentSource() instead.\n */\n public static getSvgSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(IconSpecUtilities.SVG_PREFIX) && iconSpec.length > 4) {\n return iconSpec.slice(4);\n }\n\n return undefined;\n }\n /** Get the SVG Source from an svg-loader IconSpec\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n\n public static getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(IconSpecUtilities.WEB_COMPONENT_PREFIX) && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n\n }\n}\n"]}
@@ -204,6 +204,8 @@ export class UiAdmin {
204
204
  static sendUiEvent(args) {
205
205
  UiAdmin.onGenericUiEvent.emit(args);
206
206
  }
207
+ /** GenericUiEvent */
208
+ static { this.onGenericUiEvent = new GenericUiEvent(); }
207
209
  /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.
208
210
  * @param _uiDataProvider The DialogLayoutDataProvider for the dialog
209
211
  * @param _title Specify title for dialog.
@@ -218,6 +220,4 @@ export class UiAdmin {
218
220
  /** Closes the Dialog with a given Id. */
219
221
  closeDialog(_dialogId) { return false; }
220
222
  }
221
- /** GenericUiEvent */
222
- UiAdmin.onGenericUiEvent = new GenericUiEvent();
223
223
  //# sourceMappingURL=UiAdmin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiAdmin.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiAdmin.ts"],"names":[],"mappings":"AAAA;;;+FAG+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O,KAAK,CAAC,CAAC,CAAC;;AAjBhE,sBAAsB;AACC,wBAAgB,GAAG,IAAI,cAAc,EAAE,AAAvB,CAAwB","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 { BentleyError, BentleyStatus, 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 { MessagePresenter } from \"./notification/MessagePresenter\";\n\ninterface XAndY { readonly x: number, readonly y: number }\n\ninterface BentleyErrorWithCategory extends BentleyError {\n category: string;\n}\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 const error = new BentleyError(BentleyStatus.ERROR, \"UiAdmin.messagePresenter not set\") as BentleyErrorWithCategory;\n error.category = \"messagePresenter\";\n throw error;\n }\n\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(): XAndY { return { x: 0, y: 0 }; }\n\n /** Create a PointProps object.\n * @deprecated in 4.2.x. Please use @core/geometry [[XAndY]] or a custom implementation.\n */\n public createXAndY(x: number, y: number): XAndY { 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: XAndY, _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: XAndY, _offset: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _offset: XAndY, _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: XAndY, _offset: XAndY, _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: XAndY, _offset: XAndY, _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"]}
1
+ {"version":3,"file":"UiAdmin.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiAdmin.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AA+C7E;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,SAA6B;CAAI;AAUrE;;GAEG;AACH,MAAM,OAAO,OAAO;IAApB;QACU,kBAAa,GAAY,EAAE,CAAC;IAqPtC,CAAC;IAlPC,qDAAqD;IAC9C,MAAM,KAAK,gBAAgB;QAChC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC/B,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,aAAa,CAAC,KAAK,EAAE,kCAAkC,CAA6B,CAAC;YACpH,KAAK,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YACpC,MAAM,KAAK,CAAC;QACd,CAAC;QAED,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,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A4B;QAClE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yCAAyC;IAClC,sBAAsB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAE1D;;;OAGG;IACI,gBAAgB,CAAC,YAA0B,IAAa,OAAO,KAAK,CAAC,CAAC,CAAC;IAE9E,+BAA+B;IACxB,gBAAgB,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAEpD,sBAAsB;IACf,MAAM,CAAC,WAAW,CAAC,IAAwB;QAChD,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,sBAAsB;aACC,qBAAgB,GAAG,IAAI,cAAc,EAAE,AAAvB,CAAwB;IAE/D;;;;;;;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","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 { BentleyError, BentleyStatus, 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 { MessagePresenter } from \"./notification/MessagePresenter\";\n\ninterface XAndY { readonly x: number, readonly y: number }\n\ninterface BentleyErrorWithCategory extends BentleyError {\n category: string;\n}\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 const error = new BentleyError(BentleyStatus.ERROR, \"UiAdmin.messagePresenter not set\") as BentleyErrorWithCategory;\n error.category = \"messagePresenter\";\n throw error;\n }\n\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(): XAndY { return { x: 0, y: 0 }; }\n\n /** Create a PointProps object.\n * @deprecated in 4.2.x. Please use @core/geometry [[XAndY]] or a custom implementation.\n */\n public createXAndY(x: number, y: number): XAndY { 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: XAndY, _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: XAndY, _offset: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _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: XAndY, _offset: XAndY, _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: XAndY, _offset: XAndY, _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: XAndY, _offset: XAndY, _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"]}
@@ -25,11 +25,14 @@ export var UiItemsApplicationAction;
25
25
  * @public
26
26
  */
27
27
  export class UiItemsManager {
28
+ static { this._registeredUiItemsProviders = new Map(); }
28
29
  /** For use in unit testing
29
30
  * @internal */
30
31
  static clearAllProviders() {
31
32
  UiItemsManager._registeredUiItemsProviders.clear();
32
33
  }
34
+ /** Event raised any time a UiProvider is registered or unregistered. */
35
+ static { this.onUiProviderRegisteredEvent = new BeEvent(); }
33
36
  /** Return number of registered UiProvider. */
34
37
  static get registeredProviderIds() {
35
38
  const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];
@@ -184,7 +187,4 @@ export class UiItemsManager {
184
187
  return widgets;
185
188
  }
186
189
  }
187
- UiItemsManager._registeredUiItemsProviders = new Map();
188
- /** Event raised any time a UiProvider is registered or unregistered. */
189
- UiItemsManager.onUiProviderRegisteredEvent = new BeEvent();
190
190
  //# sourceMappingURL=UiItemsManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,qDAAqD;AACrD;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAQpE,MAAM,cAAc,GAAG,+BAA+B,CAAC;AACvD;;GAEG;AACH,MAAM,CAAN,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IAClC,mCAAmC;IACnC,yEAAK,CAAA;IACL,sCAAsC;IACtC,+EAAQ,CAAA;IACR,wCAAwC;IACxC,2EAAM,CAAA;AACR,CAAC,EAPW,wBAAwB,KAAxB,wBAAwB,QAOnC;AA+CD;;;GAGG;AACH,MAAM,OAAO,cAAc;IAGzB;mBACe;IACR,MAAM,CAAC,iBAAiB;QAC7B,cAAc,CAAC,2BAA2B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAKD,8CAA8C;IACvC,MAAM,KAAK,qBAAqB;QACrC,MAAM,GAAG,GAAG,CAAC,GAAG,cAAc,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC,CAAC;QACnE,OAAO,GAAG,CAAC;IACb,CAAC;IAED,yDAAyD;IAClD,MAAM,KAAK,sBAAsB;QACtC,OAAO,IAAI,CAAC,2BAA2B,CAAC,IAAI,GAAG,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;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D,OAAO,OAAO,CAAC;QAEjB,cAAc,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC,KAA0B,EAAE,EAAE;YAChF,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC;YAClC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,UAAU,IAAI,UAAU,CAAC,EAAE,CAAC;YAEhE,uBAAuB;YACvB,IAAI,UAAU,CAAC,cAAc,IAAI,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC;gBACzF,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC;qBAC1F,OAAO,CAAC,CAAC,MAA2B,EAAE,EAAE;oBACvC,uBAAuB;oBACvB,IAAI,CAAC,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC;wBAC3E,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;YACP,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA9Lc,0CAA2B,GAAqC,IAAI,GAAG,EAA+B,CAAC;AAQtH,wEAAwE;AACjD,0CAA2B,GAAG,IAAI,OAAO,EAAmD,CAAC","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 @typescript-eslint/no-deprecated */\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 { UiItemsProvider } from \"./UiItemsProvider\";\n\nconst loggerCategory = \"appui-abstract.UiItemsManager\";\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\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"stageIds\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"stageUsages\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\" | \"stageIds\">;\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, `UiItemsProvider (${providerId}) is already loaded`);\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });\n Logger.logInfo(loggerCategory, `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, `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"]}
1
+ {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,qDAAqD;AACrD;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAQpE,MAAM,cAAc,GAAG,+BAA+B,CAAC;AACvD;;GAEG;AACH,MAAM,CAAN,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IAClC,mCA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AC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC;wBAC3E,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;YACP,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC","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 @typescript-eslint/no-deprecated */\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 { UiItemsProvider } from \"./UiItemsProvider\";\n\nconst loggerCategory = \"appui-abstract.UiItemsManager\";\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\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"stageIds\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"stageUsages\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\" | \"stageIds\">;\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, `UiItemsProvider (${providerId}) is already loaded`);\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });\n Logger.logInfo(loggerCategory, `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, `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"]}