@swisspost/design-system-components 9.0.0-next.13 → 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/cjs/{index-f1b08cdb.js → index-0ee3ab4a.js} +334 -152
- package/dist/cjs/index.cjs.js +22 -20
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-60e57542.js → package-7d11b6ea.js} +1 -1
- package/dist/cjs/{post-accordion-1e495c23.js → post-accordion-29861d97.js} +11 -5
- package/dist/cjs/{post-accordion-item-86b6950a.js → post-accordion-item-0da0f7aa.js} +15 -8
- package/dist/cjs/post-accordion-item.cjs.entry.js +3 -3
- package/dist/cjs/post-accordion.cjs.entry.js +3 -3
- package/dist/cjs/{post-avatar-067c033b.js → post-avatar-01b9cd6d.js} +23 -11
- 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 +3 -3
- package/dist/cjs/post-banner-33929088.js +110 -0
- package/dist/cjs/post-banner.cjs.entry.js +3 -3
- package/dist/cjs/{post-breadcrumb-b33abf67.js → post-breadcrumb-1384018e.js} +15 -9
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +3 -3
- package/dist/cjs/post-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/{post-card-control-7867a104.js → post-card-control-4c85eda3.js} +45 -14
- package/dist/cjs/post-card-control.cjs.entry.js +3 -3
- package/dist/cjs/post-closebutton_15.cjs.entry.js +3 -3
- package/dist/cjs/{post-collapsible-trigger-6affdc02.js → post-collapsible-trigger-0fb2596a.js} +11 -5
- package/dist/cjs/post-collapsible_2.cjs.entry.js +3 -3
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/{post-footer-330e8999.js → post-footer-f621a563.js} +8 -5
- 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-48191dfd.js → post-menu-item-ab3e2e7e.js} +8 -5
- package/dist/cjs/{post-popover-27f3e9aa.js → post-popover-a2ba9226.js} +18 -6
- package/dist/cjs/post-popover.cjs.entry.js +3 -3
- package/dist/cjs/{post-rating-28904e91.js → post-rating-c402c294.js} +21 -8
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-86b129ab.js → post-tab-header-c819517d.js} +8 -5
- package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-panel-94333a7e.js → post-tab-panel-3cb207f3.js} +8 -5
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-f8581050.js → post-tabs-b6fa39c3.js} +10 -4
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{post-tag-3a24c574.js → post-tag-9c366519.js} +18 -7
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-e7d697bf.js → post-togglebutton-d49bec2c.js} +515 -132
- package/dist/cjs/{post-tooltip-8c87dfe3.js → post-tooltip-425c01ba.js} +17 -6
- package/dist/cjs/post-tooltip.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/post-accordion/post-accordion.js +13 -5
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +17 -8
- package/dist/collection/components/post-avatar/post-avatar.js +29 -11
- 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 +9 -5
- package/dist/collection/components/post-banner/post-banner.css +1 -1
- package/dist/collection/components/post-banner/post-banner.js +34 -14
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +17 -9
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +7 -4
- package/dist/collection/components/post-card-control/post-card-control.js +61 -12
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +7 -4
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +6 -3
- package/dist/collection/components/post-footer/post-footer.js +8 -5
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +82 -8
- package/dist/collection/components/post-icon/post-icon.js +43 -10
- package/dist/collection/components/post-language-option/post-language-option.js +32 -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 +22 -6
- 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 +17 -6
- package/dist/collection/components/post-list-item/post-list-item.js +1 -1
- package/dist/collection/components/post-logo/post-logo.js +7 -4
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +193 -19
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +124 -66
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +12 -6
- package/dist/collection/components/post-menu/post-menu.js +15 -5
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +11 -5
- package/dist/collection/components/post-popover/post-popover.js +22 -4
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +46 -8
- package/dist/collection/components/post-rating/post-rating.js +27 -6
- package/dist/collection/components/post-tab-header/post-tab-header.js +8 -5
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +8 -5
- package/dist/collection/components/post-tabs/post-tabs.js +10 -4
- package/dist/collection/components/post-tag/post-tag.js +22 -5
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +7 -4
- package/dist/collection/components/post-tooltip/post-tooltip.js +21 -6
- package/dist/collection/index.js +1 -0
- package/dist/components/index.js +36 -35
- package/dist/components/{post-collapsible-trigger2.js → p-05590ac0.js} +11 -8
- package/dist/components/{post-breadcrumb2.js → p-146677d1.js} +26 -20
- 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} +15 -9
- package/dist/components/{post-tooltip2.js → p-2d9b46b4.js} +21 -10
- package/dist/components/{post-card-control2.js → p-38778a14.js} +49 -18
- package/dist/components/p-3aba7629.js +29 -0
- package/dist/components/{post-togglebutton2.js → p-3cee636a.js} +9 -6
- 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/dist/components/{post-list2.js → p-536eba02.js} +17 -8
- package/dist/components/p-5653923a.js +44 -0
- package/dist/components/{post-footer2.js → p-58878996.js} +13 -10
- package/dist/components/{post-logo2.js → p-5f51ec58.js} +9 -6
- package/{loaders/post-popovercontainer2.js → dist/components/p-60cf53cc.js} +25 -10
- package/{loaders/post-accordion-item2.js → dist/components/p-68ecd276.js} +22 -15
- package/dist/components/{post-tab-header2.js → p-75b8b652.js} +11 -8
- package/dist/components/{post-tab-panel2.js → p-78e1d893.js} +10 -7
- package/dist/components/{post-menu-trigger2.js → p-8b053fd5.js} +14 -8
- package/dist/components/{post-icon2.js → p-91031e3b.js} +35 -14
- package/{loaders/post-menu2.js → dist/components/p-91882483.js} +19 -36
- package/dist/components/{post-list-item2.js → p-9e4b1f10.js} +3 -3
- package/dist/components/{post-accordion2.js → p-a3a004e6.js} +14 -8
- package/dist/components/{post-popover2.js → p-af23f7de.js} +21 -9
- package/dist/components/{post-collapsible2.js → p-b018d864.js} +9 -6
- package/dist/components/{check-non-empty.js → p-b095519d.js} +1 -1
- package/dist/components/{post-closebutton2.js → p-bf14d264.js} +5 -5
- package/dist/components/{post-breadcrumb-item2.js → p-c7c1d466.js} +10 -7
- package/dist/components/{post-tag2.js → p-cab43cee.js} +20 -9
- package/{loaders/post-menu-item2.js → dist/components/p-ccccf0c3.js} +4 -4
- package/dist/components/{post-tabs2.js → p-ce854a7d.js} +12 -6
- package/dist/components/{post-avatar2.js → p-d3fb70af.js} +25 -13
- package/dist/components/{post-language-option2.js → p-d47bb5bf.js} +27 -11
- package/dist/components/{post-back-to-top2.js → p-e20366a6.js} +15 -11
- package/dist/components/{index2.js → p-eabb09ad.js} +3 -3
- package/dist/components/{post-language-switch2.js → p-f6d80d76.js} +27 -15
- package/dist/components/p-f7b9f90a.js +135 -0
- package/dist/components/{post-rating2.js → p-fc59de7c.js} +23 -10
- 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 +333 -149
- package/dist/esm/{index-6bfe6554.js → index-2c232bf2.js} +334 -152
- package/dist/esm/index.js +21 -20
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-8c98af5e.js +3 -0
- package/dist/esm/{post-accordion-48eb17c3.js → post-accordion-49fba403.js} +11 -5
- package/dist/esm/{post-accordion-item-e0893bb3.js → post-accordion-item-c516517a.js} +15 -8
- package/dist/esm/post-accordion-item.entry.js +3 -3
- package/dist/esm/post-accordion.entry.js +3 -3
- package/dist/esm/{post-avatar-20cde806.js → post-avatar-b527ac63.js} +23 -11
- 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 +3 -3
- package/dist/esm/post-banner-0ad7758b.js +108 -0
- package/dist/esm/post-banner.entry.js +3 -3
- package/dist/esm/{post-breadcrumb-39203792.js → post-breadcrumb-57bca9dd.js} +15 -9
- package/dist/esm/post-breadcrumb-item_2.entry.js +3 -3
- package/dist/esm/post-breadcrumb.entry.js +3 -3
- package/dist/esm/{post-card-control-d2c25c96.js → post-card-control-ea741f60.js} +45 -14
- package/dist/esm/post-card-control.entry.js +3 -3
- package/dist/esm/post-closebutton_15.entry.js +3 -3
- package/dist/esm/{post-collapsible-trigger-2f9ad9a5.js → post-collapsible-trigger-31155750.js} +11 -5
- package/dist/esm/post-collapsible_2.entry.js +3 -3
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/{post-footer-e804a967.js → post-footer-cdde2086.js} +8 -5
- 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-f9793958.js → post-menu-item-db732728.js} +8 -5
- package/dist/esm/{post-popover-8205412a.js → post-popover-00f427ac.js} +18 -6
- package/dist/esm/post-popover.entry.js +3 -3
- package/dist/esm/{post-rating-95ecb434.js → post-rating-cdcb2a1d.js} +21 -8
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-d520b99a.js → post-tab-header-1d4113cb.js} +8 -5
- package/dist/esm/post-tab-header.entry.js +3 -3
- package/dist/esm/{post-tab-panel-8c8d2332.js → post-tab-panel-7a5c03ef.js} +8 -5
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-dd6dfe43.js → post-tabs-308190c0.js} +10 -4
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/{post-tag-593813a4.js → post-tag-aebbda10.js} +18 -7
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-120df903.js → post-togglebutton-95ba85d2.js} +515 -132
- package/dist/esm/{post-tooltip-a13d6fbb.js → post-tooltip-918d3a54.js} +17 -6
- package/dist/esm/post-tooltip.entry.js +3 -3
- 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-2083ae2c.js +1 -0
- package/dist/post-components/p-24297444.js +1 -0
- package/dist/post-components/{p-4fc83a1c.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-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-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-a72cb18c.js → p-7c9758fa.js} +1 -1
- 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-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-92f8803c.entry.js → p-b0afc087.entry.js} +1 -1
- 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-d6449a93.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/components/post-header/post-header.d.ts +11 -2
- 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.d.ts +49 -23
- package/dist/types/index.d.ts +3 -2
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/loaders/index.d.ts +2 -0
- package/loaders/index.js +3 -2
- package/loaders/{post-collapsible-trigger2.js → p-05590ac0.js} +11 -8
- package/loaders/{post-breadcrumb-item2.js → p-1beacb73.js} +10 -7
- package/loaders/p-2083ae2c.js +3 -0
- package/loaders/p-3aba7629.js +29 -0
- package/loaders/p-3e8554e7.js +1646 -0
- package/loaders/{index2.js → p-56ad4838.js} +3 -3
- package/{dist/components/post-popovercontainer2.js → loaders/p-60cf53cc.js} +25 -10
- package/{dist/components/post-accordion-item2.js → loaders/p-83baa315.js} +22 -15
- package/loaders/{post-menu-trigger2.js → p-8b053fd5.js} +14 -8
- package/{dist/components/post-menu2.js → loaders/p-91882483.js} +19 -36
- package/loaders/{post-collapsible2.js → p-9fac5d7d.js} +9 -6
- package/loaders/{check-non-empty.js → p-b095519d.js} +1 -1
- package/{dist/components/post-menu-item2.js → loaders/p-ccccf0c3.js} +4 -4
- package/loaders/{post-icon2.js → p-f7177e26.js} +35 -14
- package/loaders/p-f7b9f90a.js +135 -0
- package/loaders/post-accordion-item.js +1 -1
- package/loaders/post-accordion.js +14 -8
- package/loaders/post-avatar.js +25 -13
- package/loaders/post-back-to-top.js +15 -11
- package/loaders/post-banner.js +36 -22
- package/loaders/post-breadcrumb-item.js +1 -1
- package/loaders/post-breadcrumb.js +26 -20
- package/loaders/post-card-control.js +49 -18
- package/loaders/post-closebutton.js +5 -5
- package/loaders/post-collapsible-trigger.js +1 -1
- package/loaders/post-collapsible.js +1 -1
- package/loaders/post-footer.js +13 -10
- package/loaders/post-header.js +65 -145
- package/loaders/post-icon.js +1 -1
- package/loaders/post-language-option.js +27 -11
- package/loaders/post-language-switch.js +27 -15
- package/loaders/post-linkarea.d.ts +11 -0
- package/loaders/post-linkarea.js +47 -0
- package/loaders/post-list-item.js +3 -3
- package/loaders/post-list.js +17 -8
- package/loaders/post-logo.js +9 -6
- package/loaders/post-mainnavigation.js +193 -9
- package/loaders/post-megadropdown-trigger.js +15 -9
- package/loaders/post-megadropdown.js +108 -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 +21 -9
- package/loaders/post-popovercontainer.js +1 -1
- package/loaders/post-rating.js +23 -10
- package/loaders/post-tab-header.js +11 -8
- package/loaders/post-tab-panel.js +10 -7
- package/loaders/post-tabs.js +12 -6
- package/loaders/post-tag.js +20 -9
- package/loaders/post-togglebutton.js +9 -6
- package/loaders/post-tooltip.js +21 -10
- package/package.json +10 -11
- package/dist/cjs/post-back-to-top-7efd1066.js +0 -76
- package/dist/cjs/post-banner-a6808d7d.js +0 -96
- package/dist/components/package.js +0 -3
- package/dist/components/post-banner2.js +0 -131
- package/dist/components/post-header2.js +0 -279
- package/dist/components/post-mainnavigation2.js +0 -53
- package/dist/components/post-megadropdown2.js +0 -111
- package/dist/esm/package-495dba42.js +0 -3
- package/dist/esm/post-back-to-top-e422c426.js +0 -74
- package/dist/esm/post-banner-7385397e.js +0 -94
- package/dist/post-components/p-0b613350.js +0 -1
- package/dist/post-components/p-0e216cc4.js +0 -2
- package/dist/post-components/p-20e1b680.js +0 -1
- package/dist/post-components/p-29bc8ddc.entry.js +0 -1
- package/dist/post-components/p-2b4c7ec7.entry.js +0 -1
- package/dist/post-components/p-2f327006.entry.js +0 -1
- package/dist/post-components/p-3632ace7.js +0 -1
- package/dist/post-components/p-3a978ea9.entry.js +0 -1
- package/dist/post-components/p-3d4fdde0.js +0 -1
- package/dist/post-components/p-427132e3.entry.js +0 -1
- package/dist/post-components/p-445dfa96.js +0 -1
- package/dist/post-components/p-4c0c13a9.js +0 -1
- package/dist/post-components/p-5384e6f4.js +0 -1
- package/dist/post-components/p-5630677a.entry.js +0 -1
- package/dist/post-components/p-5e5ee06d.entry.js +0 -1
- package/dist/post-components/p-68c43ef0.entry.js +0 -1
- package/dist/post-components/p-6e39bb59.entry.js +0 -1
- package/dist/post-components/p-6fede961.js +0 -1
- package/dist/post-components/p-72a5ee9b.js +0 -1
- package/dist/post-components/p-72d9d594.entry.js +0 -1
- package/dist/post-components/p-85bf673e.entry.js +0 -1
- package/dist/post-components/p-8decb072.entry.js +0 -1
- package/dist/post-components/p-9596c7d6.js +0 -1
- package/dist/post-components/p-975b30f5.js +0 -1
- package/dist/post-components/p-9a50697e.entry.js +0 -1
- package/dist/post-components/p-aaca7ca7.js +0 -1
- package/dist/post-components/p-ac2189b7.js +0 -1
- package/dist/post-components/p-afe3b28e.js +0 -1
- package/dist/post-components/p-b129c166.js +0 -1
- package/dist/post-components/p-bd49bb7e.entry.js +0 -1
- package/dist/post-components/p-c043686c.entry.js +0 -1
- package/dist/post-components/p-c8544b65.js +0 -1
- package/dist/post-components/p-c9f65844.entry.js +0 -1
- package/dist/post-components/p-f7c5b0c2.js +0 -1
- 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/{slide.js → p-4af6dbed.js} +0 -0
- /package/dist/components/{index.browser.js → p-5959f2bd.js} +0 -0
- /package/dist/components/{fade.js → p-64e3de38.js} +0 -0
- /package/dist/components/{check-type.js → p-8562c7dc.js} +0 -0
- /package/dist/components/{attribute-observer.js → p-9748a355.js} +0 -0
- /package/dist/components/{check-one-of.js → p-bacd3e2c.js} +0 -0
- /package/dist/components/{debounce.js → p-e1baac59.js} +0 -0
- /package/dist/components/{get-root.js → p-fc91cbc2.js} +0 -0
- /package/loaders/{heading-levels.js → p-247a1668.js} +0 -0
- /package/loaders/{constants.js → p-440193f4.js} +0 -0
- /package/loaders/{slide.js → p-4af6dbed.js} +0 -0
- /package/loaders/{index.browser.js → p-5959f2bd.js} +0 -0
- /package/loaders/{fade.js → p-64e3de38.js} +0 -0
- /package/loaders/{check-type.js → p-8562c7dc.js} +0 -0
- /package/loaders/{attribute-observer.js → p-9748a355.js} +0 -0
- /package/loaders/{check-one-of.js → p-bacd3e2c.js} +0 -0
- /package/loaders/{debounce.js → p-e1baac59.js} +0 -0
- /package/loaders/{get-root.js → p-fc91cbc2.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, g as getElement, h, H as Host, c as createEvent } from './index-
|
|
2
|
-
import { v as version } from './package-
|
|
1
|
+
import { r as registerInstance, g as getElement, h, H as Host, c as createEvent } from './index-2c232bf2.js';
|
|
2
|
+
import { v as version } from './package-8c98af5e.js';
|
|
3
3
|
import { s as slideUp, a as slideDown } from './slide-62768431.js';
|
|
4
4
|
import { c as checkEmptyOrOneOf, d as checkEmptyOrType, b as checkEmptyOrUrl } from './index-d1bbbd88.js';
|
|
5
5
|
import { c as checkNonEmpty } from './check-non-empty-58bd6b17.js';
|
|
@@ -13,7 +13,7 @@ const PostClosebutton = class {
|
|
|
13
13
|
}
|
|
14
14
|
get host() { return getElement(this); }
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: 'c03f50379252ba13992bc3d021989ac07dba9f79', "data-version": version }, h("button", { key: 'e97a86bb6e1eace89a1a3a78fb231047f065dd5e', class: "btn btn-icon-close", type: "button" }, h("post-icon", { key: 'aca522d4c251a8183c91c2bd4d810d0716a2fe13', "aria-hidden": "true", name: "closex" }), h("span", { key: '6873522961b1683d1261163b07ee022f93eed836', class: "visually-hidden" }, h("slot", { key: 'bf4b13356c9a0164f1481d1fedc3a78a53e5f8e0' })))));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -151,15 +151,44 @@ function throttle (delay, callback, options) {
|
|
|
151
151
|
return wrapper;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
const
|
|
154
|
+
const focusableSelector = `:where(${[
|
|
155
|
+
'button',
|
|
156
|
+
'input:not([type="hidden"])',
|
|
157
|
+
'[tabindex]',
|
|
158
|
+
'select',
|
|
159
|
+
'textarea',
|
|
160
|
+
'[contenteditable]',
|
|
161
|
+
'a[href]',
|
|
162
|
+
'iframe',
|
|
163
|
+
'audio[controls]',
|
|
164
|
+
'video[controls]',
|
|
165
|
+
'area[href]',
|
|
166
|
+
'details > summary:first-of-type',
|
|
167
|
+
].join(',')})`;
|
|
168
|
+
const focusDisablingSelector = `:where(${[
|
|
169
|
+
'[inert]',
|
|
170
|
+
'[inert] *',
|
|
171
|
+
':disabled',
|
|
172
|
+
'dialog:not([open]) *',
|
|
173
|
+
'[popover]:not(:popover-open) *',
|
|
174
|
+
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
175
|
+
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
176
|
+
'[tabindex^="-"]',
|
|
177
|
+
].join(',')})`;
|
|
178
|
+
function getFocusableChildren(element) {
|
|
179
|
+
return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
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)}}";
|
|
155
183
|
const PostHeaderStyle0 = postHeaderCss;
|
|
156
184
|
|
|
157
185
|
const PostHeader = class {
|
|
158
186
|
constructor(hostRef) {
|
|
159
187
|
registerInstance(this, hostRef);
|
|
160
|
-
this.
|
|
161
|
-
this.mobileMenuExtended = false;
|
|
188
|
+
this.postUpdateDevice = createEvent(this, "postUpdateDevice", 7);
|
|
162
189
|
}
|
|
190
|
+
firstFocusableEl;
|
|
191
|
+
lastFocusableEl;
|
|
163
192
|
scrollParent = null;
|
|
164
193
|
mobileMenu;
|
|
165
194
|
mobileMenuAnimation;
|
|
@@ -171,11 +200,28 @@ const PostHeader = class {
|
|
|
171
200
|
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
172
201
|
this.handleResize();
|
|
173
202
|
this.handleScrollEvent();
|
|
203
|
+
this.getFocusableElements();
|
|
174
204
|
}
|
|
175
205
|
get host() { return getElement(this); }
|
|
206
|
+
device = null;
|
|
207
|
+
mobileMenuExtended = false;
|
|
176
208
|
frozeBody(isMobileMenuExtended) {
|
|
177
209
|
document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
|
|
210
|
+
if (isMobileMenuExtended) {
|
|
211
|
+
this.host.addEventListener('keydown', e => {
|
|
212
|
+
this.keyboardHandler(e);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
this.host.removeEventListener('keydown', e => {
|
|
217
|
+
this.keyboardHandler(e);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
178
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* An event emitted when the device has changed
|
|
223
|
+
*/
|
|
224
|
+
postUpdateDevice;
|
|
179
225
|
/**
|
|
180
226
|
* Toggles the mobile navigation.
|
|
181
227
|
*/
|
|
@@ -195,6 +241,36 @@ const PostHeader = class {
|
|
|
195
241
|
if (!this.mobileMenuExtended)
|
|
196
242
|
await this.mobileMenuAnimation.finished;
|
|
197
243
|
}
|
|
244
|
+
// Get all the focusable elements in the post-header mobile menu
|
|
245
|
+
getFocusableElements() {
|
|
246
|
+
// Get elements in the correct order (different as the DOM order)
|
|
247
|
+
const focusableEls = [
|
|
248
|
+
...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
|
|
249
|
+
...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-mainnavigation > .back-button, post-megadropdown-trigger')),
|
|
250
|
+
...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
|
|
251
|
+
];
|
|
252
|
+
// Add the main toggle menu button to the list of focusable children
|
|
253
|
+
const focusableChildren = [
|
|
254
|
+
this.host.querySelector('post-togglebutton'),
|
|
255
|
+
...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
|
|
256
|
+
];
|
|
257
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
258
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
259
|
+
}
|
|
260
|
+
keyboardHandler(e) {
|
|
261
|
+
if (e.key === 'Tab' && this.mobileMenuExtended) {
|
|
262
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
263
|
+
// If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
264
|
+
e.preventDefault();
|
|
265
|
+
this.lastFocusableEl.focus();
|
|
266
|
+
}
|
|
267
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
268
|
+
// If Tab and last element is focused, focus goes back to the first element of the megadropdown
|
|
269
|
+
e.preventDefault();
|
|
270
|
+
this.firstFocusableEl.focus();
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
198
274
|
handleScrollEvent() {
|
|
199
275
|
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
200
276
|
const st = Math.max(0, this.scrollParent instanceof Document
|
|
@@ -243,11 +319,12 @@ const PostHeader = class {
|
|
|
243
319
|
this.toggleMobileMenu();
|
|
244
320
|
this.mobileMenuAnimation.finish(); // no animation
|
|
245
321
|
}
|
|
246
|
-
const mhh = this.host.shadowRoot.querySelector('.
|
|
322
|
+
const mhh = this.host.shadowRoot.querySelector('.local-header')?.clientHeight;
|
|
247
323
|
this.host.style.setProperty('--main-header-height', `${mhh}px`);
|
|
248
324
|
// Apply only on change for doing work only when necessary
|
|
249
325
|
if (newDevice !== previousDevice) {
|
|
250
326
|
this.device = newDevice;
|
|
327
|
+
this.postUpdateDevice.emit(this.device);
|
|
251
328
|
window.requestAnimationFrame(() => {
|
|
252
329
|
this.switchLanguageSwitchMode();
|
|
253
330
|
});
|
|
@@ -257,12 +334,15 @@ const PostHeader = class {
|
|
|
257
334
|
const variant = this.device === 'desktop' ? 'menu' : 'list';
|
|
258
335
|
this.host.querySelector('post-language-switch')?.setAttribute('variant', variant);
|
|
259
336
|
}
|
|
260
|
-
|
|
337
|
+
renderNavigation() {
|
|
261
338
|
const navigationClasses = ['navigation'];
|
|
262
339
|
if (this.mobileMenuExtended) {
|
|
263
340
|
navigationClasses.push('extended');
|
|
264
341
|
}
|
|
265
|
-
return (h(
|
|
342
|
+
return (h("div", { ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, h("slot", { name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { class: "navigation-footer" }, h("slot", { name: "meta-navigation" }), h("slot", { name: "post-language-switch" })))));
|
|
343
|
+
}
|
|
344
|
+
render() {
|
|
345
|
+
return (h(Host, { key: 'efbf8028f2abf376f497081996dba759f5885630', version: version }, h("div", { key: 'ecaaea274045453ce869f36e8a1155626b1818ba', class: "global-header" }, h("div", { key: '2fda0d65321ad1cbbc47b731f095e0d9b6694d99', class: "global-sub" }, h("div", { key: '24864d5f18c9d923717cc2e996395cff3bd6ce8b', class: "logo" }, h("slot", { key: 'ba82d7f62bb845732fe6066bcdc7eef15913c9e6', name: "post-logo" }))), h("div", { key: 'a0ddea4e564fca1e286998c73fea75eb8c228428', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '0d7aa11452eb69fe28914ff7787c6dc206fd4009', name: "meta-navigation" }), h("slot", { key: 'e92b7b9db6e16e8fcecb1ca74efa63942dd542c5', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'c68984037a71d5ac54828f6cf2367c3b07e428fc', name: "post-language-switch" }), h("div", { key: '70fb5040dc2f000c2afa286bb673ae9cf88521cf', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '509fb81812262cd9efdb3a562e48f72b0d29e376', name: "post-togglebutton" })))), h("div", { key: '393d1040bad2f85caced5b4a8ff02e30fa5fd5f1', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, h("slot", { key: '786cc114aae985a0612d3cb044684290e3026462', name: "title" }), h("div", { key: 'd4f68653a09bbf0b222873ed5d23fec6ba9d8f6f', class: "local-sub" }, h("slot", { key: '0ad7dda5490964e9a8eae5e0bf66a117882f7a06', name: "local-controls" }), h("slot", { key: 'bddc01c7696f456c38c200b330767a0f1b353d88' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
|
|
266
346
|
}
|
|
267
347
|
static get watchers() { return {
|
|
268
348
|
"mobileMenuExtended": ["frozeBody"]
|
|
@@ -286,35 +366,56 @@ const ANIMATION_KEYS = [...ANIMATION_NAMES];
|
|
|
286
366
|
const PostIcon = class {
|
|
287
367
|
constructor(hostRef) {
|
|
288
368
|
registerInstance(this, hostRef);
|
|
289
|
-
this.animation = null;
|
|
290
|
-
this.base = null;
|
|
291
|
-
this.flipH = false;
|
|
292
|
-
this.flipV = false;
|
|
293
|
-
this.name = undefined;
|
|
294
|
-
this.rotate = null;
|
|
295
|
-
this.scale = null;
|
|
296
369
|
}
|
|
297
370
|
get host() { return getElement(this); }
|
|
371
|
+
/**
|
|
372
|
+
* The name of the animation.
|
|
373
|
+
*/
|
|
374
|
+
animation = null;
|
|
298
375
|
validateAnimation(newValue = this.animation) {
|
|
299
376
|
if (newValue !== undefined)
|
|
300
377
|
checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon "animation" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);
|
|
301
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
|
|
381
|
+
*/
|
|
382
|
+
base = null;
|
|
302
383
|
validateBase(newValue = this.base) {
|
|
303
384
|
checkEmptyOrType(newValue, 'string', 'The post-icon "base" prop should be a string.');
|
|
304
385
|
}
|
|
386
|
+
/**
|
|
387
|
+
* When set to `true`, the icon will be flipped horizontally.
|
|
388
|
+
*/
|
|
389
|
+
flipH = false;
|
|
305
390
|
validateFlipH(newValue = this.flipH) {
|
|
306
391
|
checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipH" prop should be a boolean.');
|
|
307
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* When set to `true`, the icon will be flipped vertically.
|
|
395
|
+
*/
|
|
396
|
+
flipV = false;
|
|
308
397
|
validateFlipV(newValue = this.flipV) {
|
|
309
398
|
checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipV" prop should be a boolean.');
|
|
310
399
|
}
|
|
400
|
+
/**
|
|
401
|
+
* The name/id of the icon (e.g. 1000, 1001, ...).
|
|
402
|
+
*/
|
|
403
|
+
name;
|
|
311
404
|
validateName(newValue = this.name) {
|
|
312
405
|
checkNonEmpty(newValue, 'The post-icon "name" prop is required!.');
|
|
313
406
|
checkType(newValue, 'string', 'The post-icon "name" prop should be a string.');
|
|
314
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* The number of degree for the css rotate transformation.
|
|
410
|
+
*/
|
|
411
|
+
rotate = null;
|
|
315
412
|
validateRotate(newValue = this.rotate) {
|
|
316
413
|
checkEmptyOrType(newValue, 'number', 'The post-icon "rotate" prop should be a number.');
|
|
317
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* The number for the css scale transformation.
|
|
417
|
+
*/
|
|
418
|
+
scale = null;
|
|
318
419
|
validateScale(newValue = this.scale) {
|
|
319
420
|
checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
|
|
320
421
|
}
|
|
@@ -386,7 +487,7 @@ const PostIcon = class {
|
|
|
386
487
|
this.validateAnimation();
|
|
387
488
|
}
|
|
388
489
|
render() {
|
|
389
|
-
return (h(Host, { key: '
|
|
490
|
+
return (h(Host, { key: '6c494ba3cdd2ee173fa99a8ce8ff0e8ab5cf2979', "data-version": version }, h("span", { key: 'd9e0192a2788541b97bf3e25468129ac335d44b5', style: this.getStyles() })));
|
|
390
491
|
}
|
|
391
492
|
static get watchers() { return {
|
|
392
493
|
"animation": ["validateAnimation"],
|
|
@@ -407,22 +508,38 @@ const PostLanguageOption = class {
|
|
|
407
508
|
constructor(hostRef) {
|
|
408
509
|
registerInstance(this, hostRef);
|
|
409
510
|
this.postChange = createEvent(this, "postChange", 7);
|
|
410
|
-
this.code = undefined;
|
|
411
|
-
this.active = undefined;
|
|
412
|
-
this.variant = undefined;
|
|
413
|
-
this.name = undefined;
|
|
414
|
-
this.url = undefined;
|
|
415
511
|
}
|
|
416
512
|
get host() { return getElement(this); }
|
|
513
|
+
/**
|
|
514
|
+
* 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".
|
|
515
|
+
*/
|
|
516
|
+
code;
|
|
417
517
|
validateCode(value = this.code) {
|
|
418
518
|
checkType(value, 'string', 'The "code" property of the post-language-option component must be a string.');
|
|
419
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* If set to `true`, the language option is considered the current language for the page.
|
|
522
|
+
*/
|
|
523
|
+
active;
|
|
420
524
|
validateActiveProp(value = this.active) {
|
|
421
525
|
checkEmptyOrType(value, 'boolean', 'The "active" property of the post-language-option component must be a boolean value.');
|
|
422
526
|
}
|
|
527
|
+
/**
|
|
528
|
+
* The variant of the post-language-switch parent (dynamically set by the parent)
|
|
529
|
+
*/
|
|
530
|
+
variant;
|
|
531
|
+
/**
|
|
532
|
+
* The full name of the language. For example, "Deutsch".
|
|
533
|
+
*/
|
|
534
|
+
name;
|
|
423
535
|
validateName(value = this.name) {
|
|
424
536
|
checkEmptyOrType(value, 'string', 'The "name" property of the post-language-option component must be a string.');
|
|
425
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* The URL used for the href attribute of the internal anchor.
|
|
540
|
+
* This field is optional; if not provided, a button will be used internally instead of an anchor.
|
|
541
|
+
*/
|
|
542
|
+
url;
|
|
426
543
|
validateUrl(value = this.url) {
|
|
427
544
|
checkEmptyOrType(value, 'string', 'The "url" property of the post-language-option component must be a valid URL.');
|
|
428
545
|
}
|
|
@@ -459,7 +576,7 @@ const PostLanguageOption = class {
|
|
|
459
576
|
this.emitChange();
|
|
460
577
|
}
|
|
461
578
|
};
|
|
462
|
-
return (h(Host, { key: '
|
|
579
|
+
return (h(Host, { key: 'eff35e907ca174aa239604d8e3c937309d306cd1', "data-version": version, role: this.variant ? `${this.variant}item` : null }, this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null))) : (h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null)))));
|
|
463
580
|
}
|
|
464
581
|
static get watchers() { return {
|
|
465
582
|
"code": ["validateCode"],
|
|
@@ -472,27 +589,39 @@ PostLanguageOption.style = PostLanguageOptionStyle0;
|
|
|
472
589
|
|
|
473
590
|
const SWITCH_VARIANTS = ['list', 'menu'];
|
|
474
591
|
|
|
475
|
-
const postLanguageSwitchCss = ":host{display:block}@media screen and (max-width: 1023.
|
|
592
|
+
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)}";
|
|
476
593
|
const PostLanguageSwitchStyle0 = postLanguageSwitchCss;
|
|
477
594
|
|
|
478
595
|
const PostLanguageSwitch = class {
|
|
479
596
|
constructor(hostRef) {
|
|
480
597
|
registerInstance(this, hostRef);
|
|
481
|
-
this.caption = undefined;
|
|
482
|
-
this.description = undefined;
|
|
483
|
-
this.variant = 'list';
|
|
484
|
-
this.activeLang = undefined;
|
|
485
598
|
}
|
|
486
599
|
get host() { return getElement(this); }
|
|
600
|
+
/**
|
|
601
|
+
* A title for the list of language options
|
|
602
|
+
*/
|
|
603
|
+
caption;
|
|
487
604
|
validateCaption(value = this.caption) {
|
|
488
605
|
checkType(value, 'string', 'The "caption" property of the post-language-switch component must be a string.');
|
|
489
606
|
}
|
|
607
|
+
/**
|
|
608
|
+
* A descriptive text for the list of language options
|
|
609
|
+
*/
|
|
610
|
+
description;
|
|
490
611
|
validateDescription(value = this.description) {
|
|
491
612
|
checkType(value, 'string', 'The "description" property of the post-language-switch component must be a string.');
|
|
492
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* 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)
|
|
616
|
+
*/
|
|
617
|
+
variant = 'list';
|
|
493
618
|
validateVariant(value = this.variant) {
|
|
494
619
|
checkEmptyOrOneOf(value, SWITCH_VARIANTS, `The "variant" property of the post-language-switch component must be: ${SWITCH_VARIANTS.join(', ')}`);
|
|
495
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* The active language of the language switch
|
|
623
|
+
*/
|
|
624
|
+
activeLang;
|
|
496
625
|
connectedCallback() {
|
|
497
626
|
this.updateChildrenVariant();
|
|
498
627
|
// Get the active language based on children's active state
|
|
@@ -556,11 +685,20 @@ const PostListStyle0 = postListCss;
|
|
|
556
685
|
const PostList = class {
|
|
557
686
|
constructor(hostRef) {
|
|
558
687
|
registerInstance(this, hostRef);
|
|
559
|
-
this.titleId = undefined;
|
|
560
|
-
this.titleHidden = false;
|
|
561
|
-
this.horizontal = false;
|
|
562
688
|
}
|
|
563
689
|
get host() { return getElement(this); }
|
|
690
|
+
/**
|
|
691
|
+
* The unique title of the list that is also referenced in the labelledby
|
|
692
|
+
*/
|
|
693
|
+
titleId;
|
|
694
|
+
/**
|
|
695
|
+
* If `true`, the list title will be hidden. Otherwise, it will be displayed.`
|
|
696
|
+
*/
|
|
697
|
+
titleHidden = false;
|
|
698
|
+
/**
|
|
699
|
+
* The list can become horizontal by setting `horizontal="true"` or just `horizontal`
|
|
700
|
+
*/
|
|
701
|
+
horizontal = false;
|
|
564
702
|
titleEl;
|
|
565
703
|
componentWillLoad() {
|
|
566
704
|
/**
|
|
@@ -577,7 +715,7 @@ const PostList = class {
|
|
|
577
715
|
}
|
|
578
716
|
}
|
|
579
717
|
render() {
|
|
580
|
-
return (h(Host, { key: '
|
|
718
|
+
return (h(Host, { key: 'bdd973098d8b2a74635d489dca8f0f6825e31c51', "data-version": version }, h("div", { key: '9dcd6ca7069658c3e7f0d14fc130d18ebe522acb', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: 'ad51f345b2c120796d02dbc3d6815a58addc7fb4' })), h("div", { key: '47fddd7b977c85c195757f461c0ec009270cdb8b', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: '176662b40ca47b6aeeded26256bc84bdee6483a6', name: "post-list-item" }))));
|
|
581
719
|
}
|
|
582
720
|
};
|
|
583
721
|
PostList.style = PostListStyle0;
|
|
@@ -594,7 +732,7 @@ const PostListItem = class {
|
|
|
594
732
|
this.host.setAttribute('slot', 'post-list-item');
|
|
595
733
|
}
|
|
596
734
|
render() {
|
|
597
|
-
return (h(Host, { key: '
|
|
735
|
+
return (h(Host, { key: '8e209e77859bd05d62cae41aec9dec6fb2e820cb', role: "listitem", slot: "post-list-item" }, h("slot", { key: 'ce79a335e80401465b74208957e22983d6df4ce0' })));
|
|
598
736
|
}
|
|
599
737
|
};
|
|
600
738
|
PostListItem.style = PostListItemStyle0;
|
|
@@ -605,9 +743,12 @@ const PostLogoStyle0 = postLogoCss;
|
|
|
605
743
|
const PostLogo = class {
|
|
606
744
|
constructor(hostRef) {
|
|
607
745
|
registerInstance(this, hostRef);
|
|
608
|
-
this.url = undefined;
|
|
609
746
|
}
|
|
610
747
|
get host() { return getElement(this); }
|
|
748
|
+
/**
|
|
749
|
+
* The URL to which the user is redirected upon clicking the logo.
|
|
750
|
+
*/
|
|
751
|
+
url;
|
|
611
752
|
validateUrl() {
|
|
612
753
|
checkEmptyOrUrl(this.url, 'The "url" property of the post-logo is invalid');
|
|
613
754
|
}
|
|
@@ -623,7 +764,7 @@ const PostLogo = class {
|
|
|
623
764
|
render() {
|
|
624
765
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
625
766
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
626
|
-
return (h(Host, { key: '
|
|
767
|
+
return (h(Host, { key: 'd5f61d2740588571b77c9317d535b5c12c9ba996', "data-version": version }, h(LogoTag, { key: '95d19b08bae7e4137f43c0b7e345fa44ed1a6e9e', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'd7a4e97a9685ebc099e57737926d0fbe6d8ed12f', class: "description" }, h("slot", { key: '6b08a53ad00b103930f0b1aab1d305ae77feccba', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'a7adc544f620325bdec5fa3fbc5a880d10a85f7e', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: 'f68e9b4b0ef8b0d4b34a47a23cb4f0a0e04b5456', id: "Logo" }, h("rect", { key: 'b21a948f30baa4808182ccee37822315d87282eb', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), 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" }), 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" }))))));
|
|
627
768
|
}
|
|
628
769
|
static get watchers() { return {
|
|
629
770
|
"url": ["validateUrl"]
|
|
@@ -631,22 +772,45 @@ const PostLogo = class {
|
|
|
631
772
|
};
|
|
632
773
|
PostLogo.style = PostLogoStyle0;
|
|
633
774
|
|
|
634
|
-
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}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.99px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-16)}}@media screen and (max-width: 599.99px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-14)}}@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)}}@media screen and (min-width: 1024px)and (max-width: 599.99px){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%;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.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: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}";
|
|
775
|
+
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}";
|
|
635
776
|
const PostMainnavigationStyle0 = postMainnavigationCss;
|
|
636
777
|
|
|
778
|
+
const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
|
|
779
|
+
const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
|
|
780
|
+
const NAVIGATION_LIST_SELECTOR = 'post-list:not(post-megadropdown *) > [role="list"]';
|
|
781
|
+
const NAVIGATION_ITEM_SELECTOR = ':is(post-list-item > a, post-list-item > post-megadropdown-trigger > button):not(post-megadropdown *)';
|
|
637
782
|
const PostMainnavigation = class {
|
|
638
783
|
constructor(hostRef) {
|
|
639
784
|
registerInstance(this, hostRef);
|
|
640
|
-
this.postToggle = createEvent(this, "postToggle", 7);
|
|
641
785
|
}
|
|
642
786
|
header;
|
|
787
|
+
navbar;
|
|
788
|
+
rightScrollButton;
|
|
789
|
+
leftScrollButton;
|
|
790
|
+
scrollRepeatInterval;
|
|
791
|
+
navbarDisableTimer;
|
|
792
|
+
mutationObserver = new MutationObserver(async (mutations) => {
|
|
793
|
+
// Wait for all elements to be hydrated
|
|
794
|
+
await Promise.all(mutations
|
|
795
|
+
.flatMap((mutation) => Array.from(mutation.addedNodes))
|
|
796
|
+
.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
|
|
797
|
+
// Recalculate scrollability after DOM changes
|
|
798
|
+
this.checkScrollability();
|
|
799
|
+
});
|
|
643
800
|
get host() { return getElement(this); }
|
|
801
|
+
canScrollLeft = false;
|
|
802
|
+
canScrollRight = false;
|
|
803
|
+
translateAmount = 0;
|
|
644
804
|
/**
|
|
645
|
-
*
|
|
805
|
+
* Update navbar translation when 'translateAmount' changes and recalculate scrollability
|
|
646
806
|
*/
|
|
647
|
-
|
|
807
|
+
onTranslateAmountChanges(value) {
|
|
808
|
+
this.navbar.style.transform = `translateX(-${value}px)`;
|
|
809
|
+
this.checkScrollability();
|
|
810
|
+
}
|
|
648
811
|
/**
|
|
649
812
|
* Retrieves a reference to the closest 'post-header' element when the main navigation is added to the DOM.
|
|
813
|
+
* This ensures that we can interact with the header for mobile menu toggling.
|
|
650
814
|
*/
|
|
651
815
|
connectedCallback() {
|
|
652
816
|
this.header = this.host.closest('post-header');
|
|
@@ -656,110 +820,324 @@ const PostMainnavigation = class {
|
|
|
656
820
|
*/
|
|
657
821
|
disconnectedCallback() {
|
|
658
822
|
this.header = null;
|
|
823
|
+
this.mutationObserver.disconnect();
|
|
824
|
+
}
|
|
825
|
+
componentDidLoad() {
|
|
826
|
+
setTimeout(() => this.checkScrollability()); // Initial check to determine if scrolling is needed
|
|
827
|
+
this.mutationObserver.observe(this.navigationList, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
|
|
828
|
+
window.addEventListener('resize', // Recheck scrollability on window resize
|
|
829
|
+
throttle(100, () => this.checkScrollability()));
|
|
830
|
+
// Handle focus changes and adjust scroll as needed
|
|
831
|
+
this.navbar.addEventListener('focusin', e => this.adjustTranslation(e));
|
|
659
832
|
}
|
|
660
833
|
handleBackButtonClick() {
|
|
661
834
|
if (this.header)
|
|
662
835
|
this.header.toggleMobileMenu();
|
|
663
836
|
}
|
|
837
|
+
/**
|
|
838
|
+
* Moves focus on the navbar and adjusts scrolling to bring focused element into view.
|
|
839
|
+
*/
|
|
840
|
+
adjustTranslation(e) {
|
|
841
|
+
const focusedElement = e.target;
|
|
842
|
+
if (!this.canScroll || !focusedElement.matches(NAVIGATION_ITEM_SELECTOR))
|
|
843
|
+
return;
|
|
844
|
+
// We need to move the element into the view before it is focused to avoid browser default behavior
|
|
845
|
+
e.preventDefault();
|
|
846
|
+
this.withoutTransition(() => {
|
|
847
|
+
// Try scrolling in both directions, only the necessary translation will actually occur
|
|
848
|
+
this.translateRightTo(focusedElement);
|
|
849
|
+
this.translateLeftTo(focusedElement);
|
|
850
|
+
focusedElement.focus();
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* Checks if scrolling is possible in either direction (left or right) and updates the state accordingly.
|
|
855
|
+
*/
|
|
856
|
+
checkScrollability() {
|
|
857
|
+
const { scrollWidth, clientWidth } = this.navbar;
|
|
858
|
+
const couldScroll = this.canScroll;
|
|
859
|
+
if (scrollWidth === clientWidth) {
|
|
860
|
+
// If scroll width equals client width, scrolling is disabled in both directions
|
|
861
|
+
this.canScrollLeft = this.canScrollRight = false;
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
this.canScrollLeft = this.translateAmount !== 0; // Scrolling left is possible if not at the start
|
|
865
|
+
this.canScrollRight = clientWidth + this.translateAmount !== scrollWidth; // Scrolling right is possible if not at the end
|
|
866
|
+
}
|
|
867
|
+
if (couldScroll && !this.canScroll) {
|
|
868
|
+
this.withoutTransition(() => (this.translateAmount = 0));
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Returns whether scrolling is enabled in either the left or right direction.
|
|
873
|
+
*/
|
|
874
|
+
get canScroll() {
|
|
875
|
+
return this.canScrollLeft || this.canScrollRight;
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* Handles the scrolling behavior when a user clicks on the left or right scroll buttons.
|
|
879
|
+
*/
|
|
880
|
+
handleScrollButtonClick(direction) {
|
|
881
|
+
if (!this.canScroll)
|
|
882
|
+
return;
|
|
883
|
+
// Disable interaction with the navbar during scrolling
|
|
884
|
+
this.disableNavbar();
|
|
885
|
+
// Perform the initial scroll action
|
|
886
|
+
this.scroll(direction);
|
|
887
|
+
// Repeat the scrolling action while the button is held down
|
|
888
|
+
this.scrollRepeatInterval = setInterval(() => {
|
|
889
|
+
this.scroll(direction);
|
|
890
|
+
}, SCROLL_REPEAT_INTERVAL);
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Stops the repeated scrolling when the mouse button is released.
|
|
894
|
+
*/
|
|
895
|
+
stopScrolling() {
|
|
896
|
+
if (this.scrollRepeatInterval)
|
|
897
|
+
clearInterval(this.scrollRepeatInterval);
|
|
898
|
+
}
|
|
899
|
+
scroll(direction) {
|
|
900
|
+
const navigationItems = Array.from(this.navigationItems);
|
|
901
|
+
if (direction === 'left')
|
|
902
|
+
navigationItems.reverse();
|
|
903
|
+
for (const item of navigationItems) {
|
|
904
|
+
const couldScroll = direction === 'left' ? this.translateLeftTo(item) : this.translateRightTo(item);
|
|
905
|
+
if (couldScroll)
|
|
906
|
+
break;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
translateRightTo(navigationItem) {
|
|
910
|
+
const itemRightEdgePosition = navigationItem.offsetLeft + navigationItem.offsetWidth + this.getFocusMargin(navigationItem);
|
|
911
|
+
const lastVisiblePosition = this.navbar.clientWidth + this.translateAmount;
|
|
912
|
+
// If the item is already fully visible, don't scroll
|
|
913
|
+
if (itemRightEdgePosition < lastVisiblePosition)
|
|
914
|
+
return false;
|
|
915
|
+
const maxTranslateAmount = this.navbar.scrollWidth - this.navbar.clientWidth;
|
|
916
|
+
const newRightEdgePosition = itemRightEdgePosition + this.rightScrollButton.clientWidth - this.navbar.clientWidth;
|
|
917
|
+
this.translateAmount = Math.min(maxTranslateAmount, newRightEdgePosition);
|
|
918
|
+
return true;
|
|
919
|
+
}
|
|
920
|
+
translateLeftTo(navigationItem) {
|
|
921
|
+
const itemLeftEdgePosition = navigationItem.offsetLeft - this.getFocusMargin(navigationItem);
|
|
922
|
+
const firstVisiblePosition = this.translateAmount;
|
|
923
|
+
// If the item is already fully visible, don't scroll
|
|
924
|
+
if (itemLeftEdgePosition > firstVisiblePosition)
|
|
925
|
+
return false;
|
|
926
|
+
const minTranslateAmount = 0;
|
|
927
|
+
const newRightEdgePosition = itemLeftEdgePosition - this.leftScrollButton.clientWidth;
|
|
928
|
+
this.translateAmount = Math.max(minTranslateAmount, newRightEdgePosition);
|
|
929
|
+
return true;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Calculate the margin required for focus outline around navigation items
|
|
933
|
+
*/
|
|
934
|
+
getFocusMargin(navigationItem) {
|
|
935
|
+
const { outlineWidth, outlineOffset } = getComputedStyle(navigationItem);
|
|
936
|
+
return parseInt(outlineWidth) + parseInt(outlineOffset) + 1;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Returns the navigation list container element
|
|
940
|
+
*/
|
|
941
|
+
get navigationList() {
|
|
942
|
+
return this.navbar.querySelector(NAVIGATION_LIST_SELECTOR);
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Returns the navigation items
|
|
946
|
+
*/
|
|
947
|
+
get navigationItems() {
|
|
948
|
+
return this.navbar.querySelectorAll(NAVIGATION_ITEM_SELECTOR);
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Temporarily disables interactions with the navbar during scrolling to prevent accidental clicks.
|
|
952
|
+
* Re-enables interactions after a brief delay to avoid blocking the user entirely.
|
|
953
|
+
*/
|
|
954
|
+
disableNavbar() {
|
|
955
|
+
if (this.navbarDisableTimer)
|
|
956
|
+
clearTimeout(this.navbarDisableTimer);
|
|
957
|
+
this.navbar.style.pointerEvents = 'none';
|
|
958
|
+
this.navbarDisableTimer = setTimeout(() => {
|
|
959
|
+
this.navbar.style.pointerEvents = 'initial';
|
|
960
|
+
}, NAVBAR_DISABLE_DURATION);
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Allows to translate the navbar without a transition
|
|
964
|
+
*/
|
|
965
|
+
withoutTransition(callback) {
|
|
966
|
+
const transition = this.navbar.style.transition;
|
|
967
|
+
this.navbar.style.transition = 'none';
|
|
968
|
+
callback();
|
|
969
|
+
setTimeout(() => {
|
|
970
|
+
this.navbar.style.transition = transition;
|
|
971
|
+
});
|
|
972
|
+
}
|
|
664
973
|
render() {
|
|
665
|
-
return (h(Host, { key: '
|
|
974
|
+
return (h(Host, { key: '3280c55d0f8e7aec6e1dc3f59744114b2557cb04', slot: "post-mainnavigation" }, h("div", { key: '446ede19ef62a21022a771edb8a6e8eb30a5c5d3', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '5e923b62133d3452676445349624157fd7d3d957', name: "back-button" })), h("nav", { key: 'd67723ba6b42ec2b083197091ec7226dc258897e', ref: el => (this.navbar = el) }, h("slot", { key: 'ea1a0fd7f76e02b89789713a49fc4d7fd6e8a022' })), h("div", { key: '1a3d640acfe23ae5c5f9ab26a7bca9c3c2bc4434', class: `left-scroll-button${this.canScrollLeft ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: 'a3260bba8104bf9155120e04fed6ba0aa102e529', type: "button", tabindex: "-1", ref: el => (this.leftScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('left') }, h("post-icon", { key: '0bba0a76f93098267be8432636391641f55d5df8', "aria-hidden": "true", name: "chevronleft" }))), h("div", { key: '401ef6821f258737d17ed54ae1c577cc4783a3f9', class: `right-scroll-button${this.canScrollRight ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: 'd964f4b74ad8fef86115b12fcda12cc54da936f3', type: "button", tabindex: "-1", ref: el => (this.rightScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('right') }, h("post-icon", { key: '5758f48df24b4a3ea241f43464b448878e31977d', "aria-hidden": "true", name: "chevronright" })))));
|
|
666
975
|
}
|
|
976
|
+
static get watchers() { return {
|
|
977
|
+
"translateAmount": ["onTranslateAmountChanges"]
|
|
978
|
+
}; }
|
|
667
979
|
};
|
|
668
980
|
PostMainnavigation.style = PostMainnavigationStyle0;
|
|
669
981
|
|
|
670
|
-
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-
|
|
982
|
+
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}}";
|
|
671
983
|
const PostMegadropdownStyle0 = postMegadropdownCss;
|
|
672
984
|
|
|
673
985
|
const PostMegadropdown = class {
|
|
674
986
|
constructor(hostRef) {
|
|
675
987
|
registerInstance(this, hostRef);
|
|
676
988
|
this.postToggleMegadropdown = createEvent(this, "postToggleMegadropdown", 7);
|
|
677
|
-
this.isVisible = false;
|
|
678
|
-
this.animationClass = null;
|
|
679
989
|
}
|
|
680
|
-
|
|
990
|
+
header;
|
|
991
|
+
firstFocusableEl;
|
|
992
|
+
lastFocusableEl;
|
|
993
|
+
device;
|
|
681
994
|
get host() { return getElement(this); }
|
|
995
|
+
/** Tracks the currently active dropdown instance. */
|
|
996
|
+
static activeDropdown = null;
|
|
997
|
+
/**
|
|
998
|
+
* Holds the current visibility state of the dropdown.
|
|
999
|
+
* This state is internally managed to track whether the dropdown is open (`true`) or closed (`false`),
|
|
1000
|
+
* and updates automatically when the dropdown is toggled.
|
|
1001
|
+
*/
|
|
1002
|
+
isVisible = false;
|
|
1003
|
+
/** Holds the current animation class. */
|
|
1004
|
+
animationClass = null;
|
|
682
1005
|
/**
|
|
683
1006
|
* Emits when the dropdown is shown or hidden.
|
|
684
1007
|
* The event payload is a boolean: `true` when the dropdown was opened, `false` when it was closed.
|
|
685
1008
|
**/
|
|
686
1009
|
postToggleMegadropdown;
|
|
687
|
-
|
|
688
|
-
this.
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
}
|
|
696
|
-
});
|
|
1010
|
+
disconnectedCallback() {
|
|
1011
|
+
this.removeOutsideClickListener();
|
|
1012
|
+
if (PostMegadropdown.activeDropdown === this) {
|
|
1013
|
+
PostMegadropdown.activeDropdown = null;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
componentWillRender() {
|
|
1017
|
+
this.getFocusableElements();
|
|
697
1018
|
}
|
|
698
1019
|
/**
|
|
699
1020
|
* Toggles the dropdown visibility based on its current state.
|
|
700
1021
|
*/
|
|
701
|
-
async toggle(
|
|
1022
|
+
async toggle() {
|
|
702
1023
|
if (this.isVisible) {
|
|
703
1024
|
this.hide();
|
|
704
1025
|
}
|
|
705
1026
|
else {
|
|
706
|
-
await this.show(
|
|
1027
|
+
await this.show();
|
|
707
1028
|
}
|
|
708
1029
|
}
|
|
709
1030
|
/**
|
|
710
|
-
* Displays the
|
|
711
|
-
*
|
|
712
|
-
* @param target - The HTML element relative to which the popover dropdown should be displayed.
|
|
1031
|
+
* Displays the dropdown.
|
|
713
1032
|
*/
|
|
714
|
-
async show(
|
|
715
|
-
if (this
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
1033
|
+
async show() {
|
|
1034
|
+
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
1035
|
+
// Close the previously active dropdown without animation
|
|
1036
|
+
PostMegadropdown.activeDropdown.forceClose();
|
|
1037
|
+
}
|
|
1038
|
+
this.isVisible = true;
|
|
1039
|
+
this.host.addEventListener('keydown', e => this.keyboardHandler(e));
|
|
1040
|
+
this.animationClass = 'slide-in';
|
|
1041
|
+
PostMegadropdown.activeDropdown = this;
|
|
1042
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1043
|
+
this.addOutsideClickListener();
|
|
722
1044
|
}
|
|
723
1045
|
/**
|
|
724
|
-
* Hides the
|
|
1046
|
+
* Hides the dropdown with an animation.
|
|
725
1047
|
*/
|
|
726
|
-
hide() {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1048
|
+
async hide() {
|
|
1049
|
+
this.animationClass = 'slide-out';
|
|
1050
|
+
this.host.removeEventListener('keydown', e => this.keyboardHandler(e));
|
|
1051
|
+
}
|
|
1052
|
+
connectedCallback() {
|
|
1053
|
+
this.header = this.host.closest('post-header');
|
|
1054
|
+
if (this.header) {
|
|
1055
|
+
this.header.addEventListener('postUpdateDevice', (event) => (this.device = event.detail));
|
|
732
1056
|
}
|
|
733
1057
|
}
|
|
734
|
-
|
|
735
|
-
|
|
1058
|
+
/**
|
|
1059
|
+
* Forces the dropdown to close without animation.
|
|
1060
|
+
*/
|
|
1061
|
+
forceClose() {
|
|
1062
|
+
this.isVisible = false;
|
|
1063
|
+
this.animationClass = null;
|
|
1064
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1065
|
+
this.removeOutsideClickListener();
|
|
736
1066
|
}
|
|
737
|
-
|
|
738
|
-
this.
|
|
1067
|
+
handleAnimationEnd() {
|
|
1068
|
+
if (this.animationClass === 'slide-out') {
|
|
1069
|
+
this.isVisible = false;
|
|
1070
|
+
this.animationClass = null;
|
|
1071
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1072
|
+
this.removeOutsideClickListener();
|
|
1073
|
+
}
|
|
739
1074
|
}
|
|
740
|
-
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
1075
|
+
handleClickOutside = (event) => {
|
|
1076
|
+
const target = event.target;
|
|
1077
|
+
if (this.host.contains(target)) {
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
if (target instanceof HTMLElement) {
|
|
1081
|
+
const trigger = target.closest('post-megadropdown-trigger');
|
|
1082
|
+
if (trigger) {
|
|
1083
|
+
const targetDropdownId = trigger.getAttribute('for');
|
|
1084
|
+
if (targetDropdownId !== this.host.id) {
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
this.hide();
|
|
1090
|
+
};
|
|
1091
|
+
addOutsideClickListener() {
|
|
1092
|
+
document.addEventListener('mousedown', this.handleClickOutside);
|
|
1093
|
+
}
|
|
1094
|
+
removeOutsideClickListener() {
|
|
1095
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
1096
|
+
}
|
|
1097
|
+
getFocusableElements() {
|
|
1098
|
+
const focusableEls = Array.from(this.host.querySelectorAll('post-list-item, h3, .back-button'));
|
|
1099
|
+
const focusableChildren = focusableEls.flatMap(el => Array.from(getFocusableChildren(el)));
|
|
1100
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
1101
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
1102
|
+
}
|
|
1103
|
+
// Loop through the focusable children
|
|
1104
|
+
keyboardHandler(e) {
|
|
1105
|
+
if (e.key === 'Tab' && this.device !== 'desktop') {
|
|
1106
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
1107
|
+
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
1108
|
+
e.preventDefault();
|
|
1109
|
+
this.lastFocusableEl.focus();
|
|
1110
|
+
}
|
|
1111
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
1112
|
+
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
1113
|
+
e.preventDefault();
|
|
1114
|
+
this.firstFocusableEl.focus();
|
|
1115
|
+
}
|
|
745
1116
|
}
|
|
746
1117
|
}
|
|
747
1118
|
render() {
|
|
748
|
-
|
|
1119
|
+
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
1120
|
+
return (h(Host, { key: '5aa08b01be715325182c245e1b0ae2456bcc5df6' }, h("div", { key: '0737c9368ecbffac59bbdf47fabac3f3b94ae7bb', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, h("div", { key: 'efe49f3f9cdcd99e2feca78b772c944405e19f21', class: "megadropdown" }, h("div", { key: '14dd7ff2f7e7b1eb91f2673a25d7ccafffe4f9d0', onClick: () => this.hide(), class: "back-button" }, h("slot", { key: '554e30e6408c0bef0549f5e2c31dcd8b90ceee40', name: "back-button" })), h("div", { key: '4e7335152d7b6649918adf075213ebbf8b8ddeaa', onClick: () => this.hide(), class: "close-button" }, h("slot", { key: 'db90f3a5334ce723c0ee672a96167197ca25b545', name: "close-button" })), h("slot", { key: 'b11b1d16147f88103f2eb24c8dd21394de53f69c', name: "megadropdown-title" }), h("div", { key: '6d837c1a70f66f00097fb531058750fbac6fd41a', class: "megadropdown-content" }, h("slot", { key: 'be685185f04e44d867167f918494d086856b5928' }))))));
|
|
749
1121
|
}
|
|
750
1122
|
};
|
|
751
1123
|
PostMegadropdown.style = PostMegadropdownStyle0;
|
|
752
1124
|
|
|
753
|
-
const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100
|
|
1125
|
+
const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100%;position:relative;z-index:3}";
|
|
754
1126
|
const PostMegadropdownTriggerStyle0 = postMegadropdownTriggerCss;
|
|
755
1127
|
|
|
756
1128
|
const PostMegadropdownTrigger = class {
|
|
757
1129
|
constructor(hostRef) {
|
|
758
1130
|
registerInstance(this, hostRef);
|
|
759
|
-
this.for = undefined;
|
|
760
|
-
this.ariaExpanded = false;
|
|
761
1131
|
}
|
|
1132
|
+
/**
|
|
1133
|
+
* ID of the mega dropdown element that this trigger is linked to. Used to open and close the specified mega dropdown.
|
|
1134
|
+
*/
|
|
1135
|
+
for;
|
|
762
1136
|
get host() { return getElement(this); }
|
|
1137
|
+
/**
|
|
1138
|
+
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated mega dropdown is expanded or collapsed.
|
|
1139
|
+
*/
|
|
1140
|
+
ariaExpanded = false;
|
|
763
1141
|
/**
|
|
764
1142
|
* Reference to the slotted button within the trigger, if present.
|
|
765
1143
|
* Used to manage click and key events for mega dropdown control.
|
|
@@ -780,7 +1158,7 @@ const PostMegadropdownTrigger = class {
|
|
|
780
1158
|
}
|
|
781
1159
|
handleToggle() {
|
|
782
1160
|
if (this.megadropdown) {
|
|
783
|
-
this.megadropdown.toggle(
|
|
1161
|
+
this.megadropdown.toggle();
|
|
784
1162
|
}
|
|
785
1163
|
else {
|
|
786
1164
|
console.warn(`No post-megadropdown found with ID: ${this.for}`);
|
|
@@ -809,7 +1187,7 @@ const PostMegadropdownTrigger = class {
|
|
|
809
1187
|
}
|
|
810
1188
|
}
|
|
811
1189
|
render() {
|
|
812
|
-
return (h(Host, { key: '
|
|
1190
|
+
return (h(Host, { key: '2e009cb0dbfd81785d3a8ce5802a4fab0e84a52e', "data-version": version, "tab-index": "-1" }, h("button", { key: 'd77d9a5eb5786a63cf7453c639647adc705892bc' }, h("slot", { key: '19f4b17dc2d073b0770c33d6acfb763c1e47735a' }))));
|
|
813
1191
|
}
|
|
814
1192
|
static get watchers() { return {
|
|
815
1193
|
"for": ["validateControlFor"]
|
|
@@ -817,34 +1195,6 @@ const PostMegadropdownTrigger = class {
|
|
|
817
1195
|
};
|
|
818
1196
|
PostMegadropdownTrigger.style = PostMegadropdownTriggerStyle0;
|
|
819
1197
|
|
|
820
|
-
const focusableSelector = `:where(${[
|
|
821
|
-
'button',
|
|
822
|
-
'input:not([type="hidden"])',
|
|
823
|
-
'[tabindex]',
|
|
824
|
-
'select',
|
|
825
|
-
'textarea',
|
|
826
|
-
'[contenteditable]',
|
|
827
|
-
'a[href]',
|
|
828
|
-
'iframe',
|
|
829
|
-
'audio[controls]',
|
|
830
|
-
'video[controls]',
|
|
831
|
-
'area[href]',
|
|
832
|
-
'details > summary:first-of-type',
|
|
833
|
-
].join(',')})`;
|
|
834
|
-
const focusDisablingSelector = `:where(${[
|
|
835
|
-
'[inert]',
|
|
836
|
-
'[inert] *',
|
|
837
|
-
':disabled',
|
|
838
|
-
'dialog:not([open]) *',
|
|
839
|
-
'[popover]:not(:popover-open) *',
|
|
840
|
-
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
841
|
-
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
842
|
-
'[tabindex^="-"]',
|
|
843
|
-
].join(',')})`;
|
|
844
|
-
function getFocusableChildren(element) {
|
|
845
|
-
return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
|
|
846
|
-
}
|
|
847
|
-
|
|
848
1198
|
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}";
|
|
849
1199
|
const PostMenuStyle0 = postMenuCss;
|
|
850
1200
|
|
|
@@ -852,8 +1202,6 @@ const PostMenu = class {
|
|
|
852
1202
|
constructor(hostRef) {
|
|
853
1203
|
registerInstance(this, hostRef);
|
|
854
1204
|
this.toggleMenu = createEvent(this, "toggleMenu", 7);
|
|
855
|
-
this.placement = 'bottom';
|
|
856
|
-
this.isVisible = false;
|
|
857
1205
|
}
|
|
858
1206
|
popoverRef;
|
|
859
1207
|
lastFocusedElement = null;
|
|
@@ -868,6 +1216,18 @@ const PostMenu = class {
|
|
|
868
1216
|
ESCAPE: 'Escape',
|
|
869
1217
|
};
|
|
870
1218
|
get host() { return getElement(this); }
|
|
1219
|
+
/**
|
|
1220
|
+
* Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
1221
|
+
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
1222
|
+
* towards the viewport if they would overlap edge boundaries.
|
|
1223
|
+
*/
|
|
1224
|
+
placement = 'bottom';
|
|
1225
|
+
/**
|
|
1226
|
+
* Holds the current visibility state of the menu.
|
|
1227
|
+
* This state is internally managed to track whether the menu is open (`true`) or closed (`false`),
|
|
1228
|
+
* and updates automatically when the menu is toggled.
|
|
1229
|
+
*/
|
|
1230
|
+
isVisible = false;
|
|
871
1231
|
/**
|
|
872
1232
|
* Emits when the menu is shown or hidden.
|
|
873
1233
|
* The event payload is a boolean: `true` when the menu was opened, `false` when it was closed.
|
|
@@ -996,7 +1356,7 @@ const PostMenu = class {
|
|
|
996
1356
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
997
1357
|
}
|
|
998
1358
|
render() {
|
|
999
|
-
return (h(Host, { key: '
|
|
1359
|
+
return (h(Host, { key: '071532c327f80197dda662f77e5cb2444281087d', "data-version": version }, h("post-popovercontainer", { key: '9f70ca4009139e0547026b26be610a02f4f1a95a', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '3ff1048a8fb27402a82cedc3dc300366063c9601', class: "popover-container", part: "popover-container" }, h("slot", { key: 'bed6c96b7502e0032b746ac6fdf8c3dd6d782e48' })))));
|
|
1000
1360
|
}
|
|
1001
1361
|
};
|
|
1002
1362
|
PostMenu.style = PostMenuStyle0;
|
|
@@ -1007,10 +1367,16 @@ const PostMenuTriggerStyle0 = postMenuTriggerCss;
|
|
|
1007
1367
|
const PostMenuTrigger = class {
|
|
1008
1368
|
constructor(hostRef) {
|
|
1009
1369
|
registerInstance(this, hostRef);
|
|
1010
|
-
this.for = undefined;
|
|
1011
|
-
this.ariaExpanded = false;
|
|
1012
1370
|
}
|
|
1371
|
+
/**
|
|
1372
|
+
* ID of the menu element that this trigger is linked to. Used to open and close the specified menu.
|
|
1373
|
+
*/
|
|
1374
|
+
for;
|
|
1013
1375
|
get host() { return getElement(this); }
|
|
1376
|
+
/**
|
|
1377
|
+
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated menu is expanded or collapsed.
|
|
1378
|
+
*/
|
|
1379
|
+
ariaExpanded = false;
|
|
1014
1380
|
/**
|
|
1015
1381
|
* Reference to the slotted button within the trigger, if present.
|
|
1016
1382
|
* Used to manage click and key events for menu control.
|
|
@@ -1071,7 +1437,7 @@ const PostMenuTrigger = class {
|
|
|
1071
1437
|
}
|
|
1072
1438
|
}
|
|
1073
1439
|
render() {
|
|
1074
|
-
return (h(Host, { key: '
|
|
1440
|
+
return (h(Host, { key: 'a0fff619978087ce0c67d7d327982424e3784ff0', "data-version": version, "tab-index": "-1" }, h("slot", { key: '93e26150b59e9a01275a6815096e09ff5fac146b' })));
|
|
1075
1441
|
}
|
|
1076
1442
|
static get watchers() { return {
|
|
1077
1443
|
"for": ["validateControlFor"]
|
|
@@ -3181,7 +3547,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
3181
3547
|
}
|
|
3182
3548
|
`,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();})();
|
|
3183
3549
|
|
|
3184
|
-
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow
|
|
3550
|
+
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)}";
|
|
3185
3551
|
const PostPopovercontainerStyle0 = postPopovercontainerCss;
|
|
3186
3552
|
|
|
3187
3553
|
const SIDE_MAP = {
|
|
@@ -3194,9 +3560,6 @@ const PostPopovercontainer = class {
|
|
|
3194
3560
|
constructor(hostRef) {
|
|
3195
3561
|
registerInstance(this, hostRef);
|
|
3196
3562
|
this.postToggle = createEvent(this, "postToggle", 7);
|
|
3197
|
-
this.placement = 'top';
|
|
3198
|
-
this.edgeGap = 8;
|
|
3199
|
-
this.arrow = false;
|
|
3200
3563
|
}
|
|
3201
3564
|
get host() { return getElement(this); }
|
|
3202
3565
|
arrowRef;
|
|
@@ -3207,8 +3570,25 @@ const PostPopovercontainer = class {
|
|
|
3207
3570
|
* Fires whenever the popover gets shown or hidden, passing the new state in event.details as a boolean
|
|
3208
3571
|
*/
|
|
3209
3572
|
postToggle;
|
|
3573
|
+
/**
|
|
3574
|
+
* Whether or not the popover should close when user clicks outside of it
|
|
3575
|
+
*/
|
|
3576
|
+
manualClose = false;
|
|
3577
|
+
/**
|
|
3578
|
+
* Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
3579
|
+
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
3580
|
+
* towards the viewport if they would overlap edge boundaries.
|
|
3581
|
+
*/
|
|
3582
|
+
placement = 'top';
|
|
3583
|
+
/**
|
|
3584
|
+
* Gap between the edge of the page and the popover
|
|
3585
|
+
*/
|
|
3586
|
+
edgeGap = 8;
|
|
3587
|
+
/**
|
|
3588
|
+
* Wheter or not to display a little pointer arrow
|
|
3589
|
+
*/
|
|
3590
|
+
arrow = false;
|
|
3210
3591
|
componentDidLoad() {
|
|
3211
|
-
this.host.setAttribute('popover', '');
|
|
3212
3592
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
3213
3593
|
}
|
|
3214
3594
|
disconnectedCallback() {
|
|
@@ -3326,9 +3706,9 @@ const PostPopovercontainer = class {
|
|
|
3326
3706
|
}
|
|
3327
3707
|
}
|
|
3328
3708
|
render() {
|
|
3329
|
-
return (h(Host, { key: '
|
|
3709
|
+
return (h(Host, { key: '6bebf9ab3013796d0eebb3d543411a0e80d2e913', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, this.arrow && (h("span", { key: 'd6eca10452a54073a293128e8faf76e45e35c4c5', class: "arrow", ref: el => {
|
|
3330
3710
|
this.arrowRef = el;
|
|
3331
|
-
} })), h("slot", { key: '
|
|
3711
|
+
} })), h("slot", { key: '3b6674dfa1b3ffac10c6640717c7ae713577c965' })));
|
|
3332
3712
|
}
|
|
3333
3713
|
};
|
|
3334
3714
|
PostPopovercontainer.style = PostPopovercontainerStyle0;
|
|
@@ -3339,9 +3719,12 @@ const PostTogglebuttonStyle0 = postTogglebuttonCss;
|
|
|
3339
3719
|
const PostTogglebutton = class {
|
|
3340
3720
|
constructor(hostRef) {
|
|
3341
3721
|
registerInstance(this, hostRef);
|
|
3342
|
-
this.toggled = false;
|
|
3343
3722
|
}
|
|
3344
3723
|
get host() { return getElement(this); }
|
|
3724
|
+
/**
|
|
3725
|
+
* If `true`, the button is in the "on" state, otherwise it is in the "off" state.
|
|
3726
|
+
*/
|
|
3727
|
+
toggled = false;
|
|
3345
3728
|
validateToggled(value = this.toggled) {
|
|
3346
3729
|
checkType(value, 'boolean', 'The "toggled" property of the post-togglebutton must be a boolean.');
|
|
3347
3730
|
}
|
|
@@ -3362,7 +3745,7 @@ const PostTogglebutton = class {
|
|
|
3362
3745
|
}
|
|
3363
3746
|
};
|
|
3364
3747
|
render() {
|
|
3365
|
-
return (h(Host, { key: '
|
|
3748
|
+
return (h(Host, { key: 'e4974336def6dbf244b3d63b9aa00e2e7bce1920', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: 'b1179664b0f0651865e973c7afe951102b048877' })));
|
|
3366
3749
|
}
|
|
3367
3750
|
static get watchers() { return {
|
|
3368
3751
|
"toggled": ["validateToggled"]
|