@swisspost/design-system-components 9.0.0-next.12 → 9.0.0-next.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.config/bindings.angular.js +4 -0
- package/dist/cjs/{attribute-observer-10f08c04.js → attribute-observer-6d8b886b.js} +4 -4
- package/dist/cjs/{check-one-of-f4f5d0c0.js → check-one-of-ef931478.js} +2 -1
- package/dist/cjs/{check-type-64af82a9.js → check-type-696d2c51.js} +4 -4
- package/dist/cjs/{check-url-3ffdd2fb.js → check-url-1cf6fb0d.js} +2 -1
- package/dist/cjs/{debounce-1151afe3.js → debounce-158fd76f.js} +2 -1
- package/dist/cjs/fade-72d5ef55.js +14 -0
- package/dist/cjs/{index-f1b08cdb.js → index-0ee3ab4a.js} +334 -152
- package/dist/cjs/{index-5d4e0aed.js → index-bea4ac42.js} +7 -5
- package/dist/cjs/index.cjs.js +30 -28
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-0bd6fb0d.js → package-7d11b6ea.js} +1 -1
- package/dist/cjs/{post-accordion-7aadd881.js → post-accordion-29861d97.js} +15 -8
- package/dist/cjs/{post-accordion-item-bd033c7f.js → post-accordion-item-0da0f7aa.js} +20 -13
- package/dist/cjs/post-accordion-item.cjs.entry.js +7 -7
- package/dist/cjs/post-accordion.cjs.entry.js +4 -4
- package/dist/cjs/{post-avatar-5dbdf70d.js → post-avatar-01b9cd6d.js} +29 -21
- package/dist/cjs/post-avatar.cjs.entry.js +3 -3
- package/dist/cjs/post-back-to-top-9a5647f7.js +80 -0
- package/dist/cjs/post-back-to-top.cjs.entry.js +5 -5
- package/dist/cjs/post-banner-33929088.js +110 -0
- package/dist/cjs/post-banner.cjs.entry.js +8 -8
- package/dist/cjs/{post-breadcrumb-531c4f79.js → post-breadcrumb-1384018e.js} +41 -34
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +7 -7
- package/dist/cjs/post-breadcrumb.cjs.entry.js +5 -5
- package/dist/cjs/post-card-control-4c85eda3.js +314 -0
- package/dist/cjs/post-card-control.cjs.entry.js +4 -4
- package/dist/cjs/post-closebutton_15.cjs.entry.js +8 -8
- package/dist/cjs/{post-collapsible-trigger-02924200.js → post-collapsible-trigger-0fb2596a.js} +47 -35
- package/dist/cjs/post-collapsible_2.cjs.entry.js +8 -8
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/{post-footer-96d7bd47.js → post-footer-f621a563.js} +18 -12
- package/dist/cjs/post-footer.cjs.entry.js +3 -3
- package/dist/cjs/post-linkarea-865079c1.js +32 -0
- package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
- package/dist/cjs/{post-menu-item-3f73fb4d.js → post-menu-item-ab3e2e7e.js} +12 -9
- package/dist/cjs/{post-popover-64195ffd.js → post-popover-a2ba9226.js} +24 -10
- package/dist/cjs/post-popover.cjs.entry.js +4 -4
- package/dist/cjs/{post-rating-bd27ebfc.js → post-rating-c402c294.js} +33 -10
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-c819517d.js +36 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-3eedcd19.js → post-tab-panel-3cb207f3.js} +9 -6
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-ea94b243.js → post-tabs-b6fa39c3.js} +29 -18
- package/dist/cjs/post-tabs.cjs.entry.js +4 -4
- package/dist/cjs/{post-tag-1d75024b.js → post-tag-9c366519.js} +20 -9
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-876f7892.js → post-togglebutton-d49bec2c.js} +682 -221
- package/dist/cjs/{post-tooltip-e4ef3c7e.js → post-tooltip-425c01ba.js} +24 -12
- package/dist/cjs/post-tooltip.cjs.entry.js +8 -8
- package/dist/cjs/{slide-5d51abe8.js → slide-8ae17ee4.js} +4 -4
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/fade.js +6 -2
- package/dist/collection/animations/slide.js +4 -4
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/post-accordion/post-accordion.js +16 -6
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +21 -11
- package/dist/collection/components/post-avatar/post-avatar.js +35 -20
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +14 -8
- package/dist/collection/components/post-banner/post-banner.css +1 -1
- package/dist/collection/components/post-banner/post-banner.js +40 -14
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +41 -31
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +10 -6
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +104 -43
- package/dist/collection/components/post-closebutton/post-closebutton.js +2 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +16 -6
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +25 -21
- package/dist/collection/components/post-footer/post-footer.js +9 -5
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +90 -15
- package/dist/collection/components/post-icon/post-icon.js +93 -23
- package/dist/collection/components/post-language-option/post-language-option.js +37 -8
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +24 -7
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.js +32 -0
- package/dist/collection/components/post-list/post-list.js +19 -6
- package/dist/collection/components/post-list-item/post-list-item.js +2 -1
- package/dist/collection/components/post-logo/post-logo.js +8 -4
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +197 -17
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +134 -64
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +18 -11
- package/dist/collection/components/post-menu/post-menu.js +56 -33
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +24 -16
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +26 -5
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +55 -8
- package/dist/collection/components/post-rating/post-rating.js +39 -7
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +9 -5
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +9 -5
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +25 -18
- package/dist/collection/components/post-tag/post-tag.css +1 -1
- package/dist/collection/components/post-tag/post-tag.js +23 -5
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +18 -14
- package/dist/collection/components/post-tooltip/post-tooltip.js +26 -9
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/attribute-observer.js +4 -4
- package/dist/collection/utils/breakpoints.js +9 -6
- package/dist/collection/utils/component-on-ready.js +4 -4
- package/dist/collection/utils/debounce.js +2 -1
- package/dist/collection/utils/get-focusable-children.js +2 -2
- package/dist/collection/utils/property-checkers/check-one-of.js +2 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +2 -1
- package/dist/collection/utils/property-checkers/check-type.js +4 -4
- package/dist/collection/utils/property-checkers/check-url.js +2 -1
- package/dist/collection/utils/property-checkers/empty-or.js +2 -1
- package/dist/collection/utils/sass-export.js +8 -5
- package/dist/components/index.js +36 -35
- package/dist/components/{post-collapsible-trigger2.js → p-05590ac0.js} +30 -27
- package/dist/components/{post-breadcrumb2.js → p-146677d1.js} +50 -43
- package/dist/components/p-1ee1742f.js +237 -0
- package/dist/components/p-2083ae2c.js +3 -0
- package/dist/components/{post-megadropdown-trigger2.js → p-27edc023.js} +21 -15
- package/dist/components/{post-tooltip2.js → p-2d9b46b4.js} +26 -14
- package/dist/components/p-38778a14.js +345 -0
- package/dist/components/p-3aba7629.js +29 -0
- package/dist/components/{post-togglebutton2.js → p-3cee636a.js} +20 -17
- package/dist/components/p-3e8554e7.js +1646 -0
- package/dist/components/p-424d5ea9.js +199 -0
- package/dist/components/p-46a6c5ec.js +168 -0
- package/dist/components/p-4965cfe1.js +145 -0
- package/{loaders/slide.js → dist/components/p-4af6dbed.js} +4 -4
- package/dist/components/{post-list2.js → p-536eba02.js} +19 -9
- package/dist/components/p-5653923a.js +44 -0
- package/dist/components/{post-footer2.js → p-58878996.js} +23 -17
- package/dist/components/{post-logo2.js → p-5f51ec58.js} +10 -7
- package/{loaders/post-popovercontainer2.js → dist/components/p-60cf53cc.js} +34 -11
- package/dist/components/p-64e3de38.js +11 -0
- package/dist/components/{post-accordion-item2.js → p-68ecd276.js} +26 -19
- package/dist/components/p-75b8b652.js +54 -0
- package/dist/components/{post-tab-panel2.js → p-78e1d893.js} +11 -8
- package/dist/components/{check-type.js → p-8562c7dc.js} +4 -4
- package/{loaders/post-menu-trigger2.js → dist/components/p-8b053fd5.js} +27 -20
- package/dist/components/{post-icon2.js → p-91031e3b.js} +85 -28
- package/dist/components/{post-menu2.js → p-91882483.js} +60 -65
- package/dist/{esm/attribute-observer-37fa950a.js → components/p-9748a355.js} +4 -4
- package/dist/components/{post-list-item2.js → p-9e4b1f10.js} +4 -4
- package/dist/components/{post-accordion2.js → p-a3a004e6.js} +17 -10
- package/dist/components/{post-popover2.js → p-af23f7de.js} +26 -12
- package/dist/components/{post-collapsible2.js → p-b018d864.js} +23 -14
- package/dist/components/{check-non-empty.js → p-b095519d.js} +1 -1
- package/dist/components/{check-one-of.js → p-bacd3e2c.js} +2 -1
- package/dist/components/{post-closebutton2.js → p-bf14d264.js} +6 -6
- package/dist/components/{post-breadcrumb-item2.js → p-c7c1d466.js} +13 -10
- package/dist/components/{post-tag2.js → p-cab43cee.js} +22 -11
- package/dist/components/{post-menu-item2.js → p-ccccf0c3.js} +4 -4
- package/dist/components/{post-tabs2.js → p-ce854a7d.js} +30 -19
- package/dist/components/{post-avatar2.js → p-d3fb70af.js} +31 -23
- package/dist/components/{post-language-option2.js → p-d47bb5bf.js} +32 -12
- package/dist/components/{debounce.js → p-e1baac59.js} +2 -1
- package/dist/components/{post-back-to-top2.js → p-e20366a6.js} +20 -15
- package/dist/components/{index2.js → p-eabb09ad.js} +9 -6
- package/dist/components/{post-language-switch2.js → p-f6d80d76.js} +29 -17
- package/dist/components/p-f7b9f90a.js +135 -0
- package/dist/components/{post-rating2.js → p-fc59de7c.js} +35 -12
- package/dist/components/post-accordion-item.js +1 -1
- package/dist/components/post-accordion.js +1 -1
- package/dist/components/post-avatar.js +1 -1
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +1 -1
- package/dist/components/post-breadcrumb-item.js +1 -1
- package/dist/components/post-breadcrumb.js +1 -1
- package/dist/components/post-card-control.js +1 -1
- package/dist/components/post-closebutton.js +1 -1
- package/dist/components/post-collapsible-trigger.js +1 -1
- package/dist/components/post-collapsible.js +1 -1
- package/dist/components/post-footer.js +1 -1
- package/dist/components/post-header.js +1 -1
- package/dist/components/post-icon.js +1 -1
- package/dist/components/post-language-option.js +1 -1
- package/dist/components/post-language-switch.js +1 -1
- package/dist/components/post-linkarea.d.ts +11 -0
- package/dist/components/post-linkarea.js +6 -0
- package/dist/components/post-list-item.js +1 -1
- package/dist/components/post-list.js +1 -1
- package/dist/components/post-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-item.js +1 -1
- package/dist/components/post-menu-trigger.js +1 -1
- package/dist/components/post-menu.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-tab-header.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-tag.js +1 -1
- package/dist/components/post-togglebutton.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/docs.d.ts +8 -0
- package/dist/docs.json +335 -156
- package/{loaders/attribute-observer.js → dist/esm/attribute-observer-2f203993.js} +4 -4
- package/{loaders/check-one-of.js → dist/esm/check-one-of-0d5858c0.js} +2 -1
- package/dist/esm/{check-type-8828dbe4.js → check-type-a6ccc9a3.js} +4 -4
- package/dist/esm/{check-url-a974431e.js → check-url-0bd876f7.js} +2 -1
- package/dist/esm/{debounce-abe98cc2.js → debounce-e54c7131.js} +2 -1
- package/dist/esm/fade-1f3cacf4.js +11 -0
- package/dist/esm/{index-6bfe6554.js → index-2c232bf2.js} +334 -152
- package/dist/esm/{index-b49c9904.js → index-d1bbbd88.js} +7 -5
- package/dist/esm/index.js +29 -28
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-8c98af5e.js +3 -0
- package/dist/esm/{post-accordion-ca48eb18.js → post-accordion-49fba403.js} +15 -8
- package/dist/esm/{post-accordion-item-a461f2a7.js → post-accordion-item-c516517a.js} +20 -13
- package/dist/esm/post-accordion-item.entry.js +7 -7
- package/dist/esm/post-accordion.entry.js +4 -4
- package/dist/esm/{post-avatar-0da1a2e8.js → post-avatar-b527ac63.js} +29 -21
- package/dist/esm/post-avatar.entry.js +3 -3
- package/dist/esm/post-back-to-top-f514c1f0.js +78 -0
- package/dist/esm/post-back-to-top.entry.js +5 -5
- package/dist/esm/post-banner-0ad7758b.js +108 -0
- package/dist/esm/post-banner.entry.js +8 -8
- package/dist/esm/{post-breadcrumb-85ffd02f.js → post-breadcrumb-57bca9dd.js} +41 -34
- package/dist/esm/post-breadcrumb-item_2.entry.js +7 -7
- package/dist/esm/post-breadcrumb.entry.js +5 -5
- package/dist/esm/post-card-control-ea741f60.js +312 -0
- package/dist/esm/post-card-control.entry.js +4 -4
- package/dist/esm/post-closebutton_15.entry.js +8 -8
- package/dist/esm/{post-collapsible-trigger-883db3bf.js → post-collapsible-trigger-31155750.js} +47 -35
- package/dist/esm/post-collapsible_2.entry.js +8 -8
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/{post-footer-7b0eb067.js → post-footer-cdde2086.js} +18 -12
- package/dist/esm/post-footer.entry.js +3 -3
- package/dist/esm/post-linkarea-cad95623.js +30 -0
- package/dist/esm/post-linkarea.entry.js +3 -0
- package/dist/esm/{post-menu-item-37f637a3.js → post-menu-item-db732728.js} +12 -9
- package/dist/esm/{post-popover-c24ecd38.js → post-popover-00f427ac.js} +24 -10
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/{post-rating-e1c66e5c.js → post-rating-cdcb2a1d.js} +33 -10
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-1d4113cb.js +34 -0
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-73b56a16.js → post-tab-panel-7a5c03ef.js} +9 -6
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-02e523b8.js → post-tabs-308190c0.js} +29 -18
- package/dist/esm/post-tabs.entry.js +4 -4
- package/dist/esm/{post-tag-43aba068.js → post-tag-aebbda10.js} +20 -9
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-c2231709.js → post-togglebutton-95ba85d2.js} +682 -221
- package/dist/esm/{post-tooltip-8271950c.js → post-tooltip-918d3a54.js} +24 -12
- package/dist/esm/post-tooltip.entry.js +8 -8
- package/dist/{components/slide.js → esm/slide-62768431.js} +4 -4
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-037d6ef2.entry.js +1 -0
- package/dist/post-components/p-1e69a72f.js +1 -0
- package/dist/post-components/p-1fda117c.js +1 -0
- package/dist/post-components/p-2083ae2c.js +1 -0
- package/dist/post-components/p-24297444.js +1 -0
- package/dist/post-components/{p-e2f886ab.js → p-267f52a9.js} +3 -3
- package/dist/post-components/p-2e6c5b60.js +1 -0
- package/dist/post-components/p-3591d4e3.entry.js +1 -0
- package/dist/post-components/p-3dec4425.entry.js +1 -0
- package/dist/post-components/p-423aecd4.js +1 -0
- package/dist/post-components/p-43221de8.entry.js +1 -0
- package/dist/post-components/p-48fd00e7.entry.js +1 -0
- package/dist/post-components/p-4af6dbed.js +1 -0
- package/dist/post-components/p-4ca79b52.js +1 -0
- package/dist/post-components/p-4d2dee9f.entry.js +1 -0
- package/dist/post-components/p-4fedef65.js +1 -0
- package/dist/post-components/p-59109b3b.entry.js +1 -0
- package/dist/post-components/p-64e3de38.js +1 -0
- package/dist/post-components/p-675352c3.entry.js +1 -0
- package/dist/post-components/p-6e4527d9.entry.js +1 -0
- package/dist/post-components/p-726bfda2.js +1 -0
- package/dist/post-components/p-767c0bf3.js +1 -0
- package/dist/post-components/p-796968bd.entry.js +1 -0
- package/dist/post-components/p-7c9758fa.js +1 -0
- package/dist/post-components/p-8a452260.js +1 -0
- package/dist/post-components/p-8a50b900.js +1 -0
- package/dist/post-components/p-8de4f677.entry.js +1 -0
- package/dist/post-components/p-93632808.js +1 -0
- package/dist/post-components/p-9748a355.js +1 -0
- package/dist/post-components/p-9aca3d07.entry.js +1 -0
- package/dist/post-components/p-9f0c5164.js +1 -0
- package/dist/post-components/p-a6436e7f.js +1 -0
- package/dist/post-components/p-ad246c0d.js +1 -0
- package/dist/post-components/p-b015efcb.entry.js +1 -0
- package/dist/post-components/p-b0afc087.entry.js +1 -0
- package/dist/post-components/p-b1adc221.js +1 -0
- package/dist/post-components/p-b2c0d21a.js +1 -0
- package/dist/post-components/p-b5a566f1.js +1 -0
- package/dist/post-components/p-c0961047.entry.js +1 -0
- package/dist/post-components/p-c388b7bb.entry.js +1 -0
- package/dist/post-components/{p-c510d968.entry.js → p-ca41b899.entry.js} +1 -1
- package/dist/post-components/p-d2395ae9.entry.js +1 -0
- package/dist/post-components/p-d9833667.js +2 -0
- package/dist/post-components/p-da261c46.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/animations/collapse.d.ts +2 -2
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/slide.d.ts +2 -2
- package/dist/types/components/post-header/post-header.d.ts +11 -2
- package/dist/types/components/post-icon/post-icon.d.ts +1 -1
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +1 -1
- package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +57 -3
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +26 -12
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +4 -0
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components.d.ts +51 -25
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/dist/types/utils/attribute-observer.d.ts +1 -1
- package/dist/types/utils/component-on-ready.d.ts +1 -1
- package/dist/types/utils/get-focusable-children.d.ts +1 -1
- package/dist/types/utils/sass-export.d.ts +5 -1
- package/loaders/index.d.ts +2 -0
- package/loaders/index.js +3 -2
- package/loaders/{post-collapsible-trigger2.js → p-05590ac0.js} +30 -27
- package/loaders/{post-breadcrumb-item2.js → p-1beacb73.js} +13 -10
- package/loaders/p-2083ae2c.js +3 -0
- package/loaders/p-3aba7629.js +29 -0
- package/loaders/p-3e8554e7.js +1646 -0
- package/{dist/esm/slide-3422b8a3.js → loaders/p-4af6dbed.js} +4 -4
- package/loaders/{index2.js → p-56ad4838.js} +9 -6
- package/{dist/components/post-popovercontainer2.js → loaders/p-60cf53cc.js} +34 -11
- package/loaders/p-64e3de38.js +11 -0
- package/loaders/{post-accordion-item2.js → p-83baa315.js} +26 -19
- package/loaders/{check-type.js → p-8562c7dc.js} +4 -4
- package/{dist/components/post-menu-trigger2.js → loaders/p-8b053fd5.js} +27 -20
- package/loaders/{post-menu2.js → p-91882483.js} +60 -65
- package/{dist/components/attribute-observer.js → loaders/p-9748a355.js} +4 -4
- package/loaders/{post-collapsible2.js → p-9fac5d7d.js} +23 -14
- package/loaders/{check-non-empty.js → p-b095519d.js} +1 -1
- package/{dist/esm/check-one-of-6b3ef8eb.js → loaders/p-bacd3e2c.js} +2 -1
- package/loaders/{post-menu-item2.js → p-ccccf0c3.js} +4 -4
- package/loaders/{debounce.js → p-e1baac59.js} +2 -1
- package/loaders/{post-icon2.js → p-f7177e26.js} +85 -28
- package/loaders/p-f7b9f90a.js +135 -0
- package/loaders/post-accordion-item.js +1 -1
- package/loaders/post-accordion.js +17 -10
- package/loaders/post-avatar.js +31 -23
- package/loaders/post-back-to-top.js +20 -15
- package/loaders/post-banner.js +42 -23
- package/loaders/post-breadcrumb-item.js +1 -1
- package/loaders/post-breadcrumb.js +50 -43
- package/loaders/post-card-control.js +93 -51
- package/loaders/post-closebutton.js +6 -6
- package/loaders/post-collapsible-trigger.js +1 -1
- package/loaders/post-collapsible.js +1 -1
- package/loaders/post-footer.js +23 -17
- package/loaders/post-header.js +74 -154
- package/loaders/post-icon.js +1 -1
- package/loaders/post-language-option.js +32 -12
- package/loaders/post-language-switch.js +29 -17
- package/loaders/post-linkarea.d.ts +11 -0
- package/loaders/post-linkarea.js +47 -0
- package/loaders/post-list-item.js +4 -4
- package/loaders/post-list.js +19 -9
- package/loaders/post-logo.js +10 -7
- package/loaders/post-mainnavigation.js +197 -8
- package/loaders/post-megadropdown-trigger.js +21 -15
- package/loaders/post-megadropdown.js +119 -51
- package/loaders/post-menu-item.js +1 -1
- package/loaders/post-menu-trigger.js +1 -1
- package/loaders/post-menu.js +1 -1
- package/loaders/post-popover.js +26 -12
- package/loaders/post-popovercontainer.js +1 -1
- package/loaders/post-rating.js +35 -12
- package/loaders/post-tab-header.js +13 -10
- package/loaders/post-tab-panel.js +11 -8
- package/loaders/post-tabs.js +30 -19
- package/loaders/post-tag.js +22 -11
- package/loaders/post-togglebutton.js +20 -17
- package/loaders/post-tooltip.js +26 -14
- package/package.json +19 -16
- package/dist/cjs/fade-35a3633a.js +0 -10
- package/dist/cjs/post-back-to-top-71bc912c.js +0 -75
- package/dist/cjs/post-banner-d4e0c73c.js +0 -91
- package/dist/cjs/post-card-control-332f6f1f.js +0 -272
- package/dist/cjs/post-tab-header-1f057694.js +0 -33
- package/dist/components/fade.js +0 -7
- package/dist/components/package.js +0 -3
- package/dist/components/post-banner2.js +0 -126
- package/dist/components/post-card-control2.js +0 -303
- package/dist/components/post-header2.js +0 -279
- package/dist/components/post-mainnavigation2.js +0 -48
- package/dist/components/post-megadropdown2.js +0 -100
- package/dist/components/post-tab-header2.js +0 -51
- package/dist/esm/fade-7fd71785.js +0 -7
- package/dist/esm/package-f8f7bb40.js +0 -3
- package/dist/esm/post-back-to-top-77471a90.js +0 -73
- package/dist/esm/post-banner-b0af5bd3.js +0 -89
- package/dist/esm/post-card-control-3225eb57.js +0 -270
- package/dist/esm/post-tab-header-6a9b0153.js +0 -31
- package/dist/post-components/p-025688e5.js +0 -1
- package/dist/post-components/p-08b51b35.entry.js +0 -1
- package/dist/post-components/p-0e216cc4.js +0 -2
- package/dist/post-components/p-24c92608.js +0 -1
- package/dist/post-components/p-25a57971.js +0 -1
- package/dist/post-components/p-2737eaf5.js +0 -1
- package/dist/post-components/p-2cb4a8f1.js +0 -1
- package/dist/post-components/p-33b64e0c.js +0 -1
- package/dist/post-components/p-34d70cd5.js +0 -1
- package/dist/post-components/p-350f3900.entry.js +0 -1
- package/dist/post-components/p-35bc4554.js +0 -1
- package/dist/post-components/p-38b259a4.entry.js +0 -1
- package/dist/post-components/p-3c6cef1e.entry.js +0 -1
- package/dist/post-components/p-4a713cf8.js +0 -1
- package/dist/post-components/p-4b5e2b24.js +0 -1
- package/dist/post-components/p-515e0f96.js +0 -1
- package/dist/post-components/p-5467b223.js +0 -1
- package/dist/post-components/p-54e58fc2.entry.js +0 -1
- package/dist/post-components/p-637759d6.js +0 -1
- package/dist/post-components/p-6adeaa6c.js +0 -1
- package/dist/post-components/p-7589a19f.js +0 -1
- package/dist/post-components/p-7cce7342.entry.js +0 -1
- package/dist/post-components/p-819e19de.js +0 -1
- package/dist/post-components/p-82d48128.js +0 -1
- package/dist/post-components/p-85171893.entry.js +0 -1
- package/dist/post-components/p-882fdd0c.entry.js +0 -1
- package/dist/post-components/p-94399c69.js +0 -1
- package/dist/post-components/p-9a02b162.entry.js +0 -1
- package/dist/post-components/p-b1f5bc26.js +0 -1
- package/dist/post-components/p-b2f239a1.entry.js +0 -1
- package/dist/post-components/p-b571e5c8.js +0 -1
- package/dist/post-components/p-ba530822.js +0 -1
- package/dist/post-components/p-bae1c85f.entry.js +0 -1
- package/dist/post-components/p-bdabdec5.js +0 -1
- package/dist/post-components/p-c1225174.entry.js +0 -1
- package/dist/post-components/p-c372a141.entry.js +0 -1
- package/dist/post-components/p-c87c5d59.entry.js +0 -1
- package/dist/post-components/p-d04c1b7f.entry.js +0 -1
- package/dist/post-components/p-da300843.entry.js +0 -1
- package/dist/post-components/p-fec04a15.entry.js +0 -1
- package/loaders/fade.js +0 -7
- package/loaders/package.js +0 -3
- /package/dist/components/{heading-levels.js → p-247a1668.js} +0 -0
- /package/dist/components/{constants.js → p-440193f4.js} +0 -0
- /package/dist/components/{index.browser.js → p-5959f2bd.js} +0 -0
- /package/dist/components/{get-root.js → p-fc91cbc2.js} +0 -0
- /package/dist/post-components/{p-4a3f67ab.js → p-8562c7dc.js} +0 -0
- /package/dist/post-components/{p-611b3c41.js → p-bacd3e2c.js} +0 -0
- /package/dist/post-components/{p-b22656b1.js → p-cb9ab938.js} +0 -0
- /package/dist/post-components/{p-d4f93f2b.js → p-e1baac59.js} +0 -0
- /package/loaders/{heading-levels.js → p-247a1668.js} +0 -0
- /package/loaders/{constants.js → p-440193f4.js} +0 -0
- /package/loaders/{index.browser.js → p-5959f2bd.js} +0 -0
- /package/loaders/{get-root.js → p-fc91cbc2.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const _package = require('./package-
|
|
5
|
-
const slide = require('./slide-
|
|
6
|
-
const index$1 = require('./index-
|
|
3
|
+
const index = require('./index-0ee3ab4a.js');
|
|
4
|
+
const _package = require('./package-7d11b6ea.js');
|
|
5
|
+
const slide = require('./slide-8ae17ee4.js');
|
|
6
|
+
const index$1 = require('./index-bea4ac42.js');
|
|
7
7
|
const checkNonEmpty = require('./check-non-empty-eeaa8f77.js');
|
|
8
|
-
const checkType = require('./check-type-
|
|
8
|
+
const checkType = require('./check-type-696d2c51.js');
|
|
9
9
|
const index_browser = require('./index.browser-2f65f583.js');
|
|
10
10
|
const getRoot = require('./get-root-7a3498ef.js');
|
|
11
11
|
|
|
@@ -13,10 +13,10 @@ const PostClosebutton = class {
|
|
|
13
13
|
constructor(hostRef) {
|
|
14
14
|
index.registerInstance(this, hostRef);
|
|
15
15
|
}
|
|
16
|
+
get host() { return index.getElement(this); }
|
|
16
17
|
render() {
|
|
17
|
-
return (index.h(index.Host, { key: '
|
|
18
|
+
return (index.h(index.Host, { key: 'c03f50379252ba13992bc3d021989ac07dba9f79', "data-version": _package.version }, index.h("button", { key: 'e97a86bb6e1eace89a1a3a78fb231047f065dd5e', class: "btn btn-icon-close", type: "button" }, index.h("post-icon", { key: 'aca522d4c251a8183c91c2bd4d810d0716a2fe13', "aria-hidden": "true", name: "closex" }), index.h("span", { key: '6873522961b1683d1261163b07ee022f93eed836', class: "visually-hidden" }, index.h("slot", { key: 'bf4b13356c9a0164f1481d1fedc3a78a53e5f8e0' })))));
|
|
18
19
|
}
|
|
19
|
-
get host() { return index.getElement(this); }
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
|
|
@@ -153,28 +153,77 @@ function throttle (delay, callback, options) {
|
|
|
153
153
|
return wrapper;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
const
|
|
156
|
+
const focusableSelector = `:where(${[
|
|
157
|
+
'button',
|
|
158
|
+
'input:not([type="hidden"])',
|
|
159
|
+
'[tabindex]',
|
|
160
|
+
'select',
|
|
161
|
+
'textarea',
|
|
162
|
+
'[contenteditable]',
|
|
163
|
+
'a[href]',
|
|
164
|
+
'iframe',
|
|
165
|
+
'audio[controls]',
|
|
166
|
+
'video[controls]',
|
|
167
|
+
'area[href]',
|
|
168
|
+
'details > summary:first-of-type',
|
|
169
|
+
].join(',')})`;
|
|
170
|
+
const focusDisablingSelector = `:where(${[
|
|
171
|
+
'[inert]',
|
|
172
|
+
'[inert] *',
|
|
173
|
+
':disabled',
|
|
174
|
+
'dialog:not([open]) *',
|
|
175
|
+
'[popover]:not(:popover-open) *',
|
|
176
|
+
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
177
|
+
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
178
|
+
'[tabindex^="-"]',
|
|
179
|
+
].join(',')})`;
|
|
180
|
+
function getFocusableChildren(element) {
|
|
181
|
+
return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1090;--global-header-height:72px;--global-header-minimal-height:24px;--local-header-height:112px;--local-header-min-height:56px;--header-height:calc(var(--global-header-height) + var(--local-header-height));z-index:1020;position:relative}@media screen and (min-width: 1024px){:host{--global-header-reduced-height:24px;--main-navigation-height:56px}}@media screen and (max-width: 1023.98px){:host{--global-header-height:64px;--local-header-height:48px;--local-header-min-height:48px;--main-navigation-height:0px}}:host(:not(:has([slot=title]))){--local-header-height:var(--main-navigation-height)}: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;align-items:center;position:sticky;padding-inline:var(--post-core-dimension-4);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:var(--post-core-dimension-12);inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}slot[name=post-logo]{align-self:flex-end}.global-sub{display:flex;align-items:center;gap:var(--post-core-dimension-24)}.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:var(--post-core-dimension-8);min-height:var(--local-header-min-height);background:var(--post-core-color-brand-white);transition:box-shadow .2s ease-in-out}@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:var(--post-core-dimension-18);box-shadow:var(--post-core-elevation-3)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:var(--post-core-dimension-9);flex-wrap:wrap}.local-header.local-header-mobile-extended{border-bottom:1px solid var(--post-core-color-sandgrey-012)}.local-header:not(.title-header-mobile-extended){box-shadow:var(--post-core-elevation-3)}}.local-sub{margin-inline-end:var(--post-core-dimension-16)}::slotted(.list-inline){margin:-8px 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:var(--post-core-dimension-12) !important}}@media screen and (max-width: 599.98px){::slotted(h1){margin-inline-start:var(--post-core-dimension-8) !important}}@media screen and (min-width: 1024px){::slotted(h1){font-size:var(--post-core-font-size-28) !important}}@media screen and (max-width: 1023.98px){::slotted(h1){font-size:var(--post-core-font-size-20) !important;max-width:calc(100vw - var(--post-core-dimension-8) - var(--post-core-dimension-16))}}@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-minimal-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:var(--post-core-color-brand-white)}}@media screen and (max-width: 1023.98px){.navigation{position:fixed;z-index:1;inset-inline:0;background:var(--post-core-color-brand-white);inset-block-end:calc(100vh - var(--header-height))}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:var(--post-core-dimension-16) var(--post-core-dimension-24);padding-inline:var(--post-core-dimension-32)}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended{height:calc(100vh - var(--header-height));display:flex;flex-direction:column}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){background-color:var(--post-core-color-sandgrey-002);gap:var(--post-core-dimension-32)}.navigation-footer{background-color:var(--post-core-color-sandgrey-006);gap:var(--post-core-dimension-24)}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:var(--post-core-dimension-16)}}";
|
|
157
185
|
const PostHeaderStyle0 = postHeaderCss;
|
|
158
186
|
|
|
159
187
|
const PostHeader = class {
|
|
160
188
|
constructor(hostRef) {
|
|
161
189
|
index.registerInstance(this, hostRef);
|
|
162
|
-
this.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
190
|
+
this.postUpdateDevice = index.createEvent(this, "postUpdateDevice", 7);
|
|
191
|
+
}
|
|
192
|
+
firstFocusableEl;
|
|
193
|
+
lastFocusableEl;
|
|
194
|
+
scrollParent = null;
|
|
195
|
+
mobileMenu;
|
|
196
|
+
mobileMenuAnimation;
|
|
197
|
+
throttledScroll = () => this.handleScrollEvent();
|
|
198
|
+
throttledResize = throttle(50, () => this.handleResize());
|
|
168
199
|
componentWillRender() {
|
|
169
200
|
this.scrollParent = this.getScrollParent(this.host);
|
|
170
201
|
this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
171
202
|
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
172
203
|
this.handleResize();
|
|
173
204
|
this.handleScrollEvent();
|
|
205
|
+
this.getFocusableElements();
|
|
174
206
|
}
|
|
207
|
+
get host() { return index.getElement(this); }
|
|
208
|
+
device = null;
|
|
209
|
+
mobileMenuExtended = false;
|
|
175
210
|
frozeBody(isMobileMenuExtended) {
|
|
176
211
|
document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
|
|
212
|
+
if (isMobileMenuExtended) {
|
|
213
|
+
this.host.addEventListener('keydown', e => {
|
|
214
|
+
this.keyboardHandler(e);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
this.host.removeEventListener('keydown', e => {
|
|
219
|
+
this.keyboardHandler(e);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
177
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* An event emitted when the device has changed
|
|
225
|
+
*/
|
|
226
|
+
postUpdateDevice;
|
|
178
227
|
/**
|
|
179
228
|
* Toggles the mobile navigation.
|
|
180
229
|
*/
|
|
@@ -194,6 +243,36 @@ const PostHeader = class {
|
|
|
194
243
|
if (!this.mobileMenuExtended)
|
|
195
244
|
await this.mobileMenuAnimation.finished;
|
|
196
245
|
}
|
|
246
|
+
// Get all the focusable elements in the post-header mobile menu
|
|
247
|
+
getFocusableElements() {
|
|
248
|
+
// Get elements in the correct order (different as the DOM order)
|
|
249
|
+
const focusableEls = [
|
|
250
|
+
...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
|
|
251
|
+
...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-mainnavigation > .back-button, post-megadropdown-trigger')),
|
|
252
|
+
...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
|
|
253
|
+
];
|
|
254
|
+
// Add the main toggle menu button to the list of focusable children
|
|
255
|
+
const focusableChildren = [
|
|
256
|
+
this.host.querySelector('post-togglebutton'),
|
|
257
|
+
...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
|
|
258
|
+
];
|
|
259
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
260
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
261
|
+
}
|
|
262
|
+
keyboardHandler(e) {
|
|
263
|
+
if (e.key === 'Tab' && this.mobileMenuExtended) {
|
|
264
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
265
|
+
// If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
this.lastFocusableEl.focus();
|
|
268
|
+
}
|
|
269
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
270
|
+
// If Tab and last element is focused, focus goes back to the first element of the megadropdown
|
|
271
|
+
e.preventDefault();
|
|
272
|
+
this.firstFocusableEl.focus();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
197
276
|
handleScrollEvent() {
|
|
198
277
|
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
199
278
|
const st = Math.max(0, this.scrollParent instanceof Document
|
|
@@ -225,10 +304,9 @@ const PostHeader = class {
|
|
|
225
304
|
});
|
|
226
305
|
}
|
|
227
306
|
handleResize() {
|
|
228
|
-
var _a;
|
|
229
307
|
const previousDevice = this.device;
|
|
230
308
|
let newDevice;
|
|
231
|
-
const width = window
|
|
309
|
+
const width = window?.innerWidth;
|
|
232
310
|
if (width >= 1024) {
|
|
233
311
|
newDevice = 'desktop';
|
|
234
312
|
}
|
|
@@ -243,29 +321,31 @@ const PostHeader = class {
|
|
|
243
321
|
this.toggleMobileMenu();
|
|
244
322
|
this.mobileMenuAnimation.finish(); // no animation
|
|
245
323
|
}
|
|
246
|
-
const mhh =
|
|
324
|
+
const mhh = this.host.shadowRoot.querySelector('.local-header')?.clientHeight;
|
|
247
325
|
this.host.style.setProperty('--main-header-height', `${mhh}px`);
|
|
248
326
|
// Apply only on change for doing work only when necessary
|
|
249
327
|
if (newDevice !== previousDevice) {
|
|
250
328
|
this.device = newDevice;
|
|
329
|
+
this.postUpdateDevice.emit(this.device);
|
|
251
330
|
window.requestAnimationFrame(() => {
|
|
252
331
|
this.switchLanguageSwitchMode();
|
|
253
332
|
});
|
|
254
333
|
}
|
|
255
334
|
}
|
|
256
335
|
switchLanguageSwitchMode() {
|
|
257
|
-
var _a;
|
|
258
336
|
const variant = this.device === 'desktop' ? 'menu' : 'list';
|
|
259
|
-
|
|
337
|
+
this.host.querySelector('post-language-switch')?.setAttribute('variant', variant);
|
|
260
338
|
}
|
|
261
|
-
|
|
339
|
+
renderNavigation() {
|
|
262
340
|
const navigationClasses = ['navigation'];
|
|
263
341
|
if (this.mobileMenuExtended) {
|
|
264
342
|
navigationClasses.push('extended');
|
|
265
343
|
}
|
|
266
|
-
return (index.h(
|
|
344
|
+
return (index.h("div", { ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, index.h("slot", { name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (index.h("div", { class: "navigation-footer" }, index.h("slot", { name: "meta-navigation" }), index.h("slot", { name: "post-language-switch" })))));
|
|
345
|
+
}
|
|
346
|
+
render() {
|
|
347
|
+
return (index.h(index.Host, { key: 'efbf8028f2abf376f497081996dba759f5885630', version: _package.version }, index.h("div", { key: 'ecaaea274045453ce869f36e8a1155626b1818ba', class: "global-header" }, index.h("div", { key: '2fda0d65321ad1cbbc47b731f095e0d9b6694d99', class: "global-sub" }, index.h("div", { key: '24864d5f18c9d923717cc2e996395cff3bd6ce8b', class: "logo" }, index.h("slot", { key: 'ba82d7f62bb845732fe6066bcdc7eef15913c9e6', name: "post-logo" }))), index.h("div", { key: 'a0ddea4e564fca1e286998c73fea75eb8c228428', class: "global-sub" }, this.device === 'desktop' && index.h("slot", { key: '0d7aa11452eb69fe28914ff7787c6dc206fd4009', name: "meta-navigation" }), index.h("slot", { key: 'e92b7b9db6e16e8fcecb1ca74efa63942dd542c5', name: "global-controls" }), this.device === 'desktop' && index.h("slot", { key: 'c68984037a71d5ac54828f6cf2367c3b07e428fc', name: "post-language-switch" }), index.h("div", { key: '70fb5040dc2f000c2afa286bb673ae9cf88521cf', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, index.h("slot", { key: '509fb81812262cd9efdb3a562e48f72b0d29e376', name: "post-togglebutton" })))), index.h("div", { key: '393d1040bad2f85caced5b4a8ff02e30fa5fd5f1', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, index.h("slot", { key: '786cc114aae985a0612d3cb044684290e3026462', name: "title" }), index.h("div", { key: 'd4f68653a09bbf0b222873ed5d23fec6ba9d8f6f', class: "local-sub" }, index.h("slot", { key: '0ad7dda5490964e9a8eae5e0bf66a117882f7a06', name: "local-controls" }), index.h("slot", { key: 'bddc01c7696f456c38c200b330767a0f1b353d88' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
|
|
267
348
|
}
|
|
268
|
-
get host() { return index.getElement(this); }
|
|
269
349
|
static get watchers() { return {
|
|
270
350
|
"mobileMenuExtended": ["frozeBody"]
|
|
271
351
|
}; }
|
|
@@ -288,53 +368,111 @@ const ANIMATION_KEYS = [...ANIMATION_NAMES];
|
|
|
288
368
|
const PostIcon = class {
|
|
289
369
|
constructor(hostRef) {
|
|
290
370
|
index.registerInstance(this, hostRef);
|
|
291
|
-
this.animation = null;
|
|
292
|
-
this.base = null;
|
|
293
|
-
this.flipH = false;
|
|
294
|
-
this.flipV = false;
|
|
295
|
-
this.name = undefined;
|
|
296
|
-
this.rotate = null;
|
|
297
|
-
this.scale = null;
|
|
298
371
|
}
|
|
372
|
+
get host() { return index.getElement(this); }
|
|
373
|
+
/**
|
|
374
|
+
* The name of the animation.
|
|
375
|
+
*/
|
|
376
|
+
animation = null;
|
|
299
377
|
validateAnimation(newValue = this.animation) {
|
|
300
378
|
if (newValue !== undefined)
|
|
301
379
|
index$1.checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon "animation" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);
|
|
302
380
|
}
|
|
381
|
+
/**
|
|
382
|
+
* The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
|
|
383
|
+
*/
|
|
384
|
+
base = null;
|
|
303
385
|
validateBase(newValue = this.base) {
|
|
304
386
|
index$1.checkEmptyOrType(newValue, 'string', 'The post-icon "base" prop should be a string.');
|
|
305
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* When set to `true`, the icon will be flipped horizontally.
|
|
390
|
+
*/
|
|
391
|
+
flipH = false;
|
|
306
392
|
validateFlipH(newValue = this.flipH) {
|
|
307
393
|
index$1.checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipH" prop should be a boolean.');
|
|
308
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* When set to `true`, the icon will be flipped vertically.
|
|
397
|
+
*/
|
|
398
|
+
flipV = false;
|
|
309
399
|
validateFlipV(newValue = this.flipV) {
|
|
310
400
|
index$1.checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipV" prop should be a boolean.');
|
|
311
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* The name/id of the icon (e.g. 1000, 1001, ...).
|
|
404
|
+
*/
|
|
405
|
+
name;
|
|
312
406
|
validateName(newValue = this.name) {
|
|
313
407
|
checkNonEmpty.checkNonEmpty(newValue, 'The post-icon "name" prop is required!.');
|
|
314
408
|
checkType.checkType(newValue, 'string', 'The post-icon "name" prop should be a string.');
|
|
315
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* The number of degree for the css rotate transformation.
|
|
412
|
+
*/
|
|
413
|
+
rotate = null;
|
|
316
414
|
validateRotate(newValue = this.rotate) {
|
|
317
415
|
index$1.checkEmptyOrType(newValue, 'number', 'The post-icon "rotate" prop should be a number.');
|
|
318
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* The number for the css scale transformation.
|
|
419
|
+
*/
|
|
420
|
+
scale = null;
|
|
319
421
|
validateScale(newValue = this.scale) {
|
|
320
422
|
index$1.checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
|
|
321
423
|
}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
//
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
424
|
+
// Construct the icon url from different possible sources
|
|
425
|
+
getUrl() {
|
|
426
|
+
// the first definition object which defines a domain, will be used to set the domain of the file url
|
|
427
|
+
// the first definition object which defines a slug, will be used to set the slug of the file url
|
|
428
|
+
const urlDefinitions = [
|
|
429
|
+
getUrlDefinition(this.base, 'both'),
|
|
430
|
+
getUrlDefinition(document.head
|
|
431
|
+
.querySelector('meta[name="design-system-settings"][data-post-icon-base]')
|
|
432
|
+
?.getAttribute('data-post-icon-base'), 'relative'),
|
|
433
|
+
getUrlDefinition(document.querySelector('base[href]')?.getAttribute('href'), 'both'),
|
|
434
|
+
];
|
|
435
|
+
// in case no other definition defines a domain, the current origin is used as a fallback
|
|
436
|
+
const origin = urlDefinitions.find(d => d.definesDomain)?.url?.origin ?? window.location.origin;
|
|
437
|
+
// in case no other definition defines a slug, the cdn url is used as a fallback
|
|
438
|
+
const slug = urlDefinitions.find(d => d.definesSlug)?.url?.pathname;
|
|
439
|
+
const file = `${this.name}.svg`;
|
|
440
|
+
let url;
|
|
441
|
+
if (slug) {
|
|
442
|
+
url = new URL(`${origin}${slug}/${file}`).toString();
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
url = new URL(`${CDN_URL}/${file}`).toString();
|
|
446
|
+
}
|
|
447
|
+
return url;
|
|
448
|
+
function getUrlDefinition(url, allow) {
|
|
449
|
+
return {
|
|
450
|
+
url: getUrlObject(url),
|
|
451
|
+
definesDomain: allow !== 'relative' ? definesDomain(url) : false,
|
|
452
|
+
definesSlug: allow !== 'absolute' ? definesSlug(url) : false,
|
|
453
|
+
};
|
|
454
|
+
function getUrlObject(url) {
|
|
455
|
+
if (url) {
|
|
456
|
+
return definesDomain(url) ? new URL(url) : new URL(url, window.location.origin);
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function definesDomain(url) {
|
|
463
|
+
return url ? /^https?:\/\//.test(url) : false;
|
|
464
|
+
}
|
|
465
|
+
function definesSlug(url) {
|
|
466
|
+
const urlObject = getUrlObject(url);
|
|
467
|
+
return Boolean(/^\/.+/.test(urlObject?.pathname));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
332
470
|
}
|
|
333
471
|
getStyles() {
|
|
334
|
-
const
|
|
472
|
+
const url = this.getUrl();
|
|
335
473
|
return Object.entries({
|
|
336
|
-
'-webkit-mask-image': `url(${
|
|
337
|
-
'mask-image': `url('${
|
|
474
|
+
'-webkit-mask-image': `url(${url})`,
|
|
475
|
+
'mask-image': `url('${url}')`,
|
|
338
476
|
'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
|
|
339
477
|
(this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
|
|
340
478
|
})
|
|
@@ -351,9 +489,8 @@ const PostIcon = class {
|
|
|
351
489
|
this.validateAnimation();
|
|
352
490
|
}
|
|
353
491
|
render() {
|
|
354
|
-
return (index.h(index.Host, { key: '
|
|
492
|
+
return (index.h(index.Host, { key: '6c494ba3cdd2ee173fa99a8ce8ff0e8ab5cf2979', "data-version": _package.version }, index.h("span", { key: 'd9e0192a2788541b97bf3e25468129ac335d44b5', style: this.getStyles() })));
|
|
355
493
|
}
|
|
356
|
-
get host() { return index.getElement(this); }
|
|
357
494
|
static get watchers() { return {
|
|
358
495
|
"animation": ["validateAnimation"],
|
|
359
496
|
"base": ["validateBase"],
|
|
@@ -373,21 +510,38 @@ const PostLanguageOption = class {
|
|
|
373
510
|
constructor(hostRef) {
|
|
374
511
|
index.registerInstance(this, hostRef);
|
|
375
512
|
this.postChange = index.createEvent(this, "postChange", 7);
|
|
376
|
-
this.code = undefined;
|
|
377
|
-
this.active = undefined;
|
|
378
|
-
this.variant = undefined;
|
|
379
|
-
this.name = undefined;
|
|
380
|
-
this.url = undefined;
|
|
381
513
|
}
|
|
514
|
+
get host() { return index.getElement(this); }
|
|
515
|
+
/**
|
|
516
|
+
* The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, "de".
|
|
517
|
+
*/
|
|
518
|
+
code;
|
|
382
519
|
validateCode(value = this.code) {
|
|
383
520
|
checkType.checkType(value, 'string', 'The "code" property of the post-language-option component must be a string.');
|
|
384
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* If set to `true`, the language option is considered the current language for the page.
|
|
524
|
+
*/
|
|
525
|
+
active;
|
|
385
526
|
validateActiveProp(value = this.active) {
|
|
386
527
|
index$1.checkEmptyOrType(value, 'boolean', 'The "active" property of the post-language-option component must be a boolean value.');
|
|
387
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* The variant of the post-language-switch parent (dynamically set by the parent)
|
|
531
|
+
*/
|
|
532
|
+
variant;
|
|
533
|
+
/**
|
|
534
|
+
* The full name of the language. For example, "Deutsch".
|
|
535
|
+
*/
|
|
536
|
+
name;
|
|
388
537
|
validateName(value = this.name) {
|
|
389
538
|
index$1.checkEmptyOrType(value, 'string', 'The "name" property of the post-language-option component must be a string.');
|
|
390
539
|
}
|
|
540
|
+
/**
|
|
541
|
+
* The URL used for the href attribute of the internal anchor.
|
|
542
|
+
* This field is optional; if not provided, a button will be used internally instead of an anchor.
|
|
543
|
+
*/
|
|
544
|
+
url;
|
|
391
545
|
validateUrl(value = this.url) {
|
|
392
546
|
index$1.checkEmptyOrType(value, 'string', 'The "url" property of the post-language-option component must be a valid URL.');
|
|
393
547
|
}
|
|
@@ -400,6 +554,10 @@ const PostLanguageOption = class {
|
|
|
400
554
|
throw new Error('The "name" property of the post-language-option component is required when the full language name is not displayed.');
|
|
401
555
|
}
|
|
402
556
|
}
|
|
557
|
+
/**
|
|
558
|
+
* An event emitted when the language option is clicked. The payload is the ISO 639 code of the language.
|
|
559
|
+
*/
|
|
560
|
+
postChange;
|
|
403
561
|
/**
|
|
404
562
|
* Selects the language option programmatically.
|
|
405
563
|
*/
|
|
@@ -420,9 +578,8 @@ const PostLanguageOption = class {
|
|
|
420
578
|
this.emitChange();
|
|
421
579
|
}
|
|
422
580
|
};
|
|
423
|
-
return (index.h(index.Host, { key: '
|
|
581
|
+
return (index.h(index.Host, { key: 'eff35e907ca174aa239604d8e3c937309d306cd1', "data-version": _package.version, role: this.variant ? `${this.variant}item` : null }, this.url ? (index.h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, index.h("slot", null))) : (index.h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, index.h("slot", null)))));
|
|
424
582
|
}
|
|
425
|
-
get host() { return index.getElement(this); }
|
|
426
583
|
static get watchers() { return {
|
|
427
584
|
"code": ["validateCode"],
|
|
428
585
|
"active": ["validateActiveProp"],
|
|
@@ -434,27 +591,39 @@ PostLanguageOption.style = PostLanguageOptionStyle0;
|
|
|
434
591
|
|
|
435
592
|
const SWITCH_VARIANTS = ['list', 'menu'];
|
|
436
593
|
|
|
437
|
-
const postLanguageSwitchCss = ":host{display:block}@media screen and (max-width: 1023.
|
|
594
|
+
const postLanguageSwitchCss = ":host{display:block}@media screen and (max-width: 1023.98px){:host{display:flex !important;gap:.5rem}}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-dropdown-container>*{width:100%}.post-language-switch-trigger{cursor:pointer;padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-decoration:none;display:inline-flex;align-items:center;gap:var(--post-core-dimension-6);border-radius:var(--post-core-dimension-24);font-size:var(--post-core-font-size-16);padding:var(--post-core-dimension-3) var(--post-core-dimension-10)}.post-language-switch-trigger{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-switch-trigger:not(:disabled):hover,.post-language-switch-trigger.pretend-hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-switch-trigger post-icon{height:var(--post-core-dimension-16);width:var(--post-core-dimension-16)}";
|
|
438
595
|
const PostLanguageSwitchStyle0 = postLanguageSwitchCss;
|
|
439
596
|
|
|
440
597
|
const PostLanguageSwitch = class {
|
|
441
598
|
constructor(hostRef) {
|
|
442
599
|
index.registerInstance(this, hostRef);
|
|
443
|
-
this.menuId = `p${index_browser.nanoid(11)}`;
|
|
444
|
-
this.caption = undefined;
|
|
445
|
-
this.description = undefined;
|
|
446
|
-
this.variant = 'list';
|
|
447
|
-
this.activeLang = undefined;
|
|
448
600
|
}
|
|
601
|
+
get host() { return index.getElement(this); }
|
|
602
|
+
/**
|
|
603
|
+
* A title for the list of language options
|
|
604
|
+
*/
|
|
605
|
+
caption;
|
|
449
606
|
validateCaption(value = this.caption) {
|
|
450
607
|
checkType.checkType(value, 'string', 'The "caption" property of the post-language-switch component must be a string.');
|
|
451
608
|
}
|
|
609
|
+
/**
|
|
610
|
+
* A descriptive text for the list of language options
|
|
611
|
+
*/
|
|
612
|
+
description;
|
|
452
613
|
validateDescription(value = this.description) {
|
|
453
614
|
checkType.checkType(value, 'string', 'The "description" property of the post-language-switch component must be a string.');
|
|
454
615
|
}
|
|
616
|
+
/**
|
|
617
|
+
* Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)
|
|
618
|
+
*/
|
|
619
|
+
variant = 'list';
|
|
455
620
|
validateVariant(value = this.variant) {
|
|
456
621
|
index$1.checkEmptyOrOneOf(value, SWITCH_VARIANTS, `The "variant" property of the post-language-switch component must be: ${SWITCH_VARIANTS.join(', ')}`);
|
|
457
622
|
}
|
|
623
|
+
/**
|
|
624
|
+
* The active language of the language switch
|
|
625
|
+
*/
|
|
626
|
+
activeLang;
|
|
458
627
|
connectedCallback() {
|
|
459
628
|
this.updateChildrenVariant();
|
|
460
629
|
// Get the active language based on children's active state
|
|
@@ -494,6 +663,7 @@ const PostLanguageSwitch = class {
|
|
|
494
663
|
}
|
|
495
664
|
});
|
|
496
665
|
}
|
|
666
|
+
menuId = `p${index_browser.nanoid(11)}`;
|
|
497
667
|
renderList() {
|
|
498
668
|
return (index.h(index.Host, { "data-version": _package.version, "aria-label": `${this.caption}, ${this.description}`, "aria-role": "list" }, index.h("slot", null)));
|
|
499
669
|
}
|
|
@@ -503,7 +673,6 @@ const PostLanguageSwitch = class {
|
|
|
503
673
|
render() {
|
|
504
674
|
return this.variant === 'list' ? this.renderList() : this.renderDropdown();
|
|
505
675
|
}
|
|
506
|
-
get host() { return index.getElement(this); }
|
|
507
676
|
static get watchers() { return {
|
|
508
677
|
"caption": ["validateCaption"],
|
|
509
678
|
"description": ["validateDescription"],
|
|
@@ -518,10 +687,21 @@ const PostListStyle0 = postListCss;
|
|
|
518
687
|
const PostList = class {
|
|
519
688
|
constructor(hostRef) {
|
|
520
689
|
index.registerInstance(this, hostRef);
|
|
521
|
-
this.titleId = undefined;
|
|
522
|
-
this.titleHidden = false;
|
|
523
|
-
this.horizontal = false;
|
|
524
690
|
}
|
|
691
|
+
get host() { return index.getElement(this); }
|
|
692
|
+
/**
|
|
693
|
+
* The unique title of the list that is also referenced in the labelledby
|
|
694
|
+
*/
|
|
695
|
+
titleId;
|
|
696
|
+
/**
|
|
697
|
+
* If `true`, the list title will be hidden. Otherwise, it will be displayed.`
|
|
698
|
+
*/
|
|
699
|
+
titleHidden = false;
|
|
700
|
+
/**
|
|
701
|
+
* The list can become horizontal by setting `horizontal="true"` or just `horizontal`
|
|
702
|
+
*/
|
|
703
|
+
horizontal = false;
|
|
704
|
+
titleEl;
|
|
525
705
|
componentWillLoad() {
|
|
526
706
|
/**
|
|
527
707
|
* Get the id set on the host element or use a random id by default
|
|
@@ -537,9 +717,8 @@ const PostList = class {
|
|
|
537
717
|
}
|
|
538
718
|
}
|
|
539
719
|
render() {
|
|
540
|
-
return (index.h(index.Host, { key: '
|
|
720
|
+
return (index.h(index.Host, { key: 'bdd973098d8b2a74635d489dca8f0f6825e31c51', "data-version": _package.version }, index.h("div", { key: '9dcd6ca7069658c3e7f0d14fc130d18ebe522acb', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, index.h("slot", { key: 'ad51f345b2c120796d02dbc3d6815a58addc7fb4' })), index.h("div", { key: '47fddd7b977c85c195757f461c0ec009270cdb8b', role: "list", "aria-labelledby": this.titleId }, index.h("slot", { key: '176662b40ca47b6aeeded26256bc84bdee6483a6', name: "post-list-item" }))));
|
|
541
721
|
}
|
|
542
|
-
get host() { return index.getElement(this); }
|
|
543
722
|
};
|
|
544
723
|
PostList.style = PostListStyle0;
|
|
545
724
|
|
|
@@ -550,13 +729,13 @@ const PostListItem = class {
|
|
|
550
729
|
constructor(hostRef) {
|
|
551
730
|
index.registerInstance(this, hostRef);
|
|
552
731
|
}
|
|
732
|
+
get host() { return index.getElement(this); }
|
|
553
733
|
connectedCallback() {
|
|
554
734
|
this.host.setAttribute('slot', 'post-list-item');
|
|
555
735
|
}
|
|
556
736
|
render() {
|
|
557
|
-
return (index.h(index.Host, { key: '
|
|
737
|
+
return (index.h(index.Host, { key: '8e209e77859bd05d62cae41aec9dec6fb2e820cb', role: "listitem", slot: "post-list-item" }, index.h("slot", { key: 'ce79a335e80401465b74208957e22983d6df4ce0' })));
|
|
558
738
|
}
|
|
559
|
-
get host() { return index.getElement(this); }
|
|
560
739
|
};
|
|
561
740
|
PostListItem.style = PostListItemStyle0;
|
|
562
741
|
|
|
@@ -566,8 +745,12 @@ const PostLogoStyle0 = postLogoCss;
|
|
|
566
745
|
const PostLogo = class {
|
|
567
746
|
constructor(hostRef) {
|
|
568
747
|
index.registerInstance(this, hostRef);
|
|
569
|
-
this.url = undefined;
|
|
570
748
|
}
|
|
749
|
+
get host() { return index.getElement(this); }
|
|
750
|
+
/**
|
|
751
|
+
* The URL to which the user is redirected upon clicking the logo.
|
|
752
|
+
*/
|
|
753
|
+
url;
|
|
571
754
|
validateUrl() {
|
|
572
755
|
index$1.checkEmptyOrUrl(this.url, 'The "url" property of the post-logo is invalid');
|
|
573
756
|
}
|
|
@@ -583,25 +766,53 @@ const PostLogo = class {
|
|
|
583
766
|
render() {
|
|
584
767
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
585
768
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
586
|
-
return (index.h(index.Host, { key: '
|
|
769
|
+
return (index.h(index.Host, { key: 'd5f61d2740588571b77c9317d535b5c12c9ba996', "data-version": _package.version }, index.h(LogoTag, { key: '95d19b08bae7e4137f43c0b7e345fa44ed1a6e9e', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, index.h("span", { key: 'd7a4e97a9685ebc099e57737926d0fbe6d8ed12f', class: "description" }, index.h("slot", { key: '6b08a53ad00b103930f0b1aab1d305ae77feccba', onSlotchange: () => this.checkDescription() })), index.h("svg", { key: 'a7adc544f620325bdec5fa3fbc5a880d10a85f7e', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, index.h("g", { key: 'f68e9b4b0ef8b0d4b34a47a23cb4f0a0e04b5456', id: "Logo" }, index.h("rect", { key: 'b21a948f30baa4808182ccee37822315d87282eb', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), index.h("polygon", { key: '57ec911498cb069aaa80b4857447c1da3aa76959', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), index.h("path", { key: 'fed41d70f4532da5769cbc51740e21520568af7f', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
587
770
|
}
|
|
588
|
-
get host() { return index.getElement(this); }
|
|
589
771
|
static get watchers() { return {
|
|
590
772
|
"url": ["validateUrl"]
|
|
591
773
|
}; }
|
|
592
774
|
};
|
|
593
775
|
PostLogo.style = PostLogoStyle0;
|
|
594
776
|
|
|
595
|
-
const postMainnavigationCss = "post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}post-mainnavigation post-list-item post-megadropdown-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item>button:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:var(--post-core-dimension-4);z-index:1}@media screen and (min-width: 1024px){post-mainnavigation nav{position:relative;max-width:100vw;max-height:var(--post-core-dimension-56);user-select:none}post-mainnavigation post-list{margin-inline:var(--post-core-dimension-4)}post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline:var(--post-core-dimension-12);height:var(--post-core-dimension-56);gap:var(--post-core-dimension-4);font-size:var(--post-core-font-size-16);border-block:0 solid rgba(0,0,0,0);border-block-end-color:currentColor}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{border-block-width:var(--post-core-dimension-2)}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{border-block-width:var(--post-core-dimension-4);font-weight:var(--post-core-font-weight-700)}post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:var(--post-core-dimension-12);transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{content:\"\";mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.99px){post-mainnavigation post-list>[role=list]{transform:none !important}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;height:var(--post-core-dimension-48);padding-inline-end:var(--post-core-dimension-6);gap:var(--post-core-dimension-16);border-block:var(--post-core-dimension-1) solid rgba(0,0,0,0);border-block-end-color:currentColor;font-weight:var(--post-core-font-weight-700)}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button.selected{border-block-width:var(--post-core-dimension-3)}post-mainnavigation post-list-item>a:hover::after,post-mainnavigation post-list-item>button:hover::after,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::after{content:\"\";display:block;mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.667 5.333H18.8L29.467 16H0v1.333h29.467L18.8 28h1.867L32 16.667z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-24);height:var(--post-core-dimension-24)}}post-mainnavigation .back-button .btn{padding-inline:0}";
|
|
777
|
+
const postMainnavigationCss = "post-mainnavigation{flex:0 0 auto}post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}post-mainnavigation post-list-item post-megadropdown-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item post-megadropdown-trigger button{flex:0 0 fit-content;white-space:nowrap;display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:var(--post-core-dimension-4)}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.98px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-16)}}@media screen and (max-width: 599.98px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-14)}}@media screen and (min-width: 1024px){post-mainnavigation{display:block}post-mainnavigation nav{max-width:100vw;background:var(--post-core-color-brand-white);max-height:var(--main-navigation-height);user-select:none;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{position:absolute;inset-block:0;overflow:hidden}post-mainnavigation .left-scroll-button button,post-mainnavigation .right-scroll-button button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;background:var(--post-core-color-brand-white);padding:var(--post-core-dimension-16);box-shadow:var(--post-core-elevation-5);line-height:var(--post-core-line-height-100);height:100%}post-mainnavigation .left-scroll-button button post-icon,post-mainnavigation .right-scroll-button button post-icon{font-size:1rem}post-mainnavigation .left-scroll-button{inset-inline-start:0;padding-inline-end:2rem}post-mainnavigation .right-scroll-button{inset-inline-end:0;padding-inline-start:2rem}post-mainnavigation post-list{margin-inline:var(--post-core-dimension-4)}post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{position:sticky;padding-inline:var(--post-core-dimension-12);height:var(--main-navigation-height);gap:var(--post-core-dimension-4);font-size:var(--post-core-font-size-16);border-block:0 solid rgba(0,0,0,0);border-block-end-color:currentColor}}@media screen and (min-width: 1024px)and (max-width: 1023.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{z-index:3}}@media screen and (min-width: 1024px)and (min-width: 1024px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{z-index:4}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{border-block-width:var(--post-core-dimension-2)}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{border-block-width:var(--post-core-dimension-4);font-weight:var(--post-core-font-weight-700)}}@media screen and (min-width: 1024px)and (max-width: 599.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{font-size:var(--post-core-font-size-14)}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:var(--post-core-dimension-12);transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{content:\"\";mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}}@media screen and (min-width: 1024px){post-mainnavigation post-megadropdown button:not(.btn-icon-close),post-mainnavigation post-megadropdown a{width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative}post-mainnavigation post-megadropdown button:not(.btn-icon-close)::before,post-mainnavigation post-megadropdown a::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::before,post-mainnavigation post-megadropdown a:hover::before{height:var(--post-core-dimension-3)}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::after,post-mainnavigation post-megadropdown a:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}}@media screen and (min-width: 1024px){post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.98px){post-mainnavigation nav{transform:none !important}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{display:none}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative}post-mainnavigation post-list-item>a::before,post-mainnavigation post-list-item>button::before,post-mainnavigation post-list-item post-megadropdown-trigger button::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}post-mainnavigation post-list-item>a:hover::before,post-mainnavigation post-list-item>button:hover::before,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::before{height:var(--post-core-dimension-3)}post-mainnavigation post-list-item>a:hover::after,post-mainnavigation post-list-item>button:hover::after,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}}post-mainnavigation .back-button .btn{padding-inline:0}";
|
|
596
778
|
const PostMainnavigationStyle0 = postMainnavigationCss;
|
|
597
779
|
|
|
780
|
+
const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
|
|
781
|
+
const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
|
|
782
|
+
const NAVIGATION_LIST_SELECTOR = 'post-list:not(post-megadropdown *) > [role="list"]';
|
|
783
|
+
const NAVIGATION_ITEM_SELECTOR = ':is(post-list-item > a, post-list-item > post-megadropdown-trigger > button):not(post-megadropdown *)';
|
|
598
784
|
const PostMainnavigation = class {
|
|
599
785
|
constructor(hostRef) {
|
|
600
786
|
index.registerInstance(this, hostRef);
|
|
601
|
-
|
|
787
|
+
}
|
|
788
|
+
header;
|
|
789
|
+
navbar;
|
|
790
|
+
rightScrollButton;
|
|
791
|
+
leftScrollButton;
|
|
792
|
+
scrollRepeatInterval;
|
|
793
|
+
navbarDisableTimer;
|
|
794
|
+
mutationObserver = new MutationObserver(async (mutations) => {
|
|
795
|
+
// Wait for all elements to be hydrated
|
|
796
|
+
await Promise.all(mutations
|
|
797
|
+
.flatMap((mutation) => Array.from(mutation.addedNodes))
|
|
798
|
+
.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
|
|
799
|
+
// Recalculate scrollability after DOM changes
|
|
800
|
+
this.checkScrollability();
|
|
801
|
+
});
|
|
802
|
+
get host() { return index.getElement(this); }
|
|
803
|
+
canScrollLeft = false;
|
|
804
|
+
canScrollRight = false;
|
|
805
|
+
translateAmount = 0;
|
|
806
|
+
/**
|
|
807
|
+
* Update navbar translation when 'translateAmount' changes and recalculate scrollability
|
|
808
|
+
*/
|
|
809
|
+
onTranslateAmountChanges(value) {
|
|
810
|
+
this.navbar.style.transform = `translateX(-${value}px)`;
|
|
811
|
+
this.checkScrollability();
|
|
602
812
|
}
|
|
603
813
|
/**
|
|
604
814
|
* Retrieves a reference to the closest 'post-header' element when the main navigation is added to the DOM.
|
|
815
|
+
* This ensures that we can interact with the header for mobile menu toggling.
|
|
605
816
|
*/
|
|
606
817
|
connectedCallback() {
|
|
607
818
|
this.header = this.host.closest('post-header');
|
|
@@ -611,104 +822,329 @@ const PostMainnavigation = class {
|
|
|
611
822
|
*/
|
|
612
823
|
disconnectedCallback() {
|
|
613
824
|
this.header = null;
|
|
825
|
+
this.mutationObserver.disconnect();
|
|
826
|
+
}
|
|
827
|
+
componentDidLoad() {
|
|
828
|
+
setTimeout(() => this.checkScrollability()); // Initial check to determine if scrolling is needed
|
|
829
|
+
this.mutationObserver.observe(this.navigationList, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
|
|
830
|
+
window.addEventListener('resize', // Recheck scrollability on window resize
|
|
831
|
+
throttle(100, () => this.checkScrollability()));
|
|
832
|
+
// Handle focus changes and adjust scroll as needed
|
|
833
|
+
this.navbar.addEventListener('focusin', e => this.adjustTranslation(e));
|
|
614
834
|
}
|
|
615
835
|
handleBackButtonClick() {
|
|
616
836
|
if (this.header)
|
|
617
837
|
this.header.toggleMobileMenu();
|
|
618
838
|
}
|
|
839
|
+
/**
|
|
840
|
+
* Moves focus on the navbar and adjusts scrolling to bring focused element into view.
|
|
841
|
+
*/
|
|
842
|
+
adjustTranslation(e) {
|
|
843
|
+
const focusedElement = e.target;
|
|
844
|
+
if (!this.canScroll || !focusedElement.matches(NAVIGATION_ITEM_SELECTOR))
|
|
845
|
+
return;
|
|
846
|
+
// We need to move the element into the view before it is focused to avoid browser default behavior
|
|
847
|
+
e.preventDefault();
|
|
848
|
+
this.withoutTransition(() => {
|
|
849
|
+
// Try scrolling in both directions, only the necessary translation will actually occur
|
|
850
|
+
this.translateRightTo(focusedElement);
|
|
851
|
+
this.translateLeftTo(focusedElement);
|
|
852
|
+
focusedElement.focus();
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Checks if scrolling is possible in either direction (left or right) and updates the state accordingly.
|
|
857
|
+
*/
|
|
858
|
+
checkScrollability() {
|
|
859
|
+
const { scrollWidth, clientWidth } = this.navbar;
|
|
860
|
+
const couldScroll = this.canScroll;
|
|
861
|
+
if (scrollWidth === clientWidth) {
|
|
862
|
+
// If scroll width equals client width, scrolling is disabled in both directions
|
|
863
|
+
this.canScrollLeft = this.canScrollRight = false;
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
this.canScrollLeft = this.translateAmount !== 0; // Scrolling left is possible if not at the start
|
|
867
|
+
this.canScrollRight = clientWidth + this.translateAmount !== scrollWidth; // Scrolling right is possible if not at the end
|
|
868
|
+
}
|
|
869
|
+
if (couldScroll && !this.canScroll) {
|
|
870
|
+
this.withoutTransition(() => (this.translateAmount = 0));
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Returns whether scrolling is enabled in either the left or right direction.
|
|
875
|
+
*/
|
|
876
|
+
get canScroll() {
|
|
877
|
+
return this.canScrollLeft || this.canScrollRight;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Handles the scrolling behavior when a user clicks on the left or right scroll buttons.
|
|
881
|
+
*/
|
|
882
|
+
handleScrollButtonClick(direction) {
|
|
883
|
+
if (!this.canScroll)
|
|
884
|
+
return;
|
|
885
|
+
// Disable interaction with the navbar during scrolling
|
|
886
|
+
this.disableNavbar();
|
|
887
|
+
// Perform the initial scroll action
|
|
888
|
+
this.scroll(direction);
|
|
889
|
+
// Repeat the scrolling action while the button is held down
|
|
890
|
+
this.scrollRepeatInterval = setInterval(() => {
|
|
891
|
+
this.scroll(direction);
|
|
892
|
+
}, SCROLL_REPEAT_INTERVAL);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Stops the repeated scrolling when the mouse button is released.
|
|
896
|
+
*/
|
|
897
|
+
stopScrolling() {
|
|
898
|
+
if (this.scrollRepeatInterval)
|
|
899
|
+
clearInterval(this.scrollRepeatInterval);
|
|
900
|
+
}
|
|
901
|
+
scroll(direction) {
|
|
902
|
+
const navigationItems = Array.from(this.navigationItems);
|
|
903
|
+
if (direction === 'left')
|
|
904
|
+
navigationItems.reverse();
|
|
905
|
+
for (const item of navigationItems) {
|
|
906
|
+
const couldScroll = direction === 'left' ? this.translateLeftTo(item) : this.translateRightTo(item);
|
|
907
|
+
if (couldScroll)
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
translateRightTo(navigationItem) {
|
|
912
|
+
const itemRightEdgePosition = navigationItem.offsetLeft + navigationItem.offsetWidth + this.getFocusMargin(navigationItem);
|
|
913
|
+
const lastVisiblePosition = this.navbar.clientWidth + this.translateAmount;
|
|
914
|
+
// If the item is already fully visible, don't scroll
|
|
915
|
+
if (itemRightEdgePosition < lastVisiblePosition)
|
|
916
|
+
return false;
|
|
917
|
+
const maxTranslateAmount = this.navbar.scrollWidth - this.navbar.clientWidth;
|
|
918
|
+
const newRightEdgePosition = itemRightEdgePosition + this.rightScrollButton.clientWidth - this.navbar.clientWidth;
|
|
919
|
+
this.translateAmount = Math.min(maxTranslateAmount, newRightEdgePosition);
|
|
920
|
+
return true;
|
|
921
|
+
}
|
|
922
|
+
translateLeftTo(navigationItem) {
|
|
923
|
+
const itemLeftEdgePosition = navigationItem.offsetLeft - this.getFocusMargin(navigationItem);
|
|
924
|
+
const firstVisiblePosition = this.translateAmount;
|
|
925
|
+
// If the item is already fully visible, don't scroll
|
|
926
|
+
if (itemLeftEdgePosition > firstVisiblePosition)
|
|
927
|
+
return false;
|
|
928
|
+
const minTranslateAmount = 0;
|
|
929
|
+
const newRightEdgePosition = itemLeftEdgePosition - this.leftScrollButton.clientWidth;
|
|
930
|
+
this.translateAmount = Math.max(minTranslateAmount, newRightEdgePosition);
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Calculate the margin required for focus outline around navigation items
|
|
935
|
+
*/
|
|
936
|
+
getFocusMargin(navigationItem) {
|
|
937
|
+
const { outlineWidth, outlineOffset } = getComputedStyle(navigationItem);
|
|
938
|
+
return parseInt(outlineWidth) + parseInt(outlineOffset) + 1;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Returns the navigation list container element
|
|
942
|
+
*/
|
|
943
|
+
get navigationList() {
|
|
944
|
+
return this.navbar.querySelector(NAVIGATION_LIST_SELECTOR);
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Returns the navigation items
|
|
948
|
+
*/
|
|
949
|
+
get navigationItems() {
|
|
950
|
+
return this.navbar.querySelectorAll(NAVIGATION_ITEM_SELECTOR);
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Temporarily disables interactions with the navbar during scrolling to prevent accidental clicks.
|
|
954
|
+
* Re-enables interactions after a brief delay to avoid blocking the user entirely.
|
|
955
|
+
*/
|
|
956
|
+
disableNavbar() {
|
|
957
|
+
if (this.navbarDisableTimer)
|
|
958
|
+
clearTimeout(this.navbarDisableTimer);
|
|
959
|
+
this.navbar.style.pointerEvents = 'none';
|
|
960
|
+
this.navbarDisableTimer = setTimeout(() => {
|
|
961
|
+
this.navbar.style.pointerEvents = 'initial';
|
|
962
|
+
}, NAVBAR_DISABLE_DURATION);
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Allows to translate the navbar without a transition
|
|
966
|
+
*/
|
|
967
|
+
withoutTransition(callback) {
|
|
968
|
+
const transition = this.navbar.style.transition;
|
|
969
|
+
this.navbar.style.transition = 'none';
|
|
970
|
+
callback();
|
|
971
|
+
setTimeout(() => {
|
|
972
|
+
this.navbar.style.transition = transition;
|
|
973
|
+
});
|
|
974
|
+
}
|
|
619
975
|
render() {
|
|
620
|
-
return (index.h(index.Host, { key: '
|
|
976
|
+
return (index.h(index.Host, { key: '3280c55d0f8e7aec6e1dc3f59744114b2557cb04', slot: "post-mainnavigation" }, index.h("div", { key: '446ede19ef62a21022a771edb8a6e8eb30a5c5d3', onClick: () => this.handleBackButtonClick(), class: "back-button" }, index.h("slot", { key: '5e923b62133d3452676445349624157fd7d3d957', name: "back-button" })), index.h("nav", { key: 'd67723ba6b42ec2b083197091ec7226dc258897e', ref: el => (this.navbar = el) }, index.h("slot", { key: 'ea1a0fd7f76e02b89789713a49fc4d7fd6e8a022' })), index.h("div", { key: '1a3d640acfe23ae5c5f9ab26a7bca9c3c2bc4434', class: `left-scroll-button${this.canScrollLeft ? '' : ' d-none'}`, "aria-hidden": "true" }, index.h("button", { key: 'a3260bba8104bf9155120e04fed6ba0aa102e529', type: "button", tabindex: "-1", ref: el => (this.leftScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('left') }, index.h("post-icon", { key: '0bba0a76f93098267be8432636391641f55d5df8', "aria-hidden": "true", name: "chevronleft" }))), index.h("div", { key: '401ef6821f258737d17ed54ae1c577cc4783a3f9', class: `right-scroll-button${this.canScrollRight ? '' : ' d-none'}`, "aria-hidden": "true" }, index.h("button", { key: 'd964f4b74ad8fef86115b12fcda12cc54da936f3', type: "button", tabindex: "-1", ref: el => (this.rightScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('right') }, index.h("post-icon", { key: '5758f48df24b4a3ea241f43464b448878e31977d', "aria-hidden": "true", name: "chevronright" })))));
|
|
621
977
|
}
|
|
622
|
-
get
|
|
978
|
+
static get watchers() { return {
|
|
979
|
+
"translateAmount": ["onTranslateAmountChanges"]
|
|
980
|
+
}; }
|
|
623
981
|
};
|
|
624
982
|
PostMainnavigation.style = PostMainnavigationStyle0;
|
|
625
983
|
|
|
626
|
-
const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}*,::before,::after{box-sizing:border-box}post-
|
|
984
|
+
const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{--post-main-header-height:56px;--post-global-header-height:72px;--post-header-height:calc(var(--post-global-header-height) + var(--post-main-header-height));box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;z-index:1;border-top:1px solid #e1e0dc;width:100%;top:100%;left:0;border-radius:0}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{--post-global-header-height:64px;z-index:4;top:0 !important;left:0;width:100%;position:fixed;height:calc(100vh - var(--post-header-height));max-height:calc(100vh - var(--header-height));border-top:unset;overflow:auto}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-top:0;margin-bottom:8px;font-weight:900}.megadropdown h2 a{text-decoration:none;font-weight:inherit;border-bottom:0;border-top:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)){padding:15px 12px 14px 8px;border-bottom:1px solid #050400}.megadropdown post-list .list-title h3 a{padding-block:15px 14px;padding-inline-start:8px;border-radius:0;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}.megadropdown post-list .list-title h3 a:hover::before{height:var(--post-core-dimension-3)}.megadropdown post-list .list-title h3 a:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)){padding:15px 12px 14px 8px;border-bottom:1px solid #050400}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-bottom:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{display:block}}.megadropdown .close-button{position:absolute;top:1rem;right:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}";
|
|
627
985
|
const PostMegadropdownStyle0 = postMegadropdownCss;
|
|
628
986
|
|
|
629
987
|
const PostMegadropdown = class {
|
|
630
988
|
constructor(hostRef) {
|
|
631
989
|
index.registerInstance(this, hostRef);
|
|
632
990
|
this.postToggleMegadropdown = index.createEvent(this, "postToggleMegadropdown", 7);
|
|
633
|
-
this.isVisible = false;
|
|
634
|
-
this.animationClass = null;
|
|
635
|
-
}
|
|
636
|
-
componentDidLoad() {
|
|
637
|
-
this.popoverRef.addEventListener('postToggle', (event) => {
|
|
638
|
-
this.isVisible = event.detail;
|
|
639
|
-
this.postToggleMegadropdown.emit(this.isVisible);
|
|
640
|
-
});
|
|
641
|
-
this.popoverRef.addEventListener('animationend', () => {
|
|
642
|
-
if (this.animationClass === 'slide-out') {
|
|
643
|
-
this.hide();
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
991
|
}
|
|
992
|
+
header;
|
|
993
|
+
firstFocusableEl;
|
|
994
|
+
lastFocusableEl;
|
|
995
|
+
device;
|
|
996
|
+
get host() { return index.getElement(this); }
|
|
997
|
+
/** Tracks the currently active dropdown instance. */
|
|
998
|
+
static activeDropdown = null;
|
|
647
999
|
/**
|
|
648
|
-
*
|
|
1000
|
+
* Holds the current visibility state of the dropdown.
|
|
1001
|
+
* This state is internally managed to track whether the dropdown is open (`true`) or closed (`false`),
|
|
1002
|
+
* and updates automatically when the dropdown is toggled.
|
|
649
1003
|
*/
|
|
650
|
-
|
|
651
|
-
|
|
1004
|
+
isVisible = false;
|
|
1005
|
+
/** Holds the current animation class. */
|
|
1006
|
+
animationClass = null;
|
|
1007
|
+
/**
|
|
1008
|
+
* Emits when the dropdown is shown or hidden.
|
|
1009
|
+
* The event payload is a boolean: `true` when the dropdown was opened, `false` when it was closed.
|
|
1010
|
+
**/
|
|
1011
|
+
postToggleMegadropdown;
|
|
1012
|
+
disconnectedCallback() {
|
|
1013
|
+
this.removeOutsideClickListener();
|
|
1014
|
+
if (PostMegadropdown.activeDropdown === this) {
|
|
1015
|
+
PostMegadropdown.activeDropdown = null;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
componentWillRender() {
|
|
1019
|
+
this.getFocusableElements();
|
|
652
1020
|
}
|
|
653
1021
|
/**
|
|
654
|
-
*
|
|
655
|
-
*
|
|
656
|
-
* @param target - The HTML element relative to which the popover dropdown should be displayed.
|
|
1022
|
+
* Toggles the dropdown visibility based on its current state.
|
|
657
1023
|
*/
|
|
658
|
-
async
|
|
659
|
-
if (this.
|
|
660
|
-
|
|
661
|
-
this.animationClass = 'slide-in';
|
|
1024
|
+
async toggle() {
|
|
1025
|
+
if (this.isVisible) {
|
|
1026
|
+
this.hide();
|
|
662
1027
|
}
|
|
663
1028
|
else {
|
|
664
|
-
|
|
1029
|
+
await this.show();
|
|
665
1030
|
}
|
|
666
1031
|
}
|
|
667
1032
|
/**
|
|
668
|
-
*
|
|
1033
|
+
* Displays the dropdown.
|
|
669
1034
|
*/
|
|
670
|
-
|
|
671
|
-
if (this
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
else {
|
|
675
|
-
console.error('hide: popoverRef is null or undefined');
|
|
1035
|
+
async show() {
|
|
1036
|
+
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
1037
|
+
// Close the previously active dropdown without animation
|
|
1038
|
+
PostMegadropdown.activeDropdown.forceClose();
|
|
676
1039
|
}
|
|
1040
|
+
this.isVisible = true;
|
|
1041
|
+
this.host.addEventListener('keydown', e => this.keyboardHandler(e));
|
|
1042
|
+
this.animationClass = 'slide-in';
|
|
1043
|
+
PostMegadropdown.activeDropdown = this;
|
|
1044
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1045
|
+
this.addOutsideClickListener();
|
|
677
1046
|
}
|
|
678
|
-
|
|
1047
|
+
/**
|
|
1048
|
+
* Hides the dropdown with an animation.
|
|
1049
|
+
*/
|
|
1050
|
+
async hide() {
|
|
679
1051
|
this.animationClass = 'slide-out';
|
|
1052
|
+
this.host.removeEventListener('keydown', e => this.keyboardHandler(e));
|
|
680
1053
|
}
|
|
681
|
-
|
|
682
|
-
this.
|
|
1054
|
+
connectedCallback() {
|
|
1055
|
+
this.header = this.host.closest('post-header');
|
|
1056
|
+
if (this.header) {
|
|
1057
|
+
this.header.addEventListener('postUpdateDevice', (event) => (this.device = event.detail));
|
|
1058
|
+
}
|
|
683
1059
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
1060
|
+
/**
|
|
1061
|
+
* Forces the dropdown to close without animation.
|
|
1062
|
+
*/
|
|
1063
|
+
forceClose() {
|
|
1064
|
+
this.isVisible = false;
|
|
1065
|
+
this.animationClass = null;
|
|
1066
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1067
|
+
this.removeOutsideClickListener();
|
|
1068
|
+
}
|
|
1069
|
+
handleAnimationEnd() {
|
|
1070
|
+
if (this.animationClass === 'slide-out') {
|
|
1071
|
+
this.isVisible = false;
|
|
1072
|
+
this.animationClass = null;
|
|
1073
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1074
|
+
this.removeOutsideClickListener();
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
handleClickOutside = (event) => {
|
|
1078
|
+
const target = event.target;
|
|
1079
|
+
if (this.host.contains(target)) {
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
if (target instanceof HTMLElement) {
|
|
1083
|
+
const trigger = target.closest('post-megadropdown-trigger');
|
|
1084
|
+
if (trigger) {
|
|
1085
|
+
const targetDropdownId = trigger.getAttribute('for');
|
|
1086
|
+
if (targetDropdownId !== this.host.id) {
|
|
1087
|
+
return;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
this.hide();
|
|
1092
|
+
};
|
|
1093
|
+
addOutsideClickListener() {
|
|
1094
|
+
document.addEventListener('mousedown', this.handleClickOutside);
|
|
1095
|
+
}
|
|
1096
|
+
removeOutsideClickListener() {
|
|
1097
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
1098
|
+
}
|
|
1099
|
+
getFocusableElements() {
|
|
1100
|
+
const focusableEls = Array.from(this.host.querySelectorAll('post-list-item, h3, .back-button'));
|
|
1101
|
+
const focusableChildren = focusableEls.flatMap(el => Array.from(getFocusableChildren(el)));
|
|
1102
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
1103
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
1104
|
+
}
|
|
1105
|
+
// Loop through the focusable children
|
|
1106
|
+
keyboardHandler(e) {
|
|
1107
|
+
if (e.key === 'Tab' && this.device !== 'desktop') {
|
|
1108
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
1109
|
+
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
1110
|
+
e.preventDefault();
|
|
1111
|
+
this.lastFocusableEl.focus();
|
|
1112
|
+
}
|
|
1113
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
1114
|
+
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
1115
|
+
e.preventDefault();
|
|
1116
|
+
this.firstFocusableEl.focus();
|
|
1117
|
+
}
|
|
689
1118
|
}
|
|
690
1119
|
}
|
|
691
1120
|
render() {
|
|
692
|
-
|
|
1121
|
+
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
1122
|
+
return (index.h(index.Host, { key: '5aa08b01be715325182c245e1b0ae2456bcc5df6' }, index.h("div", { key: '0737c9368ecbffac59bbdf47fabac3f3b94ae7bb', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, index.h("div", { key: 'efe49f3f9cdcd99e2feca78b772c944405e19f21', class: "megadropdown" }, index.h("div", { key: '14dd7ff2f7e7b1eb91f2673a25d7ccafffe4f9d0', onClick: () => this.hide(), class: "back-button" }, index.h("slot", { key: '554e30e6408c0bef0549f5e2c31dcd8b90ceee40', name: "back-button" })), index.h("div", { key: '4e7335152d7b6649918adf075213ebbf8b8ddeaa', onClick: () => this.hide(), class: "close-button" }, index.h("slot", { key: 'db90f3a5334ce723c0ee672a96167197ca25b545', name: "close-button" })), index.h("slot", { key: 'b11b1d16147f88103f2eb24c8dd21394de53f69c', name: "megadropdown-title" }), index.h("div", { key: '6d837c1a70f66f00097fb531058750fbac6fd41a', class: "megadropdown-content" }, index.h("slot", { key: 'be685185f04e44d867167f918494d086856b5928' }))))));
|
|
693
1123
|
}
|
|
694
|
-
get host() { return index.getElement(this); }
|
|
695
1124
|
};
|
|
696
1125
|
PostMegadropdown.style = PostMegadropdownStyle0;
|
|
697
1126
|
|
|
698
|
-
const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100
|
|
1127
|
+
const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100%;position:relative;z-index:3}";
|
|
699
1128
|
const PostMegadropdownTriggerStyle0 = postMegadropdownTriggerCss;
|
|
700
1129
|
|
|
701
1130
|
const PostMegadropdownTrigger = class {
|
|
702
1131
|
constructor(hostRef) {
|
|
703
1132
|
index.registerInstance(this, hostRef);
|
|
704
|
-
/**
|
|
705
|
-
* Reference to the slotted button within the trigger, if present.
|
|
706
|
-
* Used to manage click and key events for mega dropdown control.
|
|
707
|
-
*/
|
|
708
|
-
this.slottedButton = null;
|
|
709
|
-
this.for = undefined;
|
|
710
|
-
this.ariaExpanded = false;
|
|
711
1133
|
}
|
|
1134
|
+
/**
|
|
1135
|
+
* ID of the mega dropdown element that this trigger is linked to. Used to open and close the specified mega dropdown.
|
|
1136
|
+
*/
|
|
1137
|
+
for;
|
|
1138
|
+
get host() { return index.getElement(this); }
|
|
1139
|
+
/**
|
|
1140
|
+
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated mega dropdown is expanded or collapsed.
|
|
1141
|
+
*/
|
|
1142
|
+
ariaExpanded = false;
|
|
1143
|
+
/**
|
|
1144
|
+
* Reference to the slotted button within the trigger, if present.
|
|
1145
|
+
* Used to manage click and key events for mega dropdown control.
|
|
1146
|
+
*/
|
|
1147
|
+
slottedButton = null;
|
|
712
1148
|
/**
|
|
713
1149
|
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
714
1150
|
* @param forValue - The new value of the `for` property.
|
|
@@ -724,7 +1160,7 @@ const PostMegadropdownTrigger = class {
|
|
|
724
1160
|
}
|
|
725
1161
|
handleToggle() {
|
|
726
1162
|
if (this.megadropdown) {
|
|
727
|
-
this.megadropdown.toggle(
|
|
1163
|
+
this.megadropdown.toggle();
|
|
728
1164
|
}
|
|
729
1165
|
else {
|
|
730
1166
|
console.warn(`No post-megadropdown found with ID: ${this.for}`);
|
|
@@ -753,43 +1189,14 @@ const PostMegadropdownTrigger = class {
|
|
|
753
1189
|
}
|
|
754
1190
|
}
|
|
755
1191
|
render() {
|
|
756
|
-
return (index.h(index.Host, { key: '
|
|
1192
|
+
return (index.h(index.Host, { key: '2e009cb0dbfd81785d3a8ce5802a4fab0e84a52e', "data-version": _package.version, "tab-index": "-1" }, index.h("button", { key: 'd77d9a5eb5786a63cf7453c639647adc705892bc' }, index.h("slot", { key: '19f4b17dc2d073b0770c33d6acfb763c1e47735a' }))));
|
|
757
1193
|
}
|
|
758
|
-
get host() { return index.getElement(this); }
|
|
759
1194
|
static get watchers() { return {
|
|
760
1195
|
"for": ["validateControlFor"]
|
|
761
1196
|
}; }
|
|
762
1197
|
};
|
|
763
1198
|
PostMegadropdownTrigger.style = PostMegadropdownTriggerStyle0;
|
|
764
1199
|
|
|
765
|
-
const focusableSelector = `:where(${[
|
|
766
|
-
'button',
|
|
767
|
-
'input:not([type="hidden"])',
|
|
768
|
-
'[tabindex]',
|
|
769
|
-
'select',
|
|
770
|
-
'textarea',
|
|
771
|
-
'[contenteditable]',
|
|
772
|
-
'a[href]',
|
|
773
|
-
'iframe',
|
|
774
|
-
'audio[controls]',
|
|
775
|
-
'video[controls]',
|
|
776
|
-
'area[href]',
|
|
777
|
-
'details > summary:first-of-type',
|
|
778
|
-
].join(',')})`;
|
|
779
|
-
const focusDisablingSelector = `:where(${[
|
|
780
|
-
'[inert]',
|
|
781
|
-
'[inert] *',
|
|
782
|
-
':disabled',
|
|
783
|
-
'dialog:not([open]) *',
|
|
784
|
-
'[popover]:not(:popover-open) *',
|
|
785
|
-
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
786
|
-
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
787
|
-
'[tabindex^="-"]',
|
|
788
|
-
].join(',')})`;
|
|
789
|
-
const getFocusableChildren = (element) => {
|
|
790
|
-
return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
|
|
791
|
-
};
|
|
792
|
-
|
|
793
1200
|
const postMenuCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}post-popovercontainer{padding:var(--post-menu-padding);background-color:var(--post-menu-bg, #ffffff);border-color:var(--post-menu-bg, #ffffff)}.popover-container{display:flex;flex-direction:column}";
|
|
794
1201
|
const PostMenuStyle0 = postMenuCss;
|
|
795
1202
|
|
|
@@ -797,36 +1204,38 @@ const PostMenu = class {
|
|
|
797
1204
|
constructor(hostRef) {
|
|
798
1205
|
index.registerInstance(this, hostRef);
|
|
799
1206
|
this.toggleMenu = index.createEvent(this, "toggleMenu", 7);
|
|
800
|
-
this.lastFocusedElement = null;
|
|
801
|
-
this.KEYCODES = {
|
|
802
|
-
SPACE: ' ',
|
|
803
|
-
ENTER: 'Enter',
|
|
804
|
-
UP: 'ArrowUp',
|
|
805
|
-
DOWN: 'ArrowDown',
|
|
806
|
-
TAB: 'Tab',
|
|
807
|
-
HOME: 'Home',
|
|
808
|
-
END: 'End',
|
|
809
|
-
ESCAPE: 'Escape',
|
|
810
|
-
};
|
|
811
|
-
this.handleKeyDown = (e) => {
|
|
812
|
-
e.stopPropagation();
|
|
813
|
-
if (e.key === this.KEYCODES.ESCAPE) {
|
|
814
|
-
this.toggle(this.host);
|
|
815
|
-
return;
|
|
816
|
-
}
|
|
817
|
-
if (Object.values(this.KEYCODES).includes(e.key)) {
|
|
818
|
-
this.controlKeyDownHandler(e);
|
|
819
|
-
}
|
|
820
|
-
};
|
|
821
|
-
this.handleClick = (e) => {
|
|
822
|
-
const target = e.target;
|
|
823
|
-
if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
|
824
|
-
this.toggle(this.host);
|
|
825
|
-
}
|
|
826
|
-
};
|
|
827
|
-
this.placement = 'bottom';
|
|
828
|
-
this.isVisible = false;
|
|
829
1207
|
}
|
|
1208
|
+
popoverRef;
|
|
1209
|
+
lastFocusedElement = null;
|
|
1210
|
+
KEYCODES = {
|
|
1211
|
+
SPACE: ' ',
|
|
1212
|
+
ENTER: 'Enter',
|
|
1213
|
+
UP: 'ArrowUp',
|
|
1214
|
+
DOWN: 'ArrowDown',
|
|
1215
|
+
TAB: 'Tab',
|
|
1216
|
+
HOME: 'Home',
|
|
1217
|
+
END: 'End',
|
|
1218
|
+
ESCAPE: 'Escape',
|
|
1219
|
+
};
|
|
1220
|
+
get host() { return index.getElement(this); }
|
|
1221
|
+
/**
|
|
1222
|
+
* Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
1223
|
+
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
1224
|
+
* towards the viewport if they would overlap edge boundaries.
|
|
1225
|
+
*/
|
|
1226
|
+
placement = 'bottom';
|
|
1227
|
+
/**
|
|
1228
|
+
* Holds the current visibility state of the menu.
|
|
1229
|
+
* This state is internally managed to track whether the menu is open (`true`) or closed (`false`),
|
|
1230
|
+
* and updates automatically when the menu is toggled.
|
|
1231
|
+
*/
|
|
1232
|
+
isVisible = false;
|
|
1233
|
+
/**
|
|
1234
|
+
* Emits when the menu is shown or hidden.
|
|
1235
|
+
* The event payload is a boolean: `true` when the menu was opened, `false` when it was closed.
|
|
1236
|
+
**/
|
|
1237
|
+
toggleMenu;
|
|
1238
|
+
root;
|
|
830
1239
|
connectedCallback() {
|
|
831
1240
|
this.root = getRoot.getRoot(this.host);
|
|
832
1241
|
this.host.addEventListener('keydown', this.handleKeyDown);
|
|
@@ -846,7 +1255,12 @@ const PostMenu = class {
|
|
|
846
1255
|
* Toggles the menu visibility based on its current state.
|
|
847
1256
|
*/
|
|
848
1257
|
async toggle(target) {
|
|
849
|
-
this.isVisible
|
|
1258
|
+
if (this.isVisible) {
|
|
1259
|
+
await this.hide();
|
|
1260
|
+
}
|
|
1261
|
+
else {
|
|
1262
|
+
await this.show(target);
|
|
1263
|
+
}
|
|
850
1264
|
}
|
|
851
1265
|
/**
|
|
852
1266
|
* Displays the popover menu, focusing the first menu item.
|
|
@@ -880,6 +1294,22 @@ const PostMenu = class {
|
|
|
880
1294
|
console.error('hide: popoverRef is null or undefined');
|
|
881
1295
|
}
|
|
882
1296
|
}
|
|
1297
|
+
handleKeyDown = (e) => {
|
|
1298
|
+
e.stopPropagation();
|
|
1299
|
+
if (e.key === this.KEYCODES.ESCAPE) {
|
|
1300
|
+
this.toggle(this.host);
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
if (Object.values(this.KEYCODES).includes(e.key)) {
|
|
1304
|
+
this.controlKeyDownHandler(e);
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
handleClick = (e) => {
|
|
1308
|
+
const target = e.target;
|
|
1309
|
+
if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
|
1310
|
+
this.toggle(this.host);
|
|
1311
|
+
}
|
|
1312
|
+
};
|
|
883
1313
|
controlKeyDownHandler(e) {
|
|
884
1314
|
const menuItems = this.getSlottedItems();
|
|
885
1315
|
if (!menuItems.length) {
|
|
@@ -928,9 +1358,8 @@ const PostMenu = class {
|
|
|
928
1358
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
929
1359
|
}
|
|
930
1360
|
render() {
|
|
931
|
-
return (index.h(index.Host, { key: '
|
|
1361
|
+
return (index.h(index.Host, { key: '071532c327f80197dda662f77e5cb2444281087d', "data-version": _package.version }, index.h("post-popovercontainer", { key: '9f70ca4009139e0547026b26be610a02f4f1a95a', placement: this.placement, ref: e => (this.popoverRef = e) }, index.h("div", { key: '3ff1048a8fb27402a82cedc3dc300366063c9601', class: "popover-container", part: "popover-container" }, index.h("slot", { key: 'bed6c96b7502e0032b746ac6fdf8c3dd6d782e48' })))));
|
|
932
1362
|
}
|
|
933
|
-
get host() { return index.getElement(this); }
|
|
934
1363
|
};
|
|
935
1364
|
PostMenu.style = PostMenuStyle0;
|
|
936
1365
|
|
|
@@ -940,20 +1369,22 @@ const PostMenuTriggerStyle0 = postMenuTriggerCss;
|
|
|
940
1369
|
const PostMenuTrigger = class {
|
|
941
1370
|
constructor(hostRef) {
|
|
942
1371
|
index.registerInstance(this, hostRef);
|
|
943
|
-
/**
|
|
944
|
-
* Reference to the slotted button within the trigger, if present.
|
|
945
|
-
* Used to manage click and key events for menu control.
|
|
946
|
-
*/
|
|
947
|
-
this.slottedButton = null;
|
|
948
|
-
this.handleKeyDown = (e) => {
|
|
949
|
-
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
950
|
-
e.preventDefault();
|
|
951
|
-
this.handleToggle();
|
|
952
|
-
}
|
|
953
|
-
};
|
|
954
|
-
this.for = undefined;
|
|
955
|
-
this.ariaExpanded = false;
|
|
956
1372
|
}
|
|
1373
|
+
/**
|
|
1374
|
+
* ID of the menu element that this trigger is linked to. Used to open and close the specified menu.
|
|
1375
|
+
*/
|
|
1376
|
+
for;
|
|
1377
|
+
get host() { return index.getElement(this); }
|
|
1378
|
+
/**
|
|
1379
|
+
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated menu is expanded or collapsed.
|
|
1380
|
+
*/
|
|
1381
|
+
ariaExpanded = false;
|
|
1382
|
+
/**
|
|
1383
|
+
* Reference to the slotted button within the trigger, if present.
|
|
1384
|
+
* Used to manage click and key events for menu control.
|
|
1385
|
+
*/
|
|
1386
|
+
slottedButton = null;
|
|
1387
|
+
root;
|
|
957
1388
|
/**
|
|
958
1389
|
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
959
1390
|
* @param forValue - The new value of the `for` property.
|
|
@@ -976,6 +1407,12 @@ const PostMenuTrigger = class {
|
|
|
976
1407
|
console.warn(`No post-menu found with ID: ${this.for}`);
|
|
977
1408
|
}
|
|
978
1409
|
}
|
|
1410
|
+
handleKeyDown = (e) => {
|
|
1411
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
1412
|
+
e.preventDefault();
|
|
1413
|
+
this.handleToggle();
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
979
1416
|
componentDidLoad() {
|
|
980
1417
|
this.root = getRoot.getRoot(this.host);
|
|
981
1418
|
this.validateControlFor();
|
|
@@ -1002,9 +1439,8 @@ const PostMenuTrigger = class {
|
|
|
1002
1439
|
}
|
|
1003
1440
|
}
|
|
1004
1441
|
render() {
|
|
1005
|
-
return (index.h(index.Host, { key: '
|
|
1442
|
+
return (index.h(index.Host, { key: 'a0fff619978087ce0c67d7d327982424e3784ff0', "data-version": _package.version, "tab-index": "-1" }, index.h("slot", { key: '93e26150b59e9a01275a6815096e09ff5fac146b' })));
|
|
1006
1443
|
}
|
|
1007
|
-
get host() { return index.getElement(this); }
|
|
1008
1444
|
static get watchers() { return {
|
|
1009
1445
|
"for": ["validateControlFor"]
|
|
1010
1446
|
}; }
|
|
@@ -3113,7 +3549,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
3113
3549
|
}
|
|
3114
3550
|
`,E=null;function I(e){if(E===null)try{E=new CSSStyleSheet,E.replaceSync(C);}catch{E=!1;}if(E===!1){let t=document.createElement("style");t.textContent=C,e instanceof Document?e.head.prepend(t):e.prepend(t);}else e.adoptedStyleSheets=[E,...e.adoptedStyleSheets];}function K(){window.ToggleEvent=window.ToggleEvent||c;function e(n){return n?.includes(":popover-open")&&(n=n.replace(J,"$1.\\:popover-open")),n}f(Document.prototype,"querySelector",e),f(Document.prototype,"querySelectorAll",e),f(Element.prototype,"querySelector",e),f(Element.prototype,"querySelectorAll",e),f(Element.prototype,"matches",e),f(Element.prototype,"closest",e),f(DocumentFragment.prototype,"querySelectorAll",e),f(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let n=(this.getAttribute("popover")||"").toLowerCase();return n===""||n=="auto"?"auto":"manual"},set(n){this.setAttribute("popover",n);}},showPopover:{enumerable:!0,configurable:!0,value(){S(this);}},hidePopover:{enumerable:!0,configurable:!0,value(){m(this,!0,!0);}},togglePopover:{enumerable:!0,configurable:!0,value(n){h.get(this)==="showing"&&n===void 0||n===!1?m(this,!0,!0):(n===void 0||n===!0)&&S(this);}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(n){let s=t.call(this,n);return I(s),s}}});let o=HTMLElement.prototype.attachInternals;o&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let n=o.call(this);return n.shadowRoot&&I(n.shadowRoot),n}}});let r=new WeakMap;function i(n){Object.defineProperties(n.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(s){if(s===null)this.removeAttribute("popovertarget"),r.delete(this);else if(s instanceof Element)this.setAttribute("popovertarget",""),r.set(this,s);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let s=r.get(this);if(s&&s.isConnected)return s;if(s&&!s.isConnected)return r.delete(this),null;let u=v(this),w=this.getAttribute("popovertarget");return (u instanceof Document||u instanceof B)&&w&&u.getElementById(w)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let s=(this.getAttribute("popovertargetaction")||"").toLowerCase();return s==="show"||s==="hide"?s:"toggle"},set(s){this.setAttribute("popovertargetaction",s);}}});}i(HTMLButtonElement),i(HTMLInputElement);let l=n=>{if(!n.isTrusted)return;let s=n.composedPath()[0];if(!(s instanceof Element)||s?.shadowRoot)return;let u=v(s);if(!(u instanceof B||u instanceof Document))return;let w=s.closest("[popovertargetaction],[popovertarget]");if(w){O(w),n.preventDefault();return}},a=n=>{let s=n.key,u=n.target;!n.defaultPrevented&&u&&(s==="Escape"||s==="Esc")&&T(u.ownerDocument,!0,!0);};(n=>{n.addEventListener("click",l),n.addEventListener("keydown",a),n.addEventListener("pointerdown",x),n.addEventListener("pointerup",x);})(document),I(document);}j()||K();})();
|
|
3115
3551
|
|
|
3116
|
-
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow
|
|
3552
|
+
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow:var(--post-device-elevation-300);background:var(--post-current-palette-bg);color:var(--post-current-palette-fg);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer):not(:has(.arrow)){box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow){filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top){filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left){filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right){filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
|
|
3117
3553
|
const PostPopovercontainerStyle0 = postPopovercontainerCss;
|
|
3118
3554
|
|
|
3119
3555
|
const SIDE_MAP = {
|
|
@@ -3126,12 +3562,35 @@ const PostPopovercontainer = class {
|
|
|
3126
3562
|
constructor(hostRef) {
|
|
3127
3563
|
index.registerInstance(this, hostRef);
|
|
3128
3564
|
this.postToggle = index.createEvent(this, "postToggle", 7);
|
|
3129
|
-
this.placement = 'top';
|
|
3130
|
-
this.edgeGap = 8;
|
|
3131
|
-
this.arrow = false;
|
|
3132
3565
|
}
|
|
3566
|
+
get host() { return index.getElement(this); }
|
|
3567
|
+
arrowRef;
|
|
3568
|
+
eventTarget;
|
|
3569
|
+
clearAutoUpdate;
|
|
3570
|
+
toggleTimeoutId;
|
|
3571
|
+
/**
|
|
3572
|
+
* Fires whenever the popover gets shown or hidden, passing the new state in event.details as a boolean
|
|
3573
|
+
*/
|
|
3574
|
+
postToggle;
|
|
3575
|
+
/**
|
|
3576
|
+
* Whether or not the popover should close when user clicks outside of it
|
|
3577
|
+
*/
|
|
3578
|
+
manualClose = false;
|
|
3579
|
+
/**
|
|
3580
|
+
* Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
3581
|
+
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
3582
|
+
* towards the viewport if they would overlap edge boundaries.
|
|
3583
|
+
*/
|
|
3584
|
+
placement = 'top';
|
|
3585
|
+
/**
|
|
3586
|
+
* Gap between the edge of the page and the popover
|
|
3587
|
+
*/
|
|
3588
|
+
edgeGap = 8;
|
|
3589
|
+
/**
|
|
3590
|
+
* Wheter or not to display a little pointer arrow
|
|
3591
|
+
*/
|
|
3592
|
+
arrow = false;
|
|
3133
3593
|
componentDidLoad() {
|
|
3134
|
-
this.host.setAttribute('popover', '');
|
|
3135
3594
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
3136
3595
|
}
|
|
3137
3596
|
disconnectedCallback() {
|
|
@@ -3249,11 +3708,10 @@ const PostPopovercontainer = class {
|
|
|
3249
3708
|
}
|
|
3250
3709
|
}
|
|
3251
3710
|
render() {
|
|
3252
|
-
return (index.h(index.Host, { key: '
|
|
3711
|
+
return (index.h(index.Host, { key: '6bebf9ab3013796d0eebb3d543411a0e80d2e913', "data-version": _package.version, popover: this.manualClose ? 'manual' : 'auto' }, this.arrow && (index.h("span", { key: 'd6eca10452a54073a293128e8faf76e45e35c4c5', class: "arrow", ref: el => {
|
|
3253
3712
|
this.arrowRef = el;
|
|
3254
|
-
} })), index.h("slot", { key: '
|
|
3713
|
+
} })), index.h("slot", { key: '3b6674dfa1b3ffac10c6640717c7ae713577c965' })));
|
|
3255
3714
|
}
|
|
3256
|
-
get host() { return index.getElement(this); }
|
|
3257
3715
|
};
|
|
3258
3716
|
PostPopovercontainer.style = PostPopovercontainerStyle0;
|
|
3259
3717
|
|
|
@@ -3263,18 +3721,12 @@ const PostTogglebuttonStyle0 = postTogglebuttonCss;
|
|
|
3263
3721
|
const PostTogglebutton = class {
|
|
3264
3722
|
constructor(hostRef) {
|
|
3265
3723
|
index.registerInstance(this, hostRef);
|
|
3266
|
-
this.handleClick = () => {
|
|
3267
|
-
this.toggled = !this.toggled;
|
|
3268
|
-
};
|
|
3269
|
-
this.handleKeydown = (event) => {
|
|
3270
|
-
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
3271
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
3272
|
-
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
3273
|
-
this.host.click();
|
|
3274
|
-
}
|
|
3275
|
-
};
|
|
3276
|
-
this.toggled = false;
|
|
3277
3724
|
}
|
|
3725
|
+
get host() { return index.getElement(this); }
|
|
3726
|
+
/**
|
|
3727
|
+
* If `true`, the button is in the "on" state, otherwise it is in the "off" state.
|
|
3728
|
+
*/
|
|
3729
|
+
toggled = false;
|
|
3278
3730
|
validateToggled(value = this.toggled) {
|
|
3279
3731
|
checkType.checkType(value, 'boolean', 'The "toggled" property of the post-togglebutton must be a boolean.');
|
|
3280
3732
|
}
|
|
@@ -3284,10 +3736,19 @@ const PostTogglebutton = class {
|
|
|
3284
3736
|
this.host.addEventListener('click', () => this.handleClick());
|
|
3285
3737
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
3286
3738
|
}
|
|
3739
|
+
handleClick = () => {
|
|
3740
|
+
this.toggled = !this.toggled;
|
|
3741
|
+
};
|
|
3742
|
+
handleKeydown = (event) => {
|
|
3743
|
+
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
3744
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
3745
|
+
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
3746
|
+
this.host.click();
|
|
3747
|
+
}
|
|
3748
|
+
};
|
|
3287
3749
|
render() {
|
|
3288
|
-
return (index.h(index.Host, { key: '
|
|
3750
|
+
return (index.h(index.Host, { key: 'e4974336def6dbf244b3d63b9aa00e2e7bce1920', "data-version": _package.version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, index.h("slot", { key: 'b1179664b0f0651865e973c7afe951102b048877' })));
|
|
3289
3751
|
}
|
|
3290
|
-
get host() { return index.getElement(this); }
|
|
3291
3752
|
static get watchers() { return {
|
|
3292
3753
|
"toggled": ["validateToggled"]
|
|
3293
3754
|
}; }
|