@ui5/webcomponents 1.7.0 → 1.7.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,17 @@
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.7.1](https://github.com/SAP/ui5-webcomponents/compare/v1.7.0...v1.7.1) (2022-09-08)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **ui5-tabcontainer:** fixed error when no tabs ([#5793](https://github.com/SAP/ui5-webcomponents/issues/5793)) ([4aefe17](https://github.com/SAP/ui5-webcomponents/commit/4aefe176bfed5a6ba963418413aa167955b40418))
12
+
13
+
14
+
15
+
16
+
6
17
  # [1.7.0](https://github.com/SAP/ui5-webcomponents/compare/v1.6.0...v1.7.0) (2022-09-02)
7
18
 
8
19
 
@@ -378,17 +378,20 @@ class TabContainer extends UI5Element {
378
378
  }
379
379
 
380
380
  onBeforeRendering() {
381
- // update selected tab
382
381
  this._allItemsAndSubItems = this._getAllSubItems(this.items);
383
- if (this._allItemsAndSubItems.length) {
384
- const selectedTabs = this._allItemsAndSubItems.filter(tab => tab.selected);
385
- if (selectedTabs.length) {
386
- this._selectedTab = selectedTabs[0];
387
- } else {
388
- this._selectedTab = this._allItemsAndSubItems[0];
389
- this._selectedTab._selected = true;
390
- }
382
+ if (!this._allItemsAndSubItems.length) {
383
+ return;
384
+ }
385
+
386
+ // update selected tab
387
+ const selectedTabs = this._allItemsAndSubItems.filter(tab => tab.selected);
388
+ if (selectedTabs.length) {
389
+ this._selectedTab = selectedTabs[0];
390
+ } else {
391
+ this._selectedTab = this._allItemsAndSubItems[0];
392
+ this._selectedTab._selected = true;
391
393
  }
394
+
392
395
  this._setItemsPrivateProperties(this.items);
393
396
 
394
397
  if (!this._animationRunning) {
@@ -401,6 +404,10 @@ class TabContainer extends UI5Element {
401
404
  }
402
405
 
403
406
  onAfterRendering() {
407
+ if (!this.items.length) {
408
+ return;
409
+ }
410
+
404
411
  this._setItemsForStrip();
405
412
 
406
413
  if (!this.shadowRoot.contains(document.activeElement)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "UI5 Web Components: webcomponents.main",
5
5
  "ui5": {
6
6
  "webComponentsPackage": true
@@ -41,13 +41,13 @@
41
41
  "directory": "packages/main"
42
42
  },
43
43
  "dependencies": {
44
- "@ui5/webcomponents-base": "1.7.0",
45
- "@ui5/webcomponents-icons": "1.7.0",
46
- "@ui5/webcomponents-localization": "1.7.0",
47
- "@ui5/webcomponents-theming": "1.7.0"
44
+ "@ui5/webcomponents-base": "1.7.1",
45
+ "@ui5/webcomponents-icons": "1.7.1",
46
+ "@ui5/webcomponents-localization": "1.7.1",
47
+ "@ui5/webcomponents-theming": "1.7.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@ui5/webcomponents-tools": "1.7.0",
50
+ "@ui5/webcomponents-tools": "1.7.1",
51
51
  "chromedriver": "104.0.0"
52
52
  }
53
53
  }
@@ -378,17 +378,20 @@ class TabContainer extends UI5Element {
378
378
  }
379
379
 
380
380
  onBeforeRendering() {
381
- // update selected tab
382
381
  this._allItemsAndSubItems = this._getAllSubItems(this.items);
383
- if (this._allItemsAndSubItems.length) {
384
- const selectedTabs = this._allItemsAndSubItems.filter(tab => tab.selected);
385
- if (selectedTabs.length) {
386
- this._selectedTab = selectedTabs[0];
387
- } else {
388
- this._selectedTab = this._allItemsAndSubItems[0];
389
- this._selectedTab._selected = true;
390
- }
382
+ if (!this._allItemsAndSubItems.length) {
383
+ return;
384
+ }
385
+
386
+ // update selected tab
387
+ const selectedTabs = this._allItemsAndSubItems.filter(tab => tab.selected);
388
+ if (selectedTabs.length) {
389
+ this._selectedTab = selectedTabs[0];
390
+ } else {
391
+ this._selectedTab = this._allItemsAndSubItems[0];
392
+ this._selectedTab._selected = true;
391
393
  }
394
+
392
395
  this._setItemsPrivateProperties(this.items);
393
396
 
394
397
  if (!this._animationRunning) {
@@ -401,6 +404,10 @@ class TabContainer extends UI5Element {
401
404
  }
402
405
 
403
406
  onAfterRendering() {
407
+ if (!this.items.length) {
408
+ return;
409
+ }
410
+
404
411
  this._setItemsForStrip();
405
412
 
406
413
  if (!this.shadowRoot.contains(document.activeElement)) {