@itwin/appui-abstract 4.0.0-dev.54 → 4.0.0-dev.55

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -1
  2. package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
  3. package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
  4. package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -1
  5. package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +1 -1
  6. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
  7. package/lib/cjs/appui-abstract/common/KeyboardKey.js.map +1 -1
  8. package/lib/cjs/appui-abstract/content/ContentLayoutProps.js.map +1 -1
  9. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  10. package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
  11. package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
  12. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  13. package/lib/cjs/appui-abstract/items/AbstractItemProps.js.map +1 -1
  14. package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
  15. package/lib/cjs/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
  16. package/lib/cjs/appui-abstract/items/BadgeType.js.map +1 -1
  17. package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
  18. package/lib/cjs/appui-abstract/items/ConditionalStringValue.js.map +1 -1
  19. package/lib/cjs/appui-abstract/items/ProvidedItem.js.map +1 -1
  20. package/lib/cjs/appui-abstract/items/RelativePosition.js.map +1 -1
  21. package/lib/cjs/appui-abstract/items/StageUsage.js.map +1 -1
  22. package/lib/cjs/appui-abstract/notification/MessagePresenter.js.map +1 -1
  23. package/lib/cjs/appui-abstract/notification/MessageSeverity.js.map +1 -1
  24. package/lib/cjs/appui-abstract/properties/Description.js.map +1 -1
  25. package/lib/cjs/appui-abstract/properties/EditorParams.js.map +1 -1
  26. package/lib/cjs/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
  27. package/lib/cjs/appui-abstract/properties/Record.js.map +1 -1
  28. package/lib/cjs/appui-abstract/properties/StandardEditorNames.js.map +1 -1
  29. package/lib/cjs/appui-abstract/properties/StandardTypeNames.js.map +1 -1
  30. package/lib/cjs/appui-abstract/properties/Value.js.map +1 -1
  31. package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
  32. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  33. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
  34. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  35. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
  36. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  37. package/lib/cjs/appui-abstract/utils/PointProps.js.map +1 -1
  38. package/lib/cjs/appui-abstract/utils/UiError.js.map +1 -1
  39. package/lib/cjs/appui-abstract/utils/UiEvent.js.map +1 -1
  40. package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
  41. package/lib/cjs/appui-abstract/utils/callbacks.js.map +1 -1
  42. package/lib/cjs/appui-abstract/utils/filter/charCode.js.map +1 -1
  43. package/lib/cjs/appui-abstract/utils/filter/filters.js.map +1 -1
  44. package/lib/cjs/appui-abstract/utils/filter/map.js.map +1 -1
  45. package/lib/cjs/appui-abstract/utils/filter/strings.js.map +1 -1
  46. package/lib/cjs/appui-abstract/utils/isLetter.js.map +1 -1
  47. package/lib/cjs/appui-abstract/utils/misc.js.map +1 -1
  48. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
  49. package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -1
  50. package/lib/cjs/appui-abstract/widget/WidgetState.js.map +1 -1
  51. package/lib/cjs/appui-abstract.js.map +1 -1
  52. package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -1
  53. package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
  54. package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
  55. package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -1
  56. package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +1 -1
  57. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
  58. package/lib/esm/appui-abstract/common/KeyboardKey.js.map +1 -1
  59. package/lib/esm/appui-abstract/content/ContentLayoutProps.js.map +1 -1
  60. package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  61. package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
  62. package/lib/esm/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
  63. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  64. package/lib/esm/appui-abstract/items/AbstractItemProps.js.map +1 -1
  65. package/lib/esm/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
  66. package/lib/esm/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
  67. package/lib/esm/appui-abstract/items/BadgeType.js.map +1 -1
  68. package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
  69. package/lib/esm/appui-abstract/items/ConditionalStringValue.js.map +1 -1
  70. package/lib/esm/appui-abstract/items/ProvidedItem.js.map +1 -1
  71. package/lib/esm/appui-abstract/items/RelativePosition.js.map +1 -1
  72. package/lib/esm/appui-abstract/items/StageUsage.js.map +1 -1
  73. package/lib/esm/appui-abstract/notification/MessagePresenter.js.map +1 -1
  74. package/lib/esm/appui-abstract/notification/MessageSeverity.js.map +1 -1
  75. package/lib/esm/appui-abstract/properties/Description.js.map +1 -1
  76. package/lib/esm/appui-abstract/properties/EditorParams.js.map +1 -1
  77. package/lib/esm/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
  78. package/lib/esm/appui-abstract/properties/Record.js.map +1 -1
  79. package/lib/esm/appui-abstract/properties/StandardEditorNames.js.map +1 -1
  80. package/lib/esm/appui-abstract/properties/StandardTypeNames.js.map +1 -1
  81. package/lib/esm/appui-abstract/properties/Value.js.map +1 -1
  82. package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
  83. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  84. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
  85. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  86. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
  87. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  88. package/lib/esm/appui-abstract/utils/PointProps.js.map +1 -1
  89. package/lib/esm/appui-abstract/utils/UiError.js.map +1 -1
  90. package/lib/esm/appui-abstract/utils/UiEvent.js.map +1 -1
  91. package/lib/esm/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
  92. package/lib/esm/appui-abstract/utils/callbacks.js.map +1 -1
  93. package/lib/esm/appui-abstract/utils/filter/charCode.js.map +1 -1
  94. package/lib/esm/appui-abstract/utils/filter/filters.js.map +1 -1
  95. package/lib/esm/appui-abstract/utils/filter/map.js.map +1 -1
  96. package/lib/esm/appui-abstract/utils/filter/strings.js.map +1 -1
  97. package/lib/esm/appui-abstract/utils/isLetter.js.map +1 -1
  98. package/lib/esm/appui-abstract/utils/misc.js.map +1 -1
  99. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
  100. package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -1
  101. package/lib/esm/appui-abstract/widget/WidgetState.js.map +1 -1
  102. package/lib/esm/appui-abstract.js.map +1 -1
  103. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"BaseUiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAOH,mD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,CAAC;QAE3B,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SACjF;aAAM;YACL,cAAc,GAAG,CAAC,UAAU,KAAK,uBAAU,CAAC,OAAO,CAAC,CAAC;SACtD;QAED,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrG,CAAC;IAEM,sBAAsB,CAAC,QAAgB,EAAE,WAAmB,EAAE,SAA6B,EAAE,QAA4B,EAAE,aAAoC,EAAE,aAAmB;QACzL,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,cAAc,CAAC,OAAe,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B,EAClH,aAAoC,EAAE,YAAkB;QACxD,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SACjF;aAAM;YACL,cAAc,GAAG,CAAC,UAAU,KAAK,uBAAU,CAAC,OAAO,CAAC,CAAC;SACtD;QAED,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChI,CAAC;CACF;AAnED,kDAmEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable deprecation/deprecation */\n/** @packageDocumentation\n * @module UiItemsProvider\n */\n\nimport { BackstageItem } from \"./backstage/BackstageItem\";\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\nimport { StageUsage } from \"./items/StageUsage\";\nimport { UiItemsProvider } from \"./UiItemsProvider\";\nimport { UiItemsManager } from \"./UiItemsManager\";\n\n/** Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the\n * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.\n * @deprecated in 3.6. Use [BaseUiItemsProvider]($appui-react) instead.\n * @public\n */\nexport class BaseUiItemsProvider implements UiItemsProvider {\n /*\n * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want\n * to set up custom stage with their own subset of standard tools.\n * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and\n * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.\n */\n constructor(protected _providerId: string, public isSupportedStage?: (stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider) => boolean) { }\n\n public get id(): string { return this._providerId; }\n public onUnregister(): void { }\n\n public unregister() {\n UiItemsManager.unregister(this._providerId);\n }\n\n /** Backstage items are not stage specific so no callback is used */\n public provideBackstageItems(): BackstageItem[] {\n return [];\n }\n\n public provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[] {\n return [];\n }\n public provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\n let provideToStage = false;\n\n if (this.isSupportedStage) {\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\n } else {\n provideToStage = (stageUsage === StageUsage.General);\n }\n\n return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];\n }\n\n public provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[] {\n return [];\n }\n public provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\n let provideToStage = false;\n\n if (this.isSupportedStage) {\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\n } else {\n provideToStage = (stageUsage === StageUsage.General);\n }\n\n return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];\n }\n\n public provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, _stageAppData?: any): AbstractWidgetProps[] {\n return [];\n }\n\n public provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection,\n _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\n let provideToStage = false;\n\n if (this.isSupportedStage) {\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\n } else {\n provideToStage = (stageUsage === StageUsage.General);\n }\n\n return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, _zoneLocation, stageAppData) : [];\n }\n}\n"]}
