@itwin/components-react 3.0.0-dev.72 → 3.0.0-dev.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/lib/components-react/UiComponents.d.ts +10 -10
  2. package/lib/components-react/UiComponents.d.ts.map +1 -1
  3. package/lib/components-react/UiComponents.js +18 -18
  4. package/lib/components-react/UiComponents.js.map +1 -1
  5. package/lib/components-react/common/HighlightedText.d.ts +2 -2
  6. package/lib/components-react/common/HighlightedText.js +1 -1
  7. package/lib/components-react/common/HighlightedText.js.map +1 -1
  8. package/lib/components-react/common/HighlightingComponentProps.d.ts +2 -2
  9. package/lib/components-react/common/HighlightingComponentProps.js.map +1 -1
  10. package/lib/components-react/common/UseAsyncValue.d.ts +1 -1
  11. package/lib/components-react/common/UseAsyncValue.js +1 -1
  12. package/lib/components-react/common/UseAsyncValue.js.map +1 -1
  13. package/lib/components-react/datepicker/DatePicker.js +28 -28
  14. package/lib/components-react/datepicker/DatePicker.js.map +1 -1
  15. package/lib/components-react/editors/BooleanEditor.d.ts +2 -2
  16. package/lib/components-react/editors/BooleanEditor.js +2 -2
  17. package/lib/components-react/editors/BooleanEditor.js.map +1 -1
  18. package/lib/components-react/editors/EnumButtonGroupEditor.d.ts +2 -2
  19. package/lib/components-react/editors/EnumButtonGroupEditor.js +2 -2
  20. package/lib/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
  21. package/lib/components-react/editors/EnumEditor.d.ts +2 -2
  22. package/lib/components-react/editors/EnumEditor.js +2 -2
  23. package/lib/components-react/editors/EnumEditor.js.map +1 -1
  24. package/lib/components-react/editors/ImageCheckBoxEditor.d.ts +2 -2
  25. package/lib/components-react/editors/ImageCheckBoxEditor.js +2 -2
  26. package/lib/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
  27. package/lib/components-react/editors/NumericInputEditor.d.ts +2 -2
  28. package/lib/components-react/editors/NumericInputEditor.js +2 -2
  29. package/lib/components-react/editors/NumericInputEditor.js.map +1 -1
  30. package/lib/components-react/editors/PropertyEditorManager.d.ts +7 -7
  31. package/lib/components-react/editors/PropertyEditorManager.js +4 -4
  32. package/lib/components-react/editors/PropertyEditorManager.js.map +1 -1
  33. package/lib/components-react/editors/SliderEditor.d.ts +2 -2
  34. package/lib/components-react/editors/SliderEditor.js +2 -2
  35. package/lib/components-react/editors/SliderEditor.js.map +1 -1
  36. package/lib/components-react/editors/TextEditor.d.ts +1 -1
  37. package/lib/components-react/editors/TextEditor.js +1 -1
  38. package/lib/components-react/editors/TextEditor.js.map +1 -1
  39. package/lib/components-react/editors/TextareaEditor.d.ts +2 -2
  40. package/lib/components-react/editors/TextareaEditor.js +2 -2
  41. package/lib/components-react/editors/TextareaEditor.js.map +1 -1
  42. package/lib/components-react/editors/ThemedEnumEditor.d.ts +3 -3
  43. package/lib/components-react/editors/ThemedEnumEditor.d.ts.map +1 -1
  44. package/lib/components-react/editors/ThemedEnumEditor.js +3 -2
  45. package/lib/components-react/editors/ThemedEnumEditor.js.map +1 -1
  46. package/lib/components-react/editors/ToggleEditor.d.ts +2 -2
  47. package/lib/components-react/editors/ToggleEditor.js +2 -2
  48. package/lib/components-react/editors/ToggleEditor.js.map +1 -1
  49. package/lib/components-react/favorite/FavoritePropertiesRenderer.d.ts +1 -1
  50. package/lib/components-react/favorite/FavoritePropertiesRenderer.js +1 -1
  51. package/lib/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
  52. package/lib/components-react/filtering/FilteringInput.d.ts +1 -2
  53. package/lib/components-react/filtering/FilteringInput.d.ts.map +1 -1
  54. package/lib/components-react/filtering/FilteringInput.js +1 -1
  55. package/lib/components-react/filtering/FilteringInput.js.map +1 -1
  56. package/lib/components-react/inputs/ParsedInput.d.ts +2 -2
  57. package/lib/components-react/inputs/ParsedInput.js +1 -1
  58. package/lib/components-react/inputs/ParsedInput.js.map +1 -1
  59. package/lib/components-react/properties/renderers/ActionButtonList.d.ts +2 -2
  60. package/lib/components-react/properties/renderers/ActionButtonList.js +1 -1
  61. package/lib/components-react/properties/renderers/ActionButtonList.js.map +1 -1
  62. package/lib/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +0 -1
  63. package/lib/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
  64. package/lib/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  65. package/lib/components-react/properties/renderers/PropertyRenderer.d.ts +5 -10
  66. package/lib/components-react/properties/renderers/PropertyRenderer.d.ts.map +1 -1
  67. package/lib/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
  68. package/lib/components-react/properties/renderers/label/PropertyLabelRenderer.d.ts +1 -3
  69. package/lib/components-react/properties/renderers/label/PropertyLabelRenderer.d.ts.map +1 -1
  70. package/lib/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  71. package/lib/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.d.ts +1 -1
  72. package/lib/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +1 -1
  73. package/lib/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  74. package/lib/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +1 -1
  75. package/lib/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  76. package/lib/components-react/propertygrid/PropertyDataProvider.d.ts +1 -3
  77. package/lib/components-react/propertygrid/PropertyDataProvider.d.ts.map +1 -1
  78. package/lib/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  79. package/lib/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +1 -3
  80. package/lib/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
  81. package/lib/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  82. package/lib/components-react/propertygrid/component/PropertyGridCommons.d.ts +0 -2
  83. package/lib/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
  84. package/lib/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  85. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts +13 -4
  86. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts.map +1 -1
  87. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js +9 -2
  88. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  89. package/lib/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.d.ts +2 -2
  90. package/lib/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  91. package/lib/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  92. package/lib/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.d.ts +1 -1
  93. package/lib/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +1 -1
  94. package/lib/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  95. package/lib/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.d.ts +1 -1
  96. package/lib/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js +1 -1
  97. package/lib/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
  98. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.d.ts +1 -1
  99. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js +1 -1
  100. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
  101. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.d.ts +17 -14
  102. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.d.ts.map +1 -1
  103. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js +10 -8
  104. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
  105. package/lib/components-react/propertygrid/internal/PropertyGridHooks.d.ts +4 -4
  106. package/lib/components-react/propertygrid/internal/PropertyGridHooks.js +5 -5
  107. package/lib/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  108. package/lib/components-react/selectable-content/SelectableContent.d.ts +5 -5
  109. package/lib/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
  110. package/lib/components-react/selectable-content/SelectableContent.js +3 -2
  111. package/lib/components-react/selectable-content/SelectableContent.js.map +1 -1
  112. package/lib/components-react/table/SimpleTableDataProvider.d.ts +2 -2
  113. package/lib/components-react/table/SimpleTableDataProvider.js +2 -2
  114. package/lib/components-react/table/SimpleTableDataProvider.js.map +1 -1
  115. package/lib/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.d.ts.map +1 -1
  116. package/lib/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.js +1 -0
  117. package/lib/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.js.map +1 -1
  118. package/lib/components-react/table/component/Table.d.ts +4 -7
  119. package/lib/components-react/table/component/Table.d.ts.map +1 -1
  120. package/lib/components-react/table/component/Table.js.map +1 -1
  121. package/lib/components-react/toolbar/Item.d.ts +2 -2
  122. package/lib/components-react/toolbar/Item.js +1 -1
  123. package/lib/components-react/toolbar/Item.js.map +1 -1
  124. package/lib/components-react/toolbar/PopupItem.d.ts +2 -2
  125. package/lib/components-react/toolbar/PopupItem.js +1 -1
  126. package/lib/components-react/toolbar/PopupItem.js.map +1 -1
  127. package/lib/components-react/toolbar/PopupItemWithDrag.d.ts +2 -2
  128. package/lib/components-react/toolbar/PopupItemWithDrag.js +1 -1
  129. package/lib/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  130. package/lib/components-react/toolbar/Toolbar.d.ts +2 -2
  131. package/lib/components-react/toolbar/Toolbar.js +1 -1
  132. package/lib/components-react/toolbar/Toolbar.js.map +1 -1
  133. package/lib/components-react/toolbar/ToolbarWithOverflow.d.ts +6 -6
  134. package/lib/components-react/toolbar/ToolbarWithOverflow.js +3 -3
  135. package/lib/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  136. package/lib/components-react/toolbar/utilities/Direction.d.ts +1 -1
  137. package/lib/components-react/toolbar/utilities/Direction.js +1 -1
  138. package/lib/components-react/toolbar/utilities/Direction.js.map +1 -1
  139. package/lib/components-react/tree/HighlightingEngine.d.ts +1 -1
  140. package/lib/components-react/tree/HighlightingEngine.js +1 -1
  141. package/lib/components-react/tree/HighlightingEngine.js.map +1 -1
  142. package/lib/components-react/tree/TreeDataProvider.d.ts +1 -1
  143. package/lib/components-react/tree/TreeDataProvider.js.map +1 -1
  144. package/lib/components-react/tree/controlled/TreeHooks.d.ts +3 -4
  145. package/lib/components-react/tree/controlled/TreeHooks.d.ts.map +1 -1
  146. package/lib/components-react/tree/controlled/TreeHooks.js +3 -4
  147. package/lib/components-react/tree/controlled/TreeHooks.js.map +1 -1
  148. package/lib/components-react/tree/controlled/component/ControlledTree.d.ts +1 -1
  149. package/lib/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  150. package/lib/components-react/tree/controlled/component/TreeNodeEditor.d.ts +9 -6
  151. package/lib/components-react/tree/controlled/component/TreeNodeEditor.d.ts.map +1 -1
  152. package/lib/components-react/tree/controlled/component/TreeNodeEditor.js +3 -2
  153. package/lib/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
  154. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +12 -16
  155. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
  156. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.js +1 -1
  157. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
  158. package/lib/components-react/tree/controlled/component/TreeRenderer.d.ts +5 -54
  159. package/lib/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
  160. package/lib/components-react/tree/controlled/component/TreeRenderer.js +13 -28
  161. package/lib/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  162. package/lib/public/locales/en/UiComponents.json +1 -8
  163. package/package.json +16 -15
@@ -34,7 +34,7 @@ require("./Item.scss");
34
34
  const classnames_1 = __importDefault(require("classnames"));
35
35
  const React = __importStar(require("react"));
36
36
  /** Toolbar item component. Used in [[Toolbar]] component.
37
- * @beta
37
+ * @public
38
38
  */
39
39
  // eslint-disable-next-line react/display-name
40
40
  exports.ToolbarButtonItem = React.memo((props) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAqB;AACrB,4DAAoC;AACpC,6CAA+B;AAyB/B;;GAEG;AACH,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,KAAK,CAAC,IAAI,CACzC,CAAC,KAA6B,EAAE,EAAE;IAChC,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,gCAAgC,EAChC,KAAK,CAAC,QAAQ,IAAI,mBAAmB,EACrC,KAAK,CAAC,UAAU,IAAI,qBAAqB,EACzC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnB,OAAO,CACL,gDACgB,KAAK,CAAC,MAAM,oBACX,aAAa,EAC5B,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAElB,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,KAAK,CAAC,IAAI,CACP;QACL,KAAK,CAAC,KAAK;YACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR,CAED,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport \"./Item.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { CommonProps } from \"@itwin/core-react\";\n\n/** Properties of [[ToolbarButtonItem]] component.\n * @beta\n */\nexport interface ToolbarButtonItemProps extends CommonProps {\n /** button icon. */\n icon?: React.ReactNode;\n /** Describes if item is active. */\n isActive?: boolean;\n /** Describes if the item is disabled. */\n isDisabled?: boolean;\n /** Function called when the item is clicked. */\n onClick?: () => void;\n /** Function called when a key is pressed. */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n /** Title for the item. */\n title: string;\n /** A badge to draw. */\n badge?: React.ReactNode;\n /** If true add a gap before button. Default to false. */\n addGroupSeparator?: boolean;\n}\n\n/** Toolbar item component. Used in [[Toolbar]] component.\n * @beta\n */\n// eslint-disable-next-line react/display-name\nexport const ToolbarButtonItem = React.memo<React.FC<ToolbarButtonItemProps>>(\n (props: ToolbarButtonItemProps) => {\n const className = classnames(\n \"components-toolbar-button-item\",\n props.isActive && \"components-active\",\n props.isDisabled && \"components-disabled\",\n props.className);\n\n return (\n <button\n data-item-id={props.itemId}\n data-item-type=\"tool-button\"\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\n onClick={props.onClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={props.title}\n >\n <div className=\"components-icon\">\n {props.icon}\n </div>\n {props.badge &&\n <div className=\"components-badge\">\n {props.badge}\n </div>\n }\n </button>\n );\n });\n"]}
1
+ {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/Item.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uBAAqB;AACrB,4DAAoC;AACpC,6CAA+B;AAyB/B;;GAEG;AACH,8CAA8C;AACjC,QAAA,iBAAiB,GAAG,KAAK,CAAC,IAAI,CACzC,CAAC,KAA6B,EAAE,EAAE;IAChC,MAAM,SAAS,GAAG,IAAA,oBAAU,EAC1B,gCAAgC,EAChC,KAAK,CAAC,QAAQ,IAAI,mBAAmB,EACrC,KAAK,CAAC,UAAU,IAAI,qBAAqB,EACzC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnB,OAAO,CACL,gDACgB,KAAK,CAAC,MAAM,oBACX,aAAa,EAC5B,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAElB,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,KAAK,CAAC,IAAI,CACP;QACL,KAAK,CAAC,KAAK;YACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR,CAED,CACV,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport \"./Item.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { CommonProps } from \"@itwin/core-react\";\n\n/** Properties of [[ToolbarButtonItem]] component.\n * @public\n */\nexport interface ToolbarButtonItemProps extends CommonProps {\n /** button icon. */\n icon?: React.ReactNode;\n /** Describes if item is active. */\n isActive?: boolean;\n /** Describes if the item is disabled. */\n isDisabled?: boolean;\n /** Function called when the item is clicked. */\n onClick?: () => void;\n /** Function called when a key is pressed. */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n /** Title for the item. */\n title: string;\n /** A badge to draw. */\n badge?: React.ReactNode;\n /** If true add a gap before button. Default to false. */\n addGroupSeparator?: boolean;\n}\n\n/** Toolbar item component. Used in [[Toolbar]] component.\n * @public\n */\n// eslint-disable-next-line react/display-name\nexport const ToolbarButtonItem = React.memo<React.FC<ToolbarButtonItemProps>>(\n (props: ToolbarButtonItemProps) => {\n const className = classnames(\n \"components-toolbar-button-item\",\n props.isActive && \"components-active\",\n props.isDisabled && \"components-disabled\",\n props.className);\n\n return (\n <button\n data-item-id={props.itemId}\n data-item-type=\"tool-button\"\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\n onClick={props.onClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={props.title}\n >\n <div className=\"components-icon\">\n {props.icon}\n </div>\n {props.badge &&\n <div className=\"components-badge\">\n {props.badge}\n </div>\n }\n </button>\n );\n });\n"]}
@@ -21,7 +21,7 @@ export declare const ToolbarPopupContext: React.Context<ToolbarPopupContextProps
21
21
  */
22
22
  export declare function useToolbarPopupContext(): ToolbarPopupContextProps;
