@sapudex/web-components 2.16.1 → 2.17.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/cypress/specs/AccordionItem.cy.tsx +18 -1
- package/cypress/specs/EventRibbon.cy.tsx +11 -1
- package/cypress/specs/Quote.cy.tsx +2 -2
- package/cypress/specs/SecondaryNavigationDesktop.cy.tsx +2 -2
- package/cypress/specs/Switch.cy.tsx +13 -1
- package/dist/AccordionItem.d.ts +4 -0
- package/dist/AccordionItem.js +16 -1
- package/dist/AccordionItem.js.map +1 -1
- package/dist/AssetsVariables.js +13 -0
- package/dist/AssetsVariables.js.map +1 -1
- package/dist/AvatarGroup.d.ts +2 -0
- package/dist/AvatarGroup.js +16 -8
- package/dist/AvatarGroup.js.map +1 -1
- package/dist/Breadcrumbs.d.ts +2 -1
- package/dist/Breadcrumbs.js +5 -2
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/BreadcrumbsPopoverTemplate.js +1 -1
- package/dist/BreadcrumbsPopoverTemplate.js.map +1 -1
- package/dist/BreadcrumbsTemplate.js +1 -1
- package/dist/BreadcrumbsTemplate.js.map +1 -1
- package/dist/EventRibbonTemplate.js +2 -2
- package/dist/EventRibbonTemplate.js.map +1 -1
- package/dist/Footer.d.ts +1 -0
- package/dist/Footer.js +4 -1
- package/dist/Footer.js.map +1 -1
- package/dist/FooterTemplate.js +1 -1
- package/dist/FooterTemplate.js.map +1 -1
- package/dist/MastheadShell.js +2 -1
- package/dist/MastheadShell.js.map +1 -1
- package/dist/Quote.d.ts +1 -0
- package/dist/Quote.js +6 -4
- package/dist/Quote.js.map +1 -1
- package/dist/QuoteTemplate.d.ts +2 -0
- package/dist/QuoteTemplate.js +9 -0
- package/dist/QuoteTemplate.js.map +1 -0
- package/dist/Search.d.ts +0 -1
- package/dist/Search.js +0 -13
- package/dist/Search.js.map +1 -1
- package/dist/Switch.d.ts +1 -0
- package/dist/Switch.js +7 -0
- package/dist/Switch.js.map +1 -1
- package/dist/SwitchTemplate.js +1 -1
- package/dist/SwitchTemplate.js.map +1 -1
- package/dist/Tag.js +3 -3
- package/dist/Tag.js.map +1 -1
- package/dist/TagGroup.d.ts +0 -2
- package/dist/TagGroup.js +3 -9
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroupTemplate.d.ts +2 -0
- package/dist/TagGroupTemplate.js +12 -0
- package/dist/TagGroupTemplate.js.map +1 -0
- package/dist/TagTemplate.d.ts +2 -0
- package/dist/TagTemplate.js +18 -0
- package/dist/TagTemplate.js.map +1 -0
- package/dist/assets/{InputSuggestions-C-OeoyHk.js → InputSuggestions-Bxc8oM64.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-D05JXl_S.js → ListItemStandardExpandableTextTemplate-DUnH9BGH.js} +1 -1
- package/dist/assets/{bundle.esm-jB2aQPid.js → bundle.esm-qoZLPRl7.js} +248 -235
- package/dist/assets/messagebundle_ar-BNhVFt1-.js +1 -0
- package/dist/assets/messagebundle_bg-4X593TQq.js +1 -0
- package/dist/assets/messagebundle_cs-Bt8XtMib.js +1 -0
- package/dist/assets/messagebundle_da-BB7OtRY9.js +1 -0
- package/dist/assets/messagebundle_de-NtViQTfJ.js +1 -0
- package/dist/assets/messagebundle_el-BZAAedlK.js +1 -0
- package/dist/assets/messagebundle_en-D6cJIiUq.js +1 -0
- package/dist/assets/messagebundle_es-CO-oJIBU.js +1 -0
- package/dist/assets/messagebundle_et-BCYOcg2t.js +1 -0
- package/dist/assets/messagebundle_fi-CssCIjmp.js +1 -0
- package/dist/assets/messagebundle_fr-CvOyuAVw.js +1 -0
- package/dist/assets/messagebundle_hr-CashhWbN.js +1 -0
- package/dist/assets/messagebundle_hu-BEMbu-EE.js +1 -0
- package/dist/assets/messagebundle_it-BhrBdOd4.js +1 -0
- package/dist/assets/messagebundle_iw-CzJjIyB1.js +1 -0
- package/dist/assets/messagebundle_ja-5P5L7sQ1.js +1 -0
- package/dist/assets/messagebundle_ko-B9H5YQlC.js +1 -0
- package/dist/assets/messagebundle_lt-BJ5gr_LF.js +1 -0
- package/dist/assets/messagebundle_lv-BHId5zho.js +1 -0
- package/dist/assets/messagebundle_nl-etaldyfo.js +1 -0
- package/dist/assets/messagebundle_no-BIUfmTWJ.js +1 -0
- package/dist/assets/messagebundle_pl-BmaELnDD.js +1 -0
- package/dist/assets/messagebundle_pt-DPeE7NbC.js +1 -0
- package/dist/assets/messagebundle_pt_PT-DcVh6BH6.js +1 -0
- package/dist/assets/messagebundle_ro-CN4kAAYE.js +1 -0
- package/dist/assets/messagebundle_ru-BT7zyn7i.js +1 -0
- package/dist/assets/messagebundle_sk-gmWb_4Wo.js +1 -0
- package/dist/assets/messagebundle_sl-B4p3OqyZ.js +1 -0
- package/dist/assets/messagebundle_sr-D8Lxl5cz.js +1 -0
- package/dist/assets/messagebundle_sv-DZNyuq7Z.js +1 -0
- package/dist/assets/messagebundle_tr-9FvYSV7d.js +1 -0
- package/dist/assets/messagebundle_uk-BgTRxken.js +1 -0
- package/dist/assets/messagebundle_zh_CN-BsCxQ-NE.js +1 -0
- package/dist/assets/messagebundle_zh_TW-Li9m-Dgo.js +1 -0
- package/dist/css/themes/DatePickerPopover.css +1 -1
- package/dist/css/themes/EventRibbon.css +1 -1
- package/dist/css/themes/Footer.css +1 -1
- package/dist/css/themes/Quote.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +2 -1
- package/dist/generated/i18n/i18n-defaults.js +2 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/json-imports/i18n-fetch.js +4 -0
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -1
- package/dist/generated/json-imports/i18n-node.js +4 -0
- package/dist/generated/json-imports/i18n-node.js.map +1 -1
- package/dist/generated/json-imports/i18n.js +4 -0
- package/dist/generated/json-imports/i18n.js.map +1 -1
- package/dist/generated/templates/SearchTemplate.lit.js +1 -1
- package/dist/generated/templates/SearchTemplate.lit.js.map +1 -1
- package/dist/generated/themes/DatePickerPopover.css.d.ts +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js +1 -1
- package/dist/generated/themes/DatePickerPopover.css.js.map +1 -1
- package/dist/generated/themes/EventRibbon.css.d.ts +1 -1
- package/dist/generated/themes/EventRibbon.css.js +1 -1
- package/dist/generated/themes/EventRibbon.css.js.map +1 -1
- package/dist/generated/themes/Footer.css.d.ts +1 -1
- package/dist/generated/themes/Footer.css.js +1 -1
- package/dist/generated/themes/Footer.css.js.map +1 -1
- package/dist/generated/themes/Quote.css.d.ts +1 -1
- package/dist/generated/themes/Quote.css.js +1 -1
- package/dist/generated/themes/Quote.css.js.map +1 -1
- package/dist/generated/themes/RatingIndicator.css.d.ts +1 -1
- package/dist/generated/themes/RatingIndicator.css.js +1 -1
- package/dist/generated/themes/RatingIndicator.css.js.map +1 -1
- package/dist/generated/themes/Slider.css.d.ts +1 -1
- package/dist/generated/themes/Slider.css.js +1 -1
- package/dist/generated/themes/Slider.css.js.map +1 -1
- package/dist/messagebundle.properties +1 -0
- package/dist/messagebundle_ar.properties +1 -0
- package/dist/messagebundle_bg.properties +1 -0
- package/dist/messagebundle_cs.properties +1 -0
- package/dist/messagebundle_da.properties +1 -0
- package/dist/messagebundle_de.properties +1 -0
- package/dist/messagebundle_el.properties +1 -0
- package/dist/messagebundle_en.properties +1 -0
- package/dist/messagebundle_es.properties +1 -0
- package/dist/messagebundle_et.properties +1 -0
- package/dist/messagebundle_fi.properties +1 -0
- package/dist/messagebundle_fr.properties +1 -0
- package/dist/messagebundle_hr.properties +1 -0
- package/dist/messagebundle_hu.properties +1 -0
- package/dist/messagebundle_it.properties +1 -0
- package/dist/messagebundle_iw.properties +1 -0
- package/dist/messagebundle_ja.properties +5 -0
- package/dist/messagebundle_ko.properties +1 -0
- package/dist/messagebundle_lt.properties +1 -0
- package/dist/messagebundle_lv.properties +1 -0
- package/dist/messagebundle_nl.properties +1 -0
- package/dist/messagebundle_no.properties +2 -0
- package/dist/messagebundle_pl.properties +1 -0
- package/dist/messagebundle_pt.properties +5 -3
- package/dist/messagebundle_pt_PT.properties +7 -0
- package/dist/messagebundle_ro.properties +1 -0
- package/dist/messagebundle_ru.properties +1 -0
- package/dist/messagebundle_sk.properties +1 -0
- package/dist/messagebundle_sl.properties +1 -0
- package/dist/messagebundle_sr.properties +1 -0
- package/dist/messagebundle_sv.properties +1 -0
- package/dist/messagebundle_tr.properties +1 -0
- package/dist/messagebundle_uk.properties +1 -0
- package/dist/messagebundle_zh_CN.properties +1 -0
- package/dist/messagebundle_zh_TW.properties +1 -0
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
- package/src/AccordionItem.ts +21 -1
- package/src/AssetsVariables.ts +13 -0
- package/src/AvatarGroup.ts +21 -11
- package/src/Breadcrumbs.ts +10 -2
- package/src/BreadcrumbsPopoverTemplate.tsx +1 -0
- package/src/BreadcrumbsTemplate.tsx +2 -2
- package/src/EventRibbonTemplate.tsx +2 -1
- package/src/Footer.ts +5 -0
- package/src/FooterTemplate.tsx +35 -33
- package/src/MastheadShell.ts +2 -1
- package/src/Quote.ts +7 -5
- package/src/QuoteTemplate.tsx +29 -0
- package/src/Search.hbs +1 -1
- package/src/Search.ts +0 -14
- package/src/Switch.ts +8 -0
- package/src/SwitchTemplate.tsx +2 -1
- package/src/Tag.ts +3 -3
- package/src/TagGroup.ts +3 -11
- package/src/TagGroupTemplate.tsx +75 -0
- package/src/TagTemplate.tsx +79 -0
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/json-imports/i18n-fetch.ts +4 -0
- package/src/generated/json-imports/i18n-node.ts +4 -0
- package/src/generated/json-imports/i18n.ts +4 -0
- package/src/generated/templates/SearchTemplate.lit.ts +1 -1
- package/src/generated/themes/DatePickerPopover.css.ts +1 -1
- package/src/generated/themes/EventRibbon.css.ts +1 -1
- package/src/generated/themes/Footer.css.ts +1 -1
- package/src/generated/themes/Quote.css.ts +1 -1
- package/src/generated/themes/RatingIndicator.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/i18n/messagebundle.properties +1 -0
- package/src/i18n/messagebundle_ar.properties +1 -0
- package/src/i18n/messagebundle_bg.properties +1 -0
- package/src/i18n/messagebundle_cs.properties +1 -0
- package/src/i18n/messagebundle_da.properties +1 -0
- package/src/i18n/messagebundle_de.properties +1 -0
- package/src/i18n/messagebundle_el.properties +1 -0
- package/src/i18n/messagebundle_en.properties +1 -0
- package/src/i18n/messagebundle_es.properties +1 -0
- package/src/i18n/messagebundle_et.properties +1 -0
- package/src/i18n/messagebundle_fi.properties +1 -0
- package/src/i18n/messagebundle_fr.properties +1 -0
- package/src/i18n/messagebundle_hr.properties +1 -0
- package/src/i18n/messagebundle_hu.properties +1 -0
- package/src/i18n/messagebundle_it.properties +1 -0
- package/src/i18n/messagebundle_iw.properties +1 -0
- package/src/i18n/messagebundle_ja.properties +5 -0
- package/src/i18n/messagebundle_ko.properties +1 -0
- package/src/i18n/messagebundle_lt.properties +1 -0
- package/src/i18n/messagebundle_lv.properties +1 -0
- package/src/i18n/messagebundle_nl.properties +1 -0
- package/src/i18n/messagebundle_no.properties +2 -0
- package/src/i18n/messagebundle_pl.properties +1 -0
- package/src/i18n/messagebundle_pt.properties +5 -3
- package/src/i18n/messagebundle_pt_PT.properties +7 -0
- package/src/i18n/messagebundle_ro.properties +1 -0
- package/src/i18n/messagebundle_ru.properties +1 -0
- package/src/i18n/messagebundle_sk.properties +1 -0
- package/src/i18n/messagebundle_sl.properties +1 -0
- package/src/i18n/messagebundle_sr.properties +1 -0
- package/src/i18n/messagebundle_sv.properties +1 -0
- package/src/i18n/messagebundle_tr.properties +1 -0
- package/src/i18n/messagebundle_uk.properties +1 -0
- package/src/i18n/messagebundle_zh_CN.properties +1 -0
- package/src/i18n/messagebundle_zh_TW.properties +1 -0
- package/src/themes/DatePickerPopover.css +5 -0
- package/src/themes/EventRibbon.css +4 -0
- package/src/themes/Footer.css +3 -0
- package/src/themes/Quote.css +38 -33
- package/dist/assets/messagebundle_ar-C39XMRa3.js +0 -1
- package/dist/assets/messagebundle_bg-CFuqxDUo.js +0 -1
- package/dist/assets/messagebundle_cs-HZFdxP5k.js +0 -1
- package/dist/assets/messagebundle_da-Cb19y_UU.js +0 -1
- package/dist/assets/messagebundle_de-BPtfcnG8.js +0 -1
- package/dist/assets/messagebundle_el-BfR2BVvB.js +0 -1
- package/dist/assets/messagebundle_en-PmkE-Vht.js +0 -1
- package/dist/assets/messagebundle_es-DEz3xznF.js +0 -1
- package/dist/assets/messagebundle_et-BHSda64J.js +0 -1
- package/dist/assets/messagebundle_fi-DTkxmWJb.js +0 -1
- package/dist/assets/messagebundle_fr-BEq1Nxlj.js +0 -1
- package/dist/assets/messagebundle_hr-BzWPMYA7.js +0 -1
- package/dist/assets/messagebundle_hu-DQvndOA8.js +0 -1
- package/dist/assets/messagebundle_it-Bx7wA4HY.js +0 -1
- package/dist/assets/messagebundle_iw-L2hZONxh.js +0 -1
- package/dist/assets/messagebundle_ko-D4ckbm7i.js +0 -1
- package/dist/assets/messagebundle_lt-BriAnQM8.js +0 -1
- package/dist/assets/messagebundle_lv-Di1Ng3Tk.js +0 -1
- package/dist/assets/messagebundle_nl-Bhq20VT1.js +0 -1
- package/dist/assets/messagebundle_no-bTeyeWYl.js +0 -1
- package/dist/assets/messagebundle_pl-BnBUJpAL.js +0 -1
- package/dist/assets/messagebundle_pt-Cd_ey78V.js +0 -1
- package/dist/assets/messagebundle_ro-Cy-zHe5i.js +0 -1
- package/dist/assets/messagebundle_ru-CiDd56L1.js +0 -1
- package/dist/assets/messagebundle_sk-DJS6mahY.js +0 -1
- package/dist/assets/messagebundle_sl-BUi3OLzP.js +0 -1
- package/dist/assets/messagebundle_sr-BtodsTa0.js +0 -1
- package/dist/assets/messagebundle_sv-CVVuFZcm.js +0 -1
- package/dist/assets/messagebundle_tr-CqVlQ8yY.js +0 -1
- package/dist/assets/messagebundle_uk-aDyDoabO.js +0 -1
- package/dist/assets/messagebundle_zh_CN-CTb6-Dhs.js +0 -1
- package/dist/assets/messagebundle_zh_TW-DtT5REQh.js +0 -1
- package/dist/generated/templates/QuoteTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/QuoteTemplate.lit.js +0 -10
- package/dist/generated/templates/QuoteTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TagGroupTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TagGroupTemplate.lit.js +0 -10
- package/dist/generated/templates/TagGroupTemplate.lit.js.map +0 -1
- package/dist/generated/templates/TagTemplate.lit.d.ts +0 -3
- package/dist/generated/templates/TagTemplate.lit.js +0 -19
- package/dist/generated/templates/TagTemplate.lit.js.map +0 -1
- package/dist/messagebundle_pt_BR.properties +0 -4
- package/src/Quote.hbs +0 -20
- package/src/Tag.hbs +0 -76
- package/src/TagGroup.hbs +0 -57
- package/src/generated/templates/QuoteTemplate.lit.ts +0 -14
- package/src/generated/templates/TagGroupTemplate.lit.ts +0 -14
- package/src/generated/templates/TagTemplate.lit.ts +0 -23
- package/src/i18n/messagebundle_pt_BR.properties +0 -4
package/src/AvatarGroup.ts
CHANGED
|
@@ -3,6 +3,7 @@ import AvatarGroup from "@ui5/webcomponents/dist/AvatarGroup.js";
|
|
|
3
3
|
import AvatarGroupType from "@ui5/webcomponents/dist/types/AvatarGroupType.js";
|
|
4
4
|
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
|
|
5
5
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
6
|
+
import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js";
|
|
6
7
|
import jsxRenderer from "@ui5/webcomponents-base/dist/renderer/JsxRenderer.js";
|
|
7
8
|
|
|
8
9
|
// Styles
|
|
@@ -61,22 +62,14 @@ const avatarOffsets = {
|
|
|
61
62
|
class UDExAvatarGroup extends AvatarGroup {
|
|
62
63
|
constructor() {
|
|
63
64
|
super();
|
|
64
|
-
|
|
65
|
-
this._itemNavigation = new ItemNavigation(this, {
|
|
66
|
-
getItemsCallback: () => {
|
|
67
|
-
return this._isIndividual
|
|
68
|
-
? this.items.slice(0, this._hiddenStartIndex).map(
|
|
69
|
-
item => item.shadowRoot?.firstElementChild as IAvatarGroupItem,
|
|
70
|
-
)
|
|
71
|
-
: [];
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
65
|
}
|
|
66
|
+
|
|
75
67
|
onEnterDOM(): void {
|
|
76
68
|
super.onEnterDOM();
|
|
77
69
|
const container: HTMLElement = this.shadowRoot?.querySelector(".ui5-avatar-group-items") as HTMLElement;
|
|
78
70
|
container?.addEventListener("mouseenter", this._onHover.bind(this, true));
|
|
79
71
|
container?.addEventListener("mouseleave", this._onHover.bind(this, false));
|
|
72
|
+
this._initializeItemNavigation();
|
|
80
73
|
}
|
|
81
74
|
|
|
82
75
|
onExitDOM(): void {
|
|
@@ -86,6 +79,19 @@ class UDExAvatarGroup extends AvatarGroup {
|
|
|
86
79
|
container?.removeEventListener("mouseleave", this._onHover.bind(this, false));
|
|
87
80
|
}
|
|
88
81
|
|
|
82
|
+
async _initializeItemNavigation() {
|
|
83
|
+
await renderFinished();
|
|
84
|
+
this._itemNavigation = new ItemNavigation(this, {
|
|
85
|
+
getItemsCallback: () => {
|
|
86
|
+
return this._isIndividual
|
|
87
|
+
? this.items.slice(0, this._hiddenStartIndex).map(
|
|
88
|
+
item => item.shadowRoot?.firstElementChild as IAvatarGroupItem,
|
|
89
|
+
)
|
|
90
|
+
: [];
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
89
95
|
_onHover(hover: boolean) {
|
|
90
96
|
if (this._isGroup) {
|
|
91
97
|
this.items.every(avatar => {
|
|
@@ -102,6 +108,10 @@ class UDExAvatarGroup extends AvatarGroup {
|
|
|
102
108
|
this._itemNavigation.setCurrentItem(targetItem as IAvatarGroupItem);
|
|
103
109
|
}
|
|
104
110
|
|
|
111
|
+
_isValidSize(size: string): boolean {
|
|
112
|
+
return Object.values(UDExAvatarSize).includes(size as UDExAvatarSize);
|
|
113
|
+
}
|
|
114
|
+
|
|
105
115
|
_prepareAvatars() {
|
|
106
116
|
this._colorIndex = 0;
|
|
107
117
|
const visibleColors = Object.values(UDExAvatarColorScheme);
|
|
@@ -118,7 +128,7 @@ class UDExAvatarGroup extends AvatarGroup {
|
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
if (index !== this._itemsCount - 1 || this._customOverflowButton) {
|
|
121
|
-
const avatarSize = avatar.effectiveSize
|
|
131
|
+
const avatarSize = this._isValidSize(avatar.effectiveSize) ? avatar.effectiveSize : UDExAvatarSize.S;
|
|
122
132
|
avatar.style.marginInlineEnd = avatarOffsets[avatarSize][this.type];
|
|
123
133
|
}
|
|
124
134
|
});
|
package/src/Breadcrumbs.ts
CHANGED
|
@@ -18,7 +18,11 @@ import BreadcrumbsTemplate from "./BreadcrumbsTemplate.js";
|
|
|
18
18
|
import UDExBreadcrumbsItem from "./BreadcrumbsItem.js";
|
|
19
19
|
import UDExDropdown from "./Dropdown.js";
|
|
20
20
|
import UDExLink from "./Link.js";
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
AVAILABLE_VALUES,
|
|
23
|
+
BREADCRUMBS_ARIA_LABEL,
|
|
24
|
+
BREADCRUMBS_OVERFLOW_ARIA_LABEL,
|
|
25
|
+
} from "./generated/i18n/i18n-defaults.js";
|
|
22
26
|
|
|
23
27
|
// Styles
|
|
24
28
|
import BreadcrumbsCss from "./generated/themes/Breadcrumbs.css.js";
|
|
@@ -312,13 +316,17 @@ class UDExBreadcrumbs extends UI5Element {
|
|
|
312
316
|
return this._dropdownOpened ? `${rootClass} ${rootClass}__trigger--opened` : rootClass;
|
|
313
317
|
}
|
|
314
318
|
|
|
315
|
-
get
|
|
319
|
+
get _breadcrumbsAccessibleNameText(): string {
|
|
316
320
|
return UDExBreadcrumbs.i18nBundle.getText(BREADCRUMBS_ARIA_LABEL);
|
|
317
321
|
}
|
|
318
322
|
|
|
319
323
|
get _dropdownArrowAccessibleNameText(): string {
|
|
320
324
|
return UDExBreadcrumbs.i18nBundle.getText(BREADCRUMBS_OVERFLOW_ARIA_LABEL);
|
|
321
325
|
}
|
|
326
|
+
|
|
327
|
+
get _dropdownAccessibleNameText(): string {
|
|
328
|
+
return UDExBreadcrumbs.i18nBundle.getText(AVAILABLE_VALUES);
|
|
329
|
+
}
|
|
322
330
|
}
|
|
323
331
|
|
|
324
332
|
UDExBreadcrumbs.define();
|
|
@@ -9,6 +9,7 @@ export default function BreadcrumbsPopoverTemplate(this: Breadcrumbs) {
|
|
|
9
9
|
id={`udex-${this._id}-breadcrumbs__popover`}
|
|
10
10
|
opener={`udex-${this._id}-breadcrumbs__opener`}
|
|
11
11
|
class={`${this._rootClass}__popover ui5-breadcrumbs-popover`}
|
|
12
|
+
accessibleName={this._dropdownAccessibleNameText}
|
|
12
13
|
placement={Placement.Bottom}
|
|
13
14
|
horizontalAlign={HorizontalAlign.Start}
|
|
14
15
|
onKeyDown={this._handleKeydown}
|
|
@@ -11,14 +11,14 @@ export default function BreadcrumbsTemplate(this: Breadcrumbs) {
|
|
|
11
11
|
<>
|
|
12
12
|
<nav
|
|
13
13
|
class={`${this._rootClass} ui5-breadcrumbs-root`}
|
|
14
|
-
aria-label={this.
|
|
14
|
+
aria-label={this._breadcrumbsAccessibleNameText}>
|
|
15
15
|
<ol onFocusIn={this._onfocusin}>
|
|
16
16
|
<li class={`${this._rootClass}__arrow-wrapper ui5-breadcrumbs-dropdown-arrow-link-wrapper`}>
|
|
17
17
|
<UDExLink
|
|
18
18
|
id={`udex-${this._id}-breadcrumbs__opener`}
|
|
19
19
|
class={`${this._rootClass}__trigger ${this._triggerClass}`}
|
|
20
20
|
onClick={this._toggleDropdown}
|
|
21
|
-
|
|
21
|
+
accessibleName={this._dropdownArrowAccessibleNameText}
|
|
22
22
|
accessibleRole={UDExButtonAccessibleRole.Button}
|
|
23
23
|
icon={slimArrowDown}
|
|
24
24
|
aria-haspopup="true">
|
|
@@ -8,7 +8,7 @@ export default function EventRibbonTemplate(this: UDExEventRibbon) {
|
|
|
8
8
|
return (
|
|
9
9
|
<a
|
|
10
10
|
onKeyDown={this.handleKeyDown}
|
|
11
|
-
aria-labelledby={`${this.eventText ? `${this._id}-text` : ""} ${this._id}-link-text`}
|
|
11
|
+
aria-labelledby={`${this._id}__logo-alt ${this.eventText ? `${this._id}-text` : ""} ${this._id}-link-text`}
|
|
12
12
|
class={{
|
|
13
13
|
[`${rootClass}__container`]: true,
|
|
14
14
|
[`${rootClass}__container-with-background-image`]: this.backgroundImage
|
|
@@ -17,6 +17,7 @@ export default function EventRibbonTemplate(this: UDExEventRibbon) {
|
|
|
17
17
|
href={url}>
|
|
18
18
|
<div class={`${rootClass}__logo`}>
|
|
19
19
|
<img class={`${logoClass}`} src={this.eventLogoPath} alt={this.eventLogoAlt}/>
|
|
20
|
+
<span id={`${this._id}__logo-alt`} class="hidden-text">{this.eventLogoAlt}</span>
|
|
20
21
|
</div>
|
|
21
22
|
{this.eventText && <p class={`${rootClass}__text`} id={`${this._id}-text`}>{this.eventText}</p>}
|
|
22
23
|
<div class={`${rootClass}__link-container`}>
|
package/src/Footer.ts
CHANGED
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
COPYRIGHT,
|
|
36
36
|
PUBLIC_SECURITY_NETWORK_NUMBER,
|
|
37
37
|
ICP_NUMBER,
|
|
38
|
+
BACK_TO_TOP,
|
|
38
39
|
} from "./generated/i18n/i18n-defaults.js";
|
|
39
40
|
|
|
40
41
|
// Styles
|
|
@@ -561,6 +562,10 @@ class UDExFooter extends UI5Element {
|
|
|
561
562
|
return this.isChineseLang && this.chineseLogoUrl ? `${root}-chinese` : root;
|
|
562
563
|
}
|
|
563
564
|
|
|
565
|
+
get backToTopTitle(): string {
|
|
566
|
+
return UDExFooter.i18nBundle.getText(BACK_TO_TOP);
|
|
567
|
+
}
|
|
568
|
+
|
|
564
569
|
_onLogoClick(e: MouseEvent): void {
|
|
565
570
|
this.fireFooterBaseEvent(e, "logo-click");
|
|
566
571
|
}
|
package/src/FooterTemplate.tsx
CHANGED
|
@@ -160,49 +160,51 @@ export default function FooterTemplate(this: Footer) {
|
|
|
160
160
|
)}
|
|
161
161
|
|
|
162
162
|
<UDExDivider class={`${rootClass}__divider`}></UDExDivider>
|
|
163
|
-
</div>
|
|
164
163
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
164
|
+
<div className={`${rootClass}__copyright`}>
|
|
165
|
+
{this.isChineseLang && (
|
|
166
|
+
<span className={`${rootClass}__copyright-chinese-text`}>
|
|
167
|
+
<a
|
|
168
|
+
href={this.chineseIcpNumberLink}
|
|
169
|
+
title={this.chineseICPNumber}
|
|
170
|
+
className={`${rootClass}__copyright-chinese-link`}
|
|
171
|
+
target="_blank"
|
|
172
|
+
rel="noopener noreferrer">
|
|
173
|
+
{this.chineseICPNumber}
|
|
174
|
+
</a>
|
|
175
|
+
{this.chineseSecurityNetworkNumber}
|
|
176
|
+
</span>
|
|
177
|
+
)}
|
|
178
|
+
<span className={`${rootClass}__copyright-text`}>{this.copyrightText}</span>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
{this.socialLinksArray.length > 0 && (
|
|
182
|
+
<ul className={`${rootClass}__social-container`}>
|
|
183
|
+
{this.socialLinksArray.map((social, index) => (
|
|
184
|
+
<UDExSocialMediaButton
|
|
185
|
+
{...{ role: "listitem" }}
|
|
186
|
+
key={index}
|
|
187
|
+
type={social.name}
|
|
188
|
+
url={social.url}
|
|
189
|
+
target={social.target}
|
|
190
|
+
accessible-name={social.accessibleName}
|
|
191
|
+
data-name={social.name}
|
|
192
|
+
data-id={social.id}
|
|
193
|
+
onui5-click={this._onSocialMediaLinkClick}>
|
|
194
|
+
</UDExSocialMediaButton>
|
|
195
|
+
))}
|
|
196
|
+
</ul>
|
|
178
197
|
)}
|
|
179
|
-
<span className={`${rootClass}__copyright-text`}>{this.copyrightText}</span>
|
|
180
198
|
</div>
|
|
181
199
|
|
|
182
|
-
{this.socialLinksArray.length > 0 && (
|
|
183
|
-
<div className={`${rootClass}__social-container`}>
|
|
184
|
-
{this.socialLinksArray.map((social, index) => (
|
|
185
|
-
<UDExSocialMediaButton
|
|
186
|
-
key={index}
|
|
187
|
-
type={social.name}
|
|
188
|
-
url={social.url}
|
|
189
|
-
target={social.target}
|
|
190
|
-
accessible-name={social.accessibleName}
|
|
191
|
-
data-name={social.name}
|
|
192
|
-
data-id={social.id}
|
|
193
|
-
onui5-click={this._onSocialMediaLinkClick}>
|
|
194
|
-
</UDExSocialMediaButton>
|
|
195
|
-
))}
|
|
196
|
-
</div>
|
|
197
|
-
)}
|
|
198
|
-
|
|
199
200
|
<UDExButton
|
|
200
201
|
class={`${rootClass}__back-to-top-button`}
|
|
201
202
|
icon={backToTop}
|
|
202
203
|
onClick={this.onBackToTopClick}
|
|
203
204
|
design={UDExButtonDesign.Tertiary}
|
|
204
205
|
size={UDExButtonSize.Large}
|
|
205
|
-
|
|
206
|
+
tooltip={this.backToTopTitle}
|
|
207
|
+
accessibleName={this.backToTopTitle}>
|
|
206
208
|
</UDExButton>
|
|
207
209
|
</footer>
|
|
208
210
|
);
|
package/src/MastheadShell.ts
CHANGED
|
@@ -859,7 +859,8 @@ class UDExMastheadShell extends UI5Element {
|
|
|
859
859
|
|
|
860
860
|
setMobileMenuHeight(): void {
|
|
861
861
|
const mastheadHeight = parseInt(window.getComputedStyle(this).getPropertyValue(UDExMastheadVariable.mastheadHeight));
|
|
862
|
-
const
|
|
862
|
+
const rectTop = this.getBoundingClientRect().top;
|
|
863
|
+
const mobileMenuHeight = `${window.innerHeight - mastheadHeight - rectTop}px`;
|
|
863
864
|
this.style.setProperty(UDExMastheadVariable.mobileMenuHeight, mobileMenuHeight);
|
|
864
865
|
}
|
|
865
866
|
|
package/src/Quote.ts
CHANGED
|
@@ -2,10 +2,8 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
2
2
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
3
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
4
4
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
// Template
|
|
8
|
-
import QuoteTemplate from "./generated/templates/QuoteTemplate.lit.js";
|
|
5
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
6
|
+
import QuoteTemplate from "./QuoteTemplate.js";
|
|
9
7
|
|
|
10
8
|
// Styles
|
|
11
9
|
import QuoteCss from "./generated/themes/Quote.css.js";
|
|
@@ -39,7 +37,7 @@ export enum UDExImagePlacement {
|
|
|
39
37
|
*/
|
|
40
38
|
@customElement({
|
|
41
39
|
tag: "udex-quote",
|
|
42
|
-
renderer:
|
|
40
|
+
renderer: jsxRenderer,
|
|
43
41
|
styles: QuoteCss,
|
|
44
42
|
template: QuoteTemplate,
|
|
45
43
|
})
|
|
@@ -115,6 +113,10 @@ class UDExQuote extends UI5Element {
|
|
|
115
113
|
*/
|
|
116
114
|
@property()
|
|
117
115
|
imagePlacement: `${UDExImagePlacement}` = UDExImagePlacement.left;
|
|
116
|
+
|
|
117
|
+
get isImagePlacementRight(): boolean {
|
|
118
|
+
return this.imagePlacement === UDExImagePlacement.right;
|
|
119
|
+
}
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
UDExQuote.define();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type UDExQuote from "./Quote.js";
|
|
2
|
+
|
|
3
|
+
export default function QuoteTemplate(this: UDExQuote) {
|
|
4
|
+
const rootClass = "udex-quote";
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div class={`${rootClass}__container`}>
|
|
8
|
+
{this.image?.length > 0 && !this.isImagePlacementRight && imageHolder.call(this, rootClass)}
|
|
9
|
+
<div class={`${rootClass}__content-container`}>
|
|
10
|
+
<blockquote class={`${rootClass}__text-container`}>
|
|
11
|
+
<p class={`${rootClass}__text`}>
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</p>
|
|
14
|
+
</blockquote>
|
|
15
|
+
{this.author && <slot slot="author" name="author"></slot>}
|
|
16
|
+
{this.link && <slot slot="link" name="link"></slot>}
|
|
17
|
+
</div>
|
|
18
|
+
{this.image?.length > 0 && this.isImagePlacementRight && imageHolder.call(this, rootClass)}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function imageHolder(this: UDExQuote, rootClass: string) {
|
|
24
|
+
return (
|
|
25
|
+
<div class={`${rootClass}__image-container`}>
|
|
26
|
+
<slot name="image" slot="image"></slot>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
package/src/Search.hbs
CHANGED
package/src/Search.ts
CHANGED
|
@@ -931,7 +931,6 @@ class UDExSearch extends UI5Element {
|
|
|
931
931
|
prefixObserver.observe(popoverNode, { attributes: true, attributeOldValue: true });
|
|
932
932
|
}
|
|
933
933
|
|
|
934
|
-
this.handleOutsideClick();
|
|
935
934
|
this.handleOpenSuggestionPopover();
|
|
936
935
|
this.setSearchWidth();
|
|
937
936
|
}
|
|
@@ -944,19 +943,6 @@ class UDExSearch extends UI5Element {
|
|
|
944
943
|
}
|
|
945
944
|
}
|
|
946
945
|
|
|
947
|
-
handleOutsideClick(): void {
|
|
948
|
-
document.addEventListener("mousedown", (e: MouseEvent) => {
|
|
949
|
-
const popover = (e.target as HTMLElement).shadowRoot?.querySelector("[ui5-popover]");
|
|
950
|
-
if (e.target !== this && popover !== this.Suggestion?.popover) {
|
|
951
|
-
this.handleBlur();
|
|
952
|
-
this.onClosePopover();
|
|
953
|
-
if (this.isShowSearchHomePrefix) {
|
|
954
|
-
this.handleAfterClosePrefixPopover();
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
|
|
960
946
|
handleBlur(): void {
|
|
961
947
|
this._isTouched = false;
|
|
962
948
|
if (this.value) {
|
package/src/Switch.ts
CHANGED
|
@@ -5,6 +5,7 @@ import "@ui5/webcomponents/dist/Switch.js";
|
|
|
5
5
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
6
6
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
7
7
|
import { isDesktop } from "@ui5/webcomponents-base/dist/Device.js";
|
|
8
|
+
import { isEnter, isSpace } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
8
9
|
import SwitchTemplate from "./SwitchTemplate.js";
|
|
9
10
|
import Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
10
11
|
|
|
@@ -128,6 +129,13 @@ class UDExSwitch extends UI5Element {
|
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
|
|
132
|
+
handleKeyDown(e: KeyboardEvent): void {
|
|
133
|
+
if (!this.disabled && (isEnter(e) || isSpace(e))) {
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
this.handleSwitchClick();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
get switchTabIndex(): 0 | undefined {
|
|
132
140
|
return this.disabled ? undefined : 0;
|
|
133
141
|
}
|
package/src/SwitchTemplate.tsx
CHANGED
|
@@ -29,7 +29,8 @@ export default function SwitchTemplate(this: Switch) {
|
|
|
29
29
|
aria-disabled={this.disabled}
|
|
30
30
|
tabindex={this.switchTabIndex}
|
|
31
31
|
title={this.tooltip}
|
|
32
|
-
onClick={this.handleSwitchClick}
|
|
32
|
+
onClick={this.handleSwitchClick}
|
|
33
|
+
onKeyDown={this.handleKeyDown}>
|
|
33
34
|
<div class={`${rootClass}__track ${this.isActiveTrackClass}`}>
|
|
34
35
|
<div class={`${rootClass}__handle`}>
|
|
35
36
|
<UI5Icon
|
package/src/Tag.ts
CHANGED
|
@@ -2,7 +2,7 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
2
2
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
3
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
4
4
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
5
|
-
import
|
|
5
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
6
6
|
import Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
7
7
|
import type { ResizeObserverCallback } from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
8
8
|
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
@@ -10,7 +10,7 @@ import { isEnter } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
|
10
10
|
import { isDesktop } from "@ui5/webcomponents-base/dist/Device.js";
|
|
11
11
|
import UDExIconPlacement from "./types/IconPlacement.js";
|
|
12
12
|
|
|
13
|
-
import TagTemplate from "./
|
|
13
|
+
import TagTemplate from "./TagTemplate.js";
|
|
14
14
|
|
|
15
15
|
// Styles
|
|
16
16
|
import TagCss from "./generated/themes/Tag.css.js";
|
|
@@ -52,7 +52,7 @@ type UDExTagLinkClickEventDetail = {
|
|
|
52
52
|
*/
|
|
53
53
|
@customElement({
|
|
54
54
|
tag: "udex-tag",
|
|
55
|
-
renderer:
|
|
55
|
+
renderer: jsxRenderer,
|
|
56
56
|
styles: TagCss,
|
|
57
57
|
template: TagTemplate,
|
|
58
58
|
dependencies: [Icon],
|
package/src/TagGroup.ts
CHANGED
|
@@ -6,12 +6,12 @@ import { isEnter, isSpace, isEscape } from "@ui5/webcomponents-base/dist/Keys.js
|
|
|
6
6
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
7
7
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
8
8
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
9
|
-
import
|
|
9
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
10
10
|
import Token from "@ui5/webcomponents/dist/Token.js";
|
|
11
11
|
import UDExTag from "./Tag.js";
|
|
12
12
|
import UDExTooltip from "./Tooltip.js";
|
|
13
13
|
|
|
14
|
-
import TagGroupTemplate from "./
|
|
14
|
+
import TagGroupTemplate from "./TagGroupTemplate.js";
|
|
15
15
|
|
|
16
16
|
// Styles
|
|
17
17
|
import TagGroupCss from "./generated/themes/TagGroup.css.js";
|
|
@@ -48,7 +48,7 @@ type UDExTagKeydownEventDetail = {
|
|
|
48
48
|
*/
|
|
49
49
|
@customElement({
|
|
50
50
|
tag: "udex-tag-group",
|
|
51
|
-
renderer:
|
|
51
|
+
renderer: jsxRenderer,
|
|
52
52
|
styles: TagGroupCss,
|
|
53
53
|
template: TagGroupTemplate,
|
|
54
54
|
dependencies: [UDExTag, UDExTooltip, Tokenizer, Token],
|
|
@@ -160,18 +160,10 @@ class UDExTagGroup extends UI5Element {
|
|
|
160
160
|
return this.readonly || this.displayonly;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
get tagTabIndex(): string {
|
|
164
|
-
return this.disabled ? "-1" : "";
|
|
165
|
-
}
|
|
166
|
-
|
|
167
163
|
get tokenizer(): Tokenizer {
|
|
168
164
|
return this.shadowRoot!.querySelector<Tokenizer>(`#${this._id}-tag-group-tokenizer`)!;
|
|
169
165
|
}
|
|
170
166
|
|
|
171
|
-
get tagRole(): string {
|
|
172
|
-
return this.displayonly || this.readonly ? "option" : "";
|
|
173
|
-
}
|
|
174
|
-
|
|
175
167
|
onAfterRendering(): void {
|
|
176
168
|
this._tokenizer = this.tokenizer;
|
|
177
169
|
this._nMoreBtn = this._tokenizer.moreLink || null;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type UDExTagGroup from "./TagGroup.js";
|
|
2
|
+
import UDExTag from "./Tag.js";
|
|
3
|
+
import UDExTooltip from "./Tooltip.js";
|
|
4
|
+
import UI5Tokenizer from "@ui5/webcomponents/dist/Tokenizer.js";
|
|
5
|
+
|
|
6
|
+
export default function TagTemplate(this: UDExTagGroup) {
|
|
7
|
+
const rootClass = "udex-tag-group";
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<div class={`${rootClass}`}
|
|
12
|
+
id={`${this._id}-tag-group`}
|
|
13
|
+
role="group">
|
|
14
|
+
<UI5Tokenizer
|
|
15
|
+
part="tokenizer"
|
|
16
|
+
show-more
|
|
17
|
+
prevent-popover-open
|
|
18
|
+
disabled={this.disabled}
|
|
19
|
+
expanded={this.tokenizerExpanded}
|
|
20
|
+
id={`${this._id}-tag-group-tokenizer`}
|
|
21
|
+
class={`${rootClass}__tokenizer`}
|
|
22
|
+
onShowMoreItemsPress={this.showMoreItems}>
|
|
23
|
+
{this.items.map((item, index) => (
|
|
24
|
+
tag.call(this, rootClass, item, index)
|
|
25
|
+
))}
|
|
26
|
+
</UI5Tokenizer>
|
|
27
|
+
{this._isHiddenTags && (
|
|
28
|
+
<>
|
|
29
|
+
<UDExTooltip
|
|
30
|
+
id={`${this._id}-tag-group-tooltip`}
|
|
31
|
+
placement={this.tooltipPlacement}
|
|
32
|
+
onKeyDown={this.handleShowMoreButtonKeydown}>
|
|
33
|
+
<div
|
|
34
|
+
role="group"
|
|
35
|
+
class={`${rootClass}-tooltip__content`}>
|
|
36
|
+
{this.hiddenTags.map((item, index) => (
|
|
37
|
+
tag.call(this, rootClass, item, index)
|
|
38
|
+
))}
|
|
39
|
+
</div>
|
|
40
|
+
</UDExTooltip>
|
|
41
|
+
</>
|
|
42
|
+
)}
|
|
43
|
+
</div>
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function tag(this: UDExTagGroup, rootClass: string, item: any, index: number) {
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
<UDExTag
|
|
52
|
+
key={index}
|
|
53
|
+
accessibleRole="option"
|
|
54
|
+
class={`${rootClass}__tag`}
|
|
55
|
+
data-id={`${item.id}`}
|
|
56
|
+
part={`token-${index}`}
|
|
57
|
+
read-only={this.isReadOrDisplayOnly}
|
|
58
|
+
id={`${this._id}-tag-group-tag`}
|
|
59
|
+
text={item.text}
|
|
60
|
+
icon={item.icon}
|
|
61
|
+
href={item.href}
|
|
62
|
+
design={item.design}
|
|
63
|
+
size={item.size}
|
|
64
|
+
icon-placement={item.iconPlacement}
|
|
65
|
+
accessible-name={item.accessibleName}
|
|
66
|
+
non-selectable={item.nonSelectable}
|
|
67
|
+
data-overflows={item.overflows}
|
|
68
|
+
onKeyDown={this.handleTagKeyDown}
|
|
69
|
+
onSelectionChange={this.handleTagClick}
|
|
70
|
+
onIconClick={this.tagIconClickHandler}
|
|
71
|
+
{...(this.disabled ? { tabindex: -1 } : {})}>
|
|
72
|
+
</UDExTag>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type UDExTag from "./Tag.js";
|
|
2
|
+
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
3
|
+
import type { AriaRole } from "@ui5/webcomponents-base/dist/types.js";
|
|
4
|
+
|
|
5
|
+
export default function TagTemplate(this: UDExTag) {
|
|
6
|
+
const rootClass = "udex-tag";
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
this.readOnly ? (
|
|
10
|
+
<div class={this.tagClasses}>
|
|
11
|
+
<span class={`${rootClass}__text`}>{this.text}</span>
|
|
12
|
+
</div>
|
|
13
|
+
) : this.href ? (
|
|
14
|
+
<a class={this.tagClasses}
|
|
15
|
+
role={this.accessibleRole as AriaRole}
|
|
16
|
+
href={this.href}
|
|
17
|
+
onClick={this.tagLinkClickHandler}>
|
|
18
|
+
{tagContent.call(this, rootClass)}
|
|
19
|
+
</a>
|
|
20
|
+
) : this.nonSelectable ? (
|
|
21
|
+
<div class={this.tagClasses}>
|
|
22
|
+
{tagContent.call(this, rootClass, false, true)}
|
|
23
|
+
</div>
|
|
24
|
+
) : (
|
|
25
|
+
<div
|
|
26
|
+
tabindex={this._tabIndex}
|
|
27
|
+
class={this.tagClasses}
|
|
28
|
+
onClick={this.tagClickHandler}
|
|
29
|
+
onFocusIn={this._focusin}
|
|
30
|
+
onFocusOut={this._focusout}
|
|
31
|
+
onKeyDown={this.tagKeyDown}
|
|
32
|
+
role={this.accessibleRole as AriaRole}
|
|
33
|
+
aria-label={this.accessibleName}
|
|
34
|
+
aria-pressed={this.selected}>
|
|
35
|
+
{tagContent.call(this, rootClass, true)}
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function tagContent(this: UDExTag, rootClass: string, isIconClickable: boolean = false, isIconBtn: boolean = false) {
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
{this.startIcon && (
|
|
45
|
+
isIconBtn ? tagBtnIcon.call(this, rootClass, "start")
|
|
46
|
+
: tagIcon.call(this, rootClass, "start", isIconClickable))}
|
|
47
|
+
<span class={`${rootClass}__text`}>{this.text}</span>
|
|
48
|
+
{this.endIcon && (
|
|
49
|
+
isIconBtn ? tagBtnIcon.call(this, rootClass, "end")
|
|
50
|
+
: tagIcon.call(this, rootClass, "end", isIconClickable))}
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function tagBtnIcon(this: UDExTag, rootClass: string, iconType: string) {
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<button
|
|
59
|
+
class={`${rootClass}__btn-icon`}
|
|
60
|
+
onClick={this.iconClickHandler}
|
|
61
|
+
role={this.accessibleRole as AriaRole}
|
|
62
|
+
aria-label={this.iconAccessibleName}>
|
|
63
|
+
{tagIcon.call(this, rootClass, iconType)}
|
|
64
|
+
</button>
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function tagIcon(this: UDExTag, rootClass: string, iconType: string, isIconClickable: boolean = false) {
|
|
70
|
+
return (
|
|
71
|
+
<>
|
|
72
|
+
<UI5Icon
|
|
73
|
+
class={`${rootClass}__icon ${rootClass}__icon--${iconType}`}
|
|
74
|
+
name={this.icon}
|
|
75
|
+
{...(isIconClickable ? { onClick: this.iconClickHandler } : {})}>
|
|
76
|
+
</UI5Icon>
|
|
77
|
+
</>
|
|
78
|
+
);
|
|
79
|
+
}
|