@swisspost/design-system-components 9.0.0-next.2 → 9.0.0-next.21
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-non-empty-bd99d236.js +15 -0
- package/dist/cjs/check-one-of-75d270b5.js +13 -0
- package/dist/cjs/check-type-cdbf6d29.js +21 -0
- package/dist/cjs/check-url-220a286c.js +19 -0
- package/dist/cjs/debounce-158fd76f.js +13 -0
- package/dist/cjs/fade-72d5ef55.js +14 -0
- package/dist/cjs/get-root-7a3498ef.js +11 -0
- package/dist/cjs/index-23e36ff7.js +37 -0
- package/dist/cjs/{index-c15bd800.js → index-5acef487.js} +54 -17
- package/dist/cjs/index.browser-2f65f583.js +15 -0
- package/dist/cjs/index.cjs.js +56 -27
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-a7150f64.js → package-c6bc9e82.js} +1 -1
- package/dist/cjs/{post-accordion-62d2fd79.js → post-accordion-d1345784.js} +9 -8
- package/dist/cjs/post-accordion-item-a796d803.js +64 -0
- package/dist/cjs/post-accordion-item.cjs.entry.js +8 -5
- package/dist/cjs/post-accordion.cjs.entry.js +4 -4
- package/dist/cjs/post-avatar-b4e96354.js +144 -0
- package/dist/cjs/post-avatar.cjs.entry.js +13 -0
- package/dist/cjs/post-back-to-top-fc541c6b.js +76 -0
- package/dist/cjs/post-back-to-top.cjs.entry.js +15 -0
- package/dist/cjs/post-banner-46522b4f.js +96 -0
- package/dist/cjs/post-banner.cjs.entry.js +19 -0
- package/dist/cjs/post-breadcrumb-799d34da.js +112 -0
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +17 -0
- package/dist/cjs/post-breadcrumb.cjs.entry.js +13 -0
- package/dist/cjs/post-card-control-7bf7d3f2.js +283 -0
- package/dist/cjs/post-card-control.cjs.entry.js +5 -5
- package/dist/cjs/post-closebutton_15.cjs.entry.js +34 -0
- package/dist/cjs/{post-collapsible-trigger-9dca8493.js → post-collapsible-trigger-0568e3ec.js} +50 -56
- package/dist/cjs/post-collapsible_2.cjs.entry.js +10 -6
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-footer-f87a556b.js +88 -0
- package/dist/cjs/post-footer.cjs.entry.js +11 -0
- package/dist/cjs/post-linkarea-0ccf93fc.js +30 -0
- package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
- package/dist/cjs/post-menu-item-eba24c40.js +68 -0
- package/dist/cjs/post-popover-35f679f6.js +106 -0
- package/dist/cjs/post-popover.cjs.entry.js +4 -4
- package/dist/cjs/{post-rating-db5a397a.js → post-rating-d12fa214.js} +16 -6
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-89dca04b.js +33 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +5 -4
- package/dist/cjs/{post-tab-panel-d59cf1ec.js → post-tab-panel-ad1ab180.js} +6 -5
- package/dist/cjs/post-tab-panel.cjs.entry.js +4 -3
- package/dist/cjs/{post-tabs-7afae61a.js → post-tabs-0db75745.js} +23 -16
- package/dist/cjs/post-tabs.cjs.entry.js +4 -4
- package/dist/cjs/post-tag-396a46c9.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/post-togglebutton-69983699.js +3861 -0
- package/dist/cjs/{post-tooltip-432852c7.js → post-tooltip-7174ea97.js} +38 -25
- package/dist/cjs/post-tooltip.cjs.entry.js +8 -6
- package/dist/cjs/slide-8ae17ee4.js +28 -0
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/fade.js +6 -2
- package/dist/collection/animations/slide.js +23 -0
- package/dist/collection/collection-manifest.json +22 -3
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +5 -3
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +29 -11
- package/dist/collection/components/post-avatar/post-avatar.css +3 -0
- package/dist/collection/components/post-avatar/post-avatar.js +234 -0
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -0
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +109 -0
- package/dist/collection/components/post-banner/banner-types.js +1 -0
- package/dist/collection/components/post-banner/post-banner.css +3 -0
- package/dist/collection/components/{post-alert/post-alert.js → post-banner/post-banner.js} +51 -73
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +3 -0
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +163 -0
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -0
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +98 -0
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +55 -43
- package/dist/collection/components/post-closebutton/post-closebutton.js +13 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +15 -6
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +21 -20
- package/dist/collection/components/post-footer/post-footer.css +1 -0
- package/dist/collection/components/post-footer/post-footer.js +76 -0
- package/dist/collection/components/post-header/post-header.css +1 -0
- package/dist/collection/components/post-header/post-header.js +267 -0
- package/dist/collection/components/post-icon/post-icon.js +80 -47
- package/dist/collection/components/post-language-option/post-language-option.css +3 -0
- package/dist/collection/components/post-language-option/post-language-option.js +224 -0
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -0
- package/dist/collection/components/post-language-switch/post-language-switch.js +164 -0
- package/dist/collection/components/post-language-switch/switch-variants.js +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.js +30 -0
- package/dist/collection/components/post-list/post-list.css +3 -0
- package/dist/collection/components/post-list/post-list.js +90 -0
- package/dist/collection/components/post-list-item/post-list-item.css +1 -0
- package/dist/collection/components/post-list-item/post-list-item.js +26 -0
- package/dist/collection/components/post-logo/post-logo.css +1 -1
- package/dist/collection/components/post-logo/post-logo.js +4 -3
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -0
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +255 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +268 -0
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -0
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +127 -0
- package/dist/collection/components/post-menu/post-menu.css +3 -0
- package/dist/collection/components/post-menu/post-menu.js +297 -0
- package/dist/collection/components/post-menu-item/post-menu-item.js +8 -0
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +1 -0
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +122 -0
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +6 -3
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +193 -38
- package/dist/collection/components/post-rating/post-rating.css +1 -1
- package/dist/collection/components/post-rating/post-rating.js +13 -2
- package/dist/collection/components/post-tab-header/post-tab-header.css +2 -2
- package/dist/collection/components/post-tab-header/post-tab-header.js +6 -4
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +4 -2
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +17 -14
- package/dist/collection/components/post-tag/post-tag.css +1 -1
- package/dist/collection/components/post-tag/post-tag.js +3 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.css +1 -0
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +75 -0
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +35 -17
- package/dist/collection/index.js +21 -2
- package/dist/collection/utils/attribute-observer.js +4 -4
- package/dist/collection/utils/breakpoints.js +50 -0
- 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 +33 -0
- package/dist/collection/utils/property-checkers/check-non-empty.js +6 -2
- package/dist/collection/utils/property-checkers/check-one-of.js +8 -3
- package/dist/collection/utils/property-checkers/check-pattern.js +8 -3
- package/dist/collection/utils/property-checkers/check-type.js +11 -6
- package/dist/collection/utils/property-checkers/check-url.js +11 -6
- package/dist/collection/utils/property-checkers/empty-or.js +5 -2
- package/dist/collection/utils/sass-export.js +8 -5
- package/dist/components/attribute-observer.js +4 -4
- package/dist/components/check-non-empty.js +6 -2
- package/dist/components/check-one-of.js +8 -3
- package/dist/components/check-type.js +11 -6
- package/dist/components/debounce.js +11 -0
- package/dist/components/fade.js +6 -2
- package/dist/components/get-focusable-children.js +35 -0
- package/dist/components/get-root.js +9 -0
- package/dist/components/index.browser.js +13 -0
- package/dist/components/index.js +21 -2
- package/dist/components/index2.js +25 -12
- package/dist/components/index3.js +135 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +36 -16
- package/dist/components/post-accordion2.js +6 -5
- package/dist/components/post-avatar.d.ts +11 -0
- package/dist/components/post-avatar.js +6 -0
- package/dist/components/post-avatar2.js +169 -0
- package/dist/components/post-back-to-top.d.ts +11 -0
- package/dist/components/post-back-to-top.js +6 -0
- package/dist/components/post-back-to-top2.js +101 -0
- package/dist/components/post-banner.d.ts +11 -0
- package/dist/components/post-banner.js +6 -0
- package/dist/components/post-banner2.js +131 -0
- package/dist/components/post-breadcrumb-item.d.ts +11 -0
- package/dist/components/post-breadcrumb-item.js +6 -0
- package/dist/components/post-breadcrumb-item2.js +82 -0
- package/dist/components/post-breadcrumb.d.ts +11 -0
- package/dist/components/post-breadcrumb.js +6 -0
- package/dist/components/post-breadcrumb2.js +169 -0
- package/dist/components/post-card-control2.js +50 -39
- package/dist/components/post-closebutton.d.ts +11 -0
- package/dist/components/post-closebutton.js +6 -0
- package/dist/components/post-closebutton2.js +34 -0
- package/dist/components/post-collapsible-trigger2.js +23 -38
- package/dist/components/post-collapsible2.js +22 -14
- package/dist/components/post-footer.d.ts +11 -0
- package/dist/components/post-footer.js +6 -0
- package/dist/components/post-footer2.js +128 -0
- package/dist/components/post-header.d.ts +11 -0
- package/dist/components/post-header.js +6 -0
- package/dist/components/post-header2.js +217 -0
- package/dist/components/post-icon2.js +82 -46
- package/dist/components/post-language-option.d.ts +11 -0
- package/dist/components/post-language-option.js +6 -0
- package/dist/components/post-language-option2.js +102 -0
- package/dist/components/post-language-switch.d.ts +11 -0
- package/dist/components/post-language-switch.js +6 -0
- package/dist/components/post-language-switch2.js +135 -0
- package/dist/components/post-linkarea.d.ts +11 -0
- package/dist/components/post-linkarea.js +6 -0
- package/dist/components/post-linkarea2.js +42 -0
- package/dist/components/post-list-item.d.ts +11 -0
- package/dist/components/post-list-item.js +6 -0
- package/dist/components/post-list-item2.js +35 -0
- package/dist/components/{post-alert.d.ts → post-list.d.ts} +4 -4
- package/dist/components/post-list.js +6 -0
- package/dist/components/post-list2.js +55 -0
- package/dist/components/post-logo2.js +5 -5
- package/dist/components/post-mainnavigation.d.ts +11 -0
- package/dist/components/post-mainnavigation.js +6 -0
- package/dist/components/post-mainnavigation2.js +258 -0
- package/dist/components/post-megadropdown-trigger.d.ts +11 -0
- package/dist/components/post-megadropdown-trigger.js +6 -0
- package/dist/components/post-megadropdown-trigger2.js +113 -0
- package/dist/components/post-megadropdown.d.ts +11 -0
- package/dist/components/post-megadropdown.js +6 -0
- package/dist/components/post-megadropdown2.js +186 -0
- package/dist/components/post-menu-item.d.ts +11 -0
- package/dist/components/post-menu-item.js +6 -0
- package/dist/components/post-menu-item2.js +27 -0
- package/dist/components/post-menu-trigger.d.ts +11 -0
- package/dist/components/post-menu-trigger.js +6 -0
- package/dist/components/post-menu-trigger2.js +109 -0
- package/dist/components/post-menu.d.ts +11 -0
- package/dist/components/post-menu.js +6 -0
- package/dist/components/post-menu2.js +193 -0
- package/dist/components/post-popover2.js +6 -4
- package/dist/components/post-popovercontainer2.js +227 -59
- package/dist/components/post-rating2.js +14 -4
- package/dist/components/post-tab-header2.js +7 -6
- package/dist/components/post-tab-panel2.js +4 -3
- package/dist/components/post-tabs2.js +20 -13
- package/dist/components/post-tag2.js +3 -3
- package/dist/components/post-togglebutton.d.ts +11 -0
- package/dist/components/post-togglebutton.js +6 -0
- package/dist/components/post-togglebutton2.js +61 -0
- package/dist/components/post-tooltip2.js +35 -22
- package/dist/components/slide.js +25 -0
- package/dist/docs.json +1956 -270
- package/dist/esm/{attribute-observer-37fa950a.js → attribute-observer-2f203993.js} +4 -4
- package/dist/esm/check-non-empty-258a56b3.js +13 -0
- package/dist/esm/check-one-of-0bee20f5.js +11 -0
- package/dist/esm/check-type-37d5d307.js +19 -0
- package/dist/esm/check-url-17962bc8.js +17 -0
- package/dist/esm/debounce-e54c7131.js +11 -0
- package/dist/esm/fade-1f3cacf4.js +11 -0
- package/dist/esm/get-root-7af2e0d1.js +9 -0
- package/dist/esm/{index-0b56fc28.js → index-40846676.js} +54 -17
- package/dist/esm/index-8f8fe5b0.js +32 -0
- package/dist/esm/index.browser-51485f85.js +13 -0
- package/dist/esm/index.js +32 -22
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-5614c98b.js +3 -0
- package/dist/esm/{post-accordion-6f4d2b9a.js → post-accordion-f6d1834d.js} +9 -8
- package/dist/esm/post-accordion-item-7cb93300.js +62 -0
- package/dist/esm/post-accordion-item.entry.js +8 -5
- package/dist/esm/post-accordion.entry.js +4 -4
- package/dist/esm/post-avatar-96108967.js +142 -0
- package/dist/esm/post-avatar.entry.js +5 -0
- package/dist/esm/post-back-to-top-7f8a61c8.js +74 -0
- package/dist/esm/post-back-to-top.entry.js +7 -0
- package/dist/esm/post-banner-bb69bce8.js +94 -0
- package/dist/esm/post-banner.entry.js +11 -0
- package/dist/esm/post-breadcrumb-9d9efa4e.js +110 -0
- package/dist/esm/post-breadcrumb-item_2.entry.js +8 -0
- package/dist/esm/post-breadcrumb.entry.js +5 -0
- package/dist/esm/post-card-control-fdced7d5.js +281 -0
- package/dist/esm/post-card-control.entry.js +5 -5
- package/dist/esm/post-closebutton_15.entry.js +12 -0
- package/dist/esm/{post-collapsible-trigger-85c2064a.js → post-collapsible-trigger-17b2f067.js} +49 -55
- package/dist/esm/post-collapsible_2.entry.js +10 -6
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-footer-2dcd8159.js +86 -0
- package/dist/esm/post-footer.entry.js +3 -0
- package/dist/esm/post-linkarea-06c5144d.js +28 -0
- package/dist/esm/post-linkarea.entry.js +3 -0
- package/dist/esm/post-menu-item-e917bf99.js +65 -0
- package/dist/esm/post-popover-67a3cbf2.js +104 -0
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/{post-rating-d9fc0b40.js → post-rating-9613bee8.js} +16 -6
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-dff3a025.js +31 -0
- package/dist/esm/post-tab-header.entry.js +5 -4
- package/dist/esm/{post-tab-panel-926439f4.js → post-tab-panel-2b3f82a8.js} +6 -5
- package/dist/esm/post-tab-panel.entry.js +4 -3
- package/dist/esm/{post-tabs-13b2d9a6.js → post-tabs-46d1165f.js} +23 -16
- package/dist/esm/post-tabs.entry.js +4 -4
- package/dist/esm/post-tag-4176268e.js +45 -0
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/post-togglebutton-5892c5bd.js +3845 -0
- package/dist/esm/{post-tooltip-3cde6b53.js → post-tooltip-5a45a569.js} +38 -25
- package/dist/esm/post-tooltip.entry.js +8 -6
- package/dist/esm/slide-62768431.js +25 -0
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-017dc6c7.js +1 -0
- package/dist/post-components/p-0227b899.js +1 -0
- package/dist/post-components/p-04895a54.js +1 -0
- package/dist/post-components/p-04c38bfe.entry.js +1 -0
- package/dist/post-components/p-07a0a626.js +1 -0
- package/dist/post-components/p-12573893.js +1 -0
- package/dist/post-components/p-1289b0a7.entry.js +1 -0
- package/dist/post-components/p-12a11565.js +1 -0
- package/dist/post-components/p-1542a80e.entry.js +1 -0
- package/dist/post-components/p-181c73d5.js +1 -0
- package/dist/post-components/p-254a9bd2.entry.js +1 -0
- package/dist/post-components/p-28500934.entry.js +1 -0
- package/dist/post-components/p-2b1281af.js +1 -0
- package/dist/post-components/p-2c69e7f2.entry.js +1 -0
- package/dist/post-components/p-30132b19.entry.js +1 -0
- package/dist/post-components/p-30af1d48.js +1 -0
- package/dist/post-components/p-3bdeb686.entry.js +1 -0
- package/dist/post-components/p-47cb31dd.js +1 -0
- package/dist/post-components/p-4af6dbed.js +1 -0
- package/dist/post-components/p-4f41f63e.js +1 -0
- package/dist/post-components/p-52790b8b.js +1 -0
- package/dist/post-components/p-5959f2bd.js +1 -0
- package/dist/post-components/{p-82dcf8c6.js → p-59ca0a13.js} +3 -3
- package/dist/post-components/p-5aaa5703.entry.js +1 -0
- package/dist/post-components/p-64e3de38.js +1 -0
- package/dist/post-components/p-67a45f16.js +1 -0
- package/dist/post-components/p-6d8ac9bd.entry.js +1 -0
- package/dist/post-components/p-7709c14a.js +1 -0
- package/dist/post-components/p-77cc2a5e.entry.js +1 -0
- package/dist/post-components/p-79c552fb.js +1 -0
- package/dist/post-components/p-7dd05e6d.entry.js +1 -0
- package/dist/post-components/p-803b7598.js +1 -0
- package/dist/post-components/p-85fdc2d3.js +1 -0
- package/dist/post-components/p-9748a355.js +1 -0
- package/dist/post-components/p-98fcf90b.entry.js +1 -0
- package/dist/post-components/p-994fae4c.entry.js +1 -0
- package/dist/post-components/p-a805515a.entry.js +1 -0
- package/dist/post-components/p-b5b48f66.entry.js +1 -0
- package/dist/post-components/p-b9bf5a5f.js +1 -0
- package/dist/post-components/p-c6b3a926.js +1 -0
- package/dist/post-components/p-c9dd3cdb.entry.js +1 -0
- package/dist/post-components/p-cb5e4a06.js +1 -0
- package/dist/post-components/p-d45df336.js +1 -0
- package/dist/post-components/p-dd4a5c0a.entry.js +1 -0
- package/dist/post-components/p-e1baac59.js +1 -0
- package/dist/post-components/p-e585c6fe.js +1 -0
- package/dist/post-components/p-e6d54838.entry.js +1 -0
- package/dist/post-components/p-f4b0cc7d.js +1 -0
- package/dist/post-components/p-fc91cbc2.js +1 -0
- package/dist/post-components/p-fe8c300c.js +1 -0
- package/dist/post-components/p-ff95dcd3.js +2 -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 -0
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +8 -2
- package/dist/types/components/post-avatar/post-avatar.d.ts +51 -0
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +19 -0
- package/dist/types/components/post-banner/banner-types.d.ts +2 -0
- package/dist/types/components/post-banner/post-banner.d.ts +49 -0
- package/dist/types/components/post-breadcrumb/post-breadcrumb.d.ts +30 -0
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +20 -0
- package/dist/types/components/post-card-control/post-card-control.d.ts +9 -9
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +7 -0
- package/dist/types/components/post-footer/post-footer.d.ts +23 -0
- package/dist/types/components/post-header/post-header.d.ts +45 -0
- package/dist/types/components/post-icon/post-icon.d.ts +14 -12
- package/dist/types/components/post-language-option/post-language-option.d.ts +45 -0
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +31 -0
- package/dist/types/components/post-language-switch/switch-variants.d.ts +2 -0
- package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
- package/dist/types/components/post-list/post-list.d.ts +24 -0
- package/dist/types/components/post-list-item/post-list-item.d.ts +8 -0
- package/dist/types/components/post-logo/post-logo.d.ts +1 -1
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +70 -0
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +57 -0
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +31 -0
- package/dist/types/components/post-menu/post-menu.d.ts +48 -0
- package/dist/types/components/post-menu-item/post-menu-item.d.ts +3 -0
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +28 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +23 -1
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +15 -0
- package/dist/types/components.d.ts +609 -48
- 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 +22 -3
- package/dist/types/utils/attribute-observer.d.ts +1 -1
- package/dist/types/utils/breakpoints.d.ts +12 -0
- package/dist/types/utils/component-on-ready.d.ts +1 -1
- package/dist/types/utils/get-focusable-children.d.ts +1 -0
- package/dist/types/utils/get-root.d.ts +1 -1
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-one-of.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-url.d.ts +3 -1
- package/dist/types/utils/property-checkers/index.d.ts +12 -4
- package/dist/types/utils/sass-export.d.ts +5 -1
- package/loaders/attribute-observer.js +4 -4
- package/loaders/check-non-empty.js +6 -2
- package/loaders/check-one-of.js +8 -3
- package/loaders/check-type.js +11 -6
- package/loaders/debounce.js +11 -0
- package/loaders/fade.js +6 -2
- package/loaders/get-focusable-children.js +35 -0
- package/loaders/get-root.js +9 -0
- package/loaders/index.browser.js +13 -0
- package/loaders/index.d.ts +40 -2
- package/loaders/index.js +21 -2
- package/loaders/index2.js +25 -12
- package/loaders/index3.js +135 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item.js +1 -81
- package/loaders/post-accordion-item2.js +103 -0
- package/loaders/post-accordion.js +6 -5
- package/loaders/post-avatar.d.ts +11 -0
- package/loaders/post-avatar.js +172 -0
- package/loaders/post-back-to-top.d.ts +11 -0
- package/loaders/post-back-to-top.js +104 -0
- package/loaders/post-banner.d.ts +11 -0
- package/loaders/post-banner.js +134 -0
- package/loaders/post-breadcrumb-item.d.ts +11 -0
- package/loaders/post-breadcrumb-item.js +6 -0
- package/loaders/post-breadcrumb-item2.js +82 -0
- package/loaders/post-breadcrumb.d.ts +11 -0
- package/loaders/post-breadcrumb.js +172 -0
- package/loaders/post-card-control.js +50 -39
- package/loaders/post-closebutton.d.ts +11 -0
- package/loaders/post-closebutton.js +37 -0
- package/loaders/post-collapsible-trigger2.js +23 -38
- package/loaders/post-collapsible2.js +21 -13
- package/loaders/post-footer.d.ts +11 -0
- package/loaders/post-footer.js +131 -0
- package/loaders/post-header.d.ts +11 -0
- package/loaders/post-header.js +220 -0
- package/loaders/post-icon2.js +82 -46
- package/loaders/post-language-option.d.ts +11 -0
- package/loaders/post-language-option.js +105 -0
- package/loaders/post-language-switch.d.ts +11 -0
- package/loaders/post-language-switch.js +138 -0
- package/loaders/post-linkarea.d.ts +11 -0
- package/loaders/post-linkarea.js +45 -0
- package/loaders/post-list-item.d.ts +11 -0
- package/loaders/post-list-item.js +38 -0
- package/loaders/{post-alert.d.ts → post-list.d.ts} +4 -4
- package/loaders/post-list.js +58 -0
- package/loaders/post-logo.js +6 -6
- package/loaders/post-mainnavigation.d.ts +11 -0
- package/loaders/post-mainnavigation.js +261 -0
- package/loaders/post-megadropdown-trigger.d.ts +11 -0
- package/loaders/post-megadropdown-trigger.js +116 -0
- package/loaders/post-megadropdown.d.ts +11 -0
- package/loaders/post-megadropdown.js +189 -0
- package/loaders/post-menu-item.d.ts +11 -0
- package/loaders/post-menu-item.js +6 -0
- package/loaders/post-menu-item2.js +27 -0
- package/loaders/post-menu-trigger.d.ts +11 -0
- package/loaders/post-menu-trigger.js +6 -0
- package/loaders/post-menu-trigger2.js +109 -0
- package/loaders/post-menu.d.ts +11 -0
- package/loaders/post-menu.js +6 -0
- package/loaders/post-menu2.js +193 -0
- package/loaders/post-popover.js +6 -4
- package/loaders/post-popovercontainer2.js +227 -59
- package/loaders/post-rating.js +14 -4
- package/loaders/post-tab-header.js +7 -6
- package/loaders/post-tab-panel.js +4 -3
- package/loaders/post-tabs.js +20 -13
- package/loaders/post-tag.js +3 -3
- package/loaders/post-togglebutton.d.ts +11 -0
- package/loaders/post-togglebutton.js +64 -0
- package/loaders/post-tooltip.js +34 -21
- package/loaders/slide.js +25 -0
- package/package.json +26 -20
- package/dist/cjs/check-non-empty-eeaa8f77.js +0 -11
- package/dist/cjs/check-one-of-f4f5d0c0.js +0 -8
- package/dist/cjs/fade-35a3633a.js +0 -10
- package/dist/cjs/index-01f30442.js +0 -52
- package/dist/cjs/post-accordion-item-7b348fa5.js +0 -51
- package/dist/cjs/post-alert-fca3a4a3.js +0 -98
- package/dist/cjs/post-alert.cjs.entry.js +0 -16
- package/dist/cjs/post-card-control-b4e4b4d5.js +0 -272
- package/dist/cjs/post-icon-3934be0b.js +0 -104
- package/dist/cjs/post-icon.cjs.entry.js +0 -15
- package/dist/cjs/post-logo-c3603fc7.js +0 -39
- package/dist/cjs/post-logo.cjs.entry.js +0 -14
- package/dist/cjs/post-popover-15f9620a.js +0 -104
- package/dist/cjs/post-popovercontainer-7d536276.js +0 -2186
- package/dist/cjs/post-popovercontainer.cjs.entry.js +0 -11
- package/dist/cjs/post-tab-header-29b8d4e1.js +0 -32
- package/dist/cjs/post-tag-b7d0bbff.js +0 -47
- package/dist/collection/components/post-alert/alert-types.js +0 -1
- package/dist/collection/components/post-alert/post-alert.css +0 -7
- package/dist/components/post-alert.js +0 -6
- package/dist/components/post-alert2.js +0 -136
- package/dist/esm/check-non-empty-58bd6b17.js +0 -9
- package/dist/esm/check-one-of-6b3ef8eb.js +0 -6
- package/dist/esm/fade-7fd71785.js +0 -7
- package/dist/esm/index-f41b763f.js +0 -46
- package/dist/esm/package-3d758f77.js +0 -3
- package/dist/esm/post-accordion-item-6b5a65ad.js +0 -49
- package/dist/esm/post-alert-f19db551.js +0 -96
- package/dist/esm/post-alert.entry.js +0 -8
- package/dist/esm/post-card-control-1b5df6cb.js +0 -270
- package/dist/esm/post-icon-40929043.js +0 -102
- package/dist/esm/post-icon.entry.js +0 -7
- package/dist/esm/post-logo-c6351ba8.js +0 -37
- package/dist/esm/post-logo.entry.js +0 -6
- package/dist/esm/post-popover-58149de7.js +0 -102
- package/dist/esm/post-popovercontainer-8bde9fc3.js +0 -2184
- package/dist/esm/post-popovercontainer.entry.js +0 -3
- package/dist/esm/post-tab-header-ae8feb19.js +0 -30
- package/dist/esm/post-tag-887d5fbe.js +0 -45
- package/dist/post-components/p-0b71bf5a.js +0 -1
- package/dist/post-components/p-0e09dc41.js +0 -1
- package/dist/post-components/p-19e54be9.js +0 -1
- package/dist/post-components/p-1e8f0f36.js +0 -1
- package/dist/post-components/p-22257eff.entry.js +0 -1
- package/dist/post-components/p-249ac168.entry.js +0 -1
- package/dist/post-components/p-2737eaf5.js +0 -1
- package/dist/post-components/p-2b10e265.js +0 -1
- package/dist/post-components/p-3325086e.js +0 -1
- package/dist/post-components/p-3b823fee.entry.js +0 -1
- package/dist/post-components/p-45f4c803.entry.js +0 -1
- package/dist/post-components/p-47935dbb.js +0 -1
- package/dist/post-components/p-486fbbce.entry.js +0 -1
- package/dist/post-components/p-4a7fb0f3.entry.js +0 -1
- package/dist/post-components/p-5f231c2c.js +0 -1
- package/dist/post-components/p-611b3c41.js +0 -1
- package/dist/post-components/p-6a28f8b9.js +0 -1
- package/dist/post-components/p-6adeaa6c.js +0 -1
- package/dist/post-components/p-6ed3497a.entry.js +0 -1
- package/dist/post-components/p-820c5c19.entry.js +0 -1
- package/dist/post-components/p-8aeb549f.entry.js +0 -1
- package/dist/post-components/p-92aeec3c.js +0 -1
- package/dist/post-components/p-9a99cfc7.js +0 -1
- package/dist/post-components/p-aa8a08dc.entry.js +0 -1
- package/dist/post-components/p-b095519d.js +0 -1
- package/dist/post-components/p-b99fdec3.js +0 -1
- package/dist/post-components/p-ba40b28a.entry.js +0 -1
- package/dist/post-components/p-c62de925.js +0 -1
- package/dist/post-components/p-d2101b8a.entry.js +0 -1
- package/dist/post-components/p-d2f9de94.js +0 -2
- package/dist/post-components/p-d7a44f45.js +0 -1
- package/dist/post-components/p-db4b8ea1.entry.js +0 -1
- package/dist/post-components/p-deb4131c.js +0 -1
- package/dist/post-components/p-eedc6ae8.entry.js +0 -1
- package/dist/post-components/p-f217f420.js +0 -1
- package/dist/post-components/p-f707d163.entry.js +0 -1
- package/dist/types/components/post-alert/alert-types.d.ts +0 -2
- package/dist/types/components/post-alert/post-alert.d.ts +0 -54
- package/loaders/post-alert.js +0 -139
|
@@ -2,52 +2,25 @@ import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { c as checkType } from './check-type.js';
|
|
4
4
|
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let id;
|
|
8
|
-
return (...args) => {
|
|
9
|
-
if (id)
|
|
10
|
-
clearTimeout(id);
|
|
11
|
-
id = setTimeout(callback, timeout, ...args);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function getRoot(element) {
|
|
16
|
-
const root = element.getRootNode();
|
|
17
|
-
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
18
|
-
return root;
|
|
19
|
-
}
|
|
20
|
-
throw new Error('Attempting to access root node before the element is attached to the document or shadow tree.');
|
|
21
|
-
}
|
|
5
|
+
import { d as debounce } from './debounce.js';
|
|
6
|
+
import { g as getRoot } from './get-root.js';
|
|
22
7
|
|
|
23
8
|
const PostCollapsibleTrigger = /*@__PURE__*/ proxyCustomElement(class PostCollapsibleTrigger extends HTMLElement {
|
|
24
9
|
constructor() {
|
|
25
10
|
super();
|
|
26
11
|
this.__registerHost();
|
|
27
|
-
this.observer = new MutationObserver(() => this.setTrigger());
|
|
28
|
-
this.debouncedUpdate = debounce(() => {
|
|
29
|
-
var _a;
|
|
30
|
-
if (!this.trigger)
|
|
31
|
-
return;
|
|
32
|
-
// add the provided id to the aria-controls list
|
|
33
|
-
const ariaControls = this.trigger.getAttribute('aria-controls');
|
|
34
|
-
if (!(ariaControls === null || ariaControls === void 0 ? void 0 : ariaControls.includes(this.for))) {
|
|
35
|
-
const newAriaControls = ariaControls ? `${ariaControls} ${this.for}` : this.for;
|
|
36
|
-
this.trigger.setAttribute('aria-controls', newAriaControls);
|
|
37
|
-
}
|
|
38
|
-
// set the aria-expanded to `false` if the controlled collapsible is collapsed or undefined, set it to `true` otherwise
|
|
39
|
-
const isCollapsed = (_a = this.collapsible) === null || _a === void 0 ? void 0 : _a.collapsed;
|
|
40
|
-
const newAriaExpanded = isCollapsed !== undefined ? !isCollapsed : undefined;
|
|
41
|
-
this.trigger.setAttribute('aria-expanded', `${newAriaExpanded}`);
|
|
42
|
-
});
|
|
43
12
|
this.for = undefined;
|
|
44
13
|
}
|
|
14
|
+
trigger;
|
|
15
|
+
observer = new MutationObserver(() => this.setTrigger());
|
|
16
|
+
root;
|
|
17
|
+
get host() { return this; }
|
|
45
18
|
/**
|
|
46
19
|
* Set the "aria-controls" and "aria-expanded" attributes on the trigger to match the state of the controlled post-collapsible
|
|
47
20
|
*/
|
|
48
21
|
setAriaAttributes() {
|
|
49
|
-
checkNonEmpty(this
|
|
50
|
-
checkType(this
|
|
22
|
+
checkNonEmpty(this, 'for');
|
|
23
|
+
checkType(this, 'for', 'string', 'The post-collapsible-trigger "for" prop should be a id.');
|
|
51
24
|
void this.update();
|
|
52
25
|
}
|
|
53
26
|
/**
|
|
@@ -89,12 +62,25 @@ const PostCollapsibleTrigger = /*@__PURE__*/ proxyCustomElement(class PostCollap
|
|
|
89
62
|
async update() {
|
|
90
63
|
this.debouncedUpdate();
|
|
91
64
|
}
|
|
65
|
+
debouncedUpdate = debounce(() => {
|
|
66
|
+
if (!this.trigger)
|
|
67
|
+
return;
|
|
68
|
+
// add the provided id to the aria-controls list
|
|
69
|
+
const ariaControls = this.trigger.getAttribute('aria-controls');
|
|
70
|
+
if (!ariaControls?.includes(this.for)) {
|
|
71
|
+
const newAriaControls = ariaControls ? `${ariaControls} ${this.for}` : this.for;
|
|
72
|
+
this.trigger.setAttribute('aria-controls', newAriaControls);
|
|
73
|
+
}
|
|
74
|
+
// set the aria-expanded to `false` if the controlled collapsible is collapsed or undefined, set it to `true` otherwise
|
|
75
|
+
const isCollapsed = this.collapsible?.collapsed;
|
|
76
|
+
const newAriaExpanded = isCollapsed !== undefined ? !isCollapsed : undefined;
|
|
77
|
+
this.trigger.setAttribute('aria-expanded', `${newAriaExpanded}`);
|
|
78
|
+
});
|
|
92
79
|
/**
|
|
93
80
|
* Toggle the post-collapsible controlled by the trigger
|
|
94
81
|
*/
|
|
95
82
|
async toggleCollapsible() {
|
|
96
|
-
|
|
97
|
-
await ((_a = this.collapsible) === null || _a === void 0 ? void 0 : _a.toggle());
|
|
83
|
+
await this.collapsible?.toggle();
|
|
98
84
|
}
|
|
99
85
|
/**
|
|
100
86
|
* Retrieve the post-collapsible controlled by the trigger
|
|
@@ -117,7 +103,6 @@ const PostCollapsibleTrigger = /*@__PURE__*/ proxyCustomElement(class PostCollap
|
|
|
117
103
|
this.trigger.addEventListener('click', () => this.toggleCollapsible());
|
|
118
104
|
this.setAriaAttributes();
|
|
119
105
|
}
|
|
120
|
-
get host() { return this; }
|
|
121
106
|
static get watchers() { return {
|
|
122
107
|
"for": ["setAriaAttributes"]
|
|
123
108
|
}; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
|
-
import {
|
|
3
|
+
import { e as checkEmptyOrType } from './index2.js';
|
|
4
4
|
|
|
5
5
|
function isMotionReduced() {
|
|
6
6
|
return window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
@@ -14,17 +14,17 @@ const animationOptions = {
|
|
|
14
14
|
easing: collapseEasing,
|
|
15
15
|
fill: 'forwards',
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
function collapse(el) {
|
|
18
18
|
const expandedKeyframe = { height: window.getComputedStyle(el).height };
|
|
19
19
|
return el.animate([expandedKeyframe, collapsedKeyframe], animationOptions);
|
|
20
|
-
}
|
|
21
|
-
|
|
20
|
+
}
|
|
21
|
+
function expand(el) {
|
|
22
22
|
const expandedKeyframe = { height: `${el.scrollHeight}px`, offset: 1 };
|
|
23
|
-
const finalKeyframe = { height: 'auto' };
|
|
23
|
+
const finalKeyframe = { height: 'auto', overflow: 'visible' };
|
|
24
24
|
return el.animate([collapsedKeyframe, expandedKeyframe, finalKeyframe], animationOptions);
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
|
|
27
|
-
const postCollapsibleCss = ":host{display:block;overflow:hidden}";
|
|
27
|
+
const postCollapsibleCss = ":host{display:block;position:relative;overflow:hidden}";
|
|
28
28
|
const PostCollapsibleStyle0 = postCollapsibleCss;
|
|
29
29
|
|
|
30
30
|
const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible extends HTMLElement {
|
|
@@ -33,14 +33,21 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
33
33
|
this.__registerHost();
|
|
34
34
|
this.__attachShadow();
|
|
35
35
|
this.postToggle = createEvent(this, "postToggle", 7);
|
|
36
|
-
this.isLoaded = false;
|
|
37
|
-
this.isOpen = true;
|
|
38
36
|
this.collapsed = false;
|
|
39
37
|
}
|
|
38
|
+
isLoaded = false;
|
|
39
|
+
isOpen = true;
|
|
40
|
+
get host() { return this; }
|
|
40
41
|
collapsedChange() {
|
|
41
|
-
checkEmptyOrType(this
|
|
42
|
+
checkEmptyOrType(this, 'collapsed', 'boolean');
|
|
42
43
|
void this.toggle(!this.collapsed);
|
|
43
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* An event emitted when the collapse element is shown or hidden, before the transition.
|
|
47
|
+
*
|
|
48
|
+
* The event payload is a boolean: `true` if the collapsible was opened, `false` if it was closed.
|
|
49
|
+
*/
|
|
50
|
+
postToggle;
|
|
44
51
|
componentDidLoad() {
|
|
45
52
|
this.collapsedChange();
|
|
46
53
|
this.isLoaded = true;
|
|
@@ -62,20 +69,21 @@ const PostCollapsible = /*@__PURE__*/ proxyCustomElement(class PostCollapsible e
|
|
|
62
69
|
if (!this.isLoaded || isMotionReduced())
|
|
63
70
|
animation.finish();
|
|
64
71
|
await animation.finished;
|
|
65
|
-
|
|
72
|
+
const isHostRendered = this.host.offsetParent;
|
|
73
|
+
if (isHostRendered)
|
|
74
|
+
animation.commitStyles();
|
|
66
75
|
return open;
|
|
67
76
|
}
|
|
68
77
|
/**
|
|
69
78
|
* Update all post-collapsible-trigger elements referring to the collapsible
|
|
70
79
|
*/
|
|
71
80
|
updateTriggers() {
|
|
72
|
-
const triggers = document.querySelectorAll(`post-collapsible-trigger[for
|
|
81
|
+
const triggers = document.querySelectorAll(`post-collapsible-trigger[for="${this.host.id}"]`);
|
|
73
82
|
triggers.forEach(trigger => trigger.update());
|
|
74
83
|
}
|
|
75
84
|
render() {
|
|
76
|
-
return (h(Host, { key: '
|
|
85
|
+
return (h(Host, { key: 'a43e25138933a758759b4adcca249757db75cc4b', "data-version": version, tabindex: this.collapsed ? -1 : undefined }, h("slot", { key: '2936f71a6fb3ddedda372e8da4a19dbceecaefa6' })));
|
|
77
86
|
}
|
|
78
|
-
get host() { return this; }
|
|
79
87
|
static get watchers() { return {
|
|
80
88
|
"collapsed": ["collapsedChange"]
|
|
81
89
|
}; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostFooter extends Components.PostFooter, HTMLElement {}
|
|
4
|
+
export const PostFooter: {
|
|
5
|
+
prototype: PostFooter;
|
|
6
|
+
new (): PostFooter;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { v as version } from './package.js';
|
|
3
|
+
import { d as defineCustomElement$4 } from './post-accordion-item2.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './post-collapsible2.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './post-collapsible-trigger2.js';
|
|
6
|
+
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
7
|
+
|
|
8
|
+
class Breakpoint {
|
|
9
|
+
breakpointMap;
|
|
10
|
+
current = {
|
|
11
|
+
key: '',
|
|
12
|
+
name: '',
|
|
13
|
+
};
|
|
14
|
+
constructor() {
|
|
15
|
+
if (!this.breakpointMap) {
|
|
16
|
+
const keys = this.getStyles('--post-breakpoint-keys');
|
|
17
|
+
const names = this.getStyles('--post-breakpoint-names');
|
|
18
|
+
const widths = this.getStyles('--post-breakpoint-widths');
|
|
19
|
+
this.breakpointMap = widths
|
|
20
|
+
.map((width, i) => ({
|
|
21
|
+
minWidth: Number(width),
|
|
22
|
+
key: keys[i],
|
|
23
|
+
name: names[i],
|
|
24
|
+
}))
|
|
25
|
+
.reverse();
|
|
26
|
+
window.addEventListener('resize', () => this.updateHandler(), { passive: true });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
getStyles(propertyName) {
|
|
30
|
+
const styles = getComputedStyle(document.documentElement);
|
|
31
|
+
return (styles
|
|
32
|
+
.getPropertyValue(propertyName)
|
|
33
|
+
?.split(',')
|
|
34
|
+
.map(w => w.trim()) ?? []);
|
|
35
|
+
}
|
|
36
|
+
updateHandler(emitEvents = true) {
|
|
37
|
+
const calculated = this.breakpointMap.find(({ minWidth }) => innerWidth >= minWidth);
|
|
38
|
+
if (this.current.key !== calculated.key) {
|
|
39
|
+
this.current.key = calculated.key;
|
|
40
|
+
if (emitEvents)
|
|
41
|
+
this.dispatchEvent('key');
|
|
42
|
+
}
|
|
43
|
+
if (this.current.name !== calculated.name) {
|
|
44
|
+
this.current.name = calculated.name;
|
|
45
|
+
if (emitEvents)
|
|
46
|
+
this.dispatchEvent('name');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
dispatchEvent(type) {
|
|
50
|
+
window.dispatchEvent(new CustomEvent(`postBreakpoint:${type}`, { detail: this.current[type] }));
|
|
51
|
+
}
|
|
52
|
+
get(type) {
|
|
53
|
+
this.updateHandler(false);
|
|
54
|
+
return this.current[type];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const breakpoint = new Breakpoint();
|
|
58
|
+
|
|
59
|
+
const postFooterCss = ":host{display:block}footer{background-color:#fc0;--post-footer-container-padding-block:32px;--post-footer-container-padding-inline:16px;--post-footer-container-max-width:1200px;--post-footer-grid-template:auto / auto;--post-footer-grid-row-gap:0;--post-footer-grid-column-gap:0;--post-footer-grid-margin-block-end:24px;--post-footer-grid-padding-block-end:0;--post-footer-column-flex-direction:column;--post-footer-column-align-items:start;--post-footer-column-gap:0;--post-footer-post-list-flex-direction:column;--post-footer-post-list-gap:8px;--post-footer-post-list-align-items:start;--post-footer-socialmedia-margin-block-end:var(--post-footer-grid-margin-block-end);--post-footer-app-margin-block-end:var(--post-footer-grid-margin-block-end);--post-footer-businesssectors-margin-block-end:var(--post-footer-grid-margin-block-end);--post-footer-meta-margin-block-end:16px;--post-footer-meta-font-size:inherit;--post-footer-copyright-font-size:var(--post-footer-meta-font-size)}@media screen and (min-width: 600px){footer{--post-footer-container-padding-block:40px;--post-footer-grid-template:repeat(2, auto) / repeat(2, auto);--post-footer-grid-row-gap:32px;--post-footer-grid-column-gap:16px;--post-footer-grid-margin-block-end:32px;--post-footer-grid-padding-block-end:32px;--post-footer-post-list-flex-direction:row;--post-footer-post-list-gap:16px;--post-footer-post-list-align-items:center;--post-footer-meta-margin-block-end:8px}}@media screen and (min-width: 780px){footer{--post-footer-container-padding-inline:40px}}@media screen and (min-width: 1024px){footer{--post-footer-container-padding-block:56px;--post-footer-grid-template:auto / repeat(4, auto);--post-footer-grid-row-gap:0;--post-footer-grid-column-gap:24px;--post-footer-grid-margin-block-end:40px;--post-footer-column-flex-direction:row;--post-footer-column-align-items:center;--post-footer-column-gap:32px;--post-footer-post-list-gap:24px;--post-footer-businesssectors-margin-block-end:24px;--post-footer-meta-font-size:16px}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.footer-container{box-sizing:content-box;margin:0 auto;padding:var(--post-footer-container-padding-block) var(--post-footer-container-padding-inline);max-width:var(--post-footer-container-max-width)}.footer-grid{display:grid;grid-template:var(--post-footer-grid-template);row-gap:var(--post-footer-grid-row-gap);column-gap:var(--post-footer-grid-column-gap);margin-block-end:var(--post-footer-grid-margin-block-end);padding-block-end:var(--post-footer-grid-padding-block-end)}.footer-grid ::part(button),.footer-grid ::part(body){padding-inline:0}.footer-column{display:flex;flex-direction:var(--post-footer-column-flex-direction);flex-wrap:wrap;justify-content:space-between;align-items:var(--post-footer-column-align-items);column-gap:var(--post-footer-column-gap)}.footer-socialmedia ::slotted(post-list),.footer-app ::slotted(post-list),.footer-businesssectors ::slotted(post-list),.footer-meta ::slotted(post-list){display:flex !important;flex-direction:var(--post-footer-post-list-flex-direction) !important;gap:var(--post-footer-post-list-gap) !important;align-items:var(--post-footer-post-list-align-items) !important}.footer-socialmedia{margin-block-end:var(--post-footer-socialmedia-margin-block-end)}.footer-app{margin-block-end:var(--post-footer-app-margin-block-end)}.footer-businesssectors{margin-block-end:var(--post-footer-businesssectors-margin-block-end)}.footer-meta{margin-block-end:var(--post-footer-meta-margin-block-end);font-size:var(--post-footer-meta-font-size)}.footer-copyright{display:flex;flex-wrap:wrap;column-gap:.5rem;font-size:var(--post-footer-copyright-font-size)}";
|
|
60
|
+
const PostFooterStyle0 = postFooterCss;
|
|
61
|
+
|
|
62
|
+
const PostFooter = /*@__PURE__*/ proxyCustomElement(class PostFooter extends HTMLElement {
|
|
63
|
+
constructor() {
|
|
64
|
+
super();
|
|
65
|
+
this.__registerHost();
|
|
66
|
+
this.__attachShadow();
|
|
67
|
+
this.label = undefined;
|
|
68
|
+
this.isMobile = breakpoint.get('name') === 'mobile';
|
|
69
|
+
}
|
|
70
|
+
get host() { return this; }
|
|
71
|
+
connectedCallback() {
|
|
72
|
+
window.addEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
|
|
73
|
+
}
|
|
74
|
+
breakpointChange(e) {
|
|
75
|
+
this.isMobile = e.detail === 'mobile';
|
|
76
|
+
}
|
|
77
|
+
renderAccordion() {
|
|
78
|
+
return (h("div", { class: "footer-grid" }, h("post-accorddion", { "heading-level": "3", multiple: true }, h("post-accordion-item", { collapsed: true }, h("span", { slot: "header" }, h("slot", { name: "grid-1-title" })), h("slot", { name: "grid-1" })), h("post-accordion-item", { collapsed: true }, h("span", { slot: "header" }, h("slot", { name: "grid-2-title" })), h("slot", { name: "grid-2" })), h("post-accordion-item", { collapsed: true }, h("span", { slot: "header" }, h("slot", { name: "grid-3-title" })), h("slot", { name: "grid-3" })), h("post-accordion-item", { collapsed: true }, h("span", { slot: "header" }, h("slot", { name: "grid-4-title" })), h("slot", { name: "grid-4" })))));
|
|
79
|
+
}
|
|
80
|
+
renderGrid() {
|
|
81
|
+
return (h("div", { class: "footer-grid" }, h("div", null, h("slot", { name: "grid-1" })), h("div", null, h("slot", { name: "grid-2" })), h("div", null, h("slot", { name: "grid-3" })), h("div", null, h("slot", { name: "grid-4" }))));
|
|
82
|
+
}
|
|
83
|
+
render() {
|
|
84
|
+
return (h(Host, { key: '14370a1cfd730a0b0353c88c95f265aefb57c480', "data-version": version }, h("footer", { key: '7208e9d465eb0b469887e7cfae66674db2092dbd' }, h("h2", { key: 'b392c866326374ae27704baaba0dd28c3001ee62', class: "visually-hidden" }, this.label), h("div", { key: '13411ad6e0b55ee17cf9bf77b155aa1c2810f057', class: "footer-container" }, this.isMobile ? this.renderAccordion() : this.renderGrid(), h("div", { key: '4815ae94cd43eca92482ad3c93f107243b26890e', class: "footer-column" }, h("div", { key: 'edc787dc5fc96169c323f15254b6088024a6f19d', class: "footer-socialmedia" }, h("slot", { key: '0971e342ac6f3913c408a535ce0746080e3f57af', name: "socialmedia" })), h("div", { key: 'da583c9ed819181bf2732277f4e6ee22df2e3022', class: "footer-app" }, h("slot", { key: 'b6dab5cfa1f4dc9c049f24d3e08416ef5a27e0aa', name: "app" }))), h("div", { key: '53a5c04129d24dfb64eedd46e95b5c78142a3fd7', class: "footer-businesssectors" }, h("slot", { key: '470f4294778b8978bf6eb168e2b47ff29ef43d07', name: "businesssectors" })), h("div", { key: '45d734ded794352b951f2891bbdba081e05a99d5', class: "footer-meta" }, h("slot", { key: '4d0da53c2eb79e111f0f05278a0972f046eebfa9', name: "meta" })), h("div", { key: 'f95fb7ed3cc09218a3d4a554c619b6f379d5135d', class: "footer-copyright" }, h("slot", { key: '9cdcec805152413693dced0f0d55ac1b1121c70e', name: "copyright" }))))));
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
window.removeEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
|
|
88
|
+
}
|
|
89
|
+
static get style() { return PostFooterStyle0; }
|
|
90
|
+
}, [1, "post-footer", {
|
|
91
|
+
"label": [1],
|
|
92
|
+
"isMobile": [32]
|
|
93
|
+
}]);
|
|
94
|
+
function defineCustomElement() {
|
|
95
|
+
if (typeof customElements === "undefined") {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const components = ["post-footer", "post-accordion-item", "post-collapsible", "post-collapsible-trigger", "post-icon"];
|
|
99
|
+
components.forEach(tagName => { switch (tagName) {
|
|
100
|
+
case "post-footer":
|
|
101
|
+
if (!customElements.get(tagName)) {
|
|
102
|
+
customElements.define(tagName, PostFooter);
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
case "post-accordion-item":
|
|
106
|
+
if (!customElements.get(tagName)) {
|
|
107
|
+
defineCustomElement$4();
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "post-collapsible":
|
|
111
|
+
if (!customElements.get(tagName)) {
|
|
112
|
+
defineCustomElement$3();
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
case "post-collapsible-trigger":
|
|
116
|
+
if (!customElements.get(tagName)) {
|
|
117
|
+
defineCustomElement$2();
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
case "post-icon":
|
|
121
|
+
if (!customElements.get(tagName)) {
|
|
122
|
+
defineCustomElement$1();
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
125
|
+
} });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { PostFooter as P, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PostHeader extends Components.PostHeader, HTMLElement {}
|
|
4
|
+
export const PostHeader: {
|
|
5
|
+
prototype: PostHeader;
|
|
6
|
+
new (): PostHeader;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { t as throttle } from './index3.js';
|
|
3
|
+
import { v as version } from './package.js';
|
|
4
|
+
import { s as slideUp, a as slideDown } from './slide.js';
|
|
5
|
+
import { g as getFocusableChildren } from './get-focusable-children.js';
|
|
6
|
+
|
|
7
|
+
const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;position:sticky;padding-inline:4px;height:var(--global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:3;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:12px;inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}.global-sub{display:flex;align-items:center;gap:24px}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px;min-height:var(--local-header-min-height);background:#fff;transition:box-shadow .2s ease-in-out;border-block-end:1px solid #e1e0dc}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:calc(-1*(var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height));padding-block-start:18px;box-shadow:var(--post-device-elevation-300)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:12px;flex-wrap:wrap;gap:16px}.local-header.local-header-mobile-extended{border-bottom:1px solid #e1e0dc}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-sub{margin-inline-end:16px}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}::slotted(h1){margin:0 !important;flex-shrink:10;z-index:3}@media screen and (min-width: 600px){::slotted(h1){margin-inline-start:12px !important}}@media screen and (max-width: 599.98px){::slotted(h1){margin-inline-start:8px !important}}@media screen and (min-width: 1024px){::slotted(h1){font-size:28px !important}}@media screen and (max-width: 1023.98px){::slotted(h1){font-size:20px !important;max-width:calc(100vw - 8px - 16px)}}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--global-header-reduced-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:#fff}}@media screen and (max-width: 1023.98px){.navigation{position:fixed;z-index:1;inset-inline:0;background:#fff;inset-block-end:calc(100dvh - var(--header-height))}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:16px 24px;padding-inline:32px}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended{height:calc(100dvh - var(--header-height));display:flex;flex-direction:column}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){background-color:#fafafa;gap:32px}.navigation-footer{background-color:#f0efed;gap:24px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}";
|
|
8
|
+
const PostHeaderStyle0 = postHeaderCss;
|
|
9
|
+
|
|
10
|
+
const PostHeader = /*@__PURE__*/ proxyCustomElement(class PostHeader extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.__registerHost();
|
|
14
|
+
this.__attachShadow();
|
|
15
|
+
this.postUpdateDevice = createEvent(this, "postUpdateDevice", 7);
|
|
16
|
+
this.device = null;
|
|
17
|
+
this.mobileMenuExtended = false;
|
|
18
|
+
}
|
|
19
|
+
firstFocusableEl;
|
|
20
|
+
lastFocusableEl;
|
|
21
|
+
scrollParent = null;
|
|
22
|
+
mobileMenu;
|
|
23
|
+
mobileMenuAnimation;
|
|
24
|
+
throttledScroll = () => this.handleScrollEvent();
|
|
25
|
+
throttledResize = throttle(50, () => this.handleResize());
|
|
26
|
+
componentWillRender() {
|
|
27
|
+
this.scrollParent = this.getScrollParent(this.host);
|
|
28
|
+
this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
29
|
+
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
30
|
+
this.handleResize();
|
|
31
|
+
this.handleScrollEvent();
|
|
32
|
+
this.getFocusableElements();
|
|
33
|
+
}
|
|
34
|
+
componentDidLoad() {
|
|
35
|
+
this.updateLocalHeaderHeight();
|
|
36
|
+
}
|
|
37
|
+
// Clean up possible side effects when post-header is disconnected
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
this.mobileMenuExtended = false;
|
|
40
|
+
document.body.style.overflow = '';
|
|
41
|
+
this.host.removeEventListener('keydown', e => {
|
|
42
|
+
this.keyboardHandler(e);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
get host() { return this; }
|
|
46
|
+
frozeBody(isMobileMenuExtended) {
|
|
47
|
+
document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
|
|
48
|
+
if (isMobileMenuExtended) {
|
|
49
|
+
this.host.addEventListener('keydown', e => {
|
|
50
|
+
this.keyboardHandler(e);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.host.removeEventListener('keydown', e => {
|
|
55
|
+
this.keyboardHandler(e);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An event emitted when the device has changed
|
|
61
|
+
*/
|
|
62
|
+
postUpdateDevice;
|
|
63
|
+
/**
|
|
64
|
+
* Toggles the mobile navigation.
|
|
65
|
+
*/
|
|
66
|
+
async toggleMobileMenu() {
|
|
67
|
+
if (this.device === 'desktop')
|
|
68
|
+
return;
|
|
69
|
+
this.mobileMenuAnimation = this.mobileMenuExtended
|
|
70
|
+
? slideUp(this.mobileMenu)
|
|
71
|
+
: slideDown(this.mobileMenu);
|
|
72
|
+
// Update the state of the toggle button
|
|
73
|
+
const menuButton = this.host.querySelector('post-togglebutton');
|
|
74
|
+
menuButton.toggled = !this.mobileMenuExtended;
|
|
75
|
+
// Toggle menu visibility before it slides down and after it slides back up
|
|
76
|
+
if (this.mobileMenuExtended)
|
|
77
|
+
await this.mobileMenuAnimation.finished;
|
|
78
|
+
this.mobileMenuExtended = !this.mobileMenuExtended;
|
|
79
|
+
if (!this.mobileMenuExtended)
|
|
80
|
+
await this.mobileMenuAnimation.finished;
|
|
81
|
+
}
|
|
82
|
+
// Get all the focusable elements in the post-header mobile menu
|
|
83
|
+
getFocusableElements() {
|
|
84
|
+
// Get elements in the correct order (different as the DOM order)
|
|
85
|
+
const focusableEls = [
|
|
86
|
+
...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
|
|
87
|
+
...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-mainnavigation > .back-button, post-megadropdown-trigger')),
|
|
88
|
+
...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
|
|
89
|
+
];
|
|
90
|
+
// Add the main toggle menu button to the list of focusable children
|
|
91
|
+
const focusableChildren = [
|
|
92
|
+
this.host.querySelector('post-togglebutton'),
|
|
93
|
+
...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
|
|
94
|
+
];
|
|
95
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
96
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
97
|
+
}
|
|
98
|
+
keyboardHandler(e) {
|
|
99
|
+
if (e.key === 'Tab' && this.mobileMenuExtended) {
|
|
100
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
101
|
+
// If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
this.lastFocusableEl.focus();
|
|
104
|
+
}
|
|
105
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
106
|
+
// If Tab and last element is focused, focus goes back to the first element of the megadropdown
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
this.firstFocusableEl.focus();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
handleScrollEvent() {
|
|
113
|
+
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
114
|
+
const st = Math.max(0, this.scrollParent instanceof Document
|
|
115
|
+
? this.scrollParent.documentElement.scrollTop
|
|
116
|
+
: this.scrollParent.scrollTop);
|
|
117
|
+
this.host.style.setProperty('--header-scroll-top', `${st}px`);
|
|
118
|
+
}
|
|
119
|
+
getScrollParent(node) {
|
|
120
|
+
let currentParent = node.parentElement;
|
|
121
|
+
while (currentParent) {
|
|
122
|
+
if (currentParent.nodeName === 'BODY') {
|
|
123
|
+
return document;
|
|
124
|
+
}
|
|
125
|
+
if (this.isScrollable(currentParent)) {
|
|
126
|
+
return currentParent;
|
|
127
|
+
}
|
|
128
|
+
currentParent = currentParent.parentElement;
|
|
129
|
+
}
|
|
130
|
+
return document;
|
|
131
|
+
}
|
|
132
|
+
isScrollable(node) {
|
|
133
|
+
if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
const style = getComputedStyle(node);
|
|
137
|
+
return ['overflow', 'overflow-x', 'overflow-y'].some(propertyName => {
|
|
138
|
+
const value = style.getPropertyValue(propertyName);
|
|
139
|
+
return value === 'auto' || value === 'scroll';
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
updateLocalHeaderHeight() {
|
|
143
|
+
requestAnimationFrame(() => {
|
|
144
|
+
const mhh = this.host.shadowRoot.querySelector('.local-header')?.clientHeight || 0;
|
|
145
|
+
this.host.style.setProperty('--local-header-height', `${mhh}px`);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
handleResize() {
|
|
149
|
+
const previousDevice = this.device;
|
|
150
|
+
let newDevice;
|
|
151
|
+
const width = window?.innerWidth;
|
|
152
|
+
if (width >= 1024) {
|
|
153
|
+
newDevice = 'desktop';
|
|
154
|
+
}
|
|
155
|
+
else if (width >= 600) {
|
|
156
|
+
newDevice = 'tablet';
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
newDevice = 'mobile';
|
|
160
|
+
}
|
|
161
|
+
// Close any open mobile menu
|
|
162
|
+
if (newDevice === 'desktop' && this.mobileMenuExtended) {
|
|
163
|
+
this.toggleMobileMenu();
|
|
164
|
+
this.mobileMenuAnimation.finish(); // no animation
|
|
165
|
+
}
|
|
166
|
+
this.updateLocalHeaderHeight();
|
|
167
|
+
// Apply only on change for doing work only when necessary
|
|
168
|
+
if (newDevice !== previousDevice) {
|
|
169
|
+
this.device = newDevice;
|
|
170
|
+
this.postUpdateDevice.emit(this.device);
|
|
171
|
+
window.requestAnimationFrame(() => {
|
|
172
|
+
this.switchLanguageSwitchMode();
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
switchLanguageSwitchMode() {
|
|
177
|
+
const variant = this.device === 'desktop' ? 'menu' : 'list';
|
|
178
|
+
Array.from(this.host.querySelectorAll('post-language-switch')).forEach(languageSwitch => {
|
|
179
|
+
languageSwitch?.setAttribute('variant', variant);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
renderNavigation() {
|
|
183
|
+
const navigationClasses = ['navigation'];
|
|
184
|
+
if (this.mobileMenuExtended) {
|
|
185
|
+
navigationClasses.push('extended');
|
|
186
|
+
}
|
|
187
|
+
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" })))));
|
|
188
|
+
}
|
|
189
|
+
render() {
|
|
190
|
+
return (h(Host, { key: '45452d2c2f6ac9a067ce71330ea898a797040cca', version: version }, h("div", { key: 'c50478141de45d0a718b18c0edc416eb9c832fde', class: "global-header" }, h("div", { key: 'a2ddc2de9a94fb3b16928fe9c1ac3b3ae61ff9bf', class: "global-sub" }, h("div", { key: '30083683ff7683202118471473f2a0ed98a1c920', class: "logo" }, h("slot", { key: '028bd4a8f03a228378b09a80dce8654d52c30e5c', name: "post-logo" }))), h("div", { key: '853bcf2e6c8a95d88f62795cef8d8e58c8996811', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '40e3027a4e4358b7a614558ed7e1f59fa65ed312', name: "meta-navigation" }), h("slot", { key: '31c141cc45aa12441557d9b817630328df3d3778', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'afe4b2c3123a89c1a4390578c22e89dfff7be655', name: "post-language-switch" }), h("div", { key: 'aea74d0c7f25288afa18b5aeb3e557216d695ec3', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '1efed8b7c823ef49b89120ed2e23f151c64b9c0e', name: "post-togglebutton" })))), h("div", { key: 'e09df2136d01c0516d0166f505055615cf1d70d3', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, h("slot", { key: '491f9bbcb2743519f544b24ae6f00405be85e589', name: "title" }), h("div", { key: 'e85c0a76597832a6966e989111b4508579fb9c4d', class: "local-sub" }, h("slot", { key: 'f2d504ea6a3d7592a15551e6be8cb0c1ba220fbc', name: "local-controls" }), h("slot", { key: 'e0dd0f9c12e0c6bf5d5d66cb29139af59f7c0b4d' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
|
|
191
|
+
}
|
|
192
|
+
static get watchers() { return {
|
|
193
|
+
"mobileMenuExtended": ["frozeBody"]
|
|
194
|
+
}; }
|
|
195
|
+
static get style() { return PostHeaderStyle0; }
|
|
196
|
+
}, [1, "post-header", {
|
|
197
|
+
"device": [32],
|
|
198
|
+
"mobileMenuExtended": [32],
|
|
199
|
+
"toggleMobileMenu": [64]
|
|
200
|
+
}, undefined, {
|
|
201
|
+
"mobileMenuExtended": ["frozeBody"]
|
|
202
|
+
}]);
|
|
203
|
+
function defineCustomElement() {
|
|
204
|
+
if (typeof customElements === "undefined") {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const components = ["post-header"];
|
|
208
|
+
components.forEach(tagName => { switch (tagName) {
|
|
209
|
+
case "post-header":
|
|
210
|
+
if (!customElements.get(tagName)) {
|
|
211
|
+
customElements.define(tagName, PostHeader);
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
} });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { PostHeader as P, defineCustomElement as d };
|