23
23
  /** Properties of [[PopupItem]] component.
24
- * @beta
24
+ * @public
25
25
  */
26
26
  export interface PopupItemProps extends ToolbarButtonItemProps {
27
27
  /** Describes if expandable item triangle indicator should be hidden. */
@@ -30,7 +30,7 @@ export interface PopupItemProps extends ToolbarButtonItemProps {
30
30
  panel?: React.ReactNode;
31
31
  }
32
32
  /** Popup toolbar item that displays a panel
33
- * @beta
33
+ * @public
34
34
  */
35
35
  export declare function PopupItem(props: PopupItemProps): JSX.Element;
36
36
  /** @internal */
@@ -56,7 +56,7 @@ function useToolbarPopupContext() {
56
56
  }
57
57
  exports.useToolbarPopupContext = useToolbarPopupContext;
58
58
  /** Popup toolbar item that displays a panel
59
- * @beta
59
+ * @public
60
60
  */
61
61
  function PopupItem(props) {
62
62
  const [isPanelShown, setPanelShown] = React.useState(false);
@@ -1 +1 @@
1
- {"version":3,"file":"PopupItem.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/PopupItem.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F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AAK,CACR;YAEP,aAAa,CAAC,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CACxF;QACT,oBAAC,cAAc,IACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,IAAA,kDAA8B,EAAC,kBAAkB,EAAE,cAAc,CAAC,EAC5E,MAAM,EAAE,MAAM,IAEb,KAAK,CACS,CACY,CAChC,CAAC;AACJ,CAAC;AArED,8BAqEC;AAWD,gBAAgB;AAChB,SAAgB,cAAc,CAAC,KAA0B;IACvD,OAAO,oBAAC,kBAAK,kBACX,SAAS,EAAC,6CAA6C,EACvD,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,IACb,KAAK,EACT,CAAC;AACL,CAAC;AAPD,wCAOC","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 \"./PopupItem.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ActionButton, RelativePosition } from \"@itwin/appui-abstract\";\nimport { Popup, useRefState } from \"@itwin/core-react\";\nimport { ToolbarButtonItemProps } from \"./Item\";\nimport { useToolbarWithOverflowDirectionContext, useToolItemEntryContext } from \"./ToolbarWithOverflow\";\nimport { toToolbarPopupRelativePosition } from \"./PopupItemWithDrag\";\n\n/** @public */\nexport interface ToolbarPopupContextProps {\n readonly closePanel: () => void;\n readonly setSelectedItem?: (buttonItem: ActionButton) => void;\n}\n\n/**\n * Context used by Toolbar items in popups to close the popup panel.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ToolbarPopupContext = React.createContext<ToolbarPopupContextProps>({\n /** function used to close popup panel */\n closePanel: /* istanbul ignore next */ () => { },\n /** if popup panel is a GroupButton then this is call to set the selected action item within the panel */\n setSelectedItem: /* istanbul ignore next */ (_buttonItem: ActionButton) => { },\n});\n\n/**\n * React hook used to retrieve the ToolbarPopupContext.\n * @public\n */\nexport function useToolbarPopupContext() {\n return React.useContext(ToolbarPopupContext);\n}\n\n/** Properties of [[PopupItem]] component.\n * @beta\n */\nexport interface PopupItemProps extends ToolbarButtonItemProps {\n /** Describes if expandable item triangle indicator should be hidden. */\n hideIndicator?: boolean;\n /** Panel of the toolbar. */\n panel?: React.ReactNode;\n}\n\n/** Popup toolbar item that displays a panel\n * @beta\n */\nexport function PopupItem(props: PopupItemProps) {\n const [isPanelShown, setPanelShown] = React.useState(false);\n const { expandsTo, overflowExpandsTo, panelAlignment, onPopupPanelOpenClose } = useToolbarWithOverflowDirectionContext();\n const processPanelOpenClose = React.useCallback((isOpening: boolean) => {\n setPanelShown((prev) => {\n // istanbul ignore else\n if (prev !== isOpening)\n onPopupPanelOpenClose(isOpening);\n return isOpening;\n });\n }, [setPanelShown, onPopupPanelOpenClose]);\n\n // handle open and closing overflow panel\n const onButtonClick = React.useCallback(() => {\n processPanelOpenClose(!isPanelShown);\n // istanbul ignore next\n if (props.onClick)\n props.onClick();\n }, [props, isPanelShown, processPanelOpenClose]);\n const className = classnames(\n \"components-toolbar-button-item\",\n \"components-toolbar-expandable-button\",\n props.isDisabled && \"components-disabled\",\n props.className);\n\n const [targetRef, target] = useRefState<HTMLButtonElement>();\n // istanbul ignore next\n const handleClose = React.useCallback(() => {\n processPanelOpenClose(false);\n }, [processPanelOpenClose]);\n const { hasOverflow } = useToolItemEntryContext();\n const expandsToDirection = hasOverflow ? overflowExpandsTo : expandsTo;\n\n const { hideIndicator, panel } = props;\n return (\n <ToolbarPopupContext.Provider value={{\n closePanel: () => processPanelOpenClose(false),\n }}>\n <button\n data-item-id={props.itemId}\n data-item-type=\"tool-button\"\n ref={targetRef}\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\n onClick={onButtonClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={props.title}\n >\n <div className=\"components-icon\">\n {props.icon}\n </div>\n {props.badge &&\n <div className=\"components-badge\">\n {props.badge}\n </div>\n }\n {hideIndicator ? /* istanbul ignore next */ undefined : <div className=\"components-triangle\" />}\n </button>\n <PopupItemPopup\n isOpen={isPanelShown}\n onClose={handleClose}\n position={toToolbarPopupRelativePosition(expandsToDirection, panelAlignment)}\n target={target}\n >\n {panel}\n </PopupItemPopup>\n </ToolbarPopupContext.Provider>\n );\n}\n\n/** @internal */\ninterface PopupItemPopupProps {\n children?: React.ReactNode;\n isOpen?: boolean;\n onClose(): void;\n position: RelativePosition;\n target?: HTMLElement;\n}\n\n/** @internal */\nexport function PopupItemPopup(props: PopupItemPopupProps) {\n return <Popup\n className=\"components-toolbar-popupItem_popupItemPopup\"\n offset={0}\n showShadow={false}\n {...props}\n />;\n}\n"]}
1
+ {"version":3,"file":"PopupItem.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/PopupItem.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4BAA0B;AAC1B,4DAAoC;AACpC,6CAA+B;AAE/B,kDAAuD;AAEvD,+DAAwG;AACxG,2DAAqE;AAQrE;;;GAGG;AACH,gEAAgE;AACnD,QAAA,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAA2B;IAC/E,yCAAyC;IACzC,UAAU,EAAE,0BAA0B,CAAC,GAAG,EAAE,GAAG,CAAC;IAChD,yGAAyG;IACzG,eAAe,EAAE,0BAA0B,CAAE,CAAC,WAAyB,EAAE,EAAE,GAAG,CAAC;CAChF,CAAC,CAAC;AAEH;;;GAGG;AACH,SAAgB,sBAAsB;IACpC,OAAO,KAAK,CAAC,UAAU,CAAC,2BAAmB,CAAC,CAAC;AAC/C,CAAC;AAFD,wDAEC;AAYD;;GAEG;AACH,SAAgB,SAAS,CAAC,KAAqB;IAC7C,MAAM,CAAC,YAAY,EAAE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W,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACvC,OAAO,CACL,oBAAC,2BAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE;YACnC,UAAU,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC;SAC/C;QACC,gDACgB,KAAK,CAAC,MAAM,oBACX,aAAa,EAC5B,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,KAAK,CAAC,UAAU,EAC1B,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAElB,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,KAAK,CAAC,IAAI,CACP;YACL,KAAK,CAAC,KAAK;gBACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CAAC,KAAK,CACR;YAEP,aAAa,CAAC,CAAC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CACxF;QACT,oBAAC,cAAc,IACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,IAAA,kDAA8B,EAAC,kBAAkB,EAAE,cAAc,CAAC,EAC5E,MAAM,EAAE,MAAM,IAEb,KAAK,CACS,CACY,CAChC,CAAC;AACJ,CAAC;AArED,8BAqEC;AAWD,gBAAgB;AAChB,SAAgB,cAAc,CAAC,KAA0B;IACvD,OAAO,oBAAC,kBAAK,kBACX,SAAS,EAAC,6CAA6C,EACvD,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,KAAK,IACb,KAAK,EACT,CAAC;AACL,CAAC;AAPD,wCAOC","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 \"./PopupItem.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ActionButton, RelativePosition } from \"@itwin/appui-abstract\";\nimport { Popup, useRefState } from \"@itwin/core-react\";\nimport { ToolbarButtonItemProps } from \"./Item\";\nimport { useToolbarWithOverflowDirectionContext, useToolItemEntryContext } from \"./ToolbarWithOverflow\";\nimport { toToolbarPopupRelativePosition } from \"./PopupItemWithDrag\";\n\n/** @public */\nexport interface ToolbarPopupContextProps {\n readonly closePanel: () => void;\n readonly setSelectedItem?: (buttonItem: ActionButton) => void;\n}\n\n/**\n * Context used by Toolbar items in popups to close the popup panel.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ToolbarPopupContext = React.createContext<ToolbarPopupContextProps>({\n /** function used to close popup panel */\n closePanel: /* istanbul ignore next */ () => { },\n /** if popup panel is a GroupButton then this is call to set the selected action item within the panel */\n setSelectedItem: /* istanbul ignore next */ (_buttonItem: ActionButton) => { },\n});\n\n/**\n * React hook used to retrieve the ToolbarPopupContext.\n * @public\n */\nexport function useToolbarPopupContext() {\n return React.useContext(ToolbarPopupContext);\n}\n\n/** Properties of [[PopupItem]] component.\n * @public\n */\nexport interface PopupItemProps extends ToolbarButtonItemProps {\n /** Describes if expandable item triangle indicator should be hidden. */\n hideIndicator?: boolean;\n /** Panel of the toolbar. */\n panel?: React.ReactNode;\n}\n\n/** Popup toolbar item that displays a panel\n * @public\n */\nexport function PopupItem(props: PopupItemProps) {\n const [isPanelShown, setPanelShown] = React.useState(false);\n const { expandsTo, overflowExpandsTo, panelAlignment, onPopupPanelOpenClose } = useToolbarWithOverflowDirectionContext();\n const processPanelOpenClose = React.useCallback((isOpening: boolean) => {\n setPanelShown((prev) => {\n // istanbul ignore else\n if (prev !== isOpening)\n onPopupPanelOpenClose(isOpening);\n return isOpening;\n });\n }, [setPanelShown, onPopupPanelOpenClose]);\n\n // handle open and closing overflow panel\n const onButtonClick = React.useCallback(() => {\n processPanelOpenClose(!isPanelShown);\n // istanbul ignore next\n if (props.onClick)\n props.onClick();\n }, [props, isPanelShown, processPanelOpenClose]);\n const className = classnames(\n \"components-toolbar-button-item\",\n \"components-toolbar-expandable-button\",\n props.isDisabled && \"components-disabled\",\n props.className);\n\n const [targetRef, target] = useRefState<HTMLButtonElement>();\n // istanbul ignore next\n const handleClose = React.useCallback(() => {\n processPanelOpenClose(false);\n }, [processPanelOpenClose]);\n const { hasOverflow } = useToolItemEntryContext();\n const expandsToDirection = hasOverflow ? overflowExpandsTo : expandsTo;\n\n const { hideIndicator, panel } = props;\n return (\n <ToolbarPopupContext.Provider value={{\n closePanel: () => processPanelOpenClose(false),\n }}>\n <button\n data-item-id={props.itemId}\n data-item-type=\"tool-button\"\n ref={targetRef}\n disabled={props.isDisabled} // this is needed to prevent focusing/keyboard access to disabled buttons\n onClick={onButtonClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={props.title}\n >\n <div className=\"components-icon\">\n {props.icon}\n </div>\n {props.badge &&\n <div className=\"components-badge\">\n {props.badge}\n </div>\n }\n {hideIndicator ? /* istanbul ignore next */ undefined : <div className=\"components-triangle\" />}\n </button>\n <PopupItemPopup\n isOpen={isPanelShown}\n onClose={handleClose}\n position={toToolbarPopupRelativePosition(expandsToDirection, panelAlignment)}\n target={target}\n >\n {panel}\n </PopupItemPopup>\n </ToolbarPopupContext.Provider>\n );\n}\n\n/** @internal */\ninterface PopupItemPopupProps {\n children?: React.ReactNode;\n isOpen?: boolean;\n onClose(): void;\n position: RelativePosition;\n target?: HTMLElement;\n}\n\n/** @internal */\nexport function PopupItemPopup(props: PopupItemPopupProps) {\n return <Popup\n className=\"components-toolbar-popupItem_popupItemPopup\"\n offset={0}\n showShadow={false}\n {...props}\n />;\n}\n"]}
@@ -8,14 +8,14 @@ import { ToolbarButtonItemProps } from "./Item";
8
8
  import { ToolbarPanelAlignment } from "./ToolbarWithOverflow";
9
9
  import { Direction } from "./utilities/Direction";
10
10
  /** Properties of [[PopupItem]] component.
11
- * @beta
11
+ * @public
12
12
  */
13
13
  export interface PopupItemWithDragProps extends ToolbarButtonItemProps {
14
14
  /** Panel of the toolbar. */
15
15
  groupItem: GroupButton;
16
16
  }
17
17
  /** Expandable Group button Item
18
- * @beta
18
+ * @public
19
19
  */
20
20
  export declare function PopupItemWithDrag(props: PopupItemWithDragProps): JSX.Element;
21
21
  /** @internal */
@@ -87,7 +87,7 @@ function getActiveAction(item) {
87
87
  return getFirstAvailableChildActionItem(item);
88
88
  }
89
89
  /** Expandable Group button Item
90
- * @beta
90
+ * @public
91
91
  */
