-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tab-nav): adds optional closable functionality to individual `ta…
…b-titles` (#6740) **Related Issue:** #2620 ## Summary `handleTabTitleClose` sequence is as follows: > if `closed` item is `selected`, fall back on the next > unless it's the last item, which falls back on previous > closing non-selected items doesn't affect the `selected` tab > last remaining item becomes `disabled`, if `closable` - Added `closed` property - Added `closable` property - Added `calciteInternalTabsClose` event - Added `calciteTabsClose` event - Added t9n messages for `Close` text. - Updated styling per new Figma specs - Added tests `handleTabTitleClose` keeps track of `visibleTabTitlesIndices` instead of having Dom queries filter out `hidden`. This helps to sync `tabs` with `tab-titles` using their corresponding `id`s set on the original render. `visibleTabIndeces` is an array of `id`s of the non-hidden `tab-titles`. When `tab-title` is `closed` this `id` is used to navigate to the next visible item. This makes figuring out what the next item should be when closing out of order is now more straightforward. Tests coverage for - simple closing behavior - closing sequence behavior: > - when closing `tab-titles` in sequence 1 (first selected) through 4, `tab-title` and corresponding `tab` become hidden, and selection fallback is the next tab > - reverse fallback: when closing `tab-titles` in sequence 4 (last selected) through 1, `tab-title` and corresponding `tab` become hidden, and selection fallback is the previous tab > - closing an unselected `tab-title` does not deselect the current selection > - 2 additional cases: works with a randomized closing sequence with mixed selected and not --------- Co-authored-by: Matt Driscoll <[email protected]> Co-authored-by: JC Franco <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Anveshreddy mekala <[email protected]> Co-authored-by: jona7150 <[email protected]> Co-authored-by: Kitty Hurley <[email protected]>
- Loading branch information
1 parent
167f9f8
commit d30792d
Showing
51 changed files
with
760 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Close" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_ar.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "إغلاق" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_bg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Затваряне" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_bs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Zatvori" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_ca.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Tanca" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_cs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Zavřít" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_da.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Luk" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_de.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Schließen" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_el.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Κλείσιμο" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Close" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_es.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Cerrar" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_et.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Sule" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_fi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Sulje" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_fr.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Fermer" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_he.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "סגירה" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_hr.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Zatvori" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_hu.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Bezárás" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_id.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Tutup" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_it.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Chiudi" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_ja.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "閉じる" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_ko.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "닫기" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_lt.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Uždaryti" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_lv.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Aizvērt" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_nl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Sluiten" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_no.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Lukk" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_pl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Zamknij" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_pt-BR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Fechar" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_pt-PT.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Fechar" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_ro.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Închidere" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_ru.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Закрыть" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_sk.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Zatvoriť" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_sl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Zapri" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_sr.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Zatvori" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_sv.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Stäng" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_th.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "ปิด" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_tr.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Kapat" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_uk.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Закрити" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_vi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "Đóng" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_zh-CN.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "关闭" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_zh-HK.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "關閉" | ||
} |
3 changes: 3 additions & 0 deletions
3
src/components/tab-title/assets/tab-title/t9n/messages_zh-TW.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"close": "關閉" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
export const CSS = { | ||
closeButton: "close-button", | ||
container: "container", | ||
containerHasText: "container--has-text", | ||
content: "content", | ||
contentHasText: "content--has-text", | ||
iconEnd: "icon-end", | ||
iconStart: "icon-start", | ||
iconPresent: "icon-present", | ||
titleIcon: "calcite-tab-title--icon" | ||
}; | ||
|
||
export const ICONS = { | ||
close: "x" | ||
}; |
Oops, something went wrong.