1
+ {"version":3,"file":"BaseUiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAOH,mDAAgD;AAEhD,qDAAkD;AAElD;;;;GAIG;AACH,MAAa,mBAAmB;IAC9B;;;;;OAKG;IACH,YAAsB,WAAmB,EAAS,gBAAmH;QAA/I,gBAAW,GAAX,WAAW,CAAQ;QAAS,qBAAgB,GAAhB,gBAAgB,CAAmG;IAAI,CAAC;IAE1K,IAAW,EAAE,KAAa,OAAO,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;SACtD;QAED,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrG,CAAC;IAEM,sBAAsB,CAAC,QAAgB,EAAE,WAAmB,EAAE,SAA6B,EAAE,QAA4B,EAAE,aAAoC,EAAE,aAAmB;QACzL,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,cAAc,CAAC,OAAe,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B,EAClH,aAAoC,EAAE,YAAkB;QACxD,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SACjF;aAAM;YACL,cAAc,GAAG,CAAC,UAAU,KAAK,uBAAU,CAAC,OAAO,CAAC,CAAC;SACtD;QAED,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChI,CAAC;CACF;AAnED,kDAmEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\nimport { StageUsage } from \"./items/StageUsage\";\r\nimport { UiItemsProvider } from \"./UiItemsProvider\";\r\nimport { UiItemsManager } from \"./UiItemsManager\";\r\n\r\n/** Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the\r\n * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.\r\n * @deprecated in 3.6. Use [BaseUiItemsProvider]($appui-react) instead.\r\n * @public\r\n */\r\nexport class BaseUiItemsProvider implements UiItemsProvider {\r\n /*\r\n * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want\r\n * to set up custom stage with their own subset of standard tools.\r\n * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and\r\n * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.\r\n */\r\n constructor(protected _providerId: string, public isSupportedStage?: (stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider) => boolean) { }\r\n\r\n public get id(): string { return this._providerId; }\r\n public onUnregister(): void { }\r\n\r\n public unregister() {\r\n UiItemsManager.unregister(this._providerId);\r\n }\r\n\r\n /** Backstage items are not stage specific so no callback is used */\r\n public provideBackstageItems(): BackstageItem[] {\r\n return [];\r\n }\r\n\r\n public provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[] {\r\n return [];\r\n }\r\n public provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];\r\n }\r\n\r\n public provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[] {\r\n return [];\r\n }\r\n public provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];\r\n }\r\n\r\n public provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, _stageAppData?: any): AbstractWidgetProps[] {\r\n return [];\r\n }\r\n\r\n public provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection,\r\n _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, _zoneLocation, stageAppData) : [];\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UiAdmin.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiAdmin.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAWhD,uCAA8C;AAE9C,6CAA0C;AA+B1C;;GAEG;AACH,MAAa,cAAe,SAAQ,wBAA6B;CAAI;AAArE,wCAAqE;AAUrE;;GAEG;AACH,MAAa,OAAO;IAApB;QACU,kBAAa,GAAY,EAAE,CAAC;IA+OtC,CAAC;IA5OC,qDAAqD;IAC9C,MAAM,KAAK,gBAAgB;QAChC,IAA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,MAA2C,EAAE,aAA+C,EACnH,SAAqB,EAAE,OAAmB,EAAE,eAAmC,EAAE,SAAuB,EACxG,iBAAoC,EAAE,cAA4B;QAClE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,sBAAsB;IACf,QAAQ,KAAc,OAAO,KAAK,CAAC,CAAC,CAAC;IAE5C;;;;;;;;OAQG;IACI,qBAAqB,CAC1B,aAA6B,EAAE,SAAqB,EAAE,OAAmB,EAAE,SAAuB,EAClG,iBAAoC,EAAE,cAA4B;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;IAID;;;;;;;OAOG;IACI,UAAU,CAAC,eAAyC,EAAE,MAAc,EAAE,QAAiB,EAAE,GAAW,EACzG,cAA4B;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yCAAyC;IAClC,WAAW,CAAC,SAAiB,IAAa,OAAO,KAAK,CAAC,CAAC,CAAC;;AAjBhE,sBAAsB;AACC,wBAAgB,GAAG,IAAI,cAAc,EAAE,AAAvB,CAAwB;AA/NpD,0BAAO","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UiAdmin\n */\n\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport { AbstractMenuItemProps } from \"./items/AbstractMenuItemProps\";\nimport { AbstractToolbarProps } from \"./items/AbstractToolbarProps\";\nimport { RelativePosition } from \"./items/RelativePosition\";\nimport { PropertyDescription } from \"./properties/Description\";\nimport { Primitives } from \"./properties/PrimitiveTypes\";\nimport { OnCancelFunc, OnItemExecutedFunc, OnNumberCommitFunc, OnValueCommitFunc } from \"./utils/callbacks\";\nimport { PropertyRecord } from \"./properties/Record\";\nimport { UiDataProvider } from \"./dialogs/UiDataProvider\";\nimport { DialogLayoutDataProvider } from \"./dialogs/UiLayoutDataProvider\";\nimport { PointProps } from \"./utils/PointProps\";\nimport { loggerCategory } from \"./utils/misc\";\nimport { MessagePresenter } from \"./notification/MessagePresenter\";\nimport { UiError } from \"./utils/UiError\";\n\n/** The Generic UI Event args contains information useful for any UI message\n * @public\n */\nexport interface GenericUiEventArgs {\n uiComponentId: string;\n}\n\n/** Optional props to pass to the Dialog control that is generated.\n * @public\n */\nexport interface DialogProps {\n /** Indicates whether the user can resize dialog with cursor. */\n resizable?: boolean;\n /** Indicates whether the user can move dialog with cursor.*/\n movable?: boolean;\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n width?: string | number;\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n height?: string | number;\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n minWidth?: string | number;\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n minHeight?: string | number;\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxWidth?: string | number;\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\n maxHeight?: string | number;\n}\n\n/** The GenericUiEvent is the base event class for UI events that target a specific component, as identified in uiComponentId.\n * @public\n */\nexport class GenericUiEvent extends BeUiEvent<GenericUiEventArgs> { }\n\n/** Flags that control enabling/disabling certain UI features\n * @public\n */\nexport interface UiFlags {\n /** if true then Ctrl+F2 will show popup key-in palette */\n allowKeyinPalette?: boolean;\n}\n\n/** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.\n * @public\n */\nexport class UiAdmin {\n private _featureFlags: UiFlags = {};\n private static _messagePresenter?: MessagePresenter;\n\n /** The MessagePresenter used to display messages. */\n public static get messagePresenter(): MessagePresenter {\n if (!UiAdmin._messagePresenter)\n throw new UiError(loggerCategory(this), \"UiAdmin.messagePresenter not set\");\n return UiAdmin._messagePresenter;\n }\n public static set messagePresenter(mp: MessagePresenter) {\n UiAdmin._messagePresenter = mp;\n }\n\n public get featureFlags(): UiFlags {\n return { ...this._featureFlags }; // return copy so no direct access to modify value\n }\n\n public updateFeatureFlags(uiFlags: UiFlags) {\n this._featureFlags = { ...this._featureFlags, ...uiFlags };\n }\n\n /** @internal */\n public onInitialized() { }\n\n /** Get the cursor X and Y position. */\n public get cursorPosition(): PointProps { return { x: 0, y: 0 }; }\n\n /** Create a PointProps object. */\n public createXAndY(x: number, y: number): PointProps { return { x, y }; }\n\n /** Determines if focus is set to Home */\n public get isFocusOnHome(): boolean { return false; }\n\n /** Sets focus to Home */\n public setFocusToHome(): void { }\n\n /** Show a context menu at a particular location.\n * @param _menuItemsProps Properties of the menu items to display.\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public showContextMenu(_menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show a Toolbar at a particular location.\n * @param _toolbarProps Properties of the Toolbar to display.\n * @param _location Location of the Toolbar, relative to the origin of htmlElement or the window.\n * @param _offset Offset of the Toolbar from the location.\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public showToolbar(\n _toolbarProps: AbstractToolbarProps, _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the toolbar. */\n public hideToolbar(): boolean { return false; }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\n * @param _menuItemsProps Properties of the menu items to display.\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the button was displayed, false if the button could not be displayed.\n */\n public showMenuButton(_id: string, _menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides a menu button.\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public hideMenuButton(_id: string): boolean { return false; }\n\n /** Show a calculator at a particular location.\n * @param _initialValue Value initially displayed in the calculator.\n * @param _resultIcon Icon displayed to the left of the value.\n * @param _location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the calculator was displayed, false if the calculator could not be displayed.\n */\n public showCalculator(_initialValue: number, _resultIcon: string, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the calculator. */\n public hideCalculator(): boolean { return false; }\n\n /** Show an input editor for an angle value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showAngleEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showLengthEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showHeightEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param _initialValue Value initially displayed in the editor.\n * @param _propertyDescription Description of the primitive value property.\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public showInputEditor(_initialValue: Primitives.Value, _propertyDescription: PropertyDescription, _location: PointProps, _onCommit: OnValueCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the input editor. */\n public hideInputEditor(): boolean { return false; }\n\n /** Show an HTML element at a particular location.\n * @param _displayElement The HTMLElement to display\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param _offset Offset of the display element from the location\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public showHTMLElement(\n _displayElement: HTMLElement, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the HTML Element. */\n public hideHTMLElement(): boolean { return false; }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param _content The HTMLElement of the content to display\n * @param _title Title to display at the top of the card.\n * @param _toolbarProps Properties of the Toolbar to display.\n * @param _location Location of the Card, relative to the origin of anchorElement or the window.\n * @param _offset Offset of the Card from the location.\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showCard(\n _content: HTMLElement, _title: string | PropertyRecord | undefined, _toolbarProps: AbstractToolbarProps | undefined,\n _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Hides the Card. */\n public hideCard(): boolean { return false; }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param _dataProvider The UiDataProvider for the tool settings\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param _offset Offset of the tool settings from the location\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\n * @param _anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public openToolSettingsPopup(\n _dataProvider: UiDataProvider, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\n return false;\n }\n\n /** Closes the Tool Settings Ui popup. */\n public closeToolSettingsPopup(): boolean { return false; }\n\n /** Show the Keyin Palette to display all support Tool key-ins.\n * @param _htmlElement The HTMLElement that anchors the Keyin Palette. If undefined, the location is relative to the overall window.\n * @return true if the Keyin Palette was displayed, false if it could not be displayed.\n */\n public showKeyinPalette(_htmlElement?: HTMLElement): boolean { return false; }\n\n /** Hides the Keyin Palette. */\n public hideKeyinPalette(): boolean { return false; }\n\n /** Send a UI event */\n public static sendUiEvent(args: GenericUiEventArgs) {\n UiAdmin.onGenericUiEvent.emit(args);\n }\n /** GenericUiEvent */\n public static readonly onGenericUiEvent = new GenericUiEvent();\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param _uiDataProvider The DialogLayoutDataProvider for the dialog\n * @param _title Specify title for dialog.\n * @param _isModal Specify if the dialog is opened as a modal or modeless.\n * @param _id Id of the dialog that is used to close it.\n * @param _optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public openDialog(_uiDataProvider: DialogLayoutDataProvider, _title: string, _isModal: boolean, _id: string,\n _optionalProps?: DialogProps): boolean {\n return false;\n }\n\n /** Closes the Dialog with a given Id. */\n public closeDialog(_dialogId: string): boolean { return false; }\n}\n"]}
1
+ {"version":3,"file":"UiAdmin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AAjBhE,sBAAsB;AACC,wBAAgB,GAAG,IAAI,cAAc,EAAE,AAAvB,CAAwB;AA/NpD,0BAAO","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiAdmin\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\nimport { AbstractMenuItemProps } from \"./items/AbstractMenuItemProps\";\r\nimport { AbstractToolbarProps } from \"./items/AbstractToolbarProps\";\r\nimport { RelativePosition } from \"./items/RelativePosition\";\r\nimport { PropertyDescription } from \"./properties/Description\";\r\nimport { Primitives } from \"./properties/PrimitiveTypes\";\r\nimport { OnCancelFunc, OnItemExecutedFunc, OnNumberCommitFunc, OnValueCommitFunc } from \"./utils/callbacks\";\r\nimport { PropertyRecord } from \"./properties/Record\";\r\nimport { UiDataProvider } from \"./dialogs/UiDataProvider\";\r\nimport { DialogLayoutDataProvider } from \"./dialogs/UiLayoutDataProvider\";\r\nimport { PointProps } from \"./utils/PointProps\";\r\nimport { loggerCategory } from \"./utils/misc\";\r\nimport { MessagePresenter } from \"./notification/MessagePresenter\";\r\nimport { UiError } from \"./utils/UiError\";\r\n\r\n/** The Generic UI Event args contains information useful for any UI message\r\n * @public\r\n */\r\nexport interface GenericUiEventArgs {\r\n uiComponentId: string;\r\n}\r\n\r\n/** Optional props to pass to the Dialog control that is generated.\r\n * @public\r\n */\r\nexport interface DialogProps {\r\n /** Indicates whether the user can resize dialog with cursor. */\r\n resizable?: boolean;\r\n /** Indicates whether the user can move dialog with cursor.*/\r\n movable?: boolean;\r\n /** Initial width of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n width?: string | number;\r\n /** Initial height of dialog. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n height?: string | number;\r\n /** Minimum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n minWidth?: string | number;\r\n /** Minimum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n minHeight?: string | number;\r\n /** Maximum width that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxWidth?: string | number;\r\n /** Maximum height that the dialog may be resized to. Displayed in px if value is a number; otherwise, displayed in specified CSS unit. */\r\n maxHeight?: string | number;\r\n}\r\n\r\n/** The GenericUiEvent is the base event class for UI events that target a specific component, as identified in uiComponentId.\r\n * @public\r\n */\r\nexport class GenericUiEvent extends BeUiEvent<GenericUiEventArgs> { }\r\n\r\n/** Flags that control enabling/disabling certain UI features\r\n * @public\r\n */\r\nexport interface UiFlags {\r\n /** if true then Ctrl+F2 will show popup key-in palette */\r\n allowKeyinPalette?: boolean;\r\n}\r\n\r\n/** The UiAdmin controls various UI components and is callable from IModelApp.uiAdmin in the core-frontend package.\r\n * @public\r\n */\r\nexport class UiAdmin {\r\n private _featureFlags: UiFlags = {};\r\n private static _messagePresenter?: MessagePresenter;\r\n\r\n /** The MessagePresenter used to display messages. */\r\n public static get messagePresenter(): MessagePresenter {\r\n if (!UiAdmin._messagePresenter)\r\n throw new UiError(loggerCategory(this), \"UiAdmin.messagePresenter not set\");\r\n return UiAdmin._messagePresenter;\r\n }\r\n public static set messagePresenter(mp: MessagePresenter) {\r\n UiAdmin._messagePresenter = mp;\r\n }\r\n\r\n public get featureFlags(): UiFlags {\r\n return { ...this._featureFlags }; // return copy so no direct access to modify value\r\n }\r\n\r\n public updateFeatureFlags(uiFlags: UiFlags) {\r\n this._featureFlags = { ...this._featureFlags, ...uiFlags };\r\n }\r\n\r\n /** @internal */\r\n public onInitialized() { }\r\n\r\n /** Get the cursor X and Y position. */\r\n public get cursorPosition(): PointProps { return { x: 0, y: 0 }; }\r\n\r\n /** Create a PointProps object. */\r\n public createXAndY(x: number, y: number): PointProps { return { x, y }; }\r\n\r\n /** Determines if focus is set to Home */\r\n public get isFocusOnHome(): boolean { return false; }\r\n\r\n /** Sets focus to Home */\r\n public setFocusToHome(): void { }\r\n\r\n /** Show a context menu at a particular location.\r\n * @param _menuItemsProps Properties of the menu items to display.\r\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the menu was displayed, false if the menu could not be displayed.\r\n */\r\n public showContextMenu(_menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show a Toolbar at a particular location.\r\n * @param _toolbarProps Properties of the Toolbar to display.\r\n * @param _location Location of the Toolbar, relative to the origin of htmlElement or the window.\r\n * @param _offset Offset of the Toolbar from the location.\r\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\r\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\r\n */\r\n public showToolbar(\r\n _toolbarProps: AbstractToolbarProps, _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the toolbar. */\r\n public hideToolbar(): boolean { return false; }\r\n\r\n /** Show a menu button at a particular location. A menu button opens a context menu.\r\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\r\n * @param _menuItemsProps Properties of the menu items to display.\r\n * @param _location Location of the context menu, relative to the origin of htmlElement or the window.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the button was displayed, false if the button could not be displayed.\r\n */\r\n public showMenuButton(_id: string, _menuItemsProps: AbstractMenuItemProps[], _location: PointProps, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides a menu button.\r\n * @param _id Id of the menu button. Multiple menu buttons may be displayed.\r\n * @return true if the menu was hidden, false if the menu could not be hidden.\r\n */\r\n public hideMenuButton(_id: string): boolean { return false; }\r\n\r\n /** Show a calculator at a particular location.\r\n * @param _initialValue Value initially displayed in the calculator.\r\n * @param _resultIcon Icon displayed to the left of the value.\r\n * @param _location Location of the calculator, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the calculator was displayed, false if the calculator could not be displayed.\r\n */\r\n public showCalculator(_initialValue: number, _resultIcon: string, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the calculator. */\r\n public hideCalculator(): boolean { return false; }\r\n\r\n /** Show an input editor for an angle value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showAngleEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show an input editor for a length value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showLengthEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show an input editor for a height value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showHeightEditor(_initialValue: number, _location: PointProps, _onCommit: OnNumberCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Show an input editor for a primitive value at a particular location.\r\n * @param _initialValue Value initially displayed in the editor.\r\n * @param _propertyDescription Description of the primitive value property.\r\n * @param _location Location of the editor, relative to the origin of htmlElement or the window.\r\n * @param _onCommit Function called when the OK button or the Enter key is pressed.\r\n * @param _onCancel Function called when the Cancel button or the Escape key is pressed.\r\n * @param _htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\r\n * @return true if the editor was displayed, false if the editor could not be displayed.\r\n */\r\n public showInputEditor(_initialValue: Primitives.Value, _propertyDescription: PropertyDescription, _location: PointProps, _onCommit: OnValueCommitFunc, _onCancel: OnCancelFunc, _htmlElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the input editor. */\r\n public hideInputEditor(): boolean { return false; }\r\n\r\n /** Show an HTML element at a particular location.\r\n * @param _displayElement The HTMLElement to display\r\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\r\n * @param _offset Offset of the display element from the location\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\r\n * @return true if the display element was displayed, false if the display element could not be displayed.\r\n */\r\n public showHTMLElement(\r\n _displayElement: HTMLElement, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the HTML Element. */\r\n public hideHTMLElement(): boolean { return false; }\r\n\r\n /** Show a Card containing content, a title and a toolbar at a particular location.\r\n * @param _content The HTMLElement of the content to display\r\n * @param _title Title to display at the top of the card.\r\n * @param _toolbarProps Properties of the Toolbar to display.\r\n * @param _location Location of the Card, relative to the origin of anchorElement or the window.\r\n * @param _offset Offset of the Card from the location.\r\n * @param _onItemExecuted Function invoked after a Toolbar item is executed\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\r\n * @return true if the Card was displayed, false if the Card could not be displayed.\r\n */\r\n public showCard(\r\n _content: HTMLElement, _title: string | PropertyRecord | undefined, _toolbarProps: AbstractToolbarProps | undefined,\r\n _location: PointProps, _offset: PointProps, _onItemExecuted: OnItemExecutedFunc, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Hides the Card. */\r\n public hideCard(): boolean { return false; }\r\n\r\n /** Opens a Tool Settings Ui popup at a particular location.\r\n * @param _dataProvider The UiDataProvider for the tool settings\r\n * @param _location Location of the tool settings, relative to the origin of anchorElement or the window\r\n * @param _offset Offset of the tool settings from the location\r\n * @param _onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\r\n * @param _relativePosition Position relative to the given location. Defaults to TopRight.\r\n * @param _anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\r\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\r\n */\r\n public openToolSettingsPopup(\r\n _dataProvider: UiDataProvider, _location: PointProps, _offset: PointProps, _onCancel: OnCancelFunc,\r\n _relativePosition?: RelativePosition, _anchorElement?: HTMLElement): boolean {\r\n return false;\r\n }\r\n\r\n /** Closes the Tool Settings Ui popup. */\r\n public closeToolSettingsPopup(): boolean { return false; }\r\n\r\n /** Show the Keyin Palette to display all support Tool key-ins.\r\n * @param _htmlElement The HTMLElement that anchors the Keyin Palette. If undefined, the location is relative to the overall window.\r\n * @return true if the Keyin Palette was displayed, false if it could not be displayed.\r\n */\r\n public showKeyinPalette(_htmlElement?: HTMLElement): boolean { return false; }\r\n\r\n /** Hides the Keyin Palette. */\r\n public hideKeyinPalette(): boolean { return false; }\r\n\r\n /** Send a UI event */\r\n public static sendUiEvent(args: GenericUiEventArgs) {\r\n UiAdmin.onGenericUiEvent.emit(args);\r\n }\r\n /** GenericUiEvent */\r\n public static readonly onGenericUiEvent = new GenericUiEvent();\r\n\r\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\r\n * @param _uiDataProvider The DialogLayoutDataProvider for the dialog\r\n * @param _title Specify title for dialog.\r\n * @param _isModal Specify if the dialog is opened as a modal or modeless.\r\n * @param _id Id of the dialog that is used to close it.\r\n * @param _optionalProps Optional props for Dialog construction.\r\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\r\n */\r\n public openDialog(_uiDataProvider: DialogLayoutDataProvider, _title: string, _isModal: boolean, _id: string,\r\n _optionalProps?: DialogProps): boolean {\r\n return false;\r\n }\r\n\r\n /** Closes the Dialog with a given Id. */\r\n public closeDialog(_dialogId: string): boolean { return false; }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,sDAAoE;AAMpE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CAAC,CAAC,YAAY,EAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAE;wBAC3E,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;aACN;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA9Lc,0CAA2B,GAAqC,IAAI,GAAG,EAA+B,CAAC;AAQtH,wEAAwE;AACjD,0CAA2B,GAAG,IAAI,sBAAO,EAAmD,CAAC;AAVzG,wCAAc","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/* eslint-disable deprecation/deprecation */\n/** @packageDocumentation\n * @module UiItemsProvider\n */\n\nimport { BeEvent, Logger, MarkRequired } from \"@itwin/core-bentley\";\nimport { BackstageItem } from \"./backstage/BackstageItem\";\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\nimport { loggerCategory } from \"./utils/misc\";\nimport { UiItemsProvider } from \"./UiItemsProvider\";\n\n/** Action taken by the application on item provided by a UiItemsProvider\n * @public @deprecated in 3.2. This was only used by the previously removed UiItemsArbiter.\n */\nexport enum UiItemsApplicationAction {\n /** Allow the change to the item */\n Allow,\n /** Disallow the change to the item */\n Disallow,\n /** Update the item during the change */\n Update,\n}\n\n/** UIProvider Registered Event Args interface.\n * @deprecated in 3.6. Use [UiItemsProviderRegisteredEventArgs]($appui-react) instead.\n * @public\n */\nexport interface UiItemProviderRegisteredEventArgs {\n providerId: string;\n}\n\n/** UiItemProviderOverrides allows the application that registers a provider to limit when it is allowed to provide items\n * @deprecated in 3.6. Use [AllowedUiItemsProviderOverrides]($appui-react) instead.\n * @public\n */\nexport interface AllowedUiItemProviderOverrides {\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages\n * @beta\n */\n providerId?: string;\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided\n * @beta\n */\n stageUsages?: string[];\n /** if specified then the current stage's Id will be compared before allowing any items to be provided\n * @beta\n */\n stageIds?: string[];\n}\n\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\n * items are allowed.\n * @deprecated in 3.6. Use [UiItemsProviderOverrides]($appui-react) instead.\n * @public\n */\nexport type UiItemProviderOverrides = MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\"> |\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\n MarkRequired<AllowedUiItemProviderOverrides, \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\n MarkRequired<AllowedUiItemProviderOverrides, \"stageUsages\"> | // eslint-disable-line @typescript-eslint/indent\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\" | \"stageIds\">; // eslint-disable-line @typescript-eslint/indent\n\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\ninterface UiItemProviderEntry {\n provider: UiItemsProvider;\n overrides?: UiItemProviderOverrides;\n}\n\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\n * @deprecated in 3.6. Use [UiItemsManager]($appui-react) instead.\n * @public\n */\nexport class UiItemsManager {\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> = new Map<string, UiItemProviderEntry>();\n\n /** For use in unit testing\n * @internal */\n public static clearAllProviders() {\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n public static readonly onUiProviderRegisteredEvent = new BeEvent<(ev: UiItemProviderRegisteredEventArgs) => void>();\n\n /** Return number of registered UiProvider. */\n public static get registeredProviderIds() {\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\n return ids;\n }\n\n /** Return true if there is any registered UiProvider. */\n public static get hasRegisteredProviders(): boolean {\n return this._registeredUiItemsProviders.size > 0;\n }\n\n /**\n * Retrieves a previously loaded UiItemsProvider.\n * @param providerId id of the UiItemsProvider to get\n */\n public static getUiItemsProvider(providerId: string): UiItemsProvider | undefined {\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\n }\n\n private static sendRegisteredEvent(ev: UiItemProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(ev);\n }\n\n /**\n * Registers a UiItemsProvider with the UiItemsManager.\n * @param uiProvider the UI items provider to register.\n */\n public static register(uiProvider: UiItemsProvider, overrides?: UiItemProviderOverrides): void {\n const providerId = overrides?.providerId ?? uiProvider.id;\n\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${providerId}) is already loaded`);\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });\n Logger.logInfo(loggerCategory(this), `UiItemsProvider ${uiProvider.id} registered as ${providerId} `);\n\n UiItemsManager.sendRegisteredEvent({ providerId } as UiItemProviderRegisteredEventArgs);\n }\n }\n\n /** Remove a specific UiItemsProvider from the list of available providers. */\n public static unregister(uiProviderId: string): void {\n const provider = UiItemsManager.getUiItemsProvider(uiProviderId);\n if (!provider)\n return;\n\n provider.onUnregister && provider.onUnregister();\n\n UiItemsManager._registeredUiItemsProviders.delete(uiProviderId);\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProviderId}) unloaded`);\n\n // trigger a refresh of the ui\n UiItemsManager.sendRegisteredEvent({ providerId: uiProviderId } as UiItemProviderRegisteredEventArgs);\n }\n\n private static allowItemsFromProvider(entry: UiItemProviderEntry, stageId?: string, stageUsage?: string) {\n // istanbul ignore else\n const overrides = entry.overrides;\n if (undefined !== stageId && overrides?.stageIds && !(overrides.stageIds.some((value: string) => value === stageId)))\n return false;\n if (undefined !== stageUsage && overrides?.stageUsages && !(overrides.stageUsages.some((value: string) => value === stageUsage)))\n return false;\n return true;\n }\n\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\n * an action or specify a registered ToolId into toolbar.\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param toolbarUsage usage of the toolbar\n * @param toolbarOrientation orientation of the toolbar\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\n */\n public static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\n const buttonItems: CommonToolbarItem[] = [];\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return buttonItems;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n // istanbul ignore else\n if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\n uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)\n .forEach((spec: CommonToolbarItem) => {\n // ignore duplicate ids\n if (-1 === buttonItems.findIndex((existingItem)=> spec.id === existingItem.id ))\n buttonItems.push({ ...spec, providerId });\n });\n }\n });\n\n return buttonItems;\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\n */\n public static getStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\n const statusBarItems: CommonStatusBarItem[] = [];\n\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return statusBarItems;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\n uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)\n .forEach((item: CommonStatusBarItem) => {\n // ignore duplicate ids\n if (-1 === statusBarItems.findIndex((existingItem)=> item.id === existingItem.id ))\n statusBarItems.push({ ...item, providerId });\n });\n }\n });\n\n return statusBarItems;\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\n */\n public static getBackstageItems(): BackstageItem[] {\n const backstageItems: BackstageItem[] = [];\n\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return backstageItems;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (uiProvider.provideBackstageItems) { // Note: We do not call this.allowItemsFromProvider here as backstage items\n uiProvider.provideBackstageItems() // should not be considered stage specific. If they need to be hidden\n .forEach((item: BackstageItem) => { // the isHidden property should be set to a ConditionalBooleanValue\n // ignore duplicate ids\n if (-1 === backstageItems.findIndex((existingItem)=> item.id === existingItem.id ))\n backstageItems.push({ ...item, providerId });\n });\n }\n });\n return backstageItems;\n }\n\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\n * @param stageId a string identifier the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param location the location within the stage.\n * @param section the section within location.\n * @returns An array of AbstractWidgetProps that will be used to create widgets.\n */\n public static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\n const widgets: AbstractWidgetProps[] = [];\n\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\n return widgets;\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n\n // istanbul ignore else\n if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\n uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)\n .forEach((widget: AbstractWidgetProps) => {\n // ignore duplicate ids\n if (-1 === widgets.findIndex((existingItem)=> widget.id === existingItem.id ))\n widgets.push({ ...widget, providerId });\n });\n }\n });\n return widgets;\n }\n\n}\n"]}
1
+ {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,sDAAoE;AAMpE,uCAA8C;AAG9C;;GAEG;AACH,IAAY,wBAOX;AAPD,WAAY,wBAAwB;IAClC,mCAAmC;IACnC,yEAAK,CAAA;IACL,sCAAsC;IACtC,+EAAQ,CAAA;IACR,wCAAwC;IACxC,2EAAM,CAAA;AACR,CAAC,EAPW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAOnC;AA+CD;;;GAGG;AACH,MAAa,cAAc;IAGzB;mBACe;IACR,MAAM,CAAC,iBAAiB;QAC7B,cAAc,CAAC,2BAA2B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAKD,8CAA8C;IACvC,MAAM,KAAK,qBAAqB;QACrC,MAAM,GAAG,GAAG,CAAC,GAAG,cAAc,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC,CAAC;QACnE,OAAO,GAAG,CAAC;IACb,CAAC;IAED,yDAAyD;IAClD,MAAM,KAAK,sBAAsB;QACtC,OAAO,IAAI,CAAC,2BAA2B,CAAC,IAAI,GAA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AE1C,IAAI,CAAC,KAAK,cAAc,CAAC,2BAA2B,CAAC,IAAI;YACvD,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;gBACxF,UAAU,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC;qBAC1F,OAAO,CAAC,CAAC,MAA2B,EAAE,EAAE;oBACvC,uBAAuB;oBACvB,IAAI,CAAC,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,EAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAE;wBAC3E,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;gBAC5C,CAAC,CAAC,CAAC;aACN;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;;AA9Lc,0CAA2B,GAAqC,IAAI,GAAG,EAA+B,CAAC;AAQtH,wEAAwE;AACjD,0CAA2B,GAAG,IAAI,sBAAO,EAAmD,CAAC;AAVzG,wCAAc","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BeEvent, Logger, MarkRequired } from \"@itwin/core-bentley\";\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\nimport { loggerCategory } from \"./utils/misc\";\r\nimport { UiItemsProvider } from \"./UiItemsProvider\";\r\n\r\n/** Action taken by the application on item provided by a UiItemsProvider\r\n * @public @deprecated in 3.2. This was only used by the previously removed UiItemsArbiter.\r\n */\r\nexport enum UiItemsApplicationAction {\r\n /** Allow the change to the item */\r\n Allow,\r\n /** Disallow the change to the item */\r\n Disallow,\r\n /** Update the item during the change */\r\n Update,\r\n}\r\n\r\n/** UIProvider Registered Event Args interface.\r\n * @deprecated in 3.6. Use [UiItemsProviderRegisteredEventArgs]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface UiItemProviderRegisteredEventArgs {\r\n providerId: string;\r\n}\r\n\r\n/** UiItemProviderOverrides allows the application that registers a provider to limit when it is allowed to provide items\r\n * @deprecated in 3.6. Use [AllowedUiItemsProviderOverrides]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface AllowedUiItemProviderOverrides {\r\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages\r\n * @beta\r\n */\r\n providerId?: string;\r\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided\r\n * @beta\r\n */\r\n stageUsages?: string[];\r\n /** if specified then the current stage's Id will be compared before allowing any items to be provided\r\n * @beta\r\n */\r\n stageIds?: string[];\r\n}\r\n\r\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\r\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\r\n * items are allowed.\r\n * @deprecated in 3.6. Use [UiItemsProviderOverrides]($appui-react) instead.\r\n * @public\r\n */\r\nexport type UiItemProviderOverrides = MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\"> |\r\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"stageIds\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"stageUsages\"> | // eslint-disable-line @typescript-eslint/indent\r\n MarkRequired<AllowedUiItemProviderOverrides, \"providerId\" | \"stageUsages\" | \"stageIds\">; // eslint-disable-line @typescript-eslint/indent\r\n\r\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\r\ninterface UiItemProviderEntry {\r\n provider: UiItemsProvider;\r\n overrides?: UiItemProviderOverrides;\r\n}\r\n\r\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\r\n * @deprecated in 3.6. Use [UiItemsManager]($appui-react) instead.\r\n * @public\r\n */\r\nexport class UiItemsManager {\r\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> = new Map<string, UiItemProviderEntry>();\r\n\r\n /** For use in unit testing\r\n * @internal */\r\n public static clearAllProviders() {\r\n UiItemsManager._registeredUiItemsProviders.clear();\r\n }\r\n\r\n /** Event raised any time a UiProvider is registered or unregistered. */\r\n public static readonly onUiProviderRegisteredEvent = new BeEvent<(ev: UiItemProviderRegisteredEventArgs) => void>();\r\n\r\n /** Return number of registered UiProvider. */\r\n public static get registeredProviderIds() {\r\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\r\n return ids;\r\n }\r\n\r\n /** Return true if there is any registered UiProvider. */\r\n public static get hasRegisteredProviders(): boolean {\r\n return this._registeredUiItemsProviders.size > 0;\r\n }\r\n\r\n /**\r\n * Retrieves a previously loaded UiItemsProvider.\r\n * @param providerId id of the UiItemsProvider to get\r\n */\r\n public static getUiItemsProvider(providerId: string): UiItemsProvider | undefined {\r\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\r\n }\r\n\r\n private static sendRegisteredEvent(ev: UiItemProviderRegisteredEventArgs) {\r\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(ev);\r\n }\r\n\r\n /**\r\n * Registers a UiItemsProvider with the UiItemsManager.\r\n * @param uiProvider the UI items provider to register.\r\n */\r\n public static register(uiProvider: UiItemsProvider, overrides?: UiItemProviderOverrides): void {\r\n const providerId = overrides?.providerId ?? uiProvider.id;\r\n\r\n if (UiItemsManager.getUiItemsProvider(providerId)) {\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${providerId}) is already loaded`);\r\n } else {\r\n UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider ${uiProvider.id} registered as ${providerId} `);\r\n\r\n UiItemsManager.sendRegisteredEvent({ providerId } as UiItemProviderRegisteredEventArgs);\r\n }\r\n }\r\n\r\n /** Remove a specific UiItemsProvider from the list of available providers. */\r\n public static unregister(uiProviderId: string): void {\r\n const provider = UiItemsManager.getUiItemsProvider(uiProviderId);\r\n if (!provider)\r\n return;\r\n\r\n provider.onUnregister && provider.onUnregister();\r\n\r\n UiItemsManager._registeredUiItemsProviders.delete(uiProviderId);\r\n Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProviderId}) unloaded`);\r\n\r\n // trigger a refresh of the ui\r\n UiItemsManager.sendRegisteredEvent({ providerId: uiProviderId } as UiItemProviderRegisteredEventArgs);\r\n }\r\n\r\n private static allowItemsFromProvider(entry: UiItemProviderEntry, stageId?: string, stageUsage?: string) {\r\n // istanbul ignore else\r\n const overrides = entry.overrides;\r\n if (undefined !== stageId && overrides?.stageIds && !(overrides.stageIds.some((value: string) => value === stageId)))\r\n return false;\r\n if (undefined !== stageUsage && overrides?.stageUsages && !(overrides.stageUsages.some((value: string) => value === stageUsage)))\r\n return false;\r\n return true;\r\n }\r\n\r\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\r\n * an action or specify a registered ToolId into toolbar.\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @param toolbarUsage usage of the toolbar\r\n * @param toolbarOrientation orientation of the toolbar\r\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\r\n */\r\n public static getToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage,\r\n toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\r\n const buttonItems: CommonToolbarItem[] = [];\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return buttonItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n // istanbul ignore else\r\n if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)\r\n .forEach((spec: CommonToolbarItem) => {\r\n // ignore duplicate ids\r\n if (-1 === buttonItems.findIndex((existingItem)=> spec.id === existingItem.id ))\r\n buttonItems.push({ ...spec, providerId });\r\n });\r\n }\r\n });\r\n\r\n return buttonItems;\r\n }\r\n\r\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\r\n */\r\n public static getStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\r\n const statusBarItems: CommonStatusBarItem[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return statusBarItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)\r\n .forEach((item: CommonStatusBarItem) => {\r\n // ignore duplicate ids\r\n if (-1 === statusBarItems.findIndex((existingItem)=> item.id === existingItem.id ))\r\n statusBarItems.push({ ...item, providerId });\r\n });\r\n }\r\n });\r\n\r\n return statusBarItems;\r\n }\r\n\r\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\r\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\r\n */\r\n public static getBackstageItems(): BackstageItem[] {\r\n const backstageItems: BackstageItem[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return backstageItems;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideBackstageItems) { // Note: We do not call this.allowItemsFromProvider here as backstage items\r\n uiProvider.provideBackstageItems() // should not be considered stage specific. If they need to be hidden\r\n .forEach((item: BackstageItem) => { // the isHidden property should be set to a ConditionalBooleanValue\r\n // ignore duplicate ids\r\n if (-1 === backstageItems.findIndex((existingItem)=> item.id === existingItem.id ))\r\n backstageItems.push({ ...item, providerId });\r\n });\r\n }\r\n });\r\n return backstageItems;\r\n }\r\n\r\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\r\n * @param stageId a string identifier the active stage.\r\n * @param stageUsage the StageUsage of the active stage.\r\n * @param location the location within the stage.\r\n * @param section the section within location.\r\n * @returns An array of AbstractWidgetProps that will be used to create widgets.\r\n */\r\n public static getWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\r\n const widgets: AbstractWidgetProps[] = [];\r\n\r\n if (0 === UiItemsManager._registeredUiItemsProviders.size)\r\n return widgets;\r\n\r\n UiItemsManager._registeredUiItemsProviders.forEach((entry: UiItemProviderEntry) => {\r\n const uiProvider = entry.provider;\r\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\r\n\r\n // istanbul ignore else\r\n if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {\r\n uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)\r\n .forEach((widget: AbstractWidgetProps) => {\r\n // ignore duplicate ids\r\n if (-1 === widgets.findIndex((existingItem)=> widget.id === existingItem.id ))\r\n widgets.push({ ...widget, providerId });\r\n });\r\n }\r\n });\r\n return widgets;\r\n }\r\n\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module UiItemsProvider\n */\n\nimport { BackstageItem } from \"./backstage/BackstageItem\";\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\n\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\n * @deprecated in 3.6. Use [UiItemsProvider]($appui-react) instead.\n * @public\n */\nexport interface UiItemsProvider {\n /** id of provider */\n readonly id: string;\n\n /** UiItemsManager calls following method to get items to populate specific toolbars */\n provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any) => CommonToolbarItem[]; // eslint-disable-line deprecation/deprecation\n /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */\n provideStatusBarItems?: (stageId: string, stageUsage: string, stageAppData?: any) => CommonStatusBarItem[]; // eslint-disable-line deprecation/deprecation\n /** UiItemsManager calls following method to augment backstage items. */\n provideBackstageItems?: () => BackstageItem[]; // eslint-disable-line deprecation/deprecation\n /** UiItemsManager calls following method to augment Widget lists.\n * @note Returned widgets must provide unique `AbstractWidgetProps[\"id\"]` to correctly save/restore App layout.\n */\n provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, // eslint-disable-line deprecation/deprecation\n zoneLocation?: AbstractZoneLocation, stageAppData?: any) => ReadonlyArray<AbstractWidgetProps>; // eslint-disable-line deprecation/deprecation\n /** Function called when the provider is unregistered via `ItemsManager.unregister` to allow provider to do cleanup. */\n onUnregister?: () => void;\n}\n"]}
1
+ {"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\n\r\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\r\n * @deprecated in 3.6. Use [UiItemsProvider]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface UiItemsProvider {\r\n /** id of provider */\r\n readonly id: string;\r\n\r\n /** UiItemsManager calls following method to get items to populate specific toolbars */\r\n provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any) => CommonToolbarItem[]; // eslint-disable-line deprecation/deprecation\r\n /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */\r\n provideStatusBarItems?: (stageId: string, stageUsage: string, stageAppData?: any) => CommonStatusBarItem[]; // eslint-disable-line deprecation/deprecation\r\n /** UiItemsManager calls following method to augment backstage items. */\r\n provideBackstageItems?: () => BackstageItem[]; // eslint-disable-line deprecation/deprecation\r\n /** UiItemsManager calls following method to augment Widget lists.\r\n * @note Returned widgets must provide unique `AbstractWidgetProps[\"id\"]` to correctly save/restore App layout.\r\n */\r\n provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, // eslint-disable-line deprecation/deprecation\r\n zoneLocation?: AbstractZoneLocation, stageAppData?: any) => ReadonlyArray<AbstractWidgetProps>; // eslint-disable-line deprecation/deprecation\r\n /** Function called when the provider is unregistered via `ItemsManager.unregister` to allow provider to do cleanup. */\r\n onUnregister?: () => void;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BackstageItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/backstage/BackstageItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,4CAA4C;IAC5C,qEAAc,CAAA;IACd,kCAAkC;IAClC,2EAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AA4DD;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,IAAmB,EAA+B,EAAE;IAC/E,OAAQ,IAA4B,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,8CAA8C;AAC5G,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF;;;GAGG;AACI,MAAM,eAAe,GAAG,CAAC,IAAmB,EAAkC,EAAE;IACrF,OAAQ,IAA+B,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,8CAA8C;AAC/G,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEF;;;GAGG;AACH,MAAa,sBAAsB;;AACjC,8CAA8C;AAChC,0CAAmB,GAAG,CAClC,YAAoB,EAAE,aAAqB,EAAE,YAAoB,EAAE,KAAsC,EACzG,QAA0C,EAAE,IAAsC,EAAE,SAA2C,CAAC,8CAA8C;EACtJ,EAAE,CAAC,CAAC;IAC5B,aAAa;IACb,IAAI;IACJ,YAAY,EAAE,SAAS,EAAE,YAAY;IACrC,EAAE,EAAE,YAAY;IAChB,YAAY;IACZ,KAAK;IACL,OAAO,EAAE,YAAY;IACrB,QAAQ;IACR,GAAG,SAAS;CACb,CAAC,CAAC;AAEH,uCAAuC;AACzB,uCAAgB,GAAG,CAC/B,MAAc,EAAE,aAAqB,EAAE,YAAoB,EAAE,OAAmB,EAAE,KAAsC,EACxH,QAA0C,EAAE,IAAsC,EAAE,SAAwC,CAAC,8CAA8C;EACtJ,EAAE,CAAC,CAAC;IACzB,OAAO;IACP,aAAa;IACb,IAAI;IACJ,YAAY,EAAE,SAAS,EAAE,YAAY;IACrC,EAAE,EAAE,MAAM;IACV,YAAY;IACZ,KAAK;IACL,QAAQ;IACR,GAAG,SAAS;CACb,CAAC,CAAC;AA/BQ,wDAAsB","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 Backstage\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 item type added to the backstage menu.\n * @deprecated in 3.6. Use type guards instead.\n * @public\n */\nexport enum BackstageItemType {\n /** Item that executes an action function */\n ActionItem = 1,\n /** Item that activate a stage. */\n StageLauncher = 2,\n}\n\n/** Describes the data needed to insert a button into the backstage menu.\n * @deprecated in 3.6. Use [CommonBackstageItem]($appui-react) instead.\n * @public\n */\nexport interface CommonBackstageItem extends ProvidedItem { // eslint-disable-line deprecation/deprecation\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 /** 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.\n */\n readonly groupPriority: number;\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 /** 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 be 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 group (recommend using values 1 through 100). */\n readonly itemPriority: number;\n /** Label. */\n readonly label: string | ConditionalStringValue;\n /** Subtitle. */\n readonly subtitle?: string | ConditionalStringValue;\n /** Tooltip. */\n readonly tooltip?: string | ConditionalStringValue;\n /** Describes if the item is active. The default is for the item to be active if stageId matches activeFrontstageId */\n readonly isActive?: boolean | ConditionalBooleanValue;\n}\n\n/** Describes the data needed to insert an action button into the backstage menu.\n * @deprecated in 3.6. Use [BackstageActionItem]($appui-react) instead.\n * @public\n */\nexport interface BackstageActionItem extends CommonBackstageItem { // eslint-disable-line deprecation/deprecation\n readonly execute: () => void;\n}\n\n/** Describes the data needed to insert an action button into the backstage menu.\n * @deprecated in 3.6. Use [BackstageActionItem]($appui-react) instead.\n * @public\n */\nexport interface BackstageStageLauncher extends CommonBackstageItem { // eslint-disable-line deprecation/deprecation\n readonly stageId: string;\n}\n\n/** Describes the data needed to insert a button into the backstage menu.\n * @deprecated in 3.6. Use [BackstageItem]($appui-react) instead.\n * @public\n */\nexport type BackstageItem = BackstageActionItem | BackstageStageLauncher; // eslint-disable-line deprecation/deprecation\n\n/** BackstageActionItem type guard.\n * @deprecated in 3.6. Use [isBackstageActionItem]($appui-react) instead.\n * @public\n */\nexport const isActionItem = (item: BackstageItem): item is BackstageActionItem => { // eslint-disable-line deprecation/deprecation\n return (item as BackstageActionItem).execute !== undefined; // eslint-disable-line deprecation/deprecation\n};\n\n/** BackstageStageLauncher type guard.\n * @deprecated in 3.6. Use [isBackstageStageLauncher]($appui-react) instead.\n * @public\n */\nexport const isStageLauncher = (item: BackstageItem): item is BackstageStageLauncher => { // eslint-disable-line deprecation/deprecation\n return (item as BackstageStageLauncher).stageId !== undefined; // eslint-disable-line deprecation/deprecation\n};\n\n/** Utilities for creating and maintaining backstage items\n * @deprecated in 3.6. Use [BackstageItemUtilities]($appui-react) instead.\n * @public\n */\nexport class BackstageItemUtilities {\n /** Creates a stage launcher backstage item */\n public static createStageLauncher = (\n frontstageId: string, groupPriority: number, itemPriority: number, label: string | ConditionalStringValue,\n subtitle?: string | ConditionalStringValue, icon?: string | ConditionalStringValue, overrides?: Partial<BackstageStageLauncher> // eslint-disable-line deprecation/deprecation\n ): BackstageStageLauncher => ({ // eslint-disable-line deprecation/deprecation\n groupPriority,\n icon,\n internalData: overrides?.internalData,\n id: frontstageId,\n itemPriority,\n label,\n stageId: frontstageId,\n subtitle,\n ...overrides,\n });\n\n /** Creates an action backstage item */\n public static createActionItem = (\n itemId: string, groupPriority: number, itemPriority: number, execute: () => void, label: string | ConditionalStringValue,\n subtitle?: string | ConditionalStringValue, icon?: string | ConditionalStringValue, overrides?: Partial<BackstageActionItem> // eslint-disable-line deprecation/deprecation\n ): BackstageActionItem => ({ // eslint-disable-line deprecation/deprecation\n execute,\n groupPriority,\n icon,\n internalData: overrides?.internalData,\n id: itemId,\n itemPriority,\n label,\n subtitle,\n ...overrides,\n });\n}\n"]}
1
+ {"version":3,"file":"BackstageItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/backstage/BackstageItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,4CAA4C;IAC5C,qEAAc,CAAA;IACd,kCAAkC;IAClC,2EAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AA4DD;;;GAGG;AACI,MAAM,YAAY,GAAG,CAAC,IAAmB,EAA+B,EAAE;IAC/E,OAAQ,IAA4B,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,8CAA8C;AAC5G,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF;;;GAGG;AACI,MAAM,eAAe,GAAG,CAAC,IAAmB,EAAkC,EAAE;IACrF,OAAQ,IAA+B,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,8CAA8C;AAC/G,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEF;;;GAGG;AACH,MAAa,sBAAsB;;AACjC,8CAA8C;AAChC,0CAAmB,GAAG,CAClC,YAAoB,EAAE,aAAqB,EAAE,YAAoB,EAAE,KAAsC,EACzG,QAA0C,EAAE,IAAsC,EAAE,SAA2C,CAAC,8CAA8C;EACtJ,EAAE,CAAC,CAAC;IAC5B,aAAa;IACb,IAAI;IACJ,YAAY,EAAE,SAAS,EAAE,YAAY;IACrC,EAAE,EAAE,YAAY;IAChB,YAAY;IACZ,KAAK;IACL,OAAO,EAAE,YAAY;IACrB,QAAQ;IACR,GAAG,SAAS;CACb,CAAC,CAAC;AAEH,uCAAuC;AACzB,uCAAgB,GAAG,CAC/B,MAAc,EAAE,aAAqB,EAAE,YAAoB,EAAE,OAAmB,EAAE,KAAsC,EACxH,QAA0C,EAAE,IAAsC,EAAE,SAAwC,CAAC,8CAA8C;EACtJ,EAAE,CAAC,CAAC;IACzB,OAAO;IACP,aAAa;IACb,IAAI;IACJ,YAAY,EAAE,SAAS,EAAE,YAAY;IACrC,EAAE,EAAE,MAAM;IACV,YAAY;IACZ,KAAK;IACL,QAAQ;IACR,GAAG,SAAS;CACb,CAAC,CAAC;AA/BQ,wDAAsB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Backstage\r\n */\r\n\r\nimport { BadgeType } from \"../items/BadgeType\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { ProvidedItem } from \"../items/ProvidedItem\";\r\n\r\n/** Used to specify the item type added to the backstage menu.\r\n * @deprecated in 3.6. Use type guards instead.\r\n * @public\r\n */\r\nexport enum BackstageItemType {\r\n /** Item that executes an action function */\r\n ActionItem = 1,\r\n /** Item that activate a stage. */\r\n StageLauncher = 2,\r\n}\r\n\r\n/** Describes the data needed to insert a button into the backstage menu.\r\n * @deprecated in 3.6. Use [CommonBackstageItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface CommonBackstageItem extends ProvidedItem { // eslint-disable-line deprecation/deprecation\r\n /** can be used by application to store miscellaneous data. */\r\n applicationData?: any;\r\n /** Describes badge. Renders no badge if not specified. */\r\n readonly badgeType?: BadgeType;\r\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\r\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\r\n * allows extensions enough gaps to insert their own groups.\r\n */\r\n readonly groupPriority: number;\r\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\r\n readonly icon?: string | ConditionalStringValue;\r\n /** Required unique id of the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\r\n readonly id: string;\r\n /** optional data to be used by item implementor. */\r\n readonly internalData?: Map<string, any>;\r\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\r\n readonly isHidden?: boolean | ConditionalBooleanValue;\r\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\r\n readonly isDisabled?: boolean | ConditionalBooleanValue;\r\n /** Priority within a group (recommend using values 1 through 100). */\r\n readonly itemPriority: number;\r\n /** Label. */\r\n readonly label: string | ConditionalStringValue;\r\n /** Subtitle. */\r\n readonly subtitle?: string | ConditionalStringValue;\r\n /** Tooltip. */\r\n readonly tooltip?: string | ConditionalStringValue;\r\n /** Describes if the item is active. The default is for the item to be active if stageId matches activeFrontstageId */\r\n readonly isActive?: boolean | ConditionalBooleanValue;\r\n}\r\n\r\n/** Describes the data needed to insert an action button into the backstage menu.\r\n * @deprecated in 3.6. Use [BackstageActionItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface BackstageActionItem extends CommonBackstageItem { // eslint-disable-line deprecation/deprecation\r\n readonly execute: () => void;\r\n}\r\n\r\n/** Describes the data needed to insert an action button into the backstage menu.\r\n * @deprecated in 3.6. Use [BackstageActionItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface BackstageStageLauncher extends CommonBackstageItem { // eslint-disable-line deprecation/deprecation\r\n readonly stageId: string;\r\n}\r\n\r\n/** Describes the data needed to insert a button into the backstage menu.\r\n * @deprecated in 3.6. Use [BackstageItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport type BackstageItem = BackstageActionItem | BackstageStageLauncher; // eslint-disable-line deprecation/deprecation\r\n\r\n/** BackstageActionItem type guard.\r\n * @deprecated in 3.6. Use [isBackstageActionItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport const isActionItem = (item: BackstageItem): item is BackstageActionItem => { // eslint-disable-line deprecation/deprecation\r\n return (item as BackstageActionItem).execute !== undefined; // eslint-disable-line deprecation/deprecation\r\n};\r\n\r\n/** BackstageStageLauncher type guard.\r\n * @deprecated in 3.6. Use [isBackstageStageLauncher]($appui-react) instead.\r\n * @public\r\n */\r\nexport const isStageLauncher = (item: BackstageItem): item is BackstageStageLauncher => { // eslint-disable-line deprecation/deprecation\r\n return (item as BackstageStageLauncher).stageId !== undefined; // eslint-disable-line deprecation/deprecation\r\n};\r\n\r\n/** Utilities for creating and maintaining backstage items\r\n * @deprecated in 3.6. Use [BackstageItemUtilities]($appui-react) instead.\r\n * @public\r\n */\r\nexport class BackstageItemUtilities {\r\n /** Creates a stage launcher backstage item */\r\n public static createStageLauncher = (\r\n frontstageId: string, groupPriority: number, itemPriority: number, label: string | ConditionalStringValue,\r\n subtitle?: string | ConditionalStringValue, icon?: string | ConditionalStringValue, overrides?: Partial<BackstageStageLauncher> // eslint-disable-line deprecation/deprecation\r\n ): BackstageStageLauncher => ({ // eslint-disable-line deprecation/deprecation\r\n groupPriority,\r\n icon,\r\n internalData: overrides?.internalData,\r\n id: frontstageId,\r\n itemPriority,\r\n label,\r\n stageId: frontstageId,\r\n subtitle,\r\n ...overrides,\r\n });\r\n\r\n /** Creates an action backstage item */\r\n public static createActionItem = (\r\n itemId: string, groupPriority: number, itemPriority: number, execute: () => void, label: string | ConditionalStringValue,\r\n subtitle?: string | ConditionalStringValue, icon?: string | ConditionalStringValue, overrides?: Partial<BackstageActionItem> // eslint-disable-line deprecation/deprecation\r\n ): BackstageActionItem => ({ // eslint-disable-line deprecation/deprecation\r\n execute,\r\n groupPriority,\r\n icon,\r\n internalData: overrides?.internalData,\r\n id: itemId,\r\n itemPriority,\r\n label,\r\n subtitle,\r\n ...overrides,\r\n });\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3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M,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YAEhC,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBACnD,IAAI,KAAK,YAAY,iDAAuB,EAAE;oBAC5C,uBAAuB;oBACvB,IAAI,iDAAuB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACvD,cAAc,GAAG,IAAI,CAAC;iBACzB;qBAAM,0BAA0B,CAAC,IAAI,KAAK,YAAY,+CAAsB,EAAE;oBAC7E,uBAAuB;oBACvB,IAAI,+CAAsB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACtD,cAAc,GAAG,IAAI,CAAC;iBACzB;aACF;YAED,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;IAClE,CAAC;IAEM,oBAAoB,CAAC,QAAqB;QAC/C,uBAAuB;QACvB,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI;YACrB,OAAO;QAET,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE/F,uBAAuB;QACvB,IAAI,YAAY;YACd,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CAEF;AAlID,sDAkIC","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 Backstage\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { BackstageItem } from \"./BackstageItem\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Arguments of [[BackstageItemsManager.onChanged]] event.\n * @internal\n */\nexport interface BackstageItemsChangedArgs {\n readonly items: ReadonlyArray<BackstageItem>;\n}\n\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\n\nconst isInstance = <T>(args: InstanceOrArray<T>): args is T => {\n return !Array.isArray(args);\n};\n\n/**\n * Controls backstage items.\n * @internal\n */\nexport class BackstageItemsManager {\n private _items: ReadonlyArray<BackstageItem> = [];\n\n constructor(items?: ReadonlyArray<BackstageItem>) {\n // istanbul ignore else\n if (items)\n this.loadItemsInternal(items, true, false);\n }\n\n private loadItemsInternal(items: ReadonlyArray<BackstageItem>, processConditions: boolean, sendItemChanged: boolean) {\n if (processConditions && items) {\n const eventIds = BackstageItemsManager.getSyncIdsOfInterest(items);\n if (0 !== eventIds.length) {\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\n\n // istanbul ignore else\n if (itemsUpdated)\n items = updatedItems;\n }\n }\n\n this._items = items;\n if (sendItemChanged)\n this.onItemsChanged.raiseEvent({ items });\n }\n\n /** load items but do not fire onItemsChanged\n * @internal\n */\n public loadItems(items: ReadonlyArray<BackstageItem>) {\n this.loadItemsInternal(items, true, false);\n }\n\n /** Event raised when backstage items are changed.\n * @internal\n */\n public readonly onItemsChanged = new BeEvent<(args: BackstageItemsChangedArgs) => void>();\n\n public get items(): ReadonlyArray<BackstageItem> {\n return this._items;\n }\n\n public set items(items: ReadonlyArray<BackstageItem>) {\n // istanbul ignore else\n if (items !== this._items)\n this.loadItemsInternal(items, true, true);\n }\n\n /** @internal */\n public add(itemOrItems: BackstageItem | ReadonlyArray<BackstageItem>) {\n let itemsToAdd;\n if (isInstance(itemOrItems))\n itemsToAdd = [itemOrItems];\n else {\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\n }\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\n if (itemsToAdd.length === 0)\n return;\n const items = [\n ...this._items,\n ...itemsToAdd,\n ];\n this.items = items;\n }\n\n /** @internal */\n public remove(itemIdOrItemIds: BackstageItem[\"id\"] | ReadonlyArray<BackstageItem[\"id\"]>) {\n const items = this._items.filter((item) => {\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\n });\n this.items = items;\n }\n\n /** @internal */\n public static getSyncIdsOfInterest(items: readonly BackstageItem[]): string[] {\n const eventIds = new Set<string>();\n items.forEach((item) => {\n for (const [, entry] of Object.entries(item)) {\n if (entry instanceof ConditionalBooleanValue) {\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\n }\n }\n });\n return [...eventIds.values()];\n }\n\n private internalRefreshAffectedItems(items: readonly BackstageItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: BackstageItem[] } {\n // istanbul ignore next\n if (0 === eventIds.size)\n return { itemsUpdated: false, updatedItems: [] };\n\n let updateRequired = false;\n\n const newItems: BackstageItem[] = [];\n for (const item of items) {\n const updatedItem = { ...item };\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n // istanbul ignore else\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n updateRequired = true;\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\n // istanbul ignore else\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n updateRequired = true;\n }\n }\n\n newItems.push(updatedItem);\n }\n\n return { itemsUpdated: updateRequired, updatedItems: newItems };\n }\n\n public refreshAffectedItems(eventIds: Set<string>) {\n // istanbul ignore next\n if (0 === eventIds.size)\n return;\n\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\n\n // istanbul ignore else\n if (itemsUpdated)\n this.loadItemsInternal(updatedItems, false, true);\n }\n\n}\n"]}
1
+ {"version":3,"file":"BackstageItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-abstract/backstage/BackstageItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAC9C,8EAA2E;AAC3E,4EAAyE;AAczE,MAAM,UAAU,GAAG,CAAI,IAAwB,EAAa,EAAE;IAC5D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAa,qBAAqB;IAGhC,YAAY,KAAoC;QAFxC,WAAM,GAAiC,EAAE,CAAC;QAgClD;;WAEG;QACa,mBAAc,GAAG,IAAI,sBAAO,EAA6C,CAAC;QAhCxF,uBAAuB;QACvB,IAAI,KAAK;YACP,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAEO,iBAAiB,CAAC,KAAmC,EAAE,iBAA0B,EAAE,eAAwB;QACjH,IAAI,iBAAiB,IAAI,KAAK,EAAE;YAC9B,MAAM,QAAQ,GAAG,qBAAqB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACnE,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,EAAE;gBACzB,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,KAAK,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAEnG,uBAAuB;gBACvB,IAAI,YAAY;oBACd,KAAK,GAAG,YAAY,CAAC;aACxB;SACF;QAED,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,eAAe;YACjB,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,C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D,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,MAAM,QAAQ,GAAoB,EAAE,CAAC;QACrC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YAEhC,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBACnD,IAAI,KAAK,YAAY,iDAAuB,EAAE;oBAC5C,uBAAuB;oBACvB,IAAI,iDAAuB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACvD,cAAc,GAAG,IAAI,CAAC;iBACzB;qBAAM,0BAA0B,CAAC,IAAI,KAAK,YAAY,+CAAsB,EAAE;oBAC7E,uBAAuB;oBACvB,IAAI,+CAAsB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACtD,cAAc,GAAG,IAAI,CAAC;iBACzB;aACF;YAED,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;IAClE,CAAC;IAEM,oBAAoB,CAAC,QAAqB;QAC/C,uBAAuB;QACvB,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI;YACrB,OAAO;QAET,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE/F,uBAAuB;QACvB,IAAI,YAAY;YACd,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CAEF;AAlID,sDAkIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Backstage\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { BackstageItem } from \"./BackstageItem\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/** Arguments of [[BackstageItemsManager.onChanged]] event.\r\n * @internal\r\n */\r\nexport interface BackstageItemsChangedArgs {\r\n readonly items: ReadonlyArray<BackstageItem>;\r\n}\r\n\r\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\r\n\r\nconst isInstance = <T>(args: InstanceOrArray<T>): args is T => {\r\n return !Array.isArray(args);\r\n};\r\n\r\n/**\r\n * Controls backstage items.\r\n * @internal\r\n */\r\nexport class BackstageItemsManager {\r\n private _items: ReadonlyArray<BackstageItem> = [];\r\n\r\n constructor(items?: ReadonlyArray<BackstageItem>) {\r\n // istanbul ignore else\r\n if (items)\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n private loadItemsInternal(items: ReadonlyArray<BackstageItem>, processConditions: boolean, sendItemChanged: boolean) {\r\n if (processConditions && items) {\r\n const eventIds = BackstageItemsManager.getSyncIdsOfInterest(items);\r\n if (0 !== eventIds.length) {\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n items = updatedItems;\r\n }\r\n }\r\n\r\n this._items = items;\r\n if (sendItemChanged)\r\n this.onItemsChanged.raiseEvent({ items });\r\n }\r\n\r\n /** load items but do not fire onItemsChanged\r\n * @internal\r\n */\r\n public loadItems(items: ReadonlyArray<BackstageItem>) {\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Event raised when backstage items are changed.\r\n * @internal\r\n */\r\n public readonly onItemsChanged = new BeEvent<(args: BackstageItemsChangedArgs) => void>();\r\n\r\n public get items(): ReadonlyArray<BackstageItem> {\r\n return this._items;\r\n }\r\n\r\n public set items(items: ReadonlyArray<BackstageItem>) {\r\n // istanbul ignore else\r\n if (items !== this._items)\r\n this.loadItemsInternal(items, true, true);\r\n }\r\n\r\n /** @internal */\r\n public add(itemOrItems: BackstageItem | ReadonlyArray<BackstageItem>) {\r\n let itemsToAdd;\r\n if (isInstance(itemOrItems))\r\n itemsToAdd = [itemOrItems];\r\n else {\r\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\r\n }\r\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\r\n if (itemsToAdd.length === 0)\r\n return;\r\n const items = [\r\n ...this._items,\r\n ...itemsToAdd,\r\n ];\r\n this.items = items;\r\n }\r\n\r\n /** @internal */\r\n public remove(itemIdOrItemIds: BackstageItem[\"id\"] | ReadonlyArray<BackstageItem[\"id\"]>) {\r\n const items = this._items.filter((item) => {\r\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\r\n });\r\n this.items = items;\r\n }\r\n\r\n /** @internal */\r\n public static getSyncIdsOfInterest(items: readonly BackstageItem[]): string[] {\r\n const eventIds = new Set<string>();\r\n items.forEach((item) => {\r\n for (const [, entry] of Object.entries(item)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n }\r\n }\r\n });\r\n return [...eventIds.values()];\r\n }\r\n\r\n private internalRefreshAffectedItems(items: readonly BackstageItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: BackstageItem[] } {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return { itemsUpdated: false, updatedItems: [] };\r\n\r\n let updateRequired = false;\r\n\r\n const newItems: BackstageItem[] = [];\r\n for (const item of items) {\r\n const updatedItem = { ...item };\r\n\r\n for (const [, entry] of Object.entries(updatedItem)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n // istanbul ignore else\r\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n // istanbul ignore else\r\n if (ConditionalStringValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n }\r\n }\r\n\r\n newItems.push(updatedItem);\r\n }\r\n\r\n return { itemsUpdated: updateRequired, updatedItems: newItems };\r\n }\r\n\r\n public refreshAffectedItems(eventIds: Set<string>) {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return;\r\n\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n this.loadItemsInternal(updatedItems, false, true);\r\n }\r\n\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"KeyboardKey.js","sourceRoot":"","sources":["../../../../src/appui-abstract/common/KeyboardKey.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;AACb,CAAC,EAbW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAatB;AAED;;GAEG;AACH,IAAY,UAuBX;AAvBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;IACzB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,8BAAgB,CAAA;IAChB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;IACrB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAvBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAuBrB;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,CAAC,GAAG,KAAK,UAAU,CAAC,SAAS,IAAI,GAAG,KAAK,UAAU,CAAC,UAAU,IAAI,GAAG,KAAK,UAAU,CAAC,OAAO,IAAI,GAAG,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC;AACvI,CAAC;AAFD,gCAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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/** Enumeration for Function Keys\n * @public\n */\nexport enum FunctionKey {\n F1 = \"F1\",\n F2 = \"F2\",\n F3 = \"F3\",\n F4 = \"F4\",\n F5 = \"F5\",\n F6 = \"F6\",\n F7 = \"F7\",\n F8 = \"F8\",\n F9 = \"F9\",\n F10 = \"F10\",\n F11 = \"F11\",\n F12 = \"F12\",\n}\n\n/** Enumeration for Special Keys\n * @public\n */\nexport enum SpecialKey {\n Home = \"Home\",\n End = \"End\",\n PageUp = \"PageUp\",\n PageDown = \"PageDown\",\n Escape = \"Escape\",\n Delete = \"Delete\",\n Insert = \"Insert\",\n Tab = \"Tab\",\n ArrowLeft = \"ArrowLeft\",\n ArrowRight = \"ArrowRight\",\n ArrowUp = \"ArrowUp\",\n ArrowDown = \"ArrowDown\",\n Enter = \"Enter\",\n Return = \"Enter\",\n Space = \" \",\n Backspace = \"Backspace\",\n Clear = \"Clear\",\n Divide = \"Divide\",\n Multiply = \"Multiply\",\n Subtract = \"Subtract\",\n Add = \"Add\",\n Decimal = \"Decimal\",\n}\n\n/** Determines if a KeyboardEvent.key is an Arrow key\n * @public\n */\nexport function isArrowKey(key: string): boolean {\n return (key === SpecialKey.ArrowLeft || key === SpecialKey.ArrowRight || key === SpecialKey.ArrowUp || key === SpecialKey.ArrowDown);\n}\n"]}
1
+ {"version":3,"file":"KeyboardKey.js","sourceRoot":"","sources":["../../../../src/appui-abstract/common/KeyboardKey.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,wBAAS,CAAA;IACT,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,0BAAW,CAAA;AACb,CAAC,EAbW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAatB;AAED;;GAEG;AACH,IAAY,UAuBX;AAvBD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,uCAAyB,CAAA;IACzB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,8BAAgB,CAAA;IAChB,yBAAW,CAAA;IACX,qCAAuB,CAAA;IACvB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;IACrB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAvBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAuBrB;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,OAAO,CAAC,GAAG,KAAK,UAAU,CAAC,SAAS,IAAI,GAAG,KAAK,UAAU,CAAC,UAAU,IAAI,GAAG,KAAK,UAAU,CAAC,OAAO,IAAI,GAAG,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC;AACvI,CAAC;AAFD,gCAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/** Enumeration for Function Keys\r\n * @public\r\n */\r\nexport enum FunctionKey {\r\n F1 = \"F1\",\r\n F2 = \"F2\",\r\n F3 = \"F3\",\r\n F4 = \"F4\",\r\n F5 = \"F5\",\r\n F6 = \"F6\",\r\n F7 = \"F7\",\r\n F8 = \"F8\",\r\n F9 = \"F9\",\r\n F10 = \"F10\",\r\n F11 = \"F11\",\r\n F12 = \"F12\",\r\n}\r\n\r\n/** Enumeration for Special Keys\r\n * @public\r\n */\r\nexport enum SpecialKey {\r\n Home = \"Home\",\r\n End = \"End\",\r\n PageUp = \"PageUp\",\r\n PageDown = \"PageDown\",\r\n Escape = \"Escape\",\r\n Delete = \"Delete\",\r\n Insert = \"Insert\",\r\n Tab = \"Tab\",\r\n ArrowLeft = \"ArrowLeft\",\r\n ArrowRight = \"ArrowRight\",\r\n ArrowUp = \"ArrowUp\",\r\n ArrowDown = \"ArrowDown\",\r\n Enter = \"Enter\",\r\n Return = \"Enter\",\r\n Space = \" \",\r\n Backspace = \"Backspace\",\r\n Clear = \"Clear\",\r\n Divide = \"Divide\",\r\n Multiply = \"Multiply\",\r\n Subtract = \"Subtract\",\r\n Add = \"Add\",\r\n Decimal = \"Decimal\",\r\n}\r\n\r\n/** Determines if a KeyboardEvent.key is an Arrow key\r\n * @public\r\n */\r\nexport function isArrowKey(key: string): boolean {\r\n return (key === SpecialKey.ArrowLeft || key === SpecialKey.ArrowRight || key === SpecialKey.ArrowUp || key === SpecialKey.ArrowDown);\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ContentLayoutProps.js","sourceRoot":"","sources":["../../../../src/appui-abstract/content/ContentLayoutProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContentView\n */\n\n/** Base interface for layout split properties\n * @public\n */\nexport interface LayoutSplitPropsBase {\n /** The id used to save the current state of the splitter */\n id: string;\n /** The percentage of this layout that should be occupied by the top/left fragment by default */\n percentage: number;\n /** Used to lock splitter into fixed position. Defaults to false. */\n lock?: boolean;\n}\n\n/** Properties for a layout fragment\n * @public\n */\nexport interface LayoutFragmentProps {\n /** Vertical split layout properties */\n verticalSplit?: LayoutVerticalSplitProps;\n /** Horizontal split layout properties */\n horizontalSplit?: LayoutHorizontalSplitProps;\n}\n\n/** Properties for a vertical layout split.\n * When a member is a [[LayoutFragmentProps]], it creates a nested split pane.\n * When a number, it represents an index into a [[ContentGroup]].\n * @public\n */\nexport interface LayoutVerticalSplitProps extends LayoutSplitPropsBase {\n /** Left layout fragment properties. */\n left: LayoutFragmentProps | number;\n /** Right layout fragment properties. */\n right: LayoutFragmentProps | number;\n\n /** Minimum size of the left fragment. */\n minSizeLeft?: number;\n /** Minimum size of the right fragment. */\n minSizeRight?: number;\n}\n\n/** Properties for a horizontal layout split\n * When a member is a [[LayoutFragmentProps]], it creates a nested split pane.\n * When a number, it represents an index into a [[ContentGroup]].\n * @public\n */\nexport interface LayoutHorizontalSplitProps extends LayoutSplitPropsBase {\n /** Top layout fragment properties. */\n top: LayoutFragmentProps | number;\n /** Bottom layout fragment properties. */\n bottom: LayoutFragmentProps | number;\n\n /** Minimum size of the top fragment. */\n minSizeTop?: number;\n /** Minimum size of the bottom fragment. */\n minSizeBottom?: number;\n}\n\n/** Properties for a [[ContentLayoutDef]]\n * @public\n */\nexport interface ContentLayoutProps extends LayoutFragmentProps {\n /** ID for this Content Layout */\n id: string;\n /** Description of the layout*/\n description?: string;\n}\n"]}
1
+ {"version":3,"file":"ContentLayoutProps.js","sourceRoot":"","sources":["../../../../src/appui-abstract/content/ContentLayoutProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\n/** Base interface for layout split properties\r\n * @public\r\n */\r\nexport interface LayoutSplitPropsBase {\r\n /** The id used to save the current state of the splitter */\r\n id: string;\r\n /** The percentage of this layout that should be occupied by the top/left fragment by default */\r\n percentage: number;\r\n /** Used to lock splitter into fixed position. Defaults to false. */\r\n lock?: boolean;\r\n}\r\n\r\n/** Properties for a layout fragment\r\n * @public\r\n */\r\nexport interface LayoutFragmentProps {\r\n /** Vertical split layout properties */\r\n verticalSplit?: LayoutVerticalSplitProps;\r\n /** Horizontal split layout properties */\r\n horizontalSplit?: LayoutHorizontalSplitProps;\r\n}\r\n\r\n/** Properties for a vertical layout split.\r\n * When a member is a [[LayoutFragmentProps]], it creates a nested split pane.\r\n * When a number, it represents an index into a [[ContentGroup]].\r\n * @public\r\n */\r\nexport interface LayoutVerticalSplitProps extends LayoutSplitPropsBase {\r\n /** Left layout fragment properties. */\r\n left: LayoutFragmentProps | number;\r\n /** Right layout fragment properties. */\r\n right: LayoutFragmentProps | number;\r\n\r\n /** Minimum size of the left fragment. */\r\n minSizeLeft?: number;\r\n /** Minimum size of the right fragment. */\r\n minSizeRight?: number;\r\n}\r\n\r\n/** Properties for a horizontal layout split\r\n * When a member is a [[LayoutFragmentProps]], it creates a nested split pane.\r\n * When a number, it represents an index into a [[ContentGroup]].\r\n * @public\r\n */\r\nexport interface LayoutHorizontalSplitProps extends LayoutSplitPropsBase {\r\n /** Top layout fragment properties. */\r\n top: LayoutFragmentProps | number;\r\n /** Bottom layout fragment properties. */\r\n bottom: LayoutFragmentProps | number;\r\n\r\n /** Minimum size of the top fragment. */\r\n minSizeTop?: number;\r\n /** Minimum size of the bottom fragment. */\r\n minSizeBottom?: number;\r\n}\r\n\r\n/** Properties for a [[ContentLayoutDef]]\r\n * @public\r\n */\r\nexport interface ContentLayoutProps extends LayoutFragmentProps {\r\n /** ID for this Content Layout */\r\n id: string;\r\n /** Description of the layout*/\r\n description?: string;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StandardContentLayouts.js","sourceRoot":"","sources":["../../../../src/appui-abstract/content/StandardContentLayouts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;;GAGG;AACH,MAAa,sBAAsB;;AACV,iCAAU,GAAuB;IACtD,EAAE,EAAE,gBAAgB;IACpB,WAAW,EAAE,qBAAqB;CACnC,CAAC;AAEqB,oCAAa,GAAuB;IACzD,EAAE,EAAE,mBAAmB;IACvB,WAAW,EAAE,+DAA+D;IAC5E,aAAa,EAAE;QACb,EAAE,EAAE,+BAA+B;QACnC,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,GAAG;QAChB,YAAY,EAAE,GAAG;QACjB,IAAI,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,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AsB,CAAC,UAAU;IACjC,sBAAsB,CAAC,aAAa;IACpC,sBAAsB,CAAC,gBAAgB;IACvC,sBAAsB,CAAC,kBAAkB;IACzC,sBAAsB,CAAC,mBAAmB;IAC1C,sBAAsB,CAAC,oBAAoB;IAC3C,sBAAsB,CAAC,qBAAqB;IAC5C,sBAAsB,CAAC,kBAAkB;CAC1C,CAAC;AAlGS,wDAAsB","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 ContentView\n */\n\nimport { ContentLayoutProps } from \"./ContentLayoutProps\";\n\n/**\n * Class that define Standard Content Layouts that can be used to specify how the content is arranged in a frontstage.\n * @public\n */\nexport class StandardContentLayouts {\n public static readonly singleView: ContentLayoutProps = {\n id: \"uia:singleView\",\n description: \"Single Content View\",\n };\n\n public static readonly fourQuadrants: ContentLayoutProps = {\n id: \"uia:fourQuadrants\",\n description: \"Four Views, two stacked on the left, two stacked on the right\",\n verticalSplit: {\n id: \"uia:fourQuadrantVerticalSplit\",\n percentage: 0.50,\n lock: false,\n minSizeLeft: 100,\n minSizeRight: 100,\n left: { horizontalSplit: { id: \"uia:fourQuadrantsLeftHorizontal\", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\n right: { horizontalSplit: { id: \"uia:fourQuadrantsRightHorizontal\", percentage: 0.50, top: 2, bottom: 3, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\n },\n };\n\n public static readonly twoVerticalSplit: ContentLayoutProps = {\n id: \"uia:twoVerticalSplit\",\n description: \"Two Views, side by side\",\n verticalSplit: {\n id: \"uia:twoViewsVerticalSplit\",\n percentage: 0.50,\n left: 0,\n right: 1,\n },\n };\n public static readonly twoHorizontalSplit: ContentLayoutProps = {\n id: \"uia:twoHorizontalSplit\",\n description: \"Two views, stack one on top of the other\",\n horizontalSplit: {\n id: \"uia:twoViewsHorizontalSplit\",\n percentage: 0.50,\n lock: false,\n top: 0,\n bottom: 1,\n },\n };\n\n public static readonly threeViewsTwoOnLeft: ContentLayoutProps = {\n id: \"uia:threeViewsTwoOnLeft\",\n description: \"Three views, one on the right with the two on the left stacked one of top of the other\",\n verticalSplit: {\n id: \"uia:twoViewsOnLeftSplit\",\n percentage: 0.50,\n left: { horizontalSplit: { id: \"uia:twoViewsOnLeftHorizontal\", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\n right: 2,\n },\n };\n\n public static readonly threeViewsTwoOnRight: ContentLayoutProps = {\n id: \"uia:threeViewsTwoOnRight\",\n description: \"Three views, one on the left with the two on the right stacked one of top of the other\",\n verticalSplit: {\n id: \"uia:twoViewsOnRightSplit\",\n percentage: 0.50,\n left: 0,\n right: { horizontalSplit: { id: \"uia:twoViewsOnRightHorizontal\", percentage: 0.50, top: 1, bottom: 2, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\n },\n };\n\n public static readonly threeViewsTwoOnBottom: ContentLayoutProps = {\n id: \"uia:threeViewsTwoOnBottom\",\n description: \"Three Views, one on top and two side by side on the bottom\",\n horizontalSplit: {\n id: \"uia:threeViewsTwoOnBottomHorizontal\",\n percentage: 0.50,\n lock: false,\n top: 0,\n bottom: { verticalSplit: { id: \"uia:twoViewsOnBottomVertical\", percentage: 0.50, left: 1, right: 2, lock: false, minSizeLeft: 50, minSizeRight: 50 } },\n },\n };\n\n public static readonly threeViewsTwoOnTop: ContentLayoutProps = {\n id: \"uia:threeViewsTwoOnTop\",\n description: \"Three Views, two side by side on top and one on the bottom\",\n horizontalSplit: {\n id: \"uia:twoViewsOnTopHorizontal\",\n percentage: 0.50,\n lock: false,\n top: { verticalSplit: { id: \"uia:twoViewsOnTopVertical\", percentage: 0.50, left: 0, right: 1, lock: false, minSizeLeft: 50, minSizeRight: 50 } },\n bottom: 2,\n },\n };\n\n // provides and iterable list of standard content layouts\n public static readonly availableLayouts: ContentLayoutProps[] = [\n StandardContentLayouts.singleView,\n StandardContentLayouts.fourQuadrants,\n StandardContentLayouts.twoVerticalSplit,\n StandardContentLayouts.twoHorizontalSplit,\n StandardContentLayouts.threeViewsTwoOnLeft,\n StandardContentLayouts.threeViewsTwoOnRight,\n StandardContentLayouts.threeViewsTwoOnBottom,\n StandardContentLayouts.threeViewsTwoOnTop,\n ];\n\n}\n"]}
1
+ {"version":3,"file":"StandardContentLayouts.js","sourceRoot":"","sources":["../../../../src/appui-abstract/content/StandardContentLayouts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;;GAGG;AACH,MAAa,sBAAsB;;AACV,iCAAU,GAAuB;IACtD,EAAE,EAAE,gBAAgB;IACpB,WAAW,EAAE,qBAAqB;CACnC,CAAC;AAEqB,oCAAa,GAAuB;IACzD,EAAE,EAAE,mBAAmB;IACvB,WAAW,EAAE,+DAA+D;IAC5E,aAAa,EAAE;QACb,EAAE,EAAE,+BAA+B;QACnC,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,GAAG;QAChB,YAAY,EAAE,GAAG;QACjB,IAAI,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE;QACzJ,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE;KAC5J;CACF,CAAC;AAEqB,uCAAgB,GAAuB;IAC5D,EAAE,EAAE,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IACjE,EAAE,EAAE,2BAA2B;IAC/B,WAAW,EAAE,4DAA4D;IACzE,eAAe,EAAE;QACf,EAAE,EAAE,qCAAqC;QACzC,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,CAAC;QACN,MAAM,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,8BAA8B,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE;KACvJ;CACF,CAAC;AAEqB,yCAAkB,GAAuB;IAC9D,EAAE,EAAE,wBAAwB;IAC5B,WAAW,EAAE,4DAA4D;IACzE,eAAe,EAAE;QACf,EAAE,EAAE,6BAA6B;QACjC,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,EAAE,2BAA2B,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE;QAChJ,MAAM,EAAE,CAAC;KACV;CACF,CAAC;AAEF,yDAAyD;AAClC,uCAAgB,GAAyB;IAC9D,sBAAsB,CAAC,UAAU;IACjC,sBAAsB,CAAC,aAAa;IACpC,sBAAsB,CAAC,gBAAgB;IACvC,sBAAsB,CAAC,kBAAkB;IACzC,sBAAsB,CAAC,mBAAmB;IAC1C,sBAAsB,CAAC,oBAAoB;IAC3C,sBAAsB,CAAC,qBAAqB;IAC5C,sBAAsB,CAAC,kBAAkB;CAC1C,CAAC;AAlGS,wDAAsB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport { ContentLayoutProps } from \"./ContentLayoutProps\";\r\n\r\n/**\r\n * Class that define Standard Content Layouts that can be used to specify how the content is arranged in a frontstage.\r\n * @public\r\n */\r\nexport class StandardContentLayouts {\r\n public static readonly singleView: ContentLayoutProps = {\r\n id: \"uia:singleView\",\r\n description: \"Single Content View\",\r\n };\r\n\r\n public static readonly fourQuadrants: ContentLayoutProps = {\r\n id: \"uia:fourQuadrants\",\r\n description: \"Four Views, two stacked on the left, two stacked on the right\",\r\n verticalSplit: {\r\n id: \"uia:fourQuadrantVerticalSplit\",\r\n percentage: 0.50,\r\n lock: false,\r\n minSizeLeft: 100,\r\n minSizeRight: 100,\r\n left: { horizontalSplit: { id: \"uia:fourQuadrantsLeftHorizontal\", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n right: { horizontalSplit: { id: \"uia:fourQuadrantsRightHorizontal\", percentage: 0.50, top: 2, bottom: 3, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n },\r\n };\r\n\r\n public static readonly twoVerticalSplit: ContentLayoutProps = {\r\n id: \"uia:twoVerticalSplit\",\r\n description: \"Two Views, side by side\",\r\n verticalSplit: {\r\n id: \"uia:twoViewsVerticalSplit\",\r\n percentage: 0.50,\r\n left: 0,\r\n right: 1,\r\n },\r\n };\r\n public static readonly twoHorizontalSplit: ContentLayoutProps = {\r\n id: \"uia:twoHorizontalSplit\",\r\n description: \"Two views, stack one on top of the other\",\r\n horizontalSplit: {\r\n id: \"uia:twoViewsHorizontalSplit\",\r\n percentage: 0.50,\r\n lock: false,\r\n top: 0,\r\n bottom: 1,\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnLeft: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnLeft\",\r\n description: \"Three views, one on the right with the two on the left stacked one of top of the other\",\r\n verticalSplit: {\r\n id: \"uia:twoViewsOnLeftSplit\",\r\n percentage: 0.50,\r\n left: { horizontalSplit: { id: \"uia:twoViewsOnLeftHorizontal\", percentage: 0.50, top: 0, bottom: 1, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n right: 2,\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnRight: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnRight\",\r\n description: \"Three views, one on the left with the two on the right stacked one of top of the other\",\r\n verticalSplit: {\r\n id: \"uia:twoViewsOnRightSplit\",\r\n percentage: 0.50,\r\n left: 0,\r\n right: { horizontalSplit: { id: \"uia:twoViewsOnRightHorizontal\", percentage: 0.50, top: 1, bottom: 2, lock: false, minSizeTop: 50, minSizeBottom: 50 } },\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnBottom: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnBottom\",\r\n description: \"Three Views, one on top and two side by side on the bottom\",\r\n horizontalSplit: {\r\n id: \"uia:threeViewsTwoOnBottomHorizontal\",\r\n percentage: 0.50,\r\n lock: false,\r\n top: 0,\r\n bottom: { verticalSplit: { id: \"uia:twoViewsOnBottomVertical\", percentage: 0.50, left: 1, right: 2, lock: false, minSizeLeft: 50, minSizeRight: 50 } },\r\n },\r\n };\r\n\r\n public static readonly threeViewsTwoOnTop: ContentLayoutProps = {\r\n id: \"uia:threeViewsTwoOnTop\",\r\n description: \"Three Views, two side by side on top and one on the bottom\",\r\n horizontalSplit: {\r\n id: \"uia:twoViewsOnTopHorizontal\",\r\n percentage: 0.50,\r\n lock: false,\r\n top: { verticalSplit: { id: \"uia:twoViewsOnTopVertical\", percentage: 0.50, left: 0, right: 1, lock: false, minSizeLeft: 50, minSizeRight: 50 } },\r\n bottom: 2,\r\n },\r\n };\r\n\r\n // provides and iterable list of standard content layouts\r\n public static readonly availableLayouts: ContentLayoutProps[] = [\r\n StandardContentLayouts.singleView,\r\n StandardContentLayouts.fourQuadrants,\r\n StandardContentLayouts.twoVerticalSplit,\r\n StandardContentLayouts.twoHorizontalSplit,\r\n StandardContentLayouts.threeViewsTwoOnLeft,\r\n StandardContentLayouts.threeViewsTwoOnRight,\r\n StandardContentLayouts.threeViewsTwoOnBottom,\r\n StandardContentLayouts.threeViewsTwoOnTop,\r\n ];\r\n\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DialogItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/DialogItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AA0DH;;GAEG;AACH,MAAa,cAAc;IACzB,YAAmB,WAAgC,EAAU,MAAS,EAAU,aAAsB,EAAU,WAAqB;QAAlH,gBAAW,GAAX,WAAW,CAAqB;QAAU,WAAM,GAAN,MAAM,CAAG;QAAU,kBAAa,GAAb,aAAa,CAAS;QAAU,gBAAW,GAAX,WAAW,CAAU;IAAI,CAAC;IAE1I,IAAW,UAAU;QACnB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,GAAY;QAChC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAW,KAAK,CAAC,GAAM;QACrB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED,IAAW,YAAY,CAAC,GAAuB;QAC7C,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC;IAC3B,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,eAAe;QACxB,uBAAuB;QACvB,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,WAAW,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,YAAY,IAAI;YAC7K,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,MAAM;gBAClB,YAAY,EAAE,IAAI,CAAC,aAAa;aACd,CAAC;QACvB,uBAAuB;QACvB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC;IAED,IAAW,eAAe,CAAC,GAAoB;QAC7C,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,KAAqB,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,YAAY,CAAC;IACxC,CAAC;IAED,IAAW,QAAQ;QACjB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9E,CAAC;IAED,IAAW,IAAI;QACb,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;IAClE,CAAC;IAEM,YAAY,CAAC,cAA8B,EAAE,YAAyB;QAC3E,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC;IACjI,CAAC;CACF;AA3DD,wCA2DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\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 * @see See learning documentation [DialogItem]($docs/learning/ui/abstract/dialogitem.md)\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;;;AA0DH;;GAEG;AACH,MAAa,cAAc;IACzB,YAAmB,WAAgC,EAAU,MAAS,EAAU,aAAsB,EAAU,WAAqB;QAAlH,gBAAW,GAAX,WAAW,CAAqB;QAAU,WAAM,GAAN,MAAM,CAAG;QAAU,kBAAa,GAAb,aAAa,CAAS;QAAU,gBAAW,GAAX,WAAW,CAAU;IAAI,CAAC;IAE1I,IAAW,UAAU;QACnB,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,GAAY;QAChC,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAW,KAAK,CAAC,GAAM;QACrB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;IACpB,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,IA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,EAAE,YAAY,EAAE,CAAC;IACjI,CAAC;CACF;AA3DD,wCA2DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Dialog\r\n */\r\n\r\nimport { PropertyDescription } from \"../properties/Description\";\r\n\r\n/** [[DialogItemValue]] Interface of PrimitiveValue types that have type editor support for use in dialogs.\r\n * @public\r\n */\r\nexport interface DialogItemValue {\r\n value?: number | string | boolean | Date;\r\n displayValue?: string;\r\n}\r\n/** [[EditorPosition]] Interface used to identify the location of the item a DialogItem property value.\r\n * @public\r\n */\r\nexport interface EditorPosition {\r\n /** Determine the order the row is shown in UI */\r\n rowPriority: number;\r\n /** Determines the column position for the type editor */\r\n columnIndex: number;\r\n /** Number of columns to occupy. Defaults to 1\r\n * @deprecated in 2.19. No longer necessary, ignored.\r\n */\r\n columnSpan?: number;\r\n}\r\n\r\n/** [[BaseDialogItem]] contains only the members necessary to create a PropertyRecord.\r\n * @public\r\n */\r\nexport interface BaseDialogItem {\r\n readonly value: DialogItemValue;\r\n readonly property: PropertyDescription;\r\n readonly isDisabled?: boolean;\r\n}\r\n/** [[DialogItem]] is the specification that the display engine turns into a UI item.\r\n * @see See learning documentation [DialogItem]($docs/learning/ui/abstract/dialogitem.md)\r\n * @public\r\n */\r\nexport interface DialogItem extends BaseDialogItem {\r\n readonly editorPosition: EditorPosition;\r\n readonly lockProperty?: BaseDialogItem;\r\n}\r\n\r\n/** [[DialogPropertyItem]] us the specification to use if you are defining the components directly, e.g., in React\r\n * @public\r\n */\r\nexport interface DialogPropertyItem {\r\n readonly value: DialogItemValue;\r\n readonly propertyName: string;\r\n}\r\n\r\n/** [[DialogPropertySyncItem]] is used to pass sync messages for DialogPropertyItems\r\n * @public\r\n */\r\nexport interface DialogPropertySyncItem extends DialogPropertyItem {\r\n readonly isDisabled?: boolean;\r\n readonly property?: PropertyDescription;\r\n}\r\n\r\n/** [[DialogProperty]] is a generic helper class that assists working with properties used by UiLayoutDataProvider implementations (i.e. Tool Settings and Dynamic Dialogs).\r\n * @public\r\n */\r\nexport class DialogProperty<T> {\r\n constructor(public description: PropertyDescription, private _value: T, private _displayValue?: string, private _isDisabled?: boolean) { }\r\n\r\n public get isDisabled() {\r\n return !!this._isDisabled;\r\n }\r\n\r\n public set isDisabled(val: boolean) {\r\n this._isDisabled = val;\r\n }\r\n\r\n public get value() {\r\n return this._value;\r\n }\r\n\r\n public set value(val: T) {\r\n this._value = val;\r\n }\r\n\r\n public get name() {\r\n return this.description.name;\r\n }\r\n\r\n public set displayValue(val: string | undefined) {\r\n this._displayValue = val;\r\n }\r\n\r\n public get displayValue() {\r\n return this._displayValue;\r\n }\r\n\r\n public get dialogItemValue() {\r\n // istanbul ignore else\r\n if (typeof this._value === \"string\" || typeof this._value === \"number\" || typeof this._value === \"undefined\" || typeof this._value === \"boolean\" || this._value instanceof Date)\r\n return {\r\n value: this._value,\r\n displayValue: this._displayValue,\r\n } as DialogItemValue;\r\n // istanbul ignore next\r\n throw new Error(\"Not valid primitive type\");\r\n }\r\n\r\n public set dialogItemValue(val: DialogItemValue) {\r\n this._value = val.value as unknown as T;\r\n this._displayValue = val.displayValue;\r\n }\r\n\r\n public get syncItem(): DialogPropertySyncItem {\r\n const isDisabled = this._isDisabled;\r\n return { propertyName: this.name, value: this.dialogItemValue, isDisabled };\r\n }\r\n\r\n public get item(): DialogPropertyItem {\r\n return { propertyName: this.name, value: this.dialogItemValue };\r\n }\r\n\r\n public toDialogItem(editorPosition: EditorPosition, lockProperty?: DialogItem): DialogItem {\r\n return { value: this.dialogItemValue, property: this.description, editorPosition, isDisabled: this._isDisabled, lockProperty };\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UiDataProvider.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/UiDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAGhD;;GAEG;AACH,MAAa,yBAA0B,SAAQ,wBAAwC;CAAI;AAA3F,8DAA2F;AAE3F;;GAEG;AACH,uBAAuB;AACvB,MAAsB,cAAc;IAApC;QAME,2CAA2C;QACpC,gCAA2B,GAAG,IAAI,yBAAyB,EAAE,CAAC;QAE9D,yBAAoB,GAAG,IAAI,wBAAS,EAAQ,CAAC;IA6BtD,CAAC;IArCC,uDAAuD;IAChD,kBAAkB,CAAC,WAAiC;QACzD,MAAM,CAAC,IAAI,KAAK,CAAC,iGAAiG,CAAC,CAAC,CAAC;IACvH,CAAC;IAOD,gDAAgD;IACzC,gBAAgB,CAAC,KAAyB;QAC/C,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;IAED,uFAAuF;IAChF,cAAc,CAAC,cAAwC;QAC5D,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;IAED,sFAAsF;IAC/E,uBAAuB,CAAC,cAAwC;QACrE,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;OACG;IACI,sBAAsB;QAC3B,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,yBAAyB;QAC9B,MAAM,CAAC,IAAI,KAAK,CAAC,+HAA+H,CAAC,CAAC,CAAC;IACrJ,CAAC;CACF;AAtCD,wCAsCC;AASD;;GAEG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAmC;IACnC,qEAAW,CAAA;IACX,0CAA0C;IAC1C,iEAAS,CAAA;AACX,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B","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 { DialogPropertyItem, DialogPropertySyncItem } from \"./DialogItem\";\n\n/** Sync UI Control Properties Event class.\n * @public\n */\nexport class SyncPropertiesChangeEvent extends BeUiEvent<SyncPropertiesChangeEventArgs> { }\n\n/** [[UiDataProvider]] Abstract class that allows property values to be passed between hosting API and UI.\n * @public\n */\n// istanbul ignore next\nexport abstract class UiDataProvider {\n /** Called by UI to inform data provider of changes. */\n public processChangesInUi(_properties: DialogPropertyItem[]): PropertyChangeResult {\n throw (new Error(\"Derived UiDataProvider must implement this method to apply changes to a bulk set of properties.\"));\n }\n\n /** Get Sync UI Control Properties Event */\n public onSyncPropertiesChangeEvent = new SyncPropertiesChangeEvent();\n\n public onItemsReloadedEvent = new BeUiEvent<void>();\n\n /** Called by UI to validate a property value */\n public validateProperty(_item: DialogPropertyItem): PropertyChangeResult {\n return { status: PropertyChangeStatus.Success };\n }\n\n /** Called to sync properties synchronously if a UiDataProvider is active for the UI */\n public syncProperties(syncProperties: DialogPropertySyncItem[]) {\n this.fireSyncPropertiesEvent(syncProperties);\n }\n\n /** Called to inform listener that the UiDataProvider has updated values for the UI */\n public fireSyncPropertiesEvent(syncProperties: DialogPropertySyncItem[]) {\n this.onSyncPropertiesChangeEvent.emit({ properties: syncProperties });\n }\n\n /** Called to inform listeners that new properties are ready for display in UI.\n */\n public fireItemsReloadedEvent() {\n this.onItemsReloadedEvent.emit();\n }\n\n /** Used to pass properties between a tool and an explicity defined UI dialog. See method supplyDialogItems in [[UiLayoutDataProvider]] for supplying\n * properties that will be used to dynamically create and layout control in a Dialog or Widget.\n */\n public supplyAvailableProperties(): DialogPropertyItem[] {\n throw (new Error(\"Derived UiDataProvider that want to use DialogPropertyItems must implement this method. Not for use with dynamic UI controls.\"));\n }\n}\n\n/** Sync UI Control Properties Event Args interface.\n * @public\n */\nexport interface SyncPropertiesChangeEventArgs {\n properties: DialogPropertySyncItem[];\n}\n\n/** Status of Proposed property changes from UI to UiDataProvider\n * @public\n */\nexport enum PropertyChangeStatus {\n /** Property Change(s) Succeeded */\n Success = 0,\n /** Error Processing Property Change(s) */\n Error = 2,\n}\n\n/** Interface used by UiDataProvider to report change status (validation) to UI.\n * @public\n */\nexport interface PropertyChangeResult {\n errorMsg?: string;\n status: PropertyChangeStatus;\n}\n"]}
1
+ {"version":3,"file":"UiDataProvider.js","sourceRoot":"","sources":["../../../../src/appui-abstract/dialogs/UiDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAGhD;;GAEG;AACH,MAAa,yBAA0B,SAAQ,wBAAwC;CAAI;AAA3F,8DAA2F;AAE3F;;GAEG;AACH,uBAAuB;AACvB,MAAsB,cAAc;IAApC;QAME,2CAA2C;QACpC,gCAA2B,GAAG,IAAI,yBAAyB,EAAE,CAAC;QAE9D,yBAAoB,GAAG,IAAI,wBAAS,EAAQ,CAAC;IA6BtD,CAAC;IArCC,uDAAuD;IAChD,kBAAkB,CAAC,WAAiC;QACzD,MAAM,CAAC,IAAI,KAAK,CAAC,iGAAiG,CAAC,CAAC,CAAC;IACvH,CAAC;IAOD,gDAAgD;IACzC,gBAAgB,CAAC,KAAyB;QAC/C,OAAO,EAAE,MAAM,EAAE,oBAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;IAED,uFAAuF;IAChF,cAAc,CAAC,cAAwC;QAC5D,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;IAED,sFAAsF;IAC/E,uBAAuB,CAAC,cAAwC;QACrE,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;OACG;IACI,sBAAsB;QAC3B,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,yBAAyB;QAC9B,MAAM,CAAC,IAAI,KAAK,CAAC,+HAA+H,CAAC,CAAC,CAAC;IACrJ,CAAC;CACF;AAtCD,wCAsCC;AASD;;GAEG;AACH,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAmC;IACnC,qEAAW,CAAA;IACX,0CAA0C;IAC1C,iEAAS,CAAA;AACX,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Dialog\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\nimport { DialogPropertyItem, DialogPropertySyncItem } from \"./DialogItem\";\r\n\r\n/** Sync UI Control Properties Event class.\r\n * @public\r\n */\r\nexport class SyncPropertiesChangeEvent extends BeUiEvent<SyncPropertiesChangeEventArgs> { }\r\n\r\n/** [[UiDataProvider]] Abstract class that allows property values to be passed between hosting API and UI.\r\n * @public\r\n */\r\n// istanbul ignore next\r\nexport abstract class UiDataProvider {\r\n /** Called by UI to inform data provider of changes. */\r\n public processChangesInUi(_properties: DialogPropertyItem[]): PropertyChangeResult {\r\n throw (new Error(\"Derived UiDataProvider must implement this method to apply changes to a bulk set of properties.\"));\r\n }\r\n\r\n /** Get Sync UI Control Properties Event */\r\n public onSyncPropertiesChangeEvent = new SyncPropertiesChangeEvent();\r\n\r\n public onItemsReloadedEvent = new BeUiEvent<void>();\r\n\r\n /** Called by UI to validate a property value */\r\n public validateProperty(_item: DialogPropertyItem): PropertyChangeResult {\r\n return { status: PropertyChangeStatus.Success };\r\n }\r\n\r\n /** Called to sync properties synchronously if a UiDataProvider is active for the UI */\r\n public syncProperties(syncProperties: DialogPropertySyncItem[]) {\r\n this.fireSyncPropertiesEvent(syncProperties);\r\n }\r\n\r\n /** Called to inform listener that the UiDataProvider has updated values for the UI */\r\n public fireSyncPropertiesEvent(syncProperties: DialogPropertySyncItem[]) {\r\n this.onSyncPropertiesChangeEvent.emit({ properties: syncProperties });\r\n }\r\n\r\n /** Called to inform listeners that new properties are ready for display in UI.\r\n */\r\n public fireItemsReloadedEvent() {\r\n this.onItemsReloadedEvent.emit();\r\n }\r\n\r\n /** Used to pass properties between a tool and an explicity defined UI dialog. See method supplyDialogItems in [[UiLayoutDataProvider]] for supplying\r\n * properties that will be used to dynamically create and layout control in a Dialog or Widget.\r\n */\r\n public supplyAvailableProperties(): DialogPropertyItem[] {\r\n throw (new Error(\"Derived UiDataProvider that want to use DialogPropertyItems must implement this method. Not for use with dynamic UI controls.\"));\r\n }\r\n}\r\n\r\n/** Sync UI Control Properties Event Args interface.\r\n * @public\r\n */\r\nexport interface SyncPropertiesChangeEventArgs {\r\n properties: DialogPropertySyncItem[];\r\n}\r\n\r\n/** Status of Proposed property changes from UI to UiDataProvider\r\n * @public\r\n */\r\nexport enum PropertyChangeStatus {\r\n /** Property Change(s) Succeeded */\r\n Success = 0,\r\n /** Error Processing Property Change(s) */\r\n Error = 2,\r\n}\r\n\r\n/** Interface used by UiDataProvider to report change status (validation) to UI.\r\n * @public\r\n */\r\nexport interface PropertyChangeResult {\r\n errorMsg?: string;\r\n status: PropertyChangeStatus;\r\n}\r\n"]}
@@ -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,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AE,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,GAAhB,wBAAgB,KAAhB,wBAAgB,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,GAAjB,yBAAiB,KAAjB,yBAAiB,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,C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AK,EAAE,YAAY,EAAE,UAAU,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACjJ,MAAM,MAAM,GAAG,IAAI,uBAAc,CAAC,aAA+B,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IACxF,MAAM,CAAC,UAAU,GAAG,oBAAoB,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC;AAChB,CAAC,AAL8B,CAK7B;AA9GkB,oDAAoB;AA2H1C;;;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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Dialog\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\nimport { PropertyEditorParams, PropertyEditorParamTypes, SuppressLabelEditorParams } from \"../properties/EditorParams\";\r\nimport { PropertyRecord } from \"../properties/Record\";\r\nimport { PrimitiveValue, PropertyValueFormat } from \"../properties/Value\";\r\nimport { BaseDialogItem, DialogItem, DialogPropertyItem, DialogPropertySyncItem } from \"./DialogItem\";\r\nimport { PropertyChangeResult, PropertyChangeStatus, UiDataProvider } from \"./UiDataProvider\";\r\n\r\n/** Enum for button types. Determines button label, and default button style.\r\n * @public\r\n */\r\nexport enum DialogButtonType {\r\n None = \"\",\r\n Close = \"close\",\r\n OK = \"ok\",\r\n Cancel = \"cancel\",\r\n Yes = \"yes\",\r\n No = \"no\",\r\n Retry = \"retry\",\r\n Next = \"next\",\r\n Previous = \"previous\"\r\n}\r\n\r\n/** Enum for button style.\r\n * @public\r\n */\r\nexport enum DialogButtonStyle {\r\n None = \"\",\r\n Primary = \"iui-cta\",\r\n Hollow = \"iui-default\",\r\n Blue = \"iui-high-visibility\",\r\n}\r\n\r\n/** Interface for a dialog button in a button cluster\r\n * @public\r\n */\r\nexport interface DialogButtonDef {\r\n /** type of button */\r\n type: DialogButtonType;\r\n /** Triggered on button click */\r\n onClick: () => void;\r\n /** Which button style to decorate button width */\r\n buttonStyle?: DialogButtonStyle;\r\n /** Disable the button */\r\n disabled?: boolean;\r\n /** Custom label */\r\n label?: string;\r\n /** Custom CSS class */\r\n className?: string;\r\n}\r\n\r\n/** [[DialogRow]] is the interface that groups dialog items into rows for building UI\r\n * @public\r\n */\r\nexport interface DialogRow {\r\n priority: number;\r\n items: DialogItem[];\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport abstract class UiLayoutDataProvider extends UiDataProvider {\r\n private _items: ReadonlyArray<DialogItem> | undefined;\r\n\r\n /** Applies changes from one or more properties - some dialogs will use this to send a bulk set of changes back to the provider */\r\n public override processChangesInUi(properties: DialogPropertyItem[]): PropertyChangeResult {\r\n // Default implementation is to just pass each property to applyUiPropertyChange\r\n properties.forEach((property) => this.applyUiPropertyChange(property));\r\n return { status: PropertyChangeStatus.Success };\r\n }\r\n\r\n /** Applies change of a single property - this is the default method used when property editors are dynamically generated. */\r\n // istanbul ignore next\r\n public applyUiPropertyChange = (_updatedValue: DialogPropertySyncItem): void => {\r\n throw (new Error(\"Derived UiDataProvider should implement this to apply change to a single property.\"));\r\n };\r\n\r\n private _rows: DialogRow[] | undefined;\r\n\r\n /** Array of dialog rows */\r\n public get rows(): DialogRow[] {\r\n if (!this._rows) {\r\n this._rows = this.layoutDialogRows();\r\n }\r\n return this._rows;\r\n }\r\n\r\n protected loadItemsInternal(items: ReadonlyArray<DialogItem> | undefined) {\r\n this._items = items ? items : [];\r\n this._rows = this.layoutDialogRows();\r\n }\r\n\r\n /** Called by UI to request available properties that can be bound to user supplied UI components (See Tool1UiProvider for example). */\r\n // istanbul ignore next\r\n public supplyDialogItems(): DialogItem[] | undefined {\r\n throw (new Error(\"Derived UiDataProvider must implement this method to supply set of properties.\"));\r\n }\r\n\r\n public get items(): ReadonlyArray<DialogItem> {\r\n if (undefined === this._items) {\r\n this.loadItemsInternal(this.supplyDialogItems());\r\n }\r\n return this._items!;\r\n }\r\n\r\n /** Called to inform listeners that new properties are ready for display in UI. */\r\n public reloadDialogItems(emitEvent = true) {\r\n this.loadItemsInternal(this.supplyDialogItems());\r\n // istanbul ignore else\r\n if (emitEvent)\r\n this.fireItemsReloadedEvent();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public layoutDialogRows(): DialogRow[] {\r\n const rows: DialogRow[] = [];\r\n\r\n this.items.forEach((item) => {\r\n const row = rows.find((value) => value.priority === item.editorPosition.rowPriority);\r\n if (row) {\r\n row.items.push(item);\r\n } else {\r\n rows.push({ priority: item.editorPosition.rowPriority, items: [item] });\r\n }\r\n });\r\n\r\n // sort rows\r\n rows.sort((a: DialogRow, b: DialogRow) => a.priority - b.priority);\r\n // sort records\r\n rows.forEach((row: DialogRow) => row.items.sort((a: DialogItem, b: DialogItem) => a.editorPosition.columnIndex - b.editorPosition.columnIndex));\r\n return rows;\r\n }\r\n\r\n /** Determines if a dialog item editor wants a label */\r\n public static editorWantsLabel(item: DialogItem): boolean {\r\n if (item.property.editor && item.property.editor.params) {\r\n const params = item.property.editor.params.find((param: PropertyEditorParams) => param.type === PropertyEditorParamTypes.SuppressEditorLabel) as SuppressLabelEditorParams;\r\n // istanbul ignore else\r\n if (params)\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Determines if a dialog items has an associated lock property */\r\n public static hasAssociatedLockProperty(item: DialogItem): boolean {\r\n return !!item.lockProperty;\r\n }\r\n\r\n /** Gets the disabled state for a given dialog item */\r\n public static getItemDisabledState(baseDialogItem: BaseDialogItem): boolean {\r\n const dialogItem = baseDialogItem as DialogItem;\r\n // istanbul ignore else\r\n if (dialogItem === undefined || dialogItem.lockProperty === undefined)\r\n return !!baseDialogItem.isDisabled;\r\n const value = dialogItem.lockProperty.value;\r\n // istanbul ignore next\r\n if (value === undefined)\r\n return !!baseDialogItem.isDisabled;\r\n\r\n return !value.value;\r\n }\r\n\r\n /** Gets a property record for a given dialog item */\r\n public static getPropertyRecord = (dialogItem: BaseDialogItem): PropertyRecord => {\r\n const propertyValue = { valueFormat: PropertyValueFormat.Primitive, value: dialogItem.value.value, displayValue: dialogItem.value.displayValue };\r\n const record = new PropertyRecord(propertyValue as PrimitiveValue, dialogItem.property);\r\n record.isDisabled = UiLayoutDataProvider.getItemDisabledState(dialogItem);\r\n return record;\r\n };\r\n\r\n /** Determines if a dialog row only contains button group editors */\r\n public static onlyContainButtonGroupEditors(row: DialogRow): boolean {\r\n for (const item of row.items) {\r\n // istanbul ignore else\r\n if (UiLayoutDataProvider.hasAssociatedLockProperty(item) || undefined === item.property.editor || \"enum-buttongroup\" !== item.property.editor.name || UiLayoutDataProvider.editorWantsLabel(item))\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/** [[DialogLayoutDataProvider]] Abstract class that allows property values to be passed between hosting API and Dialog that generates and arranges components dynamically\r\n * including the buttons at the bottom of the dialog.\r\n * @public\r\n */\r\nexport abstract class DialogLayoutDataProvider extends UiLayoutDataProvider {\r\n public onButtonsReloadedEvent = new BeUiEvent<void>();\r\n\r\n /** Called to inform listeners that modal dialog button data needs to be refreshed. */\r\n public fireDialogButtonsReloadEvent() {\r\n this.onButtonsReloadedEvent.emit();\r\n }\r\n\r\n public supplyButtonData(): DialogButtonDef[] | undefined {\r\n // Derived class should override\r\n const buttons: DialogButtonDef[] = [];\r\n // istanbul ignore next\r\n buttons.push({ type: DialogButtonType.OK, onClick: () => { } });\r\n // istanbul ignore next\r\n buttons.push({ type: DialogButtonType.Cancel, onClick: () => { } });\r\n return buttons;\r\n }\r\n}\r\n"]}