@ui5/webcomponents 1.12.0-rc.2 → 1.12.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 (236) hide show
  1. package/.eslintrc.cjs +3 -0
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +36 -0
  4. package/config/wdio.conf.cjs +13 -0
  5. package/dist/Avatar.d.ts +2 -0
  6. package/dist/Avatar.js.map +1 -1
  7. package/dist/Button.d.ts +7 -2
  8. package/dist/Button.js +7 -2
  9. package/dist/Button.js.map +1 -1
  10. package/dist/CalendarPart.js +4 -1
  11. package/dist/CalendarPart.js.map +1 -1
  12. package/dist/DatePicker.d.ts +1 -1
  13. package/dist/DatePicker.js +1 -1
  14. package/dist/DatePicker.js.map +1 -1
  15. package/dist/DayPicker.js +1 -1
  16. package/dist/DayPicker.js.map +1 -1
  17. package/dist/Icon.d.ts +2 -4
  18. package/dist/Icon.js +3 -7
  19. package/dist/Icon.js.map +1 -1
  20. package/dist/ListItemBase.d.ts +1 -1
  21. package/dist/ListItemBase.js +4 -7
  22. package/dist/ListItemBase.js.map +1 -1
  23. package/dist/MultiComboBox.js +1 -0
  24. package/dist/MultiComboBox.js.map +1 -1
  25. package/dist/Select.js +1 -0
  26. package/dist/Select.js.map +1 -1
  27. package/dist/TimePicker.d.ts +2 -1
  28. package/dist/TimePickerBase.d.ts +1 -1
  29. package/dist/TimePickerBase.js +1 -1
  30. package/dist/TimePickerBase.js.map +1 -1
  31. package/dist/TimeSelection.d.ts +2 -1
  32. package/dist/api.json +1 -1
  33. package/dist/assets/IconCollectionInCustomTheme.91b08a2b.css +1 -0
  34. package/dist/assets/SAP-icons-TNT.1a9c4736.js +1 -0
  35. package/dist/assets/SAP-icons-business-suite.0589a2e2.js +1 -0
  36. package/dist/assets/SAP-icons-business-suite.cabfcb50.js +1 -0
  37. package/dist/assets/SAP-icons.94515297.js +1 -0
  38. package/dist/assets/{SAP-icons.535f5f87.js → SAP-icons.e7342524.js} +1 -1
  39. package/dist/assets/messagebundle_en_US_sappsd.4b5e22df.js +1 -0
  40. package/dist/assets/messagebundle_en_US_saptrc.1c1645fc.js +1 -0
  41. package/dist/assets/parameters-bundle.css.01644757.js +1 -0
  42. package/dist/assets/parameters-bundle.css.2c8496aa.js +1 -0
  43. package/dist/assets/parameters-bundle.css.52765351.js +1 -0
  44. package/dist/assets/parameters-bundle.css.699b96c0.js +1 -0
  45. package/dist/assets/parameters-bundle.css.6db4d34a.js +1 -0
  46. package/dist/assets/parameters-bundle.css.70a65e3a.js +1 -0
  47. package/dist/assets/parameters-bundle.css.71348be9.js +1 -0
  48. package/dist/assets/parameters-bundle.css.71c92b92.js +1 -0
  49. package/dist/assets/parameters-bundle.css.9bd22734.js +1 -0
  50. package/dist/assets/parameters-bundle.css.b7a262bf.js +1 -0
  51. package/dist/assets/parameters-bundle.css.c565b624.js +1 -0
  52. package/dist/assets/parameters-bundle.css.cbd268df.js +1 -0
  53. package/dist/assets/parameters-bundle.css.d3b9e3dd.js +1 -0
  54. package/dist/assets/parameters-bundle.css.f552e9e6.js +1 -0
  55. package/dist/assets/test/pages/{ComboBox.html.617ef1d9.js → ComboBox.html.ce286d9b.js} +1 -1
  56. package/dist/assets/test/pages/{Icon.html.3b4d9b39.js → Icon.html.f06bfd56.js} +1 -1
  57. package/dist/assets/test/pages/{Label.html.f4a54c92.js → Label.html.9dc7b220.js} +1 -1
  58. package/dist/assets/test/pages/{Popups.html.5288d6fc.js → Popups.html.ec5a0fc7.js} +1 -1
  59. package/dist/css/themes/BusyIndicator.css +1 -1
  60. package/dist/css/themes/Button.css +1 -1
  61. package/dist/css/themes/CheckBox.css +1 -1
  62. package/dist/css/themes/ProgressIndicator.css +1 -1
  63. package/dist/css/themes/TextArea.css +1 -1
  64. package/dist/custom-elements.json +1 -1
  65. package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
  66. package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
  67. package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
  68. package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -1
  69. package/dist/generated/templates/ButtonTemplate.lit.js +1 -1
  70. package/dist/generated/templates/IconTemplate.lit.js +1 -1
  71. package/dist/generated/templates/ToggleButtonTemplate.lit.js +1 -1
  72. package/dist/generated/themes/BusyIndicator.css.js +1 -1
  73. package/dist/generated/themes/BusyIndicator.css.js.map +1 -1
  74. package/dist/generated/themes/Button.css.js +1 -1
  75. package/dist/generated/themes/Button.css.js.map +1 -1
  76. package/dist/generated/themes/CheckBox.css.js +1 -1
  77. package/dist/generated/themes/CheckBox.css.js.map +1 -1
  78. package/dist/generated/themes/ProgressIndicator.css.js +1 -1
  79. package/dist/generated/themes/ProgressIndicator.css.js.map +1 -1
  80. package/dist/generated/themes/TextArea.css.js +1 -1
  81. package/dist/generated/themes/TextArea.css.js.map +1 -1
  82. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
  83. package/dist/generated/themes/sap_horizon/parameters-bundle.css.js.map +1 -1
  84. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -1
  85. package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js.map +1 -1
  86. package/dist/i18n/messagebundle_en_US_sappsd.properties +0 -2
  87. package/dist/i18n/messagebundle_en_US_saptrc.properties +0 -2
  88. package/dist/test/pages/72override.html +1 -1
  89. package/dist/test/pages/AnimanitionOff.html +1 -1
  90. package/dist/test/pages/Avatar.html +1 -1
  91. package/dist/test/pages/AvatarGroup.html +1 -1
  92. package/dist/test/pages/Badge.html +1 -1
  93. package/dist/test/pages/Breadcrumbs.html +1 -1
  94. package/dist/test/pages/BusyIndicator.html +24 -1
  95. package/dist/test/pages/Button.html +4 -2
  96. package/dist/test/pages/Calendar.html +3 -1
  97. package/dist/test/pages/Card.html +1 -1
  98. package/dist/test/pages/Carousel.html +1 -1
  99. package/dist/test/pages/CheckBox.html +1 -1
  100. package/dist/test/pages/ColorPalette.html +1 -1
  101. package/dist/test/pages/ColorPalettePopover.html +1 -1
  102. package/dist/test/pages/ColorPicker.html +1 -1
  103. package/dist/test/pages/ComboBox.html +2 -2
  104. package/dist/test/pages/Components.html +1 -1
  105. package/dist/test/pages/CoreControls.html +1 -1
  106. package/dist/test/pages/CoreControls_exp.html +1 -1
  107. package/dist/test/pages/CustomCSS.html +1 -1
  108. package/dist/test/pages/DatePicker.html +1 -1
  109. package/dist/test/pages/DatePicker_test_page.html +1 -1
  110. package/dist/test/pages/DateRangePicker.html +1 -1
  111. package/dist/test/pages/DateTimePicker.html +1 -1
  112. package/dist/test/pages/DayPicker.html +1 -1
  113. package/dist/test/pages/Dialog.html +1 -1
  114. package/dist/test/pages/DialogLifecycle.html +1 -1
  115. package/dist/test/pages/DialogSemantic.html +1 -1
  116. package/dist/test/pages/Eventing.html +1 -1
  117. package/dist/test/pages/F6Test1.html +1 -1
  118. package/dist/test/pages/F6Test2.html +1 -1
  119. package/dist/test/pages/F6Test3.html +1 -1
  120. package/dist/test/pages/F6Test4.html +1 -1
  121. package/dist/test/pages/F6Test5.html +1 -1
  122. package/dist/test/pages/F6Test6.html +1 -1
  123. package/dist/test/pages/F6Test7.html +1 -1
  124. package/dist/test/pages/FileUploader.html +1 -1
  125. package/dist/test/pages/FormSupport.html +1 -1
  126. package/dist/test/pages/HCB.html +1 -1
  127. package/dist/test/pages/Icon.html +29 -20
  128. package/dist/test/pages/Icon_and_theming.html +1 -1
  129. package/dist/test/pages/Icon_custom.html +1 -1
  130. package/dist/test/pages/Input.html +1 -1
  131. package/dist/test/pages/InputFieldLabels.html +1 -1
  132. package/dist/test/pages/InputFieldMinWidth.html +1 -1
  133. package/dist/test/pages/InputIcons.html +1 -1
  134. package/dist/test/pages/Input_quickview.html +1 -1
  135. package/dist/test/pages/InputsAlignment.html +1 -1
  136. package/dist/test/pages/InputsLazyLoading.html +1 -1
  137. package/dist/test/pages/ItemNavigation.html +1 -1
  138. package/dist/test/pages/Kitchen.html +1 -1
  139. package/dist/test/pages/Kitchen.openui5.html +1 -1
  140. package/dist/test/pages/Label.html +2 -2
  141. package/dist/test/pages/Link.html +1 -1
  142. package/dist/test/pages/List.html +1 -1
  143. package/dist/test/pages/ListGrowing_Button.html +1 -1
  144. package/dist/test/pages/ListGrowing_Scroll.html +1 -1
  145. package/dist/test/pages/List_keyboard_support.html +1 -1
  146. package/dist/test/pages/List_test_page.html +14 -1
  147. package/dist/test/pages/LitKeyFunction.html +1 -1
  148. package/dist/test/pages/MemoryLeak.html +1 -1
  149. package/dist/test/pages/Menu.html +1 -1
  150. package/dist/test/pages/MessagePage.html +1 -1
  151. package/dist/test/pages/MessageStrip.html +1 -1
  152. package/dist/test/pages/MultiComboBox.html +13 -1
  153. package/dist/test/pages/MultiInput.html +1 -1
  154. package/dist/test/pages/MultiInput_Suggestions.html +1 -1
  155. package/dist/test/pages/OpenUI5-second.html +1 -1
  156. package/dist/test/pages/OpenUI5.html +1 -1
  157. package/dist/test/pages/Panel.html +1 -1
  158. package/dist/test/pages/Popover.html +1 -1
  159. package/dist/test/pages/PopoverArrowBounds.html +1 -1
  160. package/dist/test/pages/Popups.html +2 -2
  161. package/dist/test/pages/ProgressIndicator.html +1 -1
  162. package/dist/test/pages/RTL.html +1 -1
  163. package/dist/test/pages/RadioButton.html +1 -1
  164. package/dist/test/pages/RangeSlider.html +1 -1
  165. package/dist/test/pages/RatingIndicator.html +1 -1
  166. package/dist/test/pages/ResizeHandler.html +1 -1
  167. package/dist/test/pages/ResponsivePopover.html +1 -1
  168. package/dist/test/pages/SegmentedButton.html +1 -1
  169. package/dist/test/pages/Select.html +1 -1
  170. package/dist/test/pages/Simple.html +1 -1
  171. package/dist/test/pages/Slider.html +1 -1
  172. package/dist/test/pages/SplitButton.html +1 -1
  173. package/dist/test/pages/StepInput.html +1 -1
  174. package/dist/test/pages/Switch.html +1 -1
  175. package/dist/test/pages/TabContainer.html +1 -1
  176. package/dist/test/pages/Table-perf-pure.html +1 -1
  177. package/dist/test/pages/Table-perf.html +1 -1
  178. package/dist/test/pages/Table.html +1 -1
  179. package/dist/test/pages/Table2.html +1 -1
  180. package/dist/test/pages/TableAllPopin.html +1 -1
  181. package/dist/test/pages/TableCustomStyling.html +1 -1
  182. package/dist/test/pages/TableGrouping.html +1 -1
  183. package/dist/test/pages/TableGrowingWithButton.html +1 -1
  184. package/dist/test/pages/TableGrowingWithScroll.html +1 -1
  185. package/dist/test/pages/TableSelection.html +1 -1
  186. package/dist/test/pages/TextArea.html +1 -1
  187. package/dist/test/pages/TimePicker.html +1 -1
  188. package/dist/test/pages/TimeSelection.html +1 -1
  189. package/dist/test/pages/Title.html +1 -1
  190. package/dist/test/pages/Toast.html +1 -1
  191. package/dist/test/pages/ToggleButton.html +1 -1
  192. package/dist/test/pages/Tree.html +1 -1
  193. package/dist/test/pages/WheelSlider_Test_Page.html +1 -1
  194. package/dist/test/pages/base/AriaLabelHelper.html +1 -1
  195. package/dist/test/pages/base/DOMObserver.html +1 -1
  196. package/dist/test/pages/base/IconCollection.html +23 -0
  197. package/dist/test/pages/base/IconCollectionInCustomTheme.html +25 -0
  198. package/dist/test/pages/base/InvisibleMessage.html +1 -1
  199. package/dist/test/pages/form.html +1 -1
  200. package/dist/test/pages/i18n-defaultLang.html +1 -1
  201. package/dist/test/pages/i18n-demo.html +1 -1
  202. package/package.json +8 -7
  203. package/src/Button.hbs +1 -1
  204. package/src/Icon.hbs +0 -1
  205. package/src/i18n/messagebundle_en_US_sappsd.properties +0 -2
  206. package/src/i18n/messagebundle_en_US_saptrc.properties +0 -2
  207. package/src/themes/BusyIndicator.css +1 -0
  208. package/src/themes/Button.css +1 -3
  209. package/src/themes/CheckBox.css +1 -0
  210. package/src/themes/ProgressIndicator.css +1 -1
  211. package/src/themes/TextArea.css +6 -3
  212. package/src/themes/sap_horizon/CheckBox-parameters.css +0 -1
  213. package/src/themes/sap_horizon_dark/CheckBox-parameters.css +0 -1
  214. package/dist/assets/SAP-icons-TNT.0ab30112.js +0 -1
  215. package/dist/assets/SAP-icons-business-suite.5e4d496e.js +0 -1
  216. package/dist/assets/SAP-icons-business-suite.7313c1b1.js +0 -1
  217. package/dist/assets/SAP-icons.8ad12244.js +0 -1
  218. package/dist/assets/messagebundle_en_US_sappsd.9968eca8.js +0 -1
  219. package/dist/assets/messagebundle_en_US_saptrc.ce217732.js +0 -1
  220. package/dist/assets/parameters-bundle.css.06915823.js +0 -1
  221. package/dist/assets/parameters-bundle.css.0fbb157c.js +0 -1
  222. package/dist/assets/parameters-bundle.css.1472a695.js +0 -1
  223. package/dist/assets/parameters-bundle.css.27f47e2c.js +0 -1
  224. package/dist/assets/parameters-bundle.css.3d177072.js +0 -1
  225. package/dist/assets/parameters-bundle.css.555b94dc.js +0 -1
  226. package/dist/assets/parameters-bundle.css.568a0fcb.js +0 -1
  227. package/dist/assets/parameters-bundle.css.83dc09a3.js +0 -1
  228. package/dist/assets/parameters-bundle.css.998f5591.js +0 -1
  229. package/dist/assets/parameters-bundle.css.aa4080ac.js +0 -1
  230. package/dist/assets/parameters-bundle.css.c5191133.js +0 -1
  231. package/dist/assets/parameters-bundle.css.dbd9833e.js +0 -1
  232. package/dist/assets/parameters-bundle.css.e59e43e9.js +0 -1
  233. package/dist/assets/parameters-bundle.css.ecedad1a.js +0 -1
  234. /package/config/postcss.components/{postcss.config.js → postcss.config.cjs} +0 -0
  235. /package/config/postcss.themes/{postcss.config.js → postcss.config.cjs} +0 -0
  236. /package/{package-scripts.js → package-scripts.cjs} +0 -0
