Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui5-tabcontainer): show separators in overflow #4507

Merged
merged 60 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
de1ab1c
ui5-tabcontainer: introduce overflow tabs
kskondov Nov 26, 2021
2a24d59
Fixing bugs
kskondov Nov 29, 2021
84e7532
Merge remote-tracking branch 'upstream/master' into ui5-tab-container…
TeodorTaushanov Nov 30, 2021
d35e584
filter visible tab strip items
TeodorTaushanov Dec 2, 2021
65dbfcf
Merge remote-tracking branch 'upstream/master' into ui5-tab-container…
TeodorTaushanov Dec 2, 2021
0daed63
filter overflow items
TeodorTaushanov Dec 2, 2021
72464a5
fix lint error and inline mode filtering
TeodorTaushanov Dec 2, 2021
f763831
implemented "start and end" overflow
TeodorTaushanov Dec 3, 2021
1d0c28c
Merge remote-tracking branch 'upstream/master' into ui5-tab-container…
TeodorTaushanov Dec 6, 2021
17bf805
fix start and end overflow items visibility
TeodorTaushanov Dec 6, 2021
f85caa7
fix filtering corner cases
TeodorTaushanov Dec 6, 2021
fe1340c
fix test page and the overflow buttons count text
TeodorTaushanov Dec 6, 2021
05287bb
fix lint errors
TeodorTaushanov Dec 7, 2021
09dc8a9
Merge remote-tracking branch 'upstream/master' into ui5-tab-container…
TeodorTaushanov Dec 7, 2021
a4af1be
Added documentation and samples
kskondov Dec 9, 2021
88d8892
Added tests
kskondov Dec 9, 2021
0c841bb
Address review comments
kskondov Dec 10, 2021
8dc7671
Addressed code review comments
kskondov Dec 10, 2021
fc1b49b
Address review findings
kskondov Dec 13, 2021
92361a1
feat(ui5-tabcontainer): Add keyboard navigation
kskondov Dec 13, 2021
e19b30e
Fix lint error
kskondov Dec 13, 2021
3e4b70f
Added tabs and overflow buttons keyboard navigation
kskondov Dec 13, 2021
c1efc03
Added warning for deprecated property
kskondov Dec 14, 2021
e055947
Fixed lint error
kskondov Dec 14, 2021
3049dce
Initial commit
kskondov Dec 14, 2021
28a131d
Merge branch 'ui5-tab-container-overflows' of github.com:SAP/ui5-webc…
kskondov Dec 14, 2021
e097e60
Set initial focus in overflow list
kskondov Dec 14, 2021
dfb48e3
Fixed lint
kskondov Dec 14, 2021
d0f23b5
Merge branch 'ui5-tabcontainer-keyboard-handling' of github.com:SAP/u…
kskondov Dec 14, 2021
b06e12e
Merge branch 'master' of github.com:SAP/ui5-webcomponents into ui5-ta…
kskondov Dec 14, 2021
12f6215
Set focus on selected item when there are no overflows
kskondov Dec 14, 2021
36c4fb1
Fix tests
kskondov Dec 14, 2021
688bf88
add arrow keys handling, truncate the tab if it can't fit in the tab …
georgimkv Dec 17, 2021
6c57478
lint
georgimkv Dec 17, 2021
257a36f
fix test
georgimkv Dec 20, 2021
7ec9b4b
feat(ui5-tabcontainer): show separators in overflow
georgimkv Dec 20, 2021
885a6b1
rename classes, refactor
georgimkv Dec 20, 2021
832d3d8
Merge branch 'master' into tc-separators-in-overflow
kskondov Dec 20, 2021
cf30bbe
Disable separators
kskondov Dec 20, 2021
9a88841
Merge branch 'master' of github.com:SAP/ui5-webcomponents into tc-sep…
kskondov Dec 20, 2021
d930408
Merge branch 'master' into ui5-tabcontainer-keyboardhandling
georgimkv Dec 21, 2021
a7154a2
Merge branch 'master' into ui5-tabcontainer-keyboardhandling
georgimkv Dec 21, 2021
95567c6
update base hash and lint
georgimkv Dec 21, 2021
dd0ad67
Lint and style
kskondov Dec 21, 2021
80a2830
Fix tests
kskondov Dec 21, 2021
74bc827
Merge branch 'ui5-tabcontainer-keyboardhandling' of github.com:SAP/ui…
kskondov Dec 21, 2021
63329c3
Remove unused unnecessary code and review for obsolete documentation
kskondov Dec 21, 2021
3d211c7
cancel item selection in overflow list
georgimkv Dec 22, 2021
d79d392
Merge branch 'ui5-tabcontainer-keyboardhandling' of github.com:SAP/ui…
kskondov Dec 22, 2021
4a6f384
css separators
kskondov Dec 22, 2021
1586879
Merge branch 'master' of github.com:SAP/ui5-webcomponents into tc-sep…
kskondov Dec 22, 2021
8f87ae6
Fix bug with multiple separators
kskondov Dec 23, 2021
84bae16
Merge branch 'master' of github.com:SAP/ui5-webcomponents into tc-sep…
kskondov Jan 6, 2022
57fc132
Address code review
kskondov Jan 7, 2022
7375956
Code review comments
kskondov Jan 7, 2022
2982bae
Updated separator metrics according to VD spec
kskondov Jan 10, 2022
a8a1e76
Merge branch 'master' of github.com:SAP/ui5-webcomponents into tc-sep…
kskondov Jan 10, 2022
ab8313d
Update separator parameters
kskondov Jan 10, 2022
146f106
Focus on first focusable element in overflow
kskondov Jan 10, 2022
3a704cc
Updated first focusable element selection
kskondov Jan 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/main/src/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const metadata = {
},

