@ui5/webcomponents 2.20.0-rc.3 → 2.21.0-rc.0

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 (181) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/Breadcrumbs.d.ts +3 -3
  4. package/dist/Breadcrumbs.js +1 -1
  5. package/dist/Breadcrumbs.js.map +1 -1
  6. package/dist/Button.d.ts +6 -0
  7. package/dist/Button.js +11 -2
  8. package/dist/Button.js.map +1 -1
  9. package/dist/Carousel.d.ts +14 -13
  10. package/dist/Carousel.js +93 -177
  11. package/dist/Carousel.js.map +1 -1
  12. package/dist/CarouselTemplate.js +2 -2
  13. package/dist/CarouselTemplate.js.map +1 -1
  14. package/dist/ColorPaletteTemplate.js +1 -1
  15. package/dist/ColorPaletteTemplate.js.map +1 -1
  16. package/dist/DatePicker.js +2 -2
  17. package/dist/DatePicker.js.map +1 -1
  18. package/dist/DayPickerTemplate.js +1 -1
  19. package/dist/DayPickerTemplate.js.map +1 -1
  20. package/dist/Dialog.d.ts +0 -3
  21. package/dist/Dialog.js +3 -1
  22. package/dist/Dialog.js.map +1 -1
  23. package/dist/Icon.d.ts +1 -1
  24. package/dist/Icon.js +12 -4
  25. package/dist/Icon.js.map +1 -1
  26. package/dist/IconTemplate.js +1 -1
  27. package/dist/IconTemplate.js.map +1 -1
  28. package/dist/Input.d.ts +2 -1
  29. package/dist/Input.js +38 -16
  30. package/dist/Input.js.map +1 -1
  31. package/dist/Menu.js +6 -1
  32. package/dist/Menu.js.map +1 -1
  33. package/dist/MenuItem.d.ts +8 -0
  34. package/dist/MenuItem.js +29 -1
  35. package/dist/MenuItem.js.map +1 -1
  36. package/dist/MenuItemTemplate.js +2 -2
  37. package/dist/MenuItemTemplate.js.map +1 -1
  38. package/dist/MultiComboBox.js +5 -0
  39. package/dist/MultiComboBox.js.map +1 -1
  40. package/dist/MultiInput.js +4 -5
  41. package/dist/MultiInput.js.map +1 -1
  42. package/dist/StepInput.d.ts +5 -0
  43. package/dist/StepInput.js +26 -5
  44. package/dist/StepInput.js.map +1 -1
  45. package/dist/Switch.d.ts +8 -4
  46. package/dist/Switch.js +15 -11
  47. package/dist/Switch.js.map +1 -1
  48. package/dist/SwitchTemplate.js +1 -1
  49. package/dist/SwitchTemplate.js.map +1 -1
  50. package/dist/TimePicker.d.ts +55 -3
  51. package/dist/TimePicker.js +160 -26
  52. package/dist/TimePicker.js.map +1 -1
  53. package/dist/TimePickerTemplate.js +1 -1
  54. package/dist/TimePickerTemplate.js.map +1 -1
  55. package/dist/TimeSelectionClocks.js +8 -0
  56. package/dist/TimeSelectionClocks.js.map +1 -1
  57. package/dist/Token.js +2 -2
  58. package/dist/Token.js.map +1 -1
  59. package/dist/Tokenizer.js +2 -1
  60. package/dist/Tokenizer.js.map +1 -1
  61. package/dist/Toolbar.d.ts +11 -11
  62. package/dist/Toolbar.js +3 -3
  63. package/dist/Toolbar.js.map +1 -1
  64. package/dist/ToolbarButton.d.ts +22 -3
  65. package/dist/ToolbarButton.js +23 -3
  66. package/dist/ToolbarButton.js.map +1 -1
  67. package/dist/ToolbarItem.d.ts +18 -77
  68. package/dist/ToolbarItem.js +9 -110
  69. package/dist/ToolbarItem.js.map +1 -1
  70. package/dist/ToolbarItemBase.d.ts +69 -0
  71. package/dist/ToolbarItemBase.js +142 -0
  72. package/dist/ToolbarItemBase.js.map +1 -0
  73. package/dist/ToolbarSelect.d.ts +6 -5
  74. package/dist/ToolbarSelect.js +3 -3
  75. package/dist/ToolbarSelect.js.map +1 -1
  76. package/dist/ToolbarSeparator.d.ts +3 -3
  77. package/dist/ToolbarSeparator.js +3 -3
  78. package/dist/ToolbarSeparator.js.map +1 -1
  79. package/dist/ToolbarSpacer.d.ts +3 -3
  80. package/dist/ToolbarSpacer.js +3 -3
  81. package/dist/ToolbarSpacer.js.map +1 -1
  82. package/dist/css/themes/Breadcrumbs.css +1 -1
  83. package/dist/css/themes/ColorPaletteItem.css +1 -1
  84. package/dist/css/themes/DatePickerPopover.css +1 -1
  85. package/dist/css/themes/MenuItem.css +1 -1
  86. package/dist/css/themes/PopupsCommon.css +1 -1
  87. package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -1
  88. package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -1
  89. package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -1
  90. package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -1
  91. package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -1
  92. package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -1
  93. package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -1
  94. package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -1
  95. package/dist/custom-elements-internal.json +179 -183
  96. package/dist/custom-elements.json +159 -112
  97. package/dist/features/InputSuggestions.js +2 -1
  98. package/dist/features/InputSuggestions.js.map +1 -1
  99. package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
  100. package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
  101. package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
  102. package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
  103. package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
  104. package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
  105. package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
  106. package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -1
  107. package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -1
  108. package/dist/generated/i18n/i18n-defaults.d.ts +7 -2
  109. package/dist/generated/i18n/i18n-defaults.js +7 -2
  110. package/dist/generated/i18n/i18n-defaults.js.map +1 -1
  111. package/dist/generated/themes/Breadcrumbs.css.d.ts +1 -1
  112. package/dist/generated/themes/Breadcrumbs.css.js +1 -1
  113. package/dist/generated/themes/Breadcrumbs.css.js.map +1 -1
  114. package/dist/generated/themes/ColorPaletteItem.css.d.ts +1 -1
  115. package/dist/generated/themes/ColorPaletteItem.css.js +1 -1
  116. package/dist/generated/themes/ColorPaletteItem.css.js.map +1 -1
  117. package/dist/generated/themes/DatePickerPopover.css.d.ts +1 -1
  118. package/dist/generated/themes/DatePickerPopover.css.js +1 -1
  119. package/dist/generated/themes/DatePickerPopover.css.js.map +1 -1
  120. package/dist/generated/themes/MenuItem.css.d.ts +1 -1
  121. package/dist/generated/themes/MenuItem.css.js +1 -1
  122. package/dist/generated/themes/MenuItem.css.js.map +1 -1
  123. package/dist/generated/themes/PopupsCommon.css.d.ts +1 -1
  124. package/dist/generated/themes/PopupsCommon.css.js +1 -1
  125. package/dist/generated/themes/PopupsCommon.css.js.map +1 -1
  126. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.d.ts +1 -1
  127. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
  128. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js.map +1 -1
  129. package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.d.ts +1 -1
  130. package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
  131. package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js.map +1 -1
  132. package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.d.ts +1 -1
  133. package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
  134. package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js.map +1 -1
  135. package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.d.ts +1 -1
  136. package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
  137. package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js.map +1 -1
  138. package/dist/generated/themes/sap_horizon/parameters-bundle.css.d.ts +1 -1
  139. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
  140. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
  141. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.d.ts +1 -1
  142. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
  143. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
  144. package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.d.ts +1 -1
  145. package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -1
  146. package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js.map +1 -1
  147. package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.d.ts +1 -1
  148. package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -1
  149. package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js.map +1 -1
  150. package/dist/vscode.html-custom-data.json +39 -8
  151. package/dist/web-types.json +39 -74
  152. package/package.json +9 -9
  153. package/src/CarouselTemplate.tsx +3 -3
  154. package/src/ColorPaletteTemplate.tsx +2 -2
  155. package/src/DayPickerTemplate.tsx +1 -1
  156. package/src/IconTemplate.tsx +1 -0
  157. package/src/MenuItemTemplate.tsx +11 -1
  158. package/src/SwitchTemplate.tsx +2 -2
  159. package/src/TimePickerTemplate.tsx +1 -1
  160. package/src/i18n/messagebundle.properties +17 -2
  161. package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
  162. package/src/themes/Breadcrumbs.css +6 -2
  163. package/src/themes/ColorPaletteItem.css +14 -0
  164. package/src/themes/DatePickerPopover.css +5 -0
  165. package/src/themes/MenuItem.css +5 -0
  166. package/src/themes/PopupsCommon.css +7 -0
  167. package/src/themes/base/Bar-parameters.css +1 -0
  168. package/src/themes/base/Breadcrumbs-parameters.css +4 -0
  169. package/src/themes/sap_fiori_3/parameters-bundle.css +2 -1
  170. package/src/themes/sap_fiori_3_dark/parameters-bundle.css +2 -1
  171. package/src/themes/sap_fiori_3_hcb/parameters-bundle.css +2 -1
  172. package/src/themes/sap_fiori_3_hcw/parameters-bundle.css +2 -1
  173. package/src/themes/sap_horizon/Breadcrumbs-parameters.css +5 -1
  174. package/src/themes/sap_horizon/CalendarHeader-parameters.css +3 -3
  175. package/src/themes/sap_horizon/DayPicker-parameters.css +3 -3
  176. package/src/themes/sap_horizon_dark/Breadcrumbs-parameters.css +5 -1
  177. package/src/themes/sap_horizon_dark/CalendarHeader-parameters.css +2 -2
  178. package/src/themes/sap_horizon_hcb/Breadcrumbs-parameters.css +6 -0
  179. package/src/themes/sap_horizon_hcb/parameters-bundle.css +2 -1
  180. package/src/themes/sap_horizon_hcw/Breadcrumbs-parameters.css +6 -0
  181. package/src/themes/sap_horizon_hcw/parameters-bundle.css +2 -1
