@swisspost/design-system-components 9.0.0-next.32 → 9.0.0-next.34
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/cjs/{attribute-observer-6d8b886b.js → attribute-observer-c3a805b2.js} +3 -1
- package/dist/cjs/{breakpoints-c6247c71.js → breakpoints-cdf1b747.js} +12 -7
- package/dist/cjs/event-guard-efabc84f.js +47 -0
- package/dist/cjs/get-root-8102fecd.js +17 -0
- package/dist/cjs/{index-d6bf2c66.js → index-b60129c4.js} +2 -2
- package/dist/cjs/index.cjs.js +25 -25
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/long-press-event-6e62d113.js +266 -0
- package/dist/cjs/{package-6f8f430c.js → package-3426e8f7.js} +1 -1
- package/dist/cjs/{post-accordion-e3a6d78e.js → post-accordion-3ac8dca8.js} +10 -12
- package/dist/cjs/{post-accordion-item-7ed1f630.js → post-accordion-item-aace6bc2.js} +10 -10
- package/dist/cjs/post-accordion-item.cjs.entry.js +5 -3
- package/dist/cjs/post-accordion.cjs.entry.js +5 -3
- package/dist/cjs/{post-avatar-de8ec197.js → post-avatar-53abd22f.js} +5 -4
- package/dist/cjs/post-avatar.cjs.entry.js +4 -3
- package/dist/cjs/post-back-to-top-b231fc1c.js +96 -0
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -3
- package/dist/cjs/{post-banner-bf523706.js → post-banner-e6d14bf1.js} +4 -8
- package/dist/cjs/post-banner.cjs.entry.js +4 -3
- package/dist/cjs/{post-breadcrumb-da55143a.js → post-breadcrumb-a929f2a6.js} +30 -22
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +4 -3
- package/dist/cjs/post-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/{post-card-control-0bcd7d16.js → post-card-control-cbee7b86.js} +26 -40
- package/dist/cjs/post-card-control.cjs.entry.js +4 -3
- package/dist/cjs/post-closebutton_15.cjs.entry.js +6 -5
- package/dist/cjs/{post-collapsible-trigger-a5e4451d.js → post-collapsible-trigger-d1cb592a.js} +39 -46
- package/dist/cjs/post-collapsible_2.cjs.entry.js +6 -5
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/{post-footer-b15fee73.js → post-footer-4290dafc.js} +11 -11
- package/dist/cjs/post-footer.cjs.entry.js +4 -4
- package/dist/cjs/{post-linkarea-8c85bf5e.js → post-linkarea-f22f4f92.js} +5 -5
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/{post-menu-item-509877cd.js → post-menu-item-afabaa61.js} +4 -4
- package/dist/cjs/{post-popover-1213aa19.js → post-popover-a4c72d38.js} +16 -14
- package/dist/cjs/post-popover.cjs.entry.js +5 -4
- package/dist/cjs/{post-rating-e1f8a668.js → post-rating-b87616fc.js} +4 -14
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-889a6c64.js → post-tab-header-45cb6bb4.js} +5 -4
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -3
- package/dist/cjs/{post-tab-panel-300f39a9.js → post-tab-panel-00d16ba7.js} +4 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-dc281228.js → post-tabs-2c3a89d0.js} +5 -12
- package/dist/cjs/post-tabs.cjs.entry.js +4 -3
- package/dist/cjs/{post-tag-fd9e586f.js → post-tag-370a2f4d.js} +3 -3
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-ad6ae1e4.js → post-togglebutton-2c9552e3.js} +969 -471
- package/dist/cjs/{post-tooltip-52d690e4.js → post-tooltip-4d4d2ea9.js} +39 -296
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
- package/dist/collection/animations/collapse.js +3 -1
- package/dist/collection/components/post-accordion/post-accordion.js +6 -10
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +6 -8
- package/dist/collection/components/post-avatar/post-avatar.js +3 -4
- 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 +37 -19
- package/dist/collection/components/post-banner/post-banner.js +0 -6
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +16 -19
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -2
- package/dist/collection/components/post-card-control/post-card-control.js +24 -40
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -0
- package/dist/collection/components/post-closebutton/post-closebutton.js +12 -2
- package/dist/collection/components/post-collapsible/post-collapsible.js +4 -10
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +29 -32
- package/dist/collection/components/post-footer/post-footer.js +8 -9
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +16 -19
- package/dist/collection/components/post-icon/post-icon.js +5 -7
- package/dist/collection/components/post-language-option/post-language-option.js +1 -10
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +25 -31
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +2 -2
- package/dist/collection/components/post-list/post-list.js +1 -3
- package/dist/collection/components/post-list-item/post-list-item.js +1 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +98 -182
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +20 -30
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +42 -36
- package/dist/collection/components/post-menu/post-menu.js +51 -52
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +13 -15
- package/dist/collection/components/post-popover/post-popover.js +12 -12
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +30 -33
- package/dist/collection/components/post-rating/post-rating.js +1 -12
- package/dist/collection/components/post-tab-header/post-tab-header.js +2 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
- package/dist/collection/components/post-tabs/post-tabs.js +1 -10
- package/dist/collection/components/post-tag/post-tag.js +0 -1
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +10 -11
- package/dist/collection/components/post-tooltip/post-tooltip.js +36 -32
- package/dist/collection/utils/attribute-observer.js +2 -1
- package/dist/collection/utils/breakpoints.js +9 -7
- package/dist/collection/utils/environment.js +2 -0
- package/dist/collection/utils/event-guard.js +43 -0
- package/dist/collection/utils/get-root.js +6 -1
- package/dist/collection/utils/index.js +5 -0
- package/dist/collection/utils/is-motion-reduced.js +2 -1
- package/dist/components/attribute-observer.js +3 -1
- package/dist/components/breakpoints.js +12 -8
- package/dist/components/event-guard.js +45 -0
- package/dist/components/get-root.js +7 -1
- package/dist/components/long-press-event.js +264 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +8 -8
- package/dist/components/post-accordion2.js +8 -10
- package/dist/components/post-avatar2.js +4 -3
- package/dist/components/post-back-to-top2.js +40 -20
- package/dist/components/post-banner2.js +2 -6
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/post-breadcrumb2.js +28 -20
- package/dist/components/post-card-control2.js +25 -39
- package/dist/components/post-closebutton2.js +8 -3
- package/dist/components/post-collapsible-trigger2.js +33 -35
- package/dist/components/post-collapsible2.js +9 -12
- package/dist/components/post-footer2.js +8 -8
- package/dist/components/post-header2.js +18 -20
- package/dist/components/post-icon2.js +6 -6
- package/dist/components/post-language-option2.js +3 -10
- package/dist/components/post-language-switch2.js +28 -31
- package/dist/components/post-linkarea2.js +5 -4
- package/dist/components/post-list-item2.js +2 -2
- package/dist/components/post-list2.js +2 -3
- package/dist/components/post-logo2.js +3 -2
- package/dist/components/post-mainnavigation2.js +94 -182
- package/dist/components/post-megadropdown-trigger2.js +44 -36
- package/dist/components/post-megadropdown2.js +22 -31
- package/dist/components/post-menu-trigger2.js +15 -15
- package/dist/components/post-menu2.js +53 -52
- package/dist/components/post-popover2.js +14 -12
- package/dist/components/post-popovercontainer2.js +638 -36
- package/dist/components/post-rating2.js +2 -12
- package/dist/components/post-tab-header2.js +4 -3
- package/dist/components/post-tab-panel2.js +3 -3
- package/dist/components/post-tabs2.js +3 -10
- package/dist/components/post-tag2.js +1 -1
- package/dist/components/post-togglebutton2.js +12 -11
- package/dist/components/post-tooltip2.js +37 -294
- package/dist/docs.json +21 -15
- package/dist/esm/{attribute-observer-2f203993.js → attribute-observer-009deee5.js} +3 -1
- package/dist/esm/{breakpoints-bbe0c54e.js → breakpoints-7812702e.js} +12 -8
- package/dist/esm/event-guard-538ee077.js +45 -0
- package/dist/esm/get-root-1b1af46f.js +15 -0
- package/dist/esm/{index-3419e46d.js → index-f4d19816.js} +2 -2
- package/dist/esm/index.js +25 -25
- package/dist/esm/loader.js +3 -3
- package/dist/esm/long-press-event-04d24397.js +264 -0
- package/dist/esm/package-8986a24c.js +3 -0
- package/dist/esm/{post-accordion-7b6fb9c3.js → post-accordion-577b52a0.js} +10 -12
- package/dist/esm/{post-accordion-item-d40c0b26.js → post-accordion-item-99053b41.js} +10 -10
- package/dist/esm/post-accordion-item.entry.js +5 -3
- package/dist/esm/post-accordion.entry.js +5 -3
- package/dist/esm/{post-avatar-04ca6e3e.js → post-avatar-2914706c.js} +5 -4
- package/dist/esm/post-avatar.entry.js +4 -3
- package/dist/esm/post-back-to-top-4c7b1b47.js +94 -0
- package/dist/esm/post-back-to-top.entry.js +4 -3
- package/dist/esm/{post-banner-7c37e3ef.js → post-banner-295fd0f5.js} +4 -8
- package/dist/esm/post-banner.entry.js +4 -3
- package/dist/esm/{post-breadcrumb-59e4d655.js → post-breadcrumb-1abfb312.js} +30 -22
- package/dist/esm/post-breadcrumb-item_2.entry.js +4 -3
- package/dist/esm/post-breadcrumb.entry.js +4 -4
- package/dist/esm/{post-card-control-5471488b.js → post-card-control-ad72d4f8.js} +26 -40
- package/dist/esm/post-card-control.entry.js +4 -3
- package/dist/esm/post-closebutton_15.entry.js +6 -5
- package/dist/esm/{post-collapsible-trigger-1f6d816e.js → post-collapsible-trigger-6b4ece20.js} +39 -46
- package/dist/esm/post-collapsible_2.entry.js +6 -5
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/{post-footer-d30f4dc8.js → post-footer-a5105e66.js} +11 -11
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/{post-linkarea-8e1a561e.js → post-linkarea-22f97a88.js} +5 -5
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/{post-menu-item-0c8477eb.js → post-menu-item-9465a1f3.js} +4 -4
- package/dist/esm/{post-popover-c43969ca.js → post-popover-e9b4569c.js} +16 -14
- package/dist/esm/post-popover.entry.js +5 -4
- package/dist/esm/{post-rating-94148df7.js → post-rating-ae16e3c9.js} +4 -14
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-82df0ba9.js → post-tab-header-11f23150.js} +5 -4
- package/dist/esm/post-tab-header.entry.js +4 -3
- package/dist/esm/{post-tab-panel-a6512f53.js → post-tab-panel-0f3a952e.js} +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-d26ce341.js → post-tabs-1192509c.js} +5 -12
- package/dist/esm/post-tabs.entry.js +4 -3
- package/dist/esm/{post-tag-41d1667e.js → post-tag-8be0a71c.js} +3 -3
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-4f94bddb.js → post-togglebutton-b634fc7c.js} +969 -471
- package/dist/esm/{post-tooltip-20f916db.js → post-tooltip-f64bd0cc.js} +39 -296
- package/dist/esm/post-tooltip.entry.js +5 -4
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-0889c759.js +1 -0
- package/dist/post-components/p-0f398677.js +1 -0
- package/dist/post-components/p-1038fc25.js +1 -0
- package/dist/post-components/p-30f94eca.entry.js +1 -0
- package/dist/post-components/p-31bb6dc5.entry.js +1 -0
- package/dist/post-components/p-32173742.js +1 -0
- package/dist/post-components/p-338a2507.js +1 -0
- package/dist/post-components/p-36540dd6.entry.js +1 -0
- package/dist/post-components/p-3aa766a6.js +1 -0
- package/dist/post-components/p-3b0158b3.js +1 -0
- package/dist/post-components/p-40db8cd5.js +1 -0
- package/dist/post-components/p-44f13ce4.entry.js +1 -0
- package/dist/post-components/p-46a9324f.entry.js +1 -0
- package/dist/post-components/p-49c5aa99.js +1 -0
- package/dist/post-components/p-4cd4a936.entry.js +1 -0
- package/dist/post-components/p-548ef2f5.entry.js +1 -0
- package/dist/post-components/p-58f453dd.js +1 -0
- package/dist/post-components/p-5f54b77f.js +1 -0
- package/dist/post-components/p-60bb7f26.js +1 -0
- package/dist/post-components/p-60bfa4be.entry.js +1 -0
- package/dist/post-components/p-6b31a76a.js +1 -0
- package/dist/post-components/p-6ee81c5d.js +1 -0
- package/dist/post-components/p-6faad212.entry.js +1 -0
- package/dist/post-components/p-722ffaae.js +1 -0
- package/dist/post-components/p-74a0b44c.entry.js +1 -0
- package/dist/post-components/{p-28e77ad3.js → p-78b4c699.js} +1 -1
- package/dist/post-components/p-7aa0468b.entry.js +1 -0
- package/dist/post-components/p-7afc495e.entry.js +1 -0
- package/dist/post-components/p-8db32dab.js +8 -0
- package/dist/post-components/p-96034ba4.entry.js +1 -0
- package/dist/post-components/p-9aaf9f54.js +1 -0
- package/dist/post-components/{p-5c758f41.js → p-9e461613.js} +1 -1
- package/dist/post-components/p-ab4073be.js +1 -0
- package/dist/post-components/p-abd7eb91.js +8 -0
- package/dist/post-components/p-afb8a487.entry.js +1 -0
- package/dist/post-components/p-b003b381.js +1 -0
- package/dist/post-components/p-b97dea1e.entry.js +1 -0
- package/dist/post-components/p-be37cf2a.js +1 -0
- package/dist/post-components/p-c31b56ed.js +1 -0
- package/dist/post-components/p-ccbb51fe.js +1 -0
- package/dist/post-components/p-d3900385.entry.js +1 -0
- package/dist/post-components/p-ef49153c.entry.js +1 -0
- package/dist/post-components/p-f27e5691.js +1 -0
- package/dist/post-components/p-f553019f.entry.js +1 -0
- package/dist/post-components/p-ffc1db17.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +1 -1
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +3 -1
- package/dist/types/components/post-card-control/post-card-control.d.ts +1 -1
- package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +9 -14
- package/dist/types/components/post-footer/post-footer.d.ts +2 -2
- package/dist/types/components/post-header/post-header.d.ts +1 -0
- package/dist/types/components/post-icon/post-icon.d.ts +0 -1
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +5 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +14 -39
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +2 -0
- package/dist/types/components/post-menu/post-menu.d.ts +1 -0
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +3 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +6 -1
- package/dist/types/components.d.ts +4 -4
- package/dist/types/popover-fn.d.ts +11 -0
- package/dist/types/utils/environment.d.ts +2 -0
- package/dist/types/utils/event-guard.d.ts +4 -0
- package/dist/types/utils/get-root.d.ts +4 -0
- package/dist/types/utils/index.d.ts +5 -0
- package/loaders/attribute-observer.js +3 -1
- package/loaders/breakpoints.js +12 -8
- package/loaders/event-guard.js +45 -0
- package/loaders/get-root.js +7 -1
- package/loaders/index.js +3 -3
- package/loaders/long-press-event.js +264 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +8 -8
- package/loaders/post-accordion.js +8 -10
- package/loaders/post-avatar.js +4 -3
- package/loaders/post-back-to-top.js +40 -20
- package/loaders/post-banner.js +2 -6
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/post-breadcrumb.js +28 -20
- package/loaders/post-card-control.js +25 -39
- package/loaders/post-closebutton.js +8 -3
- package/loaders/post-collapsible-trigger2.js +33 -35
- package/loaders/post-collapsible2.js +9 -12
- package/loaders/post-footer.js +8 -8
- package/loaders/post-header.js +18 -20
- package/loaders/post-icon2.js +6 -6
- package/loaders/post-language-option.js +3 -10
- package/loaders/post-language-switch.js +28 -31
- package/loaders/post-linkarea.js +5 -4
- package/loaders/post-list-item.js +2 -2
- package/loaders/post-list.js +2 -3
- package/loaders/post-logo.js +3 -2
- package/loaders/post-mainnavigation.js +94 -182
- package/loaders/post-megadropdown-trigger.js +44 -36
- package/loaders/post-megadropdown.js +22 -31
- package/loaders/post-menu-trigger2.js +15 -15
- package/loaders/post-menu2.js +53 -52
- package/loaders/post-popover.js +14 -12
- package/loaders/post-popovercontainer2.js +638 -36
- package/loaders/post-rating.js +2 -12
- package/loaders/post-tab-header.js +4 -3
- package/loaders/post-tab-panel.js +3 -3
- package/loaders/post-tabs.js +3 -10
- package/loaders/post-tag.js +1 -1
- package/loaders/post-togglebutton.js +12 -11
- package/loaders/post-tooltip.js +37 -294
- package/package.json +5 -5
- package/dist/cjs/debounce-158fd76f.js +0 -13
- package/dist/cjs/get-root-7a3498ef.js +0 -11
- package/dist/cjs/post-back-to-top-6a1c1ba4.js +0 -76
- package/dist/components/debounce.js +0 -11
- package/dist/esm/debounce-e54c7131.js +0 -11
- package/dist/esm/get-root-7af2e0d1.js +0 -9
- package/dist/esm/package-70367d05.js +0 -3
- package/dist/esm/post-back-to-top-abe253c1.js +0 -74
- package/dist/post-components/p-015361b5.entry.js +0 -1
- package/dist/post-components/p-077edb8c.js +0 -1
- package/dist/post-components/p-08a13d05.js +0 -1
- package/dist/post-components/p-08c3b919.entry.js +0 -1
- package/dist/post-components/p-0d7b0c2e.entry.js +0 -1
- package/dist/post-components/p-12f9a91e.entry.js +0 -1
- package/dist/post-components/p-20137c6a.entry.js +0 -1
- package/dist/post-components/p-21254d9c.entry.js +0 -1
- package/dist/post-components/p-22513a27.entry.js +0 -1
- package/dist/post-components/p-3638e50d.js +0 -1
- package/dist/post-components/p-4397f28e.js +0 -1
- package/dist/post-components/p-494a2a31.js +0 -1
- package/dist/post-components/p-509987da.entry.js +0 -1
- package/dist/post-components/p-5aeb3656.js +0 -1
- package/dist/post-components/p-5d0bb74d.js +0 -1
- package/dist/post-components/p-5e0f6c12.js +0 -1
- package/dist/post-components/p-5f89f4e8.entry.js +0 -1
- package/dist/post-components/p-6213f0dc.entry.js +0 -1
- package/dist/post-components/p-6ad7bf0f.js +0 -1
- package/dist/post-components/p-6f058a98.js +0 -1
- package/dist/post-components/p-737d76cb.js +0 -15
- package/dist/post-components/p-753a1935.js +0 -1
- package/dist/post-components/p-88a2cdaa.js +0 -1
- package/dist/post-components/p-90935fdd.js +0 -1
- package/dist/post-components/p-931c4523.js +0 -1
- package/dist/post-components/p-9748a355.js +0 -1
- package/dist/post-components/p-97865e22.entry.js +0 -1
- package/dist/post-components/p-a200c9c7.js +0 -1
- package/dist/post-components/p-a35c235a.entry.js +0 -1
- package/dist/post-components/p-a4264a61.entry.js +0 -1
- package/dist/post-components/p-a54c63d0.entry.js +0 -1
- package/dist/post-components/p-aebe402d.entry.js +0 -1
- package/dist/post-components/p-b43e79e3.entry.js +0 -1
- package/dist/post-components/p-c0c71e37.js +0 -1
- package/dist/post-components/p-c0ca344d.js +0 -1
- package/dist/post-components/p-c554fcf3.js +0 -1
- package/dist/post-components/p-cff7c06f.entry.js +0 -1
- package/dist/post-components/p-d1f70a05.entry.js +0 -1
- package/dist/post-components/p-dc67e6de.entry.js +0 -1
- package/dist/post-components/p-e1baac59.js +0 -1
- package/dist/post-components/p-f1ceccf3.js +0 -1
- package/dist/post-components/p-fc91cbc2.js +0 -1
- package/loaders/debounce.js +0 -11
|
@@ -4,18 +4,16 @@ import { version } from "../../../../package";
|
|
|
4
4
|
import { checkType, checkNonEmpty } from "../../utils/index";
|
|
5
5
|
export class PostBackToTop {
|
|
6
6
|
constructor() {
|
|
7
|
+
this.handleScroll = () => {
|
|
8
|
+
this.belowFold = this.isBelowFold();
|
|
9
|
+
};
|
|
7
10
|
this.label = undefined;
|
|
8
11
|
this.belowFold = false;
|
|
9
12
|
}
|
|
10
|
-
host;
|
|
11
|
-
translateY;
|
|
12
13
|
isBelowFold() {
|
|
13
14
|
return window.scrollY > window.innerHeight;
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
this.belowFold = this.isBelowFold();
|
|
17
|
-
};
|
|
18
|
-
// Watch for changes in belowFold
|
|
16
|
+
/*Watch for changes in belowFold to show/hide the back to top button*/
|
|
19
17
|
watchBelowFold(newValue) {
|
|
20
18
|
if (newValue) {
|
|
21
19
|
slideDown(this.host, this.translateY);
|
|
@@ -27,12 +25,41 @@ export class PostBackToTop {
|
|
|
27
25
|
scrollToTop() {
|
|
28
26
|
window.scrollTo({
|
|
29
27
|
top: 0,
|
|
28
|
+
behavior: 'smooth',
|
|
30
29
|
});
|
|
31
30
|
}
|
|
31
|
+
getSecondPixelValue(parts) {
|
|
32
|
+
for (const part of parts) {
|
|
33
|
+
const pixelValues = part.match(/\b\d+px\b/g);
|
|
34
|
+
if (pixelValues && pixelValues.length > 1) {
|
|
35
|
+
return pixelValues[1];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
animateButton() {
|
|
40
|
+
// Get the back-to-top button top postiion
|
|
41
|
+
const positionTop = window.getComputedStyle(this.host).getPropertyValue('top');
|
|
42
|
+
const buttonElement = this.host.shadowRoot.querySelector('button');
|
|
43
|
+
// Extract the elevation height from the back-to-top button elevation token
|
|
44
|
+
const elevation = getComputedStyle(buttonElement).getPropertyValue('--post-back-to-top-elevation');
|
|
45
|
+
const elevationParts = elevation.split(',');
|
|
46
|
+
const elevationHeight = this.getSecondPixelValue(elevationParts);
|
|
47
|
+
// The translateY is calculated as => -100% (btt button height) - topPosition - elevationHeight
|
|
48
|
+
this.translateY =
|
|
49
|
+
String((-1 * 100) / 100 -
|
|
50
|
+
parseFloat(positionTop.replace('px', '')) -
|
|
51
|
+
parseFloat(elevationHeight.replace('px', ''))) + 'px';
|
|
52
|
+
if (this.belowFold) {
|
|
53
|
+
slideDown(this.host, this.translateY);
|
|
54
|
+
}
|
|
55
|
+
if (!this.belowFold) {
|
|
56
|
+
this.host.style.transform = `translateY(${this.translateY})`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
32
59
|
// Validate the label
|
|
33
60
|
validateLabel() {
|
|
34
|
-
checkType(this, 'label', 'string');
|
|
35
61
|
checkNonEmpty(this, 'label');
|
|
62
|
+
checkType(this, 'label', 'string');
|
|
36
63
|
}
|
|
37
64
|
// Set the initial state
|
|
38
65
|
componentWillLoad() {
|
|
@@ -40,23 +67,14 @@ export class PostBackToTop {
|
|
|
40
67
|
}
|
|
41
68
|
componentDidLoad() {
|
|
42
69
|
window.addEventListener('scroll', this.handleScroll, false);
|
|
43
|
-
this.
|
|
44
|
-
.getComputedStyle(this.host)
|
|
45
|
-
.getPropertyValue('--post-floating-button-translate-y');
|
|
46
|
-
if (!this.belowFold) {
|
|
47
|
-
this.host.style.transform = `translateY(${this.translateY})`;
|
|
48
|
-
}
|
|
49
|
-
// Initial load
|
|
50
|
-
if (this.belowFold) {
|
|
51
|
-
slideUp(this.host, this.translateY);
|
|
52
|
-
}
|
|
70
|
+
this.animateButton();
|
|
53
71
|
this.validateLabel();
|
|
54
72
|
}
|
|
55
73
|
disconnectedCallback() {
|
|
56
74
|
window.removeEventListener('scroll', this.handleScroll);
|
|
57
75
|
}
|
|
58
76
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
77
|
+
return (h(Host, { key: 'c1ab6c5e7619ad829d64aea16c59a923310cf091', "data-version": version }, h("button", { key: '99e10e4d16c8d82521b001c3b3d902d8ba47ee92', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, h("post-icon", { key: '5a6a1b472b45fcc466127ece7091617e4700ee16', "aria-hidden": "true", name: "3026" }), h("span", { key: 'c8502e4822347d48034f6a936203e3314c7ae91e', class: "visually-hidden" }, this.label))));
|
|
60
78
|
}
|
|
61
79
|
static get is() { return "post-back-to-top"; }
|
|
62
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -87,7 +105,7 @@ export class PostBackToTop {
|
|
|
87
105
|
"text": "The label of the back-to-top button, intended solely for accessibility purposes.\nThis label is always hidden from view."
|
|
88
106
|
},
|
|
89
107
|
"attribute": "label",
|
|
90
|
-
"reflect":
|
|
108
|
+
"reflect": true
|
|
91
109
|
}
|
|
92
110
|
};
|
|
93
111
|
}
|
|
@@ -21,7 +21,6 @@ export class PostBanner {
|
|
|
21
21
|
this.icon = undefined;
|
|
22
22
|
this.type = 'neutral';
|
|
23
23
|
}
|
|
24
|
-
host;
|
|
25
24
|
validateDismissible() {
|
|
26
25
|
checkType(this, 'dismissible', 'boolean');
|
|
27
26
|
setTimeout(() => this.validateDismissLabel());
|
|
@@ -37,11 +36,6 @@ export class PostBanner {
|
|
|
37
36
|
validateType() {
|
|
38
37
|
checkEmptyOrOneOf(this, 'type', BANNER_TYPES);
|
|
39
38
|
}
|
|
40
|
-
/**
|
|
41
|
-
* An event emitted when the banner element is dismissed, after the transition.
|
|
42
|
-
* It has no payload and only relevant for dismissible banners.
|
|
43
|
-
*/
|
|
44
|
-
postDismissed;
|
|
45
39
|
componentDidLoad() {
|
|
46
40
|
this.validateDismissible();
|
|
47
41
|
this.validateIcon();
|
|
@@ -3,15 +3,28 @@ import { version } from "../../../../package";
|
|
|
3
3
|
import { checkUrl, debounce } from "../../utils/index";
|
|
4
4
|
export class PostBreadcrumb {
|
|
5
5
|
constructor() {
|
|
6
|
+
// Waits for breadcrumb navigation reference to be available
|
|
7
|
+
this.waitForBreadcrumbRef = debounce(() => {
|
|
8
|
+
if (this.breadcrumbNavRef?.clientWidth > 0) {
|
|
9
|
+
this.checkConcatenation();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
this.waitForBreadcrumbRef();
|
|
13
|
+
}
|
|
14
|
+
}, 50);
|
|
15
|
+
// Handles resizing to check concatenation
|
|
16
|
+
this.handleResize = () => {
|
|
17
|
+
if (window.innerWidth === this.lastWindowWidth)
|
|
18
|
+
return;
|
|
19
|
+
this.lastWindowWidth = window.innerWidth;
|
|
20
|
+
this.checkConcatenation();
|
|
21
|
+
};
|
|
6
22
|
this.homeUrl = undefined;
|
|
7
23
|
this.homeText = 'Home';
|
|
8
24
|
this.breadcrumbItems = [];
|
|
9
25
|
this.isConcatenated = undefined;
|
|
10
26
|
this.lastWindowWidth = undefined;
|
|
11
27
|
}
|
|
12
|
-
host;
|
|
13
|
-
breadcrumbNavRef;
|
|
14
|
-
lastItem;
|
|
15
28
|
validateUrl() {
|
|
16
29
|
checkUrl(this, 'homeUrl');
|
|
17
30
|
}
|
|
@@ -25,15 +38,6 @@ export class PostBreadcrumb {
|
|
|
25
38
|
disconnectedCallback() {
|
|
26
39
|
window.removeEventListener('resize', this.handleResize);
|
|
27
40
|
}
|
|
28
|
-
// Waits for breadcrumb navigation reference to be available
|
|
29
|
-
waitForBreadcrumbRef = debounce(() => {
|
|
30
|
-
if (this.breadcrumbNavRef?.clientWidth > 0) {
|
|
31
|
-
this.checkConcatenation();
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this.waitForBreadcrumbRef();
|
|
35
|
-
}
|
|
36
|
-
}, 50);
|
|
37
41
|
// Updates breadcrumb items and sets the last item
|
|
38
42
|
updateBreadcrumbItems() {
|
|
39
43
|
this.breadcrumbItems = Array.from(this.host.querySelectorAll('post-breadcrumb-item')).map(item => ({
|
|
@@ -42,13 +46,6 @@ export class PostBreadcrumb {
|
|
|
42
46
|
}));
|
|
43
47
|
this.lastItem = this.breadcrumbItems[this.breadcrumbItems.length - 1];
|
|
44
48
|
}
|
|
45
|
-
// Handles resizing to check concatenation
|
|
46
|
-
handleResize = () => {
|
|
47
|
-
if (window.innerWidth === this.lastWindowWidth)
|
|
48
|
-
return;
|
|
49
|
-
this.lastWindowWidth = window.innerWidth;
|
|
50
|
-
this.checkConcatenation();
|
|
51
|
-
};
|
|
52
49
|
// Determines parent width for concatenation logic
|
|
53
50
|
getParentWidth() {
|
|
54
51
|
let parent = this.host.parentNode;
|
|
@@ -9,42 +9,6 @@ let cardControlIds = 0;
|
|
|
9
9
|
* @slot icon - To insert a custom icon into the named `icon` slot.<p>Markup accepted: <a href="https://developer.mozilla.org/en-US/docs/Glossary/Inline-level_content">inline content</a>.<p className="banner banner-sm banner-info">It is only meant for <code>img</code> or <code>svg</code> elements and overrides the `icon` property.</p>
|
|
10
10
|
*/
|
|
11
11
|
export class PostCardControl {
|
|
12
|
-
EVENT_MAP = {
|
|
13
|
-
input: 'postInput',
|
|
14
|
-
change: 'postChange',
|
|
15
|
-
};
|
|
16
|
-
KEYCODES = {
|
|
17
|
-
SPACE: 'Space',
|
|
18
|
-
LEFT: 'ArrowLeft',
|
|
19
|
-
UP: 'ArrowUp',
|
|
20
|
-
RIGHT: 'ArrowRight',
|
|
21
|
-
DOWN: 'ArrowDown',
|
|
22
|
-
};
|
|
23
|
-
group = {
|
|
24
|
-
hosts: [],
|
|
25
|
-
members: [],
|
|
26
|
-
first: null,
|
|
27
|
-
last: null,
|
|
28
|
-
checked: null,
|
|
29
|
-
focused: null,
|
|
30
|
-
};
|
|
31
|
-
control;
|
|
32
|
-
controlId = `PostCardControl_${cardControlIds++}`;
|
|
33
|
-
initialChecked;
|
|
34
|
-
hasIcon;
|
|
35
|
-
host;
|
|
36
|
-
internals;
|
|
37
|
-
/**
|
|
38
|
-
* An event emitted whenever the components checked state is toggled.
|
|
39
|
-
* The event payload (emitted under `event.detail.state`) is a boolean: `true` if the component is checked, `false` if it is unchecked.
|
|
40
|
-
*/
|
|
41
|
-
postInput;
|
|
42
|
-
/**
|
|
43
|
-
* An event emitted whenever the components checked state is toggled.
|
|
44
|
-
* The event payload (emitted under `event.detail.state`) is a boolean: `true` if the component is checked, `false` if it is unchecked.
|
|
45
|
-
* <span className="banner banner-sm banner-info">If the component is used with type `radio`, it will only emit this event, when the checked state is changing to `true`.</span>
|
|
46
|
-
*/
|
|
47
|
-
postChange;
|
|
48
12
|
/**
|
|
49
13
|
* A public method to reset the controls `checked` and `validity` state.
|
|
50
14
|
* The validity state is set to `null`, so it's neither valid nor invalid.
|
|
@@ -74,6 +38,26 @@ export class PostCardControl {
|
|
|
74
38
|
this.controlSetChecked(this.checked);
|
|
75
39
|
}
|
|
76
40
|
constructor() {
|
|
41
|
+
this.EVENT_MAP = {
|
|
42
|
+
input: 'postInput',
|
|
43
|
+
change: 'postChange',
|
|
44
|
+
};
|
|
45
|
+
this.KEYCODES = {
|
|
46
|
+
SPACE: 'Space',
|
|
47
|
+
LEFT: 'ArrowLeft',
|
|
48
|
+
UP: 'ArrowUp',
|
|
49
|
+
RIGHT: 'ArrowRight',
|
|
50
|
+
DOWN: 'ArrowDown',
|
|
51
|
+
};
|
|
52
|
+
this.group = {
|
|
53
|
+
hosts: [],
|
|
54
|
+
members: [],
|
|
55
|
+
first: null,
|
|
56
|
+
last: null,
|
|
57
|
+
checked: null,
|
|
58
|
+
focused: null,
|
|
59
|
+
};
|
|
60
|
+
this.controlId = `PostCardControl_${cardControlIds++}`;
|
|
77
61
|
this.focused = false;
|
|
78
62
|
this.label = undefined;
|
|
79
63
|
this.description = null;
|
|
@@ -232,14 +216,14 @@ export class PostCardControl {
|
|
|
232
216
|
this.hasIcon = Boolean(this.host.querySelector('[slot="icon"]') || this.icon);
|
|
233
217
|
}
|
|
234
218
|
render() {
|
|
235
|
-
return (h(Host, { key: '
|
|
219
|
+
return (h(Host, { key: '9172642a4424a3393c0738feba3a3ef8dcea43e8', "data-version": version, onClick: this.cardClickHandler }, h("div", { key: 'd6e47613dfe9d33647fd2379010275d70cbcbdcb', class: {
|
|
236
220
|
'card-control': true,
|
|
237
221
|
'is-checked': this.checked,
|
|
238
222
|
'is-disabled': this.disabled,
|
|
239
223
|
'is-focused': this.focused,
|
|
240
224
|
'is-valid': this.validity !== null && this.validity !== 'false',
|
|
241
225
|
'is-invalid': this.validity === 'false',
|
|
242
|
-
} }, h("input", { key: '
|
|
226
|
+
} }, h("input", { key: '44b0e5d5c2c6a759300979a5c33c2a65afaaa27d', ref: el => (this.control = el), id: this.controlId, class: "card-control--input", type: this.type, name: this.name, value: this.value, checked: this.checked, "aria-describedby": `${this.controlId}_content`, "aria-disabled": this.disabled, "aria-invalid": this.validity === 'false', onClick: this.controlClickHandler, onInput: this.controlChangeHandler, onChange: this.controlChangeHandler, onFocus: this.controlFocusHandler, onBlur: this.controlFocusHandler, onKeyDown: this.controlKeyDownHandler }), h("label", { key: 'fd3106562bfcb5ca0e7e5704272f927bfb201af5', id: `${this.controlId}_label`, htmlFor: this.controlId, class: "card-control--label" }, this.label, this.description ? (h("div", { class: "card-control--description" }, this.description)) : null), this.hasIcon ? (h("div", { class: "card-control--icon" }, h("slot", { name: "icon" }, this.icon ? h("post-icon", { name: this.icon }) : null))) : null, h("div", { key: 'ebfa245a0e2b6e45384586408614ce85494fbc58', id: `${this.controlId}_content`, class: "card-control--content" }, h("slot", { key: '99b406bc58fbfcd054f1b551a453a7ac1f4276f6' })))));
|
|
243
227
|
}
|
|
244
228
|
componentDidRender() {
|
|
245
229
|
this.setHostContext();
|
|
@@ -291,7 +275,7 @@ export class PostCardControl {
|
|
|
291
275
|
"text": "Defines the text in the control-label."
|
|
292
276
|
},
|
|
293
277
|
"attribute": "label",
|
|
294
|
-
"reflect":
|
|
278
|
+
"reflect": true
|
|
295
279
|
},
|
|
296
280
|
"description": {
|
|
297
281
|
"type": "string",
|
|
@@ -340,7 +324,7 @@ export class PostCardControl {
|
|
|
340
324
|
"optional": false,
|
|
341
325
|
"docs": {
|
|
342
326
|
"tags": [],
|
|
343
|
-
"text": "Defines the `name` attribute of the control.\n<span className=\"banner banner-sm banner-info\">This is a required property, when the control should participate in a native `form`. If not specified, a native `form` will never contain this controls value.</span>\n<span className=\"banner banner-sm banner-info\">This is a required property, when the control is used with type `radio`.</span>"
|
|
327
|
+
"text": "Defines the `name` attribute of the control.\n<span className=\"mb-4 banner banner-sm banner-info\">This is a required property, when the control should participate in a native `form`. If not specified, a native `form` will never contain this controls value.</span>\n<span className=\"banner banner-sm banner-info\">This is a required property, when the control is used with type `radio`.</span>"
|
|
344
328
|
},
|
|
345
329
|
"attribute": "name",
|
|
346
330
|
"reflect": false,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.btn-icon-close{padding:0;border:unset;min-height:unset;min-width:unset;width:var(--post-device-sizing-notification-1);height:var(--post-device-sizing-notification-1);border-radius:var(--post-device-border-radius-round);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}.btn-icon-close>post-icon{min-width:var(--post-device-sizing-interactive-icon-size4);width:var(--post-device-sizing-interactive-icon-size4);height:var(--post-device-sizing-interactive-icon-size4)}.btn-icon-close:not(:disabled):hover,.btn-icon-close.pretend-hover{cursor:pointer;background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-icon-close:not(:disabled):hover,.btn-icon-close.pretend-hover{color:HighlightText !important}}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}
|
|
@@ -4,10 +4,20 @@ import { version } from "../../../../package";
|
|
|
4
4
|
* @slot default - Slot for placing visually hidden label in the close button.
|
|
5
5
|
*/
|
|
6
6
|
export class PostClosebutton {
|
|
7
|
-
host;
|
|
8
7
|
render() {
|
|
9
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: 'cfa55f799fdf9ad0f3ac1eb296e063b5001de997', "data-version": version }, h("button", { key: '7c8a084f6d7278329ddfb5fc4b2b8f992a185666', class: "btn btn-icon-close", type: "button" }, h("post-icon", { key: 'fc74ccb4f0c4c091a02a41cdef918d6c3b065c8c', "aria-hidden": "true", name: "closex" }), h("span", { key: '98478b013714df6d82c6c2f533ac8ecd2abae778', class: "visually-hidden" }, h("slot", { key: '109e2bca4436986dd037d8c29088cc79395bc200' })))));
|
|
10
9
|
}
|
|
11
10
|
static get is() { return "post-closebutton"; }
|
|
11
|
+
static get encapsulation() { return "shadow"; }
|
|
12
|
+
static get originalStyleUrls() {
|
|
13
|
+
return {
|
|
14
|
+
"$": ["post-closebutton.scss"]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
static get styleUrls() {
|
|
18
|
+
return {
|
|
19
|
+
"$": ["post-closebutton.css"]
|
|
20
|
+
};
|
|
21
|
+
}
|
|
12
22
|
static get elementRef() { return "host"; }
|
|
13
23
|
}
|
|
@@ -7,21 +7,14 @@ import { checkEmptyOrType, isMotionReduced } from "../../utils/index";
|
|
|
7
7
|
*/
|
|
8
8
|
export class PostCollapsible {
|
|
9
9
|
constructor() {
|
|
10
|
+
this.isLoaded = false;
|
|
11
|
+
this.isOpen = true;
|
|
10
12
|
this.collapsed = false;
|
|
11
13
|
}
|
|
12
|
-
isLoaded = false;
|
|
13
|
-
isOpen = true;
|
|
14
|
-
host;
|
|
15
14
|
collapsedChange() {
|
|
16
15
|
checkEmptyOrType(this, 'collapsed', 'boolean');
|
|
17
16
|
void this.toggle(!this.collapsed);
|
|
18
17
|
}
|
|
19
|
-
/**
|
|
20
|
-
* An event emitted when the collapse element is shown or hidden, before the transition.
|
|
21
|
-
*
|
|
22
|
-
* The event payload is a boolean: `true` if the collapsible was opened, `false` if it was closed.
|
|
23
|
-
*/
|
|
24
|
-
postToggle;
|
|
25
18
|
componentDidLoad() {
|
|
26
19
|
this.collapsedChange();
|
|
27
20
|
this.isLoaded = true;
|
|
@@ -46,6 +39,7 @@ export class PostCollapsible {
|
|
|
46
39
|
const isHostRendered = this.host.offsetParent;
|
|
47
40
|
if (isHostRendered)
|
|
48
41
|
animation.commitStyles();
|
|
42
|
+
this.updateTriggers();
|
|
49
43
|
return open;
|
|
50
44
|
}
|
|
51
45
|
/**
|
|
@@ -56,7 +50,7 @@ export class PostCollapsible {
|
|
|
56
50
|
triggers.forEach(trigger => trigger.update());
|
|
57
51
|
}
|
|
58
52
|
render() {
|
|
59
|
-
return (h(Host, { key: '
|
|
53
|
+
return (h(Host, { key: 'a678bc639dfd7686d8e1bd57ca0f09984a24ab61', "data-version": version, tabindex: this.collapsed ? -1 : undefined }, h("slot", { key: 'e0b88ac152fa09314b4bc01c9abdb11480e2cb4d' })));
|
|
60
54
|
}
|
|
61
55
|
static get is() { return "post-collapsible"; }
|
|
62
56
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,61 +1,54 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
1
2
|
import { version } from "../../../../package";
|
|
2
|
-
import { checkNonEmpty, checkType,
|
|
3
|
+
import { checkNonEmpty, checkType, eventGuard, getRoot } from "../../utils/index";
|
|
3
4
|
export class PostCollapsibleTrigger {
|
|
4
5
|
constructor() {
|
|
6
|
+
this.observer = new MutationObserver(() => this.setTrigger());
|
|
5
7
|
this.for = undefined;
|
|
6
8
|
}
|
|
7
|
-
trigger;
|
|
8
|
-
observer = new MutationObserver(() => this.setTrigger());
|
|
9
|
-
root;
|
|
10
|
-
host;
|
|
11
9
|
/**
|
|
12
10
|
* Set the "aria-controls" and "aria-expanded" attributes on the trigger to match the state of the controlled post-collapsible
|
|
13
11
|
*/
|
|
14
|
-
|
|
12
|
+
validateAriaAttributes() {
|
|
15
13
|
checkNonEmpty(this, 'for');
|
|
16
14
|
checkType(this, 'for', 'string', 'The post-collapsible-trigger "for" prop should be a id.');
|
|
17
|
-
void this.update();
|
|
18
15
|
}
|
|
19
16
|
/**
|
|
20
17
|
* Initiate a mutation observer that updates the trigger whenever necessary
|
|
21
18
|
*/
|
|
22
19
|
connectedCallback() {
|
|
23
|
-
this.observer.observe(this.host, { childList: true, subtree: true });
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Attach a "postToggle" event listener to the root node
|
|
27
|
-
* to update the trigger's "aria-expanded" attribute whenever the controlled post-collapsible is toggled
|
|
28
|
-
*/
|
|
29
|
-
componentWillLoad() {
|
|
30
20
|
this.root = getRoot(this.host);
|
|
31
|
-
this.root.addEventListener('postToggle',
|
|
32
|
-
|
|
33
|
-
return;
|
|
34
|
-
this.trigger.setAttribute('aria-expanded', `${e.detail}`);
|
|
35
|
-
});
|
|
21
|
+
this.root.addEventListener('postToggle', this.handlePostToggle);
|
|
22
|
+
this.observer.observe(this.host, { childList: true, subtree: true });
|
|
36
23
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Add the "data-version" to the host element and set the trigger
|
|
39
|
-
*/
|
|
40
24
|
componentDidLoad() {
|
|
41
|
-
this.host.setAttribute('data-version', version);
|
|
42
25
|
this.setTrigger();
|
|
43
26
|
if (!this.trigger)
|
|
44
27
|
console.warn('The post-collapsible-trigger must contain a button.');
|
|
28
|
+
this.validateAriaAttributes();
|
|
45
29
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Disconnect the mutation observer
|
|
48
|
-
*/
|
|
49
30
|
disconnectedCallback() {
|
|
50
31
|
this.observer.disconnect();
|
|
32
|
+
this.root.removeEventListener('postToggle', this.handlePostToggle);
|
|
51
33
|
}
|
|
52
34
|
/**
|
|
53
35
|
* Update the "aria-controls" and "aria-expanded" attributes on the trigger button
|
|
54
36
|
*/
|
|
55
37
|
async update() {
|
|
56
|
-
this.
|
|
38
|
+
this.updateAriaAttributes();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Private handler for the 'postToggle' event.
|
|
42
|
+
* This updates the trigger's "aria-expanded" attribute based on the event detail.
|
|
43
|
+
*/
|
|
44
|
+
handlePostToggle(e) {
|
|
45
|
+
eventGuard(this.host, e, { targetLocalName: 'post-collapsible' }, () => {
|
|
46
|
+
if (this.trigger) {
|
|
47
|
+
this.trigger.setAttribute('aria-expanded', `${e.detail}`);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
57
50
|
}
|
|
58
|
-
|
|
51
|
+
updateAriaAttributes() {
|
|
59
52
|
if (!this.trigger)
|
|
60
53
|
return;
|
|
61
54
|
// add the provided id to the aria-controls list
|
|
@@ -68,7 +61,7 @@ export class PostCollapsibleTrigger {
|
|
|
68
61
|
const isCollapsed = this.collapsible?.collapsed;
|
|
69
62
|
const newAriaExpanded = isCollapsed !== undefined ? !isCollapsed : undefined;
|
|
70
63
|
this.trigger.setAttribute('aria-expanded', `${newAriaExpanded}`);
|
|
71
|
-
}
|
|
64
|
+
}
|
|
72
65
|
/**
|
|
73
66
|
* Toggle the post-collapsible controlled by the trigger
|
|
74
67
|
*/
|
|
@@ -94,9 +87,13 @@ export class PostCollapsibleTrigger {
|
|
|
94
87
|
return;
|
|
95
88
|
this.trigger = trigger;
|
|
96
89
|
this.trigger.addEventListener('click', () => this.toggleCollapsible());
|
|
97
|
-
this.
|
|
90
|
+
this.updateAriaAttributes();
|
|
91
|
+
}
|
|
92
|
+
render() {
|
|
93
|
+
return (h(Host, { key: 'cd703fe34b8c82afc5956b58724d36b06054bc0b', "data-version": version }, h("slot", { key: '5abe4ba2b8922b941cc8aebbc7039e34e1853855' })));
|
|
98
94
|
}
|
|
99
95
|
static get is() { return "post-collapsible-trigger"; }
|
|
96
|
+
static get encapsulation() { return "shadow"; }
|
|
100
97
|
static get properties() {
|
|
101
98
|
return {
|
|
102
99
|
"for": {
|
|
@@ -114,7 +111,7 @@ export class PostCollapsibleTrigger {
|
|
|
114
111
|
"text": "Link the trigger to a post-collapsible with this id"
|
|
115
112
|
},
|
|
116
113
|
"attribute": "for",
|
|
117
|
-
"reflect":
|
|
114
|
+
"reflect": true
|
|
118
115
|
}
|
|
119
116
|
};
|
|
120
117
|
}
|
|
@@ -143,7 +140,7 @@ export class PostCollapsibleTrigger {
|
|
|
143
140
|
static get watchers() {
|
|
144
141
|
return [{
|
|
145
142
|
"propName": "for",
|
|
146
|
-
"methodName": "
|
|
143
|
+
"methodName": "validateAriaAttributes"
|
|
147
144
|
}];
|
|
148
145
|
}
|
|
149
146
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
|
-
import { breakpoint } from "../../utils/
|
|
3
|
+
import { breakpoint } from "../../utils/index";
|
|
4
4
|
/**
|
|
5
5
|
* @slot grid-{1|2|3|4}-title - Slot for the accordion headers (mobile).
|
|
6
6
|
* @slot grid-{1|2|3|4} - Slot for the accordion bodies (mobile) and the grid cells (tablet, desktop).
|
|
@@ -12,15 +12,17 @@ import { breakpoint } from "../../utils/breakpoints";
|
|
|
12
12
|
*/
|
|
13
13
|
export class PostFooter {
|
|
14
14
|
constructor() {
|
|
15
|
+
this.breakpointChange = (e) => {
|
|
16
|
+
this.isMobile = e.detail === 'mobile';
|
|
17
|
+
};
|
|
15
18
|
this.label = undefined;
|
|
16
19
|
this.isMobile = breakpoint.get('name') === 'mobile';
|
|
17
20
|
}
|
|
18
|
-
host;
|
|
19
21
|
connectedCallback() {
|
|
20
|
-
window.addEventListener('postBreakpoint:name', this.breakpointChange
|
|
22
|
+
window.addEventListener('postBreakpoint:name', this.breakpointChange);
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
window.removeEventListener('postBreakpoint:name', this.breakpointChange);
|
|
24
26
|
}
|
|
25
27
|
renderAccordion() {
|
|
26
28
|
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" })))));
|
|
@@ -29,10 +31,7 @@ export class PostFooter {
|
|
|
29
31
|
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" }))));
|
|
30
32
|
}
|
|
31
33
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
33
|
-
}
|
|
34
|
-
disconnectedCallback() {
|
|
35
|
-
window.removeEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
|
|
34
|
+
return (h(Host, { key: '4058ba0a63a666b82d274d1c35397c97d280ba49', "data-version": version }, h("footer", { key: '27adf1e2a1439fd69efd6e571fcdd6851304c92a' }, h("h2", { key: '1ca0cd955ec5e6d315521eb5c28c5963ed44856d', class: "visually-hidden" }, this.label), h("div", { key: '27a6f520dee9d6294fa3cd4ebc6fd5062ac327ce', class: "footer-container" }, this.isMobile ? this.renderAccordion() : this.renderGrid(), h("div", { key: '5607004d5e3ea553a86d476ca459b3b3632ef12d', class: "footer-column" }, h("div", { key: 'cd4727970358ffad4ca28fffaccc8a5eab4dec27', class: "footer-socialmedia" }, h("slot", { key: '92e105af21b69640a07c2d35c24bff6aae84abb6', name: "socialmedia" })), h("div", { key: '904b787df3f192593408d99857e213143cec6706', class: "footer-app" }, h("slot", { key: '2f4ab14e20737c6035c175e58982464fe6987724', name: "app" }))), h("div", { key: 'c85b261b4ae0cb1e27f424f460fa2838e1174fb0', class: "footer-businesssectors" }, h("slot", { key: 'c66baa3a1b689d881db68448b9d72d47acd11c7c', name: "businesssectors" })), h("div", { key: '4eebc88279f29eef028766c1fcb90effc1aaf1ca', class: "footer-meta" }, h("slot", { key: 'd689d7c14af01dc13c7f9f0fd170f3974150b9aa', name: "meta" })), h("div", { key: '36f87386755a4ae1186109b46609c6ad9c1d5041', class: "footer-copyright" }, h("slot", { key: 'c37231f795b1a5a407f83aeaf8a8b093713b8db1', name: "copyright" }))))));
|
|
36
35
|
}
|
|
37
36
|
static get is() { return "post-footer"; }
|
|
38
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative;--global-header-top: calc( (var(--global-header-height) - var(--global-header-reduced-height)) * -1 );--local-header-top: calc( -1 * (var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height) );--logo-height: calc(var(--global-header-height) - var(--header-scroll-top));--global-controls-top: calc(min((var(--header-scroll-top) / 4), 20px) * -1)}:host:has(.global-sub>*:not(.logo):focus-within),:host:has(.local-sub:focus-within){--global-header-top: 0;--local-header-top: var(--global-header-height);--logo-height: var(--global-header-height);--global-controls-top: 0}: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:var(--global-header-top);transition:inset-block-start .2s ease-in-out}}.global-sub{display:flex;align-items:center;gap:24px}@media screen and (min-width: 1024px){.global-sub:not(:has(.logo)){position:relative;transition:inset-block-start .2s ease-in-out;inset-block-start:var(--global-controls-top)}}.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{transition:height .2 ease-in-out;height:var(--logo-height)}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-inline-start: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}.local-header::after{content:"";position:absolute;width:100%;height:1px;background-color:#e1e0dc;inset-block-end:-1px;z-index:1}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.local-header::after{background-color:Highlight}}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:var(--local-header-top);padding-block-start:18px;box-shadow:var(--post-device-elevation-300);transition:box-shadow .2s ease-in-out,inset-block-start .2s ease-in-out}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:
|
|
1
|
+
*,::before,::after{box-sizing:border-box}:host{z-index:1020;position:relative;--global-header-top: calc( (var(--post-global-header-height) - var(--post-global-header-reduced-height)) * -1 );--local-header-top: calc( -1 * (var(--post-local-header-height) - var(--post-main-navigation-height)) + var(--post-global-header-reduced-height) );--logo-height: calc(var(--post-global-header-height) - var(--post-header-scroll-top, 0px));--global-controls-top: calc(min((var(--post-header-scroll-top) / 4), 20px) * -1)}:host:has(.global-sub>*:not(.logo):focus-within),:host:has(.local-sub:focus-within){--global-header-top: 0;--local-header-top: var(--post-global-header-height);--logo-height: var(--post-global-header-height);--global-controls-top: 0}: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(--post-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:var(--global-header-top);transition:inset-block-start .2s ease-in-out}}.global-sub{display:flex;align-items:center;gap:24px}@media screen and (min-width: 1024px){.global-sub:not(:has(.logo)){position:relative;transition:inset-block-start .2s ease-in-out;inset-block-start:var(--global-controls-top)}}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--post-global-header-height);width:var(--post-global-header-height);min-height:var(--post-global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{transition:height .2 ease-in-out;height:var(--logo-height)}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-inline-start: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(--post-local-header-min-height);background:#fff;transition:box-shadow .2s ease-in-out}.local-header::after{content:"";position:absolute;width:100%;height:1px;background-color:#e1e0dc;inset-block-end:-1px;z-index:1}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.local-header::after{background-color:Highlight}}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:var(--local-header-top);padding-block-start:18px;box-shadow:var(--post-device-elevation-300);transition:box-shadow .2s ease-in-out,inset-block-start .2s ease-in-out}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--post-global-header-height);padding-block:8px;flex-wrap:wrap;gap:12px}.local-header.local-header-mobile-extended::after{inset-block-end:0}.local-header:not(.local-header-mobile-extended){box-shadow:var(--post-device-elevation-300)}}.local-sub{margin-inline-end:8px}@media screen and (max-width: 1023.98px){.local-sub{margin-inline-end:4px}}::slotted(.list-inline){margin:0 !important;z-index:3 !important;position:relative !important}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--post-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:sticky;z-index:1;inset-inline:0;inset-block-start:var(--post-header-height)}.mobile-menu{background-color:#fafafa}::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>div{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;height:calc(min(var(--header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height))}.navigation.extended.megadropdown-open>div{overflow-y:hidden}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){gap:32px}.navigation-footer{background-color:#f0efed;gap:24px}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:16px}}
|