92
92
  function PopupItemWithDrag(props) {
93
93
  const [isPanelShown, setPanelShown] = React.useState(false);
@@ -1 +1 @@
1
- {"version":3,"file":"PopupItemWithDrag.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/PopupItemWithDrag.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4BAA0B;AAC1B,4DAAoC;AACpC,6CAA+B;AAC/B,0DAA2J;AAC3J,kDAA4E;AAE5E,2CAAkE;AAClE,uDAAoD;AACpD,+DAA+H;AAC/H,6DAA0D;AAC1D,qDAAkD;AAUlD,SAAS,mBAAmB,CAAC,IAAiB;IAC5C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE;QAClC,uBAAuB;QACvB,IAAI,qCAAoB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;YAClD,IAAI,SAAS,CAAC,QAAQ;gBACpB,OAAO,SAAS,CAAC;SACpB;aAAM,IAAI,qCAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;YACxD,MAAM,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;YACnD,IAAI,WAAW;gBACb,OAAO,WAAW,CAAC;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,UAAU,CAAC;SACpC;QACD,KAAK,qBAAS,CAAC,IAAI;YACjB,OAAO,iCAAgB,CAAC,OAAO,CAAC;QAClC,KAAK,qBAAS,CAAC,KAAK;YAClB,OAAO,iCAAgB,CAAC,QAAQ,CAAC;QACnC,KAAK,qBAAS,CAAC,GAAG;YAChB,OAAO,iCAAgB,CAAC,GAAG,CAAC;KAC/B;AACH,CAAC;AAfD,wEAeC","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 \"./PopupItem.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ActionButton, ConditionalBooleanValue, ConditionalStringValue, GroupButton, RelativePosition, ToolbarItemUtilities } from \"@itwin/appui-abstract\";\nimport { BadgeUtilities, IconHelper, useRefState } from \"@itwin/core-react\";\nimport { ToolbarButtonItemProps } from \"./Item\";\nimport { PopupItemPopup, ToolbarPopupContext } from \"./PopupItem\";\nimport { PopupItemsPanel } from \"./PopupItemsPanel\";\nimport { ToolbarPanelAlignment, useToolbarWithOverflowDirectionContext, useToolItemEntryContext } from \"./ToolbarWithOverflow\";\nimport { useDragInteraction } from \"./useDragInteraction\";\nimport { Direction } from \"./utilities/Direction\";\n\n/** Properties of [[PopupItem]] component.\n * @beta\n */\nexport interface PopupItemWithDragProps extends ToolbarButtonItemProps {\n /** Panel of the toolbar. */\n groupItem: GroupButton;\n}\n\nfunction tryFindActiveAction(item: GroupButton): ActionButton | undefined {\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n if (childItem.isActive)\n return childItem;\n } else if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = tryFindActiveAction(childItem);\n if (nestedChild)\n return nestedChild;\n }\n }\n return undefined;\n}\n\nfunction getFirstAvailableChildActionItem(item: GroupButton): ActionButton | undefined {\n for (const childItem of item.items) {\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n } else {\n // istanbul ignore else\n if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = getFirstAvailableChildActionItem(childItem);\n // istanbul ignore else\n if (nestedChild)\n return nestedChild;\n }\n }\n }\n return undefined;\n}\n\nfunction getActiveAction(item: GroupButton): ActionButton | undefined {\n const activeItem = tryFindActiveAction(item);\n if (activeItem)\n return activeItem;\n\n // initially look only in root items\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n }\n }\n\n // if not found look inside groups\n return getFirstAvailableChildActionItem(item);\n}\n\n/** Expandable Group button Item\n * @beta\n */\nexport function PopupItemWithDrag(props: PopupItemWithDragProps) {\n const [isPanelShown, setPanelShown] = React.useState(false);\n const [activeAction, setActiveAction] = React.useState(getActiveAction(props.groupItem));\n const { expandsTo, overflowExpandsTo, panelAlignment, onPopupPanelOpenClose } = useToolbarWithOverflowDirectionContext();\n\n React.useEffect(() => {\n const newActiveAction = getActiveAction(props.groupItem);\n // istanbul ignore else\n if (newActiveAction) {\n // istanbul ignore next\n if (newActiveAction.isActive) {\n setActiveAction(newActiveAction);\n } else {\n if (activeAction && activeAction.isActive) {\n setActiveAction({ ...activeAction, isActive: false });\n }\n }\n }\n }, [props.groupItem, activeAction]);\n\n const processPanelOpenClose = React.useCallback((isOpening: boolean) => {\n setPanelShown((prev) => {\n // istanbul ignore else\n if (prev !== isOpening)\n onPopupPanelOpenClose(isOpening);\n return isOpening;\n });\n }, [setPanelShown, onPopupPanelOpenClose]);\n\n // handle open and closing popup panel\n const onOpenPanel = React.useCallback(() => {\n processPanelOpenClose(!isPanelShown);\n }, [isPanelShown, processPanelOpenClose]);\n\n // handle open and closing popup panel\n const onGroupButtonClick = React.useCallback(() => {\n // only execute action if not disabled\n activeAction && !ConditionalBooleanValue.getValue(activeAction.isDisabled) && activeAction.execute();\n }, [activeAction]);\n\n const badge = activeAction ? BadgeUtilities.getComponentForBadgeType(activeAction.badgeType) : props.badge;\n const icon = activeAction ? IconHelper.getIconReactNode(activeAction.icon, activeAction.internalData) : props.icon;\n const title = activeAction ? ConditionalStringValue.getValue(activeAction.label) : props.title;\n const isActive = activeAction ? activeAction.isActive : props.isActive;\n const isDisabled = ConditionalBooleanValue.getValue(activeAction ? activeAction.isDisabled : props.isDisabled);\n\n const { handlePointerDown, handleButtonClick } = useDragInteraction(onGroupButtonClick, onOpenPanel);\n\n const className = classnames(\n \"components-toolbar-button-item\",\n \"components-toolbar-expandable-button\",\n isActive && \"components-active\",\n isDisabled && \"components-disabled-drag\",\n props.className);\n\n const [targetRef, target] = useRefState<HTMLButtonElement>();\n const handleClose = React.useCallback(() => {\n processPanelOpenClose(false);\n }, [processPanelOpenClose]);\n const { hasOverflow } = useToolItemEntryContext();\n const expandsToDirection = hasOverflow ? /* istanbul ignore next */ overflowExpandsTo : expandsTo;\n\n return (\n <ToolbarPopupContext.Provider value={{\n closePanel: /* istanbul ignore next */ () => processPanelOpenClose(false),\n setSelectedItem: /* istanbul ignore next */ (buttonItem: ActionButton) => setActiveAction(buttonItem),\n }\n }>\n <button\n ref={targetRef}\n onPointerDown={handlePointerDown}\n onClick={handleButtonClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={title}\n >\n <div className=\"components-icon\">\n {icon}\n </div>\n {props.badge &&\n <div className=\"components-badge\">\n {badge}\n </div>\n }\n <div className=\"components-triangle\" />\n </button>\n <PopupItemPopup\n isOpen={isPanelShown}\n onClose={handleClose}\n position={toToolbarPopupRelativePosition(expandsToDirection, panelAlignment)}\n target={target}\n >\n <PopupItemsPanel groupItem={props.groupItem} activateOnPointerUp={true} />\n </PopupItemPopup>\n </ToolbarPopupContext.Provider>\n );\n}\n\n/** @internal */\nexport function toToolbarPopupRelativePosition(expandsTo: Direction, alignment: ToolbarPanelAlignment): RelativePosition {\n // istanbul ignore next\n switch (expandsTo) {\n case Direction.Bottom: {\n if (alignment === ToolbarPanelAlignment.End)\n return RelativePosition.BottomRight;\n return RelativePosition.BottomLeft;\n }\n case Direction.Left:\n return RelativePosition.LeftTop;\n case Direction.Right:\n return RelativePosition.RightTop;\n case Direction.Top:\n return RelativePosition.Top;\n }\n}\n"]}
1
+ {"version":3,"file":"PopupItemWithDrag.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/PopupItemWithDrag.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4BAA0B;AAC1B,4DAAoC;AACpC,6CAA+B;AAC/B,0DAA2J;AAC3J,kDAA4E;AAE5E,2CAAkE;AAClE,uDAAoD;AACpD,+DAA+H;AAC/H,6DAA0D;AAC1D,qDAAkD;AAUlD,SAAS,mBAAmB,CAAC,IAAiB;IAC5C,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE;QAClC,uBAAuB;QACvB,IAAI,qCAAoB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;YAClD,IAAI,SAAS,CAAC,QAAQ;gBACpB,OAAO,SAAS,CAAC;SACpB;aAAM,IAAI,qCAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;YACxD,MAAM,WAAW,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;YACnD,IAAI,WAAW;gBACb,OAAO,WAAW,CAAC;SACtB;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,gCAAgC,CAAC,IAAiB;IACzD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE;QAClC,IAAI,qCAAoB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;YAClD,OAAO,SAAS,CAAC;SAClB;aAAM;YACL,uBAAuB;YACvB,IAAI,qCAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;gBACjD,MAAM,WAAW,GAAG,gCAAgC,CAAC,SAAS,CAAC,C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a,EAAE,iBAAiB,EAChC,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK;YAEZ,6BAAK,SAAS,EAAC,iBAAiB,IAC7B,IAAI,CACD;YACL,KAAK,CAAC,KAAK;gBACV,6BAAK,SAAS,EAAC,kBAAkB,IAC9B,KAAK,CACF;YAER,6BAAK,SAAS,EAAC,qBAAqB,GAAG,CAChC;QACT,oBAAC,0BAAc,IACb,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,8BAA8B,CAAC,kBAAkB,EAAE,cAAc,CAAC,EAC5E,MAAM,EAAE,MAAM;YAEd,oBAAC,iCAAe,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,mBAAmB,EAAE,IAAI,GAAI,CAC3D,CACY,CAChC,CAAC;AACJ,CAAC;AAjGD,8CAiGC;AAED,gBAAgB;AAChB,SAAgB,8BAA8B,CAAC,SAAoB,EAAE,SAAgC;IACnG,uBAAuB;IACvB,QAAQ,SAAS,EAAE;QACjB,KAAK,qBAAS,CAAC,MAAM,CAAC,CAAC;YACrB,IAAI,SAAS,KAAK,2CAAqB,CAAC,GAAG;gBACzC,OAAO,iCAAgB,CAAC,WAAW,CAAC;YACtC,OAAO,iCAAgB,CAAC,UAAU,CAAC;SACpC;QACD,KAAK,qBAAS,CAAC,IAAI;YACjB,OAAO,iCAAgB,CAAC,OAAO,CAAC;QAClC,KAAK,qBAAS,CAAC,KAAK;YAClB,OAAO,iCAAgB,CAAC,QAAQ,CAAC;QACnC,KAAK,qBAAS,CAAC,GAAG;YAChB,OAAO,iCAAgB,CAAC,GAAG,CAAC;KAC/B;AACH,CAAC;AAfD,wEAeC","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 \"./PopupItem.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ActionButton, ConditionalBooleanValue, ConditionalStringValue, GroupButton, RelativePosition, ToolbarItemUtilities } from \"@itwin/appui-abstract\";\nimport { BadgeUtilities, IconHelper, useRefState } from \"@itwin/core-react\";\nimport { ToolbarButtonItemProps } from \"./Item\";\nimport { PopupItemPopup, ToolbarPopupContext } from \"./PopupItem\";\nimport { PopupItemsPanel } from \"./PopupItemsPanel\";\nimport { ToolbarPanelAlignment, useToolbarWithOverflowDirectionContext, useToolItemEntryContext } from \"./ToolbarWithOverflow\";\nimport { useDragInteraction } from \"./useDragInteraction\";\nimport { Direction } from \"./utilities/Direction\";\n\n/** Properties of [[PopupItem]] component.\n * @public\n */\nexport interface PopupItemWithDragProps extends ToolbarButtonItemProps {\n /** Panel of the toolbar. */\n groupItem: GroupButton;\n}\n\nfunction tryFindActiveAction(item: GroupButton): ActionButton | undefined {\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n if (childItem.isActive)\n return childItem;\n } else if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = tryFindActiveAction(childItem);\n if (nestedChild)\n return nestedChild;\n }\n }\n return undefined;\n}\n\nfunction getFirstAvailableChildActionItem(item: GroupButton): ActionButton | undefined {\n for (const childItem of item.items) {\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n } else {\n // istanbul ignore else\n if (ToolbarItemUtilities.isGroupButton(childItem)) {\n const nestedChild = getFirstAvailableChildActionItem(childItem);\n // istanbul ignore else\n if (nestedChild)\n return nestedChild;\n }\n }\n }\n return undefined;\n}\n\nfunction getActiveAction(item: GroupButton): ActionButton | undefined {\n const activeItem = tryFindActiveAction(item);\n if (activeItem)\n return activeItem;\n\n // initially look only in root items\n for (const childItem of item.items) {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(childItem)) {\n return childItem;\n }\n }\n\n // if not found look inside groups\n return getFirstAvailableChildActionItem(item);\n}\n\n/** Expandable Group button Item\n * @public\n */\nexport function PopupItemWithDrag(props: PopupItemWithDragProps) {\n const [isPanelShown, setPanelShown] = React.useState(false);\n const [activeAction, setActiveAction] = React.useState(getActiveAction(props.groupItem));\n const { expandsTo, overflowExpandsTo, panelAlignment, onPopupPanelOpenClose } = useToolbarWithOverflowDirectionContext();\n\n React.useEffect(() => {\n const newActiveAction = getActiveAction(props.groupItem);\n // istanbul ignore else\n if (newActiveAction) {\n // istanbul ignore next\n if (newActiveAction.isActive) {\n setActiveAction(newActiveAction);\n } else {\n if (activeAction && activeAction.isActive) {\n setActiveAction({ ...activeAction, isActive: false });\n }\n }\n }\n }, [props.groupItem, activeAction]);\n\n const processPanelOpenClose = React.useCallback((isOpening: boolean) => {\n setPanelShown((prev) => {\n // istanbul ignore else\n if (prev !== isOpening)\n onPopupPanelOpenClose(isOpening);\n return isOpening;\n });\n }, [setPanelShown, onPopupPanelOpenClose]);\n\n // handle open and closing popup panel\n const onOpenPanel = React.useCallback(() => {\n processPanelOpenClose(!isPanelShown);\n }, [isPanelShown, processPanelOpenClose]);\n\n // handle open and closing popup panel\n const onGroupButtonClick = React.useCallback(() => {\n // only execute action if not disabled\n activeAction && !ConditionalBooleanValue.getValue(activeAction.isDisabled) && activeAction.execute();\n }, [activeAction]);\n\n const badge = activeAction ? BadgeUtilities.getComponentForBadgeType(activeAction.badgeType) : props.badge;\n const icon = activeAction ? IconHelper.getIconReactNode(activeAction.icon, activeAction.internalData) : props.icon;\n const title = activeAction ? ConditionalStringValue.getValue(activeAction.label) : props.title;\n const isActive = activeAction ? activeAction.isActive : props.isActive;\n const isDisabled = ConditionalBooleanValue.getValue(activeAction ? activeAction.isDisabled : props.isDisabled);\n\n const { handlePointerDown, handleButtonClick } = useDragInteraction(onGroupButtonClick, onOpenPanel);\n\n const className = classnames(\n \"components-toolbar-button-item\",\n \"components-toolbar-expandable-button\",\n isActive && \"components-active\",\n isDisabled && \"components-disabled-drag\",\n props.className);\n\n const [targetRef, target] = useRefState<HTMLButtonElement>();\n const handleClose = React.useCallback(() => {\n processPanelOpenClose(false);\n }, [processPanelOpenClose]);\n const { hasOverflow } = useToolItemEntryContext();\n const expandsToDirection = hasOverflow ? /* istanbul ignore next */ overflowExpandsTo : expandsTo;\n\n return (\n <ToolbarPopupContext.Provider value={{\n closePanel: /* istanbul ignore next */ () => processPanelOpenClose(false),\n setSelectedItem: /* istanbul ignore next */ (buttonItem: ActionButton) => setActiveAction(buttonItem),\n }\n }>\n <button\n ref={targetRef}\n onPointerDown={handlePointerDown}\n onClick={handleButtonClick}\n onKeyDown={props.onKeyDown}\n className={className}\n style={props.style}\n title={title}\n >\n <div className=\"components-icon\">\n {icon}\n </div>\n {props.badge &&\n <div className=\"components-badge\">\n {badge}\n </div>\n }\n <div className=\"components-triangle\" />\n </button>\n <PopupItemPopup\n isOpen={isPanelShown}\n onClose={handleClose}\n position={toToolbarPopupRelativePosition(expandsToDirection, panelAlignment)}\n target={target}\n >\n <PopupItemsPanel groupItem={props.groupItem} activateOnPointerUp={true} />\n </PopupItemPopup>\n </ToolbarPopupContext.Provider>\n );\n}\n\n/** @internal */\nexport function toToolbarPopupRelativePosition(expandsTo: Direction, alignment: ToolbarPanelAlignment): RelativePosition {\n // istanbul ignore next\n switch (expandsTo) {\n case Direction.Bottom: {\n if (alignment === ToolbarPanelAlignment.End)\n return RelativePosition.BottomRight;\n return RelativePosition.BottomLeft;\n }\n case Direction.Left:\n return RelativePosition.LeftTop;\n case Direction.Right:\n return RelativePosition.RightTop;\n case Direction.Top:\n return RelativePosition.Top;\n }\n}\n"]}
@@ -8,7 +8,7 @@ import { CommonProps, NoChildrenProps } from "@itwin/core-react";
8
8
  import { Direction } from "./utilities/Direction";
