@ui5/webcomponents 0.31.14 → 0.31.18

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 (129) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +1 -1
  3. package/dist/Avatar.js +8 -6
  4. package/dist/CalendarHeader.js +75 -1
  5. package/dist/Card.js +19 -2
  6. package/dist/ComboBox.js +10 -0
  7. package/dist/DateComponentBase.js +12 -0
  8. package/dist/DatePicker.js +48 -9
  9. package/dist/DayPicker.js +21 -2
  10. package/dist/FileUploader.js +8 -0
  11. package/dist/GroupHeaderListItem.js +4 -0
  12. package/dist/Icon.js +6 -6
  13. package/dist/Input.js +10 -2
  14. package/dist/Label.js +1 -1
  15. package/dist/List.js +8 -5
  16. package/dist/ListItem.js +25 -4
  17. package/dist/Panel.js +17 -5
  18. package/dist/Popup.js +16 -5
  19. package/dist/RadioButton.js +15 -2
  20. package/dist/ResponsivePopover.js +3 -2
  21. package/dist/SegmentedButton.js +85 -53
  22. package/dist/SegmentedButtonItem.js +112 -0
  23. package/dist/Toast.js +11 -0
  24. package/dist/TreeListItem.js +2 -12
  25. package/dist/api.json +1 -1
  26. package/dist/generated/assets/themes/sap_belize/parameters-bundle.css.json +1 -1
  27. package/dist/generated/assets/themes/sap_belize_hcb/parameters-bundle.css.json +1 -1
  28. package/dist/generated/assets/themes/sap_belize_hcw/parameters-bundle.css.json +1 -1
  29. package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
  30. package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
  31. package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
  32. package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
  33. package/dist/generated/i18n/i18n-defaults.js +2 -2
  34. package/dist/generated/templates/CalendarHeaderTemplate.lit.js +3 -1
  35. package/dist/generated/templates/CalendarTemplate.lit.js +1 -1
  36. package/dist/generated/templates/CardTemplate.lit.js +1 -1
  37. package/dist/generated/templates/CustomListItemTemplate.lit.js +3 -3
  38. package/dist/generated/templates/DatePickerPopoverTemplate.lit.js +1 -1
  39. package/dist/generated/templates/DateTimePickerPopoverTemplate.lit.js +1 -1
  40. package/dist/generated/templates/DayPickerTemplate.lit.js +7 -6
  41. package/dist/generated/templates/FileUploaderTemplate.lit.js +1 -1
  42. package/dist/generated/templates/GroupHeaderListItemTemplate.lit.js +1 -1
  43. package/dist/generated/templates/ListItemTemplate.lit.js +3 -3
  44. package/dist/generated/templates/ListTemplate.lit.js +1 -1
  45. package/dist/generated/templates/RadioButtonTemplate.lit.js +1 -1
  46. package/dist/generated/templates/SegmentedButtonItemTemplate.lit.js +15 -0
  47. package/dist/generated/templates/SegmentedButtonTemplate.lit.js +1 -1
  48. package/dist/generated/templates/StandardListItemTemplate.lit.js +3 -3
  49. package/dist/generated/templates/SuggestionListItemTemplate.lit.js +3 -3
  50. package/dist/generated/templates/ToastTemplate.lit.js +2 -1
  51. package/dist/generated/templates/TreeListItemTemplate.lit.js +3 -3
  52. package/dist/generated/templates/TreeTemplate.lit.js +1 -1
  53. package/dist/generated/themes/Badge.css.js +1 -1
  54. package/dist/generated/themes/Button.css.js +1 -1
  55. package/dist/generated/themes/CalendarHeader.css.js +1 -1
  56. package/dist/generated/themes/Card.css.js +1 -1
  57. package/dist/generated/themes/CheckBox.css.js +1 -1
  58. package/dist/generated/themes/ComboBox.css.js +1 -1
  59. package/dist/generated/themes/DatePicker.css.js +1 -1
  60. package/dist/generated/themes/DayPicker.css.js +1 -1
  61. package/dist/generated/themes/GroupHeaderListItem.css.js +1 -1
  62. package/dist/generated/themes/Input.css.js +1 -1
  63. package/dist/generated/themes/InvisibleTextStyles.css.js +1 -1
  64. package/dist/generated/themes/Label.css.js +1 -1
  65. package/dist/generated/themes/Link.css.js +1 -1
  66. package/dist/generated/themes/ListItem.css.js +1 -1
  67. package/dist/generated/themes/MessageStrip.css.js +1 -1
  68. package/dist/generated/themes/MultiComboBox.css.js +1 -1
  69. package/dist/generated/themes/Panel.css.js +1 -1
  70. package/dist/generated/themes/RadioButton.css.js +1 -1
  71. package/dist/generated/themes/SegmentedButton.css.js +1 -1
  72. package/dist/generated/themes/Select.css.js +1 -1
  73. package/dist/generated/themes/SliderBase.css.js +1 -1
  74. package/dist/generated/themes/StepInput.css.js +1 -1
  75. package/dist/generated/themes/Switch.css.js +1 -1
  76. package/dist/generated/themes/TextArea.css.js +1 -1
  77. package/dist/generated/themes/Tokenizer.css.js +1 -1
  78. package/dist/generated/themes/Tree.css.js +1 -1
  79. package/dist/generated/themes/TreeListItem.css.js +1 -1
  80. package/dist/generated/themes/ValueStateMessage.css.js +1 -1
  81. package/dist/generated/themes/sap_belize/parameters-bundle.css.js +1 -1
  82. package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js +1 -1
  83. package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js +1 -1
  84. package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
  85. package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
  86. package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
  87. package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
  88. package/dist/i18n/messagebundle.properties +13 -1
  89. package/dist/popup-utils/OpenedPopupsRegistry.js +1 -1
  90. package/package.json +7 -7
  91. package/src/Avatar.js +8 -6
  92. package/src/Calendar.hbs +2 -0
  93. package/src/CalendarHeader.hbs +11 -4
  94. package/src/CalendarHeader.js +75 -1
  95. package/src/Card.hbs +1 -1
  96. package/src/Card.js +19 -2
  97. package/src/ComboBox.js +10 -0
  98. package/src/DateComponentBase.js +12 -0
  99. package/src/DatePicker.js +48 -9
  100. package/src/DatePickerPopover.hbs +1 -0
  101. package/src/DateTimePickerPopover.hbs +4 -4
  102. package/src/DayPicker.hbs +6 -1
  103. package/src/DayPicker.js +21 -2
  104. package/src/FileUploader.hbs +1 -0
  105. package/src/FileUploader.js +8 -0
  106. package/src/GroupHeaderListItem.hbs +3 -3
  107. package/src/GroupHeaderListItem.js +4 -0
  108. package/src/Icon.js +6 -6
  109. package/src/Input.js +10 -2
  110. package/src/Label.js +1 -1
  111. package/src/List.hbs +1 -2
  112. package/src/List.js +8 -5
  113. package/src/ListItem.hbs +3 -1
  114. package/src/ListItem.js +25 -4
  115. package/src/Panel.js +17 -5
  116. package/src/Popup.js +16 -5
  117. package/src/RadioButton.hbs +1 -1
  118. package/src/RadioButton.js +15 -2
  119. package/src/ResponsivePopover.js +3 -2
  120. package/src/SegmentedButton.hbs +12 -5
  121. package/src/SegmentedButton.js +85 -53
  122. package/src/SegmentedButtonItem.hbs +42 -0
  123. package/src/SegmentedButtonItem.js +112 -0
  124. package/src/Toast.hbs +13 -11
  125. package/src/Toast.js +11 -0
  126. package/src/Tree.hbs +1 -1
  127. package/src/TreeListItem.js +2 -12
  128. package/src/i18n/messagebundle.properties +13 -1
  129. package/src/popup-utils/OpenedPopupsRegistry.js +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,63 @@
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
+ ## [0.31.17](https://github.com/SAP/ui5-webcomponents/compare/v0.31.16...v0.31.17) (2021-09-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui5-avatar, ui5-icon:** attach onclick handler based on interactive property ([#3742](https://github.com/SAP/ui5-webcomponents/issues/3742)) ([e61f46f](https://github.com/SAP/ui5-webcomponents/commit/e61f46f))
12
+ * **ui5-badge:** update parameters for color-scheme="8" ([#3814](https://github.com/SAP/ui5-webcomponents/issues/3814)) ([3ea8cad](https://github.com/SAP/ui5-webcomponents/commit/3ea8cad))
13
+ * **ui5-daypicker:** support secondary calendar type ([#3773](https://github.com/SAP/ui5-webcomponents/issues/3773)) ([0c0690c](https://github.com/SAP/ui5-webcomponents/commit/0c0690c))
14
+ * **ui5-dialog:** correctly restore body scrolling on ESC ([#3696](https://github.com/SAP/ui5-webcomponents/issues/3696)) ([983af6a](https://github.com/SAP/ui5-webcomponents/commit/983af6a)), closes [#3690](https://github.com/SAP/ui5-webcomponents/issues/3690)
15
+ * **ui5-li:** add "Selected" text to item's accessible name ([#3853](https://github.com/SAP/ui5-webcomponents/issues/3853)) ([d73bba1](https://github.com/SAP/ui5-webcomponents/commit/d73bba1))
16
+ * **ui5-li-groupheader:** change role option ([#3869](https://github.com/SAP/ui5-webcomponents/issues/3869)) ([b6219c7](https://github.com/SAP/ui5-webcomponents/commit/b6219c7))
17
+ * (ui5-li): add accessible name to single select radio button ([#3842](https://github.com/SAP/ui5-webcomponents/issues/3842)) ([eda250f](https://github.com/SAP/ui5-webcomponents/commit/eda250f))
18
+
19
+
20
+ ### Features
21
+
22
+ * **ui5-calendar:** support secondary calendar type ([#3634](https://github.com/SAP/ui5-webcomponents/issues/3634)) ([3d04792](https://github.com/SAP/ui5-webcomponents/commit/3d04792))
23
+
24
+
25
+
26
+
27
+
28
+ ## [0.31.16](https://github.com/SAP/ui5-webcomponents/compare/v0.31.15...v0.31.16) (2021-08-26)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **ui5-date-picker:** fix "dateValue" getter to return most recent value ([#3629](https://github.com/SAP/ui5-webcomponents/issues/3629)) ([eb8fcf9](https://github.com/SAP/ui5-webcomponents/commit/eb8fcf9)), closes [#3516](https://github.com/SAP/ui5-webcomponents/issues/3516)
34
+
35
+
36
+ ### Features
37
+
38
+ * **ui5-panel:** noAnimation property introduced ([#3694](https://github.com/SAP/ui5-webcomponents/issues/3694)) ([d58bf44](https://github.com/SAP/ui5-webcomponents/commit/d58bf44)), closes [#3505](https://github.com/SAP/ui5-webcomponents/issues/3505)
39
+
40
+
41
+
42
+
43
+
44
+ ## [0.31.15](https://github.com/SAP/ui5-webcomponents/compare/v0.31.14...v0.31.15) (2021-08-10)
45
+
46
+
47
+ ### Bug Fixes
48
+
49
+ * **ui5-date-picker:** does not trigger value verification upon typing([#2922](https://github.com/SAP/ui5-webcomponents/issues/2922)) ([38a90ba](https://github.com/SAP/ui5-webcomponents/commit/38a90ba)), closes [#2827](https://github.com/SAP/ui5-webcomponents/issues/2827)
50
+ * **ui5-li-groupheader:** fix row height ([#3610](https://github.com/SAP/ui5-webcomponents/issues/3610)) ([9ee7ea5](https://github.com/SAP/ui5-webcomponents/commit/9ee7ea5)), closes [#3606](https://github.com/SAP/ui5-webcomponents/issues/3606)
51
+
52
+
53
+ ### Features
54
+
55
+ * **ui5-date-picker:** preventable change and input events ([#3609](https://github.com/SAP/ui5-webcomponents/issues/3609)) ([850a6c4](https://github.com/SAP/ui5-webcomponents/commit/850a6c4)), closes [#3516](https://github.com/SAP/ui5-webcomponents/issues/3516) [#3516](https://github.com/SAP/ui5-webcomponents/issues/3516)
56
+ * **ui5-responsive-popover:** add prevent initial focus parameter to showAt method ([#3595](https://github.com/SAP/ui5-webcomponents/issues/3595)) ([1eb7206](https://github.com/SAP/ui5-webcomponents/commit/1eb7206)), closes [#3473](https://github.com/SAP/ui5-webcomponents/issues/3473)
57
+ * **ui5-segmented-button-item:** introduce new component to serve as child of SegmentedButton ([#3258](https://github.com/SAP/ui5-webcomponents/issues/3258)) ([d9f5ce3](https://github.com/SAP/ui5-webcomponents/commit/d9f5ce3)), closes [#3191](https://github.com/SAP/ui5-webcomponents/issues/3191) [#3191](https://github.com/SAP/ui5-webcomponents/issues/3191)
58
+
59
+
60
+
61
+
62
+
6
63
  ## [0.31.14](https://github.com/SAP/ui5-webcomponents/compare/v0.31.13...v0.31.14) (2021-08-03)
7
64
 
8
65
 
package/README.md CHANGED
@@ -38,7 +38,7 @@ Provides general purpose UI building blocks such as buttons, labels, inputs and
38
38
  | Responsive Popover | `ui5-responsive-popover`| `import "@ui5/webcomponents/dist/ResponsivePopover.js";`|
39
39
  | Select | `ui5-select` | `import "@ui5/webcomponents/dist/Select.js";` |
40
40
  | Select Option | `ui5-option` | comes with ui5-select |
41
- | Segmented Button | `ui5-segmentedbutton`|`import "@ui5/webcomponents/dist/SegmentedButton.js";` |
41
+ | Segmented Button | `ui5-segmented-button`|`import "@ui5/webcomponents/dist/SegmentedButton.js";` |
42
42
  | Suggestion Item | `ui5-suggestion-item`|`import "@ui5/webcomponents/dist/SuggestionItem.js";` |
43
43
  | Switch | `ui5-switch` | `import "@ui5/webcomponents/dist/Switch.js";` |
44
44
  | Tab Container | `ui5-tabcontainer` | `import "@ui5/webcomponents/dist/TabContainer.js";` |
package/dist/Avatar.js CHANGED
@@ -322,12 +322,14 @@ class Avatar extends UI5Element {
322
322
  };
323
323
  }
324
324
 
325
- _onclick(event) {
326
- if (this.interactive) {
327
- // prevent the native event and fire custom event to ensure the noConfict "ui5-click" is fired
328
- event.stopPropagation();
329
- this.fireEvent("click");
330
- }
325
+ onBeforeRendering() {
326
+ this._onclick = this.interactive ? this._onClickHandler.bind(this) : undefined;
327
+ }
328
+
329
+ _onClickHandler(event) {
330
+ // prevent the native event and fire custom event to ensure the noConfict "ui5-click" is fired
331
+ event.stopPropagation();
332
+ this.fireEvent("click");
331
333
  }
332
334
 
333
335
  _onkeydown(event) {
@@ -41,6 +41,17 @@ const metadata = {
41
41
  type: CalendarType,
42
42
  },
43
43
 
44
+ /**
45
+ * Already normalized by Calendar
46
+ * @sience 1.0.0-rc.16
47
+ * @defaultvalue undefined
48
+ * @type {CalendarType}
49
+ * @public
50
+ */
51
+ secondaryCalendarType: {
52
+ type: CalendarType,
53
+ },
54
+
44
55
  isNextButtonDisabled: {
45
56
  type: Boolean,
46
57
  },
@@ -52,6 +63,10 @@ const metadata = {
52
63
  isMonthButtonHidden: {
53
64
  type: Boolean,
54
65
  },
66
+
67
+ isYearButtonHidden: {
68
+ type: Boolean,
69
+ },
55
70
  },
56
71
  events: {
57
72
  "previous-press": {},
@@ -96,11 +111,19 @@ class CalendarHeader extends UI5Element {
96
111
  const yearFormat = DateFormat.getDateInstance({ format: "y", calendarType: this.primaryCalendarType });
97
112
  const localDate = new Date(this.timestamp * 1000);
98
113
  const calendarDate = CalendarDate.fromTimestamp(localDate.getTime(), this.primaryCalendarType);
99
-
100
114
  this._monthButtonText = localeData.getMonths("wide", this.primaryCalendarType)[calendarDate.getMonth()];
101
115
  this._yearButtonText = yearFormat.format(localDate, true);
102
116
  this._prevButtonText = this.i18nBundle.getText(CALENDAR_HEADER_PREVIOUS_BUTTON);
103
117
  this._nextButtonText = this.i18nBundle.getText(CALENDAR_HEADER_NEXT_BUTTON);
118
+
119
+ if (this.hasSecondaryCalendarType) {
120
+ const secondYearFormat = DateFormat.getDateInstance({ format: "y", calendarType: this.secondaryCalendarType });
121
+ const secoundaryMonths = this._getDisplayedSecondaryMonths(localDate);
122
+
123
+ this._secondaryMonthInfo = this._getDisplayedSecondaryMonthText(secoundaryMonths);
124
+ this._secondMonthButtonText = this._secondaryMonthInfo.text;
125
+ this._secondYearButtonText = secondYearFormat.format(localDate, true);
126
+ }
104
127
  }
105
128
 
106
129
  onPrevButtonClick(event) {
@@ -133,6 +156,51 @@ class CalendarHeader extends UI5Element {
133
156
  }
134
157
  }
135
158
 
159
+ _getDisplayedSecondaryMonthText(month) {
160
+ const localeData = getCachedLocaleDataInstance(getLocale());
161
+ const pattern = localeData.getIntervalPattern();
162
+ const secondaryMonthsNames = getCachedLocaleDataInstance(getLocale()).getMonthsStandAlone("abbreviated", this.secondaryCalendarType);
163
+ const secondaryMonthsNamesWide = getCachedLocaleDataInstance(getLocale()).getMonthsStandAlone("wide", this.secondaryCalendarType);
164
+
165
+ if (month.startMonth === month.endMonth) {
166
+ return {
167
+ text: localeData.getMonths("abbreviated", this.secondaryCalendarType)[month.startMonth],
168
+ textInfo: localeData.getMonths("wide", this.secondaryCalendarType)[month.startMonth],
169
+ };
170
+ }
171
+
172
+ return {
173
+ text: pattern.replace(/\{0\}/, secondaryMonthsNames[month.startMonth]).replace(/\{1\}/, secondaryMonthsNames[month.endMonth]),
174
+ textInfo: pattern.replace(/\{0\}/, secondaryMonthsNamesWide[month.startMonth]).replace(/\{1\}/, secondaryMonthsNamesWide[month.endMonth]),
175
+ };
176
+ }
177
+
178
+ _getDisplayedSecondaryMonths(localDate) {
179
+ let firstDate = CalendarDate.fromLocalJSDate(localDate, this.primaryCalendarType);
180
+ firstDate.setDate(1);
181
+ firstDate = new CalendarDate(firstDate, this.secondaryCalendarType);
182
+
183
+ const startMonth = firstDate.getMonth();
184
+ let lastDate = CalendarDate.fromLocalJSDate(localDate, this.primaryCalendarType);
185
+
186
+ lastDate.setDate(this._daysInMonth(lastDate));
187
+ lastDate = new CalendarDate(lastDate, this.secondaryCalendarType);
188
+ const endMonth = lastDate.getMonth();
189
+ return { startMonth, endMonth };
190
+ }
191
+
192
+ _daysInMonth(calendarDate) {
193
+ calendarDate = new CalendarDate(calendarDate);
194
+ calendarDate.setDate(1);
195
+ calendarDate.setMonth(calendarDate.getMonth() + 1);
196
+ calendarDate.setDate(0);
197
+ return calendarDate.getDate();
198
+ }
199
+
200
+ get hasSecondaryCalendarType() {
201
+ return !!this.secondaryCalendarType;
202
+ }
203
+
136
204
  get classes() {
137
205
  return {
138
206
  prevButton: {
@@ -145,6 +213,12 @@ class CalendarHeader extends UI5Element {
145
213
  },
146
214
  };
147
215
  }
216
+
217
+ get accInfo() {
218
+ return {
219
+ ariaLabelMonthButton: this.hasSecondaryCalendarType ? `${this._monthButtonText},${this._secondaryMonthInfo.textInfo}` : `${this._monthButtonText}`,
220
+ };
221
+ }
148
222
  }
149
223
 
150
224
  CalendarHeader.define();
package/dist/Card.js CHANGED
@@ -3,6 +3,7 @@ import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
3
3
  import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
4
4
  import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
5
5
  import { isSpace, isEnter } from "@ui5/webcomponents-base/dist/Keys.js";
6
+ import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
6
7
  import CardTemplate from "./generated/templates/CardTemplate.lit.js";
7
8
  import Icon from "./Icon.js";
8
9
 
@@ -137,6 +138,18 @@ const metadata = {
137
138
  defaultValue: "",
138
139
  },
139
140
 
141
+ /**
142
+ * Define the <code>aria-level</code> attribute of the component
143
+ * <b>Note: </b> If the interactive property is set, <code>aria-level</code> attribute is not rendered at all.
144
+ * @private
145
+ * @type {Integer}
146
+ * @defaultValue 3
147
+ */
148
+ ariaLevel: {
149
+ type: Integer,
150
+ defaultValue: 3,
151
+ },
152
+
140
153
  _headerActive: {
141
154
  type: Boolean,
142
155
  noAttribute: true,
@@ -230,8 +243,12 @@ class Card extends UI5Element {
230
243
  return this.headerInteractive ? "button" : "heading";
231
244
  }
232
245
 
233
- get ariaLevel() {
234
- return this.headerInteractive ? undefined : "3";
246
+ get _ariaLevel() {
247
+ if (this.interactive) {
248
+ return undefined;
249
+ }
250
+
251
+ return this.ariaLevel;
235
252
  }
236
253
 
237
254
  get hasHeader() {
package/dist/ComboBox.js CHANGED
@@ -4,6 +4,7 @@ import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
4
4
  import { isPhone } from "@ui5/webcomponents-base/dist/Device.js";
5
5
  import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
6
6
  import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
7
+ import announce from "@ui5/webcomponents-base/dist/util/InvisibleMessage.js";
7
8
  import "@ui5/webcomponents-icons/dist/slim-arrow-down.js";
8
9
  import "@ui5/webcomponents-icons/dist/decline.js";
9
10
  import { getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
@@ -24,6 +25,8 @@ import {
24
25
  VALUE_STATE_INFORMATION,
25
26
  INPUT_SUGGESTIONS_TITLE,
26
27
  SELECT_OPTIONS,
28
+ LIST_ITEM_POSITION,
29
+ LIST_ITEM_SELECTED,
27
30
  } from "./generated/i18n/i18n-defaults.js";
28
31
 
29
32
  // Templates
@@ -776,6 +779,13 @@ class ComboBox extends UI5Element {
776
779
  this._itemFocused = true;
777
780
  }
778
781
 
782
+ announceSelectedItem(indexOfItem) {
783
+ const itemPositionText = this.i18nBundle.getText(LIST_ITEM_POSITION, [indexOfItem + 1], [this._filteredItems.length]);
784
+ const itemSelectionText = this.i18nBundle.getText(LIST_ITEM_SELECTED);
785
+
786
+ announce(`${itemPositionText} ${itemSelectionText}`, "Polite");
787
+ }
788
+
779
789
  get _headerTitleText() {
780
790
  return this.i18nBundle.getText(INPUT_SUGGESTIONS_TITLE);
781
791
  }
@@ -26,6 +26,18 @@ const metadata = {
26
26
  type: CalendarType,
27
27
  },
28
28
 
29
+ /**
30
+ * Defines the secondary calendar type.
31
+ * If not set, the calendar will only show the primary calendar type.
32
+ * @type {CalendarType}
33
+ * @since 1.0.0-rc.16
34
+ * @defaultvalue undefined
35
+ * @public
36
+ */
37
+ secondaryCalendarType: {
38
+ type: CalendarType,
39
+ },
40
+
29
41
  /**
30
42
  * Determines the мinimum date available for selection.
31
43
  *
@@ -230,17 +230,41 @@ const metadata = {
230
230
  * Fired when the input operation has finished by pressing Enter or on focusout.
231
231
  *
232
232
  * @event
233
+ * @allowPreventDefault
233
234
  * @public
235
+ * @param {String} value The submitted value.
236
+ * @param {Boolean} valid Indicator if the value is in correct format pattern and in valid range.
234
237
  */
235
- change: {},
238
+ change: {
239
+ details: {
240
+ value: {
241
+ type: String,
242
+ },
243
+ valid: {
244
+ type: Boolean,
245
+ },
246
+ },
247
+ },
236
248
 
237
249
  /**
238
250
  * Fired when the value of the <code>ui5-date-picker</code> is changed at each key stroke.
239
251
  *
240
252
  * @event
253
+ * @allowPreventDefault
241
254
  * @public
255
+ * @param {String} value The submitted value.
256
+ * @param {Boolean} valid Indicator if the value is in correct format pattern and in valid range.
242
257
  */
243
- input: {},
258
+ input: {
259
+ details: {
260
+ value: {
261
+ type: String,
262
+ },
263
+ valid: {
264
+ type: Boolean,
265
+ },
266
+ },
267
+ },
244
268
  },
245
269
  };
246
270
 
@@ -379,6 +403,8 @@ class DatePicker extends DateComponentBase {
379
403
  } else if (this.name) {
380
404
  console.warn(`In order for the "name" property to have effect, you should also: import "@ui5/webcomponents/dist/features/InputElementsFormSupport.js";`); // eslint-disable-line
381
405
  }
406
+
407
+ this.liveValue = this.value;
382
408
  }
383
409
 
384
410
  /**
@@ -471,17 +497,30 @@ class DatePicker extends DateComponentBase {
471
497
  this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]);
472
498
  }
473
499
 
474
- _updateValueAndFireEvents(value, normalizeValue, events) {
500
+ _updateValueAndFireEvents(value, normalizeValue, events, updateValue = true) {
475
501
  const valid = this._checkValueValidity(value);
502
+
476
503
  if (valid && normalizeValue) {
477
504
  value = this.normalizeValue(value); // transform valid values (in any format) to the correct format
478
505
  }
479
506
 
480
- this.value = value;
481
- this._updateValueState(); // Change the value state to Error/None, but only if needed
507
+ let executeEvent = true;
508
+ this.liveValue = value;
509
+
482
510
  events.forEach(event => {
483
- this.fireEvent(event, { value, valid });
511
+ if (!this.fireEvent(event, { value, valid }, true)) {
512
+ executeEvent = false;
513
+ }
484
514
  });
515
+
516
+ if (!executeEvent) {
517
+ return;
518
+ }
519
+
520
+ if (updateValue) {
521
+ this.value = value;
522
+ this._updateValueState(); // Change the value state to Error/None, but only if needed
523
+ }
485
524
  }
486
525
 
487
526
  _updateValueState() {
@@ -521,7 +560,7 @@ class DatePicker extends DateComponentBase {
521
560
  * @protected
522
561
  */
523
562
  async _onInputInput(event) {
524
- this._updateValueAndFireEvents(event.target.value, false, ["input"]);
563
+ this._updateValueAndFireEvents(event.target.value, false, ["input"], false);
525
564
  }
526
565
 
527
566
  /**
@@ -722,11 +761,11 @@ class DatePicker extends DateComponentBase {
722
761
  * @public
723
762
  */
724
763
  get dateValue() {
725
- return this.getFormat().parse(this.value);
764
+ return this.liveValue ? this.getFormat().parse(this.liveValue) : this.getFormat().parse(this.value);
726
765
  }
727
766
 
728
767
  get dateValueUTC() {
729
- return this.getFormat().parse(this.value, true);
768
+ return this.liveValue ? this.getFormat().parse(this.liveValue, true) : this.getFormat().parse(this.value);
730
769
  }
731
770
 
732
771
  get styles() {
package/dist/DayPicker.js CHANGED
@@ -184,6 +184,7 @@ class DayPicker extends CalendarPart {
184
184
 
185
185
  const firstDayOfWeek = this._getFirstDayOfWeek();
186
186
  const monthsNames = localeData.getMonths("wide", this._primaryCalendarType);
187
+ const secondaryMonthsNames = this.hasSecondaryCalendarType && localeData.getMonths("wide", this.secondaryCalendarType);
187
188
  const nonWorkingDayLabel = this.i18nBundle.getText(DAY_PICKER_NON_WORKING_DAY);
188
189
  const todayLabel = this.i18nBundle.getText(DAY_PICKER_TODAY);
189
190
  const tempDate = this._getFirstDay(); // date that will be changed by 1 day 42 times
@@ -192,6 +193,8 @@ class DayPicker extends CalendarPart {
192
193
  const minDate = this._minDate; // store the _minDate (expensive getter)
193
194
  const maxDate = this._maxDate; // store the _maxDate (expensive getter)
194
195
 
196
+ const tempSecondDate = this.hasSecondaryCalendarType && this._getSecondaryDay(tempDate);
197
+
195
198
  let week = [];
196
199
  for (let i = 0; i < DAYS_IN_WEEK * 6; i++) { // always show 6 weeks total, 42 days to avoid jumping
197
200
  const timestamp = tempDate.valueOf() / 1000; // no need to round because CalendarDate does it
@@ -212,15 +215,20 @@ class DayPicker extends CalendarPart {
212
215
 
213
216
  const nonWorkingAriaLabel = isWeekend ? `${nonWorkingDayLabel} ` : "";
214
217
  const todayAriaLabel = isToday ? `${todayLabel} ` : "";
218
+ const ariaLabel = this.hasSecondaryCalendarType
219
+ ? `${todayAriaLabel}${nonWorkingAriaLabel}${monthsNames[tempDate.getMonth()]} ${tempDate.getDate()}, ${tempDate.getYear()} ${secondaryMonthsNames[tempSecondDate.getMonth()]} ${tempSecondDate.getDate()}, ${tempSecondDate.getYear()}`
220
+ : `${todayAriaLabel}${nonWorkingAriaLabel}${monthsNames[tempDate.getMonth()]} ${tempDate.getDate()}, ${tempDate.getYear()}`;
215
221
 
216
222
  const day = {
217
223
  timestamp: timestamp.toString(),
218
224
  focusRef: isFocused,
219
225
  _tabIndex: isFocused ? "0" : "-1",
220
226
  selected: isSelected,
221
- iDay: tempDate.getDate(),
227
+ day: tempDate.getDate(),
228
+ secondDay: this.hasSecondaryCalendarType && tempSecondDate.getDate(),
229
+ _isSecondaryCalendarType: this.hasSecondaryCalendarType,
222
230
  classes: `ui5-dp-item ui5-dp-wday${dayOfTheWeek}`,
223
- ariaLabel: `${todayAriaLabel}${nonWorkingAriaLabel}${monthsNames[tempDate.getMonth()]} ${tempDate.getDate()}, ${tempDate.getYear()}`,
231
+ ariaLabel,
224
232
  ariaSelected: isSelected ? "true" : "false",
225
233
  ariaDisabled: isOtherMonth ? "true" : undefined,
226
234
  disabled: isDisabled,
@@ -268,6 +276,9 @@ class DayPicker extends CalendarPart {
268
276
  }
269
277
 
270
278
  tempDate.setDate(tempDate.getDate() + 1);
279
+ if (this.hasSecondaryCalendarType) {
280
+ tempSecondDate.setDate(tempSecondDate.getDate() + 1);
281
+ }
271
282
  }
272
283
  }
273
284
 
@@ -656,6 +667,10 @@ class DayPicker extends CalendarPart {
656
667
  return this.hideWeekNumbers;
657
668
  }
658
669
 
670
+ get hasSecondaryCalendarType() {
671
+ return !!this.secondaryCalendarType;
672
+ }
673
+
659
674
  _isWeekend(oDate) {
660
675
  const localeData = getCachedLocaleDataInstance(getLocale());
661
676
 
@@ -672,6 +687,10 @@ class DayPicker extends CalendarPart {
672
687
  return (target.className.indexOf("ui5-dp-item") > -1) || (targetParent && targetParent.classList && targetParent.classList.contains("ui5-dp-item"));
673
688
  }
674
689
 
690
+ _getSecondaryDay(tempDate) {
691
+ return new CalendarDate(tempDate, this.secondaryCalendarType);
692
+ }
693
+
675
694
  _getFirstDay() {
676
695
  let daysFromPreviousMonth;
677
696
 
@@ -274,15 +274,23 @@ class FileUploader extends UI5Element {
274
274
  });
275
275
  }
276
276
 
277
+ _onclick(event) {
278
+ if (event.isMarked === "button") {
279
+ this._input.click(event);
280
+ }
281
+ }
282
+
277
283
  _onkeydown(event) {
278
284
  if (isEnter(event)) {
279
285
  this._input.click(event);
286
+ event.preventDefault();
280
287
  }
281
288
  }
282
289
 
283
290
  _onkeyup(event) {
284
291
  if (isSpace(event)) {
285
292
  this._input.click(event);
293
+ event.preventDefault();
286
294
  }
287
295
  }
288
296
 
@@ -85,6 +85,10 @@ class GroupHeaderListItem extends ListItemBase {
85
85
  return this.i18nBundle.getText(GROUP_HEADER_TEXT);
86
86
  }
87
87
 
88
+ get ariaLabelText() {
89
+ return [this.textContent, this.accessibleName].filter(Boolean).join(" ");
90
+ }
91
+
88
92
  static async onDefine() {
89
93
  await Promise.all([
90
94
  fetchI18nBundle("@ui5/webcomponents"),
package/dist/Icon.js CHANGED
@@ -237,12 +237,10 @@ class Icon extends UI5Element {
237
237
  }
238
238
  }
239
239
 
240
- _onclick(event) {
241
- if (this.interactive) {
242
- // prevent the native event and fire custom event to ensure the noConfict "ui5-click" is fired
243
- event.stopPropagation();
244
- this.fireEvent("click");
245
- }
240
+ _onClickHandler(event) {
241
+ // prevent the native event and fire custom event to ensure the noConfict "ui5-click" is fired
242
+ event.stopPropagation();
243
+ this.fireEvent("click");
246
244
  }
247
245
 
248
246
  get _dir() {
@@ -329,6 +327,8 @@ class Icon extends UI5Element {
329
327
  this.ltr = iconData.ltr;
330
328
  this.packageName = iconData.packageName;
331
329
 
330
+ this._onclick = this.interactive ? this._onClickHandler.bind(this) : undefined;
331
+
332
332
  if (this.accessibleName) {
333
333
  this.effectiveAccessibleName = this.accessibleName;
334
334
  } else if (this.accData) {
package/dist/Input.js CHANGED
@@ -836,6 +836,14 @@ class Input extends UI5Element {
836
836
  return !!this._isPopoverOpen;
837
837
  }
838
838
 
839
+ /**
840
+ * Checks if the value state popover is open.
841
+ * @returns {boolean} true if the value state popover is open, false otherwise
842
+ */
843
+ isValueStateOpened() {
844
+ return !!this._isPopoverOpen;
845
+ }
846
+
839
847
  async openPopover() {
840
848
  const popover = await this._getPopover();
841
849
 
@@ -1168,7 +1176,8 @@ class Input extends UI5Element {
1168
1176
  return {
1169
1177
  popoverValueState: {
1170
1178
  "ui5-valuestatemessage-root": true,
1171
- "ui5-responsive-popover-header": !this.isOpen(),
1179
+ "ui5-valuestatemessage-header": true,
1180
+ "ui5-responsive-popover-header": !this.isValueStateOpened(),
1172
1181
  "ui5-valuestatemessage--success": this.valueState === ValueState.Success,
1173
1182
  "ui5-valuestatemessage--error": this.valueState === ValueState.Error,
1174
1183
  "ui5-valuestatemessage--warning": this.valueState === ValueState.Warning,
@@ -1185,7 +1194,6 @@ class Input extends UI5Element {
1185
1194
  suggestionPopoverHeader: {
1186
1195
  "display": this._listWidth === 0 ? "none" : "inline-block",
1187
1196
  "width": `${this._listWidth}px`,
1188
- "padding": "0.925rem 1rem",
1189
1197
  },
1190
1198
  suggestionsPopover: {
1191
1199
  "max-width": `${this._inputWidth}px`,
package/dist/Label.js CHANGED
@@ -42,7 +42,7 @@ const metadata = {
42
42
  },
43
43
 
44
44
  /**
45
- * Defines whether semi-colon is added to the <code>ui5-label</code> text.
45
+ * Defines whether colon is added to the component text.
46
46
  * <br><br>
47
47
  * <b>Note:</b> Usually used in forms.
48
48
  * @type {boolean}
package/dist/List.js CHANGED
@@ -208,16 +208,19 @@ const metadata = {
208
208
  },
209
209
 
210
210
  /**
211
- * Used to externally manipulate the role of the list
211
+ * Defines the accessible role of the component.
212
+ * <br><br>
213
+ * <b>Note:</b> If you use notification list items,
214
+ * it's recommended to set <code>accessible-role="list"</code> for better accessibility.
212
215
  *
213
216
  * @private
214
217
  * @type {String}
215
- * @defaultvalue "listbox"
216
- * @since 1.0.0-rc.9
218
+ * @defaultvalue "list"
219
+ * @since 1.0.0-rc.15
217
220
  */
218
- accRole: {
221
+ accessibleRole: {
219
222
  type: String,
220
- defaultValue: "listbox",
223
+ defaultValue: "list",
221
224
  },
222
225
 
223
226
  /**