@@ -8,7 +8,7 @@ import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
8
8
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
9
9
  import property from "@ui5/webcomponents-base/dist/decorators/property.js";
10
10
  import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
11
- import ToolbarItem from "./ToolbarItem.js";
11
+ import ToolbarItemBase from "./ToolbarItemBase.js";
12
12
  import ToolbarButtonTemplate from "./ToolbarButtonTemplate.js";
13
13
  import ToolbarButtonCss from "./generated/themes/ToolbarButton.css.js";
14
14
  /**
@@ -22,13 +22,27 @@ import ToolbarButtonCss from "./generated/themes/ToolbarButton.css.js";
22
22
  * `import "@ui5/webcomponents/dist/ToolbarButton.js";`
23
23
  * @constructor
24
24
  * @abstract
25
- * @extends ToolbarItem
25
+ * @extends ToolbarItemBase
26
26
  * @public
27
27
  * @since 1.17.0
28
28
  */
29
- let ToolbarButton = class ToolbarButton extends ToolbarItem {
29
+ let ToolbarButton = class ToolbarButton extends ToolbarItemBase {
30
30
  constructor() {
31
31
  super(...arguments);
32
+ /**
33
+ * Property used to define the access of the item to the overflow Popover. If "NeverOverflow" option is set,
34
+ * the item never goes in the Popover, if "AlwaysOverflow" - it never comes out of it.
35
+ * @public
36
+ * @default "Default"
37
+ */
38
+ this.overflowPriority = "Default";
39
+ /**
40
+ * Defines if the toolbar overflow popup should close upon interaction with the item.
41
+ * It will close by default.
42
+ * @default false
43
+ * @public
44
+ */
45
+ this.preventOverflowClosing = false;
32
46
  /**
33
47
  * Defines if the action is disabled.
34
48
  *
@@ -116,6 +130,12 @@ let ToolbarButton = class ToolbarButton extends ToolbarItem {
116
130
  };
117
131
  }
118
132
  };
133
+ __decorate([
134
+ property()
135
+ ], ToolbarButton.prototype, "overflowPriority", void 0);
136
+ __decorate([
137
+ property({ type: Boolean })
138
+ ], ToolbarButton.prototype, "preventOverflowClosing", void 0);
119
139
  __decorate([
120
140
  property({ type: Boolean })
121
141
  ], ToolbarButton.prototype, "disabled", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarButton.js","sourceRoot":"","sources":["../src/ToolbarButton.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAI5E,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAIvE;;;;;;;;;;;;;;GAcG;AAoBH,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAW;IAAvC;;QACC;;;;;;WAMG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;;;WAIG;QAEH,WAAM,GAAsB,SAAS,CAAC;QAuDtC;;;;;;;;;;;;;;;;WAgBG;QAEH,4BAAuB,GAAyC,EAAE,CAAC;QAUnE;;;;;;;;;;;WAWG;QAEH,qBAAgB,GAAG,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AAE,MAAM,EAAE,CAAC;8DACwC;AAQnE;IADC,QAAQ,EAAE;2CACG;AAed;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDACH;AAUzB;IADC,QAAQ,EAAE;4CACI;AA3HV,aAAa;IAnBlB,aAAa,CAAC;QACd,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,qBAAqB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,CAAC,gBAAgB,CAAC;KAC1B,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;GACI,aAAa,CAwKlB;AAED,aAAa,CAAC,MAAM,EAAE,CAAC;AAEvB,eAAe,aAAa,CAAC","sourcesContent":["import jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport type { ButtonAccessibilityAttributes } from \"./Button.js\";\nimport type ButtonDesign from \"./types/ButtonDesign.js\";\n\nimport ToolbarItem from \"./ToolbarItem.js\";\nimport ToolbarButtonTemplate from \"./ToolbarButtonTemplate.js\";\nimport ToolbarButtonCss from \"./generated/themes/ToolbarButton.css.js\";\n\ntype ToolbarButtonAccessibilityAttributes = ButtonAccessibilityAttributes;\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-button` represents an abstract action,\n * used in the `ui5-toolbar`.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/ToolbarButton.js\";`\n * @constructor\n * @abstract\n * @extends ToolbarItem\n * @public\n * @since 1.17.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-button\",\n\ttemplate: ToolbarButtonTemplate,\n\trenderer: jsxRenderer,\n\tstyles: [ToolbarButtonCss],\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n *\n * **Note:** The event will not be fired if the `disabled`\n * property is set to `true`.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n\tcancelable: true,\n})\nclass ToolbarButton extends ToolbarItem {\n\t/**\n\t * Defines if the action is disabled.\n\t *\n\t * **Note:** a disabled action can't be pressed or focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the action design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines the `icon` source URI.\n\t *\n\t * **Note:** SAP-icons font provides numerous buil-in icons. To find all the available icons, see the\n\t * [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component after the button text.\n\t *\n\t * **Note:** It is highly recommended to use `endIcon` property only together with `icon` and/or `text` properties.\n\t * Usage of `endIcon` only should be avoided.\n\t *\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t *\n\t * **Note:** A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttooltip?: string\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t *\n\t * The following fields are supported:\n\t *\n\t * - **expanded**: Indicates whether the button, or another grouping element it controls, is currently expanded or collapsed.\n\t * Accepts the following string values: `true` or `false`\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * - **controls**: Identifies the element (or elements) whose contents or presence are controlled by the button element.\n\t * Accepts a lowercase string value.\n\t *\n\t * @default {}\n\t * @public\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: ToolbarButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Button text\n\t * @public\n\t * @default undefined\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines whether the button text should only be displayed in the overflow popover.\n\t *\n\t * When set to `true`, the button appears as icon-only in the main toolbar,\n\t * but shows both icon and text when moved to the overflow popover.\n\t *\n\t * **Note:** This property only takes effect when the `text` property is also set.\n\t *\n\t * @default false\n\t * @public\n\t * @since 2.17.0\n\t */\n\t@property({ type: Boolean })\n\tshowOverflowText = false;\n\n\t/**\n\t * Defines the width of the button.\n\t *\n\t * **Note:** all CSS sizes are supported - 'percentage', 'px', 'rem', 'auto', etc.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\twidth?: string;\n\n\tget styles() {\n\t\treturn {\n\t\t\twidth: this.width,\n\t\t\tdisplay: this.hidden ? \"none\" : \"inline-block\",\n\t\t};\n\t}\n\n\t/**\n\t * Returns the effective text to display based on overflow state and showOverflowText property.\n\t *\n\t * When showOverflowText is true:\n\t * - Normal state: returns empty string (icon-only)\n\t * - Overflow state: returns text\n\t *\n\t * When showOverflowText is false:\n\t * - Returns text in both states (normal behavior)\n\t */\n\tget effectiveText(): string | undefined {\n\t\tif (this.showOverflowText) {\n\t\t\treturn this.isOverflowed ? this.text : \"\";\n\t\t}\n\t\treturn this.text;\n\t}\n\n\tonClick(e: Event) {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", { targetRef: e.target as HTMLElement });\n\t\tif (!prevented && !this.preventOverflowClosing) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\t/**\n\t * @override\n\t */\n\tget classes() {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t...super.classes.root,\n\t\t\t\t\"ui5-tb-button\": true,\n\t\t\t},\n\t\t};\n\t}\n}\n\nToolbarButton.define();\n\nexport default ToolbarButton;\n\nexport type {\n\tToolbarButtonAccessibilityAttributes,\n};\n"]}
1
+ {"version":3,"file":"ToolbarButton.js","sourceRoot":"","sources":["../src/ToolbarButton.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,yDAAyD,CAAC;AAK5E,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AAIvE;;;;;;;;;;;;;;GAcG;AAqBH,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,eAAe;IAA3C;;QAKC;;;;;UAKE;QAEF,qBAAgB,GAAqC,SAAS,CAAC;QAE/D;;;;;WAKG;QAEH,2BAAsB,GAAG,KAAK,CAAC;QAE/B;;;;;;WAMG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;;;WAIG;QAEH,WAAM,GAAsB,SAAS,CAAC;QAuDtC;;;;;;;;;;;;;;;;WAgBG;QAEH,4BAAuB,GAAyC,EAAE,CAAC;QAUnE;;;;;;;;;;;WAWG;QAEH,qBAAgB,GAAG,KAAK,CAAC;IAuD1B,CAAC;IA3CA,IAAI,MAAM;QACT,OAAO;YACN,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB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I,EAAE,MAAM,EAAE,CAAC;8DACwC;AAQnE;IADC,QAAQ,EAAE;2CACG;AAed;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDACH;AAUzB;IADC,QAAQ,EAAE;4CACI;AAjJV,aAAa;IApBlB,aAAa,CAAC;QACd,GAAG,EAAE,oBAAoB;QACzB,QAAQ,EAAE,qBAAqB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,CAAC,gBAAgB,CAAC;KAC1B,CAAC;IAEF;;;;;;;OAOG;;IACF,KAAK,CAAC,OAAO,EAAE;QACf,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;GAEI,aAAa,CA8LlB;AAED,aAAa,CAAC,MAAM,EAAE,CAAC;AAEvB,eAAe,aAAa,CAAC","sourcesContent":["import jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport type { ButtonAccessibilityAttributes } from \"./Button.js\";\nimport type ButtonDesign from \"./types/ButtonDesign.js\";\nimport type ToolbarItemOverflowBehavior from \"./types/ToolbarItemOverflowBehavior.js\";\n\nimport ToolbarItemBase from \"./ToolbarItemBase.js\";\nimport type { ToolbarItemEventDetail } from \"./ToolbarItemBase.js\";\nimport ToolbarButtonTemplate from \"./ToolbarButtonTemplate.js\";\nimport ToolbarButtonCss from \"./generated/themes/ToolbarButton.css.js\";\n\ntype ToolbarButtonAccessibilityAttributes = ButtonAccessibilityAttributes;\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-button` represents an abstract action,\n * used in the `ui5-toolbar`.\n *\n * ### ES6 Module Import\n * `import \"@ui5/webcomponents/dist/ToolbarButton.js\";`\n * @constructor\n * @abstract\n * @extends ToolbarItemBase\n * @public\n * @since 1.17.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-button\",\n\ttemplate: ToolbarButtonTemplate,\n\trenderer: jsxRenderer,\n\tstyles: [ToolbarButtonCss],\n})\n\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n *\n * **Note:** The event will not be fired if the `disabled`\n * property is set to `true`.\n * @public\n */\n@event(\"click\", {\n\tbubbles: true,\n\tcancelable: true,\n})\n\nclass ToolbarButton extends ToolbarItemBase {\n\teventDetails!: ToolbarItemBase[\"eventDetails\"] & {\n\t\tclick: ToolbarItemEventDetail,\n\t}\n\n\t/**\n\t* Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\n\t* the item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n\t* @public\n\t* @default \"Default\"\n\t*/\n\t@property()\n\toverflowPriority: `${ToolbarItemOverflowBehavior}` = \"Default\";\n\n\t/**\n\t * Defines if the toolbar overflow popup should close upon interaction with the item.\n\t * It will close by default.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tpreventOverflowClosing = false;\n\n\t/**\n\t * Defines if the action is disabled.\n\t *\n\t * **Note:** a disabled action can't be pressed or focused, and it is not in the tab chain.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled = false;\n\n\t/**\n\t * Defines the action design.\n\t * @default \"Default\"\n\t * @public\n\t */\n\t@property()\n\tdesign: `${ButtonDesign}` = \"Default\";\n\n\t/**\n\t * Defines the `icon` source URI.\n\t *\n\t * **Note:** SAP-icons font provides numerous buil-in icons. To find all the available icons, see the\n\t * [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ticon?: string\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component after the button text.\n\t *\n\t * **Note:** It is highly recommended to use `endIcon` property only together with `icon` and/or `text` properties.\n\t * Usage of `endIcon` only should be avoided.\n\t *\n\t * The SAP-icons font provides numerous options.\n\t *\n\t * Example:\n\t * See all the available icons within the [Icon Explorer](https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html).\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\tendIcon?: string;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t *\n\t * **Note:** A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\ttooltip?: string\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\taccessibleNameRef?: string;\n\n\t/**\n\t * Defines the additional accessibility attributes that will be applied to the component.\n\t *\n\t * The following fields are supported:\n\t *\n\t * - **expanded**: Indicates whether the button, or another grouping element it controls, is currently expanded or collapsed.\n\t * Accepts the following string values: `true` or `false`\n\t *\n\t * - **hasPopup**: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button.\n\t * Accepts the following string values: `dialog`, `grid`, `listbox`, `menu` or `tree`.\n\t *\n\t * - **controls**: Identifies the element (or elements) whose contents or presence are controlled by the button element.\n\t * Accepts a lowercase string value.\n\t *\n\t * @default {}\n\t * @public\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes: ToolbarButtonAccessibilityAttributes = {};\n\n\t/**\n\t * Button text\n\t * @public\n\t * @default undefined\n\t */\n\t@property()\n\ttext?: string;\n\n\t/**\n\t * Defines whether the button text should only be displayed in the overflow popover.\n\t *\n\t * When set to `true`, the button appears as icon-only in the main toolbar,\n\t * but shows both icon and text when moved to the overflow popover.\n\t *\n\t * **Note:** This property only takes effect when the `text` property is also set.\n\t *\n\t * @default false\n\t * @public\n\t * @since 2.17.0\n\t */\n\t@property({ type: Boolean })\n\tshowOverflowText = false;\n\n\t/**\n\t * Defines the width of the button.\n\t *\n\t * **Note:** all CSS sizes are supported - 'percentage', 'px', 'rem', 'auto', etc.\n\t * @default undefined\n\t * @public\n\t */\n\t@property()\n\twidth?: string;\n\n\tget styles() {\n\t\treturn {\n\t\t\twidth: this.width,\n\t\t\tdisplay: this.hidden ? \"none\" : \"inline-block\",\n\t\t};\n\t}\n\n\t/**\n\t * Returns the effective text to display based on overflow state and showOverflowText property.\n\t *\n\t * When showOverflowText is true:\n\t * - Normal state: returns empty string (icon-only)\n\t * - Overflow state: returns text\n\t *\n\t * When showOverflowText is false:\n\t * - Returns text in both states (normal behavior)\n\t */\n\tget effectiveText(): string | undefined {\n\t\tif (this.showOverflowText) {\n\t\t\treturn this.isOverflowed ? this.text : \"\";\n\t\t}\n\t\treturn this.text;\n\t}\n\n\tonClick(e: Event) {\n\t\te.stopImmediatePropagation();\n\t\tconst prevented = !this.fireDecoratorEvent(\"click\", { targetRef: e.target as HTMLElement });\n\t\tif (!prevented && !this.preventOverflowClosing) {\n\t\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t\t}\n\t}\n\n\t/**\n\t * @override\n\t */\n\tget classes() {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t...super.classes.root,\n\t\t\t\t\"ui5-tb-button\": true,\n\t\t\t},\n\t\t};\n\t}\n}\n\nToolbarButton.define();\n\nexport default ToolbarButton;\n\nexport type {\n\tToolbarButtonAccessibilityAttributes,\n};\n"]}
@@ -1,14 +1,16 @@
1
- import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
- import type ToolbarItemOverflowBehavior from "./types/ToolbarItemOverflowBehavior.js";
3
- type IEventOptions = {
4
- preventClosing: boolean;
5
- };
6
- type ToolbarItemEventDetail = {
7
- targetRef: HTMLElement;
8
- };
9
- interface IOverflowToolbarItem extends HTMLElement {
10
- overflowCloseEvents?: string[] | undefined;
11
- hasOverflow?: boolean | undefined;
1
+ import ToolbarItemBase from "./ToolbarItemBase.js";
2
+ import type { DefaultSlot } from "@ui5/webcomponents-base";
3
+ /**
4
+ * Interface for the slotted item in `ui5-toolbar-item`.
5
+ *
6
+ * It could be any HTMLElement or UI5 Web Component with option to specify custom overflow closing events and overflow behavior.
7
+ *
8
+ * @public
9
+ * @since 2.20.0
10
+ */
11
+ interface IToolbarItemContent extends HTMLElement {
12
+ overflowCloseEvents?: string[];
13
+ hasOverflow?: boolean;
12
14
  }
13
15
  /**
14
16
  * @class
@@ -29,42 +31,12 @@ interface IOverflowToolbarItem extends HTMLElement {
29
31
  * but specialized wrappers like `ui5-toolbar-button` provide
30
32
  * component-specific functionality and should be preferred when available.
31
33
  *
32
- *
33
- * @cssState overflowed - When the item is displayed in the overflow popover. Use this state to apply different styles when the item is overflowed. Available since 2.20.0.
34
34
  * @constructor
35
- * @extends UI5Element
35
+ * @extends ToolbarItemBase
36
36
  * @public
37
- * @since 1.17.0
37
+ * @since 2.20.0
38
38
  */
39
- declare class ToolbarItem extends UI5Element {
40
- eventDetails: {
41
- click: ToolbarItemEventDetail;
42
- "close-overflow": void;
43
- };
44
- /**
45
- * Property used to define the access of the item to the overflow Popover. If "NeverOverflow" option is set,
46
- * the item never goes in the Popover, if "AlwaysOverflow" - it never comes out of it.
47
- * @public
48
- * @default "Default"
49
- */
50
- overflowPriority: `${ToolbarItemOverflowBehavior}`;
51
- /**
52
- * Defines if the toolbar overflow popup should close upon interaction with the item.
53
- * It will close by default.
54
- * @default false
55
- * @public
56
- */
57
- preventOverflowClosing: boolean;
58
- _isOverflowed: boolean;
59
- get isOverflowed(): boolean;
60
- /**
61
- * Defines if the toolbar item is overflowed.
62
- * @default false
63
- * @protected
64
- * @since 2.11.0
65
- */
66
- set isOverflowed(value: boolean);
67
- _isRendering: boolean;
39
+ declare class ToolbarItem extends ToolbarItemBase {
68
40
  _maxWidth: number;
69
41
  _wrapperChecked: boolean;
70
42
  fireCloseOverflowRef: () => void;
@@ -81,51 +53,20 @@ declare class ToolbarItem extends UI5Element {
81
53
  "ui5-select": string;
82
54
  };
83
55
  onBeforeRendering(): void;
84
- onAfterRendering(): void;
85
56
  onExitDOM(): void;
86
57
  /**
87
58
  * Wrapped component slot.
88
59
  * @public
89
60
  * @since 2.20.0
90
61
  */
91
- item: IOverflowToolbarItem[];
62
+ item: DefaultSlot<IToolbarItemContent>;
92
63
  checkForWrapper(): void;
93
64
  getClosingEvents(): string[];
94
65
  attachCloseOverflowHandlers(): void;
95
66
  detachCloseOverflowHandlers(): void;
96
67
  fireCloseOverflow(): void;
97
- /**
98
- * Defines if the width of the item should be ignored in calculating the whole width of the toolbar
99
- * @protected
100
- */
101
- get ignoreSpace(): boolean;
102
- /**
103
- * Returns if the item is flexible. An item that is returning true for this property will make
104
- * the toolbar expand to fill the 100% width of its container.
105
- * @protected
106
- */
107
- get hasFlexibleWidth(): boolean;
108
- /**
109
- * Returns if the item is interactive.
110
- * This value is used to determinate if the toolbar should have its accessibility role and attributes set.
111
- * At least two interactive items are needed for the toolbar to have the role="toolbar" attribute set.
112
- * @protected
113
- */
114
- get isInteractive(): boolean;
115
68
  get itemTagName(): string;
116
69
  get hasOverflow(): boolean;
117
- /**
118
- * Returns if the item is separator.
119
- * @protected
120
- */
121
- get isSeparator(): boolean;
122
- get stableDomRef(): string;
123
- get classes(): {
124
- root: {
125
- "ui5-tb-popover-item": boolean;
126
- "ui5-tb-item": boolean;
127
- };
128
- };
129
70
  }
130
- export type { IEventOptions, ToolbarItemEventDetail, IOverflowToolbarItem, };
71
+ export type { IToolbarItemContent, };
131
72
  export default ToolbarItem;
@@ -4,14 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
8
- import property from "@ui5/webcomponents-base/dist/decorators/property.js";
9
- import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
10
- import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
7
+ var ToolbarItem_1;
8
+ import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
11
9
  import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
12
10
  import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
13
11
  import ToolbarItemTemplate from "./ToolbarItemTemplate.js";
14
12
  import ToolbarItemCss from "./generated/themes/ToolbarItem.css.js";
13
+ import ToolbarItemBase from "./ToolbarItemBase.js";
15
14
  /**
16
15
  * @class
17
16
  *
@@ -31,32 +30,14 @@ import ToolbarItemCss from "./generated/themes/ToolbarItem.css.js";
31
30
  * but specialized wrappers like `ui5-toolbar-button` provide
32
31
  * component-specific functionality and should be preferred when available.
33
32
  *
34
- *
35
- * @cssState overflowed - When the item is displayed in the overflow popover. Use this state to apply different styles when the item is overflowed. Available since 2.20.0.
36
33
  * @constructor
37
- * @extends UI5Element
34
+ * @extends ToolbarItemBase
38
35
  * @public
39
- * @since 1.17.0
36
+ * @since 2.20.0
40
37
  */
41
- let ToolbarItem = class ToolbarItem extends UI5Element {
38
+ let ToolbarItem = ToolbarItem_1 = class ToolbarItem extends ToolbarItemBase {
42
39
  constructor() {
43
40
  super(...arguments);
44
- /**
45
- * Property used to define the access of the item to the overflow Popover. If "NeverOverflow" option is set,
46
- * the item never goes in the Popover, if "AlwaysOverflow" - it never comes out of it.
47
- * @public
48
- * @default "Default"
49
- */
50
- this.overflowPriority = "Default";
51
- /**
52
- * Defines if the toolbar overflow popup should close upon interaction with the item.
53
- * It will close by default.
54
- * @default false
55
- * @public
56
- */
57
- this.preventOverflowClosing = false;
58
- this._isOverflowed = false;
59
- this._isRendering = true;
60
41
  this._maxWidth = 0;
61
42
  this._wrapperChecked = false;
62
43
  this.fireCloseOverflowRef = this.fireCloseOverflow.bind(this);
@@ -73,31 +54,10 @@ let ToolbarItem = class ToolbarItem extends UI5Element {
73
54
  "ui5-select": "ToolbarSelect",
74
55
  };
75
56
  }
76
- get isOverflowed() {
77
- return this._isOverflowed;
78
- }
79
- /**
80
- * Defines if the toolbar item is overflowed.
81
- * @default false
82
- * @protected
83
- * @since 2.11.0
84
- */
85
- set isOverflowed(value) {
86
- this._isOverflowed = value;
87
- if (value) {
88
- this._internals.states.add("overflowed");
89
- }
90
- else {
91
- this._internals.states.delete("overflowed");
92
- }
93
- }
94
57
  onBeforeRendering() {
95
58
  this.checkForWrapper();
96
59
  this.attachCloseOverflowHandlers();
97
60
  }
98
- onAfterRendering() {
99
- this._isRendering = false;
100
- }
101
61
  onExitDOM() {
102
62
  this.detachCloseOverflowHandlers();
103
63
  }
@@ -118,12 +78,12 @@ let ToolbarItem = class ToolbarItem extends UI5Element {
118
78
  }
119
79
  // We want to close the overflow popover, when closing event is being executed
120
80
  getClosingEvents() {
121
- const item = Array.isArray(this.item) ? this.item[0] : this.item;
81
+ const item = this.item[0];
122
82
  const closeEvents = this.closeOverflowSet[this.itemTagName] || [];
123
83
  if (!item) {
124
84
  return [...closeEvents];
125
85
  }
126
- const overflowCloseEvents = Array.isArray(item.overflowCloseEvents) ? item.overflowCloseEvents : [];
86
+ const overflowCloseEvents = item.overflowCloseEvents ? item.overflowCloseEvents : [];
127
87
  return [...closeEvents, ...overflowCloseEvents];
128
88
  }
129
89
  attachCloseOverflowHandlers() {
@@ -143,30 +103,6 @@ let ToolbarItem = class ToolbarItem extends UI5Element {
143
103
  fireCloseOverflow() {
144
104
  this.fireDecoratorEvent("close-overflow");
145
105
  }
146
- /**
147
- * Defines if the width of the item should be ignored in calculating the whole width of the toolbar
148
- * @protected
149
- */
150
- get ignoreSpace() {
151
- return false;
152
- }
153
- /**
154
- * Returns if the item is flexible. An item that is returning true for this property will make
155
- * the toolbar expand to fill the 100% width of its container.
156
- * @protected
157
- */
158
- get hasFlexibleWidth() {
159
- return false;
160
- }
161
- /**
162
- * Returns if the item is interactive.
163
- * This value is used to determinate if the toolbar should have its accessibility role and attributes set.
164
- * At least two interactive items are needed for the toolbar to have the role="toolbar" attribute set.
165
- * @protected
166
- */
167
- get isInteractive() {
168
- return true;
169
- }
170
106
  get itemTagName() {
171
107
  const ctor = this.getSlottedNodes("item")[0]?.constructor;
172
108
  return ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.getSlottedNodes("item")[0]?.tagName;
@@ -174,40 +110,13 @@ let ToolbarItem = class ToolbarItem extends UI5Element {
174
110
  get hasOverflow() {
175
111
  return this.item[0]?.hasOverflow ?? false;
176
112
  }
177
- /**
178
- * Returns if the item is separator.
179
- * @protected
180
- */
181
- get isSeparator() {
182
- return false;
183
- }
184
- get stableDomRef() {
185
- return this.getAttribute("stable-dom-ref") || `${this._id}-stable-dom-ref`;
186
- }
187
- get classes() {
188
- return {
189
- root: {
190
- "ui5-tb-popover-item": this.isOverflowed,
191
- "ui5-tb-item": true,
192
- },
193
- };
194
- }
195
113
  };
196
- __decorate([
197
- property()
198
- ], ToolbarItem.prototype, "overflowPriority", void 0);
199
- __decorate([
200
- property({ type: Boolean })
201
- ], ToolbarItem.prototype, "preventOverflowClosing", void 0);
202
- __decorate([
203
- property({ type: Boolean })
204
- ], ToolbarItem.prototype, "isOverflowed", null);
205
114
  __decorate([
206
115
  slot({
207
116
  "default": true, type: HTMLElement, invalidateOnChildChange: true,
208
117
  })
209
118
  ], ToolbarItem.prototype, "item", void 0);
210
- ToolbarItem = __decorate([
119
+ ToolbarItem = ToolbarItem_1 = __decorate([
211
120
  customElement({
212
121
  tag: "ui5-toolbar-item",
213
122
  languageAware: true,
@@ -215,16 +124,6 @@ ToolbarItem = __decorate([
215
124
  template: ToolbarItemTemplate,
216
125
  styles: ToolbarItemCss,
217
126
  })
218
- /**
219
- * Fired when the overflow popover is closed.
220
- * @public
221
- * @since 1.17.0
222
- */
223
- ,
224
- event("close-overflow", {
225
- bubbles: true,
226
- cancelable: true,
227
- })
228
127
  ], ToolbarItem);
229
128
  ToolbarItem.define();
230
129
  export default ToolbarItem;
@@ -1 +1 @@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AAE,WAAW;QACrB,QAAQ,EAAE,mBAAmB;QAC7B,MAAM,EAAE,cAAc;KACtB,CAAC;IACF;;;;OAIG;;IACF,KAAK,CAAC,gBAAgB,EAAE;QACxB,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,IAAI;KAChB,CAAC;GACI,WAAW,CAmMhB;AAOD,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event-strict.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport ToolbarItemTemplate from \"./ToolbarItemTemplate.js\";\nimport ToolbarItemCss from \"./generated/themes/ToolbarItem.css.js\";\nimport type ToolbarItemOverflowBehavior from \"./types/ToolbarItemOverflowBehavior.js\";\n\ntype IEventOptions = {\n\tpreventClosing: boolean;\n}\n\ntype ToolbarItemEventDetail = {\n\ttargetRef: HTMLElement;\n}\n\ninterface IOverflowToolbarItem extends HTMLElement {\n\toverflowCloseEvents?: string[] | undefined;\n\thasOverflow?: boolean | undefined;\n}\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-item` is a wrapper component used to integrate UI5 Web Components into the `ui5-toolbar`.\n * It renders within the toolbar's shadow DOM and manages the lifecycle\n * and overflow behavior of its child component.\n *\n * ### Structure\n * The toolbar item wraps a single UI5 Web Component (such as CheckBox, Title, etc.) and handles:\n * - Overflow management (determining if the item should be displayed in the main toolbar or overflow popover)\n * - Automatic popover closing on interaction\n * - CSS custom state exposure for styling based on overflow state\n *\n * ### Usage\n * The `ui5-toolbar-item` is typically used implicitly when adding components to a toolbar,\n * but specialized wrappers like `ui5-toolbar-button` provide\n * component-specific functionality and should be preferred when available.\n *\n *\n * @cssState overflowed - When the item is displayed in the overflow popover. Use this state to apply different styles when the item is overflowed. Available since 2.20.0.\n * @constructor\n * @extends UI5Element\n * @public\n * @since 1.17.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-item\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ToolbarItemTemplate,\n\tstyles: ToolbarItemCss,\n})\n/**\n * Fired when the overflow popover is closed.\n * @public\n * @since 1.17.0\n */\n@event(\"close-overflow\", {\n\tbubbles: true,\n\tcancelable: true,\n})\nclass ToolbarItem extends UI5Element {\n\t// strictEvents: needed for parent class\n\teventDetails!: {\n\t\tclick: ToolbarItemEventDetail,\n\t\t\"close-overflow\": void;\n\t}\n\t/**\n\t * Property used to define the access of the item to the overflow Popover. If \"NeverOverflow\" option is set,\n\t * the item never goes in the Popover, if \"AlwaysOverflow\" - it never comes out of it.\n\t * @public\n\t * @default \"Default\"\n\t */\n\t@property()\n\toverflowPriority: `${ToolbarItemOverflowBehavior}` = \"Default\";\n\n\t/**\n\t * Defines if the toolbar overflow popup should close upon interaction with the item.\n\t * It will close by default.\n\t * @default false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tpreventOverflowClosing = false;\n\n\t_isOverflowed: boolean = false;\n\n\tget isOverflowed(): boolean {\n\t\treturn this._isOverflowed;\n\t}\n\n\t/**\n\t * Defines if the toolbar item is overflowed.\n\t * @default false\n\t * @protected\n\t * @since 2.11.0\n\t */\n\t@property({ type: Boolean })\n\tset isOverflowed(value: boolean) {\n\t\tthis._isOverflowed = value;\n\n\t\tif (value) {\n\t\t\tthis._internals.states.add(\"overflowed\");\n\t\t} else {\n\t\t\tthis._internals.states.delete(\"overflowed\");\n\t\t}\n\t}\n\n\t_isRendering = true;\n\t_maxWidth = 0;\n\t_wrapperChecked = false;\n\tfireCloseOverflowRef = this.fireCloseOverflow.bind(this);\n\n\tcloseOverflowSet = {\n\t\t\"ui5-button\": [\"click\"],\n\t\t\"ui5-select\": [\"change\"],\n\t\t\"ui5-combobox\": [\"change\"],\n\t\t\"ui5-multi-combobox\": [\"selection-change\"],\n\t\t\"ui5-date-picker\": [\"change\"],\n\t\t\"ui5-switch\": [\"change\"],\n\t}\n\n\tpredefinedWrapperSet = {\n\t\t\"ui5-button\": \"ToolbarButton\",\n\t\t\"ui5-select\": \"ToolbarSelect\",\n\t}\n\n\tonBeforeRendering(): void {\n\t\tthis.checkForWrapper();\n\t\tthis.attachCloseOverflowHandlers();\n\t}\n\n\tonAfterRendering(): void {\n\t\tthis._isRendering = false;\n\t}\n\n\tonExitDOM(): void {\n\t\tthis.detachCloseOverflowHandlers();\n\t}\n\n\t/**\n\t * Wrapped component slot.\n\t * @public\n\t * @since 2.20.0\n\t */\n\n\t@slot({\n\t\t\"default\": true, type: HTMLElement, invalidateOnChildChange: true,\n\t})\n\titem!: IOverflowToolbarItem[];\n\n\t// Method called by ui5-toolbar to inform about the existing toolbar wrapper\n\tcheckForWrapper() {\n\t\tif (this._wrapperChecked) {\n\t\t\treturn;\n\t\t}\n\t\tthis._wrapperChecked = true;\n\n\t\tconst tagName = this.itemTagName as keyof typeof this.predefinedWrapperSet;\n\t\tconst ctor = this.constructor as typeof UI5Element;\n\t\tconst wrapperName = ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.tagName;\n\t\tif (wrapperName === \"ui5-toolbar-item\"\n\t\t\t&& this.predefinedWrapperSet[tagName]) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`This UI5 web component has its predefined toolbar wrapper called ${this.predefinedWrapperSet[tagName]}.`);\n\t\t}\n\t}\n\n\t// We want to close the overflow popover, when closing event is being executed\n\tgetClosingEvents(): string[] {\n\t\tconst item = Array.isArray(this.item) ? this.item[0] : this.item;\n\n\t\tconst closeEvents = this.closeOverflowSet[this.itemTagName as keyof typeof this.closeOverflowSet] || [];\n\t\tif (!item) {\n\t\t\treturn [...closeEvents];\n\t\t}\n\t\tconst overflowCloseEvents = Array.isArray(item.overflowCloseEvents) ? item.overflowCloseEvents : [];\n\n\t\treturn [...closeEvents, ...overflowCloseEvents];\n\t}\n\n\tattachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tif (!this.preventOverflowClosing) {\n\t\t\t\tthis.addEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t\t}\n\t\t});\n\t}\n\n\tdetachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tthis.removeEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t});\n\t}\n\n\tfireCloseOverflow() {\n\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t}\n\t/**\n\t* Defines if the width of the item should be ignored in calculating the whole width of the toolbar\n\t* @protected\n\t*/\n\tget ignoreSpace(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is flexible. An item that is returning true for this property will make\n\t * the toolbar expand to fill the 100% width of its container.\n\t * @protected\n\t */\n\tget hasFlexibleWidth(): boolean {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns if the item is interactive.\n\t * This value is used to determinate if the toolbar should have its accessibility role and attributes set.\n\t * At least two interactive items are needed for the toolbar to have the role=\"toolbar\" attribute set.\n\t * @protected\n\t */\n\tget isInteractive(): boolean {\n\t\treturn true;\n\t}\n\n\tget itemTagName() {\n\t\tconst ctor = this.getSlottedNodes<IOverflowToolbarItem>(\"item\")[0]?.constructor as typeof UI5Element;\n\t\treturn ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.getSlottedNodes<IOverflowToolbarItem>(\"item\")[0]?.tagName;\n\t}\n\n\tget hasOverflow(): boolean {\n\t\treturn this.item[0]?.hasOverflow ?? false;\n\t}\n\n\t/**\n\t * Returns if the item is separator.\n\t * @protected\n\t */\n\tget isSeparator() {\n\t\treturn false;\n\t}\n\n\tget stableDomRef() {\n\t\treturn this.getAttribute(\"stable-dom-ref\") || `${this._id}-stable-dom-ref`;\n\t}\n\n\tget classes() {\n\t\treturn {\n\t\t\troot: {\n\t\t\t\t\"ui5-tb-popover-item\": this.isOverflowed,\n\t\t\t\t\"ui5-tb-item\": true,\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport type {\n\tIEventOptions,\n\tToolbarItemEventDetail,\n\tIOverflowToolbarItem,\n};\nToolbarItem.define();\n\nexport default ToolbarItem;\n"]}
1
+ {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../src/ToolbarItem.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,IAAI,MAAM,wDAAwD,CAAC;AAC1E,OAAO,WAAW,MAAM,sDAAsD,CAAC;AAC/E,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,mBAAmB,MAAM,0BAA0B,CAAC;AAC3D,OAAO,cAAc,MAAM,uCAAuC,CAAC;AACnE,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAgBnD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,IAAM,WAAW,mBAAjB,MAAM,WAAY,SAAQ,eAAe;IAAzC;;QACC,cAAS,GAAG,CAAC,CAAC;QACd,oBAAe,GAAG,KAAK,CAAC;QACxB,yBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzD,qBAAgB,GAAG;YAClB,YAAY,EAAE,CAAC,OAAO,CAAC;YACvB,YAAY,EAAE,CAAC,QAAQ,CAAC;YACxB,cAAc,EAAE,CAAC,QAAQ,CAAC;YAC1B,oBAAoB,EAAE,CAAC,kBAAkB,CAAC;YAC1C,iBAAiB,EAAE,CAAC,QAAQ,CAAC;YAC7B,YAAY,EAAE,CAAC,QAAQ,CAAC;SACxB,CAAA;QAED,yBAAoB,GAAG;YACtB,YAAY,EAAE,eAAe;YAC7B,YAAY,EAAE,eAAe;SAC7B,CAAA;IAgFF,CAAC;IA9EA,iBAAiB;QAChB,IAAI,CAAC,eAAe,EA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,EAAE,mBAAmB;QAC7B,MAAM,EAAE,cAAc;KACtB,CAAC;GACI,WAAW,CAiGhB;AAKD,WAAW,CAAC,MAAM,EAAE,CAAC;AAErB,eAAe,WAAW,CAAC","sourcesContent":["import slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\nimport jsxRenderer from \"@ui5/webcomponents-base/dist/renderer/JsxRenderer.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport ToolbarItemTemplate from \"./ToolbarItemTemplate.js\";\nimport ToolbarItemCss from \"./generated/themes/ToolbarItem.css.js\";\nimport ToolbarItemBase from \"./ToolbarItemBase.js\";\nimport type { DefaultSlot } from \"@ui5/webcomponents-base\";\n\n/**\n * Interface for the slotted item in `ui5-toolbar-item`.\n *\n * It could be any HTMLElement or UI5 Web Component with option to specify custom overflow closing events and overflow behavior.\n *\n * @public\n * @since 2.20.0\n */\ninterface IToolbarItemContent extends HTMLElement {\n\toverflowCloseEvents?: string[];\n\thasOverflow?: boolean;\n}\n\n/**\n * @class\n *\n * ### Overview\n * The `ui5-toolbar-item` is a wrapper component used to integrate UI5 Web Components into the `ui5-toolbar`.\n * It renders within the toolbar's shadow DOM and manages the lifecycle\n * and overflow behavior of its child component.\n *\n * ### Structure\n * The toolbar item wraps a single UI5 Web Component (such as CheckBox, Title, etc.) and handles:\n * - Overflow management (determining if the item should be displayed in the main toolbar or overflow popover)\n * - Automatic popover closing on interaction\n * - CSS custom state exposure for styling based on overflow state\n *\n * ### Usage\n * The `ui5-toolbar-item` is typically used implicitly when adding components to a toolbar,\n * but specialized wrappers like `ui5-toolbar-button` provide\n * component-specific functionality and should be preferred when available.\n *\n * @constructor\n * @extends ToolbarItemBase\n * @public\n * @since 2.20.0\n */\n@customElement({\n\ttag: \"ui5-toolbar-item\",\n\tlanguageAware: true,\n\trenderer: jsxRenderer,\n\ttemplate: ToolbarItemTemplate,\n\tstyles: ToolbarItemCss,\n})\nclass ToolbarItem extends ToolbarItemBase {\n\t_maxWidth = 0;\n\t_wrapperChecked = false;\n\tfireCloseOverflowRef = this.fireCloseOverflow.bind(this);\n\n\tcloseOverflowSet = {\n\t\t\"ui5-button\": [\"click\"],\n\t\t\"ui5-select\": [\"change\"],\n\t\t\"ui5-combobox\": [\"change\"],\n\t\t\"ui5-multi-combobox\": [\"selection-change\"],\n\t\t\"ui5-date-picker\": [\"change\"],\n\t\t\"ui5-switch\": [\"change\"],\n\t}\n\n\tpredefinedWrapperSet = {\n\t\t\"ui5-button\": \"ToolbarButton\",\n\t\t\"ui5-select\": \"ToolbarSelect\",\n\t}\n\n\tonBeforeRendering(): void {\n\t\tthis.checkForWrapper();\n\t\tthis.attachCloseOverflowHandlers();\n\t}\n\n\tonExitDOM(): void {\n\t\tthis.detachCloseOverflowHandlers();\n\t}\n\n\t/**\n\t * Wrapped component slot.\n\t * @public\n\t * @since 2.20.0\n\t */\n\n\t@slot({\n\t\t\"default\": true, type: HTMLElement, invalidateOnChildChange: true,\n\t})\n\titem!: DefaultSlot<IToolbarItemContent>;\n\n\t// Method called by ui5-toolbar to inform about the existing toolbar wrapper\n\tcheckForWrapper() {\n\t\tif (this._wrapperChecked) {\n\t\t\treturn;\n\t\t}\n\t\tthis._wrapperChecked = true;\n\n\t\tconst tagName = this.itemTagName as keyof typeof this.predefinedWrapperSet;\n\t\tconst ctor = this.constructor as typeof ToolbarItem;\n\t\tconst wrapperName = ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.tagName;\n\t\tif (wrapperName === \"ui5-toolbar-item\"\n\t\t\t&& this.predefinedWrapperSet[tagName]) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(`This UI5 web component has its predefined toolbar wrapper called ${this.predefinedWrapperSet[tagName]}.`);\n\t\t}\n\t}\n\n\t// We want to close the overflow popover, when closing event is being executed\n\tgetClosingEvents(): string[] {\n\t\tconst item = this.item[0];\n\n\t\tconst closeEvents = this.closeOverflowSet[this.itemTagName as keyof typeof this.closeOverflowSet] || [];\n\t\tif (!item) {\n\t\t\treturn [...closeEvents];\n\t\t}\n\t\tconst overflowCloseEvents = item.overflowCloseEvents ? item.overflowCloseEvents : [];\n\n\t\treturn [...closeEvents, ...overflowCloseEvents];\n\t}\n\n\tattachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tif (!this.preventOverflowClosing) {\n\t\t\t\tthis.addEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t\t}\n\t\t});\n\t}\n\n\tdetachCloseOverflowHandlers() {\n\t\tconst closingEvents = this.getClosingEvents();\n\t\tclosingEvents.forEach(clEvent => {\n\t\t\tthis.removeEventListener(clEvent, this.fireCloseOverflowRef);\n\t\t});\n\t}\n\n\tfireCloseOverflow() {\n\t\tthis.fireDecoratorEvent(\"close-overflow\");\n\t}\n\n\tget itemTagName() {\n\t\tconst ctor = this.getSlottedNodes<IToolbarItemContent>(\"item\")[0]?.constructor as typeof ToolbarItem;\n\t\treturn ctor?.getMetadata ? ctor.getMetadata().getPureTag() : this.getSlottedNodes<IToolbarItemContent>(\"item\")[0]?.tagName;\n\t}\n\n\tget hasOverflow(): boolean {\n\t\treturn this.item[0]?.hasOverflow ?? false;\n\t}\n}\n\nexport type {\n\tIToolbarItemContent,\n};\nToolbarItem.define();\n\nexport default ToolbarItem;\n"]}
@@ -0,0 +1,69 @@
1
+ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
+ import type ToolbarItemOverflowBehavior from "./types/ToolbarItemOverflowBehavior.js";
3
+ type ToolbarItemEventDetail = {
4
+ targetRef: HTMLElement;
5
+ };
6
+ declare class ToolbarItemBase extends UI5Element {
7
+ eventDetails: {
8
+ "close-overflow": void;
9
+ };
10
+ /**
11
+ * Property used to define the access of the item to the overflow Popover. If "NeverOverflow" option is set,
12
+ * the item never goes in the Popover, if "AlwaysOverflow" - it never comes out of it.
13
+ * @public
14
+ * @default "Default"
15
+ */
16
+ overflowPriority: `${ToolbarItemOverflowBehavior}`;
17
+ /**
18
+ * Defines if the toolbar overflow popup should close upon interaction with the item.
19
+ * It will close by default.
20
+ * @default false
21
+ * @public
22
+ */
23
+ preventOverflowClosing: boolean;
24
+ _isOverflowed: boolean;
25
+ get isOverflowed(): boolean;
26
+ /**
27
+ * Defines if the toolbar item is overflowed.
28
+ * @default false
29
+ * @protected
30
+ * @since 2.11.0
31
+ */
32
+ set isOverflowed(value: boolean);
33
+ _maxWidth: number;
34
+ _isRendering: boolean;
35
+ onAfterRendering(): void;
36
+ /**
37
+ * Defines if the width of the item should be ignored in calculating the whole width of the toolbar
38
+ * @protected
39
+ */
40
+ get ignoreSpace(): boolean;
41
+ /**
42
+ * Returns if the item is flexible. An item that is returning true for this property will make
43
+ * the toolbar expand to fill the 100% width of its container.
44
+ * @protected
45
+ */
46
+ get hasFlexibleWidth(): boolean;
47
+ /**
48
+ * Returns if the item is interactive.
49
+ * This value is used to determinate if the toolbar should have its accessibility role and attributes set.
50
+ * At least two interactive items are needed for the toolbar to have the role="toolbar" attribute set.
51
+ * @protected
52
+ */
53
+ get isInteractive(): boolean;
54
+ get hasOverflow(): boolean;
55
+ /**
56
+ * Returns if the item is separator.
57
+ * @protected
58
+ */
59
+ get isSeparator(): boolean;
60
+ get stableDomRef(): string;
61
+ get classes(): {
62
+ root: {
63
+ "ui5-tb-popover-item": boolean;
64
+ "ui5-tb-item": boolean;
65
+ };
66
+ };
67
+ }
68
+ export type { ToolbarItemEventDetail, };
69
+ export default ToolbarItemBase;