/**
* Represents the "additionalText" text, which is displayed in the tab filter.
* Represents the "additionalText" text, which is displayed in the tab.
* @type {string}
* @defaultvalue ""
* @public
Expand Down
13 changes: 1 addition & 12 deletions packages/main/src/TabContainer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{{#if tabsAtTheBottom}}
{{> contentArea}}
{{/if}}

<div class="{{classes.header}}" id="{{_id}}-header">
<div
class="ui5-tc__overflow ui5-tc__overflow--start"
Expand Down Expand Up @@ -35,17 +34,7 @@
@keyup="{{_onTabStripKeyUp}}"
>
{{#each items}}
{{#unless this.isSeparator}}
{{this.stripPresentation}}
{{/unless}}
{{#if this.isSeparator}}
<div
id="{{this._id}}"
data-ui5-stable="{{this.stableDomRef}}"
role="separator"
class="{{../classes.separator}}"
></div>
{{/if}}
{{this.stripPresentation}}
{{/each}}
</div>

Expand Down
22 changes: 13 additions & 9 deletions packages/main/src/TabContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ const metadata = {
/**
* Defines whether the overflow select list is displayed.
* <br><br>
* The overflow select list represents a list, where all tab filters are displayed
* so that it's easier for the user to select a specific tab filter.
* The overflow select list represents a list, where all tabs are displayed
* so that it's easier for the user to select a specific tab.
*
* @type {boolean}
* @defaultvalue false
Expand Down Expand Up @@ -461,14 +461,15 @@ class TabContainer extends UI5Element {
const selectedTab = this.items[selectedIndex];

// update selected items
this._getTabs().forEach((item, index) => {
const selected = selectedIndex === index;
item.selected = selected;
this.items
.forEach((item, index) => {
const selected = selectedIndex === index;
item.selected = selected;

if (item._selected) {
item._selected = false;
}
});
if (item._selected) {
item._selected = false;
}
});

if (this.fixed) {
this.selectTab(selectedTab, selectedTabIndex);
Expand Down Expand Up @@ -586,6 +587,9 @@ class TabContainer extends UI5Element {
}

_handleResize() {
if (this.responsivePopover && this.responsivePopover.opened) {
this.responsivePopover.close();
}
this._updateMediaRange();
this._setItemsForStrip();
}
Expand Down
10 changes: 3 additions & 7 deletions packages/main/src/TabContainerPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@
<ui5-list mode="SingleSelect" separators="None" @ui5-item-click="{{_onOverflowListItemClick}}">
{{#if _endOverflowItems.length}}
{{#each _endOverflowItems}}
{{#unless this.isSeparator}}
{{this.overflowPresentation}}
{{/unless}}
{{this.overflowPresentation}}
{{/each}}
{{else }}
{{else}}
{{#each _startOverflowItems}}
{{#unless this.isSeparator}}
{{this.overflowPresentation}}
{{/unless}}
{{this.overflowPresentation}}
{{/each}}
{{/if}}
</ui5-list>
Expand Down
3 changes: 0 additions & 3 deletions packages/main/src/TabSeparator.hbs

This file was deleted.

37 changes: 34 additions & 3 deletions packages/main/src/TabSeparator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
import TabSeparatorTemplate from "./generated/templates/TabSeparatorTemplate.lit.js";
import executeTemplate from "@ui5/webcomponents-base/dist/renderer/executeTemplate.js";

import TabContainer from "./TabContainer.js";

// Templates
import TabSeparatorInStripTemplate from "./generated/templates/TabSeparatorInStripTemplate.lit.js";
import TabSeparatorInOverflowTemplate from "./generated/templates/TabSeparatorInOverflowTemplate.lit.js";

// Styles
import stripCss from "./generated/themes/TabSeparatorInStrip.css.js";
import overflowCss from "./generated/themes/TabSeparatorInOverflow.css.js";

/**
* @public
Expand Down Expand Up @@ -30,8 +40,18 @@ class TabSeparator extends UI5Element {
return litRender;
}

static get template() {
return TabSeparatorTemplate;
static get stripTemplate() {
return TabSeparatorInStripTemplate;
}

static get overflowTemplate() {
return TabSeparatorInOverflowTemplate;
}

get classes() {
return {
"ui5-tc__separator": true,
};
}

get isSeparator() {
Expand All @@ -45,8 +65,19 @@ class TabSeparator extends UI5Element {
get stableDomRef() {
return `${this._id}-stable-dom-ref`;
}

get stripPresentation() {
return executeTemplate(this.constructor.stripTemplate, this);
}

get overflowPresentation() {
return executeTemplate(this.constructor.overflowTemplate, this);
}
}

TabSeparator.define();

TabContainer.registerTabStyles(stripCss);
TabContainer.registerStaticAreaTabStyles(overflowCss);

export default TabSeparator;
8 changes: 8 additions & 0 deletions packages/main/src/TabSeparatorInOverflow.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ui5-li-custom
id="{{this._id}}"
data-ui5-stable="{{this.stableDomRef}}"
role="separator"
class="{{classes}}"
disabled
>
</ui5-li-custom>
6 changes: 6 additions & 0 deletions packages/main/src/TabSeparatorInStrip.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div
id="{{this._id}}"
data-ui5-stable="{{this.stableDomRef}}"
role="separator"
class="{{classes}}"
></div>
32 changes: 1 addition & 31 deletions packages/main/src/themes/TabContainer.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,6 @@
outline: none;
}

.ui5-tc__headerArrow {
position: absolute;
top: 0;
bottom: 1px;
z-index: 1;
display: flex;
align-items: center;
color: var(--sapContent_IconColor);
background-color: var(--sapObjectHeader_Background);
padding: 0 0.25rem;
visibility: hidden;
}

.ui5-tc__headerArrowLeft {
left: 0;
}

.ui5-tc__headerArrowRight {
right: 0;
}

.ui5-tc__headerArrow:hover,
.ui5-tc__headerArrow:active {
color: var(--sapHighlightColor);
}

.ui5-tc__headerArrow--visible {
visibility: visible;
}

.ui5-tc__overflow {
flex: 0 0 0;
margin: 0 0.25rem;
Expand Down Expand Up @@ -117,7 +87,7 @@
}

:host([tabs-placement="Bottom"]) .ui5-tc__content {
border-top: var(--_ui5_tc_content_border_bottom);
border-top: var(--_ui5_tc_content_border_bottom);
}

.ui5-tc__content--collapsed {
Expand Down
5 changes: 5 additions & 0 deletions packages/main/src/themes/TabSeparatorInOverflow.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.ui5-tc__separator {
min-height: 0.25rem;
border-bottom: 2px solid var(--sapList_BorderColor);
margin: 0.5rem 0.25rem 0.625rem;
}
4 changes: 4 additions & 0 deletions packages/main/src/themes/TabSeparatorInStrip.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.ui5-tc__separator {
border-left: 2px solid var(--sapList_BorderColor);
margin: 0.5rem 0.25rem;
}
Loading