@itwin/appui-abstract 4.4.0 → 4.5.0-dev.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -1
  3. package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
  4. package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
  5. package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -1
  6. package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +1 -1
  7. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
  8. package/lib/cjs/appui-abstract/common/KeyboardKey.js.map +1 -1
  9. package/lib/cjs/appui-abstract/content/ContentLayoutProps.js.map +1 -1
  10. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  11. package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
  12. package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
  13. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  14. package/lib/cjs/appui-abstract/items/AbstractItemProps.js.map +1 -1
  15. package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
  16. package/lib/cjs/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
  17. package/lib/cjs/appui-abstract/items/BadgeType.js.map +1 -1
  18. package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
  19. package/lib/cjs/appui-abstract/items/ConditionalStringValue.js.map +1 -1
  20. package/lib/cjs/appui-abstract/items/ProvidedItem.js.map +1 -1
  21. package/lib/cjs/appui-abstract/items/RelativePosition.js.map +1 -1
  22. package/lib/cjs/appui-abstract/items/StageUsage.js.map +1 -1
  23. package/lib/cjs/appui-abstract/notification/MessagePresenter.js.map +1 -1
  24. package/lib/cjs/appui-abstract/notification/MessageSeverity.js.map +1 -1
  25. package/lib/cjs/appui-abstract/properties/Description.js.map +1 -1
  26. package/lib/cjs/appui-abstract/properties/EditorParams.js.map +1 -1
  27. package/lib/cjs/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
  28. package/lib/cjs/appui-abstract/properties/Record.js.map +1 -1
  29. package/lib/cjs/appui-abstract/properties/StandardEditorNames.js.map +1 -1
  30. package/lib/cjs/appui-abstract/properties/StandardTypeNames.js.map +1 -1
  31. package/lib/cjs/appui-abstract/properties/Value.js.map +1 -1
  32. package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
  33. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  34. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
  35. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  36. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
  37. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  38. package/lib/cjs/appui-abstract/utils/PointProps.js.map +1 -1
  39. package/lib/cjs/appui-abstract/utils/UiError.js.map +1 -1
  40. package/lib/cjs/appui-abstract/utils/UiEvent.js.map +1 -1
  41. package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
  42. package/lib/cjs/appui-abstract/utils/callbacks.js.map +1 -1
  43. package/lib/cjs/appui-abstract/utils/filter/filters.js.map +1 -1
  44. package/lib/cjs/appui-abstract/utils/misc.js.map +1 -1
  45. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
  46. package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -1
  47. package/lib/cjs/appui-abstract/widget/WidgetState.js.map +1 -1
  48. package/lib/cjs/appui-abstract.js.map +1 -1
  49. package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -1
  50. package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
  51. package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
  52. package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -1
  53. package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +1 -1
  54. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
  55. package/lib/esm/appui-abstract/common/KeyboardKey.js.map +1 -1
  56. package/lib/esm/appui-abstract/content/ContentLayoutProps.js.map +1 -1
  57. package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  58. package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
  59. package/lib/esm/appui-abstract/dialogs/UiDataProvider.js.map +1 -1
  60. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  61. package/lib/esm/appui-abstract/items/AbstractItemProps.js.map +1 -1
  62. package/lib/esm/appui-abstract/items/AbstractMenuItemProps.js.map +1 -1
  63. package/lib/esm/appui-abstract/items/AbstractToolbarProps.js.map +1 -1
  64. package/lib/esm/appui-abstract/items/BadgeType.js.map +1 -1
  65. package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js.map +1 -1
  66. package/lib/esm/appui-abstract/items/ConditionalStringValue.js.map +1 -1
  67. package/lib/esm/appui-abstract/items/ProvidedItem.js.map +1 -1
  68. package/lib/esm/appui-abstract/items/RelativePosition.js.map +1 -1
  69. package/lib/esm/appui-abstract/items/StageUsage.js.map +1 -1
  70. package/lib/esm/appui-abstract/notification/MessagePresenter.js.map +1 -1
  71. package/lib/esm/appui-abstract/notification/MessageSeverity.js.map +1 -1
  72. package/lib/esm/appui-abstract/properties/Description.js.map +1 -1
  73. package/lib/esm/appui-abstract/properties/EditorParams.js.map +1 -1
  74. package/lib/esm/appui-abstract/properties/PrimitiveTypes.js.map +1 -1
  75. package/lib/esm/appui-abstract/properties/Record.js.map +1 -1
  76. package/lib/esm/appui-abstract/properties/StandardEditorNames.js.map +1 -1
  77. package/lib/esm/appui-abstract/properties/StandardTypeNames.js.map +1 -1
  78. package/lib/esm/appui-abstract/properties/Value.js.map +1 -1
  79. package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js.map +1 -1
  80. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  81. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
  82. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  83. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
  84. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  85. package/lib/esm/appui-abstract/utils/PointProps.js.map +1 -1
  86. package/lib/esm/appui-abstract/utils/UiError.js.map +1 -1
  87. package/lib/esm/appui-abstract/utils/UiEvent.js.map +1 -1
  88. package/lib/esm/appui-abstract/utils/UiEventDispatcher.js.map +1 -1
  89. package/lib/esm/appui-abstract/utils/callbacks.js.map +1 -1
  90. package/lib/esm/appui-abstract/utils/filter/filters.js.map +1 -1
  91. package/lib/esm/appui-abstract/utils/misc.js.map +1 -1
  92. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
  93. package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -1
  94. package/lib/esm/appui-abstract/widget/WidgetState.js.map +1 -1
  95. package/lib/esm/appui-abstract.js.map +1 -1
  96. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"MessageSeverity.js","sourceRoot":"","sources":["../../../../src/appui-abstract/notification/MessageSeverity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;IAEI;AACJ,MAAM,CAAN,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,mEAAe,CAAA;IACf,6DAAY,CAAA;IACZ,2DAAW,CAAA;IACX,uDAAS,CAAA;IACT,uDAAS,CAAA;IACT,2DAAW,CAAA;AACb,CAAC,EARW,eAAe,KAAf,eAAe,QAQ1B","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 Notification\n */\n\n/** Message Severity enum for display messages.\n * @public\n */\nexport enum MessageSeverity {\n None = 0,\n Information = 1,\n Question = 2,\n Warning = 3,\n Error = 4,\n Fatal = 5,\n Success = 6,\n}\n"]}
