@sapudex/web-components 2.9.0 → 2.11.0
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/bundle.esm.js +2 -0
- package/cypress/fixtures/footer-links.ts +32 -33
- package/cypress/specs/Accordion.cy.tsx +19 -0
- package/cypress/specs/AccordionItem.cy.tsx +9 -0
- package/cypress/specs/CountrySelector.cy.tsx +5 -2
- package/cypress/specs/FilterMenu.cy.tsx +884 -0
- package/cypress/specs/Footer.cy.tsx +54 -18
- package/cypress/specs/PromoTile.cy.tsx +124 -0
- package/cypress/specs/Quote.cy.tsx +65 -0
- package/cypress/specs/SocialMediaButton.cy.tsx +44 -0
- package/cypress/specs/Table.cy.tsx +8 -2
- package/cypress/specs/TextField.cy.tsx +11 -4
- package/cypress/support/component-imports.instrumented.ts +15 -1
- package/cypress/support/component-imports.src.ts +15 -1
- package/dist/Accordion.d.ts +15 -0
- package/dist/Accordion.js +19 -0
- package/dist/Accordion.js.map +1 -1
- package/dist/AccordionItem.d.ts +19 -0
- package/dist/AccordionItem.js +23 -0
- package/dist/AccordionItem.js.map +1 -1
- package/dist/AccordionItemTemplate.js +7 -2
- package/dist/AccordionItemTemplate.js.map +1 -1
- package/dist/AccordionTemplate.js +21 -1
- package/dist/AccordionTemplate.js.map +1 -1
- package/dist/Assets.d.ts +1 -0
- package/dist/Assets.js +1 -0
- package/dist/Assets.js.map +1 -1
- package/dist/CountrySelector.d.ts +2 -2
- package/dist/CountrySelector.js +6 -3
- package/dist/CountrySelector.js.map +1 -1
- package/dist/DatePicker.js +2 -2
- package/dist/DatePicker.js.map +1 -1
- package/dist/FilterMenu.d.ts +13 -2
- package/dist/FilterMenu.js +59 -13
- package/dist/FilterMenu.js.map +1 -1
- package/dist/Footer.d.ts +50 -6
- package/dist/Footer.js +44 -22
- package/dist/Footer.js.map +1 -1
- package/dist/MastheadItem.d.ts +12 -0
- package/dist/MastheadItem.js +6 -0
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadShell.d.ts +13 -3
- package/dist/MastheadShell.js +17 -4
- package/dist/MastheadShell.js.map +1 -1
- package/dist/PromoTile.d.ts +143 -0
- package/dist/PromoTile.js +198 -0
- package/dist/PromoTile.js.map +1 -0
- package/dist/PromoTileTemplate.d.ts +2 -0
- package/dist/PromoTileTemplate.js +22 -0
- package/dist/PromoTileTemplate.js.map +1 -0
- package/dist/Quote.d.ts +11 -0
- package/dist/Quote.js +18 -3
- package/dist/Quote.js.map +1 -1
- package/dist/Search.d.ts +3 -1
- package/dist/Search.js +1 -0
- package/dist/Search.js.map +1 -1
- package/dist/SelectBox.d.ts +0 -1
- package/dist/SelectBox.js +2 -2
- package/dist/SelectBox.js.map +1 -1
- package/dist/SocialMediaButton.d.ts +73 -0
- package/dist/SocialMediaButton.js +135 -0
- package/dist/SocialMediaButton.js.map +1 -0
- package/dist/SocialMediaButtonTemplate.d.ts +2 -0
- package/dist/SocialMediaButtonTemplate.js +6 -0
- package/dist/SocialMediaButtonTemplate.js.map +1 -0
- package/dist/StepInput.d.ts +2 -1
- package/dist/StepInput.js +6 -0
- package/dist/StepInput.js.map +1 -1
- package/dist/StepInputTemplate.js +1 -1
- package/dist/StepInputTemplate.js.map +1 -1
- package/dist/TableRow.d.ts +11 -0
- package/dist/TableRow.js +16 -0
- package/dist/TableRow.js.map +1 -1
- package/dist/TextArea.d.ts +3 -8
- package/dist/TextArea.js +12 -5
- package/dist/TextArea.js.map +1 -1
- package/dist/TextField.d.ts +20 -11
- package/dist/TextField.js +44 -31
- package/dist/TextField.js.map +1 -1
- package/dist/assets/{InputSuggestions-BmjyLzkP.js → InputSuggestions-9WQMOg4t.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-CDt3iORy.js → ListItemStandardExpandableTextTemplate-BQaMMo_n.js} +1 -1
- package/dist/assets/ar-CUjm9SSI.js +1 -0
- package/dist/assets/ar_EG-DQlFzN6x.js +1 -0
- package/dist/assets/ar_SA-lp21-ovF.js +1 -0
- package/dist/assets/bg-BMgSEqKu.js +1 -0
- package/dist/assets/{bundle.esm-Dz11sAJe.js → bundle.esm-ZNiP-jPI.js} +211 -209
- package/dist/assets/ca-BEgqToWu.js +1 -0
- package/dist/assets/cnr-IJYa9RjY.js +1 -0
- package/dist/assets/cs-DcM44PeB.js +1 -0
- package/dist/assets/da-D81rJc1N.js +1 -0
- package/dist/assets/de-eQRPkDbn.js +1 -0
- package/dist/assets/de_AT-Ag3CVI5m.js +1 -0
- package/dist/assets/de_CH-DgRYNg0p.js +1 -0
- package/dist/assets/el-W3XNt9Wl.js +1 -0
- package/dist/assets/el_CY-BfNIiYpU.js +1 -0
- package/dist/assets/en-CrBjXhTl.js +1 -0
- package/dist/assets/en_AU-Br7ytKW4.js +1 -0
- package/dist/assets/en_GB-DfnNoCgD.js +1 -0
- package/dist/assets/en_HK-Cyj9DPsW.js +1 -0
- package/dist/assets/en_IE-B5FpEUby.js +1 -0
- package/dist/assets/en_IN-C3XmKnWe.js +1 -0
- package/dist/assets/en_NZ-COJ5ycaE.js +1 -0
- package/dist/assets/en_PG-BB-Cmgcm.js +1 -0
- package/dist/assets/en_SG-Dfevg5da.js +1 -0
- package/dist/assets/en_ZA-BgOSNy0v.js +1 -0
- package/dist/assets/es-CRcVj7aR.js +1 -0
- package/dist/assets/es_AR-CFf6aWC5.js +1 -0
- package/dist/assets/es_BO-DNFEED1o.js +1 -0
- package/dist/assets/es_CL-DZhLyidG.js +1 -0
- package/dist/assets/es_CO-uWf-1tom.js +1 -0
- package/dist/assets/es_MX-C_wDRcT-.js +1 -0
- package/dist/assets/es_PE-QQsdF6EB.js +1 -0
- package/dist/assets/es_UY-CWhNSkyr.js +1 -0
- package/dist/assets/es_VE-hweLK9Ws.js +1 -0
- package/dist/assets/et-B3fco2O5.js +1 -0
- package/dist/assets/fa-oRguSKlL.js +1 -0
- package/dist/assets/fi-Daa_vlE5.js +1 -0
- package/dist/assets/fr-CANfYyyO.js +1 -0
- package/dist/assets/fr_BE-CCxD_K6m.js +1 -0
- package/dist/assets/fr_CA-BEtkRJZv.js +1 -0
- package/dist/assets/fr_CH-CrBmdh_n.js +1 -0
- package/dist/assets/fr_LU-CDcjZueC.js +1 -0
- package/dist/assets/he-CVUhin6m.js +1 -0
- package/dist/assets/hi-DF2PyuOw.js +1 -0
- package/dist/assets/hr-b6c4wXpD.js +1 -0
- package/dist/assets/hu-B7IWSU6b.js +1 -0
- package/dist/assets/id-GxIydI_w.js +1 -0
- package/dist/assets/it-DAjzvm2X.js +1 -0
- package/dist/assets/it_CH-BvNuHKQK.js +1 -0
- package/dist/assets/ja-DhVA6Wxm.js +1 -0
- package/dist/assets/kk-BSxmnq67.js +1 -0
- package/dist/assets/ko-ZT8Z04Uq.js +1 -0
- package/dist/assets/lt-BVWqkFr_.js +1 -0
- package/dist/assets/lv-DyXyW37Y.js +1 -0
- package/dist/assets/messagebundle_en-DwlTjyni.js +1 -0
- package/dist/assets/mk-ChbdOzZI.js +1 -0
- package/dist/assets/ms-H9bJ42GA.js +1 -0
- package/dist/assets/nb-Dgkq7ozi.js +1 -0
- package/dist/assets/nl-DZqLtAXS.js +1 -0
- package/dist/assets/nl_BE-Dx4AxOFo.js +1 -0
- package/dist/assets/pl-MzEgIfvm.js +1 -0
- package/dist/assets/pt-2N8dosOm.js +1 -0
- package/dist/assets/pt_PT-CIcj5FsJ.js +1 -0
- package/dist/assets/ro-CZHCJKTk.js +1 -0
- package/dist/assets/ru-BcU9rFqC.js +1 -0
- package/dist/assets/ru_UA-aH_wNrwj.js +1 -0
- package/dist/assets/sk-DYn5gXzA.js +1 -0
- package/dist/assets/sl-RYb_KlOx.js +1 -0
- package/dist/assets/sr-Bap_3nyz.js +1 -0
- package/dist/assets/sr_Latn-FYOU_tQB.js +1 -0
- package/dist/assets/sv-CeQXZ1qM.js +1 -0
- package/dist/assets/th-C5mRgAid.js +1 -0
- package/dist/assets/tr-vCU3KUkO.js +1 -0
- package/dist/assets/uk-CKvdHIrD.js +1 -0
- package/dist/assets/vi-0BxthtV1.js +1 -0
- package/dist/assets/zh_CN-BV9PXZ7J.js +1 -0
- package/dist/assets/zh_HK-kGfo3-wS.js +1 -0
- package/dist/assets/zh_SG-B8bEKxnm.js +1 -0
- package/dist/assets/zh_TW-BshO-JEe.js +1 -0
- package/dist/css/themes/AccordionItem.css +1 -1
- package/dist/css/themes/BreadcrumbsPopover.css +1 -1
- package/dist/css/themes/CountrySelector.css +1 -1
- package/dist/css/themes/DatePicker.css +1 -1
- package/dist/css/themes/Divider.css +1 -1
- package/dist/css/themes/Dropdown.css +1 -1
- package/dist/css/themes/FilterMenu.css +1 -1
- package/dist/css/themes/Footer.css +1 -1
- package/dist/css/themes/HeroBanner.css +1 -1
- package/dist/css/themes/Link.css +1 -1
- package/dist/css/themes/MastheadItem.css +1 -1
- package/dist/css/themes/MastheadMenu.css +1 -1
- package/dist/css/themes/PromoTile.css +1 -0
- package/dist/css/themes/Quote.css +1 -1
- package/dist/css/themes/RatingIndicator.css +1 -1
- package/dist/css/themes/SelectBox.css +1 -1
- package/dist/css/themes/Slider.css +1 -1
- package/dist/css/themes/SocialMediaButton.css +1 -0
- package/dist/css/themes/Tag.css +1 -1
- package/dist/css/themes/TextField.css +1 -1
- package/dist/custom-elements-internal.json +894 -232
- package/dist/custom-elements.json +858 -215
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +4 -2
- package/dist/generated/i18n/i18n-defaults.js +4 -2
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/templates/CountrySelectorTemplate.lit.js +1 -2
- package/dist/generated/templates/CountrySelectorTemplate.lit.js.map +1 -1
- package/dist/generated/templates/DatePickerTemplate.lit.js +4 -5
- package/dist/generated/templates/DatePickerTemplate.lit.js.map +1 -1
- package/dist/generated/templates/FilterMenuTemplate.lit.js +2 -2
- package/dist/generated/templates/FilterMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/FooterTemplate.lit.js +33 -32
- package/dist/generated/templates/FooterTemplate.lit.js.map +1 -1
- package/dist/generated/templates/HeroBannerTemplate.lit.js +1 -1
- package/dist/generated/templates/HeroBannerTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadItemTemplate.lit.js +3 -3
- package/dist/generated/templates/MastheadItemTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadShellTemplate.lit.js +1 -1
- package/dist/generated/templates/MastheadShellTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SearchableListBaseTemplate.lit.js +1 -1
- package/dist/generated/templates/SearchableListBaseTemplate.lit.js.map +1 -1
- package/dist/generated/templates/SelectBoxTemplate.lit.js +4 -4
- package/dist/generated/templates/SelectBoxTemplate.lit.js.map +1 -1
- package/dist/generated/templates/TextFieldTemplate.lit.js +2 -2
- package/dist/generated/templates/TextFieldTemplate.lit.js.map +1 -1
- package/dist/generated/themes/AccordionItem.css.d.ts +1 -1
- package/dist/generated/themes/AccordionItem.css.js +1 -1
- package/dist/generated/themes/AccordionItem.css.js.map +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.d.ts +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.js +1 -1
- package/dist/generated/themes/BreadcrumbsPopover.css.js.map +1 -1
- package/dist/generated/themes/CountrySelector.css.d.ts +1 -1
- package/dist/generated/themes/CountrySelector.css.js +1 -1
- package/dist/generated/themes/CountrySelector.css.js.map +1 -1
- package/dist/generated/themes/DatePicker.css.d.ts +1 -1
- package/dist/generated/themes/DatePicker.css.js +1 -1
- package/dist/generated/themes/DatePicker.css.js.map +1 -1
- package/dist/generated/themes/Divider.css.d.ts +1 -1
- package/dist/generated/themes/Divider.css.js +1 -1
- package/dist/generated/themes/Divider.css.js.map +1 -1
- package/dist/generated/themes/Dropdown.css.d.ts +1 -1
- package/dist/generated/themes/Dropdown.css.js +1 -1
- package/dist/generated/themes/Dropdown.css.js.map +1 -1
- package/dist/generated/themes/FilterMenu.css.d.ts +1 -1
- package/dist/generated/themes/FilterMenu.css.js +1 -1
- package/dist/generated/themes/FilterMenu.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/HeroBanner.css.d.ts +1 -1
- package/dist/generated/themes/HeroBanner.css.js +1 -1
- package/dist/generated/themes/HeroBanner.css.js.map +1 -1
- package/dist/generated/themes/Link.css.d.ts +1 -1
- package/dist/generated/themes/Link.css.js +1 -1
- package/dist/generated/themes/Link.css.js.map +1 -1
- package/dist/generated/themes/MastheadItem.css.d.ts +1 -1
- package/dist/generated/themes/MastheadItem.css.js +1 -1
- package/dist/generated/themes/MastheadItem.css.js.map +1 -1
- package/dist/generated/themes/MastheadMenu.css.d.ts +1 -1
- package/dist/generated/themes/MastheadMenu.css.js +1 -1
- package/dist/generated/themes/MastheadMenu.css.js.map +1 -1
- package/dist/generated/themes/PromoTile.css.d.ts +2 -0
- package/dist/generated/themes/PromoTile.css.js +8 -0
- package/dist/generated/themes/PromoTile.css.js.map +1 -0
- 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/SelectBox.css.d.ts +1 -1
- package/dist/generated/themes/SelectBox.css.js +1 -1
- package/dist/generated/themes/SelectBox.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/generated/themes/SocialMediaButton.css.d.ts +2 -0
- package/dist/generated/themes/SocialMediaButton.css.js +8 -0
- package/dist/generated/themes/SocialMediaButton.css.js.map +1 -0
- package/dist/generated/themes/Tag.css.d.ts +1 -1
- package/dist/generated/themes/Tag.css.js +1 -1
- package/dist/generated/themes/Tag.css.js.map +1 -1
- package/dist/generated/themes/TextField.css.d.ts +1 -1
- package/dist/generated/themes/TextField.css.js +1 -1
- package/dist/generated/themes/TextField.css.js.map +1 -1
- package/dist/messagebundle.properties +9 -3
- package/dist/messagebundle_en.properties +3 -1
- package/dist/types/PromoTile.d.ts +60 -0
- package/dist/types/PromoTile.js +63 -0
- package/dist/types/PromoTile.js.map +1 -0
- package/dist/types/SocialMediaButtonType.d.ts +9 -0
- package/dist/types/SocialMediaButtonType.js +11 -0
- package/dist/types/SocialMediaButtonType.js.map +1 -0
- package/dist/utils/debounce.d.ts +3 -1
- package/dist/utils/debounce.js +16 -4
- package/dist/utils/debounce.js.map +1 -1
- package/dist/vscode.html-custom-data.json +152 -1
- package/dist/web-types.json +341 -11
- package/package.json +2 -1
- package/src/Accordion.ts +19 -0
- package/src/AccordionItem.ts +28 -0
- package/src/AccordionItemTemplate.tsx +25 -10
- package/src/AccordionTemplate.tsx +22 -1
- package/src/Assets.ts +1 -0
- package/src/CountrySelector.hbs +3 -9
- package/src/CountrySelector.ts +7 -4
- package/src/DatePicker.hbs +17 -26
- package/src/DatePicker.ts +2 -2
- package/src/FilterMenu.hbs +33 -37
- package/src/FilterMenu.ts +69 -15
- package/src/Footer.hbs +39 -43
- package/src/Footer.ts +88 -14
- package/src/HeroBanner.hbs +0 -1
- package/src/MastheadItem.hbs +2 -2
- package/src/MastheadItem.ts +18 -0
- package/src/MastheadShell.hbs +3 -2
- package/src/MastheadShell.ts +28 -7
- package/src/PromoTile.ts +290 -0
- package/src/PromoTileTemplate.tsx +68 -0
- package/src/Quote.ts +17 -3
- package/src/Search.ts +1 -0
- package/src/SearchableListBase.hbs +1 -1
- package/src/SelectBox.hbs +11 -13
- package/src/SelectBox.ts +2 -2
- package/src/SocialMediaButton.ts +152 -0
- package/src/SocialMediaButtonTemplate.tsx +18 -0
- package/src/StepInput.ts +8 -1
- package/src/StepInputTemplate.tsx +1 -2
- package/src/TableRow.ts +27 -1
- package/src/TextArea.ts +14 -7
- package/src/TextField.hbs +5 -5
- package/src/TextField.ts +87 -66
- package/src/generated/i18n/i18n-defaults.ts +2 -2
- package/src/generated/templates/CountrySelectorTemplate.lit.ts +1 -2
- package/src/generated/templates/DatePickerTemplate.lit.ts +4 -5
- package/src/generated/templates/FilterMenuTemplate.lit.ts +2 -2
- package/src/generated/templates/FooterTemplate.lit.ts +33 -32
- package/src/generated/templates/HeroBannerTemplate.lit.ts +1 -1
- package/src/generated/templates/MastheadItemTemplate.lit.ts +3 -3
- package/src/generated/templates/MastheadShellTemplate.lit.ts +1 -1
- package/src/generated/templates/SearchableListBaseTemplate.lit.ts +1 -1
- package/src/generated/templates/SelectBoxTemplate.lit.ts +4 -4
- package/src/generated/templates/TextFieldTemplate.lit.ts +2 -2
- package/src/generated/themes/AccordionItem.css.ts +1 -1
- package/src/generated/themes/BreadcrumbsPopover.css.ts +1 -1
- package/src/generated/themes/CountrySelector.css.ts +1 -1
- package/src/generated/themes/DatePicker.css.ts +1 -1
- package/src/generated/themes/Divider.css.ts +1 -1
- package/src/generated/themes/Dropdown.css.ts +1 -1
- package/src/generated/themes/FilterMenu.css.ts +1 -1
- package/src/generated/themes/Footer.css.ts +1 -1
- package/src/generated/themes/HeroBanner.css.ts +1 -1
- package/src/generated/themes/Link.css.ts +1 -1
- package/src/generated/themes/MastheadItem.css.ts +1 -1
- package/src/generated/themes/MastheadMenu.css.ts +1 -1
- package/src/generated/themes/PromoTile.css.ts +9 -0
- package/src/generated/themes/Quote.css.ts +1 -1
- package/src/generated/themes/RatingIndicator.css.ts +1 -1
- package/src/generated/themes/SelectBox.css.ts +1 -1
- package/src/generated/themes/Slider.css.ts +1 -1
- package/src/generated/themes/SocialMediaButton.css.ts +9 -0
- package/src/generated/themes/Tag.css.ts +1 -1
- package/src/generated/themes/TextField.css.ts +1 -1
- package/src/i18n/messagebundle.properties +9 -3
- package/src/i18n/messagebundle_en.properties +3 -1
- package/src/themes/AccordionItem.css +61 -22
- package/src/themes/BreadcrumbsPopover.css +2 -1
- package/src/themes/CountrySelector.css +4 -0
- package/src/themes/DatePicker.css +0 -5
- package/src/themes/Divider.css +2 -1
- package/src/themes/Dropdown.css +1 -1
- package/src/themes/FilterMenu.css +2 -2
- package/src/themes/Footer.css +44 -25
- package/src/themes/HeroBanner.css +34 -32
- package/src/themes/Link.css +4 -1
- package/src/themes/MastheadItem.css +2 -1
- package/src/themes/MastheadMenu.css +4 -4
- package/src/themes/PromoTile.css +152 -0
- package/src/themes/Quote.css +21 -24
- package/src/themes/SelectBox.css +1 -1
- package/src/themes/SocialMediaButton.css +50 -0
- package/src/themes/Tag.css +18 -24
- package/src/themes/TextField.css +0 -15
- package/src/types/PromoTile.ts +61 -0
- package/src/types/SocialMediaButtonType.ts +10 -0
- package/src/utils/debounce.ts +19 -4
- package/dist/assets/messagebundle_en-CKeTZNW3.js +0 -1
package/src/Footer.ts
CHANGED
|
@@ -14,6 +14,8 @@ import UDExButton from "./Button.js";
|
|
|
14
14
|
import UDExAccordion from "./Accordion.js";
|
|
15
15
|
import UDExLink from "./Link.js";
|
|
16
16
|
import UDExDivider from "./Divider.js";
|
|
17
|
+
import UDExSocialMediaButton from "./SocialMediaButton.js";
|
|
18
|
+
import type { UDExSocialMediaButtonType } from "./types/SocialMediaButtonType.js";
|
|
17
19
|
import type { UDExTarget } from "./types/common.js";
|
|
18
20
|
import { BreakpointUtils } from "./utils/Breakpoints.js";
|
|
19
21
|
import parseArrayFromString from "./utils/parseArrayFromString.js";
|
|
@@ -35,7 +37,6 @@ import {
|
|
|
35
37
|
QUICK_LINKS,
|
|
36
38
|
SEE_COMPLETE_LIST,
|
|
37
39
|
SITE_INFORMATION,
|
|
38
|
-
SOCIAL_LINK_ICON,
|
|
39
40
|
TRENDING,
|
|
40
41
|
COPYRIGHT,
|
|
41
42
|
PUBLIC_SECURITY_NETWORK_NUMBER,
|
|
@@ -56,9 +57,11 @@ export type FooterLink = {
|
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
export type FooterSocialLink = {
|
|
60
|
+
name?: UDExSocialMediaButtonType;
|
|
59
61
|
url: string;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
target?: UDExTarget;
|
|
63
|
+
accessibleName?: string;
|
|
64
|
+
id? : string;
|
|
62
65
|
};
|
|
63
66
|
|
|
64
67
|
export type FooterContactNumber = {
|
|
@@ -106,7 +109,7 @@ type DetailedEvents = "quick-links-click" | "trending-click" | "about-sap-click"
|
|
|
106
109
|
renderer: litRender,
|
|
107
110
|
styles: [FooterCss],
|
|
108
111
|
template: FooterTemplate,
|
|
109
|
-
dependencies: [UDExAccordion, UDExAccordionItem, Icon, UDExButton, UDExDivider, UDExLink],
|
|
112
|
+
dependencies: [UDExAccordion, UDExAccordionItem, Icon, UDExButton, UDExDivider, UDExLink, UDExSocialMediaButton],
|
|
110
113
|
})
|
|
111
114
|
/**
|
|
112
115
|
* Triggered on click interaction with logo in footer
|
|
@@ -196,7 +199,7 @@ class UDExFooter extends UI5Element {
|
|
|
196
199
|
* @public
|
|
197
200
|
*/
|
|
198
201
|
@property({ type: String })
|
|
199
|
-
logoTitle
|
|
202
|
+
logoTitle?: string;
|
|
200
203
|
|
|
201
204
|
/**
|
|
202
205
|
* Defines the Logo URL
|
|
@@ -205,7 +208,7 @@ class UDExFooter extends UI5Element {
|
|
|
205
208
|
* @public
|
|
206
209
|
*/
|
|
207
210
|
@property({ type: String })
|
|
208
|
-
logoUrl
|
|
211
|
+
logoUrl?: string;
|
|
209
212
|
|
|
210
213
|
/**
|
|
211
214
|
* Defines the optional component href link for the logo.
|
|
@@ -216,6 +219,51 @@ class UDExFooter extends UI5Element {
|
|
|
216
219
|
@property({ type: String })
|
|
217
220
|
logoLink: string = "";
|
|
218
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Defines the tagline alt text.
|
|
224
|
+
*
|
|
225
|
+
* @default ""
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
228
|
+
@property({ type: String })
|
|
229
|
+
taglineAlt?: string;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Defines the tagline url.
|
|
233
|
+
*
|
|
234
|
+
* @default ""
|
|
235
|
+
* @public
|
|
236
|
+
*/
|
|
237
|
+
@property({ type: String })
|
|
238
|
+
taglineUrl?: string;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Defines the chinese tagline url.
|
|
242
|
+
*
|
|
243
|
+
* @default ""
|
|
244
|
+
* @public
|
|
245
|
+
*/
|
|
246
|
+
@property({ type: String })
|
|
247
|
+
chineseTaglineUrl?: string;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Defines the chinese logo url
|
|
251
|
+
*
|
|
252
|
+
* @default ""
|
|
253
|
+
* @public
|
|
254
|
+
*/
|
|
255
|
+
@property({ type: String })
|
|
256
|
+
chineseLogoUrl?: string;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Defines the optional component href link for the chinese logo.
|
|
260
|
+
*
|
|
261
|
+
* @default ""
|
|
262
|
+
* @public
|
|
263
|
+
*/
|
|
264
|
+
@property({ type: String })
|
|
265
|
+
chineseLogoLink?: string;
|
|
266
|
+
|
|
219
267
|
/**
|
|
220
268
|
* List of the Quick links
|
|
221
269
|
*
|
|
@@ -395,10 +443,6 @@ class UDExFooter extends UI5Element {
|
|
|
395
443
|
window.scrollTo(0, 0);
|
|
396
444
|
}
|
|
397
445
|
|
|
398
|
-
get parsedRef(): string | undefined {
|
|
399
|
-
return (this.logoLink && this.logoLink.length > 0) ? this.logoLink : undefined;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
446
|
get quickLinksArray(): FooterLink[] {
|
|
403
447
|
return parseArrayFromString<FooterLink>(this.quickLinks);
|
|
404
448
|
}
|
|
@@ -427,10 +471,6 @@ class UDExFooter extends UI5Element {
|
|
|
427
471
|
return !!this.contactNumbersArray.length || !!this.contactUsLink || !!this.chatWithUsLink;
|
|
428
472
|
}
|
|
429
473
|
|
|
430
|
-
get socialIconAccessibleName(): string {
|
|
431
|
-
return ` ${UDExFooter.i18nBundle.getText(SOCIAL_LINK_ICON)}`;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
474
|
get phoneNumberAccessibleName(): string {
|
|
435
475
|
return `${UDExFooter.i18nBundle.getText(PHONE_NUMBER)} `;
|
|
436
476
|
}
|
|
@@ -494,6 +534,40 @@ class UDExFooter extends UI5Element {
|
|
|
494
534
|
return getLanguage()?.toLowerCase() === "zh_cn";
|
|
495
535
|
}
|
|
496
536
|
|
|
537
|
+
get hasLogo(): boolean {
|
|
538
|
+
return !!(this.logoUrl || this.chineseLogoUrl);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
get hasLogoLink(): boolean {
|
|
542
|
+
return !!(this.logoLink || this.chineseLogoLink);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
get currentLogoUrl(): string | undefined {
|
|
546
|
+
return this.isChineseLang && this.chineseLogoUrl ? this.chineseLogoUrl : this.logoUrl;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
get logoHref(): string {
|
|
550
|
+
return this.isChineseLang && this.chineseLogoLink ? this.chineseLogoLink : this.logoLink;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
get hasTagline(): boolean {
|
|
554
|
+
return !!(this.taglineUrl || this.chineseTaglineUrl);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
get currentTaglineUrl(): string | undefined {
|
|
558
|
+
return this.isChineseLang && this.chineseTaglineUrl ? this.chineseTaglineUrl : this.taglineUrl;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
get taglineClass(): string {
|
|
562
|
+
const root = "udex-footer__tagline-image";
|
|
563
|
+
return this.isChineseLang && this.chineseTaglineUrl ? `${root}-chinese` : root;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
get logoClass(): string {
|
|
567
|
+
const root = "udex-footer__logo-image";
|
|
568
|
+
return this.isChineseLang && this.chineseLogoUrl ? `${root}-chinese` : root;
|
|
569
|
+
}
|
|
570
|
+
|
|
497
571
|
_onLogoClick(e: PointerEvent): void {
|
|
498
572
|
this.fireFooterBaseEvent(e, "logo-click");
|
|
499
573
|
}
|
package/src/HeroBanner.hbs
CHANGED
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
<slot id="udex-hero-banner__content" name="content" part="content"></slot>
|
|
39
39
|
|
|
40
40
|
{{#if hasAdditionalContent}}
|
|
41
|
-
<udex-media-player source="http://media.w3.org/2010/05/sintel/trailer.mp4" aspect-ratio="16:9"></udex-media-player>
|
|
42
41
|
<slot id="udex-hero-banner__additionalContent" name="additionalContent" part="additionalContent"></slot>
|
|
43
42
|
{{/if}}
|
|
44
43
|
{{/inline}}
|
package/src/MastheadItem.hbs
CHANGED
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
<ui5-icon
|
|
65
65
|
class="udex-masthead-item__icon"
|
|
66
66
|
name="{{icon}}"
|
|
67
|
-
show-tooltip="{{
|
|
68
|
-
accessible-name="{{
|
|
67
|
+
show-tooltip="{{iconAltText}}"
|
|
68
|
+
accessible-name="{{iconAltText}}"
|
|
69
69
|
mode="Decorative">
|
|
70
70
|
</ui5-icon>
|
|
71
71
|
{{else if image}}
|
package/src/MastheadItem.ts
CHANGED
|
@@ -285,9 +285,23 @@ class UDExMastheadItem extends UI5Element implements IMastheadItem {
|
|
|
285
285
|
@slot({ type: HTMLElement, "default": true })
|
|
286
286
|
content?: Array<HTMLElement>;
|
|
287
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Defines the prevents the item from losing focus.
|
|
290
|
+
*
|
|
291
|
+
* @private
|
|
292
|
+
*/
|
|
293
|
+
|
|
288
294
|
@property({ type: Boolean })
|
|
289
295
|
_preventFocusOut!: boolean;
|
|
290
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Defines the item is a menu close button
|
|
299
|
+
*
|
|
300
|
+
* @private
|
|
301
|
+
*/
|
|
302
|
+
@property({ type: Boolean })
|
|
303
|
+
_isMenuCloseBtn?: boolean;
|
|
304
|
+
|
|
291
305
|
@i18n("@sapudex/web-components")
|
|
292
306
|
static i18nBundle: I18nBundle;
|
|
293
307
|
|
|
@@ -530,6 +544,10 @@ class UDExMastheadItem extends UI5Element implements IMastheadItem {
|
|
|
530
544
|
return this.querySelector("[udex-avatar]")!;
|
|
531
545
|
}
|
|
532
546
|
|
|
547
|
+
get iconAltText(): string {
|
|
548
|
+
return this._isMenuCloseBtn ? this.accessibleName || this.icon : this.iconAlt;
|
|
549
|
+
}
|
|
550
|
+
|
|
533
551
|
get isRtlDirection(): boolean {
|
|
534
552
|
return this._direction === "rtl";
|
|
535
553
|
}
|
package/src/MastheadShell.hbs
CHANGED
|
@@ -121,9 +121,10 @@
|
|
|
121
121
|
class="udex-masthead-shell__close-btn"
|
|
122
122
|
accessible-role="button"
|
|
123
123
|
icon="decline"
|
|
124
|
-
accessible-name="
|
|
124
|
+
accessible-name="{{mobileCloseButtonAccessibleName}}"
|
|
125
125
|
part="menu-close-btn"
|
|
126
|
-
hide-active-border
|
|
126
|
+
hide-active-border
|
|
127
|
+
_is-menu-close-btn>
|
|
127
128
|
</udex-masthead-item>
|
|
128
129
|
{{/if}}
|
|
129
130
|
</div>
|
package/src/MastheadShell.ts
CHANGED
|
@@ -3,6 +3,7 @@ import customElement from "@ui5/webcomponents-base/dist/decorators/customElement
|
|
|
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
5
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
6
|
+
import type { ChangeInfo } from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
6
7
|
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
7
8
|
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
|
|
8
9
|
import type { ResizeObserverCallback } from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
@@ -31,7 +32,7 @@ import MastheadShellTemplate from "./generated/templates/MastheadShellTemplate.l
|
|
|
31
32
|
// Styles
|
|
32
33
|
import MastheadShellCss from "./generated/themes/MastheadShell.css.js";
|
|
33
34
|
|
|
34
|
-
const canvasContentFont = "
|
|
35
|
+
const canvasContentFont = "14px '72 Brand Variable'";
|
|
35
36
|
type MastheadSlottedItem = UDExMastheadItem | UDExMastheadProfileMenu | UDExMastheadMenu | UDExMastheadCountrySelector | undefined | null;
|
|
36
37
|
type MastheadItemType = UDExMastheadItem | null | undefined;
|
|
37
38
|
|
|
@@ -47,6 +48,7 @@ type UDExMastheadShellAnalyticsNameEventDetail = {
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
export enum UDExMastheadVariable {
|
|
51
|
+
itemArrowIconMarginInlineStart = "--udex-masthead-item-arrow-margin-inline-start",
|
|
50
52
|
mobileMenuHeight = "--udex-masthead-shell-mobile-menu-height",
|
|
51
53
|
itemButtonIconSize = "--udex-masthead-item-button-icon-size",
|
|
52
54
|
itemArrowIconSize = "--udex-masthead-item-arrow-icon-size",
|
|
@@ -283,7 +285,7 @@ class UDExMastheadShell extends UI5Element {
|
|
|
283
285
|
/**
|
|
284
286
|
* Defines overflow style for the body after clicking mobile menu opener button
|
|
285
287
|
*
|
|
286
|
-
* @default
|
|
288
|
+
* @default false
|
|
287
289
|
* @public
|
|
288
290
|
*/
|
|
289
291
|
@property({ type: Boolean })
|
|
@@ -292,7 +294,7 @@ class UDExMastheadShell extends UI5Element {
|
|
|
292
294
|
/**
|
|
293
295
|
* Defines the visibility of the Search by default.
|
|
294
296
|
*
|
|
295
|
-
* @default
|
|
297
|
+
* @default false
|
|
296
298
|
* @public
|
|
297
299
|
*/
|
|
298
300
|
@property({ type: Boolean })
|
|
@@ -301,7 +303,7 @@ class UDExMastheadShell extends UI5Element {
|
|
|
301
303
|
/**
|
|
302
304
|
* Defines sticky position for component
|
|
303
305
|
*
|
|
304
|
-
* @default
|
|
306
|
+
* @default false
|
|
305
307
|
* @public
|
|
306
308
|
*/
|
|
307
309
|
@property({ type: Boolean })
|
|
@@ -406,6 +408,15 @@ class UDExMastheadShell extends UI5Element {
|
|
|
406
408
|
@property()
|
|
407
409
|
closeButtonAccessibleName?: string;
|
|
408
410
|
|
|
411
|
+
/**
|
|
412
|
+
* Defines an accessible name for the close mobile menu button
|
|
413
|
+
*
|
|
414
|
+
* @default undefined
|
|
415
|
+
* @public
|
|
416
|
+
*/
|
|
417
|
+
@property()
|
|
418
|
+
mobileCloseButtonAccessibleName?: string;
|
|
419
|
+
|
|
409
420
|
/**
|
|
410
421
|
* Defines an aria label for the homepage link
|
|
411
422
|
*
|
|
@@ -490,7 +501,9 @@ class UDExMastheadShell extends UI5Element {
|
|
|
490
501
|
this.focusSearchBtn();
|
|
491
502
|
}
|
|
492
503
|
|
|
493
|
-
this.
|
|
504
|
+
if (this.shouldHandleMobileView) {
|
|
505
|
+
this.updateVisibility();
|
|
506
|
+
}
|
|
494
507
|
}
|
|
495
508
|
|
|
496
509
|
onEnterDOM(): void {
|
|
@@ -504,6 +517,12 @@ class UDExMastheadShell extends UI5Element {
|
|
|
504
517
|
ResizeHandler.deregister(this, this._handleResizeBound);
|
|
505
518
|
}
|
|
506
519
|
|
|
520
|
+
onInvalidation({ name }: ChangeInfo): void {
|
|
521
|
+
if (name === "default" && this.shouldHandleMobileView) {
|
|
522
|
+
this.handleMobileMode();
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
507
526
|
_handleResize(): void {
|
|
508
527
|
if (this.shouldHandleMobileView) {
|
|
509
528
|
this.handleMobileMode();
|
|
@@ -762,7 +781,9 @@ class UDExMastheadShell extends UI5Element {
|
|
|
762
781
|
}
|
|
763
782
|
|
|
764
783
|
getItemArrowIconWidth(): number {
|
|
765
|
-
|
|
784
|
+
const arrowIconSize = this.getItemIconSize(UDExMastheadVariable.itemArrowIconSize);
|
|
785
|
+
const marginInlineStart = this.getItemIconSize(UDExMastheadVariable.itemArrowIconMarginInlineStart);
|
|
786
|
+
return arrowIconSize + marginInlineStart;
|
|
766
787
|
}
|
|
767
788
|
|
|
768
789
|
getMainMenuWidth(): number {
|
|
@@ -772,7 +793,7 @@ class UDExMastheadShell extends UI5Element {
|
|
|
772
793
|
const mainItem = item as UDExMastheadItem;
|
|
773
794
|
const hasArrowIcon = mainItem.hasArrowDown && !mainItem.hideArrowIcon;
|
|
774
795
|
const arrowIconWidth = hasArrowIcon ? this.getItemArrowIconWidth() : 0;
|
|
775
|
-
return accumulatedWidth + this.getItemWidth(mainItem) + (index && parseInt(gapItemVar) + arrowIconWidth
|
|
796
|
+
return accumulatedWidth + this.getItemWidth(mainItem) + (index && parseInt(gapItemVar)) + arrowIconWidth;
|
|
776
797
|
}, 0);
|
|
777
798
|
}
|
|
778
799
|
|
package/src/PromoTile.ts
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
|
+
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
3
|
+
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
4
|
+
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
5
|
+
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
6
|
+
import type { ResizeObserverCallback } from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
7
|
+
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
8
|
+
import { isDesktop } from "@ui5/webcomponents-base/dist/Device.js";
|
|
9
|
+
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
10
|
+
import PromoTileTemplate from "./PromoTileTemplate.js";
|
|
11
|
+
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
|
|
12
|
+
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
|
|
13
|
+
import { PROMO_TILE, PROMO_TILE_ICON } from "./generated/i18n/i18n-defaults.js";
|
|
14
|
+
import { BreakpointUtils } from "./utils/Breakpoints.js";
|
|
15
|
+
import type UDExButton from "./Button.js";
|
|
16
|
+
import UDExButtonSize from "./types/ButtonSize.js";
|
|
17
|
+
import UDExButtonDesign from "./types/ButtonDesign.js";
|
|
18
|
+
import { UDExPromoTileColorSheme, UDExPromoTileMode } from "./types/PromoTile.js";
|
|
19
|
+
|
|
20
|
+
// Styles
|
|
21
|
+
import PromoTileCss from "./generated/themes/PromoTile.css.js";
|
|
22
|
+
|
|
23
|
+
export enum UDExOrientation {
|
|
24
|
+
Vertical = "Vertical",
|
|
25
|
+
Horizontal = "Horizontal",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @class
|
|
30
|
+
*
|
|
31
|
+
* <h3 class="comment-api-title">Overview</h3>
|
|
32
|
+
*
|
|
33
|
+
*
|
|
34
|
+
* <h3>Usage</h3>
|
|
35
|
+
*
|
|
36
|
+
* For the <code>udex-promo-tile</code>
|
|
37
|
+
* <h3>ES6 Module Import</h3>
|
|
38
|
+
*
|
|
39
|
+
* <code>import "@sapudex/web-components/dist/PromoTile.js";</code>
|
|
40
|
+
*
|
|
41
|
+
* @constructor
|
|
42
|
+
* @extends UI5Element
|
|
43
|
+
* @tagname udex-promo-tile
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
@customElement({
|
|
47
|
+
tag: "udex-promo-tile",
|
|
48
|
+
renderer: jsxRenderer,
|
|
49
|
+
styles: PromoTileCss,
|
|
50
|
+
template: PromoTileTemplate,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Triggered when the user clicks on the CTA button
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
@event("button-click", { cancelable: true, bubbles: true })
|
|
59
|
+
|
|
60
|
+
class UDExPromoTile extends UI5Element {
|
|
61
|
+
eventDetails!: {
|
|
62
|
+
"button-click": void,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Defines the text content of the Promo Tile.
|
|
67
|
+
*
|
|
68
|
+
* @slot content
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
@slot({ type: HTMLElement, "default": true })
|
|
72
|
+
content!: Array<HTMLElement>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Defines the orientation of the Promo Tile component.
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @defaultvalue "Vertical"
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
@property({ type: String })
|
|
82
|
+
orientation: `${UDExOrientation}` = UDExOrientation.Vertical;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Defines the UI5 icon name in the pictogram section.
|
|
86
|
+
*
|
|
87
|
+
* @type {string}
|
|
88
|
+
* @defaultvalue ""
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
@property({ type: String })
|
|
92
|
+
icon?: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Defines the image aria label and alt in the pictogram section.
|
|
96
|
+
*
|
|
97
|
+
* @type {string}
|
|
98
|
+
* @defaultvalue ""
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
@property({ type: String })
|
|
102
|
+
imageLabel?: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Defines the logo URL in the pictogram section.
|
|
106
|
+
*
|
|
107
|
+
* @type {string}
|
|
108
|
+
* @defaultvalue ""
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
@property({ type: String })
|
|
112
|
+
logoUrl?: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Defines the header text of the promo tile.
|
|
116
|
+
*
|
|
117
|
+
* @type {string}
|
|
118
|
+
* @defaultvalue ""
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
@property({ type: String })
|
|
122
|
+
header?: string;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Defines the eyebrow text of the promo tile.
|
|
126
|
+
*
|
|
127
|
+
* @type {string}
|
|
128
|
+
* @defaultvalue ""
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
@property({ type: String })
|
|
132
|
+
eyebrow?: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Defines the CTA button label
|
|
136
|
+
*
|
|
137
|
+
* @type {string}
|
|
138
|
+
* @defaultvalue ""
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
@property({ type: String })
|
|
142
|
+
button?: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Defines the CTA button design
|
|
146
|
+
*
|
|
147
|
+
* @type {string}
|
|
148
|
+
* @defaultvalue ""
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
@property({ type: String })
|
|
152
|
+
buttonDesign?: UDExButtonDesign;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Defines the color scheme of the Promo Tile.
|
|
156
|
+
*
|
|
157
|
+
* @type {string}
|
|
158
|
+
* @defaultvalue ""
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
@property({ type: String })
|
|
162
|
+
colorScheme?: UDExPromoTileColorSheme;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Defines the accessible name of the component.
|
|
166
|
+
*
|
|
167
|
+
* @type {string}
|
|
168
|
+
* @defaultvalue ""
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
@property({ type: String })
|
|
172
|
+
accessibleName?: string;
|
|
173
|
+
|
|
174
|
+
@i18n("@sapudex/web-components")
|
|
175
|
+
static i18nBundle: I18nBundle;
|
|
176
|
+
|
|
177
|
+
_handleResizeBound: ResizeObserverCallback;
|
|
178
|
+
_button: UDExButton | undefined;
|
|
179
|
+
_colorMode: UDExPromoTileMode = UDExPromoTileMode.light;
|
|
180
|
+
_lightModeColors: Array<number> = [1, 2];
|
|
181
|
+
_darkModeColors: Array<number> = [7, 8, 9, 10];
|
|
182
|
+
|
|
183
|
+
constructor() {
|
|
184
|
+
super();
|
|
185
|
+
this._handleResizeBound = this._handleResize.bind(this);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
onEnterDOM(): void {
|
|
189
|
+
if (isDesktop()) {
|
|
190
|
+
this.setAttribute("desktop", "");
|
|
191
|
+
}
|
|
192
|
+
ResizeHandler.register(this, this._handleResizeBound);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
onExitDOM(): void {
|
|
196
|
+
ResizeHandler.deregister(this, this._handleResizeBound);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
onAfterRendering() {
|
|
200
|
+
this._button = this.getButton();
|
|
201
|
+
this.applyColorScheme();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
_handleResize(): void {
|
|
205
|
+
if (this._button) {
|
|
206
|
+
this._button.size = this.isMobile ? UDExButtonSize.Medium : UDExButtonSize.Large;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
getButton(): UDExButton | undefined {
|
|
211
|
+
return this.shadowRoot!.querySelector<UDExButton>(
|
|
212
|
+
"[udex-button]",
|
|
213
|
+
)!;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
applyColorScheme(): void {
|
|
217
|
+
if (!this.colorScheme) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
this._colorMode = this.checkColorMode(this.colorScheme);
|
|
222
|
+
const eyebrowColor = this.checkEyebrowColor(this.colorScheme);
|
|
223
|
+
|
|
224
|
+
if (this._colorMode === UDExPromoTileMode.dark) {
|
|
225
|
+
if (this._button) {
|
|
226
|
+
this._button.design = this.buttonDesign || UDExButtonDesign.Secondary;
|
|
227
|
+
}
|
|
228
|
+
this.style.setProperty("--udex-promo-tile-icon-fill-color", `var(--udexCoreTextLight)`);
|
|
229
|
+
}
|
|
230
|
+
this.style.setProperty("--udex-promo-tile-background", `var(--udexColor${this.colorScheme})`);
|
|
231
|
+
this.style.setProperty("--udex-promo-tile-eyebrow-color", `var(--udexColor${eyebrowColor})`);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
getColorNumber(colorScheme: string): number {
|
|
235
|
+
const match = colorScheme.match(/\d+/);
|
|
236
|
+
return match ? parseInt(match[0]) : 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
checkColorMode(colorScheme: string): UDExPromoTileMode {
|
|
240
|
+
const number = this.getColorNumber(colorScheme);
|
|
241
|
+
|
|
242
|
+
if (number && this._darkModeColors.includes(number)) {
|
|
243
|
+
return UDExPromoTileMode.dark;
|
|
244
|
+
}
|
|
245
|
+
return UDExPromoTileMode.light;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
checkEyebrowColor(colorScheme: string): string {
|
|
249
|
+
const number = this.getColorNumber(colorScheme);
|
|
250
|
+
let color: string = UDExPromoTileColorSheme.Blue8;
|
|
251
|
+
|
|
252
|
+
if (number === 7) {
|
|
253
|
+
color = "NeutralWhite";
|
|
254
|
+
} else if (this._darkModeColors.includes(number)) {
|
|
255
|
+
color = colorScheme.replace(`${number}`, `${number - 7}`);
|
|
256
|
+
} else if (this._lightModeColors.includes(number)) {
|
|
257
|
+
color = colorScheme.replace(`${number}`, `${number + 7}`);
|
|
258
|
+
}
|
|
259
|
+
return color;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
get isMobile(): boolean {
|
|
263
|
+
return BreakpointUtils.isAtMost("S");
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
get promoTileContainerText(): string {
|
|
267
|
+
return this.accessibleName || this.header || UDExPromoTile.i18nBundle.getText(PROMO_TILE);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
get _showPictogram(): boolean {
|
|
271
|
+
return !!this.icon || !!this.logoUrl;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
get _showLogo(): boolean {
|
|
275
|
+
return !this.icon && !!this.logoUrl;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
get _imageLabel(): string {
|
|
279
|
+
return this.imageLabel || UDExPromoTile.i18nBundle.getText(PROMO_TILE_ICON);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
handleCTAButtonClick(e: Event) {
|
|
283
|
+
e.preventDefault();
|
|
284
|
+
this.fireDecoratorEvent("button-click");
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
UDExPromoTile.define();
|
|
289
|
+
|
|
290
|
+
export default UDExPromoTile;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type UDExPromoTile from "./PromoTile.js";
|
|
2
|
+
import UI5Icon from "@ui5/webcomponents/dist/Icon.js";
|
|
3
|
+
import IconMode from "@ui5/webcomponents/dist/types/IconMode.js";
|
|
4
|
+
import UDExButton from "./Button.js";
|
|
5
|
+
import UDExButtonSize from "./types/ButtonSize.js";
|
|
6
|
+
import UDExButtonAccessibleRole from "./types/ButtonAccessibleRole.js";
|
|
7
|
+
|
|
8
|
+
export default function PromoTileTemplate(this: UDExPromoTile) {
|
|
9
|
+
const rootClass = "udex-promo-tile";
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div
|
|
13
|
+
role="region"
|
|
14
|
+
class={`${rootClass}__container ${rootClass}--${this.orientation?.toLowerCase()} ${rootClass}--${this._colorMode}`}
|
|
15
|
+
aria-label={this.promoTileContainerText}>
|
|
16
|
+
{this._showPictogram &&
|
|
17
|
+
<div
|
|
18
|
+
part="image"
|
|
19
|
+
class={{
|
|
20
|
+
"udex-promo-tile__pictogram": true,
|
|
21
|
+
"udex-promo-tile__pictogram--logo": this.logoUrl
|
|
22
|
+
}}
|
|
23
|
+
title={this._imageLabel}>
|
|
24
|
+
{this.icon &&
|
|
25
|
+
<UI5Icon
|
|
26
|
+
class={`${rootClass}__icon`}
|
|
27
|
+
name={this.icon?.toLowerCase()}
|
|
28
|
+
mode={IconMode.Decorative}
|
|
29
|
+
accessibleName={this._imageLabel}>
|
|
30
|
+
</UI5Icon>}
|
|
31
|
+
{this._showLogo &&
|
|
32
|
+
<img
|
|
33
|
+
src={this.logoUrl}
|
|
34
|
+
class={`${rootClass}__icon`}
|
|
35
|
+
aria-label={this._imageLabel}
|
|
36
|
+
alt={this._imageLabel} />}
|
|
37
|
+
</div>
|
|
38
|
+
}
|
|
39
|
+
<div part="content" class={`${rootClass}__content`}>
|
|
40
|
+
<div class={`${rootClass}__text`}>
|
|
41
|
+
{this.eyebrow &&
|
|
42
|
+
<div class={`${rootClass}__eyebrow eyebrow--l`}>{this.eyebrow}</div>
|
|
43
|
+
}
|
|
44
|
+
{this.header &&
|
|
45
|
+
<div part="header" class={`${rootClass}__header`}>{this.header}</div>
|
|
46
|
+
}
|
|
47
|
+
<slot></slot>
|
|
48
|
+
</div>
|
|
49
|
+
{!!this.button && footerSection.call(this, rootClass)}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function footerSection(this: UDExPromoTile, rootClass: string) {
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<div part="footer" class={`${rootClass}__footer`}>
|
|
58
|
+
<UDExButton class={`${rootClass}__btn`}
|
|
59
|
+
size={UDExButtonSize.Large}
|
|
60
|
+
design={this.buttonDesign}
|
|
61
|
+
onClick={this.handleCTAButtonClick}
|
|
62
|
+
accessibleRole={UDExButtonAccessibleRole.Button}>
|
|
63
|
+
{this.button}
|
|
64
|
+
</UDExButton>
|
|
65
|
+
</div>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
}
|