@ui5/webcomponents 1.2.0 → 1.2.1

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
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.2.1](https://github.com/SAP/ui5-webcomponents/compare/v1.2.0...v1.2.1) (2022-03-02)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui5-multi-combobox:** Prevent scrolling on page up/down ([#4835](https://github.com/SAP/ui5-webcomponents/issues/4835)) ([6c85e8d](https://github.com/SAP/ui5-webcomponents/commit/6c85e8d))
12
+ * **ui5-responsive-popover:** fix auto close during re-rendering ([#4828](https://github.com/SAP/ui5-webcomponents/issues/4828)) ([5859ce7](https://github.com/SAP/ui5-webcomponents/commit/5859ce7)), closes [#4816](https://github.com/SAP/ui5-webcomponents/issues/4816)
13
+ * **ui5-segmented-button-item:** adopt inherited `tooltip` property ([#4843](https://github.com/SAP/ui5-webcomponents/issues/4843)) ([b04db63](https://github.com/SAP/ui5-webcomponents/commit/b04db63)), closes [#4840](https://github.com/SAP/ui5-webcomponents/issues/4840)
14
+
15
+
16
+ ### Features
17
+
18
+ * **ui5-multi-combobox, ui5-tokenizer:** Full Home/End implementation ([#4796](https://github.com/SAP/ui5-webcomponents/issues/4796)) ([8d83d33](https://github.com/SAP/ui5-webcomponents/commit/8d83d33))
19
+
20
+
21
+
22
+
23
+
6
24
  # [1.2.0](https://github.com/SAP/ui5-webcomponents/compare/v1.1.2...v1.2.0) (2022-02-28)
7
25
 
8
26
 
package/dist/Button.js CHANGED
@@ -113,9 +113,9 @@ const metadata = {
113
113
  },
114
114
 
115
115
  /**
116
- * Defines the tooltip of the button.
116
+ * Defines the tooltip of the component.
117
117
  * <br>
118
- * <b>Note:</b> Tooltips should only be set to icon-only buttons.
118
+ * <b>Note:</b> We recommend setting tooltip to icon-only components.
119
119
  * @type {string}
120
120
  * @defaultvalue: ""
121
121
  * @public
@@ -11,6 +11,8 @@ import {
11
11
  isHome,
12
12
  isTabNext,
13
13
  isTabPrevious,
14
+ isHomeCtrl,
15
+ isEndCtrl,
14
16
  isCtrlA,
15
17
  } from "@ui5/webcomponents-base/dist/Keys.js";
16
18
  import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
@@ -585,6 +587,14 @@ class MultiComboBox extends UI5Element {
585
587
  this[`_handle${event.key}`] && this[`_handle${event.key}`](event);
586
588
  }
587
589
 
590
+ _handlePageUp(event) {
591
+ event.preventDefault();
592
+ }
593
+
594
+ _handlePageDown(event) {
595
+ event.preventDefault();
596
+ }
597
+
588
598
  _handleBackspace(event) {
589
599
  if (event.target.value === "") {
590
600
  event.preventDefault();
@@ -661,6 +671,16 @@ class MultiComboBox extends UI5Element {
661
671
  return;
662
672
  }
663
673
 
674
+ if (isHomeCtrl(event)) {
675
+ this.list._itemNavigation._handleHome(event);
676
+ this.list.items[this.list._itemNavigation._currentIndex].focus();
677
+ }
678
+
679
+ if (isEndCtrl(event)) {
680
+ this.list._itemNavigation._handleEnd(event);
681
+ this.list.items[this.list._itemNavigation._currentIndex].focus();
682
+ }
683
+
664
684
  event.preventDefault();
665
685
 
666
686
  if (isCtrlA(event)) {
@@ -183,7 +183,7 @@ class ResponsivePopover extends Popover {
183
183
  return ResponsivePopover.i18nBundle.getText(RESPONSIVE_POPOVER_CLOSE_DIALOG_BUTTON);
184
184
  }
185
185
 
186
- _afterDialogOpen(event) {
186
+ _beforeDialogOpen(event) {
187
187
  this.open = true;
188
188
  this.opened = true;
189
189
  this._propagateDialogEvent(event);
package/dist/Tokenizer.js CHANGED
@@ -15,6 +15,10 @@ import {
15
15
  isRightShiftCtrl,
16
16
  isEnd,
17
17
  isHome,
18
+ isHomeShift,
19
+ isEndShift,
20
+ isHomeCtrl,
21
+ isEndCtrl,
18
22
  } from "@ui5/webcomponents-base/dist/Keys.js";
19
23
  import { isPhone } from "@ui5/webcomponents-base/dist/Device.js";
20
24
  import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
@@ -273,6 +277,14 @@ class Tokenizer extends UI5Element {
273
277
  return this._handleTokenSelection(event, false);
274
278
  }
275
279
 
280
+ if (isHomeShift(event)) {
281
+ this._handleHomeShift(event);
282
+ }
283
+
284
+ if (isEndShift(event)) {
285
+ this._handleEndShift(event);
286
+ }
287
+
276
288
  this._handleItemNavigation(event, this.tokens);
277
289
  }
278
290
 
@@ -293,8 +305,9 @@ class Tokenizer extends UI5Element {
293
305
  return this._handleArrowShift(event.target, tokens, (isRightShift(event) || isRightShiftCtrl(event)));
294
306
  }
295
307
 
296
- if (isHome(event) || isEnd(event)) {
297
- return this._handleHome(tokens, isEnd(event));
308
+ if (isHome(event) || isEnd(event) || isHomeCtrl(event) || isEndCtrl(event)) {
309
+ event.preventDefault();
310
+ return this._handleHome(tokens, isEnd(event) || isEndCtrl(event));
298
311
  }
299
312
 
300
313
  if (isCtrl && event.key.toLowerCase() === "a") {
@@ -315,6 +328,30 @@ class Tokenizer extends UI5Element {
315
328
  this._itemNav.setCurrentItem(tokens[index]);
316
329
  }
317
330
 
331
+ _handleHomeShift(event) {
332
+ const tokens = this.tokens;
333
+ const currentTokenIdx = tokens.indexOf(event.target);
334
+
335
+ tokens.filter((token, index) => index <= currentTokenIdx).forEach(token => {
336
+ token.selected = true;
337
+ });
338
+
339
+ tokens[0].focus();
340
+ this._itemNav.setCurrentItem(tokens[0]);
341
+ }
342
+
343
+ _handleEndShift(event) {
344
+ const tokens = this.tokens;
345
+ const currentTokenIdx = tokens.indexOf(event.target);
346
+
347
+ tokens.filter((token, index) => index >= currentTokenIdx).forEach(token => {
348
+ token.selected = true;
349
+ });
350
+
351
+ tokens[tokens.length - 1].focus();
352
+ this._itemNav.setCurrentItem(tokens[tokens.length - 1]);
353
+ }
354
+
318
355
  _calcNextTokenIndex(focusedToken, tokens, backwards) {
319
356
  if (!tokens.length) {
320
357
  return -1;
package/dist/api.json CHANGED
@@ -437,7 +437,7 @@
437
437
  "visibility": "public",
438
438
  "since": "1.2.0",
439
439
  "type": "string",
440
- "description": "Defines the tooltip of the button. <br> <b>Note:</b> Tooltips should only be set to icon-only buttons."
440
+ "description": "Defines the tooltip of the component. <br> <b>Note:</b> We recommend setting tooltip to icon-only components."
441
441
  }
442
442
  ],
443
443
  "slots": [
@@ -2,7 +2,7 @@
2
2
  import { html, svg, repeat, classMap, styleMap, ifDefined, unsafeHTML, scopeTag } from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
3
3
 
4
4
  const block0 = (context, tags, suffix) => html`${ context._isPhone ? block1(context, tags, suffix) : block7(context, tags, suffix) }`;
5
- const block1 = (context, tags, suffix) => html`<${scopeTag("ui5-dialog", tags, suffix)} accessible-name=${ifDefined(context.accessibleName)} accessible-name-ref=${ifDefined(context.accessibleNameRef)} stretch _disable-initial-focus @ui5-before-open="${ifDefined(context._propagateDialogEvent)}" @ui5-after-open="${ifDefined(context._afterDialogOpen)}" @ui5-before-close="${ifDefined(context._propagateDialogEvent)}" @ui5-after-close="${ifDefined(context._afterDialogClose)}" exportparts="content, header, footer">${ !context._hideHeader ? block2(context, tags, suffix) : undefined }<slot></slot><slot slot="footer" name="footer"></slot></${scopeTag("ui5-dialog", tags, suffix)}>`;
5
+ const block1 = (context, tags, suffix) => html`<${scopeTag("ui5-dialog", tags, suffix)} accessible-name=${ifDefined(context.accessibleName)} accessible-name-ref=${ifDefined(context.accessibleNameRef)} stretch _disable-initial-focus @ui5-before-open="${ifDefined(context._beforeDialogOpen)}" @ui5-after-open="${ifDefined(context._propagateDialogEvent)}" @ui5-before-close="${ifDefined(context._propagateDialogEvent)}" @ui5-after-close="${ifDefined(context._afterDialogClose)}" exportparts="content, header, footer">${ !context._hideHeader ? block2(context, tags, suffix) : undefined }<slot></slot><slot slot="footer" name="footer"></slot></${scopeTag("ui5-dialog", tags, suffix)}>`;
6
6
  const block2 = (context, tags, suffix) => html`${ context.header.length ? block3(context, tags, suffix) : block4(context, tags, suffix) }`;
7
7
  const block3 = (context, tags, suffix) => html`<slot slot="header" name="header"></slot>`;
8
8
  const block4 = (context, tags, suffix) => html`<div class="${classMap(context.classes.header)}" slot="header">${ context.headerText ? block5(context, tags, suffix) : undefined }${ !context._hideCloseButton ? block6(context, tags, suffix) : undefined }</div>`;
@@ -1,7 +1,7 @@
1
1
  /* eslint no-unused-vars: 0 */
2
2
  import { html, svg, repeat, classMap, styleMap, ifDefined, unsafeHTML, scopeTag } from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
3
3
 
4
- const block0 = (context, tags, suffix) => html`<li role="option" aria-roledescription="${ifDefined(context.ariaDescription)}" aria-posinset="${ifDefined(context.posInSet)}" aria-setsize="${ifDefined(context.sizeOfSet)}" aria-selected="${ifDefined(context.pressed)}" class="ui5-button-root" aria-disabled="${ifDefined(context.disabled)}" data-sap-focus-ref dir="${ifDefined(context.effectiveDir)}" @focusout=${context._onfocusout} @focusin=${context._onfocusin} @click=${context._onclick} @mousedown=${context._onmousedown} @mouseup=${context._onmouseup} @keydown=${context._onkeydown} @keyup=${context._onkeyup} @touchstart="${context._ontouchstart}" @touchend="${context._ontouchend}" tabindex=${ifDefined(context.tabIndexValue)} aria-label="${ifDefined(context.ariaLabelText)}" title="${ifDefined(context.title)}">${ context.icon ? block1(context, tags, suffix) : undefined }<span id="${ifDefined(context._id)}-content" class="ui5-button-text"><bdi><slot></slot></bdi></span></li> `;
4
+ const block0 = (context, tags, suffix) => html`<li role="option" aria-roledescription="${ifDefined(context.ariaDescription)}" aria-posinset="${ifDefined(context.posInSet)}" aria-setsize="${ifDefined(context.sizeOfSet)}" aria-selected="${ifDefined(context.pressed)}" class="ui5-button-root" aria-disabled="${ifDefined(context.disabled)}" data-sap-focus-ref dir="${ifDefined(context.effectiveDir)}" @focusout=${context._onfocusout} @focusin=${context._onfocusin} @click=${context._onclick} @mousedown=${context._onmousedown} @mouseup=${context._onmouseup} @keydown=${context._onkeydown} @keyup=${context._onkeyup} @touchstart="${context._ontouchstart}" @touchend="${context._ontouchend}" tabindex=${ifDefined(context.tabIndexValue)} aria-label="${ifDefined(context.ariaLabelText)}" title="${ifDefined(context.tooltip)}">${ context.icon ? block1(context, tags, suffix) : undefined }<span id="${ifDefined(context._id)}-content" class="ui5-button-text"><bdi><slot></slot></bdi></span></li> `;
5
5
  const block1 = (context, tags, suffix) => html`<${scopeTag("ui5-icon", tags, suffix)} class="ui5-button-icon" name="${ifDefined(context.icon)}" part="icon" ?show-tooltip=${context.showIconTooltip}></${scopeTag("ui5-icon", tags, suffix)}>`;
6
6
 
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "UI5 Web Components: webcomponents.main",
5
5
  "ui5": {
6
6
  "webComponentsPackage": true
@@ -42,14 +42,14 @@
42
42
  "directory": "packages/main"
43
43
  },
44
44
  "dependencies": {
45
- "@ui5/webcomponents-base": "1.2.0",
46
- "@ui5/webcomponents-icons": "1.2.0",
47
- "@ui5/webcomponents-ie11": "1.2.0",
48
- "@ui5/webcomponents-localization": "1.2.0",
49
- "@ui5/webcomponents-theming": "1.2.0"
45
+ "@ui5/webcomponents-base": "1.2.1",
46
+ "@ui5/webcomponents-icons": "1.2.1",
47
+ "@ui5/webcomponents-ie11": "1.2.1",
48
+ "@ui5/webcomponents-localization": "1.2.1",
49
+ "@ui5/webcomponents-theming": "1.2.1"
50
50
  },
51
51
  "devDependencies": {
52
- "@ui5/webcomponents-tools": "1.2.0",
52
+ "@ui5/webcomponents-tools": "1.2.1",
53
53
  "chromedriver": "98.0.0"
54
54
  }
55
55
  }
package/src/Button.js CHANGED
@@ -113,9 +113,9 @@ const metadata = {
113
113
  },
114
114
 
115
115
  /**
116
- * Defines the tooltip of the button.
116
+ * Defines the tooltip of the component.
117
117
  * <br>
118
- * <b>Note:</b> Tooltips should only be set to icon-only buttons.
118
+ * <b>Note:</b> We recommend setting tooltip to icon-only components.
119
119
  * @type {string}
120
120
  * @defaultvalue: ""
121
121
  * @public
@@ -11,6 +11,8 @@ import {
11
11
  isHome,
12
12
  isTabNext,
13
13
  isTabPrevious,
14
+ isHomeCtrl,
15
+ isEndCtrl,
14
16
  isCtrlA,
15
17
  } from "@ui5/webcomponents-base/dist/Keys.js";
16
18
  import Integer from "@ui5/webcomponents-base/dist/types/Integer.js";
@@ -585,6 +587,14 @@ class MultiComboBox extends UI5Element {
585
587
  this[`_handle${event.key}`] && this[`_handle${event.key}`](event);
586
588
  }
587
589
 
590
+ _handlePageUp(event) {
591
+ event.preventDefault();
592
+ }
593
+
594
+ _handlePageDown(event) {
595
+ event.preventDefault();
596
+ }
597
+
588
598
  _handleBackspace(event) {
589
599
  if (event.target.value === "") {
590
600
  event.preventDefault();
@@ -661,6 +671,16 @@ class MultiComboBox extends UI5Element {
661
671
  return;
662
672
  }
663
673
 
674
+ if (isHomeCtrl(event)) {
675
+ this.list._itemNavigation._handleHome(event);
676
+ this.list.items[this.list._itemNavigation._currentIndex].focus();
677
+ }
678
+
679
+ if (isEndCtrl(event)) {
680
+ this.list._itemNavigation._handleEnd(event);
681
+ this.list.items[this.list._itemNavigation._currentIndex].focus();
682
+ }
683
+
664
684
  event.preventDefault();
665
685
 
666
686
  if (isCtrlA(event)) {
@@ -4,8 +4,8 @@
4
4
  accessible-name-ref={{accessibleNameRef}}
5
5
  stretch
6
6
  _disable-initial-focus
7
- @ui5-before-open="{{_propagateDialogEvent}}"
8
- @ui5-after-open="{{_afterDialogOpen}}"
7
+ @ui5-before-open="{{_beforeDialogOpen}}"
8
+ @ui5-after-open="{{_propagateDialogEvent}}"
9
9
  @ui5-before-close="{{_propagateDialogEvent}}"
10
10
  @ui5-after-close="{{_afterDialogClose}}"
11
11
  exportparts="content, header, footer"
@@ -183,7 +183,7 @@ class ResponsivePopover extends Popover {
183
183
  return ResponsivePopover.i18nBundle.getText(RESPONSIVE_POPOVER_CLOSE_DIALOG_BUTTON);
184
184
  }
185
185
 
186
- _afterDialogOpen(event) {
186
+ _beforeDialogOpen(event) {
187
187
  this.open = true;
188
188
  this.opened = true;
189
189
  this._propagateDialogEvent(event);
@@ -20,7 +20,7 @@
20
20
  @touchend="{{_ontouchend}}"
21
21
  tabindex={{tabIndexValue}}
22
22
  aria-label="{{ariaLabelText}}"
23
- title="{{title}}"
23
+ title="{{tooltip}}"
24
24
  >
25
25
  {{#if icon}}
26
26
  <ui5-icon
package/src/Tokenizer.js CHANGED
@@ -15,6 +15,10 @@ import {
15
15
  isRightShiftCtrl,
16
16
  isEnd,
17
17
  isHome,
18
+ isHomeShift,
19
+ isEndShift,
20
+ isHomeCtrl,
21
+ isEndCtrl,
18
22
  } from "@ui5/webcomponents-base/dist/Keys.js";
19
23
  import { isPhone } from "@ui5/webcomponents-base/dist/Device.js";
20
24
  import ValueState from "@ui5/webcomponents-base/dist/types/ValueState.js";
@@ -273,6 +277,14 @@ class Tokenizer extends UI5Element {
273
277
  return this._handleTokenSelection(event, false);
274
278
  }
275
279
 
280
+ if (isHomeShift(event)) {
281
+ this._handleHomeShift(event);
282
+ }
283
+
284
+ if (isEndShift(event)) {
285
+ this._handleEndShift(event);
286
+ }
287
+
276
288
  this._handleItemNavigation(event, this.tokens);
277
289
  }
278
290
 
@@ -293,8 +305,9 @@ class Tokenizer extends UI5Element {
293
305
  return this._handleArrowShift(event.target, tokens, (isRightShift(event) || isRightShiftCtrl(event)));
294
306
  }
295
307
 
296
- if (isHome(event) || isEnd(event)) {
297
- return this._handleHome(tokens, isEnd(event));
308
+ if (isHome(event) || isEnd(event) || isHomeCtrl(event) || isEndCtrl(event)) {
309
+ event.preventDefault();
310
+ return this._handleHome(tokens, isEnd(event) || isEndCtrl(event));
298
311
  }
299
312
 
300
313
  if (isCtrl && event.key.toLowerCase() === "a") {
@@ -315,6 +328,30 @@ class Tokenizer extends UI5Element {
315
328
  this._itemNav.setCurrentItem(tokens[index]);
316
329
  }
317
330
 
331
+ _handleHomeShift(event) {
332
+ const tokens = this.tokens;
333
+ const currentTokenIdx = tokens.indexOf(event.target);
334
+
335
+ tokens.filter((token, index) => index <= currentTokenIdx).forEach(token => {
336
+ token.selected = true;
337
+ });
338
+
339
+ tokens[0].focus();
340
+ this._itemNav.setCurrentItem(tokens[0]);
341
+ }
342
+
343
+ _handleEndShift(event) {
344
+ const tokens = this.tokens;
345
+ const currentTokenIdx = tokens.indexOf(event.target);
346
+
347
+ tokens.filter((token, index) => index >= currentTokenIdx).forEach(token => {
348
+ token.selected = true;
349
+ });
350
+
351
+ tokens[tokens.length - 1].focus();
352
+ this._itemNav.setCurrentItem(tokens[tokens.length - 1]);
353
+ }
354
+
318
355
  _calcNextTokenIndex(focusedToken, tokens, backwards) {
319
356
  if (!tokens.length) {
320
357
  return -1;