9
9
  import { ToolbarOpacitySetting, ToolbarPanelAlignment } from "./ToolbarWithOverflow";
10
10
  /** Properties of [[Toolbar]] component.
11
- * @beta
11
+ * @public
12
12
  */
13
13
  export interface ToolbarProps extends CommonProps, NoChildrenProps {
14
14
  /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */
@@ -27,7 +27,7 @@ export interface ToolbarProps extends CommonProps, NoChildrenProps {
27
27
  onKeyDown?: (e: React.KeyboardEvent) => void;
28
28
  }
29
29
  /** Component that displays tool settings as a bar across the top of the content view.
30
- * @beta
30
+ * @public
31
31
  */
32
32
  export declare function Toolbar(props: ToolbarProps): JSX.Element;
33
33
  //# sourceMappingURL=Toolbar.d.ts.map
@@ -45,7 +45,7 @@ function getItemWrapperClass(child) {
45
45
  return "";
46
46
  }
47
47
  /** Component that displays tool settings as a bar across the top of the content view.
48
- * @beta
48
+ * @public
49
49
  */
50
50
  function Toolbar(props) {
51
51
  const expandsTo = props.expandsTo ? props.expandsTo : Direction_1.Direction.Bottom;
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0BAAwB;AACxB,4DAAoC;AACpC,6CAA+B;AAK/B,mCAAuC;AACvC,qDAAmG;AACnG,+DAAyL;AAsBzL,SAAS,mBAAmB,CAAC,KAAsB;IACjD,uBAAuB;IACvB,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;QAC/B,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,iBAAiB;YAC9C,OAAO,0CAA0C,CAAC;KACrD;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO,CAAC,KAAmB;IACzC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAS,CAAC,MAAM,CAAC;IACvE,MAAM,kB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,CAAC,GAAG,EAAE,GAAG,CAAC;aAC/C,IAEA,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;YAC1B,6BACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAY,IACX,SAAS,EAAC,kBAAkB,EAC5B,SAAS,EAAE,SAAS,IAEnB,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,6BAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,gBAAgB,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,IAAG,KAAK,CAAO,CAAC,CACxH,CACX,CAEoB,CACgB,CACjD,CAAC;AACJ,CAAC;AAjFD,0BAiFC","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 \"./Toolbar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport {\n CommonToolbarItem, OnItemExecutedFunc,\n} from \"@itwin/appui-abstract\";\nimport { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport { ToolbarItems } from \"./Items\";\nimport { Direction, OrthogonalDirection, OrthogonalDirectionHelpers } from \"./utilities/Direction\";\nimport { getToolbarDirection, ToolbarItemComponent, ToolbarItemContext, ToolbarOpacitySetting, ToolbarPanelAlignment, ToolbarWithOverflowDirectionContext } from \"./ToolbarWithOverflow\";\n\n/** Properties of [[Toolbar]] component.\n * @beta\n */\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** definitions for items of the toolbar. i.e. [[CommonToolbarItem]]. Items are expected to be already sorted by group and item. */\n items: CommonToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\nfunction getItemWrapperClass(child: React.ReactNode) {\n // istanbul ignore else\n if (React.isValidElement(child)) {\n if (child.props && child.props.addGroupSeparator)\n return \"components-toolbar-button-add-gap-before\";\n }\n return \"\";\n}\n\n/** Component that displays tool settings as a bar across the top of the content view.\n * @beta\n */\nexport function Toolbar(props: ToolbarProps) {\n const expandsTo = props.expandsTo ? props.expandsTo : Direction.Bottom;\n const useDragInteraction = !!props.useDragInteraction;\n const panelAlignment = props.panelAlignment ? props.panelAlignment : ToolbarPanelAlignment.Start;\n const [popupPanelCount, setPopupPanelCount] = React.useState(0);\n\n const handlePopupPanelOpenClose = React.useCallback((isOpening: boolean) => {\n // use setImmediate to avoid warning about setting state in Toolbar from render method of PopupItem/PopupItemWithDrag\n setImmediate(() => {\n setPopupPanelCount((prev) => {\n const nextCount = isOpening ? (prev + 1) : (prev - 1);\n // eslint-disable-next-line no-console\n // console.log(`new popup count = ${nextCount}`);\n return nextCount < 0 ? /* istanbul ignore next */ 0 : nextCount;\n });\n });\n }, []);\n\n const availableNodes = React.useMemo<React.ReactNodeArray>(() => {\n return props.items.map((item, index) => {\n let addGroupSeparator = false;\n if (index > 0)\n addGroupSeparator = item.groupPriority !== props.items[index - 1].groupPriority;\n return (\n <ToolbarItemComponent\n key={item.id}\n item={item}\n addGroupSeparator={!!addGroupSeparator}\n />\n );\n });\n }, [props.items]);\n\n const direction = getToolbarDirection(expandsTo);\n const className = classnames(\n \"components-toolbar-overflow-sizer\",\n OrthogonalDirectionHelpers.getCssClassName(direction),\n props.className);\n\n // needed to construct DOM structure identical to ToolbarWithOverflow so same css can be applied.\n const wrapperClassName = classnames(\n \"components-toolbar-item-container\",\n OrthogonalDirectionHelpers.getCssClassName(direction),\n );\n\n return (\n <ToolbarWithOverflowDirectionContext.Provider value={\n {\n expandsTo, direction, overflowExpandsTo: Direction.Right, panelAlignment, useDragInteraction,\n toolbarOpacitySetting: props.toolbarOpacitySetting ? props.toolbarOpacitySetting : ToolbarOpacitySetting.Proximity,\n overflowDirection: OrthogonalDirection.Horizontal,\n openPopupCount: popupPanelCount, onPopupPanelOpenClose: handlePopupPanelOpenClose, overflowDisplayActive: false,\n onItemExecuted: props.onItemExecuted ? props.onItemExecuted : /* istanbul ignore next */ () => { },\n onKeyDown: props.onKeyDown ? props.onKeyDown : /* istanbul ignore next */ (_e: React.KeyboardEvent) => { },\n }\n }>\n <ToolbarItemContext.Provider\n value={{\n hasOverflow: false,\n useHeight: false,\n onResize: /* istanbul ignore next */ () => { },\n }}\n >\n {(availableNodes.length > 0) &&\n <div\n className={className}\n style={props.style}\n onKeyDown={props.onKeyDown}\n role=\"presentation\"\n >\n <ToolbarItems\n className=\"components-items\"\n direction={direction}\n >\n {availableNodes.map((child, index) => <div key={index} className={`${wrapperClassName} ${getItemWrapperClass(child)}`}>{child}</div>)}\n </ToolbarItems>\n </div>\n }\n </ToolbarItemContext.Provider>\n </ToolbarWithOverflowDirectionContext.Provider >\n );\n}\n"]}
1
+ {"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0BAAwB;AACxB,4DAAoC;AACpC,6CAA+B;AAK/B,mCAAuC;AACvC,qDAAmG;AACnG,+DAAyL;AAsBzL,SAAS,mBAAmB,CAAC,KAAsB;IACjD,uBAAuB;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CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,0BAA0B,CAAC,GAAG,EAAE,GAAG,CAAC;YAClG,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,EAAuB,EAAE,EAAE,GAAG,CAAC;SAC3G;QAED,oBAAC,wCAAkB,CAAC,QAAQ,IAC1B,KAAK,EAAE;gBACL,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,KAAK;gBAChB,QAAQ,EAAE,0BAA0B,CAAC,GAAG,EAAE,GAAG,CAAC;aAC/C,IAEA,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;YAC1B,6BACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,IAAI,EAAC,cAAc;gBAEnB,oBAAC,oBAAY,IACX,SAAS,EAAC,kBAAkB,EAC5B,SAAS,EAAE,SAAS,IAEnB,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,6BAAK,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,gBAAgB,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,IAAG,KAAK,CAAO,CAAC,CACxH,CACX,CAEoB,CACgB,CACjD,CAAC;AACJ,CAAC;AAjFD,0BAiFC","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 \"./Toolbar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport {\n CommonToolbarItem, OnItemExecutedFunc,\n} from \"@itwin/appui-abstract\";\nimport { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport { ToolbarItems } from \"./Items\";\nimport { Direction, OrthogonalDirection, OrthogonalDirectionHelpers } from \"./utilities/Direction\";\nimport { getToolbarDirection, ToolbarItemComponent, ToolbarItemContext, ToolbarOpacitySetting, ToolbarPanelAlignment, ToolbarWithOverflowDirectionContext } from \"./ToolbarWithOverflow\";\n\n/** Properties of [[Toolbar]] component.\n * @public\n */\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** definitions for items of the toolbar. i.e. [[CommonToolbarItem]]. Items are expected to be already sorted by group and item. */\n items: CommonToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\nfunction getItemWrapperClass(child: React.ReactNode) {\n // istanbul ignore else\n if (React.isValidElement(child)) {\n if (child.props && child.props.addGroupSeparator)\n return \"components-toolbar-button-add-gap-before\";\n }\n return \"\";\n}\n\n/** Component that displays tool settings as a bar across the top of the content view.\n * @public\n */\nexport function Toolbar(props: ToolbarProps) {\n const expandsTo = props.expandsTo ? props.expandsTo : Direction.Bottom;\n const useDragInteraction = !!props.useDragInteraction;\n const panelAlignment = props.panelAlignment ? props.panelAlignment : ToolbarPanelAlignment.Start;\n const [popupPanelCount, setPopupPanelCount] = React.useState(0);\n\n const handlePopupPanelOpenClose = React.useCallback((isOpening: boolean) => {\n // use setImmediate to avoid warning about setting state in Toolbar from render method of PopupItem/PopupItemWithDrag\n setImmediate(() => {\n setPopupPanelCount((prev) => {\n const nextCount = isOpening ? (prev + 1) : (prev - 1);\n // eslint-disable-next-line no-console\n // console.log(`new popup count = ${nextCount}`);\n return nextCount < 0 ? /* istanbul ignore next */ 0 : nextCount;\n });\n });\n }, []);\n\n const availableNodes = React.useMemo<React.ReactNodeArray>(() => {\n return props.items.map((item, index) => {\n let addGroupSeparator = false;\n if (index > 0)\n addGroupSeparator = item.groupPriority !== props.items[index - 1].groupPriority;\n return (\n <ToolbarItemComponent\n key={item.id}\n item={item}\n addGroupSeparator={!!addGroupSeparator}\n />\n );\n });\n }, [props.items]);\n\n const direction = getToolbarDirection(expandsTo);\n const className = classnames(\n \"components-toolbar-overflow-sizer\",\n OrthogonalDirectionHelpers.getCssClassName(direction),\n props.className);\n\n // needed to construct DOM structure identical to ToolbarWithOverflow so same css can be applied.\n const wrapperClassName = classnames(\n \"components-toolbar-item-container\",\n OrthogonalDirectionHelpers.getCssClassName(direction),\n );\n\n return (\n <ToolbarWithOverflowDirectionContext.Provider value={\n {\n expandsTo, direction, overflowExpandsTo: Direction.Right, panelAlignment, useDragInteraction,\n toolbarOpacitySetting: props.toolbarOpacitySetting ? props.toolbarOpacitySetting : ToolbarOpacitySetting.Proximity,\n overflowDirection: OrthogonalDirection.Horizontal,\n openPopupCount: popupPanelCount, onPopupPanelOpenClose: handlePopupPanelOpenClose, overflowDisplayActive: false,\n onItemExecuted: props.onItemExecuted ? props.onItemExecuted : /* istanbul ignore next */ () => { },\n onKeyDown: props.onKeyDown ? props.onKeyDown : /* istanbul ignore next */ (_e: React.KeyboardEvent) => { },\n }\n }>\n <ToolbarItemContext.Provider\n value={{\n hasOverflow: false,\n useHeight: false,\n onResize: /* istanbul ignore next */ () => { },\n }}\n >\n {(availableNodes.length > 0) &&\n <div\n className={className}\n style={props.style}\n onKeyDown={props.onKeyDown}\n role=\"presentation\"\n >\n <ToolbarItems\n className=\"components-items\"\n direction={direction}\n >\n {availableNodes.map((child, index) => <div key={index} className={`${wrapperClassName} ${getItemWrapperClass(child)}`}>{child}</div>)}\n </ToolbarItems>\n </div>\n }\n </ToolbarItemContext.Provider>\n </ToolbarWithOverflowDirectionContext.Provider >\n );\n}\n"]}
@@ -7,14 +7,14 @@ import { ActionButton, CommonToolbarItem, CustomButtonDefinition, GroupButton, O
7
7
  import { CommonProps, NoChildrenProps } from "@itwin/core-react";
8
8
  import { Direction, OrthogonalDirection } from "./utilities/Direction";
9
9
  /** Describes the data needed to insert a custom framework-specific button into an ToolbarWithOverflow.
10
- * @beta
10
+ * @public
11
11
  */
12
12
  export interface CustomToolbarItem extends CustomButtonDefinition {
13
13
  buttonNode?: React.ReactNode;
14
14
  panelContentNode?: React.ReactNode;
15
15
  }
16
16
  /** Describes toolbar item.
17
- * @beta
17
+ * @public
18
18
  */
19
19
  export declare type ToolbarItem = ActionButton | GroupButton | CustomToolbarItem;
20
20
  /** CustomToolbarItem type guard.
@@ -24,14 +24,14 @@ export declare function isCustomToolbarItem(item: ToolbarItem): item is CustomTo
24
24
  /** @internal */
25
25
  export declare const getToolbarDirection: (expandsTo: Direction) => OrthogonalDirection;
26
26
  /** Available alignment modes of [[ToolbarWithOverflow]] panels.
27
- * @beta
27
+ * @public
28
28
  */
29
29
  export declare enum ToolbarPanelAlignment {
30
30
  Start = 0,
31
31
  End = 1
32
32
  }
33
33
  /** Enumeration of Toolbar Opacity setting.
34
- * @beta
34
+ * @public
35
35
  */
36
36
  export declare enum ToolbarOpacitySetting {
37
37
  /** Use the default background, box-shadow opacity and backdrop-filter blur */
@@ -95,7 +95,7 @@ export declare function ToolbarItemComponent({ item, addGroupSeparator }: {
95
95
  /** @internal */
96
96
  export declare function useToolbarWithOverflowDirectionContext(): ToolbarOverflowContextProps;
97
97
  /** Properties of [[ToolbarWithOverflow]] component.
98
- * @beta
98
+ * @public
99
99
  */
100
100
  export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {
101
101
  /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */
@@ -116,7 +116,7 @@ export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {
116
116
  onKeyDown?: (e: React.KeyboardEvent) => void;
117
117
  }
118
118
  /** Component that displays tool settings as a bar across the top of the content view.
119
- * @beta
119
+ * @public
120
120
  */
121
121
  export declare function ToolbarWithOverflow(props: ToolbarWithOverflowProps): JSX.Element;
122
122
  /** Interface toolbars use to define context for its items.
@@ -59,7 +59,7 @@ const getToolbarDirection = (expandsTo) => {
59
59
  };
60
60
  exports.getToolbarDirection = getToolbarDirection;
61
61
  /** Available alignment modes of [[ToolbarWithOverflow]] panels.
62
- * @beta
62
+ * @public
63
63
  */
64
64
  var ToolbarPanelAlignment;
65
65
  (function (ToolbarPanelAlignment) {
@@ -67,7 +67,7 @@ var ToolbarPanelAlignment;
67
67
  ToolbarPanelAlignment[ToolbarPanelAlignment["End"] = 1] = "End";
68
68
  })(ToolbarPanelAlignment = exports.ToolbarPanelAlignment || (exports.ToolbarPanelAlignment = {}));
69
69
  /** Enumeration of Toolbar Opacity setting.
70
- * @beta
70
+ * @public
71
71
  */
72
72
  var ToolbarOpacitySetting;
73
73
  (function (ToolbarOpacitySetting) {
@@ -189,7 +189,7 @@ function getItemWrapperClass(child) {
189
189
  return undefined;
190
190
  }
191
191
  /** Component that displays tool settings as a bar across the top of the content view.
192
- * @beta
192
+ * @public
193
193
  */
194
194
  function ToolbarWithOverflow(props) {
195
195
  const expandsTo = props.expandsTo ? props.expandsTo : Direction_1.Direction.Bottom;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarWithOverflow.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0BAAwB;AACxB,4DAAoC;AACpC,6CAA+B;AAC/B,0DAG+B;AAC/B,kDAAsG;AACtG,iCAA2C;AAC3C,mCAAuC;AACvC,+CAA8E;AAC9E,yCAAmD;AACnD,mDAAuD;AACvD,2CAAwC;AACxC,uDA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AE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;AAC5F,CAAC;AAWD;;GAEG;AACH,gEAAgE;AACnD,QAAA,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAyB,IAAK,CAAC,CAAC;AAErF,gBAAgB;AAChB,SAAgB,uBAAuB;IACrC,OAAO,KAAK,CAAC,UAAU,CAAC,0BAAkB,CAAC,CAAC;AAC9C,CAAC;AAFD,0DAEC;AAED,SAAS,kBAAkB,CAAI,GAA+B;IAC5D,KAAK,MAAM,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE;QACzB,4CAA4C;QAC5C,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;KACpB;IACD,OAAO,GAAqB,CAAC;AAC/B,CAAC;AAED,SAAS,GAAG,CAAC,IAAmC,EAAE,KAAwB;IACxE,IAAI,CAAC,IAAI;QACP,OAAO,KAAK,CAAC;IACf,uBAAuB;IACvB,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAC9B,OAAO,KAAK,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,uBAAuB;QACvB,IAAI,CAAC,KAAK,CAAC;YACT,OAAO,KAAK,CAAC;KAChB;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport \"./Toolbar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport {\n ActionButton, CommonToolbarItem, ConditionalBooleanValue, ConditionalStringValue, CustomButtonDefinition,\n GroupButton, OnItemExecutedFunc, ToolbarItemUtilities,\n} from \"@itwin/appui-abstract\";\nimport { BadgeUtilities, CommonProps, IconHelper, NoChildrenProps, useRefs } from \"@itwin/core-react\";\nimport { ToolbarButtonItem } from \"./Item\";\nimport { ToolbarItems } from \"./Items\";\nimport { ItemWrapper, useResizeObserverSingleDimension } from \"./ItemWrapper\";\nimport { ToolbarOverflowButton } from \"./Overflow\";\nimport { ToolbarOverflowPanel } from \"./OverflowPanel\";\nimport { PopupItem } from \"./PopupItem\";\nimport { PopupItemsPanel } from \"./PopupItemsPanel\";\nimport { PopupItemWithDrag } from \"./PopupItemWithDrag\";\nimport { Direction, DirectionHelpers, OrthogonalDirection, OrthogonalDirectionHelpers } from \"./utilities/Direction\";\nimport { UiComponents } from \"../UiComponents\";\n\n/** Describes the data needed to insert a custom framework-specific button into an ToolbarWithOverflow.\n * @beta\n */\nexport interface CustomToolbarItem extends CustomButtonDefinition {\n buttonNode?: React.ReactNode;\n panelContentNode?: React.ReactNode;\n}\n\n/** Describes toolbar item.\n * @beta\n */\nexport type ToolbarItem = ActionButton | GroupButton | CustomToolbarItem;\n\n/** CustomToolbarItem type guard.\n * @internal\n */\nexport function isCustomToolbarItem(item: ToolbarItem): item is CustomToolbarItem {\n return !!(item as CustomToolbarItem).isCustom && ((\"buttonNode\" in item) || (\"panelContentNode\" in item));\n}\n\n/** @internal */\nexport const getToolbarDirection = (expandsTo: Direction): OrthogonalDirection => {\n const orthogonalDirection = DirectionHelpers.getOrthogonalDirection(expandsTo);\n return OrthogonalDirectionHelpers.inverse(orthogonalDirection);\n};\n\n/** Available alignment modes of [[ToolbarWithOverflow]] panels.\n * @beta\n */\nexport enum ToolbarPanelAlignment {\n Start,\n End,\n}\n\n/** Enumeration of Toolbar Opacity setting.\n * @beta\n */\nexport enum ToolbarOpacitySetting {\n /** Use the default background, box-shadow opacity and backdrop-filter blur */\n Defaults,\n /** Alter the opacity from transparent to the defaults based on mouse proximity */\n Proximity,\n /** Use a transparent background, box-shadow opacity and backdrop-filter blur */\n Transparent,\n}\n\n/** Helpers for [[ToolbarPanelAlignment]].\n * @internal\n */\nexport class ToolbarPanelAlignmentHelpers {\n /** Class name of [[ToolbarPanelAlignment.Start]] */\n public static readonly START_CLASS_NAME = \"components-panel-alignment-start\";\n /** Class name of [[ToolbarPanelAlignment.End]] */\n public static readonly END_CLASS_NAME = \"components-panel-alignment-end\";\n\n /** @returns Class name of specified [[ToolbarPanelAlignment]] */\n public static getCssClassName(panelAlignment: ToolbarPanelAlignment): string {\n switch (panelAlignment) {\n case ToolbarPanelAlignment.Start:\n return ToolbarPanelAlignmentHelpers.START_CLASS_NAME;\n case ToolbarPanelAlignment.End:\n return ToolbarPanelAlignmentHelpers.END_CLASS_NAME;\n }\n }\n}\n\n/** @internal */\nexport interface ToolbarOverflowContextProps {\n readonly expandsTo: Direction;\n readonly direction: OrthogonalDirection;\n readonly overflowExpandsTo: Direction;\n readonly overflowDirection: OrthogonalDirection;\n readonly panelAlignment: ToolbarPanelAlignment;\n readonly useDragInteraction: boolean;\n readonly toolbarOpacitySetting: ToolbarOpacitySetting;\n readonly openPopupCount: number;\n readonly onPopupPanelOpenClose: (isOpening: boolean) => void;\n readonly overflowDisplayActive: boolean;\n readonly onItemExecuted: OnItemExecutedFunc;\n readonly onKeyDown: (e: React.KeyboardEvent) => void;\n}\n\n/**\n * Context used by Toolbar component to provide Direction to child components.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ToolbarWithOverflowDirectionContext = React.createContext<ToolbarOverflowContextProps>({\n expandsTo: Direction.Bottom,\n direction: OrthogonalDirection.Horizontal,\n overflowExpandsTo: Direction.Right,\n overflowDirection: OrthogonalDirection.Vertical,\n panelAlignment: ToolbarPanelAlignment.Start,\n useDragInteraction: false,\n toolbarOpacitySetting: ToolbarOpacitySetting.Proximity,\n openPopupCount: 0,\n onPopupPanelOpenClose: /* istanbul ignore next */ (_isOpening: boolean) => { },\n overflowDisplayActive: false,\n onItemExecuted: /* istanbul ignore next */ (_item: any) => void {},\n onKeyDown: /* istanbul ignore next */ (_e: React.KeyboardEvent) => void {},\n});\n\n/** @internal */\nexport function CustomItem({ item, addGroupSeparator }: { item: CustomToolbarItem, addGroupSeparator: boolean }) {\n const { useDragInteraction } = useToolbarWithOverflowDirectionContext();\n\n if (item.panelContentNode) {\n const badge = BadgeUtilities.getComponentForBadgeType(item.badgeType);\n const title = ConditionalStringValue.getValue(item.label);\n return <PopupItem\n key={item.id}\n itemId={item.id}\n icon={item.icon ? IconHelper.getIconReactNode(item.icon, item.internalData) : /* istanbul ignore next */ <i className=\"icon icon-placeholder\" />}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title ? title : /* istanbul ignore next */ item.id}\n panel={item.panelContentNode}\n hideIndicator={useDragInteraction}\n badge={badge}\n addGroupSeparator={addGroupSeparator}\n />;\n }\n\n // istanbul ignore else\n if (item.buttonNode)\n return <>{item.buttonNode}</>;\n\n // istanbul ignore next\n return null;\n}\n\n/** @internal */\nexport function GroupPopupItem({ item, addGroupSeparator }: { item: GroupButton, addGroupSeparator: boolean }) {\n const { useDragInteraction } = useToolbarWithOverflowDirectionContext();\n const title = ConditionalStringValue.getValue(item.label)!;\n const badge = BadgeUtilities.getComponentForBadgeType(item.badgeType);\n\n if (useDragInteraction) {\n return <PopupItemWithDrag\n key={item.id}\n itemId={item.id}\n icon={IconHelper.getIconReactNode(item.icon, item.internalData)}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title}\n groupItem={item}\n badge={badge}\n addGroupSeparator={addGroupSeparator}\n />;\n }\n return <PopupItem\n key={item.id}\n itemId={item.id}\n icon={IconHelper.getIconReactNode(item.icon, item.internalData)}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title}\n panel={<PopupItemsPanel groupItem={item} activateOnPointerUp={false} />}\n badge={badge}\n hideIndicator={useDragInteraction}\n addGroupSeparator={addGroupSeparator}\n />;\n}\n\n/** @internal */\nexport function ActionItem({ item, addGroupSeparator }: { item: ActionButton, addGroupSeparator: boolean }) {\n const title = ConditionalStringValue.getValue(item.label)!;\n const badge = BadgeUtilities.getComponentForBadgeType(item.badgeType);\n const { onItemExecuted } = useToolbarWithOverflowDirectionContext();\n const onExecute = React.useCallback(() => {\n item.execute();\n onItemExecuted(item);\n }, [item, onItemExecuted]);\n\n return <ToolbarButtonItem\n itemId={item.id}\n key={item.id}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title}\n icon={IconHelper.getIconReactNode(item.icon, item.internalData)}\n isActive={item.isActive}\n onClick={onExecute}\n badge={badge}\n addGroupSeparator={addGroupSeparator}\n />;\n}\n\n/** @internal */\nexport function ToolbarItemComponent({ item, addGroupSeparator }: { item: ToolbarItem, addGroupSeparator: boolean }) {\n if (ToolbarItemUtilities.isGroupButton(item)) {\n return <GroupPopupItem item={item} addGroupSeparator={addGroupSeparator} />;\n } else if (isCustomToolbarItem(item)) {\n return <CustomItem item={item} addGroupSeparator={addGroupSeparator} />;\n } else {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(item)) {\n return <ActionItem item={item} addGroupSeparator={addGroupSeparator} />;\n }\n }\n // istanbul ignore next\n return null;\n}\n\n/** @internal */\nexport function useToolbarWithOverflowDirectionContext() {\n return React.useContext(ToolbarWithOverflowDirectionContext);\n}\n\nfunction OverflowItemsContainer(p: { children: React.ReactNode }) {\n return <>{p.children}</>;\n}\n\nfunction getItemWrapperClass(child: React.ReactNode) {\n // istanbul ignore else\n if (React.isValidElement(child)) {\n if (child.props && child.props.addGroupSeparator)\n return \"components-toolbar-button-add-gap-before\";\n }\n return undefined;\n}\n\n/** Properties of [[ToolbarWithOverflow]] component.\n * @beta\n */\nexport interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n /** definitions for items of the toolbar. i.e. [[CommonToolbarItem]]. Items are expected to be already sorted by group and item. */\n items: CommonToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays tool settings as a bar across the top of the content view.\n * @beta\n */\nexport function ToolbarWithOverflow(props: ToolbarWithOverflowProps) {\n const expandsTo = props.expandsTo ? props.expandsTo : Direction.Bottom;\n const useDragInteraction = !!props.useDragInteraction;\n const panelAlignment = props.panelAlignment ? props.panelAlignment : ToolbarPanelAlignment.Start;\n const useHeight = (expandsTo === Direction.Right || expandsTo === Direction.Left);\n const [isOverflowPanelOpen, setIsOverflowPanelOpen] = React.useState(false);\n const [popupPanelCount, setPopupPanelCount] = React.useState(0);\n const overflowTitle = React.useRef(UiComponents.translate(\"toolbar.overflow\"));\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n });\n const handlePopupPanelOpenClose = React.useCallback((isOpening: boolean) => {\n // use setImmediate to avoid warning about setting state in ToolbarWithOverflow from render method of PopupItem/PopupItemWithDrag\n setImmediate(() => {\n // istanbul ignore next\n if (!isMounted.current)\n return;\n setPopupPanelCount((prev) => {\n const nextCount = isOpening ? (prev + 1) : (prev - 1);\n // eslint-disable-next-line no-console\n // console.log(`new popup count = ${nextCount}`);\n return nextCount < 0 ? /* istanbul ignore next */ 0 : nextCount;\n });\n });\n }, []);\n\n const ref = React.useRef<HTMLDivElement>(null);\n const width = React.useRef<number | undefined>(undefined);\n const availableNodes = React.useMemo<React.ReactNode>(() => {\n return props.items.map((item, index) => {\n let addGroupSeparator = false;\n if (index > 0)\n addGroupSeparator = item.groupPriority !== props.items[index - 1].groupPriority;\n return (\n <ToolbarItemComponent\n key={item.id}\n item={item}\n addGroupSeparator={!!addGroupSeparator}\n />\n );\n });\n }, [props.items]);\n /* overflowItemKeys - keys of items to show in overflow panel\n * handleContainerResize - handler called when container <div> is resized.\n * handleOverflowResize - handler called when determining size of overflow indicator/button.\n * handleEntryResize - handler called when determining size of each item/button. */\n const [overflowItemKeys, handleContainerResize, handleOverflowResize, handleEntryResize] = useOverflow(availableNodes, panelAlignment === ToolbarPanelAlignment.End);\n // handler called by ResizeObserver\n const handleResize = React.useCallback((w: number) => {\n width.current = w;\n width.current !== undefined && handleContainerResize(width.current);\n }, [handleContainerResize]);\n const resizeObserverRef = useResizeObserverSingleDimension(handleResize, useHeight);\n const handleClick = React.useCallback(() => {\n setIsOverflowPanelOpen((prev) => !prev);\n }, []);\n // istanbul ignore next - NEEDSWORK add complete tests\n const handleClose = React.useCallback(() => {\n setIsOverflowPanelOpen(false);\n }, []);\n\n const refs = useRefs(ref, resizeObserverRef);\n const availableItems = React.Children.toArray(availableNodes);\n const displayedItems = availableItems.reduce<Array<[string, React.ReactNode]>>((acc, child, index) => {\n const key = getChildKey(child, index);\n if (!overflowItemKeys || overflowItemKeys.indexOf(key) < 0) {\n acc.push([key, child]);\n }\n return acc;\n }, []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const overflowPanelItems = overflowItemKeys ? availableItems.reduce<Array<[string, React.ReactNode]>>((acc, child, index) => {\n const key = getChildKey(child, index);\n if (overflowItemKeys.indexOf(key) >= 0) {\n acc.push([key, child]);\n }\n return acc;\n }, []) : [];\n\n const direction = getToolbarDirection(expandsTo);\n const overflowExpandsTo = undefined !== props.overflowExpandsTo ? props.overflowExpandsTo : Direction.Right;\n const addOverflowButton = React.useCallback((atStart: boolean) => {\n const overflowItems = !!atStart ? overflowPanelItems.reverse() : overflowPanelItems;\n return (<ToolbarItemContext.Provider\n value={{\n hasOverflow: false,\n useHeight,\n onResize: handleOverflowResize,\n }}\n >\n <ToolbarOverflowButton\n expandsTo={expandsTo}\n onClick={handleClick}\n onClose={handleClose}\n open={overflowItems.length > 0 && isOverflowPanelOpen}\n panelNode={\n <ToolbarOverflowPanel>\n <OverflowItemsContainer>\n {overflowItems.map(([key, child]) => {\n return (\n <ToolbarItemContext.Provider\n key={key}\n value={{\n hasOverflow: true,\n useHeight,\n onResize: () => { },\n }}\n >\n {<ItemWrapper className={getItemWrapperClass(child)}>{child}</ItemWrapper>}\n </ToolbarItemContext.Provider>\n );\n })}\n </OverflowItemsContainer>\n </ToolbarOverflowPanel>\n }\n title={overflowTitle.current}\n />\n </ToolbarItemContext.Provider>);\n }, [handleClick, handleClose, handleOverflowResize, isOverflowPanelOpen, expandsTo, overflowPanelItems, useHeight]);\n\n const className = classnames(\n \"components-toolbar-overflow-sizer\",\n OrthogonalDirectionHelpers.getCssClassName(direction),\n props.className);\n\n const showOverflowAtStart = (direction === OrthogonalDirection.Horizontal) && (panelAlignment === ToolbarPanelAlignment.End);\n /* The ItemWrapper is used to wrap the <Item> <ExpandableItem> with a <div> that specifies a ref that the sizing logic uses to determine the\n size of the item. */\n return (\n <ToolbarWithOverflowDirectionContext.Provider value={\n {\n expandsTo, direction, overflowExpandsTo, panelAlignment, useDragInteraction,\n toolbarOpacitySetting: undefined !== props.toolbarOpacitySetting ? props.toolbarOpacitySetting : ToolbarOpacitySetting.Proximity,\n overflowDirection: direction === OrthogonalDirection.Horizontal ? OrthogonalDirection.Vertical : OrthogonalDirection.Horizontal,\n openPopupCount: popupPanelCount,\n onPopupPanelOpenClose: handlePopupPanelOpenClose,\n overflowDisplayActive: overflowPanelItems.length > 0 && isOverflowPanelOpen,\n onItemExecuted: props.onItemExecuted ? props.onItemExecuted : () => { },\n onKeyDown: props.onKeyDown ? props.onKeyDown : /* istanbul ignore next */ (_e: React.KeyboardEvent) => { },\n }\n }>\n {(availableItems.length > 0) &&\n <div\n className={className}\n ref={refs}\n style={props.style}\n onKeyDown={props.onKeyDown}\n role=\"presentation\"\n >\n <ToolbarItems\n className=\"components-items\"\n direction={direction}\n >\n {(!overflowItemKeys || overflowItemKeys.length > 0) && showOverflowAtStart && addOverflowButton(true)}\n {displayedItems.map(([key, child]) => {\n const onEntryResize = handleEntryResize(key);\n return (\n <ToolbarItemContext.Provider\n key={key}\n value={{\n hasOverflow: false,\n useHeight,\n onResize: onEntryResize,\n }}\n >\n {<ItemWrapper className={getItemWrapperClass(child)}>{child}</ItemWrapper>}\n </ToolbarItemContext.Provider>\n );\n })}\n {(!overflowItemKeys || overflowItemKeys.length > 0) && !showOverflowAtStart && addOverflowButton(false)}\n\n </ToolbarItems>\n </div>\n }\n </ToolbarWithOverflowDirectionContext.Provider >\n );\n}\n\n/** Returns key of a child. Must be used along with React.Children.toArray to preserve the semantics of availableItems.\n * @internal\n */\nfunction getChildKey(child: React.ReactNode, index: number) {\n // istanbul ignore else\n if (React.isValidElement(child) && child.key !== null) {\n return child.key.toString();\n }\n // istanbul ignore next\n return index.toString();\n}\n\n/** Returns a subset of toolbar item entry keys that exceed given width and should be overflowItemKeys.\n * @internal\n */\nfunction determineOverflowItems(size: number, entries: ReadonlyArray<readonly [string, number]>, overflowButtonSize: number, overflowButtonAtStart: boolean): string[] {\n let toolbarSize = 0;\n const buttonPadding = 2;\n if (overflowButtonAtStart && entries.length > 0) {\n let i = entries.length - 1;\n for (; i >= 0; i--) {\n const w = entries[i][1] + buttonPadding;\n const newSettingsWidth = toolbarSize + w;\n if (newSettingsWidth > size) {\n toolbarSize += (overflowButtonSize + buttonPadding);\n break;\n }\n toolbarSize = newSettingsWidth;\n }\n if (i >= 0) {\n let j = i + 1;\n for (; j < entries.length; j++) {\n if (toolbarSize <= size)\n break;\n const w = entries[j][1] + buttonPadding;\n toolbarSize -= w;\n }\n\n return entries.slice(0, j).map((e) => e[0]);\n } else {\n return [];\n }\n } else {\n let i = 0;\n for (; i < entries.length; i++) {\n const w = entries[i][1] + buttonPadding;\n const newSettingsWidth = toolbarSize + w;\n if (newSettingsWidth > size) {\n toolbarSize += (overflowButtonSize + buttonPadding);\n break;\n }\n toolbarSize = newSettingsWidth;\n }\n let j = i;\n for (; j > 0; j--) {\n if (toolbarSize <= size)\n break;\n const w = entries[j][1] + buttonPadding;\n toolbarSize -= w;\n }\n\n return entries.slice(j).map((e) => e[0]);\n }\n}\n\n/** Hook that returns a list of overflowItemKeys availableItems.\n * @internal\n */\nfunction useOverflow(availableItems: React.ReactNode, overflowButtonAtStart: boolean): [\n ReadonlyArray<string> | undefined,\n (size: number) => void,\n (size: number) => void,\n (key: string) => (size: number) => void,\n] {\n const [overflowItemKeys, setOverflown] = React.useState<ReadonlyArray<string>>();\n const itemSizes = React.useRef(new Map<string, number | undefined>());\n const size = React.useRef<number | undefined>(undefined);\n const overflowButtonSize = React.useRef<number | undefined>(undefined);\n\n const calculateOverflow = React.useCallback(() => {\n const sizes = verifiedMapEntries(itemSizes.current);\n if (size.current === undefined ||\n sizes === undefined ||\n overflowButtonSize.current === undefined) {\n setOverflown(undefined);\n return;\n }\n\n // Calculate overflow.\n const newOverflown = determineOverflowItems(size.current, [...sizes.entries()], overflowButtonSize.current, overflowButtonAtStart);\n setOverflown((prevOverflown) => {\n return eql(prevOverflown, newOverflown) ? prevOverflown : newOverflown;\n });\n }, [overflowButtonAtStart]);\n\n React.useLayoutEffect(() => {\n const newEntryWidths = new Map<string, number | undefined>();\n const array = React.Children.toArray(availableItems);\n for (let i = 0; i < array.length; i++) {\n const child = array[i];\n const key = getChildKey(child, i);\n const lastW = itemSizes.current.get(key);\n newEntryWidths.set(key, lastW);\n }\n itemSizes.current = newEntryWidths;\n calculateOverflow();\n }, [availableItems, calculateOverflow]);\n\n const handleContainerResize = React.useCallback((w: number) => {\n const calculate = size.current !== w;\n size.current = w;\n calculate && calculateOverflow();\n }, [calculateOverflow]);\n\n const handleOverflowResize = React.useCallback((w: number) => {\n const calculate = overflowButtonSize.current !== w;\n overflowButtonSize.current = w;\n calculate && calculateOverflow();\n }, [calculateOverflow]);\n\n const handleEntryResize = React.useCallback((key: string) => (w: number) => {\n const oldW = itemSizes.current.get(key);\n if (oldW !== w) {\n itemSizes.current.set(key, w);\n calculateOverflow();\n }\n }, [calculateOverflow]);\n\n return [overflowItemKeys, handleContainerResize, handleOverflowResize, handleEntryResize];\n}\n\n/** Interface toolbars use to define context for its items.\n * @internal\n */\nexport interface ToolbarItemContextArgs {\n readonly hasOverflow: boolean;\n readonly useHeight: boolean;\n readonly onResize: (w: number) => void;\n}\n\n/** Interface toolbars use to define context for its items.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ToolbarItemContext = React.createContext<ToolbarItemContextArgs>(null!);\n\n/** @internal */\nexport function useToolItemEntryContext() {\n return React.useContext(ToolbarItemContext);\n}\n\nfunction verifiedMapEntries<T>(map: Map<string, T | undefined>) {\n for (const [, val] of map) {\n // istanbul ignore next during unit testing\n if (val === undefined)\n return undefined;\n }\n return map as Map<string, T>;\n}\n\nfunction eql(prev: readonly string[] | undefined, value: readonly string[]) {\n if (!prev)\n return false;\n // istanbul ignore next\n if (prev.length !== value.length)\n return false;\n for (let i = 0; i < prev.length; i++) {\n const p = prev[i];\n const v = value[i];\n // istanbul ignore next\n if (p !== v)\n return false;\n }\n return true;\n}\n"]}
1
+ {"version":3,"file":"ToolbarWithOverflow.js","sourceRoot":"","sources":["../../../src/components-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0BAAwB;AACxB,4DAAoC;AACpC,6CAA+B;AAC/B,0DAG+B;AAC/B,kDAAsG;AACtG,iCAA2C;AAC3C,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GAAG,EAAE,CAAC,CAAC,CAAC;YAC9B,iBAAiB,EAAE,CAAC;SACrB;IACH,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;AAC5F,CAAC;AAWD;;GAEG;AACH,gEAAgE;AACnD,QAAA,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAyB,IAAK,CAAC,CAAC;AAErF,gBAAgB;AAChB,SAAgB,uBAAuB;IACrC,OAAO,KAAK,CAAC,UAAU,CAAC,0BAAkB,CAAC,CAAC;AAC9C,CAAC;AAFD,0DAEC;AAED,SAAS,kBAAkB,CAAI,GAA+B;IAC5D,KAAK,MAAM,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,EAAE;QACzB,4CAA4C;QAC5C,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;KACpB;IACD,OAAO,GAAqB,CAAC;AAC/B,CAAC;AAED,SAAS,GAAG,CAAC,IAAmC,EAAE,KAAwB;IACxE,IAAI,CAAC,IAAI;QACP,OAAO,KAAK,CAAC;IACf,uBAAuB;IACvB,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAC9B,OAAO,KAAK,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,uBAAuB;QACvB,IAAI,CAAC,KAAK,CAAC;YACT,OAAO,KAAK,CAAC;KAChB;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport \"./Toolbar.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport {\n ActionButton, CommonToolbarItem, ConditionalBooleanValue, ConditionalStringValue, CustomButtonDefinition,\n GroupButton, OnItemExecutedFunc, ToolbarItemUtilities,\n} from \"@itwin/appui-abstract\";\nimport { BadgeUtilities, CommonProps, IconHelper, NoChildrenProps, useRefs } from \"@itwin/core-react\";\nimport { ToolbarButtonItem } from \"./Item\";\nimport { ToolbarItems } from \"./Items\";\nimport { ItemWrapper, useResizeObserverSingleDimension } from \"./ItemWrapper\";\nimport { ToolbarOverflowButton } from \"./Overflow\";\nimport { ToolbarOverflowPanel } from \"./OverflowPanel\";\nimport { PopupItem } from \"./PopupItem\";\nimport { PopupItemsPanel } from \"./PopupItemsPanel\";\nimport { PopupItemWithDrag } from \"./PopupItemWithDrag\";\nimport { Direction, DirectionHelpers, OrthogonalDirection, OrthogonalDirectionHelpers } from \"./utilities/Direction\";\nimport { UiComponents } from \"../UiComponents\";\n\n/** Describes the data needed to insert a custom framework-specific button into an ToolbarWithOverflow.\n * @public\n */\nexport interface CustomToolbarItem extends CustomButtonDefinition {\n buttonNode?: React.ReactNode;\n panelContentNode?: React.ReactNode;\n}\n\n/** Describes toolbar item.\n * @public\n */\nexport type ToolbarItem = ActionButton | GroupButton | CustomToolbarItem;\n\n/** CustomToolbarItem type guard.\n * @internal\n */\nexport function isCustomToolbarItem(item: ToolbarItem): item is CustomToolbarItem {\n return !!(item as CustomToolbarItem).isCustom && ((\"buttonNode\" in item) || (\"panelContentNode\" in item));\n}\n\n/** @internal */\nexport const getToolbarDirection = (expandsTo: Direction): OrthogonalDirection => {\n const orthogonalDirection = DirectionHelpers.getOrthogonalDirection(expandsTo);\n return OrthogonalDirectionHelpers.inverse(orthogonalDirection);\n};\n\n/** Available alignment modes of [[ToolbarWithOverflow]] panels.\n * @public\n */\nexport enum ToolbarPanelAlignment {\n Start,\n End,\n}\n\n/** Enumeration of Toolbar Opacity setting.\n * @public\n */\nexport enum ToolbarOpacitySetting {\n /** Use the default background, box-shadow opacity and backdrop-filter blur */\n Defaults,\n /** Alter the opacity from transparent to the defaults based on mouse proximity */\n Proximity,\n /** Use a transparent background, box-shadow opacity and backdrop-filter blur */\n Transparent,\n}\n\n/** Helpers for [[ToolbarPanelAlignment]].\n * @internal\n */\nexport class ToolbarPanelAlignmentHelpers {\n /** Class name of [[ToolbarPanelAlignment.Start]] */\n public static readonly START_CLASS_NAME = \"components-panel-alignment-start\";\n /** Class name of [[ToolbarPanelAlignment.End]] */\n public static readonly END_CLASS_NAME = \"components-panel-alignment-end\";\n\n /** @returns Class name of specified [[ToolbarPanelAlignment]] */\n public static getCssClassName(panelAlignment: ToolbarPanelAlignment): string {\n switch (panelAlignment) {\n case ToolbarPanelAlignment.Start:\n return ToolbarPanelAlignmentHelpers.START_CLASS_NAME;\n case ToolbarPanelAlignment.End:\n return ToolbarPanelAlignmentHelpers.END_CLASS_NAME;\n }\n }\n}\n\n/** @internal */\nexport interface ToolbarOverflowContextProps {\n readonly expandsTo: Direction;\n readonly direction: OrthogonalDirection;\n readonly overflowExpandsTo: Direction;\n readonly overflowDirection: OrthogonalDirection;\n readonly panelAlignment: ToolbarPanelAlignment;\n readonly useDragInteraction: boolean;\n readonly toolbarOpacitySetting: ToolbarOpacitySetting;\n readonly openPopupCount: number;\n readonly onPopupPanelOpenClose: (isOpening: boolean) => void;\n readonly overflowDisplayActive: boolean;\n readonly onItemExecuted: OnItemExecutedFunc;\n readonly onKeyDown: (e: React.KeyboardEvent) => void;\n}\n\n/**\n * Context used by Toolbar component to provide Direction to child components.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ToolbarWithOverflowDirectionContext = React.createContext<ToolbarOverflowContextProps>({\n expandsTo: Direction.Bottom,\n direction: OrthogonalDirection.Horizontal,\n overflowExpandsTo: Direction.Right,\n overflowDirection: OrthogonalDirection.Vertical,\n panelAlignment: ToolbarPanelAlignment.Start,\n useDragInteraction: false,\n toolbarOpacitySetting: ToolbarOpacitySetting.Proximity,\n openPopupCount: 0,\n onPopupPanelOpenClose: /* istanbul ignore next */ (_isOpening: boolean) => { },\n overflowDisplayActive: false,\n onItemExecuted: /* istanbul ignore next */ (_item: any) => void {},\n onKeyDown: /* istanbul ignore next */ (_e: React.KeyboardEvent) => void {},\n});\n\n/** @internal */\nexport function CustomItem({ item, addGroupSeparator }: { item: CustomToolbarItem, addGroupSeparator: boolean }) {\n const { useDragInteraction } = useToolbarWithOverflowDirectionContext();\n\n if (item.panelContentNode) {\n const badge = BadgeUtilities.getComponentForBadgeType(item.badgeType);\n const title = ConditionalStringValue.getValue(item.label);\n return <PopupItem\n key={item.id}\n itemId={item.id}\n icon={item.icon ? IconHelper.getIconReactNode(item.icon, item.internalData) : /* istanbul ignore next */ <i className=\"icon icon-placeholder\" />}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title ? title : /* istanbul ignore next */ item.id}\n panel={item.panelContentNode}\n hideIndicator={useDragInteraction}\n badge={badge}\n addGroupSeparator={addGroupSeparator}\n />;\n }\n\n // istanbul ignore else\n if (item.buttonNode)\n return <>{item.buttonNode}</>;\n\n // istanbul ignore next\n return null;\n}\n\n/** @internal */\nexport function GroupPopupItem({ item, addGroupSeparator }: { item: GroupButton, addGroupSeparator: boolean }) {\n const { useDragInteraction } = useToolbarWithOverflowDirectionContext();\n const title = ConditionalStringValue.getValue(item.label)!;\n const badge = BadgeUtilities.getComponentForBadgeType(item.badgeType);\n\n if (useDragInteraction) {\n return <PopupItemWithDrag\n key={item.id}\n itemId={item.id}\n icon={IconHelper.getIconReactNode(item.icon, item.internalData)}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title}\n groupItem={item}\n badge={badge}\n addGroupSeparator={addGroupSeparator}\n />;\n }\n return <PopupItem\n key={item.id}\n itemId={item.id}\n icon={IconHelper.getIconReactNode(item.icon, item.internalData)}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title}\n panel={<PopupItemsPanel groupItem={item} activateOnPointerUp={false} />}\n badge={badge}\n hideIndicator={useDragInteraction}\n addGroupSeparator={addGroupSeparator}\n />;\n}\n\n/** @internal */\nexport function ActionItem({ item, addGroupSeparator }: { item: ActionButton, addGroupSeparator: boolean }) {\n const title = ConditionalStringValue.getValue(item.label)!;\n const badge = BadgeUtilities.getComponentForBadgeType(item.badgeType);\n const { onItemExecuted } = useToolbarWithOverflowDirectionContext();\n const onExecute = React.useCallback(() => {\n item.execute();\n onItemExecuted(item);\n }, [item, onItemExecuted]);\n\n return <ToolbarButtonItem\n itemId={item.id}\n key={item.id}\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\n title={title}\n icon={IconHelper.getIconReactNode(item.icon, item.internalData)}\n isActive={item.isActive}\n onClick={onExecute}\n badge={badge}\n addGroupSeparator={addGroupSeparator}\n />;\n}\n\n/** @internal */\nexport function ToolbarItemComponent({ item, addGroupSeparator }: { item: ToolbarItem, addGroupSeparator: boolean }) {\n if (ToolbarItemUtilities.isGroupButton(item)) {\n return <GroupPopupItem item={item} addGroupSeparator={addGroupSeparator} />;\n } else if (isCustomToolbarItem(item)) {\n return <CustomItem item={item} addGroupSeparator={addGroupSeparator} />;\n } else {\n // istanbul ignore else\n if (ToolbarItemUtilities.isActionButton(item)) {\n return <ActionItem item={item} addGroupSeparator={addGroupSeparator} />;\n }\n }\n // istanbul ignore next\n return null;\n}\n\n/** @internal */\nexport function useToolbarWithOverflowDirectionContext() {\n return React.useContext(ToolbarWithOverflowDirectionContext);\n}\n\nfunction OverflowItemsContainer(p: { children: React.ReactNode }) {\n return <>{p.children}</>;\n}\n\nfunction getItemWrapperClass(child: React.ReactNode) {\n // istanbul ignore else\n if (React.isValidElement(child)) {\n if (child.props && child.props.addGroupSeparator)\n return \"components-toolbar-button-add-gap-before\";\n }\n return undefined;\n}\n\n/** Properties of [[ToolbarWithOverflow]] component.\n * @public\n */\nexport interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n /** definitions for items of the toolbar. i.e. [[CommonToolbarItem]]. Items are expected to be already sorted by group and item. */\n items: CommonToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays tool settings as a bar across the top of the content view.\n * @public\n */\nexport function ToolbarWithOverflow(props: ToolbarWithOverflowProps) {\n const expandsTo = props.expandsTo ? props.expandsTo : Direction.Bottom;\n const useDragInteraction = !!props.useDragInteraction;\n const panelAlignment = props.panelAlignment ? props.panelAlignment : ToolbarPanelAlignment.Start;\n const useHeight = (expandsTo === Direction.Right || expandsTo === Direction.Left);\n const [isOverflowPanelOpen, setIsOverflowPanelOpen] = React.useState(false);\n const [popupPanelCount, setPopupPanelCount] = React.useState(0);\n const overflowTitle = React.useRef(UiComponents.translate(\"toolbar.overflow\"));\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n });\n const handlePopupPanelOpenClose = React.useCallback((isOpening: boolean) => {\n // use setImmediate to avoid warning about setting state in ToolbarWithOverflow from render method of PopupItem/PopupItemWithDrag\n setImmediate(() => {\n // istanbul ignore next\n if (!isMounted.current)\n return;\n setPopupPanelCount((prev) => {\n const nextCount = isOpening ? (prev + 1) : (prev - 1);\n // eslint-disable-next-line no-console\n // console.log(`new popup count = ${nextCount}`);\n return nextCount < 0 ? /* istanbul ignore next */ 0 : nextCount;\n });\n });\n }, []);\n\n const ref = React.useRef<HTMLDivElement>(null);\n const width = React.useRef<number | undefined>(undefined);\n const availableNodes = React.useMemo<React.ReactNode>(() => {\n return props.items.map((item, index) => {\n let addGroupSeparator = false;\n if (index > 0)\n addGroupSeparator = item.groupPriority !== props.items[index - 1].groupPriority;\n return (\n <ToolbarItemComponent\n key={item.id}\n item={item}\n addGroupSeparator={!!addGroupSeparator}\n />\n );\n });\n }, [props.items]);\n /* overflowItemKeys - keys of items to show in overflow panel\n * handleContainerResize - handler called when container <div> is resized.\n * handleOverflowResize - handler called when determining size of overflow indicator/button.\n * handleEntryResize - handler called when determining size of each item/button. */\n const [overflowItemKeys, handleContainerResize, handleOverflowResize, handleEntryResize] = useOverflow(availableNodes, panelAlignment === ToolbarPanelAlignment.End);\n // handler called by ResizeObserver\n const handleResize = React.useCallback((w: number) => {\n width.current = w;\n width.current !== undefined && handleContainerResize(width.current);\n }, [handleContainerResize]);\n const resizeObserverRef = useResizeObserverSingleDimension(handleResize, useHeight);\n const handleClick = React.useCallback(() => {\n setIsOverflowPanelOpen((prev) => !prev);\n }, []);\n // istanbul ignore next - NEEDSWORK add complete tests\n const handleClose = React.useCallback(() => {\n setIsOverflowPanelOpen(false);\n }, []);\n\n const refs = useRefs(ref, resizeObserverRef);\n const availableItems = React.Children.toArray(availableNodes);\n const displayedItems = availableItems.reduce<Array<[string, React.ReactNode]>>((acc, child, index) => {\n const key = getChildKey(child, index);\n if (!overflowItemKeys || overflowItemKeys.indexOf(key) < 0) {\n acc.push([key, child]);\n }\n return acc;\n }, []);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const overflowPanelItems = overflowItemKeys ? availableItems.reduce<Array<[string, React.ReactNode]>>((acc, child, index) => {\n const key = getChildKey(child, index);\n if (overflowItemKeys.indexOf(key) >= 0) {\n acc.push([key, child]);\n }\n return acc;\n }, []) : [];\n\n const direction = getToolbarDirection(expandsTo);\n const overflowExpandsTo = undefined !== props.overflowExpandsTo ? props.overflowExpandsTo : Direction.Right;\n const addOverflowButton = React.useCallback((atStart: boolean) => {\n const overflowItems = !!atStart ? overflowPanelItems.reverse() : overflowPanelItems;\n return (<ToolbarItemContext.Provider\n value={{\n hasOverflow: false,\n useHeight,\n onResize: handleOverflowResize,\n }}\n >\n <ToolbarOverflowButton\n expandsTo={expandsTo}\n onClick={handleClick}\n onClose={handleClose}\n open={overflowItems.length > 0 && isOverflowPanelOpen}\n panelNode={\n <ToolbarOverflowPanel>\n <OverflowItemsContainer>\n {overflowItems.map(([key, child]) => {\n return (\n <ToolbarItemContext.Provider\n key={key}\n value={{\n hasOverflow: true,\n useHeight,\n onResize: () => { },\n }}\n >\n {<ItemWrapper className={getItemWrapperClass(child)}>{child}</ItemWrapper>}\n </ToolbarItemContext.Provider>\n );\n })}\n </OverflowItemsContainer>\n </ToolbarOverflowPanel>\n }\n title={overflowTitle.current}\n />\n </ToolbarItemContext.Provider>);\n }, [handleClick, handleClose, handleOverflowResize, isOverflowPanelOpen, expandsTo, overflowPanelItems, useHeight]);\n\n const className = classnames(\n \"components-toolbar-overflow-sizer\",\n OrthogonalDirectionHelpers.getCssClassName(direction),\n props.className);\n\n const showOverflowAtStart = (direction === OrthogonalDirection.Horizontal) && (panelAlignment === ToolbarPanelAlignment.End);\n /* The ItemWrapper is used to wrap the <Item> <ExpandableItem> with a <div> that specifies a ref that the sizing logic uses to determine the\n size of the item. */\n return (\n <ToolbarWithOverflowDirectionContext.Provider value={\n {\n expandsTo, direction, overflowExpandsTo, panelAlignment, useDragInteraction,\n toolbarOpacitySetting: undefined !== props.toolbarOpacitySetting ? props.toolbarOpacitySetting : ToolbarOpacitySetting.Proximity,\n overflowDirection: direction === OrthogonalDirection.Horizontal ? OrthogonalDirection.Vertical : OrthogonalDirection.Horizontal,\n openPopupCount: popupPanelCount,\n onPopupPanelOpenClose: handlePopupPanelOpenClose,\n overflowDisplayActive: overflowPanelItems.length > 0 && isOverflowPanelOpen,\n onItemExecuted: props.onItemExecuted ? props.onItemExecuted : () => { },\n onKeyDown: props.onKeyDown ? props.onKeyDown : /* istanbul ignore next */ (_e: React.KeyboardEvent) => { },\n }\n }>\n {(availableItems.length > 0) &&\n <div\n className={className}\n ref={refs}\n style={props.style}\n onKeyDown={props.onKeyDown}\n role=\"presentation\"\n >\n <ToolbarItems\n className=\"components-items\"\n direction={direction}\n >\n {(!overflowItemKeys || overflowItemKeys.length > 0) && showOverflowAtStart && addOverflowButton(true)}\n {displayedItems.map(([key, child]) => {\n const onEntryResize = handleEntryResize(key);\n return (\n <ToolbarItemContext.Provider\n key={key}\n value={{\n hasOverflow: false,\n useHeight,\n onResize: onEntryResize,\n }}\n >\n {<ItemWrapper className={getItemWrapperClass(child)}>{child}</ItemWrapper>}\n </ToolbarItemContext.Provider>\n );\n })}\n {(!overflowItemKeys || overflowItemKeys.length > 0) && !showOverflowAtStart && addOverflowButton(false)}\n\n </ToolbarItems>\n </div>\n }\n </ToolbarWithOverflowDirectionContext.Provider >\n );\n}\n\n/** Returns key of a child. Must be used along with React.Children.toArray to preserve the semantics of availableItems.\n * @internal\n */\nfunction getChildKey(child: React.ReactNode, index: number) {\n // istanbul ignore else\n if (React.isValidElement(child) && child.key !== null) {\n return child.key.toString();\n }\n // istanbul ignore next\n return index.toString();\n}\n\n/** Returns a subset of toolbar item entry keys that exceed given width and should be overflowItemKeys.\n * @internal\n */\nfunction determineOverflowItems(size: number, entries: ReadonlyArray<readonly [string, number]>, overflowButtonSize: number, overflowButtonAtStart: boolean): string[] {\n let toolbarSize = 0;\n const buttonPadding = 2;\n if (overflowButtonAtStart && entries.length > 0) {\n let i = entries.length - 1;\n for (; i >= 0; i--) {\n const w = entries[i][1] + buttonPadding;\n const newSettingsWidth = toolbarSize + w;\n if (newSettingsWidth > size) {\n toolbarSize += (overflowButtonSize + buttonPadding);\n break;\n }\n toolbarSize = newSettingsWidth;\n }\n if (i >= 0) {\n let j = i + 1;\n for (; j < entries.length; j++) {\n if (toolbarSize <= size)\n break;\n const w = entries[j][1] + buttonPadding;\n toolbarSize -= w;\n }\n\n return entries.slice(0, j).map((e) => e[0]);\n } else {\n return [];\n }\n } else {\n let i = 0;\n for (; i < entries.length; i++) {\n const w = entries[i][1] + buttonPadding;\n const newSettingsWidth = toolbarSize + w;\n if (newSettingsWidth > size) {\n toolbarSize += (overflowButtonSize + buttonPadding);\n break;\n }\n toolbarSize = newSettingsWidth;\n }\n let j = i;\n for (; j > 0; j--) {\n if (toolbarSize <= size)\n break;\n const w = entries[j][1] + buttonPadding;\n toolbarSize -= w;\n }\n\n return entries.slice(j).map((e) => e[0]);\n }\n}\n\n/** Hook that returns a list of overflowItemKeys availableItems.\n * @internal\n */\nfunction useOverflow(availableItems: React.ReactNode, overflowButtonAtStart: boolean): [\n ReadonlyArray<string> | undefined,\n (size: number) => void,\n (size: number) => void,\n (key: string) => (size: number) => void,\n] {\n const [overflowItemKeys, setOverflown] = React.useState<ReadonlyArray<string>>();\n const itemSizes = React.useRef(new Map<string, number | undefined>());\n const size = React.useRef<number | undefined>(undefined);\n const overflowButtonSize = React.useRef<number | undefined>(undefined);\n\n const calculateOverflow = React.useCallback(() => {\n const sizes = verifiedMapEntries(itemSizes.current);\n if (size.current === undefined ||\n sizes === undefined ||\n overflowButtonSize.current === undefined) {\n setOverflown(undefined);\n return;\n }\n\n // Calculate overflow.\n const newOverflown = determineOverflowItems(size.current, [...sizes.entries()], overflowButtonSize.current, overflowButtonAtStart);\n setOverflown((prevOverflown) => {\n return eql(prevOverflown, newOverflown) ? prevOverflown : newOverflown;\n });\n }, [overflowButtonAtStart]);\n\n React.useLayoutEffect(() => {\n const newEntryWidths = new Map<string, number | undefined>();\n const array = React.Children.toArray(availableItems);\n for (let i = 0; i < array.length; i++) {\n const child = array[i];\n const key = getChildKey(child, i);\n const lastW = itemSizes.current.get(key);\n newEntryWidths.set(key, lastW);\n }\n itemSizes.current = newEntryWidths;\n calculateOverflow();\n }, [availableItems, calculateOverflow]);\n\n const handleContainerResize = React.useCallback((w: number) => {\n const calculate = size.current !== w;\n size.current = w;\n calculate && calculateOverflow();\n }, [calculateOverflow]);\n\n const handleOverflowResize = React.useCallback((w: number) => {\n const calculate = overflowButtonSize.current !== w;\n overflowButtonSize.current = w;\n calculate && calculateOverflow();\n }, [calculateOverflow]);\n\n const handleEntryResize = React.useCallback((key: string) => (w: number) => {\n const oldW = itemSizes.current.get(key);\n if (oldW !== w) {\n itemSizes.current.set(key, w);\n calculateOverflow();\n }\n }, [calculateOverflow]);\n\n return [overflowItemKeys, handleContainerResize, handleOverflowResize, handleEntryResize];\n}\n\n/** Interface toolbars use to define context for its items.\n * @internal\n */\nexport interface ToolbarItemContextArgs {\n readonly hasOverflow: boolean;\n readonly useHeight: boolean;\n readonly onResize: (w: number) => void;\n}\n\n/** Interface toolbars use to define context for its items.\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ToolbarItemContext = React.createContext<ToolbarItemContextArgs>(null!);\n\n/** @internal */\nexport function useToolItemEntryContext() {\n return React.useContext(ToolbarItemContext);\n}\n\nfunction verifiedMapEntries<T>(map: Map<string, T | undefined>) {\n for (const [, val] of map) {\n // istanbul ignore next during unit testing\n if (val === undefined)\n return undefined;\n }\n return map as Map<string, T>;\n}\n\nfunction eql(prev: readonly string[] | undefined, value: readonly string[]) {\n if (!prev)\n return false;\n // istanbul ignore next\n if (prev.length !== value.length)\n return false;\n for (let i = 0; i < prev.length; i++) {\n const p = prev[i];\n const v = value[i];\n // istanbul ignore next\n if (p !== v)\n return false;\n }\n return true;\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @module Toolbar
3
3
  */
4
4
  /** Available directions.
5
- * @beta
5
+ * @public
6
6
  */
7
7
  export declare enum Direction {
8
8
  Left = 1,
@@ -9,7 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.OrthogonalDirectionHelpers = exports.OrthogonalDirection = exports.DirectionHelpers = exports.Direction = void 0;
11
11
  /** Available directions.
12
- * @beta
12
+ * @public
13
13
  */
14
14
  var Direction;
15
15
  (function (Direction) {
@@ -1 +1 @@
1
- {"version":3,"file":"Direction.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/utilities/Direction.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,yCAAQ,CAAA;IACR,uCAAG,CAAA;IACH,2CAAK,CAAA;IACL,6CAAM,CAAA;AACR,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAED;;GAEG;AACH,MAAa,gBAAgB;IAU3B,qDAAqD;IAC9C,MAAM,CAAC,eAAe,CAAC,SAAoB;QAChD,QAAQ,SAAS,EAAE;YACjB,KAAK,SAAS,CAAC,IAAI;gBACjB,OAAO,gBAAgB,CAAC,eAAe,CAAC;YAC1C,KAAK,SAAS,CAAC,GAAG;gBAChB,OAAO,gBAAgB,CAAC,cAAc,CAAC;YACzC,KAAK,SAAS,CAAC,KAAK;gBAClB,OAAO,gBAAgB,CAAC,gBAAgB,CAAC;YAC3C,KAAK,SAAS,CAAC,MAAM;gBACnB,OAAO,gBAAgB,CAAC,iBAAiB,CAAC;SAC7C;IACH,CAAC;IAED,+DAA+D;IACxD,MAAM,CAAC,sBAAsB,CAAC,SAAoB;QACvD,QAAQ,SAAS,EAAE;YACjB,KAAK,SAAS,CAAC,IAAI,CAAC;YACpB,KAAK,SAAS,CAAC,KAAK;gBAClB,OAAO,mBAAmB,CAAC,UAAU,CAAC;YACxC,KAAK,SAAS,CAAC,GAAG,CAAC;YACnB,KAAK,SAAS,CAAC,MAAM;gBACnB,OAAO,mBAAmB,CAAC,QAAQ,CAAC;SACvC;IACH,CAAC;;AAlCH,4CAmCC;AAlCC,uCAAuC;AAChB,gCAAe,GAAG,2BAA2B,CAAC;AACrE,sCAAsC;AACf,+BAAc,GAAG,0BAA0B,CAAC;AACnE,wCAAwC;AACjB,iCAAgB,GAAG,4BAA4B,CAAC;AACvE,yCAAyC;AAClB,kCAAiB,GAAG,6BAA6B,CAAC;AA6B3E;;GAEG;AACH,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,qEAAQ,CAAA;IACR,yEAAU,CAAA;AACZ,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AAED;;GAEG;AACH,MAAa,0BAA0B;IAMrC,+DAA+D;IACxD,MAAM,CAAC,eAAe,CAAC,SAA8B;QAC1D,QAAQ,SAAS,EAAE;YACjB,KAAK,mBAAmB,CAAC,QAAQ;gBAC/B,OAAO,0BAA0B,CAAC,mBAAmB,CAAC;YACxD,KAAK,mBAAmB,CAAC,UAAU;gBACjC,OAAO,0BAA0B,CAAC,qBAAqB,CAAC;SAC3D;IACH,CAAC;IAED,6DAA6D;IACtD,MAAM,CAAC,OAAO,CAAC,SAA8B;QAClD,QAAQ,SAAS,EAAE;YACjB,KAAK,mBAAmB,CAAC,QAAQ;gBAC/B,OAAO,mBAAmB,CAAC,UAAU,CAAC;YACxC,KAAK,mBAAmB,CAAC,UAAU;gBACjC,OAAO,mBAAmB,CAAC,QAAQ,CAAC;SACvC;IACH,CAAC;;AAxBH,gEAyBC;AAxBC,qDAAqD;AAC9B,8CAAmB,GAAG,qBAAqB,CAAC;AACnE,uDAAuD;AAChC,gDAAqB,GAAG,uBAAuB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\n/** Available directions.\n * @beta\n */\nexport enum Direction {\n Left = 1,\n Top,\n Right,\n Bottom,\n}\n\n/** Helpers for [[Direction]].\n * @internal\n */\nexport class DirectionHelpers {\n /** Class name of [[Direction.Left]] */\n public static readonly LEFT_CLASS_NAME = \"components-direction-left\";\n /** Class name of [[Direction.Top]] */\n public static readonly TOP_CLASS_NAME = \"components-direction-top\";\n /** Class name of [[Direction.Right]] */\n public static readonly RIGHT_CLASS_NAME = \"components-direction-right\";\n /** Class name of [[Direction.Bottom]] */\n public static readonly BOTTOM_CLASS_NAME = \"components-direction-bottom\";\n\n /** @returns Class name of specified [[Direction]] */\n public static getCssClassName(direction: Direction): string {\n switch (direction) {\n case Direction.Left:\n return DirectionHelpers.LEFT_CLASS_NAME;\n case Direction.Top:\n return DirectionHelpers.TOP_CLASS_NAME;\n case Direction.Right:\n return DirectionHelpers.RIGHT_CLASS_NAME;\n case Direction.Bottom:\n return DirectionHelpers.BOTTOM_CLASS_NAME;\n }\n }\n\n /** @returns Orthogonal direction of specified [[Direction]] */\n public static getOrthogonalDirection(direction: Direction): OrthogonalDirection {\n switch (direction) {\n case Direction.Left:\n case Direction.Right:\n return OrthogonalDirection.Horizontal;\n case Direction.Top:\n case Direction.Bottom:\n return OrthogonalDirection.Vertical;\n }\n }\n}\n\n/** Available orthogonal directions.\n * @alpha\n */\nexport enum OrthogonalDirection {\n Vertical,\n Horizontal,\n}\n\n/** Helpers for [[OrthogonalDirection]].\n * @internal\n */\nexport class OrthogonalDirectionHelpers {\n /** Class name of [[OrthogonalDirection.Vertical]] */\n public static readonly VERTICAL_CLASS_NAME = \"components-vertical\";\n /** Class name of [[OrthogonalDirection.Horizontal]] */\n public static readonly HORIZONTAL_CLASS_NAME = \"components-horizontal\";\n\n /** @returns Class name of specified [[OrthogonalDirection]] */\n public static getCssClassName(direction: OrthogonalDirection): string {\n switch (direction) {\n case OrthogonalDirection.Vertical:\n return OrthogonalDirectionHelpers.VERTICAL_CLASS_NAME;\n case OrthogonalDirection.Horizontal:\n return OrthogonalDirectionHelpers.HORIZONTAL_CLASS_NAME;\n }\n }\n\n /** @returns Opposite of specified [[OrthogonalDirection]] */\n public static inverse(direction: OrthogonalDirection): OrthogonalDirection {\n switch (direction) {\n case OrthogonalDirection.Vertical:\n return OrthogonalDirection.Horizontal;\n case OrthogonalDirection.Horizontal:\n return OrthogonalDirection.Vertical;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"Direction.js","sourceRoot":"","sources":["../../../../src/components-react/toolbar/utilities/Direction.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,yCAAQ,CAAA;IACR,uCAAG,CAAA;IACH,2CAAK,CAAA;IACL,6CAAM,CAAA;AACR,CAAC,EALW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAKpB;AAED;;GAEG;AACH,MAAa,gBAAgB;IAU3B,qDAAqD;IAC9C,MAAM,CAAC,eAAe,CAAC,SAAoB;QAChD,QAAQ,SAAS,EAAE;YACjB,KAAK,SAAS,CAAC,IAAI;gBACjB,OAAO,gBAAgB,CAAC,eAAe,CAAC;YAC1C,KAAK,SAAS,CAAC,GAAG;gBAChB,OAAO,gBAAgB,CAAC,cAAc,CAAC;YACzC,KAAK,SAAS,CAAC,KAAK;gBAClB,OAAO,gBAAgB,CAAC,gBAAgB,CAAC;YAC3C,KAAK,SAAS,CAAC,MAAM;gBACnB,OAAO,gBAAgB,CAAC,iBAAiB,CAAC;SAC7C;IACH,CAAC;IAED,+DAA+D;IACxD,MAAM,CAAC,sBAAsB,CAAC,SAAoB;QACvD,QAAQ,SAAS,EAAE;YACjB,KAAK,SAAS,CAAC,IAAI,CAAC;YACpB,KAAK,SAAS,CAAC,KAAK;gBAClB,OAAO,mBAAmB,CAAC,UAAU,CAAC;YACxC,KAAK,SAAS,CAAC,GAAG,CAAC;YACnB,KAAK,SAAS,CAAC,MAAM;gBACnB,OAAO,mBAAmB,CAAC,QAAQ,CAAC;SACvC;IACH,CAAC;;AAlCH,4CAmCC;AAlCC,uCAAuC;AAChB,gCAAe,GAAG,2BAA2B,CAAC;AACrE,sCAAsC;AACf,+BAAc,GAAG,0BAA0B,CAAC;AACnE,wCAAwC;AACjB,iCAAgB,GAAG,4BAA4B,CAAC;AACvE,yCAAyC;AAClB,kCAAiB,GAAG,6BAA6B,CAAC;AA6B3E;;GAEG;AACH,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,qEAAQ,CAAA;IACR,yEAAU,CAAA;AACZ,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AAED;;GAEG;AACH,MAAa,0BAA0B;IAMrC,+DAA+D;IACxD,MAAM,CAAC,eAAe,CAAC,SAA8B;QAC1D,QAAQ,SAAS,EAAE;YACjB,KAAK,mBAAmB,CAAC,QAAQ;gBAC/B,OAAO,0BAA0B,CAAC,mBAAmB,CAAC;YACxD,KAAK,mBAAmB,CAAC,UAAU;gBACjC,OAAO,0BAA0B,CAAC,qBAAqB,CAAC;SAC3D;IACH,CAAC;IAED,6DAA6D;IACtD,MAAM,CAAC,OAAO,CAAC,SAA8B;QAClD,QAAQ,SAAS,EAAE;YACjB,KAAK,mBAAmB,CAAC,QAAQ;gBAC/B,OAAO,mBAAmB,CAAC,UAAU,CAAC;YACxC,KAAK,mBAAmB,CAAC,UAAU;gBACjC,OAAO,mBAAmB,CAAC,QAAQ,CAAC;SACvC;IACH,CAAC;;AAxBH,gEAyBC;AAxBC,qDAAqD;AAC9B,8CAAmB,GAAG,qBAAqB,CAAC;AACnE,uDAAuD;AAChC,gDAAqB,GAAG,uBAAuB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\n/** Available directions.\n * @public\n */\nexport enum Direction {\n Left = 1,\n Top,\n Right,\n Bottom,\n}\n\n/** Helpers for [[Direction]].\n * @internal\n */\nexport class DirectionHelpers {\n /** Class name of [[Direction.Left]] */\n public static readonly LEFT_CLASS_NAME = \"components-direction-left\";\n /** Class name of [[Direction.Top]] */\n public static readonly TOP_CLASS_NAME = \"components-direction-top\";\n /** Class name of [[Direction.Right]] */\n public static readonly RIGHT_CLASS_NAME = \"components-direction-right\";\n /** Class name of [[Direction.Bottom]] */\n public static readonly BOTTOM_CLASS_NAME = \"components-direction-bottom\";\n\n /** @returns Class name of specified [[Direction]] */\n public static getCssClassName(direction: Direction): string {\n switch (direction) {\n case Direction.Left:\n return DirectionHelpers.LEFT_CLASS_NAME;\n case Direction.Top:\n return DirectionHelpers.TOP_CLASS_NAME;\n case Direction.Right:\n return DirectionHelpers.RIGHT_CLASS_NAME;\n case Direction.Bottom:\n return DirectionHelpers.BOTTOM_CLASS_NAME;\n }\n }\n\n /** @returns Orthogonal direction of specified [[Direction]] */\n public static getOrthogonalDirection(direction: Direction): OrthogonalDirection {\n switch (direction) {\n case Direction.Left:\n case Direction.Right:\n return OrthogonalDirection.Horizontal;\n case Direction.Top:\n case Direction.Bottom:\n return OrthogonalDirection.Vertical;\n }\n }\n}\n\n/** Available orthogonal directions.\n * @alpha\n */\nexport enum OrthogonalDirection {\n Vertical,\n Horizontal,\n}\n\n/** Helpers for [[OrthogonalDirection]].\n * @internal\n */\nexport class OrthogonalDirectionHelpers {\n /** Class name of [[OrthogonalDirection.Vertical]] */\n public static readonly VERTICAL_CLASS_NAME = \"components-vertical\";\n /** Class name of [[OrthogonalDirection.Horizontal]] */\n public static readonly HORIZONTAL_CLASS_NAME = \"components-horizontal\";\n\n /** @returns Class name of specified [[OrthogonalDirection]] */\n public static getCssClassName(direction: OrthogonalDirection): string {\n switch (direction) {\n case OrthogonalDirection.Vertical:\n return OrthogonalDirectionHelpers.VERTICAL_CLASS_NAME;\n case OrthogonalDirection.Horizontal:\n return OrthogonalDirectionHelpers.HORIZONTAL_CLASS_NAME;\n }\n }\n\n /** @returns Opposite of specified [[OrthogonalDirection]] */\n public static inverse(direction: OrthogonalDirection): OrthogonalDirection {\n switch (direction) {\n case OrthogonalDirection.Vertical:\n return OrthogonalDirection.Horizontal;\n case OrthogonalDirection.Horizontal:\n return OrthogonalDirection.Vertical;\n }\n }\n}\n"]}
@@ -31,7 +31,7 @@ export interface HighlightableTreeNodeProps {
31
31
  }
32
32
  /**
33
33
  * Tree highlighting engine
34
- * @beta
34
+ * @public
35
35
  */
36
36
  export declare class HighlightingEngine {
37
37
  private _searchText;