1
+ {"version":3,"file":"MessageSeverity.js","sourceRoot":"","sources":["../../../../src/appui-abstract/notification/MessageSeverity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;IAEI;AACJ,MAAM,CAAN,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,qDAAQ,CAAA;IACR,mEAAe,CAAA;IACf,6DAAY,CAAA;IACZ,2DAAW,CAAA;IACX,uDAAS,CAAA;IACT,uDAAS,CAAA;IACT,2DAAW,CAAA;AACb,CAAC,EARW,eAAe,KAAf,eAAe,QAQ1B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Notification\r\n */\r\n\r\n/** Message Severity enum for display messages.\r\n * @public\r\n */\r\nexport enum MessageSeverity {\r\n None = 0,\r\n Information = 1,\r\n Question = 2,\r\n Warning = 3,\r\n Error = 4,\r\n Fatal = 5,\r\n Success = 6,\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACmF,wBAAwB,GAEjH,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAmFxD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE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,CAAC,CAAC;QACxE,IAAI,WAAW,GAAG,CAAC;YACjB,OAAO,KAAK,CAAC;QAEf,WAAW,EAAE,CAAC;QACd,IAAI,WAAW,IAAI,OAAO,CAAC,MAAM;YAC/B,WAAW,GAAG,CAAC,CAAC;QAElB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,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 Properties\n */\n\nimport {\n BasePropertyEditorParams, ColorEditorParams, ImageCheckBoxParams, PropertyEditorParams, PropertyEditorParamTypes, RangeEditorParams,\n SuppressLabelEditorParams,\n} from \"./EditorParams\";\nimport { StandardEditorNames } from \"./StandardEditorNames\";\nimport { StandardTypeNames } from \"./StandardTypeNames\";\n\n// cSpell:ignore Picklist\n\n/**\n * Information about an enumeration choice\n * @public\n */\nexport interface EnumerationChoice {\n label: string;\n value: string | number;\n}\n\n/**\n * Information about a set of enumeration choices\n * @public\n */\nexport interface EnumerationChoicesInfo {\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[];\n isStrict?: boolean;\n maxDisplayedRows?: number;\n}\n\n/**\n * Property renderer identification and customization attributes\n * @public\n */\nexport interface PropertyRendererInfo {\n name: string;\n}\n\n/**\n * Information about a Property Editor\n * @public\n */\nexport interface PropertyEditorInfo {\n /** Editor name used in addition to the typename to find the registered property editor */\n name?: string;\n /** Editor params provided to the property editor */\n params?: PropertyEditorParams[];\n}\n\n/**\n * Information about a Property Converter\n * @public\n */\nexport interface PropertyConverterInfo {\n /** Converter name used in addition to the typename to find the registered property converter */\n name?: string;\n /** map of options for type converter */\n options?: { [key: string]: any };\n}\n\n/**\n * [[PropertyDescription]] contains metadata about a Property\n * @public\n */\nexport interface PropertyDescription {\n /** Name of the property description */\n name: string;\n /** Display label for the property description */\n displayLabel: string;\n /** Type name used to determine applicable Type Converter and Property Editor */\n typename: string;\n /** Additional information for enumerations */\n enum?: EnumerationChoicesInfo;\n /** Information for property renderer customization */\n renderer?: PropertyRendererInfo;\n /** Information for a property editor */\n editor?: PropertyEditorInfo;\n /** Information for a property converter */\n converter?: PropertyConverterInfo;\n /** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool\n * or the full name of a KOQ (schema:koq).\n * @alpha\n */\n quantityType?: string;\n /** Get the custom DataController by this name and register it with the property editor */\n dataController?: string;\n /** Should property label for composite (struct & array) properties be rendered. */\n hideCompositePropertyLabel?: boolean;\n}\n\n/** Helper class that builds property descriptions for specific PropertyEditors and processes descriptions.\n * @public\n */\nexport class PropertyDescriptionHelper {\n /** Builds a number description with a \"weight-picker\" editor name\n * @public\n */\n public static buildWeightPickerDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.WeightPicker,\n params: additionalParams,\n },\n };\n }\n\n /** Builds an editor that uses [NumberInput]($core-react) control\n * @public\n */\n public static buildNumberEditorDescription(name: string, label: string, overrideParams?: RangeEditorParams, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.Range,\n step: 1,\n precision: 0,\n ...overrideParams,\n } as RangeEditorParams, ...additionalParams];\n\n const editor = {\n name: StandardEditorNames.NumericInput,\n params: editorParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor,\n };\n }\n\n /** Builds a string description\n * @public\n */\n public static buildTextEditorDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.String,\n editor,\n };\n }\n\n /** Builds an enum description\n * @public\n */\n public static buildEnumPicklistEditorDescription(name: string, label: string,\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[],\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = additionalParams.length ? {\n params: additionalParams,\n } : undefined;\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Enum,\n editor,\n enum: {\n choices,\n },\n };\n }\n\n /** Builds a number description for a tool settings or dialog property that will display a \"color-picker\" control.\n * @public\n */\n public static buildColorPickerDescription(name: string, label: string, colorValues: number[], numColumns: number,\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [\n {\n type: PropertyEditorParamTypes.ColorData,\n colorValues,\n numColumns,\n } as ColorEditorParams,\n ...additionalParams,\n ];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Number,\n editor: {\n name: StandardEditorNames.ColorPicker,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"toggle\" control.\n * @public\n */\n public static buildToggleDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.Toggle,\n params: additionalParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a \"image-check-box\" control.\n * @public\n */\n public static buildImageCheckBoxDescription(name: string, label: string, imageOff: string, imageOn: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editorParams = [{\n type: PropertyEditorParamTypes.CheckBoxImages,\n imageOff,\n imageOn,\n } as ImageCheckBoxParams, ...additionalParams];\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor: {\n name: StandardEditorNames.ImageCheckBox,\n params: editorParams,\n },\n };\n }\n\n /** Builds a boolean description for a tool settings or dialog property that will display a checkbox control.\n * @public\n */\n public static buildCheckboxDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const editor = {\n params: additionalParams,\n };\n\n return {\n name,\n displayLabel: label,\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Builds a property description for a tool settings or dialog `lock` property. This will create a checkbox control with no label.\n * @public\n */\n public static buildLockPropertyDescription(name: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\n const defaultParams = {\n type: PropertyEditorParamTypes.SuppressEditorLabel,\n suppressLabelPlaceholder: true,\n } as SuppressLabelEditorParams;\n\n const editor = {\n params: [defaultParams, ...additionalParams],\n };\n\n return {\n name,\n displayLabel: \"\",\n typename: StandardTypeNames.Boolean,\n editor,\n };\n }\n\n /** Bumps an enum property description value\n * @public\n */\n public static async bumpEnumProperty(description: PropertyDescription, value: string | number): Promise<string | number> {\n let choices: EnumerationChoice[] | undefined;\n\n if (description.enum) {\n if (description.enum.choices instanceof Promise) {\n choices = await description.enum.choices;\n } else {\n choices = description.enum.choices;\n }\n }\n\n if (!choices || choices.length === 0)\n return value;\n\n let choiceIndex = choices.findIndex((choice) => choice.value === value);\n if (choiceIndex < 0)\n return value;\n\n choiceIndex++;\n if (choiceIndex >= choices.length)\n choiceIndex = 0;\n\n const newValue = choices[choiceIndex].value;\n return newValue;\n }\n}\n"]}
1
+ {"version":3,"file":"Description.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Description.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACmF,wBAAwB,GAEjH,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAmFxD;;GAEG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAY,EAAE,KAAa,EAAE,mBAA+C,EAAE;QACvH,OAAO;YACL,IAAI;YACJ,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,iBAAiB,CAAC,MAAM;YAClC,MAAM,EAAE;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CAAC,MAAM;YAC/B,WAAW,GAAG,CAAC,CAAC;QAElB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport {\r\n BasePropertyEditorParams, ColorEditorParams, ImageCheckBoxParams, PropertyEditorParams, PropertyEditorParamTypes, RangeEditorParams,\r\n SuppressLabelEditorParams,\r\n} from \"./EditorParams\";\r\nimport { StandardEditorNames } from \"./StandardEditorNames\";\r\nimport { StandardTypeNames } from \"./StandardTypeNames\";\r\n\r\n// cSpell:ignore Picklist\r\n\r\n/**\r\n * Information about an enumeration choice\r\n * @public\r\n */\r\nexport interface EnumerationChoice {\r\n label: string;\r\n value: string | number;\r\n}\r\n\r\n/**\r\n * Information about a set of enumeration choices\r\n * @public\r\n */\r\nexport interface EnumerationChoicesInfo {\r\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[];\r\n isStrict?: boolean;\r\n maxDisplayedRows?: number;\r\n}\r\n\r\n/**\r\n * Property renderer identification and customization attributes\r\n * @public\r\n */\r\nexport interface PropertyRendererInfo {\r\n name: string;\r\n}\r\n\r\n/**\r\n * Information about a Property Editor\r\n * @public\r\n */\r\nexport interface PropertyEditorInfo {\r\n /** Editor name used in addition to the typename to find the registered property editor */\r\n name?: string;\r\n /** Editor params provided to the property editor */\r\n params?: PropertyEditorParams[];\r\n}\r\n\r\n/**\r\n * Information about a Property Converter\r\n * @public\r\n */\r\nexport interface PropertyConverterInfo {\r\n /** Converter name used in addition to the typename to find the registered property converter */\r\n name?: string;\r\n /** map of options for type converter */\r\n options?: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * [[PropertyDescription]] contains metadata about a Property\r\n * @public\r\n */\r\nexport interface PropertyDescription {\r\n /** Name of the property description */\r\n name: string;\r\n /** Display label for the property description */\r\n displayLabel: string;\r\n /** Type name used to determine applicable Type Converter and Property Editor */\r\n typename: string;\r\n /** Additional information for enumerations */\r\n enum?: EnumerationChoicesInfo;\r\n /** Information for property renderer customization */\r\n renderer?: PropertyRendererInfo;\r\n /** Information for a property editor */\r\n editor?: PropertyEditorInfo;\r\n /** Information for a property converter */\r\n converter?: PropertyConverterInfo;\r\n /** Quantity type key used to look up formatting and parsing specs. This is typically either the name of a quantity type used by a tool\r\n * or the full name of a KOQ (schema:koq).\r\n * @alpha\r\n */\r\n quantityType?: string;\r\n /** Get the custom DataController by this name and register it with the property editor */\r\n dataController?: string;\r\n /** Should property label for composite (struct & array) properties be rendered. */\r\n hideCompositePropertyLabel?: boolean;\r\n}\r\n\r\n/** Helper class that builds property descriptions for specific PropertyEditors and processes descriptions.\r\n * @public\r\n */\r\nexport class PropertyDescriptionHelper {\r\n /** Builds a number description with a \"weight-picker\" editor name\r\n * @public\r\n */\r\n public static buildWeightPickerDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.Number,\r\n editor: {\r\n name: StandardEditorNames.WeightPicker,\r\n params: additionalParams,\r\n },\r\n };\r\n }\r\n\r\n /** Builds an editor that uses [NumberInput]($core-react) control\r\n * @public\r\n */\r\n public static buildNumberEditorDescription(name: string, label: string, overrideParams?: RangeEditorParams, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n const editorParams = [{\r\n type: PropertyEditorParamTypes.Range,\r\n step: 1,\r\n precision: 0,\r\n ...overrideParams,\r\n } as RangeEditorParams, ...additionalParams];\r\n\r\n const editor = {\r\n name: StandardEditorNames.NumericInput,\r\n params: editorParams,\r\n };\r\n\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.Number,\r\n editor,\r\n };\r\n }\r\n\r\n /** Builds a string description\r\n * @public\r\n */\r\n public static buildTextEditorDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n const editor = {\r\n params: additionalParams,\r\n };\r\n\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.String,\r\n editor,\r\n };\r\n }\r\n\r\n /** Builds an enum description\r\n * @public\r\n */\r\n public static buildEnumPicklistEditorDescription(name: string, label: string,\r\n choices: Promise<EnumerationChoice[]> | EnumerationChoice[],\r\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n const editor = additionalParams.length ? {\r\n params: additionalParams,\r\n } : undefined;\r\n\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.Enum,\r\n editor,\r\n enum: {\r\n choices,\r\n },\r\n };\r\n }\r\n\r\n /** Builds a number description for a tool settings or dialog property that will display a \"color-picker\" control.\r\n * @public\r\n */\r\n public static buildColorPickerDescription(name: string, label: string, colorValues: number[], numColumns: number,\r\n additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n const editorParams = [\r\n {\r\n type: PropertyEditorParamTypes.ColorData,\r\n colorValues,\r\n numColumns,\r\n } as ColorEditorParams,\r\n ...additionalParams,\r\n ];\r\n\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.Number,\r\n editor: {\r\n name: StandardEditorNames.ColorPicker,\r\n params: editorParams,\r\n },\r\n };\r\n }\r\n\r\n /** Builds a boolean description for a tool settings or dialog property that will display a \"toggle\" control.\r\n * @public\r\n */\r\n public static buildToggleDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.Boolean,\r\n editor: {\r\n name: StandardEditorNames.Toggle,\r\n params: additionalParams,\r\n },\r\n };\r\n }\r\n\r\n /** Builds a boolean description for a tool settings or dialog property that will display a \"image-check-box\" control.\r\n * @public\r\n */\r\n public static buildImageCheckBoxDescription(name: string, label: string, imageOff: string, imageOn: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n const editorParams = [{\r\n type: PropertyEditorParamTypes.CheckBoxImages,\r\n imageOff,\r\n imageOn,\r\n } as ImageCheckBoxParams, ...additionalParams];\r\n\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.Boolean,\r\n editor: {\r\n name: StandardEditorNames.ImageCheckBox,\r\n params: editorParams,\r\n },\r\n };\r\n }\r\n\r\n /** Builds a boolean description for a tool settings or dialog property that will display a checkbox control.\r\n * @public\r\n */\r\n public static buildCheckboxDescription(name: string, label: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n const editor = {\r\n params: additionalParams,\r\n };\r\n\r\n return {\r\n name,\r\n displayLabel: label,\r\n typename: StandardTypeNames.Boolean,\r\n editor,\r\n };\r\n }\r\n\r\n /** Builds a property description for a tool settings or dialog `lock` property. This will create a checkbox control with no label.\r\n * @public\r\n */\r\n public static buildLockPropertyDescription(name: string, additionalParams: BasePropertyEditorParams[] = []): PropertyDescription {\r\n const defaultParams = {\r\n type: PropertyEditorParamTypes.SuppressEditorLabel,\r\n suppressLabelPlaceholder: true,\r\n } as SuppressLabelEditorParams;\r\n\r\n const editor = {\r\n params: [defaultParams, ...additionalParams],\r\n };\r\n\r\n return {\r\n name,\r\n displayLabel: \"\",\r\n typename: StandardTypeNames.Boolean,\r\n editor,\r\n };\r\n }\r\n\r\n /** Bumps an enum property description value\r\n * @public\r\n */\r\n public static async bumpEnumProperty(description: PropertyDescription, value: string | number): Promise<string | number> {\r\n let choices: EnumerationChoice[] | undefined;\r\n\r\n if (description.enum) {\r\n if (description.enum.choices instanceof Promise) {\r\n choices = await description.enum.choices;\r\n } else {\r\n choices = description.enum.choices;\r\n }\r\n }\r\n\r\n if (!choices || choices.length === 0)\r\n return value;\r\n\r\n let choiceIndex = choices.findIndex((choice) => choice.value === value);\r\n if (choiceIndex < 0)\r\n return value;\r\n\r\n choiceIndex++;\r\n if (choiceIndex >= choices.length)\r\n choiceIndex = 0;\r\n\r\n const newValue = choices[choiceIndex].value;\r\n return newValue;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorParams.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/EditorParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAcH;;GAEG;AACH,MAAM,CAAN,IAAY,oBAcX;AAdD,WAAY,oBAAoB;IAC9B,+DAAQ,CAAA;IACR,aAAa;IACb,uEAAY,CAAA;IACZ,2BAA2B;IAC3B,6EAAW,CAAA;IACX,cAAc;IACd,uEAAQ,CAAA;IACR,2BAA2B;IAC3B,6EAAW,CAAA;IACX,mBAAmB;IACnB,qFAAe,CAAA;IACf,gCAAgC;IAChC,2FAAkB,CAAA;AACpB,CAAC,EAdW,oBAAoB,KAApB,oBAAoB,QAc/B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,wCAAwC;IACxC,iCAAkB,CAAA;IAClB,iDAAiD;IACjD,qCAAsB,CAAA;IACtB,uBAAuB;IACvB,6BAAc,CAAA;IACd,mCAAmC;IACnC,iCAAkB,CAAA;AACpB,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,wBAeX;AAfD,WAAY,wBAAwB;IAClC,0EAA8C,CAAA;IAC9C,sEAA0C,CAAA;IAC1C,oDAAwB,CAAA;IACxB,0EAA8C,CAAA;IAC9C,8DAAkC,CAAA;IAClC,sFAA0D,CAAA;IAC1D,oEAAwC,CAAA;IACxC,4BAA4B;IAC5B,sEAA0C,CAAA;IAC1C,sDAA0B,CAAA;IAC1B,wDAA4B,CAAA;IAC5B,sDAAsD;IACtD,kFAAsD,CAAA;IACtD,wEAA4C,CAAA;AAC9C,CAAC,EAfW,wBAAwB,KAAxB,wBAAwB,QAenC;AAyBD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAA8B,EAAiC,EAAE;IACvG,OAAO,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,eAAe,CAAC;AAChE,CAAC,CAAC;AAeF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAA8B,EAA6B,EAAE;IAC/F,OAAO,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,SAAS,CAAC;AAC1D,CAAC,CAAC;AAgBF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAA8B,EAAgC,EAAE;IACrG,OAAO,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,YAAY,CAAC;AAC7D,CAAC,CAAC;AAsBF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,IAA8B,EAAmC,EAAE;IAC3G,OAAO,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,eAAe,CAAC;AAChE,CAAC,CAAC;AAYF;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,IAA8B,EAAqC,EAAE;IAC/G,OAAO,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,mBAAmB,CAAC;AACpE,CAAC,CAAC;AA4IF;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,IAA8B,EAAuC,EAAE;IACnH,OAAO,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,qBAAqB,CAAC;AACtE,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 Properties\n */\n\n// cspell:ignore BBGGRR pushable DDTHH\n\n/** Interface used to provide a custom Date Time formatter and optional parser\n * for use by `DatePickerPopup`. If a parseData function is not implemented\n * then string to date parsing will not be possible when a `DateFormatter` is used.\n * @public\n */\nexport interface DateFormatter {\n formateDate: (day: Date) => string;\n parseDate?: (dateString: string) => Date | undefined;\n}\n\n/** Alternate Data Formats that can be provide by javascript. Can be used by Date TypeConverter and TypeEditor.\n * @public\n */\nexport enum AlternateDateFormats {\n None = 0,\n // YYYY-MM-DD\n IsoShort = 1,\n // YYYY-MM-DDTHH:mm:ss.sssZ\n IsoDateTime,\n // dd Mmm yyyy\n UtcShort,\n // dd Mmm yyyy hh:mm:ss GMT\n UtcDateTime,\n // Www, dd Mmm yyyy\n UtcShortWithDay,\n // Www, dd Mmm yyyy hh:mm:ss GMT\n UtcDateTimeWithDay,\n}\n\n/** Enum that defines supported time formats.\n * @public\n */\nexport enum TimeDisplay {\n // 12 hour with minutes and cycle(AM/PM)\n H12MC = \"hh:mm aa\",\n // 12 hour with minutes, seconds and cycle(AM/PM)\n H12MSC = \"hh:mm:ss aa\",\n // 24 hour with minutes\n H24M = \"hh:mm\",\n // 24 hour with minutes and seconds\n H24MS = \"hh:mm:ss\",\n}\n\n/**\n * Enum for Property Editor Param Types\n * @public\n */\nexport enum PropertyEditorParamTypes {\n ButtonGroupData = \"UiAbstract-ButtonGroupData\",\n CheckBoxIcons = \"UiAbstract-CheckBoxIcons\",\n Icon = \"UiAbstract-Icon\",\n InputEditorSize = \"UiAbstract-InputEditorSize\",\n ColorData = \"UiAbstract-ColorData\",\n CustomFormattedNumber = \"UiAbstract-CustomFormattedNumber\",\n IconListData = \"UiAbstract-IconListData\",\n // JSON = \"UiAbstract-JSON\",\n MultilineText = \"UiAbstract-MultilineText\",\n Range = \"UiAbstract-Range\",\n Slider = \"UiAbstract-Slider\",\n // SuppressUnitLabel = \"UiAbstract-SuppressUnitLabel\",\n SuppressEditorLabel = \"UiAbstract-SuppressEditorLabel\",\n CheckBoxImages = \"UiAbstract-CheckBoxImages\",\n}\n\n/**\n * [[BasePropertyEditorParams]] Base interface for Property Editor Params\n * @public\n */\nexport interface BasePropertyEditorParams {\n type: string;\n}\n\n/**\n * Parameters used by PropertyEditors that use HTML <input> element.\n * @public\n */\n/** [[InputEditorSizeParams]] type guard.\n * @public\n */\nexport interface InputEditorSizeParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.InputEditorSize;\n /** Optionally define the width in characters. */\n size?: number;\n /** Optionally define the maximum number of characters allowed. */\n maxLength?: number;\n}\n\n/** InputEditorSizeParams type guard.\n * @public\n */\nexport const isInputEditorSizeParams = (item: BasePropertyEditorParams): item is InputEditorSizeParams => {\n return item.type === PropertyEditorParamTypes.InputEditorSize;\n};\n\n/**\n * [[ColorEditorParams]] Parameters used to populate color type editor with a specific set of colors. If not specified the Color\n * Editor will show a default palette of 16 colors.\n * @public\n */\nexport interface ColorEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.ColorData;\n /** array of color values to show in color picker popup. Use [[ColorByName]] enum values. Values should be 32-bit integer in the form 0xBBGGRR. */\n colorValues: number[];\n /** number of columns to show in color picker popup. The value of 4 is used if not defined. */\n numColumns?: number;\n}\n\n/** ColorEditorParams type guard.\n * @public\n */\nexport const isColorEditorParams = (item: BasePropertyEditorParams): item is ColorEditorParams => {\n return item.type === PropertyEditorParamTypes.ColorData;\n};\n\n/**\n * [[IconListEditorParams]] Parameters used to populate icon type editor with a specific set of icons.\n * @public\n */\nexport interface IconListEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.IconListData;\n /** active icon shown in the button */\n iconValue: string;\n /** array of icon (svg) names to show in icon picker popup. */\n iconValues: string[];\n /** number of columns to show in icon picker popup. The value of 4 is used if not defined. */\n numColumns?: number;\n}\n\n/** IconListEditorParams type guard.\n * @public\n */\nexport const isIconListEditorParams = (item: BasePropertyEditorParams): item is IconListEditorParams => {\n return item.type === PropertyEditorParamTypes.IconListData;\n};\n\n/**\n * [[IconDefinition]] Information about an icon displayed next to a property editor.\n * @public\n */\nexport interface IconDefinition {\n /** Icon specification. The value is the name of an icon WebFont entry, or if specifying an imported SVG symbol use \"webSvg:\" prefix . */\n iconSpec: string;\n /** Function to determine if the item is enabled. */\n isEnabledFunction?: () => boolean;\n}\n\n/**\n * [[ButtonGroupEditorParams]] Parameters used by EnumButtonGroupEditor to define icons in button group.\n * @public\n */\nexport interface ButtonGroupEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.ButtonGroupData;\n buttons: IconDefinition[];\n}\n\n/** ButtonGroupEditorParams type guard.\n * @public\n */\nexport const isButtonGroupEditorParams = (item: BasePropertyEditorParams): item is ButtonGroupEditorParams => {\n return item.type === PropertyEditorParamTypes.ButtonGroupData;\n};\n\n/**\n * [[SuppressLabelEditorParams]] Parameters used to suppress the label for a type editor in the ToolSettings widget.\n * @public\n */\nexport interface SuppressLabelEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.SuppressEditorLabel;\n /** if false then an empty placeholder label is created. This is sometimes necessary to align editor in proper column */\n suppressLabelPlaceholder?: boolean;\n}\n\n/** SuppressLabelEditorParams type guard.\n * @public\n */\nexport const isSuppressLabelEditorParams = (item: BasePropertyEditorParams): item is SuppressLabelEditorParams => {\n return item.type === PropertyEditorParamTypes.SuppressEditorLabel;\n};\n\n// /**\n// * Parameters used by PropertyEditors that support JSON.\n// * @alpha\n// */\n// export interface JsonEditorParams extends BasePropertyEditorParams {\n// type: PropertyEditorParamTypes.JSON;\n// json: any;\n// }\n\n/**\n * Parameters used by PropertyEditors that support defining a minimum and maximum value.\n * @public\n */\nexport interface RangeEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.Range;\n /** Defines the minimum value. Default is Number.MIN_SAFE_INTEGER. */\n minimum?: number;\n /** Defines the maximum value. Default is Number.MAX_SAFE_INTEGER. */\n maximum?: number;\n /** Defines the step value. Default is 1. */\n step?: number;\n /** Defines the precision. Default is 0. */\n precision?: number;\n}\n\n/**\n * Parameters used to indicate that a Slider should be presented for the property\n * and to specify the values needed by the slider.\n * @public\n */\nexport interface SliderEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.Slider;\n /** Defines the minimum value. */\n minimum: number;\n /** Defines the maximum value. */\n maximum: number;\n\n /** Optionally define the width in pixels. */\n size?: number;\n\n /** Step value. Default is 0.1. */\n step?: number;\n /** The interaction mode. Default is 1. Possible values:\n * 1 - allows handles to cross each other.\n * 2 - keeps the sliders from crossing and separated by a step.\n */\n mode?: number;\n\n /** Indicates whether the display of the Slider values is reversed. */\n reversed?: boolean;\n\n /** Indicates whether to show tooltip with the value. The tooltip will be positioned above the Slider, by default. */\n showTooltip?: boolean;\n /** Indicates whether the tooltip should show below the Slider instead of above. */\n tooltipBelow?: boolean;\n /** Format a value for the tooltip */\n formatTooltip?: (value: number) => string;\n\n /** Indicates whether to show min & max values to the left & right of the Slider. */\n showMinMax?: boolean;\n /** Image to show for min. */\n minIconSpec?: string;\n /** Image to show for max. */\n maxIconSpec?: string;\n\n /** Indicates whether to show tick marks under the Slider. */\n showTicks?: boolean;\n /** Indicates whether to show tick labels under the tick marks. */\n showTickLabels?: boolean;\n /** Format a tick mark value */\n formatTick?: (tick: number) => string;\n /** Function to get the tick count. The default tick count is 10. */\n getTickCount?: () => number;\n /** Function to get the tick values. This overrides the tick count from getTickCount.\n * Use this prop if you want to specify your own tick values instead of ticks generated by the slider.\n * The numbers should be valid numbers in the domain and correspond to the step value.\n * Invalid values will be coerced to the closet matching value in the domain.\n */\n getTickValues?: () => number[];\n}\n\n/**\n * Parameter that is used to indicate that a multiline text editor should be created.\n * The number of rows specified will determine the height of the editor control.\n * @public\n */\nexport interface MultilineTextEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.MultilineText;\n rows: number;\n}\n\n/**\n * Parameters used to display an icon next to property editor.\n * @public\n */\nexport interface IconEditorParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.Icon;\n definition: IconDefinition;\n}\n\n/**\n * Parameters for ImageCheckBoxEditor\n * @public\n */\nexport interface ImageCheckBoxParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.CheckBoxImages;\n imageOn: string;\n imageOff: string;\n\n}\n\n// /**\n// * Parameter used to suppress Unit labels\n// * @alpha\n// */\n// export interface SuppressUnitLabelEditorParams extends BasePropertyEditorParams {\n// type: PropertyEditorParamTypes.SuppressUnitLabel;\n// }\n\n/**\n * defines Results of parsing a string input by a user into its desired value type\n * @public\n */\nexport interface ParseResults {\n value?: string | number | boolean | {} | string[] | Date | [] | undefined;\n parseError?: string;\n}\n\n/**\n * Parameters used with properties that want to control parsing and formatting.\n * @public\n */\nexport interface CustomFormattedNumberParams extends BasePropertyEditorParams {\n type: PropertyEditorParamTypes.CustomFormattedNumber;\n formatFunction: (numberValue: number) => string;\n parseFunction: (stringValue: string) => ParseResults;\n}\n\n/** CustomFormattedNumberParams type guard.\n * @public\n */\nexport const isCustomFormattedNumberParams = (item: BasePropertyEditorParams): item is CustomFormattedNumberParams => {\n return item.type === PropertyEditorParamTypes.CustomFormattedNumber;\n};\n\n/**\n * Type definition for Property Editor params\n * @public\n */\nexport type PropertyEditorParams = BasePropertyEditorParams;\n"]}
1
+ {"version":3,"file":"EditorParams.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/EditorParams.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAcH;;GAEG;AACH,MAAM,CAAN,IAAY,oBAcX;AAdD,WAAY,oBAAoB;IAC9B,+DAAQ,CAAA;IACR,aAAa;IACb,uEAAY,CAAA;IACZ,2BAA2B;IAC3B,6EAAW,CAAA;IACX,cAAc;IACd,uEAAQ,CAAA;IACR,2BAA2B;IAC3B,6EAAW,CAAA;IACX,mBAAmB;IACnB,qFAAe,CAAA;IACf,gCAAgC;IAChC,2FAAkB,CAAA;AACpB,CAAC,EAdW,oBAAoB,KAApB,oBAAoB,QAc/B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,wCAAwC;IACxC,iCAAkB,CAAA;IAClB,iDAAiD;IACjD,qCAAsB,CAAA;IACtB,uBAAuB;IACvB,6BAAc,CAAA;IACd,mCA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BAAmB,CAAC;AACpE,CAAC,CAAC;AA4IF;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,IAA8B,EAAuC,EAAE;IACnH,OAAO,IAAI,CAAC,IAAI,KAAK,wBAAwB,CAAC,qBAAqB,CAAC;AACtE,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\n// cspell:ignore BBGGRR pushable DDTHH\r\n\r\n/** Interface used to provide a custom Date Time formatter and optional parser\r\n * for use by `DatePickerPopup`. If a parseData function is not implemented\r\n * then string to date parsing will not be possible when a `DateFormatter` is used.\r\n * @public\r\n */\r\nexport interface DateFormatter {\r\n formateDate: (day: Date) => string;\r\n parseDate?: (dateString: string) => Date | undefined;\r\n}\r\n\r\n/** Alternate Data Formats that can be provide by javascript. Can be used by Date TypeConverter and TypeEditor.\r\n * @public\r\n */\r\nexport enum AlternateDateFormats {\r\n None = 0,\r\n // YYYY-MM-DD\r\n IsoShort = 1,\r\n // YYYY-MM-DDTHH:mm:ss.sssZ\r\n IsoDateTime,\r\n // dd Mmm yyyy\r\n UtcShort,\r\n // dd Mmm yyyy hh:mm:ss GMT\r\n UtcDateTime,\r\n // Www, dd Mmm yyyy\r\n UtcShortWithDay,\r\n // Www, dd Mmm yyyy hh:mm:ss GMT\r\n UtcDateTimeWithDay,\r\n}\r\n\r\n/** Enum that defines supported time formats.\r\n * @public\r\n */\r\nexport enum TimeDisplay {\r\n // 12 hour with minutes and cycle(AM/PM)\r\n H12MC = \"hh:mm aa\",\r\n // 12 hour with minutes, seconds and cycle(AM/PM)\r\n H12MSC = \"hh:mm:ss aa\",\r\n // 24 hour with minutes\r\n H24M = \"hh:mm\",\r\n // 24 hour with minutes and seconds\r\n H24MS = \"hh:mm:ss\",\r\n}\r\n\r\n/**\r\n * Enum for Property Editor Param Types\r\n * @public\r\n */\r\nexport enum PropertyEditorParamTypes {\r\n ButtonGroupData = \"UiAbstract-ButtonGroupData\",\r\n CheckBoxIcons = \"UiAbstract-CheckBoxIcons\",\r\n Icon = \"UiAbstract-Icon\",\r\n InputEditorSize = \"UiAbstract-InputEditorSize\",\r\n ColorData = \"UiAbstract-ColorData\",\r\n CustomFormattedNumber = \"UiAbstract-CustomFormattedNumber\",\r\n IconListData = \"UiAbstract-IconListData\",\r\n // JSON = \"UiAbstract-JSON\",\r\n MultilineText = \"UiAbstract-MultilineText\",\r\n Range = \"UiAbstract-Range\",\r\n Slider = \"UiAbstract-Slider\",\r\n // SuppressUnitLabel = \"UiAbstract-SuppressUnitLabel\",\r\n SuppressEditorLabel = \"UiAbstract-SuppressEditorLabel\",\r\n CheckBoxImages = \"UiAbstract-CheckBoxImages\",\r\n}\r\n\r\n/**\r\n * [[BasePropertyEditorParams]] Base interface for Property Editor Params\r\n * @public\r\n */\r\nexport interface BasePropertyEditorParams {\r\n type: string;\r\n}\r\n\r\n/**\r\n * Parameters used by PropertyEditors that use HTML <input> element.\r\n * @public\r\n */\r\n/** [[InputEditorSizeParams]] type guard.\r\n * @public\r\n */\r\nexport interface InputEditorSizeParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.InputEditorSize;\r\n /** Optionally define the width in characters. */\r\n size?: number;\r\n /** Optionally define the maximum number of characters allowed. */\r\n maxLength?: number;\r\n}\r\n\r\n/** InputEditorSizeParams type guard.\r\n * @public\r\n */\r\nexport const isInputEditorSizeParams = (item: BasePropertyEditorParams): item is InputEditorSizeParams => {\r\n return item.type === PropertyEditorParamTypes.InputEditorSize;\r\n};\r\n\r\n/**\r\n * [[ColorEditorParams]] Parameters used to populate color type editor with a specific set of colors. If not specified the Color\r\n * Editor will show a default palette of 16 colors.\r\n * @public\r\n */\r\nexport interface ColorEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.ColorData;\r\n /** array of color values to show in color picker popup. Use [[ColorByName]] enum values. Values should be 32-bit integer in the form 0xBBGGRR. */\r\n colorValues: number[];\r\n /** number of columns to show in color picker popup. The value of 4 is used if not defined. */\r\n numColumns?: number;\r\n}\r\n\r\n/** ColorEditorParams type guard.\r\n * @public\r\n */\r\nexport const isColorEditorParams = (item: BasePropertyEditorParams): item is ColorEditorParams => {\r\n return item.type === PropertyEditorParamTypes.ColorData;\r\n};\r\n\r\n/**\r\n * [[IconListEditorParams]] Parameters used to populate icon type editor with a specific set of icons.\r\n * @public\r\n */\r\nexport interface IconListEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.IconListData;\r\n /** active icon shown in the button */\r\n iconValue: string;\r\n /** array of icon (svg) names to show in icon picker popup. */\r\n iconValues: string[];\r\n /** number of columns to show in icon picker popup. The value of 4 is used if not defined. */\r\n numColumns?: number;\r\n}\r\n\r\n/** IconListEditorParams type guard.\r\n * @public\r\n */\r\nexport const isIconListEditorParams = (item: BasePropertyEditorParams): item is IconListEditorParams => {\r\n return item.type === PropertyEditorParamTypes.IconListData;\r\n};\r\n\r\n/**\r\n * [[IconDefinition]] Information about an icon displayed next to a property editor.\r\n * @public\r\n */\r\nexport interface IconDefinition {\r\n /** Icon specification. The value is the name of an icon WebFont entry, or if specifying an imported SVG symbol use \"webSvg:\" prefix . */\r\n iconSpec: string;\r\n /** Function to determine if the item is enabled. */\r\n isEnabledFunction?: () => boolean;\r\n}\r\n\r\n/**\r\n * [[ButtonGroupEditorParams]] Parameters used by EnumButtonGroupEditor to define icons in button group.\r\n * @public\r\n */\r\nexport interface ButtonGroupEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.ButtonGroupData;\r\n buttons: IconDefinition[];\r\n}\r\n\r\n/** ButtonGroupEditorParams type guard.\r\n * @public\r\n */\r\nexport const isButtonGroupEditorParams = (item: BasePropertyEditorParams): item is ButtonGroupEditorParams => {\r\n return item.type === PropertyEditorParamTypes.ButtonGroupData;\r\n};\r\n\r\n/**\r\n * [[SuppressLabelEditorParams]] Parameters used to suppress the label for a type editor in the ToolSettings widget.\r\n * @public\r\n */\r\nexport interface SuppressLabelEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.SuppressEditorLabel;\r\n /** if false then an empty placeholder label is created. This is sometimes necessary to align editor in proper column */\r\n suppressLabelPlaceholder?: boolean;\r\n}\r\n\r\n/** SuppressLabelEditorParams type guard.\r\n * @public\r\n */\r\nexport const isSuppressLabelEditorParams = (item: BasePropertyEditorParams): item is SuppressLabelEditorParams => {\r\n return item.type === PropertyEditorParamTypes.SuppressEditorLabel;\r\n};\r\n\r\n// /**\r\n// * Parameters used by PropertyEditors that support JSON.\r\n// * @alpha\r\n// */\r\n// export interface JsonEditorParams extends BasePropertyEditorParams {\r\n// type: PropertyEditorParamTypes.JSON;\r\n// json: any;\r\n// }\r\n\r\n/**\r\n * Parameters used by PropertyEditors that support defining a minimum and maximum value.\r\n * @public\r\n */\r\nexport interface RangeEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.Range;\r\n /** Defines the minimum value. Default is Number.MIN_SAFE_INTEGER. */\r\n minimum?: number;\r\n /** Defines the maximum value. Default is Number.MAX_SAFE_INTEGER. */\r\n maximum?: number;\r\n /** Defines the step value. Default is 1. */\r\n step?: number;\r\n /** Defines the precision. Default is 0. */\r\n precision?: number;\r\n}\r\n\r\n/**\r\n * Parameters used to indicate that a Slider should be presented for the property\r\n * and to specify the values needed by the slider.\r\n * @public\r\n */\r\nexport interface SliderEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.Slider;\r\n /** Defines the minimum value. */\r\n minimum: number;\r\n /** Defines the maximum value. */\r\n maximum: number;\r\n\r\n /** Optionally define the width in pixels. */\r\n size?: number;\r\n\r\n /** Step value. Default is 0.1. */\r\n step?: number;\r\n /** The interaction mode. Default is 1. Possible values:\r\n * 1 - allows handles to cross each other.\r\n * 2 - keeps the sliders from crossing and separated by a step.\r\n */\r\n mode?: number;\r\n\r\n /** Indicates whether the display of the Slider values is reversed. */\r\n reversed?: boolean;\r\n\r\n /** Indicates whether to show tooltip with the value. The tooltip will be positioned above the Slider, by default. */\r\n showTooltip?: boolean;\r\n /** Indicates whether the tooltip should show below the Slider instead of above. */\r\n tooltipBelow?: boolean;\r\n /** Format a value for the tooltip */\r\n formatTooltip?: (value: number) => string;\r\n\r\n /** Indicates whether to show min & max values to the left & right of the Slider. */\r\n showMinMax?: boolean;\r\n /** Image to show for min. */\r\n minIconSpec?: string;\r\n /** Image to show for max. */\r\n maxIconSpec?: string;\r\n\r\n /** Indicates whether to show tick marks under the Slider. */\r\n showTicks?: boolean;\r\n /** Indicates whether to show tick labels under the tick marks. */\r\n showTickLabels?: boolean;\r\n /** Format a tick mark value */\r\n formatTick?: (tick: number) => string;\r\n /** Function to get the tick count. The default tick count is 10. */\r\n getTickCount?: () => number;\r\n /** Function to get the tick values. This overrides the tick count from getTickCount.\r\n * Use this prop if you want to specify your own tick values instead of ticks generated by the slider.\r\n * The numbers should be valid numbers in the domain and correspond to the step value.\r\n * Invalid values will be coerced to the closet matching value in the domain.\r\n */\r\n getTickValues?: () => number[];\r\n}\r\n\r\n/**\r\n * Parameter that is used to indicate that a multiline text editor should be created.\r\n * The number of rows specified will determine the height of the editor control.\r\n * @public\r\n */\r\nexport interface MultilineTextEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.MultilineText;\r\n rows: number;\r\n}\r\n\r\n/**\r\n * Parameters used to display an icon next to property editor.\r\n * @public\r\n */\r\nexport interface IconEditorParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.Icon;\r\n definition: IconDefinition;\r\n}\r\n\r\n/**\r\n * Parameters for ImageCheckBoxEditor\r\n * @public\r\n */\r\nexport interface ImageCheckBoxParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.CheckBoxImages;\r\n imageOn: string;\r\n imageOff: string;\r\n\r\n}\r\n\r\n// /**\r\n// * Parameter used to suppress Unit labels\r\n// * @alpha\r\n// */\r\n// export interface SuppressUnitLabelEditorParams extends BasePropertyEditorParams {\r\n// type: PropertyEditorParamTypes.SuppressUnitLabel;\r\n// }\r\n\r\n/**\r\n * defines Results of parsing a string input by a user into its desired value type\r\n * @public\r\n */\r\nexport interface ParseResults {\r\n value?: string | number | boolean | {} | string[] | Date | [] | undefined;\r\n parseError?: string;\r\n}\r\n\r\n/**\r\n * Parameters used with properties that want to control parsing and formatting.\r\n * @public\r\n */\r\nexport interface CustomFormattedNumberParams extends BasePropertyEditorParams {\r\n type: PropertyEditorParamTypes.CustomFormattedNumber;\r\n formatFunction: (numberValue: number) => string;\r\n parseFunction: (stringValue: string) => ParseResults;\r\n}\r\n\r\n/** CustomFormattedNumberParams type guard.\r\n * @public\r\n */\r\nexport const isCustomFormattedNumberParams = (item: BasePropertyEditorParams): item is CustomFormattedNumberParams => {\r\n return item.type === PropertyEditorParamTypes.CustomFormattedNumber;\r\n};\r\n\r\n/**\r\n * Type definition for Property Editor params\r\n * @public\r\n */\r\nexport type PropertyEditorParams = BasePropertyEditorParams;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PrimitiveTypes.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/PrimitiveTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Properties\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\n\n/** Primitive Property Value Types.\n * @public\n */\nexport namespace Primitives {\n /** Text type */\n export type Text = string;\n /** String type */\n export type String = string;\n /** DateTime will be formatted as date and time */\n export type DateTime = string | Date;\n /** ShortDate will be formatted as date only and will not include time */\n export type ShortDate = string | Date;\n /** Boolean type */\n export type Boolean = boolean | string | {} | [];\n /** Float type */\n export type Float = number | string;\n /** Int type */\n export type Int = number | string;\n /** Hexadecimal type (number expressed in hex string) */\n export type Hexadecimal = Id64String;\n /** Enum type (enumerated list of values) */\n export type Enum = number | string;\n /** Numeric type (can be float or int) */\n export type Numeric = Float | Int;\n\n /** Point2d type (contains an x and a y coordinate) */\n export type Point2d = string[] | number[] | { x: number, y: number };\n /** Point3d type (contains x,y,and z coordinates) */\n export type Point3d = string[] | number[] | { x: number, y: number, z: number };\n\n /** Point type (can be a 2d or 3d point) */\n export type Point = Point2d | Point3d;\n\n /** CompositePart (ties a raw value of a specific type to a display string) */\n export interface CompositePart {\n displayValue: string;\n rawValue: Value;\n typeName: string;\n }\n /** Composite type (built of one or more CompositePart items) */\n export interface Composite {\n separator: string;\n parts: CompositePart[];\n }\n\n /** Instance key type. */\n export interface InstanceKey {\n className: string;\n id: Id64String;\n }\n\n /** Raw value */\n export type Value = Text | String | ShortDate | Boolean | Numeric | Enum | Point | Composite | InstanceKey;\n}\n"]}
1
+ {"version":3,"file":"PrimitiveTypes.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/PrimitiveTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\n\r\n/** Primitive Property Value Types.\r\n * @public\r\n */\r\nexport namespace Primitives {\r\n /** Text type */\r\n export type Text = string;\r\n /** String type */\r\n export type String = string;\r\n /** DateTime will be formatted as date and time */\r\n export type DateTime = string | Date;\r\n /** ShortDate will be formatted as date only and will not include time */\r\n export type ShortDate = string | Date;\r\n /** Boolean type */\r\n export type Boolean = boolean | string | {} | [];\r\n /** Float type */\r\n export type Float = number | string;\r\n /** Int type */\r\n export type Int = number | string;\r\n /** Hexadecimal type (number expressed in hex string) */\r\n export type Hexadecimal = Id64String;\r\n /** Enum type (enumerated list of values) */\r\n export type Enum = number | string;\r\n /** Numeric type (can be float or int) */\r\n export type Numeric = Float | Int;\r\n\r\n /** Point2d type (contains an x and a y coordinate) */\r\n export type Point2d = string[] | number[] | { x: number, y: number };\r\n /** Point3d type (contains x,y,and z coordinates) */\r\n export type Point3d = string[] | number[] | { x: number, y: number, z: number };\r\n\r\n /** Point type (can be a 2d or 3d point) */\r\n export type Point = Point2d | Point3d;\r\n\r\n /** CompositePart (ties a raw value of a specific type to a display string) */\r\n export interface CompositePart {\r\n displayValue: string;\r\n rawValue: Value;\r\n typeName: string;\r\n }\r\n /** Composite type (built of one or more CompositePart items) */\r\n export interface Composite {\r\n separator: string;\r\n parts: CompositePart[];\r\n }\r\n\r\n /** Instance key type. */\r\n export interface InstanceKey {\r\n className: string;\r\n id: Id64String;\r\n }\r\n\r\n /** Raw value */\r\n export type Value = Text | String | ShortDate | Boolean | Numeric | Enum | Point | Composite | InstanceKey;\r\n}\r\n"]}
@@ -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,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,CAAC,MAAM;aACnC,CAAC;SACH;aAAM;YACL,WAAW,GAAG;gBACZ,IAAI,EAAE,cAAc;gBACpB,YAAY,EAAE,cAAc;gBAC5B,QAAQ,EAAE,iBAAiB,CAAC,MAAM;aACnC,CAAC;SACH;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;IAsBzB,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,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1F,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QAC/C,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAC9C,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAC9C,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;QAC5C,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAC9C,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QAChD,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC;IAED,uDAAuD;IAChD,kBAAkB;QACvB,QAAQ,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAC9B,KAAK,mBAAmB,CAAC,SAAS;gBAChC,OAAO,EAAE,CAAC;YACZ,KAAK,mBAAmB,CAAC,MAAM;gBAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3C,KAAK,mBAAmB,CAAC,KAAK;gBAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;SAC3B;IACH,CAAC;IAED,oGAAoG;IAC7F,MAAM,CAAC,UAAU,CAAC,KAAa,EAAE,iBAAgD;QACtF,IAAI,WAAgC,CAAC;QACrC,IAAI,iBAAiB,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;YAC9D,WAAW,GAAG,iBAAiB,CAAC;SACjC;aAAM,IAAI,iBAAiB,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE;YACrE,WAAW,GAAG;gBACZ,IAAI,EAAE,iBAAiB;gBACvB,YAAY,EAAE,iBAAiB;gBAC/B,QAAQ,EAAE,iBAAiB,CAAC,MAAM;aACnC,CAAC;SACH;aAAM;YACL,WAAW,GAAG;gBACZ,IAAI,EAAE,cAAc;gBACpB,YAAY,EAAE,cAAc;gBAC5B,QAAQ,EAAE,iBAAiB,CAAC,MAAM;aACnC,CAAC;SACH;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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport { PropertyDescription } from \"./Description\";\r\nimport { StandardTypeNames } from \"./StandardTypeNames\";\r\nimport { PropertyValue, PropertyValueFormat } from \"./Value\";\r\n\r\n/** Properties for the [[PropertyRecord]] with link info supplied\r\n * @public\r\n */\r\nexport interface LinkElementsInfo {\r\n /** Callback to link click event */\r\n onClick: (text: string) => void;\r\n /**\r\n * Function that specifies which parts of display value need to be clickable.\r\n *\r\n * Letters will be picked from __start__ index to __end__ index. __end__ index is not included.\r\n * For a string _\"example\"_ and a match ```{ start: 1, end: 3 }```, _\"xa\"_ will be clickable.\r\n */\r\n matcher?: (displayValue: string) => Array<{ start: number, end: number }>;\r\n}\r\n\r\n/**\r\n * PropertyRecord contains instance information about a Property, including a\r\n * value that can be edited using a PropertyEditor and converted using a TypeConverter.\r\n * @public\r\n */\r\nexport class PropertyRecord {\r\n /** Value for the property */\r\n public readonly value: PropertyValue;\r\n /** The property description containing metadata for the property */\r\n public readonly property: PropertyDescription;\r\n\r\n /** Description for the property */\r\n public description?: string;\r\n /** Indicates if the property is read-only */\r\n public isReadonly?: boolean;\r\n /** Indicates if the property is disabled */\r\n public isDisabled?: boolean;\r\n /** Indicates if the property record represents merged properties */\r\n public isMerged?: boolean;\r\n /** Indicates if the property should be automatically expanded */\r\n public autoExpand?: boolean;\r\n /** Map containing any additional data */\r\n public extendedData?: { [key: string]: any };\r\n\r\n /** Properties for link logic */\r\n public links?: LinkElementsInfo;\r\n\r\n /** Constructs a PropertyRecord instance */\r\n public constructor(value: PropertyValue, property: PropertyDescription) {\r\n this.value = value;\r\n this.property = property;\r\n }\r\n\r\n /** Creates a copy of this PropertyRecord with a new value and optionally a new PropertyDescription */\r\n public copyWithNewValue(newValue: PropertyValue, newDescription?: PropertyDescription): PropertyRecord {\r\n const rec = new PropertyRecord(newValue, newDescription ? newDescription : this.property);\r\n assignMemberIfExists(rec, this, \"description\");\r\n assignMemberIfExists(rec, this, \"isReadonly\");\r\n assignMemberIfExists(rec, this, \"isDisabled\");\r\n assignMemberIfExists(rec, this, \"isMerged\");\r\n assignMemberIfExists(rec, this, \"autoExpand\");\r\n assignMemberIfExists(rec, this, \"extendedData\");\r\n assignMemberIfExists(rec, this, \"links\");\r\n return rec;\r\n }\r\n\r\n /** Gets this property record value children records */\r\n public getChildrenRecords(): PropertyRecord[] {\r\n switch (this.value.valueFormat) {\r\n case PropertyValueFormat.Primitive:\r\n return [];\r\n case PropertyValueFormat.Struct:\r\n return Object.values(this.value.members);\r\n case PropertyValueFormat.Array:\r\n return this.value.items;\r\n }\r\n }\r\n\r\n /** Creates a PropertyRecord based on a value string and an optional property description or name */\r\n public static fromString(value: string, descriptionOrName?: PropertyDescription | string): PropertyRecord {\r\n let description: PropertyDescription;\r\n if (descriptionOrName && typeof descriptionOrName === \"object\") {\r\n description = descriptionOrName;\r\n } else if (descriptionOrName && typeof descriptionOrName === \"string\") {\r\n description = {\r\n name: descriptionOrName,\r\n displayLabel: descriptionOrName,\r\n typename: StandardTypeNames.String,\r\n };\r\n } else {\r\n description = {\r\n name: \"string_value\",\r\n displayLabel: \"String Value\",\r\n typename: StandardTypeNames.String,\r\n };\r\n }\r\n return new PropertyRecord({\r\n valueFormat: PropertyValueFormat.Primitive,\r\n value,\r\n displayValue: value,\r\n }, description);\r\n }\r\n}\r\n\r\nfunction assignMemberIfExists<T extends Object>(target: T, source: T, memberName: keyof T) {\r\n if (source.hasOwnProperty(memberName))\r\n target[memberName] = source[memberName];\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StandardEditorNames.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/StandardEditorNames.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAcX;AAdD,WAAY,mBAAmB;IAC7B,mDAA4B,CAAA;IAC5B,oDAA6B,CAAA;IAC7B,sDAA+B,CAAA;IAC/B,2DAAoC,CAAA;IACpC,iDAA0B,CAAA;IAC1B,+CAAwB,CAAA;IACxB,qDAA8B,CAAA;IAC9B,qDAA8B,CAAA;IAC9B,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,qDAA8B,CAAA;IAC9B,wDAAiC,CAAA;IACjC,iDAA0B,CAAA;AAC5B,CAAC,EAdW,mBAAmB,KAAnB,mBAAmB,QAc9B","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\n/**\n * Standard Editor Names for property editors.\n * @public\n */\nexport enum StandardEditorNames {\n ColorPicker = \"color-picker\",\n LongDate = \"long-date-picker\",\n ShortDate = \"short-date-picker\",\n EnumButtonGroup = \"enum-buttongroup\",\n IconPicker = \"icon-picker\",\n MultiLine = \"multi-line\",\n NumberCustom = \"number-custom\",\n NumericInput = \"numeric-input\",\n Slider = \"slider\",\n Toggle = \"toggle\",\n WeightPicker = \"weight-picker\",\n ImageCheckBox = \"image-check-box\",\n ThemedEnum = \"themed-enum\",\n}\n"]}
1
+ {"version":3,"file":"StandardEditorNames.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/StandardEditorNames.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAcX;AAdD,WAAY,mBAAmB;IAC7B,mDAA4B,CAAA;IAC5B,oDAA6B,CAAA;IAC7B,sDAA+B,CAAA;IAC/B,2DAAoC,CAAA;IACpC,iDAA0B,CAAA;IAC1B,+CAAwB,CAAA;IACxB,qDAA8B,CAAA;IAC9B,qDAA8B,CAAA;IAC9B,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,qDAA8B,CAAA;IAC9B,wDAAiC,CAAA;IACjC,iDAA0B,CAAA;AAC5B,CAAC,EAdW,mBAAmB,KAAnB,mBAAmB,QAc9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\n/**\r\n * Standard Editor Names for property editors.\r\n * @public\r\n */\r\nexport enum StandardEditorNames {\r\n ColorPicker = \"color-picker\",\r\n LongDate = \"long-date-picker\",\r\n ShortDate = \"short-date-picker\",\r\n EnumButtonGroup = \"enum-buttongroup\",\r\n IconPicker = \"icon-picker\",\r\n MultiLine = \"multi-line\",\r\n NumberCustom = \"number-custom\",\r\n NumericInput = \"numeric-input\",\r\n Slider = \"slider\",\r\n Toggle = \"toggle\",\r\n WeightPicker = \"weight-picker\",\r\n ImageCheckBox = \"image-check-box\",\r\n ThemedEnum = \"themed-enum\",\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StandardTypeNames.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/StandardTypeNames.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,0BAA0B;AAE1B;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAsBX;AAtBD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,gCAAW,CAAA;IACX,wCAAmB,CAAA;IACnB,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,gCAAW,CAAA;IACX,kCAAa,CAAA;IACb,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;IACzB,4CAAuB,CAAA;IACvB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,gCAAW,CAAA;AACb,CAAC,EAtBW,iBAAiB,KAAjB,iBAAiB,QAsB5B","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\n// cSpell:ignore shortdate\n\n/**\n * Standard Type Names for converters and editors.\n * @public\n */\nexport enum StandardTypeNames {\n Text = \"text\",\n String = \"string\",\n DateTime = \"dateTime\", // locale specific\n ShortDate = \"shortdate\", // locale specific\n Boolean = \"boolean\",\n Bool = \"bool\",\n Float = \"float\",\n Double = \"double\",\n Int = \"int\",\n Integer = \"integer\",\n Number = \"number\",\n Hexadecimal = \"hexadecimal\",\n Hex = \"hex\",\n Enum = \"enum\",\n Point2d = \"point2d\",\n Point3d = \"point3d\",\n Navigation = \"navigation\",\n Composite = \"composite\",\n Array = \"array\",\n Struct = \"struct\",\n URL = \"url\",\n}\n"]}
1
+ {"version":3,"file":"StandardTypeNames.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/StandardTypeNames.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,0BAA0B;AAE1B;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAsBX;AAtBD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,gCAAW,CAAA;IACX,wCAAmB,CAAA;IACnB,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,gCAAW,CAAA;IACX,kCAAa,CAAA;IACb,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,8CAAyB,CAAA;IACzB,4CAAuB,CAAA;IACvB,oCAAe,CAAA;IACf,sCAAiB,CAAA;IACjB,gCAAW,CAAA;AACb,CAAC,EAtBW,iBAAiB,KAAjB,iBAAiB,QAsB5B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\n// cSpell:ignore shortdate\r\n\r\n/**\r\n * Standard Type Names for converters and editors.\r\n * @public\r\n */\r\nexport enum StandardTypeNames {\r\n Text = \"text\",\r\n String = \"string\",\r\n DateTime = \"dateTime\", // locale specific\r\n ShortDate = \"shortdate\", // locale specific\r\n Boolean = \"boolean\",\r\n Bool = \"bool\",\r\n Float = \"float\",\r\n Double = \"double\",\r\n Int = \"int\",\r\n Integer = \"integer\",\r\n Number = \"number\",\r\n Hexadecimal = \"hexadecimal\",\r\n Hex = \"hex\",\r\n Enum = \"enum\",\r\n Point2d = \"point2d\",\r\n Point3d = \"point3d\",\r\n Navigation = \"navigation\",\r\n Composite = \"composite\",\r\n Array = \"array\",\r\n Struct = \"struct\",\r\n URL = \"url\",\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Value.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,uEAAS,CAAA;IACT,+DAAK,CAAA;IACL,iEAAM,CAAA;AACR,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B","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 { Primitives } from \"./PrimitiveTypes\";\nimport { PropertyRecord } from \"./Record\";\n\n/**\n * Enumeration for Format of the property value.\n * @public\n */\nexport enum PropertyValueFormat {\n Primitive,\n Array,\n Struct,\n}\n\n/** Base interface for a property value\n * @public\n */\nexport interface BasePropertyValue {\n valueFormat: PropertyValueFormat;\n}\n\n/** Primitive property value\n * @public\n */\nexport interface PrimitiveValue extends BasePropertyValue {\n valueFormat: PropertyValueFormat.Primitive;\n value?: Primitives.Value;\n displayValue?: string;\n}\n\n/** Struct property value\n * @public\n */\nexport interface StructValue extends BasePropertyValue {\n valueFormat: PropertyValueFormat.Struct;\n members: { [name: string]: PropertyRecord };\n}\n\n/** Array property value\n * @public\n */\nexport interface ArrayValue extends BasePropertyValue {\n valueFormat: PropertyValueFormat.Array;\n items: PropertyRecord[];\n itemsTypeName: string;\n}\n\n/** Type for all property values\n * @public\n */\nexport type PropertyValue = PrimitiveValue | StructValue | ArrayValue;\n"]}
1
+ {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/appui-abstract/properties/Value.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,uEAAS,CAAA;IACT,+DAAK,CAAA;IACL,iEAAM,CAAA;AACR,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport { Primitives } from \"./PrimitiveTypes\";\r\nimport { PropertyRecord } from \"./Record\";\r\n\r\n/**\r\n * Enumeration for Format of the property value.\r\n * @public\r\n */\r\nexport enum PropertyValueFormat {\r\n Primitive,\r\n Array,\r\n Struct,\r\n}\r\n\r\n/** Base interface for a property value\r\n * @public\r\n */\r\nexport interface BasePropertyValue {\r\n valueFormat: PropertyValueFormat;\r\n}\r\n\r\n/** Primitive property value\r\n * @public\r\n */\r\nexport interface PrimitiveValue extends BasePropertyValue {\r\n valueFormat: PropertyValueFormat.Primitive;\r\n value?: Primitives.Value;\r\n displayValue?: string;\r\n}\r\n\r\n/** Struct property value\r\n * @public\r\n */\r\nexport interface StructValue extends BasePropertyValue {\r\n valueFormat: PropertyValueFormat.Struct;\r\n members: { [name: string]: PropertyRecord };\r\n}\r\n\r\n/** Array property value\r\n * @public\r\n */\r\nexport interface ArrayValue extends BasePropertyValue {\r\n valueFormat: PropertyValueFormat.Array;\r\n items: PropertyRecord[];\r\n itemsTypeName: string;\r\n}\r\n\r\n/** Type for all property values\r\n * @public\r\n */\r\nexport type PropertyValue = PrimitiveValue | StructValue | ArrayValue;\r\n"]}
@@ -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;YACZ,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;SAClC;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;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;YACZ,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;SAClC;IACH,CAAC;CAiBF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Properties\r\n */\r\n\r\nimport { PropertyDescription, PropertyEditorInfo } from \"../properties/Description\";\r\nimport { CustomFormattedNumberParams, IconEditorParams, ParseResults, PropertyEditorParamTypes } from \"../properties/EditorParams\";\r\nimport { StandardTypeNames } from \"../properties/StandardTypeNames\";\r\nimport { StandardEditorNames } from \"../properties/StandardEditorNames\";\r\n\r\n/**\r\n * Base Quantity Property Description\r\n * @beta\r\n */\r\nexport abstract class BaseQuantityDescription implements PropertyDescription {\r\n public name: string;\r\n public displayLabel: string;\r\n public typename: string;\r\n public editor: PropertyEditorInfo;\r\n\r\n constructor(name: string, displayLabel: string, iconSpec?: string) {\r\n this.name = name;\r\n this.displayLabel = displayLabel;\r\n this.typename = StandardTypeNames.Number;\r\n this.editor = {\r\n name: StandardEditorNames.NumberCustom,\r\n params: [{\r\n type: PropertyEditorParamTypes.CustomFormattedNumber,\r\n formatFunction: this.format,\r\n parseFunction: this.parse,\r\n } as CustomFormattedNumberParams,\r\n ],\r\n };\r\n\r\n // istanbul ignore else\r\n if (iconSpec) {\r\n const params: IconEditorParams = {\r\n type: PropertyEditorParamTypes.Icon,\r\n definition: { iconSpec },\r\n };\r\n this.editor.params!.push(params);\r\n }\r\n }\r\n\r\n protected abstract formatValue(numberValue: number): string;\r\n\r\n public format = (numberValue: number): string => {\r\n return this.formatValue(numberValue);\r\n };\r\n protected abstract parseString(userInput: string): ParseResults;\r\n\r\n public parse = (userInput: string): ParseResults => {\r\n return this.parseString(userInput);\r\n };\r\n\r\n public abstract get quantityType(): string;\r\n\r\n public abstract get parseError(): string;\r\n\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItem.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IAC1B,4CAA4C;IAC5C,6DAAW,CAAA;IACX,4CAA4C;IAC5C,uDAAQ,CAAA;IACR,mCAAmC;IACnC,yDAAS,CAAA;IACT,mCAAmC;IACnC,2DAAU,CAAA;IACV,sCAAsC;IACtC,iEAAa,CAAA;IACb,sCAAsC;IACtC,yDAAS,CAAA;IACT,4CAA4C;IAC5C,6DAAW,CAAA;AACb,CAAC,EAfW,gBAAgB,KAAhB,gBAAgB,QAe3B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,8EAA8E;IAC9E,2DAAI,CAAA;IACJ,6CAA6C;IAC7C,6DAAK,CAAA;AACP,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AA0ED;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,IAAyB,EAAuC,EAAE;IAC9G,OAAQ,IAAoC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,8CAA8C;AACpH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,IAAyB,EAAsC,EAAE;IAC5G,OAAQ,IAAmC,CAAC,KAAK,KAAK,SAAS,IAAK,IAAoC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,8CAA8C;AAChL,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,IAAyB,EAAuC,EAAE;IAC9G,OAAO,CAAC,CAAE,IAAoC,CAAC,QAAQ,CAAC,CAAC,8CAA8C;AACzG,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAa,8BAA8B;;AACzC,oDAAoD;AACtC,+CAAgB,GAAG,CAAC,EAAU,EAAE,OAAyB,EAAE,YAAoB,EAAE,IAAqC,EAAE,OAAwC,EAAE,OAAmB,EAAE,SAAgD,EAA+B,EAAE,CAAC,CAAC;IACtR,EAAE,EAAE,OAAO,EAAE,YAAY;IACzB,IAAI,EAAE,OAAO;IACb,OAAO;IACP,GAAG,SAAS;CACb,CAAC,CAAC;AAEH,kDAAkD;AACpC,8CAAe,GAAG,CAAC,EAAU,EAAE,OAAyB,EAAE,YAAoB,EAAE,IAAqC,EAAE,KAAsC,EAAE,SAAS,GAAG,kBAAkB,CAAC,KAAK,EAAE,SAA+C,EAA8B,EAAE,CAAC,CAAC;IAClS,EAAE,EAAE,OAAO,EAAE,YAAY;IACzB,IAAI,EAAE,KAAK;IACX,SAAS;IACT,GAAG,SAAS;CACb,CAAC,CAAC;SAfQ,8BAA8B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module StatusBar\n */\n\nimport { BadgeType } from \"../items/BadgeType\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { ProvidedItem } from \"../items/ProvidedItem\";\n\n/** Status bar Groups/Sections from Left to Right\n * @deprecated in 3.6. Use [StatusBarSection]($appui-react) instead.\n * @public\n */\nexport enum StatusBarSection {\n /** area for tool assistance and messages */\n Message = 0,\n /** area for tool assistance and messages */\n Left = 0,\n /** items specific to stage/task */\n Stage = 1,\n /** items specific to stage/task */\n Center = 1,\n /** Select scope and selection info */\n Selection = 2,\n /** Select scope and selection info */\n Right = 2,\n /** items that only show based on context */\n Context = 3,\n}\n\n/** Defines which side of Icon where label is placed\n * @deprecated in 3.6. Use [StatusBarLabelSide]($appui-react) instead.\n * @public\n */\nexport enum StatusBarLabelSide {\n /** Label is placed left side of icon. This is the default if not specified */\n Left,\n /** Label is placed on right side of icon. */\n Right,\n}\n\n/** Type for StatusBar Item Id\n * @deprecated in 3.6. Please use `CommonStatusBarItem[\"id\"]` from @itwin/appui-react.\n * @public\n */\nexport type StatusBarItemId = CommonStatusBarItem[\"id\"]; // eslint-disable-line deprecation/deprecation\n\n/** Describes the data needed to insert a button into the status bar.\n * @deprecated in 3.6. Use [CommonStatusBarItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarItem extends ProvidedItem { // eslint-disable-line deprecation/deprecation\n /** can be used by application to store miscellaneous data. */\n applicationData?: any;\n /** Describes badge. Renders no badge if not specified. */\n readonly badgeType?: BadgeType;\n /** Required unique id of the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** optional data to used by item implementor. */\n readonly internalData?: Map<string, any>;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Priority within a section (recommend using values 1 through 100). */\n readonly itemPriority: number;\n /** status bar section */\n readonly section: StatusBarSection; // eslint-disable-line deprecation/deprecation\n}\n\n/** Describes the data needed to insert an action item into the status bar.\n * @deprecated in 3.6. Use [StatusBarActionItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarActionItem extends AbstractStatusBarItem { // eslint-disable-line deprecation/deprecation\n /** method to execute when icon is pressed */\n readonly execute: () => void;\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** Label. */\n readonly label?: string | ConditionalStringValue;\n /** tooltip. */\n readonly tooltip?: string | ConditionalStringValue;\n}\n\n/** Describes the data needed to insert a label item with an optional icon into the status bar.\n * @deprecated in 3.6. Use [StatusBarLabelItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarLabelItem extends AbstractStatusBarItem { // eslint-disable-line deprecation/deprecation\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: string | ConditionalStringValue;\n /** Label. */\n readonly label: string | ConditionalStringValue;\n /** Defines which side of icon to display label if icon is defined. */\n readonly labelSide?: StatusBarLabelSide; // eslint-disable-line deprecation/deprecation\n}\n\n/** Describes the data needed to insert a custom item into the status bar. This is used to allow extension\n * implementer to create a framework specific component.\n * @deprecated in 3.6. Use [StatusBarCustomItem]($appui-react) instead.\n * @public\n */\nexport interface AbstractStatusBarCustomItem extends AbstractStatusBarItem { // eslint-disable-line deprecation/deprecation\n readonly isCustom: true;\n}\n\n/** Describes the data needed to insert a button into the status bar.\n * @deprecated in 3.6. Use [StatusBarItem]($appui-react) instead.\n * @public\n */\nexport type CommonStatusBarItem = AbstractStatusBarActionItem | AbstractStatusBarLabelItem | AbstractStatusBarCustomItem; // eslint-disable-line deprecation/deprecation\n\n/** AbstractStatusBarActionItem type guard.\n * @deprecated in 3.6. Use [isStatusBarActionItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarActionItem = (item: CommonStatusBarItem): item is AbstractStatusBarActionItem => { // eslint-disable-line deprecation/deprecation\n return (item as AbstractStatusBarActionItem).execute !== undefined; // eslint-disable-line deprecation/deprecation\n};\n\n/** AbstractStatusBarLabelItem type guard.\n * @deprecated in 3.6. Use [isStatusBarLabelItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarLabelItem = (item: CommonStatusBarItem): item is AbstractStatusBarLabelItem => { // eslint-disable-line deprecation/deprecation\n return (item as AbstractStatusBarLabelItem).label !== undefined && (item as AbstractStatusBarActionItem).execute === undefined; // eslint-disable-line deprecation/deprecation\n};\n\n/** AbstractStatusBarCustomItem type guard.\n * @deprecated in 3.6. Use [isStatusBarCustomItem]($appui-react) instead.\n * @public\n */\nexport const isAbstractStatusBarCustomItem = (item: CommonStatusBarItem): item is AbstractStatusBarCustomItem => { // eslint-disable-line deprecation/deprecation\n return !!(item as AbstractStatusBarCustomItem).isCustom; // eslint-disable-line deprecation/deprecation\n};\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @deprecated in 3.6. Use [StatusBarItemUtilities]($appui-react) instead.\n * @public\n */\nexport class AbstractStatusBarItemUtilities {\n /** Creates a StatusBar item to perform an action */\n public static createActionItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, tooltip: string | ConditionalStringValue, execute: () => void, overrides?: Partial<AbstractStatusBarCustomItem>): AbstractStatusBarActionItem => ({ // eslint-disable-line deprecation/deprecation\n id, section, itemPriority,\n icon, tooltip,\n execute,\n ...overrides,\n });\n\n /** Creates a StatusBar item to display a label */\n public static createLabelItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, labelSide = StatusBarLabelSide.Right, overrides?: Partial<AbstractStatusBarLabelItem>): AbstractStatusBarLabelItem => ({ // eslint-disable-line deprecation/deprecation\n id, section, itemPriority,\n icon, label,\n labelSide,\n ...overrides,\n });\n}\n"]}
1
+ {"version":3,"file":"StatusBarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItem.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAeX;AAfD,WAAY,gBAAgB;IAC1B,4CAA4C;IAC5C,6DAAW,CAAA;IACX,4CAA4C;IAC5C,uDAAQ,CAAA;IACR,mCAAmC;IACnC,yDAAS,CAAA;IACT,mCAAmC;IACnC,2DAAU,CAAA;IACV,sCAAsC;IACtC,iEAAa,CAAA;IACb,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CAAC,KAAK,EAAE,SAA+C,EAA8B,EAAE,CAAC,CAAC;IAClS,EAAE,EAAE,OAAO,EAAE,YAAY;IACzB,IAAI,EAAE,KAAK;IACX,SAAS;IACT,GAAG,SAAS;CACb,CAAC,CAAC;SAfQ,8BAA8B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport { BadgeType } from \"../items/BadgeType\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { ProvidedItem } from \"../items/ProvidedItem\";\r\n\r\n/** Status bar Groups/Sections from Left to Right\r\n * @deprecated in 3.6. Use [StatusBarSection]($appui-react) instead.\r\n * @public\r\n */\r\nexport enum StatusBarSection {\r\n /** area for tool assistance and messages */\r\n Message = 0,\r\n /** area for tool assistance and messages */\r\n Left = 0,\r\n /** items specific to stage/task */\r\n Stage = 1,\r\n /** items specific to stage/task */\r\n Center = 1,\r\n /** Select scope and selection info */\r\n Selection = 2,\r\n /** Select scope and selection info */\r\n Right = 2,\r\n /** items that only show based on context */\r\n Context = 3,\r\n}\r\n\r\n/** Defines which side of Icon where label is placed\r\n * @deprecated in 3.6. Use [StatusBarLabelSide]($appui-react) instead.\r\n * @public\r\n */\r\nexport enum StatusBarLabelSide {\r\n /** Label is placed left side of icon. This is the default if not specified */\r\n Left,\r\n /** Label is placed on right side of icon. */\r\n Right,\r\n}\r\n\r\n/** Type for StatusBar Item Id\r\n * @deprecated in 3.6. Please use `CommonStatusBarItem[\"id\"]` from @itwin/appui-react.\r\n * @public\r\n */\r\nexport type StatusBarItemId = CommonStatusBarItem[\"id\"]; // eslint-disable-line deprecation/deprecation\r\n\r\n/** Describes the data needed to insert a button into the status bar.\r\n * @deprecated in 3.6. Use [CommonStatusBarItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface AbstractStatusBarItem extends ProvidedItem { // eslint-disable-line deprecation/deprecation\r\n /** can be used by application to store miscellaneous data. */\r\n applicationData?: any;\r\n /** Describes badge. Renders no badge if not specified. */\r\n readonly badgeType?: BadgeType;\r\n /** Required unique id of the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\r\n readonly id: string;\r\n /** optional data to used by item implementor. */\r\n readonly internalData?: Map<string, any>;\r\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\r\n readonly isHidden?: boolean | ConditionalBooleanValue;\r\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\r\n readonly isDisabled?: boolean | ConditionalBooleanValue;\r\n /** Priority within a section (recommend using values 1 through 100). */\r\n readonly itemPriority: number;\r\n /** status bar section */\r\n readonly section: StatusBarSection; // eslint-disable-line deprecation/deprecation\r\n}\r\n\r\n/** Describes the data needed to insert an action item into the status bar.\r\n * @deprecated in 3.6. Use [StatusBarActionItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface AbstractStatusBarActionItem extends AbstractStatusBarItem { // eslint-disable-line deprecation/deprecation\r\n /** method to execute when icon is pressed */\r\n readonly execute: () => void;\r\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\r\n readonly icon?: string | ConditionalStringValue;\r\n /** Label. */\r\n readonly label?: string | ConditionalStringValue;\r\n /** tooltip. */\r\n readonly tooltip?: string | ConditionalStringValue;\r\n}\r\n\r\n/** Describes the data needed to insert a label item with an optional icon into the status bar.\r\n * @deprecated in 3.6. Use [StatusBarLabelItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface AbstractStatusBarLabelItem extends AbstractStatusBarItem { // eslint-disable-line deprecation/deprecation\r\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\r\n readonly icon?: string | ConditionalStringValue;\r\n /** Label. */\r\n readonly label: string | ConditionalStringValue;\r\n /** Defines which side of icon to display label if icon is defined. */\r\n readonly labelSide?: StatusBarLabelSide; // eslint-disable-line deprecation/deprecation\r\n}\r\n\r\n/** Describes the data needed to insert a custom item into the status bar. This is used to allow extension\r\n * implementer to create a framework specific component.\r\n * @deprecated in 3.6. Use [StatusBarCustomItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport interface AbstractStatusBarCustomItem extends AbstractStatusBarItem { // eslint-disable-line deprecation/deprecation\r\n readonly isCustom: true;\r\n}\r\n\r\n/** Describes the data needed to insert a button into the status bar.\r\n * @deprecated in 3.6. Use [StatusBarItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport type CommonStatusBarItem = AbstractStatusBarActionItem | AbstractStatusBarLabelItem | AbstractStatusBarCustomItem; // eslint-disable-line deprecation/deprecation\r\n\r\n/** AbstractStatusBarActionItem type guard.\r\n * @deprecated in 3.6. Use [isStatusBarActionItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport const isAbstractStatusBarActionItem = (item: CommonStatusBarItem): item is AbstractStatusBarActionItem => { // eslint-disable-line deprecation/deprecation\r\n return (item as AbstractStatusBarActionItem).execute !== undefined; // eslint-disable-line deprecation/deprecation\r\n};\r\n\r\n/** AbstractStatusBarLabelItem type guard.\r\n * @deprecated in 3.6. Use [isStatusBarLabelItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport const isAbstractStatusBarLabelItem = (item: CommonStatusBarItem): item is AbstractStatusBarLabelItem => { // eslint-disable-line deprecation/deprecation\r\n return (item as AbstractStatusBarLabelItem).label !== undefined && (item as AbstractStatusBarActionItem).execute === undefined; // eslint-disable-line deprecation/deprecation\r\n};\r\n\r\n/** AbstractStatusBarCustomItem type guard.\r\n * @deprecated in 3.6. Use [isStatusBarCustomItem]($appui-react) instead.\r\n * @public\r\n */\r\nexport const isAbstractStatusBarCustomItem = (item: CommonStatusBarItem): item is AbstractStatusBarCustomItem => { // eslint-disable-line deprecation/deprecation\r\n return !!(item as AbstractStatusBarCustomItem).isCustom; // eslint-disable-line deprecation/deprecation\r\n};\r\n\r\n/** Helper class to create Abstract StatusBar Item definitions.\r\n * @deprecated in 3.6. Use [StatusBarItemUtilities]($appui-react) instead.\r\n * @public\r\n */\r\nexport class AbstractStatusBarItemUtilities {\r\n /** Creates a StatusBar item to perform an action */\r\n public static createActionItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, tooltip: string | ConditionalStringValue, execute: () => void, overrides?: Partial<AbstractStatusBarCustomItem>): AbstractStatusBarActionItem => ({ // eslint-disable-line deprecation/deprecation\r\n id, section, itemPriority,\r\n icon, tooltip,\r\n execute,\r\n ...overrides,\r\n });\r\n\r\n /** Creates a StatusBar item to display a label */\r\n public static createLabelItem = (id: string, section: StatusBarSection, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, labelSide = StatusBarLabelSide.Right, overrides?: Partial<AbstractStatusBarLabelItem>): AbstractStatusBarLabelItem => ({ // eslint-disable-line deprecation/deprecation\r\n id, section, itemPriority,\r\n icon, label,\r\n labelSide,\r\n ...overrides,\r\n });\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBarItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItemsManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAOzE,MAAM,UAAU,GAAG,CAAI,IAAwB,EAAa,EAAE;IAC5D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AASF;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IAGhC,YAAY,KAA0C;QAF9C,WAAM,GAAuC,EAAE,CAAC;QAOxD;;WAE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,EAAE;oBAC7E,uBAAuB;oBACvB,IAAI,sBAAsB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACtD,cAAc,GAAG,IAAI,CAAC;iBACzB;aACF;YAED,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;IAClE,CAAC;IAEM,oBAAoB,CAAC,QAAqB;QAC/C,uBAAuB;QACvB,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI;YACrB,OAAO;QAET,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE/F,uBAAuB;QACvB,IAAI,YAAY;YACd,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;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 StatusBar\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { CommonStatusBarItem, StatusBarItemId } from \"./StatusBarItem\";\n\n/* eslint-disable deprecation/deprecation */\n\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\n\nconst isInstance = <T>(args: InstanceOrArray<T>): args is T => {\n return !Array.isArray(args);\n};\n\n/** Arguments of [[StatusBarItemsManager.onChanged]] event.\n * @internal\n */\nexport interface StatusBarItemsChangedArgs {\n readonly items: ReadonlyArray<CommonStatusBarItem>;\n}\n\n/**\n * Controls status bar items.\n * @internal\n */\nexport class StatusBarItemsManager {\n private _items: ReadonlyArray<CommonStatusBarItem> = [];\n\n constructor(items?: ReadonlyArray<CommonStatusBarItem>) {\n if (items)\n this.loadItemsInternal(items, true, false);\n }\n\n /** Event raised when StatusBar items are changed.\n * @internal\n */\n public readonly onItemsChanged = new BeEvent<(args: StatusBarItemsChangedArgs) => void>();\n\n private loadItemsInternal(items: ReadonlyArray<CommonStatusBarItem>, processConditions: boolean, sendItemChanged: boolean) {\n if (processConditions && items) {\n const eventIds = StatusBarItemsManager.getSyncIdsOfInterest(items);\n if (0 !== eventIds.length) {\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\n\n // istanbul ignore else\n if (itemsUpdated)\n items = updatedItems;\n }\n }\n\n this._items = items;\n if (sendItemChanged)\n this.onItemsChanged.raiseEvent({ items });\n }\n\n /** load items but do not fire onItemsChanged\n * @internal\n */\n public loadItems(items: ReadonlyArray<CommonStatusBarItem>) {\n this.loadItemsInternal(items, true, false);\n }\n\n /** Get an array of the StatusBar items */\n public get items(): ReadonlyArray<CommonStatusBarItem> {\n return this._items;\n }\n\n public set items(items: ReadonlyArray<CommonStatusBarItem>) {\n // istanbul ignore else\n if (items !== this._items)\n this.loadItemsInternal(items, true, true);\n }\n\n public add(itemOrItems: CommonStatusBarItem | ReadonlyArray<CommonStatusBarItem>) {\n let itemsToAdd;\n if (isInstance(itemOrItems))\n itemsToAdd = [itemOrItems];\n else {\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\n }\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\n if (itemsToAdd.length === 0)\n return;\n const items = [\n ...this._items,\n ...itemsToAdd,\n ];\n this.items = items;\n }\n\n /** Remove StatusBar items based on id */\n public remove(itemIdOrItemIds: StatusBarItemId | ReadonlyArray<StatusBarItemId\n >) {\n const items = this._items.filter((item) => {\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\n });\n this.items = items;\n }\n\n /** @internal */\n public removeAll() {\n this._items = [];\n }\n\n public static getSyncIdsOfInterest(items: readonly CommonStatusBarItem[]): string[] {\n const eventIds = new Set<string>();\n items.forEach((item) => {\n for (const [, entry] of Object.entries(item)) {\n if (entry instanceof ConditionalBooleanValue) {\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\n }\n }\n });\n return [...eventIds.values()];\n }\n\n private internalRefreshAffectedItems(items: readonly CommonStatusBarItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: CommonStatusBarItem[] } {\n // istanbul ignore next\n if (0 === eventIds.size)\n return { itemsUpdated: false, updatedItems: [] };\n\n let updateRequired = false;\n\n const newItems: CommonStatusBarItem[] = [];\n for (const item of items) {\n const updatedItem = { ...item };\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n // istanbul ignore else\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n updateRequired = true;\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\n // istanbul ignore else\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n updateRequired = true;\n }\n }\n\n newItems.push(updatedItem);\n }\n\n return { itemsUpdated: updateRequired, updatedItems: newItems };\n }\n\n public refreshAffectedItems(eventIds: Set<string>) {\n // istanbul ignore next\n if (0 === eventIds.size)\n return;\n\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\n\n // istanbul ignore else\n if (itemsUpdated)\n this.loadItemsInternal(updatedItems, false, true);\n }\n}\n"]}
1
+ {"version":3,"file":"StatusBarItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItemsManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;A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3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YAEhC,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBACnD,IAAI,KAAK,YAAY,uBAAuB,EAAE;oBAC5C,uBAAuB;oBACvB,IAAI,uBAAuB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACvD,cAAc,GAAG,IAAI,CAAC;iBACzB;qBAAM,0BAA0B,CAAC,IAAI,KAAK,YAAY,sBAAsB,EAAE;oBAC7E,uBAAuB;oBACvB,IAAI,sBAAsB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACtD,cAAc,GAAG,IAAI,CAAC;iBACzB;aACF;YAED,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;IAClE,CAAC;IAEM,oBAAoB,CAAC,QAAqB;QAC/C,uBAAuB;QACvB,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI;YACrB,OAAO;QAET,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE/F,uBAAuB;QACvB,IAAI,YAAY;YACd,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { CommonStatusBarItem, StatusBarItemId } from \"./StatusBarItem\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\r\n\r\nconst isInstance = <T>(args: InstanceOrArray<T>): args is T => {\r\n return !Array.isArray(args);\r\n};\r\n\r\n/** Arguments of [[StatusBarItemsManager.onChanged]] event.\r\n * @internal\r\n */\r\nexport interface StatusBarItemsChangedArgs {\r\n readonly items: ReadonlyArray<CommonStatusBarItem>;\r\n}\r\n\r\n/**\r\n * Controls status bar items.\r\n * @internal\r\n */\r\nexport class StatusBarItemsManager {\r\n private _items: ReadonlyArray<CommonStatusBarItem> = [];\r\n\r\n constructor(items?: ReadonlyArray<CommonStatusBarItem>) {\r\n if (items)\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Event raised when StatusBar items are changed.\r\n * @internal\r\n */\r\n public readonly onItemsChanged = new BeEvent<(args: StatusBarItemsChangedArgs) => void>();\r\n\r\n private loadItemsInternal(items: ReadonlyArray<CommonStatusBarItem>, processConditions: boolean, sendItemChanged: boolean) {\r\n if (processConditions && items) {\r\n const eventIds = StatusBarItemsManager.getSyncIdsOfInterest(items);\r\n if (0 !== eventIds.length) {\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n items = updatedItems;\r\n }\r\n }\r\n\r\n this._items = items;\r\n if (sendItemChanged)\r\n this.onItemsChanged.raiseEvent({ items });\r\n }\r\n\r\n /** load items but do not fire onItemsChanged\r\n * @internal\r\n */\r\n public loadItems(items: ReadonlyArray<CommonStatusBarItem>) {\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Get an array of the StatusBar items */\r\n public get items(): ReadonlyArray<CommonStatusBarItem> {\r\n return this._items;\r\n }\r\n\r\n public set items(items: ReadonlyArray<CommonStatusBarItem>) {\r\n // istanbul ignore else\r\n if (items !== this._items)\r\n this.loadItemsInternal(items, true, true);\r\n }\r\n\r\n public add(itemOrItems: CommonStatusBarItem | ReadonlyArray<CommonStatusBarItem>) {\r\n let itemsToAdd;\r\n if (isInstance(itemOrItems))\r\n itemsToAdd = [itemOrItems];\r\n else {\r\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\r\n }\r\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\r\n if (itemsToAdd.length === 0)\r\n return;\r\n const items = [\r\n ...this._items,\r\n ...itemsToAdd,\r\n ];\r\n this.items = items;\r\n }\r\n\r\n /** Remove StatusBar items based on id */\r\n public remove(itemIdOrItemIds: StatusBarItemId | ReadonlyArray<StatusBarItemId\r\n >) {\r\n const items = this._items.filter((item) => {\r\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\r\n });\r\n this.items = items;\r\n }\r\n\r\n /** @internal */\r\n public removeAll() {\r\n this._items = [];\r\n }\r\n\r\n public static getSyncIdsOfInterest(items: readonly CommonStatusBarItem[]): string[] {\r\n const eventIds = new Set<string>();\r\n items.forEach((item) => {\r\n for (const [, entry] of Object.entries(item)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n }\r\n }\r\n });\r\n return [...eventIds.values()];\r\n }\r\n\r\n private internalRefreshAffectedItems(items: readonly CommonStatusBarItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: CommonStatusBarItem[] } {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return { itemsUpdated: false, updatedItems: [] };\r\n\r\n let updateRequired = false;\r\n\r\n const newItems: CommonStatusBarItem[] = [];\r\n for (const item of items) {\r\n const updatedItem = { ...item };\r\n\r\n for (const [, entry] of Object.entries(updatedItem)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n // istanbul ignore else\r\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n // istanbul ignore else\r\n if (ConditionalStringValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n }\r\n }\r\n\r\n newItems.push(updatedItem);\r\n }\r\n\r\n return { itemsUpdated: updateRequired, updatedItems: newItems };\r\n }\r\n\r\n public refreshAffectedItems(eventIds: Set<string>) {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return;\r\n\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n this.loadItemsInternal(updatedItems, false, true);\r\n }\r\n}\r\n"]}
@@ -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,MAAa,oBAAoB;IAiB/B,+BAA+B;IACxB,MAAM,CAAC,cAAc,CAAC,IAAuB;QAClD,OAAQ,IAAqB,CAAC,OAAO,KAAK,SAAS,CAAC;IACtD,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,aAAa,CAAC,IAAuB;QACjD,OAAQ,IAAoB,CAAC,KAAK,KAAK,SAAS,CAAC;IACnD,CAAC;IAED,yCAAyC;IAClC,MAAM,CAAC,kBAAkB,CAAC,IAAuB;QACtD,OAAO,CAAC,CAAE,IAA+B,CAAC,QAAQ,CAAC;IACrD,CAAC;;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;SAfQ,oBAAoB","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 deprecation/deprecation\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>; // eslint-disable-line deprecation/deprecation\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\"]; // eslint-disable-line deprecation/deprecation\n\n/** Helper class to create Abstract StatusBar Item definitions.\n * @public\n */\nexport class ToolbarItemUtilities {\n /** Creates an Action Button */\n public static createActionButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton>): ActionButton => ({\n id, itemPriority,\n icon, label,\n execute,\n ...overrides,\n });\n\n /** Creates a Group button. */\n public static createGroupButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton>): GroupButton => ({\n id, itemPriority,\n icon, label,\n items,\n ...overrides,\n });\n\n /** ActionButton type guard. */\n public static isActionButton(item: CommonToolbarItem): item is ActionButton {\n return (item as ActionButton).execute !== undefined;\n }\n\n /** GroupButton type guard. */\n public static isGroupButton(item: CommonToolbarItem): item is GroupButton {\n return (item as GroupButton).items !== undefined;\n }\n\n /** CustomButtonDefinition type guard. */\n public static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition {\n return !!(item as CustomButtonDefinition).isCustom;\n }\n}\n"]}
1
+ {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItem.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAOH;;;GAGG;AACH,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,MAAa,oBAAoB;IAiB/B,+BAA+B;IACxB,MAAM,CAAC,cAAc,CAAC,IAAuB;QAClD,OAAQ,IAAqB,CAAC,OAAO,KAAK,SAAS,CAAC;IACtD,CAAC;IAED,8BAA8B;IACvB,MAAM,CAAC,aAAa,CAAC,IAAuB;QACjD,OAAQ,IAAoB,CAAC,KAAK,KAAK,SAAS,CAAC;IACnD,CAAC;IAED,yCAAyC;IAClC,MAAM,CAAC,kBAAkB,CAAC,IAAuB;QACtD,OAAO,CAAC,CAAE,IAA+B,CAAC,QAAQ,CAAC;IACrD,CAAC;;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;SAfQ,oBAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Toolbar\r\n */\r\n\r\nimport { BadgeType } from \"../items/BadgeType\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { ProvidedItem } from \"../items/ProvidedItem\";\r\n\r\n/** Used to specify the usage of the toolbar which determine the toolbar position.\r\n * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.\r\n * @public\r\n */\r\nexport enum ToolbarUsage {\r\n /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */\r\n ContentManipulation = 0,\r\n /** Manipulate view/camera - in ninezone this is in top right of content area. */\r\n ViewNavigation = 1,\r\n}\r\n\r\n/** Used to specify the orientation of the toolbar.\r\n * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.\r\n * @public\r\n */\r\nexport enum ToolbarOrientation {\r\n /** Horizontal toolbar. */\r\n Horizontal = 0,\r\n /** Vertical toolbar. */\r\n Vertical = 1,\r\n}\r\n\r\n/** Describes the data needed to insert a UI items into an existing set of UI items.\r\n * @public\r\n */\r\nexport interface ToolbarItem extends ProvidedItem { // eslint-disable-line deprecation/deprecation\r\n /** can be used by application to store miscellaneous data. */\r\n readonly applicationData?: any;\r\n /** Describes badge. Renders no badge if not specified. */\r\n readonly badgeType?: BadgeType;\r\n /** Optional description */\r\n readonly description?: string | ConditionalStringValue;\r\n /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\r\n readonly id: string;\r\n /** optional data to used by item implementor. */\r\n readonly internalData?: Map<string, any>;\r\n /** Defines if the item is active (shown with an active stripe/bar). */\r\n readonly isActive?: boolean;\r\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\r\n readonly isHidden?: boolean | ConditionalBooleanValue;\r\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\r\n readonly isDisabled?: boolean | ConditionalBooleanValue;\r\n /** Describes if the item should appear pressed (used for displaying toggle state). This property is NOT used by Toolbars\r\n * constructed using the `ToolbarWithOverflow` component, which are used in AppUi 2.0 and later. For these later toolbars\r\n * the icon is usually changed to denote the state of a toggle.\r\n */\r\n readonly isPressed?: boolean;\r\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\r\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\r\n * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.\r\n */\r\n readonly groupPriority?: number;\r\n /** Priority within a toolbar or group. */\r\n readonly itemPriority: number;\r\n /** Optional parent tool group to add tool. */\r\n readonly parentToolGroupId?: string;\r\n}\r\n\r\n/** Describes the data needed to insert an action button into a toolbar.\r\n * @public\r\n */\r\nexport interface ActionButton extends ToolbarItem {\r\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\r\n readonly icon: string | ConditionalStringValue;\r\n /** label, shown as tool tip on a button or an item label in a group. */\r\n readonly label: string | ConditionalStringValue;\r\n /** function to run when the button is pressed. */\r\n readonly execute: () => void;\r\n}\r\n\r\n/** Describes the data needed to insert a group button into a toolbar.\r\n * @public\r\n */\r\nexport interface GroupButton extends ToolbarItem {\r\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\r\n readonly icon: string | ConditionalStringValue;\r\n /** label, shown as tool tip on group button or a group button label in a group panel. */\r\n readonly label: string | ConditionalStringValue;\r\n /** label shown as the title in at top of group panel. */\r\n readonly panelLabel?: string | ConditionalStringValue;\r\n /** children of the group */\r\n readonly items: ReadonlyArray<ActionButton | GroupButton>; // eslint-disable-line deprecation/deprecation\r\n}\r\n\r\n/** Describes the data needed to insert a custom button into a toolbar.\r\n * @public\r\n */\r\nexport interface CustomButtonDefinition extends ToolbarItem {\r\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\r\n readonly icon?: string | ConditionalStringValue;\r\n /** label, shown as tool tip on group button or a group button label in a group panel. */\r\n readonly label?: string | ConditionalStringValue;\r\n /** parameter that marks data as being a custom definition. */\r\n readonly isCustom: true;\r\n}\r\n\r\n/** Any Button Type that can be inserted into a toolbar.\r\n * @public\r\n */\r\nexport type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;\r\n\r\n/** Type for Toolbar Item Id\r\n * @deprecated in 3.6. Please use `ToolbarItem[\"id\"]` from @itwin/appui-react.\r\n * @public\r\n */\r\nexport type ToolbarItemId = CommonToolbarItem[\"id\"]; // eslint-disable-line deprecation/deprecation\r\n\r\n/** Helper class to create Abstract StatusBar Item definitions.\r\n * @public\r\n */\r\nexport class ToolbarItemUtilities {\r\n /** Creates an Action Button */\r\n public static createActionButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton>): ActionButton => ({\r\n id, itemPriority,\r\n icon, label,\r\n execute,\r\n ...overrides,\r\n });\r\n\r\n /** Creates a Group button. */\r\n public static createGroupButton = (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton>): GroupButton => ({\r\n id, itemPriority,\r\n icon, label,\r\n items,\r\n ...overrides,\r\n });\r\n\r\n /** ActionButton type guard. */\r\n public static isActionButton(item: CommonToolbarItem): item is ActionButton {\r\n return (item as ActionButton).execute !== undefined;\r\n }\r\n\r\n /** GroupButton type guard. */\r\n public static isGroupButton(item: CommonToolbarItem): item is GroupButton {\r\n return (item as GroupButton).items !== undefined;\r\n }\r\n\r\n /** CustomButtonDefinition type guard. */\r\n public static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition {\r\n return !!(item as CustomButtonDefinition).isCustom;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItemsManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAA+D,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAMlH,MAAM,UAAU,GAAG,CAAI,IAAwB,EAAa,EAAE;IAC5D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AASF;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,KAAwC;QAF1C,WAAM,GAAqC,EAAE,CAAC;QAOxD;;WAEG;QACa,mBAAc,GAAG,IAAI,OAAO,EAA2C,CAAC;QAPtF,IAAI,KAAK;YACP,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC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Ae,CAAC,MAAc;QACnC,gDAAgD;QAChD,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC;YAC7C,OAAO;QAET,MAAM,QAAQ,GAAwB,EAAE,CAAC;QACzC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAC7B,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YAEhC,IAAI,oBAAoB,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE;gBACnD,WAAW,CAAC,KAAK,GAAG,mBAAmB,CAAC,+BAA+B,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;aAC9F;YAED,WAAW,CAAC,QAAQ,GAAG,CAAC,WAAW,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACxB,CAAC;CAEF","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 { BeEvent } from \"@itwin/core-bentley\";\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\nimport { ActionButton, CommonToolbarItem, GroupButton, ToolbarItemId, ToolbarItemUtilities } from \"./ToolbarItem\";\n\n/* eslint-disable deprecation/deprecation */\n\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\n\nconst isInstance = <T>(args: InstanceOrArray<T>): args is T => {\n return !Array.isArray(args);\n};\n\n/** Arguments of [[ToolbarItemsManager.onChanged]] event.\n * @internal\n */\nexport interface ToolbarItemsChangedArgs {\n readonly items: ReadonlyArray<CommonToolbarItem>;\n}\n\n/**\n * Controls status bar items.\n * @internal\n */\nexport class ToolbarItemsManager {\n protected _items: ReadonlyArray<CommonToolbarItem> = [];\n\n constructor(items?: ReadonlyArray<CommonToolbarItem>) {\n if (items)\n this.loadItemsInternal(items, true, false);\n }\n\n /** Event raised when Toolbar items are changed.\n * @internal\n */\n public readonly onItemsChanged = new BeEvent<(args: ToolbarItemsChangedArgs) => void>();\n\n private loadItemsInternal(items: ReadonlyArray<CommonToolbarItem>, processConditions: boolean, sendItemChanged: boolean) {\n if (processConditions && items) {\n const eventIds = ToolbarItemsManager.getSyncIdsOfInterest(items);\n if (0 !== eventIds.length) {\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\n\n // istanbul ignore else\n if (itemsUpdated)\n items = updatedItems;\n }\n }\n\n this._items = items;\n if (sendItemChanged)\n this.onItemsChanged.raiseEvent({ items });\n }\n\n /** load items but do not fire onItemsChanged\n * @internal\n */\n public loadItems(items: ReadonlyArray<CommonToolbarItem>) {\n this.loadItemsInternal(items, true, false);\n }\n\n /** Get an array of the Toolbar items */\n public get items(): ReadonlyArray<CommonToolbarItem> {\n return this._items;\n }\n\n public set items(items: ReadonlyArray<CommonToolbarItem>) {\n // istanbul ignore else\n if (items !== this._items)\n this.loadItemsInternal(items, true, true);\n }\n\n public add(itemOrItems: CommonToolbarItem | ReadonlyArray<CommonToolbarItem>) {\n let itemsToAdd;\n if (isInstance(itemOrItems))\n itemsToAdd = [itemOrItems];\n else {\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\n }\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\n if (itemsToAdd.length === 0)\n return;\n const items = [\n ...this._items,\n ...itemsToAdd,\n ];\n this.items = items;\n }\n\n /** Remove Toolbar items based on id */\n public remove(itemIdOrItemIds: ToolbarItemId | ReadonlyArray<ToolbarItemId\n >) {\n const items = this._items.filter((item) => {\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\n });\n this.items = items;\n }\n\n /** @internal */\n public removeAll() {\n this._items = [];\n }\n\n private static gatherSyncIds(eventIds: Set<string>, items: readonly CommonToolbarItem[]) {\n for (const item of items) {\n for (const [, entry] of Object.entries(item)) {\n if (entry instanceof ConditionalBooleanValue) {\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\n }\n }\n\n // istanbul ignore else\n if (ToolbarItemUtilities.isGroupButton(item)) {\n this.gatherSyncIds(eventIds, item.items);\n }\n }\n }\n\n public static getSyncIdsOfInterest(items: readonly CommonToolbarItem[]): string[] {\n const eventIds = new Set<string>();\n this.gatherSyncIds(eventIds, items);\n return [...eventIds.values()];\n }\n\n private static refreshChildItems(parentItem: GroupButton, eventIds: Set<string>): { childrenUpdated: boolean, childItems: ReadonlyArray<ActionButton | GroupButton> } {\n const updatedItems: Array<ActionButton | GroupButton> = [];\n let itemsUpdated = false;\n\n for (const item of parentItem.items) {\n const updatedItem = { ...item };\n\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\n const { childrenUpdated, childItems } = this.refreshChildItems(updatedItem, eventIds);\n // istanbul ignore else\n if (childrenUpdated) {\n updatedItem.items = childItems;\n itemsUpdated = true;\n }\n }\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n // istanbul ignore else\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n itemsUpdated = true;\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\n // istanbul ignore else\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n itemsUpdated = true;\n }\n }\n\n updatedItems.push(updatedItem);\n }\n return { childrenUpdated: itemsUpdated, childItems: updatedItems };\n }\n\n private internalRefreshAffectedItems(items: readonly CommonToolbarItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: CommonToolbarItem[] } {\n // istanbul ignore next\n if (0 === eventIds.size)\n return { itemsUpdated: false, updatedItems: [] };\n\n let updateRequired = false;\n\n const newItems: CommonToolbarItem[] = [];\n for (const item of items) {\n const updatedItem = { ...item };\n\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\n const { childrenUpdated, childItems } = ToolbarItemsManager.refreshChildItems(updatedItem, eventIds);\n // istanbul ignore else\n if (childrenUpdated) {\n updatedItem.items = childItems;\n updateRequired = true;\n }\n }\n\n for (const [, entry] of Object.entries(updatedItem)) {\n if (entry instanceof ConditionalBooleanValue) {\n // istanbul ignore else\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\n updateRequired = true;\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\n // istanbul ignore else\n if (ConditionalStringValue.refreshValue(entry, eventIds))\n updateRequired = true;\n }\n }\n\n newItems.push(updatedItem);\n }\n\n return { itemsUpdated: updateRequired, updatedItems: newItems };\n }\n\n public refreshAffectedItems(eventIds: Set<string>) {\n // istanbul ignore next\n if (0 === eventIds.size)\n return;\n\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\n\n // istanbul ignore else\n if (itemsUpdated)\n this.loadItemsInternal(updatedItems, false, true);\n }\n\n private static isActiveToolIdRefreshRequiredForChildren(children: ReadonlyArray<ActionButton | GroupButton>, toolId: string): boolean {\n for (const item of children) {\n if (ToolbarItemUtilities.isGroupButton(item)) {\n if (this.isActiveToolIdRefreshRequiredForChildren(item.items, toolId))\n return true;\n } else {\n const isActive = !!item.isActive;\n if ((isActive && item.id !== toolId) || (!isActive && item.id === toolId))\n return true;\n }\n }\n return false;\n }\n\n private isActiveToolIdRefreshRequired(toolId: string): boolean {\n for (const item of this.items) {\n if (ToolbarItemUtilities.isGroupButton(item)) {\n if (ToolbarItemsManager.isActiveToolIdRefreshRequiredForChildren(item.items, toolId))\n return true;\n } else {\n const isActive = !!item.isActive;\n if ((isActive && item.id !== toolId) || (!isActive && item.id === toolId))\n return true;\n }\n }\n\n return false;\n }\n\n private static refreshActiveToolIdInChildItems(parentItem: GroupButton, toolId: string): Array<ActionButton | GroupButton> {\n const newChildren: Array<ActionButton | GroupButton> = [];\n for (const item of parentItem.items) {\n const updatedItem = { ...item };\n\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\n updatedItem.items = ToolbarItemsManager.refreshActiveToolIdInChildItems(updatedItem, toolId);\n }\n\n updatedItem.isActive = (updatedItem.id === toolId);\n newChildren.push(updatedItem);\n }\n return newChildren;\n }\n\n public setActiveToolId(toolId: string) {\n // first see if any updates are really necessary\n if (!this.isActiveToolIdRefreshRequired(toolId))\n return;\n\n const newItems: CommonToolbarItem[] = [];\n for (const item of this.items) {\n const updatedItem = { ...item };\n\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\n updatedItem.items = ToolbarItemsManager.refreshActiveToolIdInChildItems(updatedItem, toolId);\n }\n\n updatedItem.isActive = (updatedItem.id === toolId);\n newItems.push(updatedItem);\n }\n\n this.items = newItems;\n }\n\n}\n"]}
1
+ {"version":3,"file":"ToolbarItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItemsManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAA+D,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAMlH,MAAM,UAAU,GAAG,CAAI,IAAwB,EAAa,EAAE;IAC5D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AASF;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,KAAwC;QAF1C,WAAM,GAAqC,EAA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AAG,CAAC,WAAW,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;YACnD,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC/B;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IAEM,eAAe,CAAC,MAAc;QACnC,gDAAgD;QAChD,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC;YAC7C,OAAO;QAET,MAAM,QAAQ,GAAwB,EAAE,CAAC;QACzC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAC7B,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YAEhC,IAAI,oBAAoB,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE;gBACnD,WAAW,CAAC,KAAK,GAAG,mBAAmB,CAAC,+BAA+B,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;aAC9F;YAED,WAAW,CAAC,QAAQ,GAAG,CAAC,WAAW,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACxB,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Toolbar\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { ActionButton, CommonToolbarItem, GroupButton, ToolbarItemId, ToolbarItemUtilities } from \"./ToolbarItem\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\r\n\r\nconst isInstance = <T>(args: InstanceOrArray<T>): args is T => {\r\n return !Array.isArray(args);\r\n};\r\n\r\n/** Arguments of [[ToolbarItemsManager.onChanged]] event.\r\n * @internal\r\n */\r\nexport interface ToolbarItemsChangedArgs {\r\n readonly items: ReadonlyArray<CommonToolbarItem>;\r\n}\r\n\r\n/**\r\n * Controls status bar items.\r\n * @internal\r\n */\r\nexport class ToolbarItemsManager {\r\n protected _items: ReadonlyArray<CommonToolbarItem> = [];\r\n\r\n constructor(items?: ReadonlyArray<CommonToolbarItem>) {\r\n if (items)\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Event raised when Toolbar items are changed.\r\n * @internal\r\n */\r\n public readonly onItemsChanged = new BeEvent<(args: ToolbarItemsChangedArgs) => void>();\r\n\r\n private loadItemsInternal(items: ReadonlyArray<CommonToolbarItem>, processConditions: boolean, sendItemChanged: boolean) {\r\n if (processConditions && items) {\r\n const eventIds = ToolbarItemsManager.getSyncIdsOfInterest(items);\r\n if (0 !== eventIds.length) {\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n items = updatedItems;\r\n }\r\n }\r\n\r\n this._items = items;\r\n if (sendItemChanged)\r\n this.onItemsChanged.raiseEvent({ items });\r\n }\r\n\r\n /** load items but do not fire onItemsChanged\r\n * @internal\r\n */\r\n public loadItems(items: ReadonlyArray<CommonToolbarItem>) {\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Get an array of the Toolbar items */\r\n public get items(): ReadonlyArray<CommonToolbarItem> {\r\n return this._items;\r\n }\r\n\r\n public set items(items: ReadonlyArray<CommonToolbarItem>) {\r\n // istanbul ignore else\r\n if (items !== this._items)\r\n this.loadItemsInternal(items, true, true);\r\n }\r\n\r\n public add(itemOrItems: CommonToolbarItem | ReadonlyArray<CommonToolbarItem>) {\r\n let itemsToAdd;\r\n if (isInstance(itemOrItems))\r\n itemsToAdd = [itemOrItems];\r\n else {\r\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\r\n }\r\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\r\n if (itemsToAdd.length === 0)\r\n return;\r\n const items = [\r\n ...this._items,\r\n ...itemsToAdd,\r\n ];\r\n this.items = items;\r\n }\r\n\r\n /** Remove Toolbar items based on id */\r\n public remove(itemIdOrItemIds: ToolbarItemId | ReadonlyArray<ToolbarItemId\r\n >) {\r\n const items = this._items.filter((item) => {\r\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\r\n });\r\n this.items = items;\r\n }\r\n\r\n /** @internal */\r\n public removeAll() {\r\n this._items = [];\r\n }\r\n\r\n private static gatherSyncIds(eventIds: Set<string>, items: readonly CommonToolbarItem[]) {\r\n for (const item of items) {\r\n for (const [, entry] of Object.entries(item)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n }\r\n }\r\n\r\n // istanbul ignore else\r\n if (ToolbarItemUtilities.isGroupButton(item)) {\r\n this.gatherSyncIds(eventIds, item.items);\r\n }\r\n }\r\n }\r\n\r\n public static getSyncIdsOfInterest(items: readonly CommonToolbarItem[]): string[] {\r\n const eventIds = new Set<string>();\r\n this.gatherSyncIds(eventIds, items);\r\n return [...eventIds.values()];\r\n }\r\n\r\n private static refreshChildItems(parentItem: GroupButton, eventIds: Set<string>): { childrenUpdated: boolean, childItems: ReadonlyArray<ActionButton | GroupButton> } {\r\n const updatedItems: Array<ActionButton | GroupButton> = [];\r\n let itemsUpdated = false;\r\n\r\n for (const item of parentItem.items) {\r\n const updatedItem = { ...item };\r\n\r\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\r\n const { childrenUpdated, childItems } = this.refreshChildItems(updatedItem, eventIds);\r\n // istanbul ignore else\r\n if (childrenUpdated) {\r\n updatedItem.items = childItems;\r\n itemsUpdated = true;\r\n }\r\n }\r\n\r\n for (const [, entry] of Object.entries(updatedItem)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n // istanbul ignore else\r\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\r\n itemsUpdated = true;\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n // istanbul ignore else\r\n if (ConditionalStringValue.refreshValue(entry, eventIds))\r\n itemsUpdated = true;\r\n }\r\n }\r\n\r\n updatedItems.push(updatedItem);\r\n }\r\n return { childrenUpdated: itemsUpdated, childItems: updatedItems };\r\n }\r\n\r\n private internalRefreshAffectedItems(items: readonly CommonToolbarItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: CommonToolbarItem[] } {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return { itemsUpdated: false, updatedItems: [] };\r\n\r\n let updateRequired = false;\r\n\r\n const newItems: CommonToolbarItem[] = [];\r\n for (const item of items) {\r\n const updatedItem = { ...item };\r\n\r\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\r\n const { childrenUpdated, childItems } = ToolbarItemsManager.refreshChildItems(updatedItem, eventIds);\r\n // istanbul ignore else\r\n if (childrenUpdated) {\r\n updatedItem.items = childItems;\r\n updateRequired = true;\r\n }\r\n }\r\n\r\n for (const [, entry] of Object.entries(updatedItem)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n // istanbul ignore else\r\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n // istanbul ignore else\r\n if (ConditionalStringValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n }\r\n }\r\n\r\n newItems.push(updatedItem);\r\n }\r\n\r\n return { itemsUpdated: updateRequired, updatedItems: newItems };\r\n }\r\n\r\n public refreshAffectedItems(eventIds: Set<string>) {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return;\r\n\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n this.loadItemsInternal(updatedItems, false, true);\r\n }\r\n\r\n private static isActiveToolIdRefreshRequiredForChildren(children: ReadonlyArray<ActionButton | GroupButton>, toolId: string): boolean {\r\n for (const item of children) {\r\n if (ToolbarItemUtilities.isGroupButton(item)) {\r\n if (this.isActiveToolIdRefreshRequiredForChildren(item.items, toolId))\r\n return true;\r\n } else {\r\n const isActive = !!item.isActive;\r\n if ((isActive && item.id !== toolId) || (!isActive && item.id === toolId))\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n private isActiveToolIdRefreshRequired(toolId: string): boolean {\r\n for (const item of this.items) {\r\n if (ToolbarItemUtilities.isGroupButton(item)) {\r\n if (ToolbarItemsManager.isActiveToolIdRefreshRequiredForChildren(item.items, toolId))\r\n return true;\r\n } else {\r\n const isActive = !!item.isActive;\r\n if ((isActive && item.id !== toolId) || (!isActive && item.id === toolId))\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private static refreshActiveToolIdInChildItems(parentItem: GroupButton, toolId: string): Array<ActionButton | GroupButton> {\r\n const newChildren: Array<ActionButton | GroupButton> = [];\r\n for (const item of parentItem.items) {\r\n const updatedItem = { ...item };\r\n\r\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\r\n updatedItem.items = ToolbarItemsManager.refreshActiveToolIdInChildItems(updatedItem, toolId);\r\n }\r\n\r\n updatedItem.isActive = (updatedItem.id === toolId);\r\n newChildren.push(updatedItem);\r\n }\r\n return newChildren;\r\n }\r\n\r\n public setActiveToolId(toolId: string) {\r\n // first see if any updates are really necessary\r\n if (!this.isActiveToolIdRefreshRequired(toolId))\r\n return;\r\n\r\n const newItems: CommonToolbarItem[] = [];\r\n for (const item of this.items) {\r\n const updatedItem = { ...item };\r\n\r\n if (ToolbarItemUtilities.isGroupButton(updatedItem)) {\r\n updatedItem.items = ToolbarItemsManager.refreshActiveToolIdInChildItems(updatedItem, toolId);\r\n }\r\n\r\n updatedItem.isActive = (updatedItem.id === toolId);\r\n newItems.push(updatedItem);\r\n }\r\n\r\n this.items = newItems;\r\n }\r\n\r\n}\r\n"]}
@@ -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,4CAA4C;AAE5C;;GAEG;AACH,MAAa,iBAAiB;IAK5B;;;MAGE;IACK,MAAM,CAAC,iBAAiB,CAAC,MAAc;QAC5C,OAAO,GAAG,iBAAiB,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC;IACpD,CAAC;IACD;;MAEE;IACK,MAAM,CAAC,0BAA0B,CAAC,SAAiB;QACxD,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACjE,CAAC;IAED;;;MAGE;IACK,MAAM,CAAC,YAAY,CAAC,QAAgB;QACzC,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5E,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC1B;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;YACtF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC;IAEnB,CAAC;;AAxCD,+DAA+D;AACxC,4BAAU,GAAG,MAAM,CAAC;AACpB,sCAAoB,GAAG,SAAS,CAAC;SAH7C,iBAAiB","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 deprecation/deprecation */\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,4CAA4C;AAE5C;;GAEG;AACH,MAAa,iBAAiB;IAK5B;;;MAGE;IACK,MAAM,CAAC,iBAAiB,CAAC,MAAc;QAC5C,OAAO,GAAG,iBAAiB,CAAC,UAAU,GAAG,MAAM,EAAE,CAAC;IACpD,CAAC;IACD;;MAEE;IACK,MAAM,CAAC,0BAA0B,CAAC,SAAiB;QACxD,OAAO,GAAG,iBAAiB,CAAC,oBAAoB,GAAG,SAAS,EAAE,CAAC;IACjE,CAAC;IAED;;;MAGE;IACK,MAAM,CAAC,YAAY,CAAC,QAAgB;QACzC,IAAI,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5E,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC1B;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;YACtF,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC;IAEnB,CAAC;;AAxCD,+DAA+D;AACxC,4BAAU,GAAG,MAAM,CAAC;AACpB,sCAAoB,GAAG,SAAS,CAAC;SAH7C,iBAAiB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\n/** Creates an IconSpec with an SVG source and gets the SVG source from an IconSpec.\r\n * @public @deprecated in 4.3. AppUI libraries >= 4.7.x support loading SVGs sources without prefixes, eliminating the need for these utilities.\r\n */\r\nexport class IconSpecUtilities {\r\n /** Prefix for an SVG IconSpec loaded with the Sprite loader */\r\n public static readonly SVG_PREFIX = \"svg:\";\r\n public static readonly WEB_COMPONENT_PREFIX = \"webSvg:\";\r\n\r\n /** Create an IconSpec for an SVG loaded into web component with sprite loader\r\n * This method is deprecated -- use createWebComponentIconSpec()\r\n * @public @deprecated in 3.2. Please avoid using the Sprite loader and use IconSpecUtilities.createWebComponentIconSpec() instead.\r\n */\r\n public static createSvgIconSpec(svgSrc: string): string {\r\n return `${IconSpecUtilities.SVG_PREFIX}${svgSrc}`;\r\n }\r\n /** Create an IconSpec for an SVG loaded into web component with svg-loader\r\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\r\n */\r\n public static createWebComponentIconSpec(srcString: string): string {\r\n return `${IconSpecUtilities.WEB_COMPONENT_PREFIX}${srcString}`;\r\n }\r\n\r\n /** Get the SVG Source from an sprite IconSpec\r\n * This method is deprecated -- use getWebComponentSource()\r\n * @public @deprecated in 3.2. avoid using the Sprite loader and use IconSpecUtilities.getWebComponentSource() instead.\r\n */\r\n public static getSvgSource(iconSpec: string): string | undefined {\r\n if (iconSpec.startsWith(IconSpecUtilities.SVG_PREFIX) && iconSpec.length > 4) {\r\n return iconSpec.slice(4);\r\n }\r\n\r\n return undefined;\r\n }\r\n /** Get the SVG Source from an svg-loader IconSpec\r\n * @public @deprecated in 4.3. AppUI libraries > 4.7.x support loading SVGs sources without prefixes, eliminating the need for this utility.\r\n */\r\n\r\n public static getWebComponentSource(iconSpec: string): string | undefined {\r\n if (iconSpec.startsWith(IconSpecUtilities.WEB_COMPONENT_PREFIX) && iconSpec.length > 7) {\r\n return iconSpec.slice(7);\r\n }\r\n\r\n return undefined;\r\n\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PointProps.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/PointProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\n/** Describes 2d points.\n * @public @deprecated in 4.2.x. Use @core/geometry [[Geometry.XAndY]] or your own custom type.\n */\nexport interface PointProps {\n readonly x: number;\n readonly y: number;\n}\n"]}
1
+ {"version":3,"file":"PointProps.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/PointProps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n/** Describes 2d points.\r\n * @public @deprecated in 4.2.x. Use @core/geometry [[Geometry.XAndY]] or your own custom type.\r\n */\r\nexport interface PointProps {\r\n readonly x: number;\r\n readonly y: number;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UiError.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAuB,MAAM,qBAAqB,CAAC;AAEvF;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,YAAY;IAEvC,6CAA6C;IAC7C,YAA0B,QAAgB,EAAE,OAAe,EAAE,cAAsB,aAAa,CAAC,KAAK,EAAE,WAAiC;QACvI,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QADjB,aAAQ,GAAR,QAAQ,CAAQ;IAE1C,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 Utilities\n */\n\nimport { BentleyError, BentleyStatus, GetMetaDataFunction } from \"@itwin/core-bentley\";\n\n/** iTwin.js UI UiError class is a subclass of BentleyError. Errors are logged.\n * @public @deprecated in 4.3. Use [[Bentley.BentleyError]] instead.\n */\nexport class UiError extends BentleyError {\n\n /** Constructs UiError using BentleyError. */\n public constructor(public category: string, message: string, errorNumber: number = BentleyStatus.ERROR, getMetaData?: GetMetaDataFunction) {\n super(errorNumber, message, getMetaData);\n }\n}\n"]}
1
+ {"version":3,"file":"UiError.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiError.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAuB,MAAM,qBAAqB,CAAC;AAEvF;;GAEG;AACH,MAAM,OAAO,OAAQ,SAAQ,YAAY;IAEvC,6CAA6C;IAC7C,YAA0B,QAAgB,EAAE,OAAe,EAAE,cAAsB,aAAa,CAAC,KAAK,EAAE,WAAiC;QACvI,KAAK,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QADjB,aAAQ,GAAR,QAAQ,CAAQ;IAE1C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport { BentleyError, BentleyStatus, GetMetaDataFunction } from \"@itwin/core-bentley\";\r\n\r\n/** iTwin.js UI UiError class is a subclass of BentleyError. Errors are logged.\r\n * @public @deprecated in 4.3. Use [[Bentley.BentleyError]] instead.\r\n */\r\nexport class UiError extends BentleyError {\r\n\r\n /** Constructs UiError using BentleyError. */\r\n public constructor(public category: string, message: string, errorNumber: number = BentleyStatus.ERROR, getMetaData?: GetMetaDataFunction) {\r\n super(errorNumber, message, getMetaData);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UiEvent.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiEvent.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,OAAoB,SAAQ,SAAqB;CAAI","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\nimport { BeUiEvent } from \"@itwin/core-bentley\";\n\n/** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.\n * @public\n * @deprecated in 4.2. This type is a duplicate of [[BeUiEvent]], which should be used instead.\n */\nexport class UiEvent<TEventArgs> extends BeUiEvent<TEventArgs> { }\n"]}
1
+ {"version":3,"file":"UiEvent.js","sourceRoot":"","sources":["../../../../src/appui-abstract/utils/UiEvent.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;GAGG;AACH,MAAM,OAAO,OAAoB,SAAQ,SAAqB;CAAI","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\n\r\n/** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.\r\n * @public\r\n * @deprecated in 4.2. This type is a duplicate of [[BeUiEvent]], which should be used instead.\r\n */\r\nexport class UiEvent<TEventArgs> extends BeUiEvent<TEventArgs> { }\r\n"]}