@itwin/appui-abstract 5.0.0-dev.8 → 5.0.0-dev.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +46 -1
  2. package/lib/cjs/appui-abstract/UiAdmin.js +4 -5
  3. package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
  4. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js +91 -91
  5. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  6. package/lib/cjs/appui-abstract/dialogs/DialogItem.d.ts +1 -1
  7. package/lib/cjs/appui-abstract/dialogs/DialogItem.js +4 -0
  8. package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
  9. package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js +3 -5
  10. package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
  11. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js +15 -19
  12. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  13. package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js +3 -0
  14. package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
  15. package/lib/cjs/appui-abstract/items/ConditionalStringValue.js +3 -0
  16. package/lib/cjs/appui-abstract/items/ConditionalStringValue.js.map +1 -1
  17. package/lib/cjs/appui-abstract/properties/Record.js +18 -0
  18. package/lib/cjs/appui-abstract/properties/Record.js.map +1 -1
  19. package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js +10 -6
  20. package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
  21. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts +3 -27
  22. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
  23. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js +15 -37
  24. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  25. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts +0 -10
  26. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
  27. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js +3 -20
  28. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  29. package/lib/cjs/appui-abstract/utils/UiError.js +1 -0
  30. package/lib/cjs/appui-abstract/utils/UiError.js.map +1 -1
  31. package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js +7 -0
  32. package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
  33. package/lib/cjs/appui-abstract.d.ts +1 -28
  34. package/lib/cjs/appui-abstract.d.ts.map +1 -1
  35. package/lib/cjs/appui-abstract.js +1 -28
  36. package/lib/cjs/appui-abstract.js.map +1 -1
  37. package/lib/esm/appui-abstract/UiAdmin.js +4 -5
  38. package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
  39. package/lib/esm/appui-abstract/content/StandardContentLayouts.js +91 -91
  40. package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  41. package/lib/esm/appui-abstract/dialogs/DialogItem.d.ts +1 -1
  42. package/lib/esm/appui-abstract/dialogs/DialogItem.js +4 -0
  43. package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
  44. package/lib/esm/appui-abstract/dialogs/UiDataProvider.js +3 -5
  45. package/lib/esm/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
  46. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js +15 -19
  47. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  48. package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js +3 -0
  49. package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
  50. package/lib/esm/appui-abstract/items/ConditionalStringValue.js +3 -0
  51. package/lib/esm/appui-abstract/items/ConditionalStringValue.js.map +1 -1
  52. package/lib/esm/appui-abstract/properties/Record.js +18 -0
  53. package/lib/esm/appui-abstract/properties/Record.js.map +1 -1
  54. package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js +10 -6
  55. package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
  56. package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts +3 -27
  57. package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
  58. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js +14 -36
  59. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  60. package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts +0 -10
  61. package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
  62. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js +3 -20
  63. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  64. package/lib/esm/appui-abstract/utils/UiError.js +1 -0
  65. package/lib/esm/appui-abstract/utils/UiError.js.map +1 -1
  66. package/lib/esm/appui-abstract/utils/UiEventDispatcher.js +7 -0
  67. package/lib/esm/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
  68. package/lib/esm/appui-abstract.d.ts +1 -28
  69. package/lib/esm/appui-abstract.d.ts.map +1 -1
  70. package/lib/esm/appui-abstract.js +1 -28
  71. package/lib/esm/appui-abstract.js.map +1 -1
  72. package/package.json +13 -14
  73. package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts +0 -31
  74. package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts.map +0 -1
  75. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js +0 -80
  76. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +0 -1
  77. package/lib/cjs/appui-abstract/UiItemsManager.d.ts +0 -111
  78. package/lib/cjs/appui-abstract/UiItemsManager.d.ts.map +0 -1
  79. package/lib/cjs/appui-abstract/UiItemsManager.js +0 -194
  80. package/lib/cjs/appui-abstract/UiItemsManager.js.map +0 -1
  81. package/lib/cjs/appui-abstract/UiItemsProvider.d.ts +0 -30
  82. package/lib/cjs/appui-abstract/UiItemsProvider.d.ts.map +0 -1
  83. package/lib/cjs/appui-abstract/UiItemsProvider.js +0 -10
  84. package/lib/cjs/appui-abstract/UiItemsProvider.js.map +0 -1
  85. package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts +0 -92
  86. package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts.map +0 -1
  87. package/lib/cjs/appui-abstract/backstage/BackstageItem.js +0 -69
  88. package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +0 -1
  89. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.d.ts +0 -43
  90. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.d.ts.map +0 -1
  91. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js +0 -136
  92. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js.map +0 -1
  93. package/lib/cjs/appui-abstract/items/ProvidedItem.d.ts +0 -12
  94. package/lib/cjs/appui-abstract/items/ProvidedItem.d.ts.map +0 -1
  95. package/lib/cjs/appui-abstract/items/ProvidedItem.js +0 -10
  96. package/lib/cjs/appui-abstract/items/ProvidedItem.js.map +0 -1
  97. package/lib/cjs/appui-abstract/items/StageUsage.d.ts +0 -17
  98. package/lib/cjs/appui-abstract/items/StageUsage.d.ts.map +0 -1
  99. package/lib/cjs/appui-abstract/items/StageUsage.js +0 -25
  100. package/lib/cjs/appui-abstract/items/StageUsage.js.map +0 -1
  101. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts +0 -129
  102. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts.map +0 -1
  103. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js +0 -88
  104. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +0 -1
  105. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.d.ts +0 -40
  106. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.d.ts.map +0 -1
  107. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js +0 -136
  108. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js.map +0 -1
  109. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.d.ts +0 -46
  110. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.d.ts.map +0 -1
  111. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js +0 -236
  112. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js.map +0 -1
  113. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts +0 -87
  114. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts.map +0 -1
  115. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js +0 -10
  116. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +0 -1
  117. package/lib/cjs/appui-abstract/widget/StagePanel.d.ts +0 -37
  118. package/lib/cjs/appui-abstract/widget/StagePanel.d.ts.map +0 -1
  119. package/lib/cjs/appui-abstract/widget/StagePanel.js +0 -47
  120. package/lib/cjs/appui-abstract/widget/StagePanel.js.map +0 -1
  121. package/lib/cjs/appui-abstract/widget/WidgetState.d.ts +0 -20
  122. package/lib/cjs/appui-abstract/widget/WidgetState.d.ts.map +0 -1
  123. package/lib/cjs/appui-abstract/widget/WidgetState.js +0 -28
  124. package/lib/cjs/appui-abstract/widget/WidgetState.js.map +0 -1
  125. package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts +0 -31
  126. package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts.map +0 -1
  127. package/lib/esm/appui-abstract/BaseUiItemsProvider.js +0 -76
  128. package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +0 -1
  129. package/lib/esm/appui-abstract/UiItemsManager.d.ts +0 -111
  130. package/lib/esm/appui-abstract/UiItemsManager.d.ts.map +0 -1
  131. package/lib/esm/appui-abstract/UiItemsManager.js +0 -190
  132. package/lib/esm/appui-abstract/UiItemsManager.js.map +0 -1
  133. package/lib/esm/appui-abstract/UiItemsProvider.d.ts +0 -30
  134. package/lib/esm/appui-abstract/UiItemsProvider.d.ts.map +0 -1
  135. package/lib/esm/appui-abstract/UiItemsProvider.js +0 -9
  136. package/lib/esm/appui-abstract/UiItemsProvider.js.map +0 -1
  137. package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts +0 -92
  138. package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts.map +0 -1
  139. package/lib/esm/appui-abstract/backstage/BackstageItem.js +0 -63
  140. package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +0 -1
  141. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.d.ts +0 -43
  142. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.d.ts.map +0 -1
  143. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js +0 -132
  144. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js.map +0 -1
  145. package/lib/esm/appui-abstract/items/ProvidedItem.d.ts +0 -12
  146. package/lib/esm/appui-abstract/items/ProvidedItem.d.ts.map +0 -1
  147. package/lib/esm/appui-abstract/items/ProvidedItem.js +0 -9
  148. package/lib/esm/appui-abstract/items/ProvidedItem.js.map +0 -1
  149. package/lib/esm/appui-abstract/items/StageUsage.d.ts +0 -17
  150. package/lib/esm/appui-abstract/items/StageUsage.d.ts.map +0 -1
  151. package/lib/esm/appui-abstract/items/StageUsage.js +0 -22
  152. package/lib/esm/appui-abstract/items/StageUsage.js.map +0 -1
  153. package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts +0 -129
  154. package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts.map +0 -1
  155. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js +0 -81
  156. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +0 -1
  157. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.d.ts +0 -40
  158. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.d.ts.map +0 -1
  159. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js +0 -132
  160. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js.map +0 -1
  161. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.d.ts +0 -46
  162. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.d.ts.map +0 -1
  163. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js +0 -232
  164. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js.map +0 -1
  165. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts +0 -87
  166. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts.map +0 -1
  167. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js +0 -9
  168. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +0 -1
  169. package/lib/esm/appui-abstract/widget/StagePanel.d.ts +0 -37
  170. package/lib/esm/appui-abstract/widget/StagePanel.d.ts.map +0 -1
  171. package/lib/esm/appui-abstract/widget/StagePanel.js +0 -44
  172. package/lib/esm/appui-abstract/widget/StagePanel.js.map +0 -1
  173. package/lib/esm/appui-abstract/widget/WidgetState.d.ts +0 -20
  174. package/lib/esm/appui-abstract/widget/WidgetState.d.ts.map +0 -1
  175. package/lib/esm/appui-abstract/widget/WidgetState.js +0 -25
  176. package/lib/esm/appui-abstract/widget/WidgetState.js.map +0 -1
