diff --git a/packages/main/src/Tab.js b/packages/main/src/Tab.js index 882f13898f0b..bc9a3559518e 100644 --- a/packages/main/src/Tab.js +++ b/packages/main/src/Tab.js @@ -1,9 +1,8 @@ import Bootstrap from "@ui5/webcomponents-base/src/Bootstrap"; import URI from "@ui5/webcomponents-base/src/types/URI"; -import Integer from "@ui5/webcomponents-base/src/types/Integer"; +import Function from "@ui5/webcomponents-base/src/types/Function"; import TabBase from "./TabBase"; import TabTemplateContext from "./TabTemplateContext"; -import TabDesignMode from "./types/TabDesignMode"; import IconColor from "./types/IconColor"; import Icon from "./Icon"; import TabRenderer from "./build/compiled/TabRenderer.lit"; @@ -47,14 +46,15 @@ const metadata = { */ disabled: { type: Boolean, + defaultValue: false, }, /** - * Represents the "count" text, which is displayed in the tab filter. + * Represents the "additionalText" text, which is displayed in the tab filter. * @type {String} * @public */ - count: { + additionalText: { type: String, defaultValue: "", }, @@ -85,27 +85,19 @@ const metadata = { defaultValue: IconColor.Default, }, - /** - * Specifies whether the icon and the texts are placed vertically or horizontally. - * @type {TabDesignMode} - * @public - */ - design: { - type: TabDesignMode, - defaultValue: TabDesignMode.Vertical, + selected: { + type: Boolean, + defaultValue: false, + }, + + _tabIndex: { + type: String, + defaultValue: "-1", }, - _showAll: { type: Boolean }, - _isSelected: { type: Boolean, defaultValue: false }, - _isInline: { type: Boolean }, - _isNoIcon: { type: Boolean }, - _isNoText: { type: Boolean }, - _tabIndex: { type: String, defaultValue: "-1" }, - _posinset: { type: Integer }, - _setsize: { type: Integer }, - _contentId: { type: String, defaultValue: " " }, - _labelledbyControls: { type: String, defaultValue: " " }, - _isIconColorRead: { type: Boolean }, + _getTabContainerHeaderItemCallback: { + type: Function, + }, }, events: /** @lends sap.ui.webcomponents.main.Tab.prototype */ { @@ -143,6 +135,16 @@ class Tab extends TabBase { super.define(...params); } + + getFocusDomRef() { + let focusedDomRef = super.getFocusDomRef(); + + if (this._getTabContainerHeaderItemCallback) { + focusedDomRef = this._getTabContainerHeaderItemCallback(); + } + + return focusedDomRef; + } } Bootstrap.boot().then(_ => { diff --git a/packages/main/src/TabBase.js b/packages/main/src/TabBase.js index db9d8cc205a5..e5c754d07401 100644 --- a/packages/main/src/TabBase.js +++ b/packages/main/src/TabBase.js @@ -24,6 +24,10 @@ class TabBase extends WebComponent { static get metadata() { return metadata; } + + isSeparator() { + return false; + } } export default TabBase; diff --git a/packages/main/src/TabContainer.hbs b/packages/main/src/TabContainer.hbs index c2fb33fca126..bc50ec27da80 100644 --- a/packages/main/src/TabContainer.hbs +++ b/packages/main/src/TabContainer.hbs @@ -1,155 +1,146 @@
controlData}} class="{{classes.main}}"> -
- -
-
- {{#each ctr._headerItems}} - {{#if isSeparator}} - {{> renderTabSeparator}} - {{else}} - {{> renderTab}} +
+ + + +
+
    + {{#each renderItems}} + {{#unless this.isSeparator}} + + {{/unless}} + {{#if this.isSeparator}} + {{/if}} {{/each}} -
+
- + + + + {{#if ctr.showOverflow}} - + {{/if}}
-
-
- {{#each ctr._selectedContent}} - - {{/each}} -
+ + +
+ {{#each renderItems}} + {{#unless this.isSeparator}} +
+ +
+ {{/unless}} + {{/each}}
- {{#if ctr.showOverflow}} - - - {{#each ctr._overflowList.items}} - -
- {{#if this.content.icon}} - + + + + + {{#each renderItems}} + {{#unless this.isSeparator}} + +
+ {{#if this.item.icon}} + {{/if}} - {{#unless this.content._isNoText}} - {{this.content.displayText}} - {{/unless}} - {{#if this.content.isIconColorRead}} - + + {{this.item.text}} + + {{#if this.item.additionalText}} + ({{this.item.additionalText}}) {{/if}}
- {{/each}} -
-
- {{/if}} + {{/unless}}s + {{/each}} + +
-{{#*inline "renderTab"}} -