@swisspost/design-system-components 9.0.0-next.12 → 9.0.0-next.14
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/dist/.config/bindings.angular.js +4 -0
- package/dist/cjs/{attribute-observer-10f08c04.js → attribute-observer-6d8b886b.js} +4 -4
- package/dist/cjs/{check-one-of-f4f5d0c0.js → check-one-of-ef931478.js} +2 -1
- package/dist/cjs/{check-type-64af82a9.js → check-type-696d2c51.js} +4 -4
- package/dist/cjs/{check-url-3ffdd2fb.js → check-url-1cf6fb0d.js} +2 -1
- package/dist/cjs/{debounce-1151afe3.js → debounce-158fd76f.js} +2 -1
- package/dist/cjs/fade-72d5ef55.js +14 -0
- package/dist/cjs/{index-f1b08cdb.js → index-0ee3ab4a.js} +334 -152
- package/dist/cjs/{index-5d4e0aed.js → index-bea4ac42.js} +7 -5
- package/dist/cjs/index.cjs.js +30 -28
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-0bd6fb0d.js → package-7d11b6ea.js} +1 -1
- package/dist/cjs/{post-accordion-7aadd881.js → post-accordion-29861d97.js} +15 -8
- package/dist/cjs/{post-accordion-item-bd033c7f.js → post-accordion-item-0da0f7aa.js} +20 -13
- package/dist/cjs/post-accordion-item.cjs.entry.js +7 -7
- package/dist/cjs/post-accordion.cjs.entry.js +4 -4
- package/dist/cjs/{post-avatar-5dbdf70d.js → post-avatar-01b9cd6d.js} +29 -21
- package/dist/cjs/post-avatar.cjs.entry.js +3 -3
- package/dist/cjs/post-back-to-top-9a5647f7.js +80 -0
- package/dist/cjs/post-back-to-top.cjs.entry.js +5 -5
- package/dist/cjs/post-banner-33929088.js +110 -0
- package/dist/cjs/post-banner.cjs.entry.js +8 -8
- package/dist/cjs/{post-breadcrumb-531c4f79.js → post-breadcrumb-1384018e.js} +41 -34
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +7 -7
- package/dist/cjs/post-breadcrumb.cjs.entry.js +5 -5
- package/dist/cjs/post-card-control-4c85eda3.js +314 -0
- package/dist/cjs/post-card-control.cjs.entry.js +4 -4
- package/dist/cjs/post-closebutton_15.cjs.entry.js +8 -8
- package/dist/cjs/{post-collapsible-trigger-02924200.js → post-collapsible-trigger-0fb2596a.js} +47 -35
- package/dist/cjs/post-collapsible_2.cjs.entry.js +8 -8
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/{post-footer-96d7bd47.js → post-footer-f621a563.js} +18 -12
- package/dist/cjs/post-footer.cjs.entry.js +3 -3
- package/dist/cjs/post-linkarea-865079c1.js +32 -0
- package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
- package/dist/cjs/{post-menu-item-3f73fb4d.js → post-menu-item-ab3e2e7e.js} +12 -9
- package/dist/cjs/{post-popover-64195ffd.js → post-popover-a2ba9226.js} +24 -10
- package/dist/cjs/post-popover.cjs.entry.js +4 -4
- package/dist/cjs/{post-rating-bd27ebfc.js → post-rating-c402c294.js} +33 -10
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-c819517d.js +36 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-3eedcd19.js → post-tab-panel-3cb207f3.js} +9 -6
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-ea94b243.js → post-tabs-b6fa39c3.js} +29 -18
- package/dist/cjs/post-tabs.cjs.entry.js +4 -4
- package/dist/cjs/{post-tag-1d75024b.js → post-tag-9c366519.js} +20 -9
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-876f7892.js → post-togglebutton-d49bec2c.js} +682 -221
- package/dist/cjs/{post-tooltip-e4ef3c7e.js → post-tooltip-425c01ba.js} +24 -12
- package/dist/cjs/post-tooltip.cjs.entry.js +8 -8
- package/dist/cjs/{slide-5d51abe8.js → slide-8ae17ee4.js} +4 -4
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/fade.js +6 -2
- package/dist/collection/animations/slide.js +4 -4
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/post-accordion/post-accordion.js +16 -6
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +21 -11
- package/dist/collection/components/post-avatar/post-avatar.js +35 -20
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +14 -8
- package/dist/collection/components/post-banner/post-banner.css +1 -1
- package/dist/collection/components/post-banner/post-banner.js +40 -14
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +41 -31
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +10 -6
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +104 -43
- package/dist/collection/components/post-closebutton/post-closebutton.js +2 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +16 -6
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +25 -21
- package/dist/collection/components/post-footer/post-footer.js +9 -5
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +90 -15
- package/dist/collection/components/post-icon/post-icon.js +93 -23
- package/dist/collection/components/post-language-option/post-language-option.js +37 -8
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +24 -7
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.js +32 -0
- package/dist/collection/components/post-list/post-list.js +19 -6
- package/dist/collection/components/post-list-item/post-list-item.js +2 -1
- package/dist/collection/components/post-logo/post-logo.js +8 -4
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +197 -17
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +134 -64
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +18 -11
- package/dist/collection/components/post-menu/post-menu.js +56 -33
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +24 -16
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +26 -5
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +55 -8
- package/dist/collection/components/post-rating/post-rating.js +39 -7
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +9 -5
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +9 -5
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +25 -18
- package/dist/collection/components/post-tag/post-tag.css +1 -1
- package/dist/collection/components/post-tag/post-tag.js +23 -5
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +18 -14
- package/dist/collection/components/post-tooltip/post-tooltip.js +26 -9
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/attribute-observer.js +4 -4
- package/dist/collection/utils/breakpoints.js +9 -6
- package/dist/collection/utils/component-on-ready.js +4 -4
- package/dist/collection/utils/debounce.js +2 -1
- package/dist/collection/utils/get-focusable-children.js +2 -2
- package/dist/collection/utils/property-checkers/check-one-of.js +2 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +2 -1
- package/dist/collection/utils/property-checkers/check-type.js +4 -4
- package/dist/collection/utils/property-checkers/check-url.js +2 -1
- package/dist/collection/utils/property-checkers/empty-or.js +2 -1
- package/dist/collection/utils/sass-export.js +8 -5
- package/dist/components/index.js +36 -35
- package/dist/components/{post-collapsible-trigger2.js → p-05590ac0.js} +30 -27
- package/dist/components/{post-breadcrumb2.js → p-146677d1.js} +50 -43
- package/dist/components/p-1ee1742f.js +237 -0
- package/dist/components/p-2083ae2c.js +3 -0
- package/dist/components/{post-megadropdown-trigger2.js → p-27edc023.js} +21 -15
- package/dist/components/{post-tooltip2.js → p-2d9b46b4.js} +26 -14
- package/dist/components/p-38778a14.js +345 -0
- package/dist/components/p-3aba7629.js +29 -0
- package/dist/components/{post-togglebutton2.js → p-3cee636a.js} +20 -17
- package/dist/components/p-3e8554e7.js +1646 -0
- package/dist/components/p-424d5ea9.js +199 -0
- package/dist/components/p-46a6c5ec.js +168 -0
- package/dist/components/p-4965cfe1.js +145 -0
- package/{loaders/slide.js → dist/components/p-4af6dbed.js} +4 -4
- package/dist/components/{post-list2.js → p-536eba02.js} +19 -9
- package/dist/components/p-5653923a.js +44 -0
- package/dist/components/{post-footer2.js → p-58878996.js} +23 -17
- package/dist/components/{post-logo2.js → p-5f51ec58.js} +10 -7
- package/{loaders/post-popovercontainer2.js → dist/components/p-60cf53cc.js} +34 -11
- package/dist/components/p-64e3de38.js +11 -0
- package/dist/components/{post-accordion-item2.js → p-68ecd276.js} +26 -19
- package/dist/components/p-75b8b652.js +54 -0
- package/dist/components/{post-tab-panel2.js → p-78e1d893.js} +11 -8
- package/dist/components/{check-type.js → p-8562c7dc.js} +4 -4
- package/{loaders/post-menu-trigger2.js → dist/components/p-8b053fd5.js} +27 -20
- package/dist/components/{post-icon2.js → p-91031e3b.js} +85 -28
- package/dist/components/{post-menu2.js → p-91882483.js} +60 -65
- package/dist/{esm/attribute-observer-37fa950a.js → components/p-9748a355.js} +4 -4
- package/dist/components/{post-list-item2.js → p-9e4b1f10.js} +4 -4
- package/dist/components/{post-accordion2.js → p-a3a004e6.js} +17 -10
- package/dist/components/{post-popover2.js → p-af23f7de.js} +26 -12
- package/dist/components/{post-collapsible2.js → p-b018d864.js} +23 -14
- package/dist/components/{check-non-empty.js → p-b095519d.js} +1 -1
- package/dist/components/{check-one-of.js → p-bacd3e2c.js} +2 -1
- package/dist/components/{post-closebutton2.js → p-bf14d264.js} +6 -6
- package/dist/components/{post-breadcrumb-item2.js → p-c7c1d466.js} +13 -10
- package/dist/components/{post-tag2.js → p-cab43cee.js} +22 -11
- package/dist/components/{post-menu-item2.js → p-ccccf0c3.js} +4 -4
- package/dist/components/{post-tabs2.js → p-ce854a7d.js} +30 -19
- package/dist/components/{post-avatar2.js → p-d3fb70af.js} +31 -23
- package/dist/components/{post-language-option2.js → p-d47bb5bf.js} +32 -12
- package/dist/components/{debounce.js → p-e1baac59.js} +2 -1
- package/dist/components/{post-back-to-top2.js → p-e20366a6.js} +20 -15
- package/dist/components/{index2.js → p-eabb09ad.js} +9 -6
- package/dist/components/{post-language-switch2.js → p-f6d80d76.js} +29 -17
- package/dist/components/p-f7b9f90a.js +135 -0
- package/dist/components/{post-rating2.js → p-fc59de7c.js} +35 -12
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-avatar.js +1 -1
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +1 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumb.js +1 -1
- package/dist/components/post-card-control.js +1 -1
- package/dist/components/post-closebutton.js +1 -1
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-footer.js +1 -1
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-language-option.js +1 -1
- package/dist/components/post-language-switch.js +1 -1
- package/dist/components/post-linkarea.d.ts +11 -0
- package/dist/components/post-linkarea.js +6 -0
- package/dist/components/post-list-item.js +1 -1
- package/dist/components/post-list.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-tab-header.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-tag.js +1 -1
- package/dist/components/post-togglebutton.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/docs.d.ts +8 -0
- package/dist/docs.json +335 -156
- package/{loaders/attribute-observer.js → dist/esm/attribute-observer-2f203993.js} +4 -4
- package/{loaders/check-one-of.js → dist/esm/check-one-of-0d5858c0.js} +2 -1
- package/dist/esm/{check-type-8828dbe4.js → check-type-a6ccc9a3.js} +4 -4
- package/dist/esm/{check-url-a974431e.js → check-url-0bd876f7.js} +2 -1
- package/dist/esm/{debounce-abe98cc2.js → debounce-e54c7131.js} +2 -1
- package/dist/esm/fade-1f3cacf4.js +11 -0
- package/dist/esm/{index-6bfe6554.js → index-2c232bf2.js} +334 -152
- package/dist/esm/{index-b49c9904.js → index-d1bbbd88.js} +7 -5
- package/dist/esm/index.js +29 -28
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-8c98af5e.js +3 -0
- package/dist/esm/{post-accordion-ca48eb18.js → post-accordion-49fba403.js} +15 -8
- package/dist/esm/{post-accordion-item-a461f2a7.js → post-accordion-item-c516517a.js} +20 -13
- package/dist/esm/post-accordion-item.entry.js +7 -7
- package/dist/esm/post-accordion.entry.js +4 -4
- package/dist/esm/{post-avatar-0da1a2e8.js → post-avatar-b527ac63.js} +29 -21
- package/dist/esm/post-avatar.entry.js +3 -3
- package/dist/esm/post-back-to-top-f514c1f0.js +78 -0
- package/dist/esm/post-back-to-top.entry.js +5 -5
- package/dist/esm/post-banner-0ad7758b.js +108 -0
- package/dist/esm/post-banner.entry.js +8 -8
- package/dist/esm/{post-breadcrumb-85ffd02f.js → post-breadcrumb-57bca9dd.js} +41 -34
- package/dist/esm/post-breadcrumb-item_2.entry.js +7 -7
- package/dist/esm/post-breadcrumb.entry.js +5 -5
- package/dist/esm/post-card-control-ea741f60.js +312 -0
- package/dist/esm/post-card-control.entry.js +4 -4
- package/dist/esm/post-closebutton_15.entry.js +8 -8
- package/dist/esm/{post-collapsible-trigger-883db3bf.js → post-collapsible-trigger-31155750.js} +47 -35
- package/dist/esm/post-collapsible_2.entry.js +8 -8
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/{post-footer-7b0eb067.js → post-footer-cdde2086.js} +18 -12
- package/dist/esm/post-footer.entry.js +3 -3
- package/dist/esm/post-linkarea-cad95623.js +30 -0
- package/dist/esm/post-linkarea.entry.js +3 -0
- package/dist/esm/{post-menu-item-37f637a3.js → post-menu-item-db732728.js} +12 -9
- package/dist/esm/{post-popover-c24ecd38.js → post-popover-00f427ac.js} +24 -10
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/{post-rating-e1c66e5c.js → post-rating-cdcb2a1d.js} +33 -10
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-1d4113cb.js +34 -0
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-73b56a16.js → post-tab-panel-7a5c03ef.js} +9 -6
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-02e523b8.js → post-tabs-308190c0.js} +29 -18
- package/dist/esm/post-tabs.entry.js +4 -4
- package/dist/esm/{post-tag-43aba068.js → post-tag-aebbda10.js} +20 -9
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-c2231709.js → post-togglebutton-95ba85d2.js} +682 -221
- package/dist/esm/{post-tooltip-8271950c.js → post-tooltip-918d3a54.js} +24 -12
- package/dist/esm/post-tooltip.entry.js +8 -8
- package/dist/{components/slide.js → esm/slide-62768431.js} +4 -4
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-037d6ef2.entry.js +1 -0
- package/dist/post-components/p-1e69a72f.js +1 -0
- package/dist/post-components/p-1fda117c.js +1 -0
- package/dist/post-components/p-2083ae2c.js +1 -0
- package/dist/post-components/p-24297444.js +1 -0
- package/dist/post-components/{p-e2f886ab.js → p-267f52a9.js} +3 -3
- package/dist/post-components/p-2e6c5b60.js +1 -0
- package/dist/post-components/p-3591d4e3.entry.js +1 -0
- package/dist/post-components/p-3dec4425.entry.js +1 -0
- package/dist/post-components/p-423aecd4.js +1 -0
- package/dist/post-components/p-43221de8.entry.js +1 -0
- package/dist/post-components/p-48fd00e7.entry.js +1 -0
- package/dist/post-components/p-4af6dbed.js +1 -0
- package/dist/post-components/p-4ca79b52.js +1 -0
- package/dist/post-components/p-4d2dee9f.entry.js +1 -0
- package/dist/post-components/p-4fedef65.js +1 -0
- package/dist/post-components/p-59109b3b.entry.js +1 -0
- package/dist/post-components/p-64e3de38.js +1 -0
- package/dist/post-components/p-675352c3.entry.js +1 -0
- package/dist/post-components/p-6e4527d9.entry.js +1 -0
- package/dist/post-components/p-726bfda2.js +1 -0
- package/dist/post-components/p-767c0bf3.js +1 -0
- package/dist/post-components/p-796968bd.entry.js +1 -0
- package/dist/post-components/p-7c9758fa.js +1 -0
- package/dist/post-components/p-8a452260.js +1 -0
- package/dist/post-components/p-8a50b900.js +1 -0
- package/dist/post-components/p-8de4f677.entry.js +1 -0
- package/dist/post-components/p-93632808.js +1 -0
- package/dist/post-components/p-9748a355.js +1 -0
- package/dist/post-components/p-9aca3d07.entry.js +1 -0
- package/dist/post-components/p-9f0c5164.js +1 -0
- package/dist/post-components/p-a6436e7f.js +1 -0
- package/dist/post-components/p-ad246c0d.js +1 -0
- package/dist/post-components/p-b015efcb.entry.js +1 -0
- package/dist/post-components/p-b0afc087.entry.js +1 -0
- package/dist/post-components/p-b1adc221.js +1 -0
- package/dist/post-components/p-b2c0d21a.js +1 -0
- package/dist/post-components/p-b5a566f1.js +1 -0
- package/dist/post-components/p-c0961047.entry.js +1 -0
- package/dist/post-components/p-c388b7bb.entry.js +1 -0
- package/dist/post-components/{p-c510d968.entry.js → p-ca41b899.entry.js} +1 -1
- package/dist/post-components/p-d2395ae9.entry.js +1 -0
- package/dist/post-components/p-d9833667.js +2 -0
- package/dist/post-components/p-da261c46.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/animations/collapse.d.ts +2 -2
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/slide.d.ts +2 -2
- package/dist/types/components/post-header/post-header.d.ts +11 -2
- package/dist/types/components/post-icon/post-icon.d.ts +1 -1
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +1 -1
- package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +57 -3
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +26 -12
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +4 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components.d.ts +51 -25
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/dist/types/utils/attribute-observer.d.ts +1 -1
- package/dist/types/utils/component-on-ready.d.ts +1 -1
- package/dist/types/utils/get-focusable-children.d.ts +1 -1
- package/dist/types/utils/sass-export.d.ts +5 -1
- package/loaders/index.d.ts +2 -0
- package/loaders/index.js +3 -2
- package/loaders/{post-collapsible-trigger2.js → p-05590ac0.js} +30 -27
- package/loaders/{post-breadcrumb-item2.js → p-1beacb73.js} +13 -10
- package/loaders/p-2083ae2c.js +3 -0
- package/loaders/p-3aba7629.js +29 -0
- package/loaders/p-3e8554e7.js +1646 -0
- package/{dist/esm/slide-3422b8a3.js → loaders/p-4af6dbed.js} +4 -4
- package/loaders/{index2.js → p-56ad4838.js} +9 -6
- package/{dist/components/post-popovercontainer2.js → loaders/p-60cf53cc.js} +34 -11
- package/loaders/p-64e3de38.js +11 -0
- package/loaders/{post-accordion-item2.js → p-83baa315.js} +26 -19
- package/loaders/{check-type.js → p-8562c7dc.js} +4 -4
- package/{dist/components/post-menu-trigger2.js → loaders/p-8b053fd5.js} +27 -20
- package/loaders/{post-menu2.js → p-91882483.js} +60 -65
- package/{dist/components/attribute-observer.js → loaders/p-9748a355.js} +4 -4
- package/loaders/{post-collapsible2.js → p-9fac5d7d.js} +23 -14
- package/loaders/{check-non-empty.js → p-b095519d.js} +1 -1
- package/{dist/esm/check-one-of-6b3ef8eb.js → loaders/p-bacd3e2c.js} +2 -1
- package/loaders/{post-menu-item2.js → p-ccccf0c3.js} +4 -4
- package/loaders/{debounce.js → p-e1baac59.js} +2 -1
- package/loaders/{post-icon2.js → p-f7177e26.js} +85 -28
- package/loaders/p-f7b9f90a.js +135 -0
- package/loaders/post-accordion-item.js +1 -1
- package/loaders/post-accordion.js +17 -10
- package/loaders/post-avatar.js +31 -23
- package/loaders/post-back-to-top.js +20 -15
- package/loaders/post-banner.js +42 -23
- package/loaders/post-breadcrumb-item.js +1 -1
- package/loaders/post-breadcrumb.js +50 -43
- package/loaders/post-card-control.js +93 -51
- package/loaders/post-closebutton.js +6 -6
- package/loaders/post-collapsible-trigger.js +1 -1
- package/loaders/post-collapsible.js +1 -1
- package/loaders/post-footer.js +23 -17
- package/loaders/post-header.js +74 -154
- package/loaders/post-icon.js +1 -1
- package/loaders/post-language-option.js +32 -12
- package/loaders/post-language-switch.js +29 -17
- package/loaders/post-linkarea.d.ts +11 -0
- package/loaders/post-linkarea.js +47 -0
- package/loaders/post-list-item.js +4 -4
- package/loaders/post-list.js +19 -9
- package/loaders/post-logo.js +10 -7
- package/loaders/post-mainnavigation.js +197 -8
- package/loaders/post-megadropdown-trigger.js +21 -15
- package/loaders/post-megadropdown.js +119 -51
- package/loaders/post-menu-item.js +1 -1
- package/loaders/post-menu-trigger.js +1 -1
- package/loaders/post-menu.js +1 -1
- package/loaders/post-popover.js +26 -12
- package/loaders/post-popovercontainer.js +1 -1
- package/loaders/post-rating.js +35 -12
- package/loaders/post-tab-header.js +13 -10
- package/loaders/post-tab-panel.js +11 -8
- package/loaders/post-tabs.js +30 -19
- package/loaders/post-tag.js +22 -11
- package/loaders/post-togglebutton.js +20 -17
- package/loaders/post-tooltip.js +26 -14
- package/package.json +19 -16
- package/dist/cjs/fade-35a3633a.js +0 -10
- package/dist/cjs/post-back-to-top-71bc912c.js +0 -75
- package/dist/cjs/post-banner-d4e0c73c.js +0 -91
- package/dist/cjs/post-card-control-332f6f1f.js +0 -272
- package/dist/cjs/post-tab-header-1f057694.js +0 -33
- package/dist/components/fade.js +0 -7
- package/dist/components/package.js +0 -3
- package/dist/components/post-banner2.js +0 -126
- package/dist/components/post-card-control2.js +0 -303
- package/dist/components/post-header2.js +0 -279
- package/dist/components/post-mainnavigation2.js +0 -48
- package/dist/components/post-megadropdown2.js +0 -100
- package/dist/components/post-tab-header2.js +0 -51
- package/dist/esm/fade-7fd71785.js +0 -7
- package/dist/esm/package-f8f7bb40.js +0 -3
- package/dist/esm/post-back-to-top-77471a90.js +0 -73
- package/dist/esm/post-banner-b0af5bd3.js +0 -89
- package/dist/esm/post-card-control-3225eb57.js +0 -270
- package/dist/esm/post-tab-header-6a9b0153.js +0 -31
- package/dist/post-components/p-025688e5.js +0 -1
- package/dist/post-components/p-08b51b35.entry.js +0 -1
- package/dist/post-components/p-0e216cc4.js +0 -2
- package/dist/post-components/p-24c92608.js +0 -1
- package/dist/post-components/p-25a57971.js +0 -1
- package/dist/post-components/p-2737eaf5.js +0 -1
- package/dist/post-components/p-2cb4a8f1.js +0 -1
- package/dist/post-components/p-33b64e0c.js +0 -1
- package/dist/post-components/p-34d70cd5.js +0 -1
- package/dist/post-components/p-350f3900.entry.js +0 -1
- package/dist/post-components/p-35bc4554.js +0 -1
- package/dist/post-components/p-38b259a4.entry.js +0 -1
- package/dist/post-components/p-3c6cef1e.entry.js +0 -1
- package/dist/post-components/p-4a713cf8.js +0 -1
- package/dist/post-components/p-4b5e2b24.js +0 -1
- package/dist/post-components/p-515e0f96.js +0 -1
- package/dist/post-components/p-5467b223.js +0 -1
- package/dist/post-components/p-54e58fc2.entry.js +0 -1
- package/dist/post-components/p-637759d6.js +0 -1
- package/dist/post-components/p-6adeaa6c.js +0 -1
- package/dist/post-components/p-7589a19f.js +0 -1
- package/dist/post-components/p-7cce7342.entry.js +0 -1
- package/dist/post-components/p-819e19de.js +0 -1
- package/dist/post-components/p-82d48128.js +0 -1
- package/dist/post-components/p-85171893.entry.js +0 -1
- package/dist/post-components/p-882fdd0c.entry.js +0 -1
- package/dist/post-components/p-94399c69.js +0 -1
- package/dist/post-components/p-9a02b162.entry.js +0 -1
- package/dist/post-components/p-b1f5bc26.js +0 -1
- package/dist/post-components/p-b2f239a1.entry.js +0 -1
- package/dist/post-components/p-b571e5c8.js +0 -1
- package/dist/post-components/p-ba530822.js +0 -1
- package/dist/post-components/p-bae1c85f.entry.js +0 -1
- package/dist/post-components/p-bdabdec5.js +0 -1
- package/dist/post-components/p-c1225174.entry.js +0 -1
- package/dist/post-components/p-c372a141.entry.js +0 -1
- package/dist/post-components/p-c87c5d59.entry.js +0 -1
- package/dist/post-components/p-d04c1b7f.entry.js +0 -1
- package/dist/post-components/p-da300843.entry.js +0 -1
- package/dist/post-components/p-fec04a15.entry.js +0 -1
- package/loaders/fade.js +0 -7
- package/loaders/package.js +0 -3
- /package/dist/components/{heading-levels.js → p-247a1668.js} +0 -0
- /package/dist/components/{constants.js → p-440193f4.js} +0 -0
- /package/dist/components/{index.browser.js → p-5959f2bd.js} +0 -0
- /package/dist/components/{get-root.js → p-fc91cbc2.js} +0 -0
- /package/dist/post-components/{p-4a3f67ab.js → p-8562c7dc.js} +0 -0
- /package/dist/post-components/{p-611b3c41.js → p-bacd3e2c.js} +0 -0
- /package/dist/post-components/{p-b22656b1.js → p-cb9ab938.js} +0 -0
- /package/dist/post-components/{p-d4f93f2b.js → p-e1baac59.js} +0 -0
- /package/loaders/{heading-levels.js → p-247a1668.js} +0 -0
- /package/loaders/{constants.js → p-440193f4.js} +0 -0
- /package/loaders/{index.browser.js → p-5959f2bd.js} +0 -0
- /package/loaders/{get-root.js → p-fc91cbc2.js} +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
1
|
+
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { throttle } from "throttle-debounce";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import { slideDown, slideUp } from "../../animations/slide";
|
|
5
|
+
import { getFocusableChildren } from "../../utils/get-focusable-children";
|
|
5
6
|
/**
|
|
6
7
|
* @slot post-logo - Should be used together with the `<post-logo>` component.
|
|
7
8
|
* @slot meta-navigation - Holds an `<ul>` with meta navigation links.
|
|
@@ -12,23 +13,41 @@ import { slideDown, slideUp } from "../../animations/slide";
|
|
|
12
13
|
* @slot post-mainnavigation - Has a default slot because it's only meant to be used in the `<post-header>`.
|
|
13
14
|
*/
|
|
14
15
|
export class PostHeader {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
firstFocusableEl;
|
|
17
|
+
lastFocusableEl;
|
|
18
|
+
scrollParent = null;
|
|
19
|
+
mobileMenu;
|
|
20
|
+
mobileMenuAnimation;
|
|
21
|
+
throttledScroll = () => this.handleScrollEvent();
|
|
22
|
+
throttledResize = throttle(50, () => this.handleResize());
|
|
22
23
|
componentWillRender() {
|
|
23
24
|
this.scrollParent = this.getScrollParent(this.host);
|
|
24
25
|
this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
25
26
|
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
26
27
|
this.handleResize();
|
|
27
28
|
this.handleScrollEvent();
|
|
29
|
+
this.getFocusableElements();
|
|
28
30
|
}
|
|
31
|
+
host;
|
|
32
|
+
device = null;
|
|
33
|
+
mobileMenuExtended = false;
|
|
29
34
|
frozeBody(isMobileMenuExtended) {
|
|
30
35
|
document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
|
|
36
|
+
if (isMobileMenuExtended) {
|
|
37
|
+
this.host.addEventListener('keydown', e => {
|
|
38
|
+
this.keyboardHandler(e);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.host.removeEventListener('keydown', e => {
|
|
43
|
+
this.keyboardHandler(e);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
31
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* An event emitted when the device has changed
|
|
49
|
+
*/
|
|
50
|
+
postUpdateDevice;
|
|
32
51
|
/**
|
|
33
52
|
* Toggles the mobile navigation.
|
|
34
53
|
*/
|
|
@@ -48,6 +67,36 @@ export class PostHeader {
|
|
|
48
67
|
if (!this.mobileMenuExtended)
|
|
49
68
|
await this.mobileMenuAnimation.finished;
|
|
50
69
|
}
|
|
70
|
+
// Get all the focusable elements in the post-header mobile menu
|
|
71
|
+
getFocusableElements() {
|
|
72
|
+
// Get elements in the correct order (different as the DOM order)
|
|
73
|
+
const focusableEls = [
|
|
74
|
+
...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
|
|
75
|
+
...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-mainnavigation > .back-button, post-megadropdown-trigger')),
|
|
76
|
+
...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
|
|
77
|
+
];
|
|
78
|
+
// Add the main toggle menu button to the list of focusable children
|
|
79
|
+
const focusableChildren = [
|
|
80
|
+
this.host.querySelector('post-togglebutton'),
|
|
81
|
+
...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
|
|
82
|
+
];
|
|
83
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
84
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
85
|
+
}
|
|
86
|
+
keyboardHandler(e) {
|
|
87
|
+
if (e.key === 'Tab' && this.mobileMenuExtended) {
|
|
88
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
89
|
+
// If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
this.lastFocusableEl.focus();
|
|
92
|
+
}
|
|
93
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
94
|
+
// If Tab and last element is focused, focus goes back to the first element of the megadropdown
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
this.firstFocusableEl.focus();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
51
100
|
handleScrollEvent() {
|
|
52
101
|
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
53
102
|
const st = Math.max(0, this.scrollParent instanceof Document
|
|
@@ -79,10 +128,9 @@ export class PostHeader {
|
|
|
79
128
|
});
|
|
80
129
|
}
|
|
81
130
|
handleResize() {
|
|
82
|
-
var _a;
|
|
83
131
|
const previousDevice = this.device;
|
|
84
132
|
let newDevice;
|
|
85
|
-
const width = window
|
|
133
|
+
const width = window?.innerWidth;
|
|
86
134
|
if (width >= 1024) {
|
|
87
135
|
newDevice = 'desktop';
|
|
88
136
|
}
|
|
@@ -97,27 +145,30 @@ export class PostHeader {
|
|
|
97
145
|
this.toggleMobileMenu();
|
|
98
146
|
this.mobileMenuAnimation.finish(); // no animation
|
|
99
147
|
}
|
|
100
|
-
const mhh =
|
|
148
|
+
const mhh = this.host.shadowRoot.querySelector('.local-header')?.clientHeight;
|
|
101
149
|
this.host.style.setProperty('--main-header-height', `${mhh}px`);
|
|
102
150
|
// Apply only on change for doing work only when necessary
|
|
103
151
|
if (newDevice !== previousDevice) {
|
|
104
152
|
this.device = newDevice;
|
|
153
|
+
this.postUpdateDevice.emit(this.device);
|
|
105
154
|
window.requestAnimationFrame(() => {
|
|
106
155
|
this.switchLanguageSwitchMode();
|
|
107
156
|
});
|
|
108
157
|
}
|
|
109
158
|
}
|
|
110
159
|
switchLanguageSwitchMode() {
|
|
111
|
-
var _a;
|
|
112
160
|
const variant = this.device === 'desktop' ? 'menu' : 'list';
|
|
113
|
-
|
|
161
|
+
this.host.querySelector('post-language-switch')?.setAttribute('variant', variant);
|
|
114
162
|
}
|
|
115
|
-
|
|
163
|
+
renderNavigation() {
|
|
116
164
|
const navigationClasses = ['navigation'];
|
|
117
165
|
if (this.mobileMenuExtended) {
|
|
118
166
|
navigationClasses.push('extended');
|
|
119
167
|
}
|
|
120
|
-
return (h(
|
|
168
|
+
return (h("div", { ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, h("slot", { name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { class: "navigation-footer" }, h("slot", { name: "meta-navigation" }), h("slot", { name: "post-language-switch" })))));
|
|
169
|
+
}
|
|
170
|
+
render() {
|
|
171
|
+
return (h(Host, { key: 'efbf8028f2abf376f497081996dba759f5885630', version: version }, h("div", { key: 'ecaaea274045453ce869f36e8a1155626b1818ba', class: "global-header" }, h("div", { key: '2fda0d65321ad1cbbc47b731f095e0d9b6694d99', class: "global-sub" }, h("div", { key: '24864d5f18c9d923717cc2e996395cff3bd6ce8b', class: "logo" }, h("slot", { key: 'ba82d7f62bb845732fe6066bcdc7eef15913c9e6', name: "post-logo" }))), h("div", { key: 'a0ddea4e564fca1e286998c73fea75eb8c228428', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '0d7aa11452eb69fe28914ff7787c6dc206fd4009', name: "meta-navigation" }), h("slot", { key: 'e92b7b9db6e16e8fcecb1ca74efa63942dd542c5', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'c68984037a71d5ac54828f6cf2367c3b07e428fc', name: "post-language-switch" }), h("div", { key: '70fb5040dc2f000c2afa286bb673ae9cf88521cf', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '509fb81812262cd9efdb3a562e48f72b0d29e376', name: "post-togglebutton" })))), h("div", { key: '393d1040bad2f85caced5b4a8ff02e30fa5fd5f1', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, h("slot", { key: '786cc114aae985a0612d3cb044684290e3026462', name: "title" }), h("div", { key: 'd4f68653a09bbf0b222873ed5d23fec6ba9d8f6f', class: "local-sub" }, h("slot", { key: '0ad7dda5490964e9a8eae5e0bf66a117882f7a06', name: "local-controls" }), h("slot", { key: 'bddc01c7696f456c38c200b330767a0f1b353d88' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
|
|
121
172
|
}
|
|
122
173
|
static get is() { return "post-header"; }
|
|
123
174
|
static get encapsulation() { return "shadow"; }
|
|
@@ -137,6 +188,30 @@ export class PostHeader {
|
|
|
137
188
|
"mobileMenuExtended": {}
|
|
138
189
|
};
|
|
139
190
|
}
|
|
191
|
+
static get events() {
|
|
192
|
+
return [{
|
|
193
|
+
"method": "postUpdateDevice",
|
|
194
|
+
"name": "postUpdateDevice",
|
|
195
|
+
"bubbles": true,
|
|
196
|
+
"cancelable": true,
|
|
197
|
+
"composed": true,
|
|
198
|
+
"docs": {
|
|
199
|
+
"tags": [],
|
|
200
|
+
"text": "An event emitted when the device has changed"
|
|
201
|
+
},
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "DEVICE_SIZE",
|
|
204
|
+
"resolved": "\"desktop\" | \"mobile\" | \"tablet\"",
|
|
205
|
+
"references": {
|
|
206
|
+
"DEVICE_SIZE": {
|
|
207
|
+
"location": "local",
|
|
208
|
+
"path": "/home/runner/work/design-system/design-system/packages/components/src/components/post-header/post-header.tsx",
|
|
209
|
+
"id": "src/components/post-header/post-header.tsx::DEVICE_SIZE"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}];
|
|
214
|
+
}
|
|
140
215
|
static get methods() {
|
|
141
216
|
return {
|
|
142
217
|
"toggleMobileMenu": {
|
|
@@ -15,54 +15,110 @@ const ANIMATION_KEYS = [...ANIMATION_NAMES];
|
|
|
15
15
|
* @class PostIcon - representing a stencil component
|
|
16
16
|
*/
|
|
17
17
|
export class PostIcon {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.name = undefined;
|
|
24
|
-
this.rotate = null;
|
|
25
|
-
this.scale = null;
|
|
26
|
-
}
|
|
18
|
+
host;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the animation.
|
|
21
|
+
*/
|
|
22
|
+
animation = null;
|
|
27
23
|
validateAnimation(newValue = this.animation) {
|
|
28
24
|
if (newValue !== undefined)
|
|
29
25
|
checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon "animation" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);
|
|
30
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
|
|
29
|
+
*/
|
|
30
|
+
base = null;
|
|
31
31
|
validateBase(newValue = this.base) {
|
|
32
32
|
checkEmptyOrType(newValue, 'string', 'The post-icon "base" prop should be a string.');
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* When set to `true`, the icon will be flipped horizontally.
|
|
36
|
+
*/
|
|
37
|
+
flipH = false;
|
|
34
38
|
validateFlipH(newValue = this.flipH) {
|
|
35
39
|
checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipH" prop should be a boolean.');
|
|
36
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* When set to `true`, the icon will be flipped vertically.
|
|
43
|
+
*/
|
|
44
|
+
flipV = false;
|
|
37
45
|
validateFlipV(newValue = this.flipV) {
|
|
38
46
|
checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipV" prop should be a boolean.');
|
|
39
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* The name/id of the icon (e.g. 1000, 1001, ...).
|
|
50
|
+
*/
|
|
51
|
+
name;
|
|
40
52
|
validateName(newValue = this.name) {
|
|
41
53
|
checkNonEmpty(newValue, 'The post-icon "name" prop is required!.');
|
|
42
54
|
checkType(newValue, 'string', 'The post-icon "name" prop should be a string.');
|
|
43
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* The number of degree for the css rotate transformation.
|
|
58
|
+
*/
|
|
59
|
+
rotate = null;
|
|
44
60
|
validateRotate(newValue = this.rotate) {
|
|
45
61
|
checkEmptyOrType(newValue, 'number', 'The post-icon "rotate" prop should be a number.');
|
|
46
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* The number for the css scale transformation.
|
|
65
|
+
*/
|
|
66
|
+
scale = null;
|
|
47
67
|
validateScale(newValue = this.scale) {
|
|
48
68
|
checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
|
|
49
69
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
// Construct the icon url from different possible sources
|
|
71
|
+
getUrl() {
|
|
72
|
+
// the first definition object which defines a domain, will be used to set the domain of the file url
|
|
73
|
+
// the first definition object which defines a slug, will be used to set the slug of the file url
|
|
74
|
+
const urlDefinitions = [
|
|
75
|
+
getUrlDefinition(this.base, 'both'),
|
|
76
|
+
getUrlDefinition(document.head
|
|
77
|
+
.querySelector('meta[name="design-system-settings"][data-post-icon-base]')
|
|
78
|
+
?.getAttribute('data-post-icon-base'), 'relative'),
|
|
79
|
+
getUrlDefinition(document.querySelector('base[href]')?.getAttribute('href'), 'both'),
|
|
80
|
+
];
|
|
81
|
+
// in case no other definition defines a domain, the current origin is used as a fallback
|
|
82
|
+
const origin = urlDefinitions.find(d => d.definesDomain)?.url?.origin ?? window.location.origin;
|
|
83
|
+
// in case no other definition defines a slug, the cdn url is used as a fallback
|
|
84
|
+
const slug = urlDefinitions.find(d => d.definesSlug)?.url?.pathname;
|
|
85
|
+
const file = `${this.name}.svg`;
|
|
86
|
+
let url;
|
|
87
|
+
if (slug) {
|
|
88
|
+
url = new URL(`${origin}${slug}/${file}`).toString();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
url = new URL(`${CDN_URL}/${file}`).toString();
|
|
92
|
+
}
|
|
93
|
+
return url;
|
|
94
|
+
function getUrlDefinition(url, allow) {
|
|
95
|
+
return {
|
|
96
|
+
url: getUrlObject(url),
|
|
97
|
+
definesDomain: allow !== 'relative' ? definesDomain(url) : false,
|
|
98
|
+
definesSlug: allow !== 'absolute' ? definesSlug(url) : false,
|
|
99
|
+
};
|
|
100
|
+
function getUrlObject(url) {
|
|
101
|
+
if (url) {
|
|
102
|
+
return definesDomain(url) ? new URL(url) : new URL(url, window.location.origin);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function definesDomain(url) {
|
|
109
|
+
return url ? /^https?:\/\//.test(url) : false;
|
|
110
|
+
}
|
|
111
|
+
function definesSlug(url) {
|
|
112
|
+
const urlObject = getUrlObject(url);
|
|
113
|
+
return Boolean(/^\/.+/.test(urlObject?.pathname));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
60
116
|
}
|
|
61
117
|
getStyles() {
|
|
62
|
-
const
|
|
118
|
+
const url = this.getUrl();
|
|
63
119
|
return Object.entries({
|
|
64
|
-
'-webkit-mask-image': `url(${
|
|
65
|
-
'mask-image': `url('${
|
|
120
|
+
'-webkit-mask-image': `url(${url})`,
|
|
121
|
+
'mask-image': `url('${url}')`,
|
|
66
122
|
'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
67
123
|
(this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
|
|
68
124
|
})
|
|
@@ -79,7 +135,7 @@ export class PostIcon {
|
|
|
79
135
|
this.validateAnimation();
|
|
80
136
|
}
|
|
81
137
|
render() {
|
|
82
|
-
return (h(Host, { key: '
|
|
138
|
+
return (h(Host, { key: '6c494ba3cdd2ee173fa99a8ce8ff0e8ab5cf2979', "data-version": version }, h("span", { key: 'd9e0192a2788541b97bf3e25468129ac335d44b5', style: this.getStyles() })));
|
|
83
139
|
}
|
|
84
140
|
static get is() { return "post-icon"; }
|
|
85
141
|
static get encapsulation() { return "shadow"; }
|
|
@@ -114,6 +170,8 @@ export class PostIcon {
|
|
|
114
170
|
"tags": [],
|
|
115
171
|
"text": "The name of the animation."
|
|
116
172
|
},
|
|
173
|
+
"getter": false,
|
|
174
|
+
"setter": false,
|
|
117
175
|
"attribute": "animation",
|
|
118
176
|
"reflect": false,
|
|
119
177
|
"defaultValue": "null"
|
|
@@ -132,6 +190,8 @@ export class PostIcon {
|
|
|
132
190
|
"tags": [],
|
|
133
191
|
"text": "The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url."
|
|
134
192
|
},
|
|
193
|
+
"getter": false,
|
|
194
|
+
"setter": false,
|
|
135
195
|
"attribute": "base",
|
|
136
196
|
"reflect": false,
|
|
137
197
|
"defaultValue": "null"
|
|
@@ -150,6 +210,8 @@ export class PostIcon {
|
|
|
150
210
|
"tags": [],
|
|
151
211
|
"text": "When set to `true`, the icon will be flipped horizontally."
|
|
152
212
|
},
|
|
213
|
+
"getter": false,
|
|
214
|
+
"setter": false,
|
|
153
215
|
"attribute": "flip-h",
|
|
154
216
|
"reflect": false,
|
|
155
217
|
"defaultValue": "false"
|
|
@@ -168,6 +230,8 @@ export class PostIcon {
|
|
|
168
230
|
"tags": [],
|
|
169
231
|
"text": "When set to `true`, the icon will be flipped vertically."
|
|
170
232
|
},
|
|
233
|
+
"getter": false,
|
|
234
|
+
"setter": false,
|
|
171
235
|
"attribute": "flip-v",
|
|
172
236
|
"reflect": false,
|
|
173
237
|
"defaultValue": "false"
|
|
@@ -186,6 +250,8 @@ export class PostIcon {
|
|
|
186
250
|
"tags": [],
|
|
187
251
|
"text": "The name/id of the icon (e.g. 1000, 1001, ...)."
|
|
188
252
|
},
|
|
253
|
+
"getter": false,
|
|
254
|
+
"setter": false,
|
|
189
255
|
"attribute": "name",
|
|
190
256
|
"reflect": false
|
|
191
257
|
},
|
|
@@ -203,6 +269,8 @@ export class PostIcon {
|
|
|
203
269
|
"tags": [],
|
|
204
270
|
"text": "The number of degree for the css rotate transformation."
|
|
205
271
|
},
|
|
272
|
+
"getter": false,
|
|
273
|
+
"setter": false,
|
|
206
274
|
"attribute": "rotate",
|
|
207
275
|
"reflect": false,
|
|
208
276
|
"defaultValue": "null"
|
|
@@ -221,6 +289,8 @@ export class PostIcon {
|
|
|
221
289
|
"tags": [],
|
|
222
290
|
"text": "The number for the css scale transformation."
|
|
223
291
|
},
|
|
292
|
+
"getter": false,
|
|
293
|
+
"setter": false,
|
|
224
294
|
"attribute": "scale",
|
|
225
295
|
"reflect": false,
|
|
226
296
|
"defaultValue": "null"
|
|
@@ -5,22 +5,37 @@ import { version } from "../../../../package";
|
|
|
5
5
|
* @slot default - Slot for placing the content inside the anchor or button.
|
|
6
6
|
*/
|
|
7
7
|
export class PostLanguageOption {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.url = undefined;
|
|
14
|
-
}
|
|
8
|
+
host;
|
|
9
|
+
/**
|
|
10
|
+
* The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, "de".
|
|
11
|
+
*/
|
|
12
|
+
code;
|
|
15
13
|
validateCode(value = this.code) {
|
|
16
14
|
checkType(value, 'string', 'The "code" property of the post-language-option component must be a string.');
|
|
17
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* If set to `true`, the language option is considered the current language for the page.
|
|
18
|
+
*/
|
|
19
|
+
active;
|
|
18
20
|
validateActiveProp(value = this.active) {
|
|
19
21
|
checkEmptyOrType(value, 'boolean', 'The "active" property of the post-language-option component must be a boolean value.');
|
|
20
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* The variant of the post-language-switch parent (dynamically set by the parent)
|
|
25
|
+
*/
|
|
26
|
+
variant;
|
|
27
|
+
/**
|
|
28
|
+
* The full name of the language. For example, "Deutsch".
|
|
29
|
+
*/
|
|
30
|
+
name;
|
|
21
31
|
validateName(value = this.name) {
|
|
22
32
|
checkEmptyOrType(value, 'string', 'The "name" property of the post-language-option component must be a string.');
|
|
23
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* The URL used for the href attribute of the internal anchor.
|
|
36
|
+
* This field is optional; if not provided, a button will be used internally instead of an anchor.
|
|
37
|
+
*/
|
|
38
|
+
url;
|
|
24
39
|
validateUrl(value = this.url) {
|
|
25
40
|
checkEmptyOrType(value, 'string', 'The "url" property of the post-language-option component must be a valid URL.');
|
|
26
41
|
}
|
|
@@ -33,6 +48,10 @@ export class PostLanguageOption {
|
|
|
33
48
|
throw new Error('The "name" property of the post-language-option component is required when the full language name is not displayed.');
|
|
34
49
|
}
|
|
35
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* An event emitted when the language option is clicked. The payload is the ISO 639 code of the language.
|
|
53
|
+
*/
|
|
54
|
+
postChange;
|
|
36
55
|
/**
|
|
37
56
|
* Selects the language option programmatically.
|
|
38
57
|
*/
|
|
@@ -53,7 +72,7 @@ export class PostLanguageOption {
|
|
|
53
72
|
this.emitChange();
|
|
54
73
|
}
|
|
55
74
|
};
|
|
56
|
-
return (h(Host, { key: '
|
|
75
|
+
return (h(Host, { key: 'eff35e907ca174aa239604d8e3c937309d306cd1', "data-version": version, role: this.variant ? `${this.variant}item` : null }, this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null))) : (h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null)))));
|
|
57
76
|
}
|
|
58
77
|
static get is() { return "post-language-option"; }
|
|
59
78
|
static get originalStyleUrls() {
|
|
@@ -82,6 +101,8 @@ export class PostLanguageOption {
|
|
|
82
101
|
"tags": [],
|
|
83
102
|
"text": "The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, \"de\"."
|
|
84
103
|
},
|
|
104
|
+
"getter": false,
|
|
105
|
+
"setter": false,
|
|
85
106
|
"attribute": "code",
|
|
86
107
|
"reflect": false
|
|
87
108
|
},
|
|
@@ -99,6 +120,8 @@ export class PostLanguageOption {
|
|
|
99
120
|
"tags": [],
|
|
100
121
|
"text": "If set to `true`, the language option is considered the current language for the page."
|
|
101
122
|
},
|
|
123
|
+
"getter": false,
|
|
124
|
+
"setter": false,
|
|
102
125
|
"attribute": "active",
|
|
103
126
|
"reflect": true
|
|
104
127
|
},
|
|
@@ -122,6 +145,8 @@ export class PostLanguageOption {
|
|
|
122
145
|
"tags": [],
|
|
123
146
|
"text": "The variant of the post-language-switch parent (dynamically set by the parent)"
|
|
124
147
|
},
|
|
148
|
+
"getter": false,
|
|
149
|
+
"setter": false,
|
|
125
150
|
"attribute": "variant",
|
|
126
151
|
"reflect": false
|
|
127
152
|
},
|
|
@@ -139,6 +164,8 @@ export class PostLanguageOption {
|
|
|
139
164
|
"tags": [],
|
|
140
165
|
"text": "The full name of the language. For example, \"Deutsch\"."
|
|
141
166
|
},
|
|
167
|
+
"getter": false,
|
|
168
|
+
"setter": false,
|
|
142
169
|
"attribute": "name",
|
|
143
170
|
"reflect": false
|
|
144
171
|
},
|
|
@@ -156,6 +183,8 @@ export class PostLanguageOption {
|
|
|
156
183
|
"tags": [],
|
|
157
184
|
"text": "The URL used for the href attribute of the internal anchor.\nThis field is optional; if not provided, a button will be used internally instead of an anchor."
|
|
158
185
|
},
|
|
186
|
+
"getter": false,
|
|
187
|
+
"setter": false,
|
|
159
188
|
"attribute": "url",
|
|
160
189
|
"reflect": false
|
|
161
190
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{display:block}@media screen and (max-width: 1023.
|
|
1
|
+
:host{display:block}@media screen and (max-width: 1023.98px){:host{display:flex !important;gap:.5rem}}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-dropdown-container>*{width:100%}.post-language-switch-trigger{cursor:pointer;padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-decoration:none;display:inline-flex;align-items:center;gap:var(--post-core-dimension-6);border-radius:var(--post-core-dimension-24);font-size:var(--post-core-font-size-16);padding:var(--post-core-dimension-3) var(--post-core-dimension-10)}.post-language-switch-trigger{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-switch-trigger:not(:disabled):hover,.post-language-switch-trigger.pretend-hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-switch-trigger post-icon{height:var(--post-core-dimension-16);width:var(--post-core-dimension-16)}
|
|
@@ -4,22 +4,32 @@ import { version } from "../../../../package";
|
|
|
4
4
|
import { SWITCH_VARIANTS } from "./switch-variants";
|
|
5
5
|
import { nanoid } from "nanoid";
|
|
6
6
|
export class PostLanguageSwitch {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.activeLang = undefined;
|
|
13
|
-
}
|
|
7
|
+
host;
|
|
8
|
+
/**
|
|
9
|
+
* A title for the list of language options
|
|
10
|
+
*/
|
|
11
|
+
caption;
|
|
14
12
|
validateCaption(value = this.caption) {
|
|
15
13
|
checkType(value, 'string', 'The "caption" property of the post-language-switch component must be a string.');
|
|
16
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* A descriptive text for the list of language options
|
|
17
|
+
*/
|
|
18
|
+
description;
|
|
17
19
|
validateDescription(value = this.description) {
|
|
18
20
|
checkType(value, 'string', 'The "description" property of the post-language-switch component must be a string.');
|
|
19
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)
|
|
24
|
+
*/
|
|
25
|
+
variant = 'list';
|
|
20
26
|
validateVariant(value = this.variant) {
|
|
21
27
|
checkEmptyOrOneOf(value, SWITCH_VARIANTS, `The "variant" property of the post-language-switch component must be: ${SWITCH_VARIANTS.join(', ')}`);
|
|
22
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The active language of the language switch
|
|
31
|
+
*/
|
|
32
|
+
activeLang;
|
|
23
33
|
connectedCallback() {
|
|
24
34
|
this.updateChildrenVariant();
|
|
25
35
|
// Get the active language based on children's active state
|
|
@@ -59,6 +69,7 @@ export class PostLanguageSwitch {
|
|
|
59
69
|
}
|
|
60
70
|
});
|
|
61
71
|
}
|
|
72
|
+
menuId = `p${nanoid(11)}`;
|
|
62
73
|
renderList() {
|
|
63
74
|
return (h(Host, { "data-version": version, "aria-label": `${this.caption}, ${this.description}`, "aria-role": "list" }, h("slot", null)));
|
|
64
75
|
}
|
|
@@ -96,6 +107,8 @@ export class PostLanguageSwitch {
|
|
|
96
107
|
"tags": [],
|
|
97
108
|
"text": "A title for the list of language options"
|
|
98
109
|
},
|
|
110
|
+
"getter": false,
|
|
111
|
+
"setter": false,
|
|
99
112
|
"attribute": "caption",
|
|
100
113
|
"reflect": false
|
|
101
114
|
},
|
|
@@ -113,6 +126,8 @@ export class PostLanguageSwitch {
|
|
|
113
126
|
"tags": [],
|
|
114
127
|
"text": "A descriptive text for the list of language options"
|
|
115
128
|
},
|
|
129
|
+
"getter": false,
|
|
130
|
+
"setter": false,
|
|
116
131
|
"attribute": "description",
|
|
117
132
|
"reflect": false
|
|
118
133
|
},
|
|
@@ -136,6 +151,8 @@ export class PostLanguageSwitch {
|
|
|
136
151
|
"tags": [],
|
|
137
152
|
"text": "Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)"
|
|
138
153
|
},
|
|
154
|
+
"getter": false,
|
|
155
|
+
"setter": false,
|
|
139
156
|
"attribute": "variant",
|
|
140
157
|
"reflect": false,
|
|
141
158
|
"defaultValue": "'list'"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:host{display:contents;cursor:pointer}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
export class PostLinkarea {
|
|
4
|
+
hostElement;
|
|
5
|
+
handleClick = () => {
|
|
6
|
+
const customSlottedLink = this.hostElement.querySelector('a[data-link]');
|
|
7
|
+
const linkElement = customSlottedLink
|
|
8
|
+
? customSlottedLink
|
|
9
|
+
: this.hostElement.querySelector('a');
|
|
10
|
+
if (linkElement.href) {
|
|
11
|
+
window.location.href = linkElement.href;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
console.error('<post-linkarea> : Your element must contain a child with a `href` property.');
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
render() {
|
|
18
|
+
return (h(Host, { key: 'fd83dca8dca965d14f5a844454e79d7fb449639d', "data-version": version, onClick: this.handleClick, tabindex: "0" }, h("slot", { key: '278537c9aabe710d118cdd6075ab506a8a4dcfe2' })));
|
|
19
|
+
}
|
|
20
|
+
static get is() { return "post-linkarea"; }
|
|
21
|
+
static get originalStyleUrls() {
|
|
22
|
+
return {
|
|
23
|
+
"$": ["post-linkarea.scss"]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
static get styleUrls() {
|
|
27
|
+
return {
|
|
28
|
+
"$": ["post-linkarea.css"]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static get elementRef() { return "hostElement"; }
|
|
32
|
+
}
|