@@ -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,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,SAAwC;CAAI;AAE3F;;GAEG;AACH,uBAAuB;AACvB,MAAM,OAAgB,cAAc;IAApC;QAME,2CAA2C;QACpC,gCAA2B,GAAG,IAAI,yBAAyB,EAAE,CAAC;QAE9D,yBAAoB,GAAG,IAAI,SAAS,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;AASD;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAmC;IACnC,qEAAW,CAAA;IACX,0CAA0C;IAC1C,iEAAS,CAAA;AACX,CAAC,EALW,oBAAoB,KAApB,oBAAoB,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,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,SAAwC;CAAI;AAE3F;;GAEG;AACH,uBAAuB;AACvB,MAAM,OAAgB,cAAc;IAClC,uDAAuD;IAChD,kBAAkB,CAAC,WAAiC;QACzD,MAAM,CAAC,IAAI,KAAK,CAAC,iGAAiG,CAAC,CAAC,CAAC;IACvH,CAAC;IAED,2CAA2C;IACpC,2BAA2B,GAAG,IAAI,yBAAyB,EAAE,CAAC;IAE9D,oBAAoB,GAAG,IAAI,SAAS,EAAQ,CAAC;IAEpD,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;AASD;;GAEG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAmC;IACnC,qEAAW,CAAA;IACX,0CAA0C;IAC1C,iEAAS,CAAA;AACX,CAAC,EALW,oBAAoB,KAApB,oBAAoB,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"]}
@@ -39,20 +39,19 @@ export var DialogButtonStyle;
39
39
  * @public
40
40
  */