package/.eslintrc.cjs ADDED
@@ -0,0 +1,3 @@
1
+ const config = require("@ui5/webcomponents-tools/components-package/eslint.js");
2
+
3
+ module.exports = config;
package/.npsrc.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "config": "./package-scripts.cjs"
3
+ }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.12.0](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.3...v1.12.0) (2023-04-04)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **theming:** fix icons version display for custom themes (built via the ThemeDesigner) ([#6815](https://github.com/SAP/ui5-webcomponents/issues/6815)) ([63ff800](https://github.com/SAP/ui5-webcomponents/commit/63ff8007889a66efae074fc6b4dbcb1b7ea36713)), closes [#6758](https://github.com/SAP/ui5-webcomponents/issues/6758)
12
+ * **ui5-checkbox:** apply correct styles to down state ([#6824](https://github.com/SAP/ui5-webcomponents/issues/6824)) ([c7c186d](https://github.com/SAP/ui5-webcomponents/commit/c7c186d048ed3a38941610e319a2568b9e92073a))
13
+ * **ui5-daypicker:** date selection range light blue indication ([#6836](https://github.com/SAP/ui5-webcomponents/issues/6836)) ([d16cf33](https://github.com/SAP/ui5-webcomponents/commit/d16cf33ef9418d7ae8857845709dd618593a3d96)), closes [#6781](https://github.com/SAP/ui5-webcomponents/issues/6781)
14
+ * **ui5-progress-indicator:** disabled opacity fix ([#6808](https://github.com/SAP/ui5-webcomponents/issues/6808)) ([1174b48](https://github.com/SAP/ui5-webcomponents/commit/1174b486d2df234b3e295af4e3d95158751bf58b))
15
+
16
+
17
+
18
+
19
+
20
+ # [1.12.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.2...v1.12.0-rc.3) (2023-03-30)
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **ui5-avatar:** documentation fix ([#6822](https://github.com/SAP/ui5-webcomponents/issues/6822)) ([e0ec2eb](https://github.com/SAP/ui5-webcomponents/commit/e0ec2eb6374df16e3b9f993075662ae13924b9c8))
26
+ * **ui5-busy-indicator:** height of the root element inherits the height of the Busy Indicator ([#6805](https://github.com/SAP/ui5-webcomponents/issues/6805)) ([3659ca0](https://github.com/SAP/ui5-webcomponents/commit/3659ca08351f8dccfd7a7505e958f1b8b53c9795)), closes [#6668](https://github.com/SAP/ui5-webcomponents/issues/6668)
27
+ * **ui5-list:** forward focus behaviour ([#6790](https://github.com/SAP/ui5-webcomponents/issues/6790)) ([3ac819c](https://github.com/SAP/ui5-webcomponents/commit/3ac819c6e56953a133cd3ecf5cc703b45c561cea))
28
+ * **ui5-multi-combobox:** prevent focus lost after token deletion ([#6734](https://github.com/SAP/ui5-webcomponents/issues/6734)) ([d23b8d7](https://github.com/SAP/ui5-webcomponents/commit/d23b8d7ca2dcf0319fd87abd109b9ead6b0b76a3)), closes [#6671](https://github.com/SAP/ui5-webcomponents/issues/6671)
29
+ * **ui5-select:** selected option is announced on dropdown open ([#6733](https://github.com/SAP/ui5-webcomponents/issues/6733)) ([6a6f87f](https://github.com/SAP/ui5-webcomponents/commit/6a6f87f64db0b61c41369e7c7414e800435a848d))
30
+ * **ui5-textarea:** apply correct styles to value state None ([#6804](https://github.com/SAP/ui5-webcomponents/issues/6804)) ([6f7a22b](https://github.com/SAP/ui5-webcomponents/commit/6f7a22b2ba58c92fcfa947df7787a406152b26c4))
31
+
32
+
33
+ ### Features
34
+
35
+ * **ui5-button:** propagate icon default title to button ([#6719](https://github.com/SAP/ui5-webcomponents/issues/6719)) ([575039e](https://github.com/SAP/ui5-webcomponents/commit/575039e03dacc49b353afefe4a9bc97998a1354e)), closes [#5733](https://github.com/SAP/ui5-webcomponents/issues/5733)
36
+ * **ui5-calendar:** focus the nearest day when today is out of range ([#6801](https://github.com/SAP/ui5-webcomponents/issues/6801)) ([e67a442](https://github.com/SAP/ui5-webcomponents/commit/e67a44273146fdb32ce8f4538ec26ba1e6135dc2)), closes [#6750](https://github.com/SAP/ui5-webcomponents/issues/6750)
37
+
38
+
39
+
40
+
41
+
6
42
  # [1.12.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.12.0-rc.1...v1.12.0-rc.2) (2023-03-23)
7
43
 
8
44
 
@@ -0,0 +1,13 @@
1
+ const wdio = require("@ui5/webcomponents-tools/components-package/wdio.js");
2
+
3
+ wdio.config.suites = {
4
+ "suite1": [
5
+ './test/specs/base/*.spec.js',
6
+ './test/specs/[A-I]*.spec.js',
7
+ ],
8
+ "suite2": [
9
+ './test/specs/[^A-I]*.spec.js',
10
+ ],
11
+ };
12
+
13
+ module.exports = wdio;
package/dist/Avatar.d.ts CHANGED
@@ -62,6 +62,8 @@ declare class Avatar extends UI5Element implements ITabbable {
62
62
  * import "@ui5/webcomponents-icons/dist/{icon_name}.js"
63
63
  * <br>
64
64
  * <pre>&lt;ui5-avatar icon="employee"></pre>
65
+ * <br>
66
+ * <b>Note:</b> If no icon or an empty one is provided, by default the "employee" icon should be displayed.
65
67
  *
66
68
  * See all the available icons in the <ui5-link target="_blank" href="https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html">Icon Explorer</ui5-link>.
67
69
  * @type {string}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAI3E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACxE,WAAW;AACX,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,SAAS;AACT,OAAO,SAAS,MAAM,kCAAkC,CAAC;AAEzD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,iBAAiB,MAAM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AAC,EAAE,CAAC;oCACzC;AAMlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;qCACxC;AAyBnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,CAAC,OAAO,EAAE,CAAC;2CAC/C;AAMhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,EAAE,iBAAiB,CAAC,OAAO,EAAE,CAAC;4CAC9C;AAajC;IADC,QAAQ,EAAE;8CACa;AAUxB;IADC,QAAQ,EAAE;4CACW;AAGtB;IADC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;yCACb;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACR;AAmBpB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;qCAClB;AA6B3B;IADC,IAAI,EAAE;qCACoB;AAtMtB,MAAM;IAhBX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,cAAc;QACxB,YAAY,EAAE,CAAC,IAAI,CAAC;KACpB,CAAC;IACF;;;;;;MAME;;IACD,KAAK,CAAC,OAAO,CAAC;GACT,MAAM,CAqVX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\n\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\n// Template\nimport AvatarTemplate from \"./generated/templates/AvatarTemplate.lit.js\";\n\nimport { AVATAR_TOOLTIP } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarCss from \"./generated/themes/Avatar.css.js\";\n\nimport Icon from \"./Icon.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport AvatarShape from \"./types/AvatarShape.js\";\nimport AvatarColorScheme from \"./types/AvatarColorScheme.js\";\n\n// Icon\nimport \"@ui5/webcomponents-icons/dist/employee.js\";\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * An image-like component that has different display options for representing images and icons\n * in different shapes and sizes, depending on the use case.\n *\n * The shape can be circular or square. There are several predefined sizes, as well as an option to\n * set a custom size.\n *\n * <br><br>\n * <h3>Keyboard Handling</h3>\n *\n * <ul>\n * <li>[SPACE, ENTER, RETURN] - Fires the <code>click</code> event if the <code>interactive</code> property is set to true.</li>\n * <li>[SHIFT] - If [SPACE] is pressed, pressing [SHIFT] releases the component without triggering the click event.</li>\n * </ul>\n * <br><br>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Avatar.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Avatar\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-avatar\n * @since 1.0.0-rc.6\n * @implements sap.ui.webc.main.IAvatar\n * @public\n */\n@customElement({\n\ttag: \"ui5-avatar\",\n\tlanguageAware: true,\n\trenderer: litRender,\n\tstyles: AvatarCss,\n\ttemplate: AvatarTemplate,\n\tdependencies: [Icon],\n})\n/**\n* Fired on mouseup, space and enter if avatar is interactive\n*\n* @event\n* @private\n* @since 1.0.0-rc.11\n*/\n@event(\"click\")\nclass Avatar extends UI5Element implements ITabbable {\n\t/**\n\t * Defines if the avatar is interactive (focusable and pressable).\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Avatar.prototype.interactive\n\t * @defaultValue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tinteractive!: boolean;\n\n\t/**\n\t * Indicates if the elements is on focus\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfocused!: boolean;\n\n\t/**\n\t * Defines the name of the UI5 Icon, that will be displayed.\n\t * <br>\n\t * <b>Note:</b> If <code>image</code> slot is provided, the property will be ignored.\n\t * <br>\n\t * <b>Note:</b> You should import the desired icon first, then use its name as \"icon\".\n\t * <br><br>\n\t * import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"\n\t * <br>\n\t * <pre>&lt;ui5-avatar icon=\"employee\"></pre>\n\t *\n\t * See all the available icons in the <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">Icon Explorer</ui5-link>.\n\t * @type {string}\n\t * @name sap.ui.webc.main.Avatar.prototype.icon\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\ticon!: string;\n\n\t/**\n\t * Defines the displayed initials.\n\t * <br>\n\t * Up to three Latin letters can be displayed as initials.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Avatar.prototype.initials\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\tinitials!: string;\n\n\t/**\n\t * Defines the shape of the component.\n\t * <br><br>\n\t * Available options are:\n\t * <ul>\n\t * <li><code>Circle</code></li>\n\t * <li><code>Square</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.AvatarShape}\n\t * @name sap.ui.webc.main.Avatar.prototype.shape\n\t * @defaultvalue \"Circle\"\n\t * @public\n\t */\n\t@property({ type: AvatarShape, defaultValue: AvatarShape.Circle })\n\tshape!: AvatarShape;\n\n\t/**\n\t * Defines predefined size of the component.\n\t * <br><br>\n\t * Available options are:\n\t * <ul>\n\t * <li><code>XS</code></li>\n\t * <li><code>S</code></li>\n\t * <li><code>M</code></li>\n\t * <li><code>L</code></li>\n\t * <li><code>XL</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.AvatarSize}\n\t * @name sap.ui.webc.main.Avatar.prototype.size\n\t * @defaultvalue \"S\"\n\t * @public\n\t */\n\t@property({ type: AvatarSize, defaultValue: AvatarSize.S })\n\tsize!: AvatarSize;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: AvatarSize, defaultValue: AvatarSize.S })\n\t_size!: AvatarSize;\n\n\t/**\n\t * Defines the background color of the desired image.\n\t * <br><br>\n\t * Available options are:\n\t * <ul>\n\t * <li><code>Accent1</code></li>\n\t * <li><code>Accent2</code></li>\n\t * <li><code>Accent3</code></li>\n\t * <li><code>Accent4</code></li>\n\t * <li><code>Accent5</code></li>\n\t * <li><code>Accent6</code></li>\n\t * <li><code>Accent7</code></li>\n\t * <li><code>Accent8</code></li>\n\t * <li><code>Accent9</code></li>\n\t * <li><code>Accent10</code></li>\n\t * <li><code>Placeholder</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.AvatarColorScheme}\n\t * @name sap.ui.webc.main.Avatar.prototype.colorScheme\n\t * @defaultvalue \"Accent6\"\n\t * @public\n\t */\n\t@property({ type: AvatarColorScheme, defaultValue: AvatarColorScheme.Accent6 })\n\tcolorScheme!: AvatarColorScheme;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: AvatarColorScheme, defaultValue: AvatarColorScheme.Accent6 })\n\t_colorScheme!: AvatarColorScheme;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Avatar.prototype.accessibleName\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.0.0-rc.7\n\t */\n\t@property()\n\taccessibleName!: string;\n\n\t/**\n\t * Defines the aria-haspopup value of the component when <code>interactive</code> property is <code>true</code>.\n\t * <br><br>\n\t * @type String\n\t * @since 1.0.0-rc.15\n\t * @protected\n\t */\n\t@property()\n\tariaHaspopup!: string;\n\n\t@property({ noAttribute: true })\n\t_tabIndex!: string;\n\n\t@property({ type: Boolean })\n\t_hasImage!: boolean;\n\n\t/**\n\t * Receives the desired <code>&lt;img&gt;</code> tag\n\t *\n\t * <b>Note:</b> If you experience flickering of the provided image, you can hide the component until it is being defined with the following CSS:\n\t * <br /> <br />\n\t * <code>\n\t *\t\tui5-avatar:not(:defined) { <br />\n\t *\t\t\t&nbsp;visibility: hidden; <br />\n\t *\t\t} <br />\n\t * </code>\n\t * @type {HTMLElement}\n\t * @name sap.ui.webc.main.Avatar.prototype.default\n\t * @slot image\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\timage!: Array<HTMLElement>;\n\n\t/**\n\t * Defines the optional badge that will be used for visual affordance.\n\t * <b>Note:</b> While the slot allows for custom badges, to achieve\n\t * the Fiori design, please use <code>ui5-badge</code> with <code>ui5-icon</code>\n\t * in the corresponding <code>icon</code> slot, without text nodes.\n\t * <br><br>\n\t * Example:\n\t * <br><br>\n\t * &lt;ui5-avatar><br>\n\t * &nbsp;&nbsp;&nbsp;&nbsp;&lt;ui5-badge slot=\"badge\"><br>\n\t * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ui5-icon slot=\"icon\" name=\"employee\">&lt;/ui5-icon><br>\n\t * &nbsp;&nbsp;&nbsp;&nbsp;&lt;/ui5-badge><br>\n\t * &lt;/ui5-avatar>\n\t * <br><br>\n\t * <ui5-avatar initials=\"AB\" color-scheme=\"Accent1\">\n\t * <ui5-badge slot=\"badge\">\n\t * <ui5-icon slot=\"icon\" name=\"accelerated\"></ui5-icon>\n\t * </ui5-badge>\n\t * </ui5-avatar>\n\t *\n\t * @type {HTMLElement}\n\t * @name sap.ui.webc.main.Avatar.prototype.badge\n\t * @slot badge\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@slot()\n\tbadge!: Array<HTMLElement>;\n\n\t_onclick?: (e: MouseEvent) => void;\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tAvatar.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget tabindex() {\n\t\treturn this._tabIndex || (this.interactive ? \"0\" : \"-1\");\n\t}\n\n\t/**\n\t * Returns the effective avatar size.\n\t * @readonly\n\t * @type {string}\n\t * @defaultValue \"S\"\n\t * @private\n\t */\n\tget _effectiveSize(): AvatarSize {\n\t\t// we read the attribute, because the \"size\" property will always have a default value\n\t\treturn this.getAttribute(\"size\") as AvatarSize || this._size;\n\t}\n\n\t/**\n\t * Returns the effective background color.\n\t * @readonly\n\t * @type {string}\n\t * @defaultValue \"Accent6\"\n\t * @private\n\t */\n\tget _effectiveBackgroundColor() {\n\t\t// we read the attribute, because the \"background-color\" property will always have a default value\n\t\treturn this.getAttribute(\"color-scheme\") || this._colorScheme;\n\t}\n\n\tget _role() {\n\t\treturn this.interactive ? \"button\" : undefined;\n\t}\n\n\tget _ariaHasPopup() {\n\t\treturn this._getAriaHasPopup();\n\t}\n\n\tget validInitials() {\n\t\t// initials should consist of only 1,2 or 3 latin letters\n\t\tconst validInitials = /^[a-zA-Zà-üÀ-Ü]{1,3}$/,\n\t\t\tareInitialsValid = this.initials && validInitials.test(this.initials);\n\n\t\tif (areInitialsValid) {\n\t\t\treturn this.initials;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget accessibleNameText() {\n\t\tif (this.accessibleName) {\n\t\t\treturn this.accessibleName;\n\t\t}\n\n\t\treturn Avatar.i18nBundle.getText(AVATAR_TOOLTIP) || undefined;\n\t}\n\n\tget hasImage() {\n\t\tthis._hasImage = !!this.image.length;\n\t\treturn this._hasImage;\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._onclick = this.interactive ? this._onClickHandler.bind(this) : undefined;\n\t}\n\n\tonAfterRendering() {\n\t\tthis._checkInitials();\n\t}\n\n\t_setFallbackIcon() {\n\t\t// if there isn`t icon set in the avatar the default one is shown, when the initials are not valid or are missing\n\t\tthis.icon = this.icon || \"employee\";\n\t\treturn this.icon;\n\t}\n\n\t_checkInitials() {\n\t\tconst avatar = this.getDomRef()!,\n\t\t\tavatarInitials = avatar.querySelector(\".ui5-avatar-initials\");\n\t\t// if there aren`t initalts set - the fallBack icon should be shown\n\t\tif (!this.validInitials) {\n\t\t\tthis._setFallbackIcon();\n\t\t}\n\t\t// if initials` width is bigger than the avatar, an icon should be shown inside the avatar\n\t\tif (this.initials && this.initials.length === 3) {\n\t\t\tif (avatarInitials && avatarInitials.scrollWidth >= avatar.scrollWidth) {\n\t\t\t\tthis._setFallbackIcon();\n\t\t\t}\n\t\t}\n\t\treturn this.icon;\n\t}\n\n\t_onClickHandler(e: MouseEvent) {\n\t\t// prevent the native event and fire custom event to ensure the noConfict \"ui5-click\" is fired\n\t\te.stopPropagation();\n\t\tthis.fireEvent(\"click\");\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this.interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this.interactive && !e.shiftKey && isSpace(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\t}\n\n\t_onfocusout() {\n\t\tthis.focused = false;\n\t}\n\n\t_onfocusin() {\n\t\tif (this.interactive) {\n\t\t\tthis.focused = true;\n\t\t}\n\t}\n\n\t_getAriaHasPopup() {\n\t\tif (!this.interactive || this.ariaHaspopup === \"\") {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.ariaHaspop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,CAAC;yCACb;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yCACR;AAmBpB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;qCAClB;AA6B3B;IADC,IAAI,EAAE;qCACoB;AAxMtB,MAAM;IAhBX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,cAAc;QACxB,YAAY,EAAE,CAAC,IAAI,CAAC;KACpB,CAAC;IACF;;;;;;MAME;;IACD,KAAK,CAAC,OAAO,CAAC;GACT,MAAM,CAuVX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.js\";\nimport customElement from \"@ui5/webcomponents-base/dist/decorators/customElement.js\";\nimport property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport event from \"@ui5/webcomponents-base/dist/decorators/event.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { ITabbable } from \"@ui5/webcomponents-base/dist/delegate/ItemNavigation.js\";\n\nimport { isEnter, isSpace } from \"@ui5/webcomponents-base/dist/Keys.js\";\n// Template\nimport AvatarTemplate from \"./generated/templates/AvatarTemplate.lit.js\";\n\nimport { AVATAR_TOOLTIP } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport AvatarCss from \"./generated/themes/Avatar.css.js\";\n\nimport Icon from \"./Icon.js\";\nimport AvatarSize from \"./types/AvatarSize.js\";\nimport AvatarShape from \"./types/AvatarShape.js\";\nimport AvatarColorScheme from \"./types/AvatarColorScheme.js\";\n\n// Icon\nimport \"@ui5/webcomponents-icons/dist/employee.js\";\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * An image-like component that has different display options for representing images and icons\n * in different shapes and sizes, depending on the use case.\n *\n * The shape can be circular or square. There are several predefined sizes, as well as an option to\n * set a custom size.\n *\n * <br><br>\n * <h3>Keyboard Handling</h3>\n *\n * <ul>\n * <li>[SPACE, ENTER, RETURN] - Fires the <code>click</code> event if the <code>interactive</code> property is set to true.</li>\n * <li>[SHIFT] - If [SPACE] is pressed, pressing [SHIFT] releases the component without triggering the click event.</li>\n * </ul>\n * <br><br>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Avatar.js\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Avatar\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-avatar\n * @since 1.0.0-rc.6\n * @implements sap.ui.webc.main.IAvatar\n * @public\n */\n@customElement({\n\ttag: \"ui5-avatar\",\n\tlanguageAware: true,\n\trenderer: litRender,\n\tstyles: AvatarCss,\n\ttemplate: AvatarTemplate,\n\tdependencies: [Icon],\n})\n/**\n* Fired on mouseup, space and enter if avatar is interactive\n*\n* @event\n* @private\n* @since 1.0.0-rc.11\n*/\n@event(\"click\")\nclass Avatar extends UI5Element implements ITabbable {\n\t/**\n\t * Defines if the avatar is interactive (focusable and pressable).\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Avatar.prototype.interactive\n\t * @defaultValue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tinteractive!: boolean;\n\n\t/**\n\t * Indicates if the elements is on focus\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfocused!: boolean;\n\n\t/**\n\t * Defines the name of the UI5 Icon, that will be displayed.\n\t * <br>\n\t * <b>Note:</b> If <code>image</code> slot is provided, the property will be ignored.\n\t * <br>\n\t * <b>Note:</b> You should import the desired icon first, then use its name as \"icon\".\n\t * <br><br>\n\t * import \"@ui5/webcomponents-icons/dist/{icon_name}.js\"\n\t * <br>\n\t * <pre>&lt;ui5-avatar icon=\"employee\"></pre>\n\t * <br>\n\t * <b>Note:</b> If no icon or an empty one is provided, by default the \"employee\" icon should be displayed.\n\t *\n\t * See all the available icons in the <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">Icon Explorer</ui5-link>.\n\t * @type {string}\n\t * @name sap.ui.webc.main.Avatar.prototype.icon\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\ticon!: string;\n\n\t/**\n\t * Defines the displayed initials.\n\t * <br>\n\t * Up to three Latin letters can be displayed as initials.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Avatar.prototype.initials\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\tinitials!: string;\n\n\t/**\n\t * Defines the shape of the component.\n\t * <br><br>\n\t * Available options are:\n\t * <ul>\n\t * <li><code>Circle</code></li>\n\t * <li><code>Square</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.AvatarShape}\n\t * @name sap.ui.webc.main.Avatar.prototype.shape\n\t * @defaultvalue \"Circle\"\n\t * @public\n\t */\n\t@property({ type: AvatarShape, defaultValue: AvatarShape.Circle })\n\tshape!: AvatarShape;\n\n\t/**\n\t * Defines predefined size of the component.\n\t * <br><br>\n\t * Available options are:\n\t * <ul>\n\t * <li><code>XS</code></li>\n\t * <li><code>S</code></li>\n\t * <li><code>M</code></li>\n\t * <li><code>L</code></li>\n\t * <li><code>XL</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.AvatarSize}\n\t * @name sap.ui.webc.main.Avatar.prototype.size\n\t * @defaultvalue \"S\"\n\t * @public\n\t */\n\t@property({ type: AvatarSize, defaultValue: AvatarSize.S })\n\tsize!: AvatarSize;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: AvatarSize, defaultValue: AvatarSize.S })\n\t_size!: AvatarSize;\n\n\t/**\n\t * Defines the background color of the desired image.\n\t * <br><br>\n\t * Available options are:\n\t * <ul>\n\t * <li><code>Accent1</code></li>\n\t * <li><code>Accent2</code></li>\n\t * <li><code>Accent3</code></li>\n\t * <li><code>Accent4</code></li>\n\t * <li><code>Accent5</code></li>\n\t * <li><code>Accent6</code></li>\n\t * <li><code>Accent7</code></li>\n\t * <li><code>Accent8</code></li>\n\t * <li><code>Accent9</code></li>\n\t * <li><code>Accent10</code></li>\n\t * <li><code>Placeholder</code></li>\n\t * </ul>\n\t * @type {sap.ui.webc.main.types.AvatarColorScheme}\n\t * @name sap.ui.webc.main.Avatar.prototype.colorScheme\n\t * @defaultvalue \"Accent6\"\n\t * @public\n\t */\n\t@property({ type: AvatarColorScheme, defaultValue: AvatarColorScheme.Accent6 })\n\tcolorScheme!: AvatarColorScheme;\n\n\t/**\n\t * @private\n\t */\n\t@property({ type: AvatarColorScheme, defaultValue: AvatarColorScheme.Accent6 })\n\t_colorScheme!: AvatarColorScheme;\n\n\t/**\n\t * Defines the text alternative of the component.\n\t * If not provided a default text alternative will be set, if present.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Avatar.prototype.accessibleName\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.0.0-rc.7\n\t */\n\t@property()\n\taccessibleName!: string;\n\n\t/**\n\t * Defines the aria-haspopup value of the component when <code>interactive</code> property is <code>true</code>.\n\t * <br><br>\n\t * @type String\n\t * @since 1.0.0-rc.15\n\t * @protected\n\t */\n\t@property()\n\tariaHaspopup!: string;\n\n\t@property({ noAttribute: true })\n\t_tabIndex!: string;\n\n\t@property({ type: Boolean })\n\t_hasImage!: boolean;\n\n\t/**\n\t * Receives the desired <code>&lt;img&gt;</code> tag\n\t *\n\t * <b>Note:</b> If you experience flickering of the provided image, you can hide the component until it is being defined with the following CSS:\n\t * <br /> <br />\n\t * <code>\n\t *\t\tui5-avatar:not(:defined) { <br />\n\t *\t\t\t&nbsp;visibility: hidden; <br />\n\t *\t\t} <br />\n\t * </code>\n\t * @type {HTMLElement}\n\t * @name sap.ui.webc.main.Avatar.prototype.default\n\t * @slot image\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@slot({ type: HTMLElement, \"default\": true })\n\timage!: Array<HTMLElement>;\n\n\t/**\n\t * Defines the optional badge that will be used for visual affordance.\n\t * <b>Note:</b> While the slot allows for custom badges, to achieve\n\t * the Fiori design, please use <code>ui5-badge</code> with <code>ui5-icon</code>\n\t * in the corresponding <code>icon</code> slot, without text nodes.\n\t * <br><br>\n\t * Example:\n\t * <br><br>\n\t * &lt;ui5-avatar><br>\n\t * &nbsp;&nbsp;&nbsp;&nbsp;&lt;ui5-badge slot=\"badge\"><br>\n\t * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ui5-icon slot=\"icon\" name=\"employee\">&lt;/ui5-icon><br>\n\t * &nbsp;&nbsp;&nbsp;&nbsp;&lt;/ui5-badge><br>\n\t * &lt;/ui5-avatar>\n\t * <br><br>\n\t * <ui5-avatar initials=\"AB\" color-scheme=\"Accent1\">\n\t * <ui5-badge slot=\"badge\">\n\t * <ui5-icon slot=\"icon\" name=\"accelerated\"></ui5-icon>\n\t * </ui5-badge>\n\t * </ui5-avatar>\n\t *\n\t * @type {HTMLElement}\n\t * @name sap.ui.webc.main.Avatar.prototype.badge\n\t * @slot badge\n\t * @public\n\t * @since 1.7.0\n\t */\n\t@slot()\n\tbadge!: Array<HTMLElement>;\n\n\t_onclick?: (e: MouseEvent) => void;\n\tstatic i18nBundle: I18nBundle;\n\n\tstatic async onDefine() {\n\t\tAvatar.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n\n\tget tabindex() {\n\t\treturn this._tabIndex || (this.interactive ? \"0\" : \"-1\");\n\t}\n\n\t/**\n\t * Returns the effective avatar size.\n\t * @readonly\n\t * @type {string}\n\t * @defaultValue \"S\"\n\t * @private\n\t */\n\tget _effectiveSize(): AvatarSize {\n\t\t// we read the attribute, because the \"size\" property will always have a default value\n\t\treturn this.getAttribute(\"size\") as AvatarSize || this._size;\n\t}\n\n\t/**\n\t * Returns the effective background color.\n\t * @readonly\n\t * @type {string}\n\t * @defaultValue \"Accent6\"\n\t * @private\n\t */\n\tget _effectiveBackgroundColor() {\n\t\t// we read the attribute, because the \"background-color\" property will always have a default value\n\t\treturn this.getAttribute(\"color-scheme\") || this._colorScheme;\n\t}\n\n\tget _role() {\n\t\treturn this.interactive ? \"button\" : undefined;\n\t}\n\n\tget _ariaHasPopup() {\n\t\treturn this._getAriaHasPopup();\n\t}\n\n\tget validInitials() {\n\t\t// initials should consist of only 1,2 or 3 latin letters\n\t\tconst validInitials = /^[a-zA-Zà-üÀ-Ü]{1,3}$/,\n\t\t\tareInitialsValid = this.initials && validInitials.test(this.initials);\n\n\t\tif (areInitialsValid) {\n\t\t\treturn this.initials;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget accessibleNameText() {\n\t\tif (this.accessibleName) {\n\t\t\treturn this.accessibleName;\n\t\t}\n\n\t\treturn Avatar.i18nBundle.getText(AVATAR_TOOLTIP) || undefined;\n\t}\n\n\tget hasImage() {\n\t\tthis._hasImage = !!this.image.length;\n\t\treturn this._hasImage;\n\t}\n\n\tonBeforeRendering() {\n\t\tthis._onclick = this.interactive ? this._onClickHandler.bind(this) : undefined;\n\t}\n\n\tonAfterRendering() {\n\t\tthis._checkInitials();\n\t}\n\n\t_setFallbackIcon() {\n\t\t// if there isn`t icon set in the avatar the default one is shown, when the initials are not valid or are missing\n\t\tthis.icon = this.icon || \"employee\";\n\t\treturn this.icon;\n\t}\n\n\t_checkInitials() {\n\t\tconst avatar = this.getDomRef()!,\n\t\t\tavatarInitials = avatar.querySelector(\".ui5-avatar-initials\");\n\t\t// if there aren`t initalts set - the fallBack icon should be shown\n\t\tif (!this.validInitials) {\n\t\t\tthis._setFallbackIcon();\n\t\t}\n\t\t// if initials` width is bigger than the avatar, an icon should be shown inside the avatar\n\t\tif (this.initials && this.initials.length === 3) {\n\t\t\tif (avatarInitials && avatarInitials.scrollWidth >= avatar.scrollWidth) {\n\t\t\t\tthis._setFallbackIcon();\n\t\t\t}\n\t\t}\n\t\treturn this.icon;\n\t}\n\n\t_onClickHandler(e: MouseEvent) {\n\t\t// prevent the native event and fire custom event to ensure the noConfict \"ui5-click\" is fired\n\t\te.stopPropagation();\n\t\tthis.fireEvent(\"click\");\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tif (!this.interactive) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault(); // prevent scrolling\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (this.interactive && !e.shiftKey && isSpace(e)) {\n\t\t\tthis.fireEvent(\"click\");\n\t\t}\n\t}\n\n\t_onfocusout() {\n\t\tthis.focused = false;\n\t}\n\n\t_onfocusin() {\n\t\tif (this.interactive) {\n\t\t\tthis.focused = true;\n\t\t}\n\t}\n\n\t_getAriaHasPopup() {\n\t\tif (!this.interactive || this.ariaHaspopup === \"\") {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.ariaHaspopup;\n\t}\n}\n\nAvatar.define();\n\nexport default Avatar;\n"]}
package/dist/Button.d.ts CHANGED
@@ -203,6 +203,11 @@ declare class Button extends UI5Element implements IFormElement {
203
203
  * @private
204
204
  */
205
205
  nonInteractive: boolean;
206
+ /**
207
+ * The current title of the button, either the tooltip property or the icons tooltip. The tooltip property with higher prio.
208
+ * @private
209
+ */
210
+ buttonTitle?: string;
206
211
  _iconSettings: object;
207
212
  /**
208
213
  * Defines the tabIndex of the component.
@@ -230,7 +235,7 @@ declare class Button extends UI5Element implements IFormElement {
230
235
  static i18nBundle: I18nBundle;
231
236
  constructor();
232
237
  onEnterDOM(): void;
233
- onBeforeRendering(): void;
238
+ onBeforeRendering(): Promise<void>;
234
239
  _onclick(e: MouseEvent): void;
235
240
  _onmousedown(e: MouseEvent): void;
236
241
  _ontouchend(): void;
@@ -240,7 +245,7 @@ declare class Button extends UI5Element implements IFormElement {
240
245
  _onfocusout(): void;
241
246
  _onfocusin(e: FocusEvent): void;
242
247
  get hasButtonType(): boolean;
243
- get iconRole(): "presentation" | "" | "img";
248
+ get iconRole(): "presentation" | "";
244
249
  get isIconOnly(): boolean;
245
250
  static typeTextMappings(): Record<string, I18nText>;
246
251
  get buttonTypeText(): string;
package/dist/Button.js CHANGED
@@ -16,6 +16,7 @@ import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/Ari
16
16
  import { getFeature } from "@ui5/webcomponents-base/dist/FeaturesRegistry.js";
17
17
  import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
18
18
  import { markEvent } from "@ui5/webcomponents-base/dist/MarkedEvents.js";
19
+ import { getIconAccessibleName } from "@ui5/webcomponents-base/dist/asset-registries/Icons.js";
19
20
  import { isPhone, isTablet, isCombi, isDesktop, isSafari, } from "@ui5/webcomponents-base/dist/Device.js";
20
21
  import willShowContent from "@ui5/webcomponents-base/dist/util/willShowContent.js";
21
22
  import ButtonDesign from "./types/ButtonDesign.js";
@@ -97,13 +98,14 @@ let Button = Button_1 = class Button extends UI5Element {
97
98
  onEnterDOM() {
98
99
  this._isTouch = (isPhone() || isTablet()) && !isCombi();
99
100
  }
100
- onBeforeRendering() {
101
+ async onBeforeRendering() {
101
102
  const formSupport = getFeature("FormSupport");
102
103
  if (this.submits && !formSupport) {
103
104
  console.warn(`In order for the "submits" property to have effect, you should also: import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";`); // eslint-disable-line
104
105
  }
105
106
  this.iconOnly = this.isIconOnly;
106
107
  this.hasIcon = !!this.icon;
108
+ this.buttonTitle = this.tooltip || await getIconAccessibleName(this.icon);
107
109
  }
108
110
  _onclick(e) {
109
111
  if (this.nonInteractive) {
@@ -171,7 +173,7 @@ let Button = Button_1 = class Button extends UI5Element {
171
173
  if (!this.icon) {
172
174
  return "";
173
175
  }
174
- return this.showIconTooltip ? "img" : "presentation";
176
+ return "presentation";
175
177
  }
176
178
  get isIconOnly() {
177
179
  return !willShowContent(this.text);
@@ -245,6 +247,9 @@ __decorate([
245
247
  __decorate([
246
248
  property({ type: Boolean })
247
249
  ], Button.prototype, "nonInteractive", void 0);
250
+ __decorate([
251
+ property({ noAttribute: true })
252
+ ], Button.prototype, "buttonTitle", void 0);
248
253
  __decorate([
249
254
  property({ type: Object })
250
255
  ], Button.prototype, "_iconSettings", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,IAAI,MAAM,iDAAiD,CAAC;AACnE,OAAO,SAAS,MAAM,sDAAsD,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAG3E,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,OAAO,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,GACR,MAAM,wCAAwC,CAAC;AAChD,OAAO,eAAe,MAAM,sDAAsD,CAAC;AAEnF,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,cAAc,MAAM,6CAA6C,CAAC;AACzE,OAAO,IAAI,MAAM,WA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jB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACT;AAOnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCACV;AAOlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uCACV;AAOlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;8CACH;AAGzB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CACJ;AAOvB;IADC,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;yCAChC;AAOnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;wCACT;AAanB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;oCACnB;AAnNd,MAAM;IApBX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,CAAC,IAAI,CAAC;KACpB,CAAC;IACF;;;;;;;;;;OAUG;;IACF,KAAK,CAAC,OAAO,CAAC;GACT,MAAM,CAiYX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.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.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport { isSpace, isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AriaLabelHelper.js\";\nimport { getFeature } from \"@ui5/webcomponents-base/dist/FeaturesRegistry.js\";\nimport type { PassiveEventListenerObject } from \"@ui5/webcomponents-base/dist/types.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { markEvent } from \"@ui5/webcomponents-base/dist/MarkedEvents.js\";\n\nimport {\n\tisPhone,\n\tisTablet,\n\tisCombi,\n\tisDesktop,\n\tisSafari,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport willShowContent from \"@ui5/webcomponents-base/dist/util/willShowContent.js\";\nimport type { IFormElement } from \"./features/InputElementsFormSupport.js\";\nimport ButtonDesign from \"./types/ButtonDesign.js\";\nimport ButtonTemplate from \"./generated/templates/ButtonTemplate.lit.js\";\nimport Icon from \"./Icon.js\";\n\nimport { BUTTON_ARIA_TYPE_ACCEPT, BUTTON_ARIA_TYPE_REJECT, BUTTON_ARIA_TYPE_EMPHASIZED } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport buttonCss from \"./generated/themes/Button.css.js\";\nimport type FormSupport from \"./features/InputElementsFormSupport.js\";\n\nlet isGlobalHandlerAttached = false;\nlet activeButton: Button | null = null;\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * The <code>ui5-button</code> component represents a simple push button.\n * It enables users to trigger actions by clicking or tapping the <code>ui5-button</code>, or by pressing\n * certain keyboard keys, such as Enter.\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>ui5-button</code> UI, you can define text, icon, or both. You can also specify\n * whether the text or the icon is displayed first.\n * <br><br>\n * You can choose from a set of predefined types that offer different\n * styling to correspond to the triggered action.\n * <br><br>\n * You can set the <code>ui5-button</code> as enabled or disabled. An enabled\n * <code>ui5-button</code> can be pressed by clicking or tapping it. The button changes\n * its style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled <code>ui5-button</code> appears inactive and cannot be pressed.\n *\n * <h3>CSS Shadow Parts</h3>\n *\n * <ui5-link target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/::part\">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.\n * <br>\n * The <code>ui5-button</code> exposes the following CSS Shadow Parts:\n * <ul>\n * <li>button - Used to style the native button element</li>\n * </ul>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Button\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Button\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-button\n * @implements sap.ui.webc.main.IButton\n * @public\n */\n@customElement({\n\ttag: \"ui5-button\",\n\tlanguageAware: true,\n\trenderer: litRender,\n\ttemplate: ButtonTemplate,\n\tstyles: buttonCss,\n\tdependencies: [Icon],\n})\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * <br><br>\n * <b>Note:</b> The event will not be fired if the <code>disabled</code>\n * property is set to <code>true</code>.\n *\n * @event sap.ui.webc.main.Button#click\n * @public\n * @native\n */\n@event(\"click\")\nclass Button extends UI5Element implements IFormElement {\n\t/**\n\t * Defines the component design.\n\t *\n\t * <br><br>\n\t * <b>The available values are:</b>\n\t *\n\t * <ul>\n\t * <li><code>Default</code></li>\n\t * <li><code>Emphasized</code></li>\n\t * <li><code>Positive</code></li>\n\t * <li><code>Negative</code></li>\n\t * <li><code>Transparent</code></li>\n\t * <li><code>Attention</code></li>\n\t * </ul>\n\t *\n\t * @type {sap.ui.webc.main.types.ButtonDesign}\n\t * @name sap.ui.webc.main.Button.prototype.design\n\t * @defaultvalue \"Default\"\n\t * @public\n\t */\n\t@property({ type: ButtonDesign, defaultValue: ButtonDesign.Default })\n\tdesign!: ButtonDesign;\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t *\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Button.prototype.disabled\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled!: boolean;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t * <br><br>\n\t * Example:\n\t *\n\t * See all the available icons within the <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">Icon Explorer</ui5-link>.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.icon\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\ticon!: string;\n\n\t/**\n\t * Defines whether the icon should be displayed after the component text.\n\t *\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Button.prototype.iconEnd\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\ticonEnd!: boolean;\n\n\t/**\n\t * When set to <code>true</code>, the component will\n\t * automatically submit the nearest HTML form element on <code>press</code>.\n\t * <br><br>\n\t * <b>Note:</b> For the <code>submits</code> property to have effect, you must add the following import to your project:\n\t * <code>import \"@ui5/webcomponents/dist/features/InputElementsFormSupport.js\";</code>\n\t *\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Button.prototype.submits\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tsubmits!: boolean;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t * <br>\n\t * <b>Note:</b> A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.tooltip\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property()\n\ttooltip!: string;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.accessibleName\n\t * @defaultvalue undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ defaultValue: undefined })\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.accessibleNameRef\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property({ defaultValue: \"\" })\n\taccessibleNameRef!: string;\n\n\t/**\n\t * An object of strings that defines several additional accessibility attribute values\n\t * for customization depending on the use case.\n\t *\n\t * It supports the following fields:\n\t *\n\t * <ul>\n\t * \t\t<li><code>expanded</code>: Indicates whether the button, or another grouping element it controls, is currently expanded or collapsed. Accepts the following string values:\n\t *\t\t\t<ul>\n\t *\t\t\t\t<li><code>true</code></li>\n\t *\t\t\t\t<li><code>false</code></li>\n\t *\t\t\t</ul>\n\t * \t\t</li>\n\t * \t\t<li><code>hasPopup</code>: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button. Accepts the following string values:\n\t * \t\t\t<ul>\n\t *\t\t\t\t<li><code>Dialog</code></li>\n\t *\t\t\t\t<li><code>Grid</code></li>\n\t *\t\t\t\t<li><code>ListBox</code></li>\n\t *\t\t\t\t<li><code>Menu</code></li>\n\t *\t\t\t\t<li><code>Tree</code></li>\n\t * \t\t\t</ul>\n\t * \t\t</li>\n\t * \t\t<li><code>controls</code>: Identifies the element (or elements) whose contents or presence are controlled by the button element. Accepts a string value.</li>\n\t * </ul>\n\t * @type {object}\n\t * @name sap.ui.webc.main.Button.prototype.accessibilityAttributes\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes!: object;\n\n\t/**\n\t * Used to switch the active state (pressed or not) of the component.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tactive!: boolean;\n\n\t/**\n\t * Defines if a content has been added to the default slot\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly!: boolean;\n\n\t/**\n\t * Indicates if the elements is on focus\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfocused!: boolean;\n\n\t/**\n\t * Indicates if the elements has a slotted icon\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thasIcon!: boolean;\n\n\t/**\n\t * Indicates if the element if focusable\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tnonInteractive!: boolean;\n\n\t@property({ type: Object })\n\t_iconSettings!: object;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @private\n\t */\n\t@property({ defaultValue: \"0\", noAttribute: true })\n\t_tabIndex!: string;\n\n\t/**\n\t * @since 1.0.0-rc.13\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isTouch!: boolean;\n\n\t/**\n\t * Defines the text of the component.\n\t * <br><br>\n\t * <b>Note:</b> Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t *\n\t * @type {Node[]}\n\t * @name sap.ui.webc.main.Button.prototype.default\n\t * @slot\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: Array<Node>;\n\n\t_deactivate: () => void;\n\n\t_ontouchstart: PassiveEventListenerObject;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._deactivate = () => {\n\t\t\tif (activeButton) {\n\t\t\t\tactiveButton.active = false;\n\t\t\t}\n\t\t};\n\n\t\tif (!isGlobalHandlerAttached) {\n\t\t\tdocument.addEventListener(\"mouseup\", this._deactivate);\n\n\t\t\tisGlobalHandlerAttached = true;\n\t\t}\n\n\t\tconst handleTouchStartEvent = (e: TouchEvent) => {\n\t\t\tmarkEvent(e, \"button\");\n\n\t\t\tif (this.nonInteractive) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.active = true;\n\t\t};\n\n\t\tthis._ontouchstart = {\n\t\t\thandleEvent: handleTouchStartEvent,\n\t\t\tpassive: true,\n\t\t};\n\t}\n\n\tonEnterDOM() {\n\t\tthis._isTouch = (isPhone() || isTablet()) && !isCombi();\n\t}\n\n\tonBeforeRendering() {\n\t\tconst formSupport = getFeature<typeof FormSupport>(\"FormSupport\");\n\t\tif (this.submits && !formSupport) {\n\t\t\tconsole.warn(`In order for the \"submits\" property to have effect, you should also: import \"@ui5/webcomponents/dist/features/InputElementsFormSupport.js\";`); // eslint-disable-line\n\t\t}\n\n\t\tthis.iconOnly = this.isIconOnly;\n\t\tthis.hasIcon = !!this.icon;\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\t\tmarkEvent(e, \"button\");\n\t\tconst formSupport = getFeature<typeof FormSupport>(\"FormSupport\");\n\t\tif (formSupport && this.submits) {\n\t\t\tformSupport.triggerFormSubmit(this);\n\t\t}\n\n\t\tif (isSafari()) {\n\t\t\tthis.getDomRef()?.focus();\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tif (this.nonInteractive || this._isTouch) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkEvent(e, \"button\");\n\t\tthis.active = true;\n\t\tactiveButton = this; // eslint-disable-line\n\t}\n\n\t_ontouchend() {\n\t\tthis.active = false;\n\n\t\tif (activeButton) {\n\t\t\tactiveButton.active = false;\n\t\t}\n\t}\n\n\t_onmouseup(e: MouseEvent) {\n\t\tmarkEvent(e, \"button\");\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tmarkEvent(e, \"button\");\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis.active = true;\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis.active = false;\n\t\t}\n\t}\n\n\t_onfocusout() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\t\tthis.active = false;\n\t\tif (isDesktop()) {\n\t\t\tthis.focused = false;\n\t\t}\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkEvent(e, \"button\");\n\t\tif (isDesktop()) {\n\t\t\tthis.focused = true;\n\t\t}\n\t}\n\n\tget hasButtonType() {\n\t\treturn this.design !== ButtonDesign.Default && this.design !== ButtonDesign.Transparent;\n\t}\n\n\tget iconRole() {\n\t\tif (!this.icon) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn this.showIconTooltip ? \"img\" : \"presentation\";\n\t}\n\n\tget isIconOnly() {\n\t\treturn !willShowContent(this.text);\n\t}\n\n\tstatic typeTextMappings(): Record<string, I18nText> {\n\t\treturn {\n\t\t\t\"Positive\": BUTTON_ARIA_TYPE_ACCEPT,\n\t\t\t\"Negative\": BUTTON_ARIA_TYPE_REJECT,\n\t\t\t\"Emphasized\": BUTTON_ARIA_TYPE_EMPHASIZED,\n\t\t};\n\t}\n\n\tget buttonTypeText() {\n\t\treturn Button.i18nBundle.getText(Button.typeTextMappings()[this.design]);\n\t}\n\n\tget tabIndexValue() {\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (tabindex) {\n\t\t\treturn tabindex;\n\t\t}\n\n\t\treturn this.nonInteractive ? \"-1\" : this._tabIndex;\n\t}\n\n\tget showIconTooltip() {\n\t\treturn this.iconOnly && !this.tooltip;\n\t}\n\n\tget ariaLabelText() {\n\t\treturn getEffectiveAriaLabelText(this);\n\t}\n\n\tstatic async onDefine() {\n\t\tButton.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n}\n\nButton.define();\n\nexport default Button;\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,UAAU,MAAM,4CAA4C,CAAC;AACpE,OAAO,aAAa,MAAM,0DAA0D,CAAC;AACrF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,KAAK,MAAM,kDAAkD,CAAC;AACrE,OAAO,IAAI,MAAM,iDAAiD,C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C,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;oCACnB;AA1Nd,MAAM;IApBX,aAAa,CAAC;QACd,GAAG,EAAE,YAAY;QACjB,aAAa,EAAE,IAAI;QACnB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,cAAc;QACxB,MAAM,EAAE,SAAS;QACjB,YAAY,EAAE,CAAC,IAAI,CAAC;KACpB,CAAC;IACF;;;;;;;;;;OAUG;;IACF,KAAK,CAAC,OAAO,CAAC;GACT,MAAM,CA0YX;AAED,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,eAAe,MAAM,CAAC","sourcesContent":["import UI5Element from \"@ui5/webcomponents-base/dist/UI5Element.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.js\";\nimport slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\nimport litRender from \"@ui5/webcomponents-base/dist/renderer/LitRenderer.js\";\nimport { isSpace, isEnter } from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getEffectiveAriaLabelText } from \"@ui5/webcomponents-base/dist/util/AriaLabelHelper.js\";\nimport { getFeature } from \"@ui5/webcomponents-base/dist/FeaturesRegistry.js\";\nimport type { PassiveEventListenerObject } from \"@ui5/webcomponents-base/dist/types.js\";\nimport { getI18nBundle } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type I18nBundle from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport type { I18nText } from \"@ui5/webcomponents-base/dist/i18nBundle.js\";\nimport { markEvent } from \"@ui5/webcomponents-base/dist/MarkedEvents.js\";\nimport { getIconAccessibleName } from \"@ui5/webcomponents-base/dist/asset-registries/Icons.js\";\n\nimport {\n\tisPhone,\n\tisTablet,\n\tisCombi,\n\tisDesktop,\n\tisSafari,\n} from \"@ui5/webcomponents-base/dist/Device.js\";\nimport willShowContent from \"@ui5/webcomponents-base/dist/util/willShowContent.js\";\nimport type { IFormElement } from \"./features/InputElementsFormSupport.js\";\nimport ButtonDesign from \"./types/ButtonDesign.js\";\nimport ButtonTemplate from \"./generated/templates/ButtonTemplate.lit.js\";\nimport Icon from \"./Icon.js\";\n\nimport { BUTTON_ARIA_TYPE_ACCEPT, BUTTON_ARIA_TYPE_REJECT, BUTTON_ARIA_TYPE_EMPHASIZED } from \"./generated/i18n/i18n-defaults.js\";\n\n// Styles\nimport buttonCss from \"./generated/themes/Button.css.js\";\nimport type FormSupport from \"./features/InputElementsFormSupport.js\";\n\nlet isGlobalHandlerAttached = false;\nlet activeButton: Button | null = null;\n\n/**\n * @class\n *\n * <h3 class=\"comment-api-title\">Overview</h3>\n *\n * The <code>ui5-button</code> component represents a simple push button.\n * It enables users to trigger actions by clicking or tapping the <code>ui5-button</code>, or by pressing\n * certain keyboard keys, such as Enter.\n *\n *\n * <h3>Usage</h3>\n *\n * For the <code>ui5-button</code> UI, you can define text, icon, or both. You can also specify\n * whether the text or the icon is displayed first.\n * <br><br>\n * You can choose from a set of predefined types that offer different\n * styling to correspond to the triggered action.\n * <br><br>\n * You can set the <code>ui5-button</code> as enabled or disabled. An enabled\n * <code>ui5-button</code> can be pressed by clicking or tapping it. The button changes\n * its style to provide visual feedback to the user that it is pressed or hovered over with\n * the mouse cursor. A disabled <code>ui5-button</code> appears inactive and cannot be pressed.\n *\n * <h3>CSS Shadow Parts</h3>\n *\n * <ui5-link target=\"_blank\" href=\"https://developer.mozilla.org/en-US/docs/Web/CSS/::part\">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.\n * <br>\n * The <code>ui5-button</code> exposes the following CSS Shadow Parts:\n * <ul>\n * <li>button - Used to style the native button element</li>\n * </ul>\n *\n * <h3>ES6 Module Import</h3>\n *\n * <code>import \"@ui5/webcomponents/dist/Button\";</code>\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.Button\n * @extends sap.ui.webc.base.UI5Element\n * @tagname ui5-button\n * @implements sap.ui.webc.main.IButton\n * @public\n */\n@customElement({\n\ttag: \"ui5-button\",\n\tlanguageAware: true,\n\trenderer: litRender,\n\ttemplate: ButtonTemplate,\n\tstyles: buttonCss,\n\tdependencies: [Icon],\n})\n/**\n * Fired when the component is activated either with a\n * mouse/tap or by using the Enter or Space key.\n * <br><br>\n * <b>Note:</b> The event will not be fired if the <code>disabled</code>\n * property is set to <code>true</code>.\n *\n * @event sap.ui.webc.main.Button#click\n * @public\n * @native\n */\n@event(\"click\")\nclass Button extends UI5Element implements IFormElement {\n\t/**\n\t * Defines the component design.\n\t *\n\t * <br><br>\n\t * <b>The available values are:</b>\n\t *\n\t * <ul>\n\t * <li><code>Default</code></li>\n\t * <li><code>Emphasized</code></li>\n\t * <li><code>Positive</code></li>\n\t * <li><code>Negative</code></li>\n\t * <li><code>Transparent</code></li>\n\t * <li><code>Attention</code></li>\n\t * </ul>\n\t *\n\t * @type {sap.ui.webc.main.types.ButtonDesign}\n\t * @name sap.ui.webc.main.Button.prototype.design\n\t * @defaultvalue \"Default\"\n\t * @public\n\t */\n\t@property({ type: ButtonDesign, defaultValue: ButtonDesign.Default })\n\tdesign!: ButtonDesign;\n\n\t/**\n\t * Defines whether the component is disabled.\n\t * A disabled component can't be pressed or\n\t * focused, and it is not in the tab chain.\n\t *\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Button.prototype.disabled\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tdisabled!: boolean;\n\n\t/**\n\t * Defines the icon, displayed as graphical element within the component.\n\t * The SAP-icons font provides numerous options.\n\t * <br><br>\n\t * Example:\n\t *\n\t * See all the available icons within the <ui5-link target=\"_blank\" href=\"https://sdk.openui5.org/test-resources/sap/m/demokit/iconExplorer/webapp/index.html\">Icon Explorer</ui5-link>.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.icon\n\t * @defaultvalue \"\"\n\t * @public\n\t */\n\t@property()\n\ticon!: string;\n\n\t/**\n\t * Defines whether the icon should be displayed after the component text.\n\t *\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Button.prototype.iconEnd\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\ticonEnd!: boolean;\n\n\t/**\n\t * When set to <code>true</code>, the component will\n\t * automatically submit the nearest HTML form element on <code>press</code>.\n\t * <br><br>\n\t * <b>Note:</b> For the <code>submits</code> property to have effect, you must add the following import to your project:\n\t * <code>import \"@ui5/webcomponents/dist/features/InputElementsFormSupport.js\";</code>\n\t *\n\t * @type {boolean}\n\t * @name sap.ui.webc.main.Button.prototype.submits\n\t * @defaultvalue false\n\t * @public\n\t */\n\t@property({ type: Boolean })\n\tsubmits!: boolean;\n\n\t/**\n\t * Defines the tooltip of the component.\n\t * <br>\n\t * <b>Note:</b> A tooltip attribute should be provided for icon-only buttons, in order to represent their exact meaning/function.\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.tooltip\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property()\n\ttooltip!: string;\n\n\t/**\n\t * Defines the accessible ARIA name of the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.accessibleName\n\t * @defaultvalue undefined\n\t * @public\n\t * @since 1.0.0-rc.15\n\t */\n\t@property({ defaultValue: undefined })\n\taccessibleName?: string;\n\n\t/**\n\t * Receives id(or many ids) of the elements that label the component.\n\t *\n\t * @type {string}\n\t * @name sap.ui.webc.main.Button.prototype.accessibleNameRef\n\t * @defaultvalue \"\"\n\t * @public\n\t * @since 1.1.0\n\t */\n\t@property({ defaultValue: \"\" })\n\taccessibleNameRef!: string;\n\n\t/**\n\t * An object of strings that defines several additional accessibility attribute values\n\t * for customization depending on the use case.\n\t *\n\t * It supports the following fields:\n\t *\n\t * <ul>\n\t * \t\t<li><code>expanded</code>: Indicates whether the button, or another grouping element it controls, is currently expanded or collapsed. Accepts the following string values:\n\t *\t\t\t<ul>\n\t *\t\t\t\t<li><code>true</code></li>\n\t *\t\t\t\t<li><code>false</code></li>\n\t *\t\t\t</ul>\n\t * \t\t</li>\n\t * \t\t<li><code>hasPopup</code>: Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by the button. Accepts the following string values:\n\t * \t\t\t<ul>\n\t *\t\t\t\t<li><code>Dialog</code></li>\n\t *\t\t\t\t<li><code>Grid</code></li>\n\t *\t\t\t\t<li><code>ListBox</code></li>\n\t *\t\t\t\t<li><code>Menu</code></li>\n\t *\t\t\t\t<li><code>Tree</code></li>\n\t * \t\t\t</ul>\n\t * \t\t</li>\n\t * \t\t<li><code>controls</code>: Identifies the element (or elements) whose contents or presence are controlled by the button element. Accepts a string value.</li>\n\t * </ul>\n\t * @type {object}\n\t * @name sap.ui.webc.main.Button.prototype.accessibilityAttributes\n\t * @public\n\t * @since 1.2.0\n\t */\n\t@property({ type: Object })\n\taccessibilityAttributes!: object;\n\n\t/**\n\t * Used to switch the active state (pressed or not) of the component.\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tactive!: boolean;\n\n\t/**\n\t * Defines if a content has been added to the default slot\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\ticonOnly!: boolean;\n\n\t/**\n\t * Indicates if the elements is on focus\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tfocused!: boolean;\n\n\t/**\n\t * Indicates if the elements has a slotted icon\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\thasIcon!: boolean;\n\n\t/**\n\t * Indicates if the element if focusable\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\tnonInteractive!: boolean;\n\n\t/**\n\t * The current title of the button, either the tooltip property or the icons tooltip. The tooltip property with higher prio.\n\t * @private\n\t */\n\t@property({ noAttribute: true })\n\tbuttonTitle?: string;\n\n\t@property({ type: Object })\n\t_iconSettings!: object;\n\n\t/**\n\t * Defines the tabIndex of the component.\n\t * @private\n\t */\n\t@property({ defaultValue: \"0\", noAttribute: true })\n\t_tabIndex!: string;\n\n\t/**\n\t * @since 1.0.0-rc.13\n\t * @private\n\t */\n\t@property({ type: Boolean })\n\t_isTouch!: boolean;\n\n\t/**\n\t * Defines the text of the component.\n\t * <br><br>\n\t * <b>Note:</b> Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.\n\t *\n\t * @type {Node[]}\n\t * @name sap.ui.webc.main.Button.prototype.default\n\t * @slot\n\t * @public\n\t */\n\t@slot({ type: Node, \"default\": true })\n\ttext!: Array<Node>;\n\n\t_deactivate: () => void;\n\n\t_ontouchstart: PassiveEventListenerObject;\n\n\tstatic i18nBundle: I18nBundle;\n\n\tconstructor() {\n\t\tsuper();\n\n\t\tthis._deactivate = () => {\n\t\t\tif (activeButton) {\n\t\t\t\tactiveButton.active = false;\n\t\t\t}\n\t\t};\n\n\t\tif (!isGlobalHandlerAttached) {\n\t\t\tdocument.addEventListener(\"mouseup\", this._deactivate);\n\n\t\t\tisGlobalHandlerAttached = true;\n\t\t}\n\n\t\tconst handleTouchStartEvent = (e: TouchEvent) => {\n\t\t\tmarkEvent(e, \"button\");\n\n\t\t\tif (this.nonInteractive) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.active = true;\n\t\t};\n\n\t\tthis._ontouchstart = {\n\t\t\thandleEvent: handleTouchStartEvent,\n\t\t\tpassive: true,\n\t\t};\n\t}\n\n\tonEnterDOM() {\n\t\tthis._isTouch = (isPhone() || isTablet()) && !isCombi();\n\t}\n\n\tasync onBeforeRendering() {\n\t\tconst formSupport = getFeature<typeof FormSupport>(\"FormSupport\");\n\t\tif (this.submits && !formSupport) {\n\t\t\tconsole.warn(`In order for the \"submits\" property to have effect, you should also: import \"@ui5/webcomponents/dist/features/InputElementsFormSupport.js\";`); // eslint-disable-line\n\t\t}\n\n\t\tthis.iconOnly = this.isIconOnly;\n\t\tthis.hasIcon = !!this.icon;\n\n\t\tthis.buttonTitle = this.tooltip || await getIconAccessibleName(this.icon);\n\t}\n\n\t_onclick(e: MouseEvent) {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\t\tmarkEvent(e, \"button\");\n\t\tconst formSupport = getFeature<typeof FormSupport>(\"FormSupport\");\n\t\tif (formSupport && this.submits) {\n\t\t\tformSupport.triggerFormSubmit(this);\n\t\t}\n\n\t\tif (isSafari()) {\n\t\t\tthis.getDomRef()?.focus();\n\t\t}\n\t}\n\n\t_onmousedown(e: MouseEvent) {\n\t\tif (this.nonInteractive || this._isTouch) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkEvent(e, \"button\");\n\t\tthis.active = true;\n\t\tactiveButton = this; // eslint-disable-line\n\t}\n\n\t_ontouchend() {\n\t\tthis.active = false;\n\n\t\tif (activeButton) {\n\t\t\tactiveButton.active = false;\n\t\t}\n\t}\n\n\t_onmouseup(e: MouseEvent) {\n\t\tmarkEvent(e, \"button\");\n\t}\n\n\t_onkeydown(e: KeyboardEvent) {\n\t\tmarkEvent(e, \"button\");\n\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis.active = true;\n\t\t}\n\t}\n\n\t_onkeyup(e: KeyboardEvent) {\n\t\tif (isSpace(e) || isEnter(e)) {\n\t\t\tthis.active = false;\n\t\t}\n\t}\n\n\t_onfocusout() {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\t\tthis.active = false;\n\t\tif (isDesktop()) {\n\t\t\tthis.focused = false;\n\t\t}\n\t}\n\n\t_onfocusin(e: FocusEvent) {\n\t\tif (this.nonInteractive) {\n\t\t\treturn;\n\t\t}\n\n\t\tmarkEvent(e, \"button\");\n\t\tif (isDesktop()) {\n\t\t\tthis.focused = true;\n\t\t}\n\t}\n\n\tget hasButtonType() {\n\t\treturn this.design !== ButtonDesign.Default && this.design !== ButtonDesign.Transparent;\n\t}\n\n\tget iconRole() {\n\t\tif (!this.icon) {\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn \"presentation\";\n\t}\n\n\tget isIconOnly() {\n\t\treturn !willShowContent(this.text);\n\t}\n\n\tstatic typeTextMappings(): Record<string, I18nText> {\n\t\treturn {\n\t\t\t\"Positive\": BUTTON_ARIA_TYPE_ACCEPT,\n\t\t\t\"Negative\": BUTTON_ARIA_TYPE_REJECT,\n\t\t\t\"Emphasized\": BUTTON_ARIA_TYPE_EMPHASIZED,\n\t\t};\n\t}\n\n\tget buttonTypeText() {\n\t\treturn Button.i18nBundle.getText(Button.typeTextMappings()[this.design]);\n\t}\n\n\tget tabIndexValue() {\n\t\tconst tabindex = this.getAttribute(\"tabindex\");\n\n\t\tif (tabindex) {\n\t\t\treturn tabindex;\n\t\t}\n\n\t\treturn this.nonInteractive ? \"-1\" : this._tabIndex;\n\t}\n\n\tget showIconTooltip() {\n\t\treturn this.iconOnly && !this.tooltip;\n\t}\n\n\tget ariaLabelText() {\n\t\treturn getEffectiveAriaLabelText(this);\n\t}\n\n\tstatic async onDefine() {\n\t\tButton.i18nBundle = await getI18nBundle(\"@ui5/webcomponents\");\n\t}\n}\n\nButton.define();\n\nexport default Button;\n"]}
@@ -36,7 +36,10 @@ class CalendarPart extends DateComponentBase {
36
36
  */
37
37
  get _timestamp() {
38
38
  let timestamp = this.timestamp !== undefined ? this.timestamp : getTodayUTCTimestamp(this._primaryCalendarType);
39
- if (timestamp < this._minTimestamp || timestamp > this._maxTimestamp) {
39
+ if (this._maxTimestamp && this._maxTimestamp < timestamp) {
40
+ timestamp = this._maxTimestamp;
41
+ }
42
+ else if (this._minTimestamp && this._minTimestamp > timestamp) {
40
43
  timestamp = this._minTimestamp;
41
44
  }
42
45
  return timestamp;
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarPart.js","sourceRoot":"","sources":["../src/CalendarPart.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,OAAO,MAAM,+CAA+C,CAAC;AACpE,OAAO,YAAY,MAAM,4DAA4D,CAAC;AACtF,OAAO,YAAY,MAA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;QACD,IAAI,SAAS,GAAG,GAAG,EAAE;YACpB,SAAS,GAAG,GAAG,CAAC;SAChB;QAED,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CAAC,MAAc,EAAE,IAAY;QACpD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,oBAAoB,CAAC,OAAoB;QACxC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAE,CAAC;QACjE,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;CACD;AArEA;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;+CACd;AAuEpB,eAAe,YAAY,CAAC","sourcesContent":["import property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport Integer from \"@ui5/webcomponents-base/dist/types/Integer.js\";\nimport CalendarDate from \"@ui5/webcomponents-localization/dist/dates/CalendarDate.js\";\nimport modifyDateBy from \"@ui5/webcomponents-localization/dist/dates/modifyDateBy.js\";\nimport getTodayUTCTimestamp from \"@ui5/webcomponents-localization/dist/dates/getTodayUTCTimestamp.js\";\nimport DateComponentBase from \"./DateComponentBase.js\";\n\n/**\n * @class\n *\n * Abstract base class for Calendar, DayPicker, MonthPicker and YearPicker that adds support for:\n * - common properties (timestamp, selectedDates): declarations and methods that operate on them\n * - other common code\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.CalendarPart\n * @extends sap.ui.webc.main.DateComponentBase\n * @public\n */\nclass CalendarPart extends DateComponentBase {\n\t/**\n\t * The timestamp of the currently focused date. Set this property to move the component's focus to a certain date.\n\t * <b>Node:</b> Timestamp is 10-digit Integer representing the seconds (not milliseconds) since the Unix Epoch.\n\t * @type {sap.ui.webc.base.types.Integer}\n\t * @protected\n\t */\n\t@property({ validator: Integer })\n\ttimestamp?: number;\n\n\tget _minTimestamp() {\n\t\treturn this._minDate.valueOf() / 1000;\n\t}\n\n\tget _maxTimestamp() {\n\t\treturn this._maxDate.valueOf() / 1000;\n\t}\n\n\t/**\n\t * Returns the effective timestamp to be used by the respective calendar part\n\t * @protected\n\t */\n\tget _timestamp() {\n\t\tlet timestamp = this.timestamp !== undefined ? this.timestamp : getTodayUTCTimestamp(this._primaryCalendarType);\n\t\tif (timestamp < this._minTimestamp || timestamp > this._maxTimestamp) {\n\t\t\ttimestamp = this._minTimestamp;\n\t\t}\n\t\treturn timestamp;\n\t}\n\n\tget _localDate() {\n\t\treturn new Date(this._timestamp * 1000);\n\t}\n\n\t/**\n\t * Returns a CalendarDate instance, representing the _timestamp getter - this date is central to all components' rendering logic\n\t * @protected\n\t */\n\tget _calendarDate() {\n\t\treturn CalendarDate.fromTimestamp(this._localDate.getTime(), this._primaryCalendarType);\n\t}\n\n\t/**\n\t * Change a timestamp and enforce limits\n\t *\n\t * @param timestamp\n\t * @protected\n\t */\n\t_safelySetTimestamp(timestamp: number) {\n\t\tconst min = this._minDate.valueOf() / 1000;\n\t\tconst max = this._maxDate.valueOf() / 1000;\n\n\t\tif (timestamp < min) {\n\t\t\ttimestamp = min;\n\t\t}\n\t\tif (timestamp > max) {\n\t\t\ttimestamp = max;\n\t\t}\n\n\t\tthis.timestamp = timestamp;\n\t}\n\n\t/**\n\t * Modify a timestamp by a certain amount of days/months/years and enforce limits\n\t * @param amount\n\t * @param unit\n\t * @protected\n\t */\n\t_safelyModifyTimestampBy(amount: number, unit: string) {\n\t\tconst newDate = modifyDateBy(this._calendarDate, amount, unit);\n\t\tthis._safelySetTimestamp(newDate.valueOf() / 1000);\n\t}\n\n\t_getTimestampFromDom(domNode: HTMLElement) {\n\t\tconst oMonthDomRef = domNode.getAttribute(\"data-sap-timestamp\")!;\n\t\treturn parseInt(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,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACzF,CAAC;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,SAAiB;QACpC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;QAC3C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;QAE3C,IAAI,SAAS,GAAG,GAAG,EAAE;YACpB,SAAS,GAAG,GAAG,CAAC;SAChB;QACD,IAAI,SAAS,GAAG,GAAG,EAAE;YACpB,SAAS,GAAG,GAAG,CAAC;SAChB;QAED,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED;;;;;OAKG;IACH,wBAAwB,CAAC,MAAc,EAAE,IAAY;QACpD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/D,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,oBAAoB,CAAC,OAAoB;QACxC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,oBAAoB,CAAE,CAAC;QACjE,OAAO,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;CACD;AAzEA;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;+CACd;AA2EpB,eAAe,YAAY,CAAC","sourcesContent":["import property from \"@ui5/webcomponents-base/dist/decorators/property.js\";\nimport Integer from \"@ui5/webcomponents-base/dist/types/Integer.js\";\nimport CalendarDate from \"@ui5/webcomponents-localization/dist/dates/CalendarDate.js\";\nimport modifyDateBy from \"@ui5/webcomponents-localization/dist/dates/modifyDateBy.js\";\nimport getTodayUTCTimestamp from \"@ui5/webcomponents-localization/dist/dates/getTodayUTCTimestamp.js\";\nimport DateComponentBase from \"./DateComponentBase.js\";\n\n/**\n * @class\n *\n * Abstract base class for Calendar, DayPicker, MonthPicker and YearPicker that adds support for:\n * - common properties (timestamp, selectedDates): declarations and methods that operate on them\n * - other common code\n *\n * @constructor\n * @author SAP SE\n * @alias sap.ui.webc.main.CalendarPart\n * @extends sap.ui.webc.main.DateComponentBase\n * @public\n */\nclass CalendarPart extends DateComponentBase {\n\t/**\n\t * The timestamp of the currently focused date. Set this property to move the component's focus to a certain date.\n\t * <b>Node:</b> Timestamp is 10-digit Integer representing the seconds (not milliseconds) since the Unix Epoch.\n\t * @type {sap.ui.webc.base.types.Integer}\n\t * @protected\n\t */\n\t@property({ validator: Integer })\n\ttimestamp?: number;\n\n\tget _minTimestamp() {\n\t\treturn this._minDate.valueOf() / 1000;\n\t}\n\n\tget _maxTimestamp() {\n\t\treturn this._maxDate.valueOf() / 1000;\n\t}\n\n\t/**\n\t * Returns the effective timestamp to be used by the respective calendar part\n\t * @protected\n\t */\n\tget _timestamp() {\n\t\tlet timestamp = this.timestamp !== undefined ? this.timestamp : getTodayUTCTimestamp(this._primaryCalendarType);\n\n\t\tif (this._maxTimestamp && this._maxTimestamp < timestamp) {\n\t\t\ttimestamp = this._maxTimestamp;\n\t\t} else if (this._minTimestamp && this._minTimestamp > timestamp) {\n\t\t\ttimestamp = this._minTimestamp;\n\t\t}\n\n\t\treturn timestamp;\n\t}\n\n\tget _localDate() {\n\t\treturn new Date(this._timestamp * 1000);\n\t}\n\n\t/**\n\t * Returns a CalendarDate instance, representing the _timestamp getter - this date is central to all components' rendering logic\n\t * @protected\n\t */\n\tget _calendarDate() {\n\t\treturn CalendarDate.fromTimestamp(this._localDate.getTime(), this._primaryCalendarType);\n\t}\n\n\t/**\n\t * Change a timestamp and enforce limits\n\t *\n\t * @param timestamp\n\t * @protected\n\t */\n\t_safelySetTimestamp(timestamp: number) {\n\t\tconst min = this._minDate.valueOf() / 1000;\n\t\tconst max = this._maxDate.valueOf() / 1000;\n\n\t\tif (timestamp < min) {\n\t\t\ttimestamp = min;\n\t\t}\n\t\tif (timestamp > max) {\n\t\t\ttimestamp = max;\n\t\t}\n\n\t\tthis.timestamp = timestamp;\n\t}\n\n\t/**\n\t * Modify a timestamp by a certain amount of days/months/years and enforce limits\n\t * @param amount\n\t * @param unit\n\t * @protected\n\t */\n\t_safelyModifyTimestampBy(amount: number, unit: string) {\n\t\tconst newDate = modifyDateBy(this._calendarDate, amount, unit);\n\t\tthis._safelySetTimestamp(newDate.valueOf() / 1000);\n\t}\n\n\t_getTimestampFromDom(domNode: HTMLElement) {\n\t\tconst oMonthDomRef = domNode.getAttribute(\"data-sap-timestamp\")!;\n\t\treturn parseInt(oMonthDomRef);\n\t}\n}\n\nexport default CalendarPart;\n"]}
@@ -394,7 +394,7 @@ declare class DatePicker extends DateComponentBase implements IFormElement {
394
394
  * @public
395
395
  * @method
396
396
  * @name sap.ui.webc.main.DatePicker#formatValue
397
- * @param {object} date A Java Script date object to be formatted as string
397
+ * @param {Date} date A Java Script date object to be formatted as string
398
398
  * @returns {string} The date as string
399
399
  */
400
400
  formatValue(date: Date): string;
@@ -477,7 +477,7 @@ let DatePicker = DatePicker_1 = class DatePicker extends DateComponentBase {
477
477
  * @public
478
478
  * @method
479
479
  * @name sap.ui.webc.main.DatePicker#formatValue
480
- * @param {object} date A Java Script date object to be formatted as string
480
+ * @param {Date} date A Java Script date object to be formatted as string
481
481
  * @returns {string} The date as string
482
482
  */
483
483
  formatValue(date) {