41
41
  export class UiLayoutDataProvider extends UiDataProvider {
42
- constructor() {
43
- super(...arguments);
44
- /** Applies change of a single property - this is the default method used when property editors are dynamically generated. */
45
- // istanbul ignore next
46
- this.applyUiPropertyChange = (_updatedValue) => {
47
- throw (new Error("Derived UiDataProvider should implement this to apply change to a single property."));
48
- };
49
- }
42
+ _items;
50
43
  /** Applies changes from one or more properties - some dialogs will use this to send a bulk set of changes back to the provider */
51
44
  processChangesInUi(properties) {
52
45
  // Default implementation is to just pass each property to applyUiPropertyChange
53
46
  properties.forEach((property) => this.applyUiPropertyChange(property));
54
47
  return { status: PropertyChangeStatus.Success };
55
48
  }
49
+ /** Applies change of a single property - this is the default method used when property editors are dynamically generated. */
50
+ // istanbul ignore next
51
+ applyUiPropertyChange = (_updatedValue) => {
52
+ throw (new Error("Derived UiDataProvider should implement this to apply change to a single property."));
53
+ };
54
+ _rows;
56
55
  /** Array of dialog rows */
57
56
  get rows() {
58
57
  if (!this._rows) {
@@ -128,6 +127,13 @@ export class UiLayoutDataProvider extends UiDataProvider {
128
127
  return !!baseDialogItem.isDisabled;
129
128
  return !value.value;
130
129
  }
130
+ /** Gets a property record for a given dialog item */
131
+ static getPropertyRecord = (dialogItem) => {
132
+ const propertyValue = { valueFormat: PropertyValueFormat.Primitive, value: dialogItem.value.value, displayValue: dialogItem.value.displayValue };
133
+ const record = new PropertyRecord(propertyValue, dialogItem.property);
134
+ record.isDisabled = UiLayoutDataProvider.getItemDisabledState(dialogItem);
135
+ return record;
136
+ };
131
137
  /** Determines if a dialog row only contains button group editors */
132
138
  static onlyContainButtonGroupEditors(row) {
133
139
  for (const item of row.items) {
@@ -138,22 +144,12 @@ export class UiLayoutDataProvider extends UiDataProvider {
138
144
  return true;
139
145
  }
140
146
  }
141
- /** Gets a property record for a given dialog item */
142
- UiLayoutDataProvider.getPropertyRecord = (dialogItem) => {
143
- const propertyValue = { valueFormat: PropertyValueFormat.Primitive, value: dialogItem.value.value, displayValue: dialogItem.value.displayValue };
144
- const record = new PropertyRecord(propertyValue, dialogItem.property);
145
- record.isDisabled = UiLayoutDataProvider.getItemDisabledState(dialogItem);
146
- return record;
147
- };
148
147
  /** [[DialogLayoutDataProvider]] Abstract class that allows property values to be passed between hosting API and Dialog that generates and arranges components dynamically
149
148
  * including the buttons at the bottom of the dialog.
150
149
  * @public
151
150
  */
152
151
  export class DialogLayoutDataProvider extends UiLayoutDataProvider {
153
- constructor() {
154
- super(...arguments);
155
- this.onButtonsReloadedEvent = new BeUiEvent();
156
- }
152
+ onButtonsReloadedEvent = new BeUiEvent();
157
153
  /** Called to inform listeners that modal dialog button data needs to be refreshed. */
158
154
  fireDialogButtonsReloadEvent() {
159
155
  this.onButtonsReloadedEvent.emit();
@@ -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,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAwB,wBAAwB,EAA6B,MAAM,4BAA4B,CAAC;AACvH,OAAO,EAAE,cAAc,EAAE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AI,SAAS,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","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,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAwB,wBAAwB,EAA6B,MAAM,4BAA4B,CAAC;AACvH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAkB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAwB,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE9F;;GAEG;AACH,MAAM,CAAN,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAC1B,6BAAS,CAAA;IACT,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,qCAAiB,CAA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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","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"]}
@@ -10,6 +10,9 @@
10
10
  * @public
11
11
  */
12
12
  export class ConditionalBooleanValue {
13
+ testFunc;
14
+ syncEventIds;
15
+ _value;
13
16
  /**
14
17
  * Constructor for ConditionalBooleanValue. It is important that the same ConditionalBooleanValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly.
15
18
  * @param testFunc Function to run to retrieve the value for the conditional. This function is run when refresh method is called or if the value is not defined in the constructor.
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionalBooleanValue.js","sourceRoot":"","sources":["../../../../src/appui-abstract/items/ConditionalBooleanValue.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IAGlC;;;;;OAKG;IACH,YAA4B,QAAuB,EAAkB,YAAsB,EAAE,KAAe;QAAhF,aAAQ,GAAR,QAAQ,CAAe;QAAkB,iBAAY,GAAZ,YAAY,CAAU;QACzF,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,oDAAoD;IACpD,IAAW,KAAK;QACd,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,yDAAyD;IAClD,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,IAAI,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0GAA0G;IACnG,MAAM,CAAC,YAAY,CAAC,gBAA+D,EAAE,QAAqB;QAC/G,IAAI,SAAS,KAAK,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,YAAY,uBAAuB,CAAC;YAC1F,OAAO,KAAK,CAAC;QAEf,IAAI,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;YACnG,OAAO,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0FAA0F;IACnF,MAAM,CAAC,QAAQ,CAAC,gBAA+D;QACpF,IAAI,SAAS,KAAK,gBAAgB;YAChC,OAAO,KAAK,CAAC;QAEf,IAAI,gBAAgB,YAAY,uBAAuB;YACrD,OAAO,gBAAgB,CAAC,KAAK,CAAC;QAEhC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF","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 Item\n */\n\n/** Class used to return a boolean value. The boolean value is refreshed by using the specified function. The syncEventIds define one or more\n * eventIds that would require the testFunc to be rerun.\n * @public\n */\nexport class ConditionalBooleanValue {\n private _value?: boolean;\n\n /**\n * Constructor for ConditionalBooleanValue. It is important that the same ConditionalBooleanValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly.\n * @param testFunc Function to run to retrieve the value for the conditional. This function is run when refresh method is called or if the value is not defined in the constructor.\n * @param syncEventIds An array of eventId that should be monitored to determine when to run the refresh method.\n * @param value The default value for the conditional value. If not specified then the function is run to set the value when the value is retrieved.\n */\n constructor(public readonly testFunc: () => boolean, public readonly syncEventIds: string[], value?: boolean) {\n this._value = value;\n }\n\n /** The current boolean value of the conditional. */\n public get value(): boolean {\n if (undefined !== this._value)\n return this._value;\n\n this._value = this.testFunc();\n return this._value;\n }\n\n /** Called to update the value by running the testFunc */\n public refresh(): boolean {\n const newValue = this.testFunc();\n if (newValue !== this._value) {\n this._value = newValue;\n return true;\n }\n return false;\n }\n\n /** helper function to process properties defined as type ConditionalBooleanValue | boolean | undefined */\n public static refreshValue(conditionalValue: ConditionalBooleanValue | boolean | undefined, eventIds: Set<string>): boolean {\n if (undefined === conditionalValue || !(conditionalValue instanceof ConditionalBooleanValue))\n return false;\n\n if (conditionalValue.syncEventIds.some((value: string): boolean => eventIds.has(value.toLowerCase())))\n return conditionalValue.refresh();\n\n return false;\n }\n\n /** helper function to get boolean from a ConditionalBooleanValue | boolean | undefined */\n public static getValue(conditionalValue: ConditionalBooleanValue | boolean | undefined): boolean {\n if (undefined === conditionalValue)\n return false;\n\n if (conditionalValue instanceof ConditionalBooleanValue)\n return conditionalValue.value;\n\n return conditionalValue;\n }\n}\n"]}
1
+ {"version":3,"file":"ConditionalBooleanValue.js","sourceRoot":"","sources":["../../../../src/appui-abstract/items/ConditionalBooleanValue.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;GAGG;AACH,MAAM,OAAO,uBAAuB;IASN;IAAyC;IAR7D,MAAM,CAAW;IAEzB;;;;;OAKG;IACH,YAA4B,QAAuB,EAAkB,YAAsB,EAAE,KAAe;QAAhF,aAAQ,GAAR,QAAQ,CAAe;QAAkB,iBAAY,GAAZ,YAAY,CAAU;QACzF,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,oDAAoD;IACpD,IAAW,KAAK;QACd,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,yDAAyD;IAClD,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACjC,IAAI,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0GAA0G;IACnG,MAAM,CAAC,YAAY,CAAC,gBAA+D,EAAE,QAAqB;QAC/G,IAAI,SAAS,KAAK,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,YAAY,uBAAuB,CAAC;YAC1F,OAAO,KAAK,CAAC;QAEf,IAAI,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;YACnG,OAAO,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0FAA0F;IACnF,MAAM,CAAC,QAAQ,CAAC,gBAA+D;QACpF,IAAI,SAAS,KAAK,gBAAgB;YAChC,OAAO,KAAK,CAAC;QAEf,IAAI,gBAAgB,YAAY,uBAAuB;YACrD,OAAO,gBAAgB,CAAC,KAAK,CAAC;QAEhC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF","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 Item\n */\n\n/** Class used to return a boolean value. The boolean value is refreshed by using the specified function. The syncEventIds define one or more\n * eventIds that would require the testFunc to be rerun.\n * @public\n */\nexport class ConditionalBooleanValue {\n private _value?: boolean;\n\n /**\n * Constructor for ConditionalBooleanValue. It is important that the same ConditionalBooleanValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly.\n * @param testFunc Function to run to retrieve the value for the conditional. This function is run when refresh method is called or if the value is not defined in the constructor.\n * @param syncEventIds An array of eventId that should be monitored to determine when to run the refresh method.\n * @param value The default value for the conditional value. If not specified then the function is run to set the value when the value is retrieved.\n */\n constructor(public readonly testFunc: () => boolean, public readonly syncEventIds: string[], value?: boolean) {\n this._value = value;\n }\n\n /** The current boolean value of the conditional. */\n public get value(): boolean {\n if (undefined !== this._value)\n return this._value;\n\n this._value = this.testFunc();\n return this._value;\n }\n\n /** Called to update the value by running the testFunc */\n public refresh(): boolean {\n const newValue = this.testFunc();\n if (newValue !== this._value) {\n this._value = newValue;\n return true;\n }\n return false;\n }\n\n /** helper function to process properties defined as type ConditionalBooleanValue | boolean | undefined */\n public static refreshValue(conditionalValue: ConditionalBooleanValue | boolean | undefined, eventIds: Set<string>): boolean {\n if (undefined === conditionalValue || !(conditionalValue instanceof ConditionalBooleanValue))\n return false;\n\n if (conditionalValue.syncEventIds.some((value: string): boolean => eventIds.has(value.toLowerCase())))\n return conditionalValue.refresh();\n\n return false;\n }\n\n /** helper function to get boolean from a ConditionalBooleanValue | boolean | undefined */\n public static getValue(conditionalValue: ConditionalBooleanValue | boolean | undefined): boolean {\n if (undefined === conditionalValue)\n return false;\n\n if (conditionalValue instanceof ConditionalBooleanValue)\n return conditionalValue.value;\n\n return conditionalValue;\n }\n}\n"]}
@@ -10,6 +10,9 @@
10
10
  * @public
11
11
  */
12
12
  export class ConditionalStringValue {
13
+ stringGetter;
14
+ syncEventIds;
15
+ _value;
13
16
  /**
14
17
  * Constructor for ConditionalStringValue. It is important that the same ConditionalStringValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly.
15
18
  * @param stringGetter Function to run to retrieve the value for the conditional. This function is run when refresh method is called or if the value is not defined in the constructor.
@@ -1 +1 @@
1
- {"version":3,"file":"ConditionalStringValue.js","sourceRoot":"","sources":["../../../../src/appui-abstract/items/ConditionalStringValue.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IAGjC;;;;;OAKG;IACH,YAA4B,YAA0B,EAAkB,YAAsB,EAAE,KAAc;QAAlF,iBAAY,GAAZ,YAAY,CAAc;QAAkB,iBAAY,GAAZ,YAAY,CAAU;QAC5F,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,oDAAoD;IACpD,IAAW,KAAK;QACd,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,6DAA6D;IACtD,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACrC,IAAI,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,YAAY,CAAC,gBAA6D,EAAE,QAAqB;QAC7G,IAAI,SAAS,KAAK,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,YAAY,sBAAsB,CAAC;YACzF,OAAO,KAAK,CAAC;QAEf,IAAI,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;YACnG,OAAO,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uFAAuF;IAChF,MAAM,CAAC,QAAQ,CAAC,gBAA6D;QAClF,IAAI,SAAS,KAAK,gBAAgB;YAChC,OAAO,SAAS,CAAC;QAEnB,IAAI,gBAAgB,YAAY,sBAAsB;YACpD,OAAO,gBAAgB,CAAC,KAAK,CAAC;QAEhC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF","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 Item\n */\n\n/** Class used to return a string value. The string value is refreshed by using the specified function. The syncEventIds define one or more\n * eventIds that would require the stringGetter function to be rerun.\n * @public\n */\nexport class ConditionalStringValue {\n private _value?: string;\n\n /**\n * Constructor for ConditionalStringValue. It is important that the same ConditionalStringValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly.\n * @param stringGetter Function to run to retrieve the value for the conditional. This function is run when refresh method is called or if the value is not defined in the constructor.\n * @param syncEventIds An array of eventId that should be monitored to determine when to run the refresh method.\n * @param value The default value for the conditional value. If not specified then the function is run to set the value when the value is retrieved.\n */\n constructor(public readonly stringGetter: () => string, public readonly syncEventIds: string[], value?: string) {\n this._value = value;\n }\n\n /** The current boolean value of the conditional. */\n public get value(): string {\n if (undefined !== this._value)\n return this._value;\n\n this._value = this.stringGetter();\n return this._value;\n }\n\n /** Called to update the value by running the stringGetter */\n public refresh(): boolean {\n const newValue = this.stringGetter();\n if (newValue !== this._value) {\n this._value = newValue;\n return true;\n }\n return false;\n }\n\n /** helper function to process properties defined as type ConditionalStringValue | string | undefined\n * Return true if the value was updated.\n */\n public static refreshValue(conditionalValue: ConditionalStringValue | string | undefined, eventIds: Set<string>): boolean {\n if (undefined === conditionalValue || !(conditionalValue instanceof ConditionalStringValue))\n return false;\n\n if (conditionalValue.syncEventIds.some((value: string): boolean => eventIds.has(value.toLowerCase())))\n return conditionalValue.refresh();\n\n return false;\n }\n\n /** helper function to get string from a ConditionalStringValue | string | undefined */\n public static getValue(conditionalValue: ConditionalStringValue | string | undefined): string | undefined {\n if (undefined === conditionalValue)\n return undefined;\n\n if (conditionalValue instanceof ConditionalStringValue)\n return conditionalValue.value;\n\n return conditionalValue;\n }\n}\n"]}
1
+ {"version":3,"file":"ConditionalStringValue.js","sourceRoot":"","sources":["../../../../src/appui-abstract/items/ConditionalStringValue.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IASL;IAA4C;IARhE,MAAM,CAAU;IAExB;;;;;OAKG;IACH,YAA4B,YAA0B,EAAkB,YAAsB,EAAE,KAAc;QAAlF,iBAAY,GAAZ,YAAY,CAAc;QAAkB,iBAAY,GAAZ,YAAY,CAAU;QAC5F,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,oDAAoD;IACpD,IAAW,KAAK;QACd,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,MAAM,CAAC;QAErB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,6DAA6D;IACtD,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACrC,IAAI,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,YAAY,CAAC,gBAA6D,EAAE,QAAqB;QAC7G,IAAI,SAAS,KAAK,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,YAAY,sBAAsB,CAAC;YACzF,OAAO,KAAK,CAAC;QAEf,IAAI,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;YACnG,OAAO,gBAAgB,CAAC,OAAO,EAAE,CAAC;QAEpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uFAAuF;IAChF,MAAM,CAAC,QAAQ,CAAC,gBAA6D;QAClF,IAAI,SAAS,KAAK,gBAAgB;YAChC,OAAO,SAAS,CAAC;QAEnB,IAAI,gBAAgB,YAAY,sBAAsB;YACpD,OAAO,gBAAgB,CAAC,KAAK,CAAC;QAEhC,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF","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 Item\n */\n\n/** Class used to return a string value. The string value is refreshed by using the specified function. The syncEventIds define one or more\n * eventIds that would require the stringGetter function to be rerun.\n * @public\n */\nexport class ConditionalStringValue {\n private _value?: string;\n\n /**\n * Constructor for ConditionalStringValue. It is important that the same ConditionalStringValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly.\n * @param stringGetter Function to run to retrieve the value for the conditional. This function is run when refresh method is called or if the value is not defined in the constructor.\n * @param syncEventIds An array of eventId that should be monitored to determine when to run the refresh method.\n * @param value The default value for the conditional value. If not specified then the function is run to set the value when the value is retrieved.\n */\n constructor(public readonly stringGetter: () => string, public readonly syncEventIds: string[], value?: string) {\n this._value = value;\n }\n\n /** The current boolean value of the conditional. */\n public get value(): string {\n if (undefined !== this._value)\n return this._value;\n\n this._value = this.stringGetter();\n return this._value;\n }\n\n /** Called to update the value by running the stringGetter */\n public refresh(): boolean {\n const newValue = this.stringGetter();\n if (newValue !== this._value) {\n this._value = newValue;\n return true;\n }\n return false;\n }\n\n /** helper function to process properties defined as type ConditionalStringValue | string | undefined\n * Return true if the value was updated.\n */\n public static refreshValue(conditionalValue: ConditionalStringValue | string | undefined, eventIds: Set<string>): boolean {\n if (undefined === conditionalValue || !(conditionalValue instanceof ConditionalStringValue))\n return false;\n\n if (conditionalValue.syncEventIds.some((value: string): boolean => eventIds.has(value.toLowerCase())))\n return conditionalValue.refresh();\n\n return false;\n }\n\n /** helper function to get string from a ConditionalStringValue | string | undefined */\n public static getValue(conditionalValue: ConditionalStringValue | string | undefined): string | undefined {\n if (undefined === conditionalValue)\n return undefined;\n\n if (conditionalValue instanceof ConditionalStringValue)\n return conditionalValue.value;\n\n return conditionalValue;\n }\n}\n"]}
@@ -13,6 +13,24 @@ import { PropertyValueFormat } from "./Value";
13
13
  * @public
14
14
  */
15
15
  export class PropertyRecord {
16
+ /** Value for the property */
17
+ value;
18
+ /** The property description containing metadata for the property */
19
+ property;
20
+ /** Description for the property */
21
+ description;
22
+ /** Indicates if the property is read-only */
23
+ isReadonly;
24
+ /** Indicates if the property is disabled */
25
+ isDisabled;
26
+ /** Indicates if the property record represents merged properties */
27
+ isMerged;
28
+ /** Indicates if the property should be automatically expanded */
29
+ autoExpand;
30
+ /** Map containing any additional data */
31
+ extendedData;
32
+ /** Properties for link logic */
33
+ links;
16
34
  /** Constructs a PropertyRecord instance */
17
35
  constructor(value, property) {
18
36
  this.value = value;
@@ -1 +1 @@
1
- {"version":3,"file":"Record.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Record.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAiB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAiB7D;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAsBzB,2CAA2C;IAC3C,YAAm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,WAAgC,CAAC;QACrC,IAAI,iBAAiB,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;YAC/D,WAAW,GAAG,iBAAiB,CAAC;QAClC,CAAC;aAAM,IAAI,iBAAiB,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;YACtE,WAAW,GAAG;gBACZ,IAAI,EAAE,iBAAiB;gBACvB,YAAY,EAAE,iBAAiB;gBAC/B,QAAQ,EAAE,iBAAiB,CAAC,MAAM;aACnC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,WAAW,GAAG;gBACZ,IAAI,EAAE,cAAc;gBACpB,YAAY,EAAE,cAAc;gBAC5B,QAAQ,EAAE,iBAAiB,CAAC,MAAM;aACnC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,cAAc,CAAC;YACxB,WAAW,EAAE,mBAAmB,CAAC,SAAS;YAC1C,KAAK;YACL,YAAY,EAAE,KAAK;SACpB,EAAE,WAAW,CAAC,CAAC;IAClB,CAAC;CACF;AAED,SAAS,oBAAoB,CAAmB,MAAS,EAAE,MAAS,EAAE,UAAmB;IACvF,IAAI,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;QACnC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport { PropertyDescription } from \"./Description\";\nimport { StandardTypeNames } from \"./StandardTypeNames\";\nimport { PropertyValue, PropertyValueFormat } from \"./Value\";\n\n/** Properties for the [[PropertyRecord]] with link info supplied\n * @public\n */\nexport interface LinkElementsInfo {\n /** Callback to link click event */\n onClick: (text: string) => void;\n /**\n * Function that specifies which parts of display value need to be clickable.\n *\n * Letters will be picked from __start__ index to __end__ index. __end__ index is not included.\n * For a string _\"example\"_ and a match ```{ start: 1, end: 3 }```, _\"xa\"_ will be clickable.\n */\n matcher?: (displayValue: string) => Array<{ start: number, end: number }>;\n}\n\n/**\n * PropertyRecord contains instance information about a Property, including a\n * value that can be edited using a PropertyEditor and converted using a TypeConverter.\n * @public\n */\nexport class PropertyRecord {\n /** Value for the property */\n public readonly value: PropertyValue;\n /** The property description containing metadata for the property */\n public readonly property: PropertyDescription;\n\n /** Description for the property */\n public description?: string;\n /** Indicates if the property is read-only */\n public isReadonly?: boolean;\n /** Indicates if the property is disabled */\n public isDisabled?: boolean;\n /** Indicates if the property record represents merged properties */\n public isMerged?: boolean;\n /** Indicates if the property should be automatically expanded */\n public autoExpand?: boolean;\n /** Map containing any additional data */\n public extendedData?: { [key: string]: any };\n\n /** Properties for link logic */\n public links?: LinkElementsInfo;\n\n /** Constructs a PropertyRecord instance */\n public constructor(value: PropertyValue, property: PropertyDescription) {\n this.value = value;\n this.property = property;\n }\n\n /** Creates a copy of this PropertyRecord with a new value and optionally a new PropertyDescription */\n public copyWithNewValue(newValue: PropertyValue, newDescription?: PropertyDescription): PropertyRecord {\n const rec = new PropertyRecord(newValue, newDescription ? newDescription : this.property);\n assignMemberIfExists(rec, this, \"description\");\n assignMemberIfExists(rec, this, \"isReadonly\");\n assignMemberIfExists(rec, this, \"isDisabled\");\n assignMemberIfExists(rec, this, \"isMerged\");\n assignMemberIfExists(rec, this, \"autoExpand\");\n assignMemberIfExists(rec, this, \"extendedData\");\n assignMemberIfExists(rec, this, \"links\");\n return rec;\n }\n\n /** Gets this property record value children records */\n public getChildrenRecords(): PropertyRecord[] {\n switch (this.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return [];\n case PropertyValueFormat.Struct:\n return Object.values(this.value.members);\n case PropertyValueFormat.Array:\n return this.value.items;\n }\n }\n\n /** Creates a PropertyRecord based on a value string and an optional property description or name */\n public static fromString(value: string, descriptionOrName?: PropertyDescription | string): PropertyRecord {\n let description: PropertyDescription;\n if (descriptionOrName && typeof descriptionOrName === \"object\") {\n description = descriptionOrName;\n } else if (descriptionOrName && typeof descriptionOrName === \"string\") {\n description = {\n name: descriptionOrName,\n displayLabel: descriptionOrName,\n typename: StandardTypeNames.String,\n };\n } else {\n description = {\n name: \"string_value\",\n displayLabel: \"String Value\",\n typename: StandardTypeNames.String,\n };\n }\n return new PropertyRecord({\n valueFormat: PropertyValueFormat.Primitive,\n value,\n displayValue: value,\n }, description);\n }\n}\n\nfunction assignMemberIfExists<T extends object>(target: T, source: T, memberName: keyof T) {\n if (source.hasOwnProperty(memberName))\n target[memberName] = source[memberName];\n}\n"]}
1
+ {"version":3,"file":"Record.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Record.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAiB,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAiB7D;;;;GAIG;AACH,MAAM,OAAO,cAAc;IACzB,6BAA6B;IACb,KAAK,CAAgB;IACrC,oEAAoE;IACpD,QAAQ,CAAsB;IAE9C,mCAAmC;IAC5B,WAAW,CAAU;IAC5B,6CAA6C;IACtC,UAAU,CAAW;IAC5B,4CAA4C;IACrC,UAAU,CAAW;IAC5B,oEAAoE;IAC7D,QAAQ,CAAW;IAC1B,iEAAiE;IAC1D,UAAU,CAAW;IAC5B,yCAAyC;IAClC,YAAY,CAA0B;IAE7C,gCAAgC;IACzB,KAAK,CAAoB;IAEhC,2CAA2C;IAC3C,YAAmB,KAAoB,EAAE,QAA6B;QACpE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,sGAAsG;IAC/F,gBAAgB,CAAC,QAAuB,EAAE,cAAoC;QACnF,MAAM,GAAG,GAAG,IAAI,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,C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AAE,iBAAiB;gBAC/B,QAAQ,EAAE,iBAAiB,CAAC,MAAM;aACnC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,WAAW,GAAG;gBACZ,IAAI,EAAE,cAAc;gBACpB,YAAY,EAAE,cAAc;gBAC5B,QAAQ,EAAE,iBAAiB,CAAC,MAAM;aACnC,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,cAAc,CAAC;YACxB,WAAW,EAAE,mBAAmB,CAAC,SAAS;YAC1C,KAAK;YACL,YAAY,EAAE,KAAK;SACpB,EAAE,WAAW,CAAC,CAAC;IAClB,CAAC;CACF;AAED,SAAS,oBAAoB,CAAmB,MAAS,EAAE,MAAS,EAAE,UAAmB;IACvF,IAAI,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;QACnC,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport { PropertyDescription } from \"./Description\";\nimport { StandardTypeNames } from \"./StandardTypeNames\";\nimport { PropertyValue, PropertyValueFormat } from \"./Value\";\n\n/** Properties for the [[PropertyRecord]] with link info supplied\n * @public\n */\nexport interface LinkElementsInfo {\n /** Callback to link click event */\n onClick: (text: string) => void;\n /**\n * Function that specifies which parts of display value need to be clickable.\n *\n * Letters will be picked from __start__ index to __end__ index. __end__ index is not included.\n * For a string _\"example\"_ and a match ```{ start: 1, end: 3 }```, _\"xa\"_ will be clickable.\n */\n matcher?: (displayValue: string) => Array<{ start: number, end: number }>;\n}\n\n/**\n * PropertyRecord contains instance information about a Property, including a\n * value that can be edited using a PropertyEditor and converted using a TypeConverter.\n * @public\n */\nexport class PropertyRecord {\n /** Value for the property */\n public readonly value: PropertyValue;\n /** The property description containing metadata for the property */\n public readonly property: PropertyDescription;\n\n /** Description for the property */\n public description?: string;\n /** Indicates if the property is read-only */\n public isReadonly?: boolean;\n /** Indicates if the property is disabled */\n public isDisabled?: boolean;\n /** Indicates if the property record represents merged properties */\n public isMerged?: boolean;\n /** Indicates if the property should be automatically expanded */\n public autoExpand?: boolean;\n /** Map containing any additional data */\n public extendedData?: { [key: string]: any };\n\n /** Properties for link logic */\n public links?: LinkElementsInfo;\n\n /** Constructs a PropertyRecord instance */\n public constructor(value: PropertyValue, property: PropertyDescription) {\n this.value = value;\n this.property = property;\n }\n\n /** Creates a copy of this PropertyRecord with a new value and optionally a new PropertyDescription */\n public copyWithNewValue(newValue: PropertyValue, newDescription?: PropertyDescription): PropertyRecord {\n const rec = new PropertyRecord(newValue, newDescription ? newDescription : this.property);\n assignMemberIfExists(rec, this, \"description\");\n assignMemberIfExists(rec, this, \"isReadonly\");\n assignMemberIfExists(rec, this, \"isDisabled\");\n assignMemberIfExists(rec, this, \"isMerged\");\n assignMemberIfExists(rec, this, \"autoExpand\");\n assignMemberIfExists(rec, this, \"extendedData\");\n assignMemberIfExists(rec, this, \"links\");\n return rec;\n }\n\n /** Gets this property record value children records */\n public getChildrenRecords(): PropertyRecord[] {\n switch (this.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return [];\n case PropertyValueFormat.Struct:\n return Object.values(this.value.members);\n case PropertyValueFormat.Array:\n return this.value.items;\n }\n }\n\n /** Creates a PropertyRecord based on a value string and an optional property description or name */\n public static fromString(value: string, descriptionOrName?: PropertyDescription | string): PropertyRecord {\n let description: PropertyDescription;\n if (descriptionOrName && typeof descriptionOrName === \"object\") {\n description = descriptionOrName;\n } else if (descriptionOrName && typeof descriptionOrName === \"string\") {\n description = {\n name: descriptionOrName,\n displayLabel: descriptionOrName,\n typename: StandardTypeNames.String,\n };\n } else {\n description = {\n name: \"string_value\",\n displayLabel: \"String Value\",\n typename: StandardTypeNames.String,\n };\n }\n return new PropertyRecord({\n valueFormat: PropertyValueFormat.Primitive,\n value,\n displayValue: value,\n }, description);\n }\n}\n\nfunction assignMemberIfExists<T extends object>(target: T, source: T, memberName: keyof T) {\n if (source.hasOwnProperty(memberName))\n target[memberName] = source[memberName];\n}\n"]}
@@ -13,13 +13,11 @@ import { StandardEditorNames } from "../properties/StandardEditorNames";
13
13
  * @beta
14
14
  */
15
15
  export class BaseQuantityDescription {
16
+ name;
17
+ displayLabel;
18
+ typename;
19
+ editor;
16
20
  constructor(name, displayLabel, iconSpec) {
17
- this.format = (numberValue) => {
18
- return this.formatValue(numberValue);
19
- };
20
- this.parse = (userInput) => {
21
- return this.parseString(userInput);
22
- };
23
21
  this.name = name;
24
22
  this.displayLabel = displayLabel;
25
23
  this.typename = StandardTypeNames.Number;
@@ -41,5 +39,11 @@ export class BaseQuantityDescription {
41
39
  this.editor.params.push(params);
42
40
  }
43
41
  }
42
+ format = (numberValue) => {
43
+ return this.formatValue(numberValue);
44
+ };
45
+ parse = (userInput) => {
46
+ return this.parseString(userInput);
47
+ };
44
48
  }
45
49
  //# sourceMappingURL=BaseQuantityDescription.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseQuantityDescription.js","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAA+D,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACnI,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;GAGG;AACH,MAAM,OAAgB,uBAAuB;IAM3C,YAAY,IAAY,EAAE,YAAoB,EAAE,QAAiB;QA0B1D,WAAM,GAAG,CAAC,WAAmB,EAAU,EAAE;YAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QACvC,CAAC,CAAC;QAGK,UAAK,GAAG,CAAC,SAAiB,EAAgB,EAAE;YACjD,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACrC,CAAC,CAAC;QAhCA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI,EAAE,mBAAmB,CAAC,YAAY;YACtC,MAAM,EAAE,CAAC;oBACP,IAAI,EAAE,wBAAwB,CAAC,qBAAqB;oBACpD,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,aAAa,EAAE,IAAI,CAAC,KAAK;iBACK;aAC/B;SACF,CAAC;QAEF,uBAAuB;QACvB,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,MAAM,GAAqB;gBAC/B,IAAI,EAAE,wBAAwB,CAAC,IAAI;gBACnC,UAAU,EAAE,EAAE,QAAQ,EAAE;aACzB,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,MAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;CAiBF","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 Properties\n */\n\nimport { PropertyDescription, PropertyEditorInfo } from \"../properties/Description\";\nimport { CustomFormattedNumberParams, IconEditorParams, ParseResults, PropertyEditorParamTypes } from \"../properties/EditorParams\";\nimport { StandardTypeNames } from \"../properties/StandardTypeNames\";\nimport { StandardEditorNames } from \"../properties/StandardEditorNames\";\n\n/**\n * Base Quantity Property Description\n * @beta\n */\nexport abstract class BaseQuantityDescription implements PropertyDescription {\n public name: string;\n public displayLabel: string;\n public typename: string;\n public editor: PropertyEditorInfo;\n\n constructor(name: string, displayLabel: string, iconSpec?: string) {\n this.name = name;\n this.displayLabel = displayLabel;\n this.typename = StandardTypeNames.Number;\n this.editor = {\n name: StandardEditorNames.NumberCustom,\n params: [{\n type: PropertyEditorParamTypes.CustomFormattedNumber,\n formatFunction: this.format,\n parseFunction: this.parse,\n } as CustomFormattedNumberParams,\n ],\n };\n\n // istanbul ignore else\n if (iconSpec) {\n const params: IconEditorParams = {\n type: PropertyEditorParamTypes.Icon,\n definition: { iconSpec },\n };\n this.editor.params!.push(params);\n }\n }\n\n protected abstract formatValue(numberValue: number): string;\n\n public format = (numberValue: number): string => {\n return this.formatValue(numberValue);\n };\n protected abstract parseString(userInput: string): ParseResults;\n\n public parse = (userInput: string): ParseResults => {\n return this.parseString(userInput);\n };\n\n public abstract get quantityType(): string;\n\n public abstract get parseError(): string;\n\n}\n"]}
1
+ {"version":3,"file":"BaseQuantityDescription.js","sourceRoot":"","sources":["../../../../src/appui-abstract/quantity/BaseQuantityDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAA+D,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACnI,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;GAGG;AACH,MAAM,OAAgB,uBAAuB;IACpC,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,QAAQ,CAAS;IACjB,MAAM,CAAqB;IAElC,YAAY,IAAY,EAAE,YAAoB,EAAE,QAAiB;QAC/D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI,EAAE,mBAAmB,CAAC,YAAY;YACtC,MAAM,EAAE,CAAC;oBACP,IAAI,EAAE,wBAAwB,CAAC,qBAAqB;oBACpD,cAAc,EAAE,IAAI,CAAC,MAAM;oBAC3B,aAAa,EAAE,IAAI,CAAC,KAAK;iBACK;aAC/B;SACF,CAAC;QAEF,uBAAuB;QACvB,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,MAAM,GAAqB;gBAC/B,IAAI,EAAE,wBAAwB,CAAC,IAAI;gBACnC,UAAU,EAAE,EAAE,QAAQ,EAAE;aACzB,CAAC;YACF,IAAI,CAAC,MAAM,CAAC,MAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAIM,MAAM,GAAG,CAAC,WAAmB,EAAU,EAAE;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC,CAAC;IAGK,KAAK,GAAG,CAAC,SAAiB,EAAgB,EAAE;QACjD,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC,CAAC;CAMH","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 Properties\n */\n\nimport { PropertyDescription, PropertyEditorInfo } from \"../properties/Description\";\nimport { CustomFormattedNumberParams, IconEditorParams, ParseResults, PropertyEditorParamTypes } from \"../properties/EditorParams\";\nimport { StandardTypeNames } from \"../properties/StandardTypeNames\";\nimport { StandardEditorNames } from \"../properties/StandardEditorNames\";\n\n/**\n * Base Quantity Property Description\n * @beta\n */\nexport abstract class BaseQuantityDescription implements PropertyDescription {\n public name: string;\n public displayLabel: string;\n public typename: string;\n public editor: PropertyEditorInfo;\n\n constructor(name: string, displayLabel: string, iconSpec?: string) {\n this.name = name;\n this.displayLabel = displayLabel;\n this.typename = StandardTypeNames.Number;\n this.editor = {\n name: StandardEditorNames.NumberCustom,\n params: [{\n type: PropertyEditorParamTypes.CustomFormattedNumber,\n formatFunction: this.format,\n parseFunction: this.parse,\n } as CustomFormattedNumberParams,\n ],\n };\n\n // istanbul ignore else\n if (iconSpec) {\n const params: IconEditorParams = {\n type: PropertyEditorParamTypes.Icon,\n definition: { iconSpec },\n };\n this.editor.params!.push(params);\n }\n }\n\n protected abstract formatValue(numberValue: number): string;\n\n public format = (numberValue: number): string => {\n return this.formatValue(numberValue);\n };\n protected abstract parseString(userInput: string): ParseResults;\n\n public parse = (userInput: string): ParseResults => {\n return this.parseString(userInput);\n };\n\n public abstract get quantityType(): string;\n\n public abstract get parseError(): string;\n\n}\n"]}
@@ -4,33 +4,14 @@
4
4
  import { BadgeType } from "../items/BadgeType";
5
5
  import { ConditionalBooleanValue } from "../items/ConditionalBooleanValue";
6
6
  import { ConditionalStringValue } from "../items/ConditionalStringValue";
7
- import { ProvidedItem } from "../items/ProvidedItem";
8
- /** Used to specify the usage of the toolbar which determine the toolbar position.
9
- * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.
10
- * @public
11
- */
12
- export declare enum ToolbarUsage {
13
- /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */
14
- ContentManipulation = 0,
15
- /** Manipulate view/camera - in ninezone this is in top right of content area. */
16
- ViewNavigation = 1
17
- }
18
- /** Used to specify the orientation of the toolbar.
19
- * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.
20
- * @public
21
- */
22
- export declare enum ToolbarOrientation {
23
- /** Horizontal toolbar. */
24
- Horizontal = 0,
25
- /** Vertical toolbar. */
26
- Vertical = 1
27
- }
28
7
  /** Describes the data needed to insert a UI items into an existing set of UI items.
29
8
  * @public
30
9
  */
31
- export interface ToolbarItem extends ProvidedItem {
10
+ export interface ToolbarItem {
32
11
  /** can be used by application to store miscellaneous data. */
33
12
  readonly applicationData?: any;
13
+ /** id of UiItemsProvider */
14
+ readonly providerId?: string;
34
15
  /** Describes badge. Renders no badge if not specified. */
35
16
  readonly badgeType?: BadgeType;
36
17
  /** Optional description */
@@ -99,11 +80,6 @@ export interface CustomButtonDefinition extends ToolbarItem {
99
80
  * @public
100
81
  */
101
82
  export type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;
102
- /** Type for Toolbar Item Id
103
- * @deprecated in 3.6. Please use `ToolbarItem["id"]` from @itwin/appui-react.
104
- * @public
105
- */
106
- export type ToolbarItemId = CommonToolbarItem["id"];
107
83
  /** Helper class to create Abstract StatusBar Item definitions.
108
84
  * @public
109
85
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItem.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;GAGG;AACH,oBAAY,YAAY;IACtB,4GAA4G;IAC5G,mBAAmB,IAAI;IACvB,iFAAiF;IACjF,cAAc,IAAI;CACnB;AAED;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,0BAA0B;IAC1B,UAAU,IAAI;IACd,wBAAwB;IACxB,QAAQ,IAAI;CACb;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,8DAA8D;IAC9D,QAAQ,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,2BAA2B;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAAC;IACvD,iIAAiI;IACjI,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,QAAQ,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CA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AChB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,WAAW;IAIzE,yCAAyC;WAC3B,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,sBAAsB;CAG1F"}
@@ -5,32 +5,24 @@
5
5
  /** @packageDocumentation
6
6
  * @module Toolbar
7
7
  */
8
- /** Used to specify the usage of the toolbar which determine the toolbar position.
9
- * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.
10
- * @public
11
- */
12
- export var ToolbarUsage;
13
- (function (ToolbarUsage) {
14
- /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */
15
- ToolbarUsage[ToolbarUsage["ContentManipulation"] = 0] = "ContentManipulation";
16
- /** Manipulate view/camera - in ninezone this is in top right of content area. */
17
- ToolbarUsage[ToolbarUsage["ViewNavigation"] = 1] = "ViewNavigation";
18
- })(ToolbarUsage || (ToolbarUsage = {}));
19
- /** Used to specify the orientation of the toolbar.
20
- * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.
21
- * @public
22
- */
23
- export var ToolbarOrientation;
24
- (function (ToolbarOrientation) {
25
- /** Horizontal toolbar. */
26
- ToolbarOrientation[ToolbarOrientation["Horizontal"] = 0] = "Horizontal";
27
- /** Vertical toolbar. */
28
- ToolbarOrientation[ToolbarOrientation["Vertical"] = 1] = "Vertical";
29
- })(ToolbarOrientation || (ToolbarOrientation = {}));
30
8
  /** Helper class to create Abstract StatusBar Item definitions.
31
9
  * @public
32
10
  */
33
11
  export class ToolbarItemUtilities {
12
+ /** Creates an Action Button */
13
+ static createActionButton = (id, itemPriority, icon, label, execute, overrides) => ({
14
+ id, itemPriority,
15
+ icon, label,
16
+ execute,
17
+ ...overrides,
18
+ });
19
+ /** Creates a Group button. */
20
+ static createGroupButton = (id, itemPriority, icon, label, items, overrides) => ({
21
+ id, itemPriority,
22
+ icon, label,
23
+ items,
24
+ ...overrides,
25
+ });
34
26
  /** ActionButton type guard. */
35
27
  static isActionButton(item) {
36
28
  return item.execute !== undefined;
@@ -44,18 +36,4 @@ export class ToolbarItemUtilities {
44
36
  return !!item.isCustom;
45
37
  }
46
38
  }
47
- /** Creates an Action Button */
48
- ToolbarItemUtilities.createActionButton = (id, itemPriority, icon, label, execute, overrides) => ({
49
- id, itemPriority,
50
- icon, label,
51
- execute,
52
- ...overrides,
53
- });
54
- /** Creates a Group button. */
55
- ToolbarItemUtilities.createGroupButton = (id, itemPriority, icon, label, items, overrides) => ({
56
- id, itemPriority,
57
- icon, label,
58
- items,
59
- ...overrides,
60
- });
61
39
  //# sourceMappingURL=ToolbarItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItem.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH;;;GAGG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,4GAA4G;IAC5G,6EAAuB,CAAA;IACvB,iFAAiF;IACjF,mEAAkB,CAAA;AACpB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,0BAA0B;IAC1B,uEAAc,CAAA;IACd,wBAAwB;IACxB,mEAAY,CAAA;AACd,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAuFD;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAiB/B,+BAA+B;IACxB,MAAM,CAAC,cAAc,CAAC,IAAuB;QAClD,OAAQ,IAAqB,CAAC,OAAO,KAAK,SAAS,CAAC;IACtD,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,aAAa,CAAC,IAAuB;QACjD,OAAQ,IAAoB,CAAC,KAAK,KAAK,SAAS,CAAC;IACnD,CAAC;IAED,yCAAyC;IAClC,MAAM,CAAC,kBAAkB,CAAC,IAAuB;QACtD,OAAO,CAAC,CAAE,IAA+B,CAAC,QAAQ,CAAC;IACrD,CAAC;;AA7BD,+BAA+B;AACjB,uCAAkB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,OAAmB,EAAE,SAAiC,EAAgB,EAAE,CAAC,CAAC;IAC7N,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,KAAK;IACX,OAAO;IACP,GAAG,SAAS;CACb,CAAC,CAAC;AAEH,8BAA8B;AAChB,sCAAiB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,KAAgD,EAAE,SAAgC,EAAe,EAAE,CAAC,CAAC;IACvP,EAAE,EAAE,YAAY;IAChB,IAAI,EAAE,KAAK;IACX,KAAK;IACL,GAAG,SAAS;CACb,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport { BadgeType } from \"../items/BadgeType\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { ProvidedItem } from \"../items/ProvidedItem\";\n\n/** Used to specify the usage of the toolbar which determine the toolbar position.\n * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.\n * @public\n */\nexport enum ToolbarUsage {\n /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */\n ContentManipulation = 0,\n /** Manipulate view/camera - in ninezone this is in top right of content area. */\n ViewNavigation = 1,\n}\n\n/** Used to specify the orientation of the toolbar.\n * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.\n * @public\n */\nexport enum ToolbarOrientation {\n /** Horizontal toolbar. */\n Horizontal = 0,\n /** Vertical toolbar. */\n Vertical = 1,\n}\n\n/** Describes the data needed to insert a UI items into an existing set of UI items.\n * @public\n */\nexport interface ToolbarItem extends ProvidedItem { // eslint-disable-line @typescript-eslint/no-deprecated\n /** can be used by application to store miscellaneous data. */\n readonly applicationData?: any;\n /** Describes badge. Renders no badge if not specified. */\n readonly badgeType?: BadgeType;\n /** Optional description */\n readonly description?: string | ConditionalStringValue;\n /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** optional data to used by item implementor. */\n readonly internalData?: Map<string, any>;\n /** Defines if the item is active (shown with an active stripe/bar). */\n readonly isActive?: boolean;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Describes if the item should appear pressed (used for displaying toggle state). This property is NOT used by Toolbars\n * constructed using the `ToolbarWithOverflow` component, which are used in AppUi 2.0 and later. For these later toolbars\n * the icon is usually changed to denote the state of a toggle.\n */\n readonly isPressed?: boolean;\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\n * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.\n */\n readonly groupPriority?: number;\n /** Priority within a toolbar or group. */\n readonly itemPriority: number;\n /** Optional parent tool group to add tool. */\n readonly parentToolGroupId?: string;\n}\n\n/** Describes the data needed to insert an action button into a toolbar.\n * @public\n */\nexport interface ActionButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on a button or an item label in a group. */\n readonly label: string | ConditionalStringValue;\n /** function to run when the button is pressed. */\n readonly execute: () => void;\n}\n\n/** Describes the data needed to insert a group button into a toolbar.\n * @public\n */\nexport interface GroupButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label: string | ConditionalStringValue;\n /** label shown as the title in at top of group panel. */\n readonly panelLabel?: string | ConditionalStringValue;\n /** children of the group */\n readonly items: ReadonlyArray<ActionButton | GroupButton>;\n}\n\n/** Describes the data needed to insert a custom button into a toolbar.\n * @public\n */\nexport interface CustomButtonDefinition extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label?: string | ConditionalStringValue;\n /** parameter that marks data as being a custom definition. */\n readonly isCustom: true;\n}\n\n/** Any Button Type that can be inserted into a toolbar.\n * @public\n */\nexport type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;\n\n/** Type for Toolbar Item Id\n * @deprecated in 3.6. Please use `ToolbarItem[\"id\"]` from @itwin/appui-react.\n * @public\n */\nexport type ToolbarItemId = CommonToolbarItem[\"id\"];\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @public\n */\nexport class ToolbarItemUtilities {\n /** Creates an Action Button */\n public static createActionButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton>): ActionButton => ({\n id, itemPriority,\n icon, label,\n execute,\n ...overrides,\n });\n\n /** Creates a Group button. */\n public static createGroupButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton>): GroupButton => ({\n id, itemPriority,\n icon, label,\n items,\n ...overrides,\n });\n\n /** ActionButton type guard. */\n public static isActionButton(item: CommonToolbarItem): item is ActionButton {\n return (item as ActionButton).execute !== undefined;\n }\n\n /** GroupButton type guard. */\n public static isGroupButton(item: CommonToolbarItem): item is GroupButton {\n return (item as GroupButton).items !== undefined;\n }\n\n /** CustomButtonDefinition type guard. */\n public static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition {\n return !!(item as CustomButtonDefinition).isCustom;\n }\n}\n"]}
1
+ {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItem.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAuFH;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAC/B,+BAA+B;IACxB,MAAM,CAAC,kBAAkB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,OAAmB,EAAE,SAAiC,EAAgB,EAAE,CAAC,CAAC;QAC7N,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,KAAK;QACX,OAAO;QACP,GAAG,SAAS;KACb,CAAC,CAAC;IAEH,8BAA8B;IACvB,MAAM,CAAC,iBAAiB,GAAG,CAAC,EAAU,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,KAAgD,EAAE,SAAgC,EAAe,EAAE,CAAC,CAAC;QACvP,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,KAAK;QACX,KAAK;QACL,GAAG,SAAS;KACb,CAAC,CAAC;IAEH,+BAA+B;IACxB,MAAM,CAAC,cAAc,CAAC,IAAuB;QAClD,OAAQ,IAAqB,CAAC,OAAO,KAAK,SAAS,CAAC;IACtD,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,aAAa,CAAC,IAAuB;QACjD,OAAQ,IAAoB,CAAC,KAAK,KAAK,SAAS,CAAC;IACnD,CAAC;IAED,yCAAyC;IAClC,MAAM,CAAC,kBAAkB,CAAC,IAAuB;QACtD,OAAO,CAAC,CAAE,IAA+B,CAAC,QAAQ,CAAC;IACrD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport { BadgeType } from \"../items/BadgeType\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\n\n/** Describes the data needed to insert a UI items into an existing set of UI items.\n * @public\n */\nexport interface ToolbarItem {\n /** can be used by application to store miscellaneous data. */\n readonly applicationData?: any;\n /** id of UiItemsProvider */\n readonly providerId?: string;\n /** Describes badge. Renders no badge if not specified. */\n readonly badgeType?: BadgeType;\n /** Optional description */\n readonly description?: string | ConditionalStringValue;\n /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** optional data to used by item implementor. */\n readonly internalData?: Map<string, any>;\n /** Defines if the item is active (shown with an active stripe/bar). */\n readonly isActive?: boolean;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Describes if the item should appear pressed (used for displaying toggle state). This property is NOT used by Toolbars\n * constructed using the `ToolbarWithOverflow` component, which are used in AppUi 2.0 and later. For these later toolbars\n * the icon is usually changed to denote the state of a toggle.\n */\n readonly isPressed?: boolean;\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\n * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.\n */\n readonly groupPriority?: number;\n /** Priority within a toolbar or group. */\n readonly itemPriority: number;\n /** Optional parent tool group to add tool. */\n readonly parentToolGroupId?: string;\n}\n\n/** Describes the data needed to insert an action button into a toolbar.\n * @public\n */\nexport interface ActionButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on a button or an item label in a group. */\n readonly label: string | ConditionalStringValue;\n /** function to run when the button is pressed. */\n readonly execute: () => void;\n}\n\n/** Describes the data needed to insert a group button into a toolbar.\n * @public\n */\nexport interface GroupButton extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label: string | ConditionalStringValue;\n /** label shown as the title in at top of group panel. */\n readonly panelLabel?: string | ConditionalStringValue;\n /** children of the group */\n readonly items: ReadonlyArray<ActionButton | GroupButton>;\n}\n\n/** Describes the data needed to insert a custom button into a toolbar.\n * @public\n */\nexport interface CustomButtonDefinition extends ToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label?: string | ConditionalStringValue;\n /** parameter that marks data as being a custom definition. */\n readonly isCustom: true;\n}\n\n/** Any Button Type that can be inserted into a toolbar.\n * @public\n */\nexport type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @public\n */\nexport class ToolbarItemUtilities {\n /** Creates an Action Button */\n public static createActionButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton>): ActionButton => ({\n id, itemPriority,\n icon, label,\n execute,\n ...overrides,\n });\n\n /** Creates a Group button. */\n public static createGroupButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton>): GroupButton => ({\n id, itemPriority,\n icon, label,\n items,\n ...overrides,\n });\n\n /** ActionButton type guard. */\n public static isActionButton(item: CommonToolbarItem): item is ActionButton {\n return (item as ActionButton).execute !== undefined;\n }\n\n /** GroupButton type guard. */\n public static isGroupButton(item: CommonToolbarItem): item is GroupButton {\n return (item as GroupButton).items !== undefined;\n }\n\n /** CustomButtonDefinition type guard. */\n public static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition {\n return !!(item as CustomButtonDefinition).isCustom;\n }\n}"]}
@@ -8,20 +8,10 @@ export declare class IconSpecUtilities {
8
8
  /** Prefix for an SVG IconSpec loaded with the Sprite loader */
9
9
  static readonly SVG_PREFIX = "svg:";
10
10
  static readonly WEB_COMPONENT_PREFIX = "webSvg:";
11
- /** Create an IconSpec for an SVG loaded into web component with sprite loader
12
- * This method is deprecated -- use createWebComponentIconSpec()
13
- * @public @deprecated in 3.2. Please avoid using the Sprite loader and use IconSpecUtilities.createWebComponentIconSpec() instead.
14
- */
15
- static createSvgIconSpec(svgSrc: string): string;
16
11
  /** Create an IconSpec for an SVG loaded into web component with svg-loader
17
12
  * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.
18
13
  */
19
14
  static createWebComponentIconSpec(srcString: string): string;
20
- /** Get the SVG Source from an sprite IconSpec
21
- * This method is deprecated -- use getWebComponentSource()
22
- * @public @deprecated in 3.2. avoid using the Sprite loader and use IconSpecUtilities.getWebComponentSource() instead.
23
- */
24
- static getSvgSource(iconSpec: string): string | undefined;
25
15
  /** Get the SVG Source from an svg-loader IconSpec
26
16
  * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.
27
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"IconSpecUtilities.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,+DAA+D;IAC/D,gBAAuB,UAAU,UAAU;IAC3C,gBAAuB,oBAAoB,aAAa;IAExD;;;MAGE;WACY,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAGvD;;MAEE;WACY,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAInE;;;MAGE;WACY,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAOhE;;MAEE;WAEY,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAQ1E"}
1
+ {"version":3,"file":"IconSpecUtilities.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,+DAA+D;IAC/D,gBAAuB,UAAU,UAAU;IAC3C,gBAAuB,oBAAoB,aAAa;IAExD;;MAEE;WACY,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAInE;;MAEE;WAEY,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAQ1E"}
@@ -10,29 +10,15 @@
10
10
  * @public @deprecated in 4.3. AppUI libraries >= 4.7.x support loading SVGs sources without prefixes, eliminating the need for these utilities.
11
11
  */
12
12
  export class IconSpecUtilities {
13
- /** Create an IconSpec for an SVG loaded into web component with sprite loader
14
- * This method is deprecated -- use createWebComponentIconSpec()
15
- * @public @deprecated in 3.2. Please avoid using the Sprite loader and use IconSpecUtilities.createWebComponentIconSpec() instead.
16
- */
17
- static createSvgIconSpec(svgSrc) {
18
- return `${IconSpecUtilities.SVG_PREFIX}${svgSrc}`;
19
- }
13
+ /** Prefix for an SVG IconSpec loaded with the Sprite loader */
14
+ static SVG_PREFIX = "svg:";
15
+ static WEB_COMPONENT_PREFIX = "webSvg:";
20
16
  /** Create an IconSpec for an SVG loaded into web component with svg-loader
21
17
  * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.
22
18
  */
23
19
  static createWebComponentIconSpec(srcString) {
24
20
  return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;
25
21
  }
26
- /** Get the SVG Source from an sprite IconSpec
27
- * This method is deprecated -- use getWebComponentSource()
28
- * @public @deprecated in 3.2. avoid using the Sprite loader and use IconSpecUtilities.getWebComponentSource() instead.
29
- */
30
- static getSvgSource(iconSpec) {
31
- if (iconSpec.startsWith(IconSpecUtilities.SVG_PREFIX) && iconSpec.length > 4) {
32
- return iconSpec.slice(4);
33
- }
34
- return undefined;
35
- }
36
22
  /** Get the SVG Source from an svg-loader IconSpec
37
23
  * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.
38
24
  */
@@ -43,7 +29,4 @@ export class IconSpecUtilities {
43
29
  return undefined;
44
30
  }
45
31
  }
46
- /** Prefix for an SVG IconSpec loaded with the Sprite loader */
47
- IconSpecUtilities.SVG_PREFIX = "svg:";
48
- IconSpecUtilities.WEB_COMPONENT_PREFIX = "webSvg:";
49
32
  //# sourceMappingURL=IconSpecUtilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconSpecUtilities.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qDAAqD;AAErD;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAK5B;;;MAGE;IACK,MAAM,CAAC,iBAAiB,CAAC,MAAc;QAC5C,OAAO,GAAG,iBAAiB,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC;IACpD,CAAC;IACD;;MAEE;IACK,MAAM,CAAC,0BAA0B,CAAC,SAAiB;QACxD,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACjE,CAAC;IAED;;;MAGE;IACK,MAAM,CAAC,YAAY,CAAC,QAAgB;QACzC,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7E,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;MAEE;IAEK,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IAEnB,CAAC;;AAxCD,+DAA+D;AACxC,4BAAU,GAAG,MAAM,CAAC;AACpB,sCAAoB,GAAG,SAAS,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Creates an IconSpec with an SVG source and gets the SVG source from an IconSpec.\n * @public @deprecated in 4.3. AppUI libraries >= 4.7.x support loading SVGs sources without prefixes, eliminating the need for these utilities.\n */\nexport class IconSpecUtilities {\n /** Prefix for an SVG IconSpec loaded with the Sprite loader */\n public static readonly SVG_PREFIX = \"svg:\";\n public static readonly WEB_COMPONENT_PREFIX = \"webSvg:\";\n\n /** Create an IconSpec for an SVG loaded into web component with sprite loader\n * This method is deprecated -- use createWebComponentIconSpec()\n * @public @deprecated in 3.2. Please avoid using the Sprite loader and use IconSpecUtilities.createWebComponentIconSpec() instead.\n */\n public static createSvgIconSpec(svgSrc: string): string {\n return `${IconSpecUtilities.SVG_PREFIX}${svgSrc}`;\n }\n /** Create an IconSpec for an SVG loaded into web component with svg-loader\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n public static createWebComponentIconSpec(srcString: string): string {\n return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;\n }\n\n /** Get the SVG Source from an sprite IconSpec\n * This method is deprecated -- use getWebComponentSource()\n * @public @deprecated in 3.2. avoid using the Sprite loader and use IconSpecUtilities.getWebComponentSource() instead.\n */\n public static getSvgSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(IconSpecUtilities.SVG_PREFIX) && iconSpec.length > 4) {\n return iconSpec.slice(4);\n }\n\n return undefined;\n }\n /** Get the SVG Source from an svg-loader IconSpec\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n\n public static getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(IconSpecUtilities.WEB_COMPONENT_PREFIX) && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n\n }\n}\n"]}
1
+ {"version":3,"file":"IconSpecUtilities.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/IconSpecUtilities.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,qDAAqD;AAErD;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAC5B,+DAA+D;IACxD,MAAM,CAAU,UAAU,GAAG,MAAM,CAAC;IACpC,MAAM,CAAU,oBAAoB,GAAG,SAAS,CAAC;IAExD;;MAEE;IACK,MAAM,CAAC,0BAA0B,CAAC,SAAiB;QACxD,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACjE,CAAC;IAED;;MAEE;IAEK,MAAM,CAAC,qBAAqB,CAAC,QAAgB;QAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,SAAS,CAAC;IAEnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Creates an IconSpec with an SVG source and gets the SVG source from an IconSpec.\n * @public @deprecated in 4.3. AppUI libraries >= 4.7.x support loading SVGs sources without prefixes, eliminating the need for these utilities.\n */\nexport class IconSpecUtilities {\n /** Prefix for an SVG IconSpec loaded with the Sprite loader */\n public static readonly SVG_PREFIX = \"svg:\";\n public static readonly WEB_COMPONENT_PREFIX = \"webSvg:\";\n\n /** Create an IconSpec for an SVG loaded into web component with svg-loader\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n public static createWebComponentIconSpec(srcString: string): string {\n return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;\n }\n\n /** Get the SVG Source from an svg-loader IconSpec\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\n */\n\n public static getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(IconSpecUtilities.WEB_COMPONENT_PREFIX) && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n\n }\n}"]}
@@ -10,6 +10,7 @@ import { BentleyError, BentleyStatus } from "@itwin/core-bentley";
10
10
  * @public @deprecated in 4.3. Use [[Bentley.BentleyError]] instead.
11
11
  */
12
12
  export class UiError extends BentleyError {
13
+ category;
13
14
  /** Constructs UiError using BentleyError. */
14
15
  constructor(category, message, errorNumber = BentleyStatus.ERROR, getMetaData) {
15
16
  super(errorNumber, message, getMetaData);