@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,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const _package = require('./package-
|
|
3
|
+
const index = require('./index-0ee3ab4a.js');
|
|
4
|
+
const _package = require('./package-7d11b6ea.js');
|
|
5
5
|
const slide = require('./slide-8ae17ee4.js');
|
|
6
6
|
const index$1 = require('./index-bea4ac42.js');
|
|
7
7
|
const checkNonEmpty = require('./check-non-empty-eeaa8f77.js');
|
|
@@ -15,7 +15,7 @@ const PostClosebutton = class {
|
|
|
15
15
|
}
|
|
16
16
|
get host() { return index.getElement(this); }
|
|
17
17
|
render() {
|
|
18
|
-
return (index.h(index.Host, { key: '
|
|
18
|
+
return (index.h(index.Host, { key: 'c03f50379252ba13992bc3d021989ac07dba9f79', "data-version": _package.version }, index.h("button", { key: 'e97a86bb6e1eace89a1a3a78fb231047f065dd5e', class: "btn btn-icon-close", type: "button" }, index.h("post-icon", { key: 'aca522d4c251a8183c91c2bd4d810d0716a2fe13', "aria-hidden": "true", name: "closex" }), index.h("span", { key: '6873522961b1683d1261163b07ee022f93eed836', class: "visually-hidden" }, index.h("slot", { key: 'bf4b13356c9a0164f1481d1fedc3a78a53e5f8e0' })))));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -153,15 +153,44 @@ function throttle (delay, callback, options) {
|
|
|
153
153
|
return wrapper;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
const
|
|
156
|
+
const focusableSelector = `:where(${[
|
|
157
|
+
'button',
|
|
158
|
+
'input:not([type="hidden"])',
|
|
159
|
+
'[tabindex]',
|
|
160
|
+
'select',
|
|
161
|
+
'textarea',
|
|
162
|
+
'[contenteditable]',
|
|
163
|
+
'a[href]',
|
|
164
|
+
'iframe',
|
|
165
|
+
'audio[controls]',
|
|
166
|
+
'video[controls]',
|
|
167
|
+
'area[href]',
|
|
168
|
+
'details > summary:first-of-type',
|
|
169
|
+
].join(',')})`;
|
|
170
|
+
const focusDisablingSelector = `:where(${[
|
|
171
|
+
'[inert]',
|
|
172
|
+
'[inert] *',
|
|
173
|
+
':disabled',
|
|
174
|
+
'dialog:not([open]) *',
|
|
175
|
+
'[popover]:not(:popover-open) *',
|
|
176
|
+
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
177
|
+
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
178
|
+
'[tabindex^="-"]',
|
|
179
|
+
].join(',')})`;
|
|
180
|
+
function getFocusableChildren(element) {
|
|
181
|
+
return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1090;--global-header-height:72px;--global-header-minimal-height:24px;--local-header-height:112px;--local-header-min-height:56px;--header-height:calc(var(--global-header-height) + var(--local-header-height));z-index:1020;position:relative}@media screen and (min-width: 1024px){:host{--global-header-reduced-height:24px;--main-navigation-height:56px}}@media screen and (max-width: 1023.98px){:host{--global-header-height:64px;--local-header-height:48px;--local-header-min-height:48px;--main-navigation-height:0px}}:host(:not(:has([slot=title]))){--local-header-height:var(--main-navigation-height)}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;align-items:center;position:sticky;padding-inline:var(--post-core-dimension-4);height:var(--global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:3;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:var(--post-core-dimension-12);inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}slot[name=post-logo]{align-self:flex-end}.global-sub{display:flex;align-items:center;gap:var(--post-core-dimension-24)}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--post-core-dimension-8);min-height:var(--local-header-min-height);background:var(--post-core-color-brand-white);transition:box-shadow .2s ease-in-out}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:calc(-1*(var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height));padding-block-start:var(--post-core-dimension-18);box-shadow:var(--post-core-elevation-3)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:var(--post-core-dimension-9);flex-wrap:wrap}.local-header.local-header-mobile-extended{border-bottom:1px solid var(--post-core-color-sandgrey-012)}.local-header:not(.title-header-mobile-extended){box-shadow:var(--post-core-elevation-3)}}.local-sub{margin-inline-end:var(--post-core-dimension-16)}::slotted(.list-inline){margin:-8px 0 !important;z-index:3 !important;position:relative !important}::slotted(h1){margin:0 !important;flex-shrink:10;z-index:3}@media screen and (min-width: 600px){::slotted(h1){margin-inline-start:var(--post-core-dimension-12) !important}}@media screen and (max-width: 599.98px){::slotted(h1){margin-inline-start:var(--post-core-dimension-8) !important}}@media screen and (min-width: 1024px){::slotted(h1){font-size:var(--post-core-font-size-28) !important}}@media screen and (max-width: 1023.98px){::slotted(h1){font-size:var(--post-core-font-size-20) !important;max-width:calc(100vw - var(--post-core-dimension-8) - var(--post-core-dimension-16))}}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--global-header-minimal-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:var(--post-core-color-brand-white)}}@media screen and (max-width: 1023.98px){.navigation{position:fixed;z-index:1;inset-inline:0;background:var(--post-core-color-brand-white);inset-block-end:calc(100vh - var(--header-height))}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:var(--post-core-dimension-16) var(--post-core-dimension-24);padding-inline:var(--post-core-dimension-32)}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended{height:calc(100vh - var(--header-height));display:flex;flex-direction:column}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){background-color:var(--post-core-color-sandgrey-002);gap:var(--post-core-dimension-32)}.navigation-footer{background-color:var(--post-core-color-sandgrey-006);gap:var(--post-core-dimension-24)}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:var(--post-core-dimension-16)}}";
|
|
157
185
|
const PostHeaderStyle0 = postHeaderCss;
|
|
158
186
|
|
|
159
187
|
const PostHeader = class {
|
|
160
188
|
constructor(hostRef) {
|
|
161
189
|
index.registerInstance(this, hostRef);
|
|
162
|
-
this.
|
|
163
|
-
this.mobileMenuExtended = false;
|
|
190
|
+
this.postUpdateDevice = index.createEvent(this, "postUpdateDevice", 7);
|
|
164
191
|
}
|
|
192
|
+
firstFocusableEl;
|
|
193
|
+
lastFocusableEl;
|
|
165
194
|
scrollParent = null;
|
|
166
195
|
mobileMenu;
|
|
167
196
|
mobileMenuAnimation;
|
|
@@ -173,11 +202,28 @@ const PostHeader = class {
|
|
|
173
202
|
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
174
203
|
this.handleResize();
|
|
175
204
|
this.handleScrollEvent();
|
|
205
|
+
this.getFocusableElements();
|
|
176
206
|
}
|
|
177
207
|
get host() { return index.getElement(this); }
|
|
208
|
+
device = null;
|
|
209
|
+
mobileMenuExtended = false;
|
|
178
210
|
frozeBody(isMobileMenuExtended) {
|
|
179
211
|
document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
|
|
212
|
+
if (isMobileMenuExtended) {
|
|
213
|
+
this.host.addEventListener('keydown', e => {
|
|
214
|
+
this.keyboardHandler(e);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
this.host.removeEventListener('keydown', e => {
|
|
219
|
+
this.keyboardHandler(e);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
180
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* An event emitted when the device has changed
|
|
225
|
+
*/
|
|
226
|
+
postUpdateDevice;
|
|
181
227
|
/**
|
|
182
228
|
* Toggles the mobile navigation.
|
|
183
229
|
*/
|
|
@@ -197,6 +243,36 @@ const PostHeader = class {
|
|
|
197
243
|
if (!this.mobileMenuExtended)
|
|
198
244
|
await this.mobileMenuAnimation.finished;
|
|
199
245
|
}
|
|
246
|
+
// Get all the focusable elements in the post-header mobile menu
|
|
247
|
+
getFocusableElements() {
|
|
248
|
+
// Get elements in the correct order (different as the DOM order)
|
|
249
|
+
const focusableEls = [
|
|
250
|
+
...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
|
|
251
|
+
...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-mainnavigation > .back-button, post-megadropdown-trigger')),
|
|
252
|
+
...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
|
|
253
|
+
];
|
|
254
|
+
// Add the main toggle menu button to the list of focusable children
|
|
255
|
+
const focusableChildren = [
|
|
256
|
+
this.host.querySelector('post-togglebutton'),
|
|
257
|
+
...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
|
|
258
|
+
];
|
|
259
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
260
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
261
|
+
}
|
|
262
|
+
keyboardHandler(e) {
|
|
263
|
+
if (e.key === 'Tab' && this.mobileMenuExtended) {
|
|
264
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
265
|
+
// If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
266
|
+
e.preventDefault();
|
|
267
|
+
this.lastFocusableEl.focus();
|
|
268
|
+
}
|
|
269
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
270
|
+
// If Tab and last element is focused, focus goes back to the first element of the megadropdown
|
|
271
|
+
e.preventDefault();
|
|
272
|
+
this.firstFocusableEl.focus();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
200
276
|
handleScrollEvent() {
|
|
201
277
|
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
202
278
|
const st = Math.max(0, this.scrollParent instanceof Document
|
|
@@ -245,11 +321,12 @@ const PostHeader = class {
|
|
|
245
321
|
this.toggleMobileMenu();
|
|
246
322
|
this.mobileMenuAnimation.finish(); // no animation
|
|
247
323
|
}
|
|
248
|
-
const mhh = this.host.shadowRoot.querySelector('.
|
|
324
|
+
const mhh = this.host.shadowRoot.querySelector('.local-header')?.clientHeight;
|
|
249
325
|
this.host.style.setProperty('--main-header-height', `${mhh}px`);
|
|
250
326
|
// Apply only on change for doing work only when necessary
|
|
251
327
|
if (newDevice !== previousDevice) {
|
|
252
328
|
this.device = newDevice;
|
|
329
|
+
this.postUpdateDevice.emit(this.device);
|
|
253
330
|
window.requestAnimationFrame(() => {
|
|
254
331
|
this.switchLanguageSwitchMode();
|
|
255
332
|
});
|
|
@@ -259,12 +336,15 @@ const PostHeader = class {
|
|
|
259
336
|
const variant = this.device === 'desktop' ? 'menu' : 'list';
|
|
260
337
|
this.host.querySelector('post-language-switch')?.setAttribute('variant', variant);
|
|
261
338
|
}
|
|
262
|
-
|
|
339
|
+
renderNavigation() {
|
|
263
340
|
const navigationClasses = ['navigation'];
|
|
264
341
|
if (this.mobileMenuExtended) {
|
|
265
342
|
navigationClasses.push('extended');
|
|
266
343
|
}
|
|
267
|
-
return (index.h(
|
|
344
|
+
return (index.h("div", { ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, index.h("slot", { name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (index.h("div", { class: "navigation-footer" }, index.h("slot", { name: "meta-navigation" }), index.h("slot", { name: "post-language-switch" })))));
|
|
345
|
+
}
|
|
346
|
+
render() {
|
|
347
|
+
return (index.h(index.Host, { key: 'efbf8028f2abf376f497081996dba759f5885630', version: _package.version }, index.h("div", { key: 'ecaaea274045453ce869f36e8a1155626b1818ba', class: "global-header" }, index.h("div", { key: '2fda0d65321ad1cbbc47b731f095e0d9b6694d99', class: "global-sub" }, index.h("div", { key: '24864d5f18c9d923717cc2e996395cff3bd6ce8b', class: "logo" }, index.h("slot", { key: 'ba82d7f62bb845732fe6066bcdc7eef15913c9e6', name: "post-logo" }))), index.h("div", { key: 'a0ddea4e564fca1e286998c73fea75eb8c228428', class: "global-sub" }, this.device === 'desktop' && index.h("slot", { key: '0d7aa11452eb69fe28914ff7787c6dc206fd4009', name: "meta-navigation" }), index.h("slot", { key: 'e92b7b9db6e16e8fcecb1ca74efa63942dd542c5', name: "global-controls" }), this.device === 'desktop' && index.h("slot", { key: 'c68984037a71d5ac54828f6cf2367c3b07e428fc', name: "post-language-switch" }), index.h("div", { key: '70fb5040dc2f000c2afa286bb673ae9cf88521cf', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, index.h("slot", { key: '509fb81812262cd9efdb3a562e48f72b0d29e376', name: "post-togglebutton" })))), index.h("div", { key: '393d1040bad2f85caced5b4a8ff02e30fa5fd5f1', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, index.h("slot", { key: '786cc114aae985a0612d3cb044684290e3026462', name: "title" }), index.h("div", { key: 'd4f68653a09bbf0b222873ed5d23fec6ba9d8f6f', class: "local-sub" }, index.h("slot", { key: '0ad7dda5490964e9a8eae5e0bf66a117882f7a06', name: "local-controls" }), index.h("slot", { key: 'bddc01c7696f456c38c200b330767a0f1b353d88' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
|
|
268
348
|
}
|
|
269
349
|
static get watchers() { return {
|
|
270
350
|
"mobileMenuExtended": ["frozeBody"]
|
|
@@ -288,35 +368,56 @@ const ANIMATION_KEYS = [...ANIMATION_NAMES];
|
|
|
288
368
|
const PostIcon = class {
|
|
289
369
|
constructor(hostRef) {
|
|
290
370
|
index.registerInstance(this, hostRef);
|
|
291
|
-
this.animation = null;
|
|
292
|
-
this.base = null;
|
|
293
|
-
this.flipH = false;
|
|
294
|
-
this.flipV = false;
|
|
295
|
-
this.name = undefined;
|
|
296
|
-
this.rotate = null;
|
|
297
|
-
this.scale = null;
|
|
298
371
|
}
|
|
299
372
|
get host() { return index.getElement(this); }
|
|
373
|
+
/**
|
|
374
|
+
* The name of the animation.
|
|
375
|
+
*/
|
|
376
|
+
animation = null;
|
|
300
377
|
validateAnimation(newValue = this.animation) {
|
|
301
378
|
if (newValue !== undefined)
|
|
302
379
|
index$1.checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon "animation" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);
|
|
303
380
|
}
|
|
381
|
+
/**
|
|
382
|
+
* The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
|
|
383
|
+
*/
|
|
384
|
+
base = null;
|
|
304
385
|
validateBase(newValue = this.base) {
|
|
305
386
|
index$1.checkEmptyOrType(newValue, 'string', 'The post-icon "base" prop should be a string.');
|
|
306
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* When set to `true`, the icon will be flipped horizontally.
|
|
390
|
+
*/
|
|
391
|
+
flipH = false;
|
|
307
392
|
validateFlipH(newValue = this.flipH) {
|
|
308
393
|
index$1.checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipH" prop should be a boolean.');
|
|
309
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* When set to `true`, the icon will be flipped vertically.
|
|
397
|
+
*/
|
|
398
|
+
flipV = false;
|
|
310
399
|
validateFlipV(newValue = this.flipV) {
|
|
311
400
|
index$1.checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipV" prop should be a boolean.');
|
|
312
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* The name/id of the icon (e.g. 1000, 1001, ...).
|
|
404
|
+
*/
|
|
405
|
+
name;
|
|
313
406
|
validateName(newValue = this.name) {
|
|
314
407
|
checkNonEmpty.checkNonEmpty(newValue, 'The post-icon "name" prop is required!.');
|
|
315
408
|
checkType.checkType(newValue, 'string', 'The post-icon "name" prop should be a string.');
|
|
316
409
|
}
|
|
410
|
+
/**
|
|
411
|
+
* The number of degree for the css rotate transformation.
|
|
412
|
+
*/
|
|
413
|
+
rotate = null;
|
|
317
414
|
validateRotate(newValue = this.rotate) {
|
|
318
415
|
index$1.checkEmptyOrType(newValue, 'number', 'The post-icon "rotate" prop should be a number.');
|
|
319
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* The number for the css scale transformation.
|
|
419
|
+
*/
|
|
420
|
+
scale = null;
|
|
320
421
|
validateScale(newValue = this.scale) {
|
|
321
422
|
index$1.checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
|
|
322
423
|
}
|
|
@@ -388,7 +489,7 @@ const PostIcon = class {
|
|
|
388
489
|
this.validateAnimation();
|
|
389
490
|
}
|
|
390
491
|
render() {
|
|
391
|
-
return (index.h(index.Host, { key: '
|
|
492
|
+
return (index.h(index.Host, { key: '6c494ba3cdd2ee173fa99a8ce8ff0e8ab5cf2979', "data-version": _package.version }, index.h("span", { key: 'd9e0192a2788541b97bf3e25468129ac335d44b5', style: this.getStyles() })));
|
|
392
493
|
}
|
|
393
494
|
static get watchers() { return {
|
|
394
495
|
"animation": ["validateAnimation"],
|
|
@@ -409,22 +510,38 @@ const PostLanguageOption = class {
|
|
|
409
510
|
constructor(hostRef) {
|
|
410
511
|
index.registerInstance(this, hostRef);
|
|
411
512
|
this.postChange = index.createEvent(this, "postChange", 7);
|
|
412
|
-
this.code = undefined;
|
|
413
|
-
this.active = undefined;
|
|
414
|
-
this.variant = undefined;
|
|
415
|
-
this.name = undefined;
|
|
416
|
-
this.url = undefined;
|
|
417
513
|
}
|
|
418
514
|
get host() { return index.getElement(this); }
|
|
515
|
+
/**
|
|
516
|
+
* The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, "de".
|
|
517
|
+
*/
|
|
518
|
+
code;
|
|
419
519
|
validateCode(value = this.code) {
|
|
420
520
|
checkType.checkType(value, 'string', 'The "code" property of the post-language-option component must be a string.');
|
|
421
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* If set to `true`, the language option is considered the current language for the page.
|
|
524
|
+
*/
|
|
525
|
+
active;
|
|
422
526
|
validateActiveProp(value = this.active) {
|
|
423
527
|
index$1.checkEmptyOrType(value, 'boolean', 'The "active" property of the post-language-option component must be a boolean value.');
|
|
424
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* The variant of the post-language-switch parent (dynamically set by the parent)
|
|
531
|
+
*/
|
|
532
|
+
variant;
|
|
533
|
+
/**
|
|
534
|
+
* The full name of the language. For example, "Deutsch".
|
|
535
|
+
*/
|
|
536
|
+
name;
|
|
425
537
|
validateName(value = this.name) {
|
|
426
538
|
index$1.checkEmptyOrType(value, 'string', 'The "name" property of the post-language-option component must be a string.');
|
|
427
539
|
}
|
|
540
|
+
/**
|
|
541
|
+
* The URL used for the href attribute of the internal anchor.
|
|
542
|
+
* This field is optional; if not provided, a button will be used internally instead of an anchor.
|
|
543
|
+
*/
|
|
544
|
+
url;
|
|
428
545
|
validateUrl(value = this.url) {
|
|
429
546
|
index$1.checkEmptyOrType(value, 'string', 'The "url" property of the post-language-option component must be a valid URL.');
|
|
430
547
|
}
|
|
@@ -461,7 +578,7 @@ const PostLanguageOption = class {
|
|
|
461
578
|
this.emitChange();
|
|
462
579
|
}
|
|
463
580
|
};
|
|
464
|
-
return (index.h(index.Host, { key: '
|
|
581
|
+
return (index.h(index.Host, { key: 'eff35e907ca174aa239604d8e3c937309d306cd1', "data-version": _package.version, role: this.variant ? `${this.variant}item` : null }, this.url ? (index.h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, index.h("slot", null))) : (index.h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, index.h("slot", null)))));
|
|
465
582
|
}
|
|
466
583
|
static get watchers() { return {
|
|
467
584
|
"code": ["validateCode"],
|
|
@@ -474,27 +591,39 @@ PostLanguageOption.style = PostLanguageOptionStyle0;
|
|
|
474
591
|
|
|
475
592
|
const SWITCH_VARIANTS = ['list', 'menu'];
|
|
476
593
|
|
|
477
|
-
const postLanguageSwitchCss = ":host{display:block}@media screen and (max-width: 1023.
|
|
594
|
+
const postLanguageSwitchCss = ":host{display:block}@media screen and (max-width: 1023.98px){:host{display:flex !important;gap:.5rem}}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-dropdown-container>*{width:100%}.post-language-switch-trigger{cursor:pointer;padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-decoration:none;display:inline-flex;align-items:center;gap:var(--post-core-dimension-6);border-radius:var(--post-core-dimension-24);font-size:var(--post-core-font-size-16);padding:var(--post-core-dimension-3) var(--post-core-dimension-10)}.post-language-switch-trigger{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-switch-trigger:not(:disabled):hover,.post-language-switch-trigger.pretend-hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-switch-trigger post-icon{height:var(--post-core-dimension-16);width:var(--post-core-dimension-16)}";
|
|
478
595
|
const PostLanguageSwitchStyle0 = postLanguageSwitchCss;
|
|
479
596
|
|
|
480
597
|
const PostLanguageSwitch = class {
|
|
481
598
|
constructor(hostRef) {
|
|
482
599
|
index.registerInstance(this, hostRef);
|
|
483
|
-
this.caption = undefined;
|
|
484
|
-
this.description = undefined;
|
|
485
|
-
this.variant = 'list';
|
|
486
|
-
this.activeLang = undefined;
|
|
487
600
|
}
|
|
488
601
|
get host() { return index.getElement(this); }
|
|
602
|
+
/**
|
|
603
|
+
* A title for the list of language options
|
|
604
|
+
*/
|
|
605
|
+
caption;
|
|
489
606
|
validateCaption(value = this.caption) {
|
|
490
607
|
checkType.checkType(value, 'string', 'The "caption" property of the post-language-switch component must be a string.');
|
|
491
608
|
}
|
|
609
|
+
/**
|
|
610
|
+
* A descriptive text for the list of language options
|
|
611
|
+
*/
|
|
612
|
+
description;
|
|
492
613
|
validateDescription(value = this.description) {
|
|
493
614
|
checkType.checkType(value, 'string', 'The "description" property of the post-language-switch component must be a string.');
|
|
494
615
|
}
|
|
616
|
+
/**
|
|
617
|
+
* Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)
|
|
618
|
+
*/
|
|
619
|
+
variant = 'list';
|
|
495
620
|
validateVariant(value = this.variant) {
|
|
496
621
|
index$1.checkEmptyOrOneOf(value, SWITCH_VARIANTS, `The "variant" property of the post-language-switch component must be: ${SWITCH_VARIANTS.join(', ')}`);
|
|
497
622
|
}
|
|
623
|
+
/**
|
|
624
|
+
* The active language of the language switch
|
|
625
|
+
*/
|
|
626
|
+
activeLang;
|
|
498
627
|
connectedCallback() {
|
|
499
628
|
this.updateChildrenVariant();
|
|
500
629
|
// Get the active language based on children's active state
|
|
@@ -558,11 +687,20 @@ const PostListStyle0 = postListCss;
|
|
|
558
687
|
const PostList = class {
|
|
559
688
|
constructor(hostRef) {
|
|
560
689
|
index.registerInstance(this, hostRef);
|
|
561
|
-
this.titleId = undefined;
|
|
562
|
-
this.titleHidden = false;
|
|
563
|
-
this.horizontal = false;
|
|
564
690
|
}
|
|
565
691
|
get host() { return index.getElement(this); }
|
|
692
|
+
/**
|
|
693
|
+
* The unique title of the list that is also referenced in the labelledby
|
|
694
|
+
*/
|
|
695
|
+
titleId;
|
|
696
|
+
/**
|
|
697
|
+
* If `true`, the list title will be hidden. Otherwise, it will be displayed.`
|
|
698
|
+
*/
|
|
699
|
+
titleHidden = false;
|
|
700
|
+
/**
|
|
701
|
+
* The list can become horizontal by setting `horizontal="true"` or just `horizontal`
|
|
702
|
+
*/
|
|
703
|
+
horizontal = false;
|
|
566
704
|
titleEl;
|
|
567
705
|
componentWillLoad() {
|
|
568
706
|
/**
|
|
@@ -579,7 +717,7 @@ const PostList = class {
|
|
|
579
717
|
}
|
|
580
718
|
}
|
|
581
719
|
render() {
|
|
582
|
-
return (index.h(index.Host, { key: '
|
|
720
|
+
return (index.h(index.Host, { key: 'bdd973098d8b2a74635d489dca8f0f6825e31c51', "data-version": _package.version }, index.h("div", { key: '9dcd6ca7069658c3e7f0d14fc130d18ebe522acb', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, index.h("slot", { key: 'ad51f345b2c120796d02dbc3d6815a58addc7fb4' })), index.h("div", { key: '47fddd7b977c85c195757f461c0ec009270cdb8b', role: "list", "aria-labelledby": this.titleId }, index.h("slot", { key: '176662b40ca47b6aeeded26256bc84bdee6483a6', name: "post-list-item" }))));
|
|
583
721
|
}
|
|
584
722
|
};
|
|
585
723
|
PostList.style = PostListStyle0;
|
|
@@ -596,7 +734,7 @@ const PostListItem = class {
|
|
|
596
734
|
this.host.setAttribute('slot', 'post-list-item');
|
|
597
735
|
}
|
|
598
736
|
render() {
|
|
599
|
-
return (index.h(index.Host, { key: '
|
|
737
|
+
return (index.h(index.Host, { key: '8e209e77859bd05d62cae41aec9dec6fb2e820cb', role: "listitem", slot: "post-list-item" }, index.h("slot", { key: 'ce79a335e80401465b74208957e22983d6df4ce0' })));
|
|
600
738
|
}
|
|
601
739
|
};
|
|
602
740
|
PostListItem.style = PostListItemStyle0;
|
|
@@ -607,9 +745,12 @@ const PostLogoStyle0 = postLogoCss;
|
|
|
607
745
|
const PostLogo = class {
|
|
608
746
|
constructor(hostRef) {
|
|
609
747
|
index.registerInstance(this, hostRef);
|
|
610
|
-
this.url = undefined;
|
|
611
748
|
}
|
|
612
749
|
get host() { return index.getElement(this); }
|
|
750
|
+
/**
|
|
751
|
+
* The URL to which the user is redirected upon clicking the logo.
|
|
752
|
+
*/
|
|
753
|
+
url;
|
|
613
754
|
validateUrl() {
|
|
614
755
|
index$1.checkEmptyOrUrl(this.url, 'The "url" property of the post-logo is invalid');
|
|
615
756
|
}
|
|
@@ -625,7 +766,7 @@ const PostLogo = class {
|
|
|
625
766
|
render() {
|
|
626
767
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
627
768
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
628
|
-
return (index.h(index.Host, { key: '
|
|
769
|
+
return (index.h(index.Host, { key: 'd5f61d2740588571b77c9317d535b5c12c9ba996', "data-version": _package.version }, index.h(LogoTag, { key: '95d19b08bae7e4137f43c0b7e345fa44ed1a6e9e', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, index.h("span", { key: 'd7a4e97a9685ebc099e57737926d0fbe6d8ed12f', class: "description" }, index.h("slot", { key: '6b08a53ad00b103930f0b1aab1d305ae77feccba', onSlotchange: () => this.checkDescription() })), index.h("svg", { key: 'a7adc544f620325bdec5fa3fbc5a880d10a85f7e', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, index.h("g", { key: 'f68e9b4b0ef8b0d4b34a47a23cb4f0a0e04b5456', id: "Logo" }, index.h("rect", { key: 'b21a948f30baa4808182ccee37822315d87282eb', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), index.h("polygon", { key: '57ec911498cb069aaa80b4857447c1da3aa76959', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), index.h("path", { key: 'fed41d70f4532da5769cbc51740e21520568af7f', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
629
770
|
}
|
|
630
771
|
static get watchers() { return {
|
|
631
772
|
"url": ["validateUrl"]
|
|
@@ -633,22 +774,45 @@ const PostLogo = class {
|
|
|
633
774
|
};
|
|
634
775
|
PostLogo.style = PostLogoStyle0;
|
|
635
776
|
|
|
636
|
-
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}";
|
|
777
|
+
const postMainnavigationCss = "post-mainnavigation{flex:0 0 auto}post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}post-mainnavigation post-list-item post-megadropdown-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item post-megadropdown-trigger button{flex:0 0 fit-content;white-space:nowrap;display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:var(--post-core-dimension-4)}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.98px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-16)}}@media screen and (max-width: 599.98px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-14)}}@media screen and (min-width: 1024px){post-mainnavigation{display:block}post-mainnavigation nav{max-width:100vw;background:var(--post-core-color-brand-white);max-height:var(--main-navigation-height);user-select:none;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{position:absolute;inset-block:0;overflow:hidden}post-mainnavigation .left-scroll-button button,post-mainnavigation .right-scroll-button button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;background:var(--post-core-color-brand-white);padding:var(--post-core-dimension-16);box-shadow:var(--post-core-elevation-5);line-height:var(--post-core-line-height-100);height:100%}post-mainnavigation .left-scroll-button button post-icon,post-mainnavigation .right-scroll-button button post-icon{font-size:1rem}post-mainnavigation .left-scroll-button{inset-inline-start:0;padding-inline-end:2rem}post-mainnavigation .right-scroll-button{inset-inline-end:0;padding-inline-start:2rem}post-mainnavigation post-list{margin-inline:var(--post-core-dimension-4)}post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{position:sticky;padding-inline:var(--post-core-dimension-12);height:var(--main-navigation-height);gap:var(--post-core-dimension-4);font-size:var(--post-core-font-size-16);border-block:0 solid rgba(0,0,0,0);border-block-end-color:currentColor}}@media screen and (min-width: 1024px)and (max-width: 1023.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{z-index:3}}@media screen and (min-width: 1024px)and (min-width: 1024px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{z-index:4}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{border-block-width:var(--post-core-dimension-2)}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{border-block-width:var(--post-core-dimension-4);font-weight:var(--post-core-font-weight-700)}}@media screen and (min-width: 1024px)and (max-width: 599.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{font-size:var(--post-core-font-size-14)}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:var(--post-core-dimension-12);transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{content:\"\";mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}}@media screen and (min-width: 1024px){post-mainnavigation post-megadropdown button:not(.btn-icon-close),post-mainnavigation post-megadropdown a{width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative}post-mainnavigation post-megadropdown button:not(.btn-icon-close)::before,post-mainnavigation post-megadropdown a::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::before,post-mainnavigation post-megadropdown a:hover::before{height:var(--post-core-dimension-3)}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::after,post-mainnavigation post-megadropdown a:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}}@media screen and (min-width: 1024px){post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.98px){post-mainnavigation nav{transform:none !important}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{display:none}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative}post-mainnavigation post-list-item>a::before,post-mainnavigation post-list-item>button::before,post-mainnavigation post-list-item post-megadropdown-trigger button::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}post-mainnavigation post-list-item>a:hover::before,post-mainnavigation post-list-item>button:hover::before,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::before{height:var(--post-core-dimension-3)}post-mainnavigation post-list-item>a:hover::after,post-mainnavigation post-list-item>button:hover::after,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}}post-mainnavigation .back-button .btn{padding-inline:0}";
|
|
637
778
|
const PostMainnavigationStyle0 = postMainnavigationCss;
|
|
638
779
|
|
|
780
|
+
const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
|
|
781
|
+
const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
|
|
782
|
+
const NAVIGATION_LIST_SELECTOR = 'post-list:not(post-megadropdown *) > [role="list"]';
|
|
783
|
+
const NAVIGATION_ITEM_SELECTOR = ':is(post-list-item > a, post-list-item > post-megadropdown-trigger > button):not(post-megadropdown *)';
|
|
639
784
|
const PostMainnavigation = class {
|
|
640
785
|
constructor(hostRef) {
|
|
641
786
|
index.registerInstance(this, hostRef);
|
|
642
|
-
this.postToggle = index.createEvent(this, "postToggle", 7);
|
|
643
787
|
}
|
|
644
788
|
header;
|
|
789
|
+
navbar;
|
|
790
|
+
rightScrollButton;
|
|
791
|
+
leftScrollButton;
|
|
792
|
+
scrollRepeatInterval;
|
|
793
|
+
navbarDisableTimer;
|
|
794
|
+
mutationObserver = new MutationObserver(async (mutations) => {
|
|
795
|
+
// Wait for all elements to be hydrated
|
|
796
|
+
await Promise.all(mutations
|
|
797
|
+
.flatMap((mutation) => Array.from(mutation.addedNodes))
|
|
798
|
+
.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
|
|
799
|
+
// Recalculate scrollability after DOM changes
|
|
800
|
+
this.checkScrollability();
|
|
801
|
+
});
|
|
645
802
|
get host() { return index.getElement(this); }
|
|
803
|
+
canScrollLeft = false;
|
|
804
|
+
canScrollRight = false;
|
|
805
|
+
translateAmount = 0;
|
|
646
806
|
/**
|
|
647
|
-
*
|
|
807
|
+
* Update navbar translation when 'translateAmount' changes and recalculate scrollability
|
|
648
808
|
*/
|
|
649
|
-
|
|
809
|
+
onTranslateAmountChanges(value) {
|
|
810
|
+
this.navbar.style.transform = `translateX(-${value}px)`;
|
|
811
|
+
this.checkScrollability();
|
|
812
|
+
}
|
|
650
813
|
/**
|
|
651
814
|
* Retrieves a reference to the closest 'post-header' element when the main navigation is added to the DOM.
|
|
815
|
+
* This ensures that we can interact with the header for mobile menu toggling.
|
|
652
816
|
*/
|
|
653
817
|
connectedCallback() {
|
|
654
818
|
this.header = this.host.closest('post-header');
|
|
@@ -658,110 +822,324 @@ const PostMainnavigation = class {
|
|
|
658
822
|
*/
|
|
659
823
|
disconnectedCallback() {
|
|
660
824
|
this.header = null;
|
|
825
|
+
this.mutationObserver.disconnect();
|
|
826
|
+
}
|
|
827
|
+
componentDidLoad() {
|
|
828
|
+
setTimeout(() => this.checkScrollability()); // Initial check to determine if scrolling is needed
|
|
829
|
+
this.mutationObserver.observe(this.navigationList, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
|
|
830
|
+
window.addEventListener('resize', // Recheck scrollability on window resize
|
|
831
|
+
throttle(100, () => this.checkScrollability()));
|
|
832
|
+
// Handle focus changes and adjust scroll as needed
|
|
833
|
+
this.navbar.addEventListener('focusin', e => this.adjustTranslation(e));
|
|
661
834
|
}
|
|
662
835
|
handleBackButtonClick() {
|
|
663
836
|
if (this.header)
|
|
664
837
|
this.header.toggleMobileMenu();
|
|
665
838
|
}
|
|
839
|
+
/**
|
|
840
|
+
* Moves focus on the navbar and adjusts scrolling to bring focused element into view.
|
|
841
|
+
*/
|
|
842
|
+
adjustTranslation(e) {
|
|
843
|
+
const focusedElement = e.target;
|
|
844
|
+
if (!this.canScroll || !focusedElement.matches(NAVIGATION_ITEM_SELECTOR))
|
|
845
|
+
return;
|
|
846
|
+
// We need to move the element into the view before it is focused to avoid browser default behavior
|
|
847
|
+
e.preventDefault();
|
|
848
|
+
this.withoutTransition(() => {
|
|
849
|
+
// Try scrolling in both directions, only the necessary translation will actually occur
|
|
850
|
+
this.translateRightTo(focusedElement);
|
|
851
|
+
this.translateLeftTo(focusedElement);
|
|
852
|
+
focusedElement.focus();
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* Checks if scrolling is possible in either direction (left or right) and updates the state accordingly.
|
|
857
|
+
*/
|
|
858
|
+
checkScrollability() {
|
|
859
|
+
const { scrollWidth, clientWidth } = this.navbar;
|
|
860
|
+
const couldScroll = this.canScroll;
|
|
861
|
+
if (scrollWidth === clientWidth) {
|
|
862
|
+
// If scroll width equals client width, scrolling is disabled in both directions
|
|
863
|
+
this.canScrollLeft = this.canScrollRight = false;
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
this.canScrollLeft = this.translateAmount !== 0; // Scrolling left is possible if not at the start
|
|
867
|
+
this.canScrollRight = clientWidth + this.translateAmount !== scrollWidth; // Scrolling right is possible if not at the end
|
|
868
|
+
}
|
|
869
|
+
if (couldScroll && !this.canScroll) {
|
|
870
|
+
this.withoutTransition(() => (this.translateAmount = 0));
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Returns whether scrolling is enabled in either the left or right direction.
|
|
875
|
+
*/
|
|
876
|
+
get canScroll() {
|
|
877
|
+
return this.canScrollLeft || this.canScrollRight;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Handles the scrolling behavior when a user clicks on the left or right scroll buttons.
|
|
881
|
+
*/
|
|
882
|
+
handleScrollButtonClick(direction) {
|
|
883
|
+
if (!this.canScroll)
|
|
884
|
+
return;
|
|
885
|
+
// Disable interaction with the navbar during scrolling
|
|
886
|
+
this.disableNavbar();
|
|
887
|
+
// Perform the initial scroll action
|
|
888
|
+
this.scroll(direction);
|
|
889
|
+
// Repeat the scrolling action while the button is held down
|
|
890
|
+
this.scrollRepeatInterval = setInterval(() => {
|
|
891
|
+
this.scroll(direction);
|
|
892
|
+
}, SCROLL_REPEAT_INTERVAL);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Stops the repeated scrolling when the mouse button is released.
|
|
896
|
+
*/
|
|
897
|
+
stopScrolling() {
|
|
898
|
+
if (this.scrollRepeatInterval)
|
|
899
|
+
clearInterval(this.scrollRepeatInterval);
|
|
900
|
+
}
|
|
901
|
+
scroll(direction) {
|
|
902
|
+
const navigationItems = Array.from(this.navigationItems);
|
|
903
|
+
if (direction === 'left')
|
|
904
|
+
navigationItems.reverse();
|
|
905
|
+
for (const item of navigationItems) {
|
|
906
|
+
const couldScroll = direction === 'left' ? this.translateLeftTo(item) : this.translateRightTo(item);
|
|
907
|
+
if (couldScroll)
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
translateRightTo(navigationItem) {
|
|
912
|
+
const itemRightEdgePosition = navigationItem.offsetLeft + navigationItem.offsetWidth + this.getFocusMargin(navigationItem);
|
|
913
|
+
const lastVisiblePosition = this.navbar.clientWidth + this.translateAmount;
|
|
914
|
+
// If the item is already fully visible, don't scroll
|
|
915
|
+
if (itemRightEdgePosition < lastVisiblePosition)
|
|
916
|
+
return false;
|
|
917
|
+
const maxTranslateAmount = this.navbar.scrollWidth - this.navbar.clientWidth;
|
|
918
|
+
const newRightEdgePosition = itemRightEdgePosition + this.rightScrollButton.clientWidth - this.navbar.clientWidth;
|
|
919
|
+
this.translateAmount = Math.min(maxTranslateAmount, newRightEdgePosition);
|
|
920
|
+
return true;
|
|
921
|
+
}
|
|
922
|
+
translateLeftTo(navigationItem) {
|
|
923
|
+
const itemLeftEdgePosition = navigationItem.offsetLeft - this.getFocusMargin(navigationItem);
|
|
924
|
+
const firstVisiblePosition = this.translateAmount;
|
|
925
|
+
// If the item is already fully visible, don't scroll
|
|
926
|
+
if (itemLeftEdgePosition > firstVisiblePosition)
|
|
927
|
+
return false;
|
|
928
|
+
const minTranslateAmount = 0;
|
|
929
|
+
const newRightEdgePosition = itemLeftEdgePosition - this.leftScrollButton.clientWidth;
|
|
930
|
+
this.translateAmount = Math.max(minTranslateAmount, newRightEdgePosition);
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Calculate the margin required for focus outline around navigation items
|
|
935
|
+
*/
|
|
936
|
+
getFocusMargin(navigationItem) {
|
|
937
|
+
const { outlineWidth, outlineOffset } = getComputedStyle(navigationItem);
|
|
938
|
+
return parseInt(outlineWidth) + parseInt(outlineOffset) + 1;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Returns the navigation list container element
|
|
942
|
+
*/
|
|
943
|
+
get navigationList() {
|
|
944
|
+
return this.navbar.querySelector(NAVIGATION_LIST_SELECTOR);
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Returns the navigation items
|
|
948
|
+
*/
|
|
949
|
+
get navigationItems() {
|
|
950
|
+
return this.navbar.querySelectorAll(NAVIGATION_ITEM_SELECTOR);
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Temporarily disables interactions with the navbar during scrolling to prevent accidental clicks.
|
|
954
|
+
* Re-enables interactions after a brief delay to avoid blocking the user entirely.
|
|
955
|
+
*/
|
|
956
|
+
disableNavbar() {
|
|
957
|
+
if (this.navbarDisableTimer)
|
|
958
|
+
clearTimeout(this.navbarDisableTimer);
|
|
959
|
+
this.navbar.style.pointerEvents = 'none';
|
|
960
|
+
this.navbarDisableTimer = setTimeout(() => {
|
|
961
|
+
this.navbar.style.pointerEvents = 'initial';
|
|
962
|
+
}, NAVBAR_DISABLE_DURATION);
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Allows to translate the navbar without a transition
|
|
966
|
+
*/
|
|
967
|
+
withoutTransition(callback) {
|
|
968
|
+
const transition = this.navbar.style.transition;
|
|
969
|
+
this.navbar.style.transition = 'none';
|
|
970
|
+
callback();
|
|
971
|
+
setTimeout(() => {
|
|
972
|
+
this.navbar.style.transition = transition;
|
|
973
|
+
});
|
|
974
|
+
}
|
|
666
975
|
render() {
|
|
667
|
-
return (index.h(index.Host, { key: '
|
|
976
|
+
return (index.h(index.Host, { key: '3280c55d0f8e7aec6e1dc3f59744114b2557cb04', slot: "post-mainnavigation" }, index.h("div", { key: '446ede19ef62a21022a771edb8a6e8eb30a5c5d3', onClick: () => this.handleBackButtonClick(), class: "back-button" }, index.h("slot", { key: '5e923b62133d3452676445349624157fd7d3d957', name: "back-button" })), index.h("nav", { key: 'd67723ba6b42ec2b083197091ec7226dc258897e', ref: el => (this.navbar = el) }, index.h("slot", { key: 'ea1a0fd7f76e02b89789713a49fc4d7fd6e8a022' })), index.h("div", { key: '1a3d640acfe23ae5c5f9ab26a7bca9c3c2bc4434', class: `left-scroll-button${this.canScrollLeft ? '' : ' d-none'}`, "aria-hidden": "true" }, index.h("button", { key: 'a3260bba8104bf9155120e04fed6ba0aa102e529', type: "button", tabindex: "-1", ref: el => (this.leftScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('left') }, index.h("post-icon", { key: '0bba0a76f93098267be8432636391641f55d5df8', "aria-hidden": "true", name: "chevronleft" }))), index.h("div", { key: '401ef6821f258737d17ed54ae1c577cc4783a3f9', class: `right-scroll-button${this.canScrollRight ? '' : ' d-none'}`, "aria-hidden": "true" }, index.h("button", { key: 'd964f4b74ad8fef86115b12fcda12cc54da936f3', type: "button", tabindex: "-1", ref: el => (this.rightScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('right') }, index.h("post-icon", { key: '5758f48df24b4a3ea241f43464b448878e31977d', "aria-hidden": "true", name: "chevronright" })))));
|
|
668
977
|
}
|
|
978
|
+
static get watchers() { return {
|
|
979
|
+
"translateAmount": ["onTranslateAmountChanges"]
|
|
980
|
+
}; }
|
|
669
981
|
};
|
|
670
982
|
PostMainnavigation.style = PostMainnavigationStyle0;
|
|
671
983
|
|
|
672
|
-
const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}*,::before,::after{box-sizing:border-box}post-
|
|
984
|
+
const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{--post-main-header-height:56px;--post-global-header-height:72px;--post-header-height:calc(var(--post-global-header-height) + var(--post-main-header-height));box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;z-index:1;border-top:1px solid #e1e0dc;width:100%;top:100%;left:0;border-radius:0}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{--post-global-header-height:64px;z-index:4;top:0 !important;left:0;width:100%;position:fixed;height:calc(100vh - var(--post-header-height));max-height:calc(100vh - var(--header-height));border-top:unset;overflow:auto}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-top:0;margin-bottom:8px;font-weight:900}.megadropdown h2 a{text-decoration:none;font-weight:inherit;border-bottom:0;border-top:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)){padding:15px 12px 14px 8px;border-bottom:1px solid #050400}.megadropdown post-list .list-title h3 a{padding-block:15px 14px;padding-inline-start:8px;border-radius:0;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}.megadropdown post-list .list-title h3 a:hover::before{height:var(--post-core-dimension-3)}.megadropdown post-list .list-title h3 a:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)){padding:15px 12px 14px 8px;border-bottom:1px solid #050400}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-bottom:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{display:block}}.megadropdown .close-button{position:absolute;top:1rem;right:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}";
|
|
673
985
|
const PostMegadropdownStyle0 = postMegadropdownCss;
|
|
674
986
|
|
|
675
987
|
const PostMegadropdown = class {
|
|
676
988
|
constructor(hostRef) {
|
|
677
989
|
index.registerInstance(this, hostRef);
|
|
678
990
|
this.postToggleMegadropdown = index.createEvent(this, "postToggleMegadropdown", 7);
|
|
679
|
-
this.isVisible = false;
|
|
680
|
-
this.animationClass = null;
|
|
681
991
|
}
|
|
682
|
-
|
|
992
|
+
header;
|
|
993
|
+
firstFocusableEl;
|
|
994
|
+
lastFocusableEl;
|
|
995
|
+
device;
|
|
683
996
|
get host() { return index.getElement(this); }
|
|
997
|
+
/** Tracks the currently active dropdown instance. */
|
|
998
|
+
static activeDropdown = null;
|
|
999
|
+
/**
|
|
1000
|
+
* Holds the current visibility state of the dropdown.
|
|
1001
|
+
* This state is internally managed to track whether the dropdown is open (`true`) or closed (`false`),
|
|
1002
|
+
* and updates automatically when the dropdown is toggled.
|
|
1003
|
+
*/
|
|
1004
|
+
isVisible = false;
|
|
1005
|
+
/** Holds the current animation class. */
|
|
1006
|
+
animationClass = null;
|
|
684
1007
|
/**
|
|
685
1008
|
* Emits when the dropdown is shown or hidden.
|
|
686
1009
|
* The event payload is a boolean: `true` when the dropdown was opened, `false` when it was closed.
|
|
687
1010
|
**/
|
|
688
1011
|
postToggleMegadropdown;
|
|
689
|
-
|
|
690
|
-
this.
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}
|
|
698
|
-
});
|
|
1012
|
+
disconnectedCallback() {
|
|
1013
|
+
this.removeOutsideClickListener();
|
|
1014
|
+
if (PostMegadropdown.activeDropdown === this) {
|
|
1015
|
+
PostMegadropdown.activeDropdown = null;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
componentWillRender() {
|
|
1019
|
+
this.getFocusableElements();
|
|
699
1020
|
}
|
|
700
1021
|
/**
|
|
701
1022
|
* Toggles the dropdown visibility based on its current state.
|
|
702
1023
|
*/
|
|
703
|
-
async toggle(
|
|
1024
|
+
async toggle() {
|
|
704
1025
|
if (this.isVisible) {
|
|
705
1026
|
this.hide();
|
|
706
1027
|
}
|
|
707
1028
|
else {
|
|
708
|
-
await this.show(
|
|
1029
|
+
await this.show();
|
|
709
1030
|
}
|
|
710
1031
|
}
|
|
711
1032
|
/**
|
|
712
|
-
* Displays the
|
|
713
|
-
*
|
|
714
|
-
* @param target - The HTML element relative to which the popover dropdown should be displayed.
|
|
1033
|
+
* Displays the dropdown.
|
|
715
1034
|
*/
|
|
716
|
-
async show(
|
|
717
|
-
if (this
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
1035
|
+
async show() {
|
|
1036
|
+
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
1037
|
+
// Close the previously active dropdown without animation
|
|
1038
|
+
PostMegadropdown.activeDropdown.forceClose();
|
|
1039
|
+
}
|
|
1040
|
+
this.isVisible = true;
|
|
1041
|
+
this.host.addEventListener('keydown', e => this.keyboardHandler(e));
|
|
1042
|
+
this.animationClass = 'slide-in';
|
|
1043
|
+
PostMegadropdown.activeDropdown = this;
|
|
1044
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1045
|
+
this.addOutsideClickListener();
|
|
724
1046
|
}
|
|
725
1047
|
/**
|
|
726
|
-
* Hides the
|
|
1048
|
+
* Hides the dropdown with an animation.
|
|
727
1049
|
*/
|
|
728
|
-
hide() {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
1050
|
+
async hide() {
|
|
1051
|
+
this.animationClass = 'slide-out';
|
|
1052
|
+
this.host.removeEventListener('keydown', e => this.keyboardHandler(e));
|
|
1053
|
+
}
|
|
1054
|
+
connectedCallback() {
|
|
1055
|
+
this.header = this.host.closest('post-header');
|
|
1056
|
+
if (this.header) {
|
|
1057
|
+
this.header.addEventListener('postUpdateDevice', (event) => (this.device = event.detail));
|
|
734
1058
|
}
|
|
735
1059
|
}
|
|
736
|
-
|
|
737
|
-
|
|
1060
|
+
/**
|
|
1061
|
+
* Forces the dropdown to close without animation.
|
|
1062
|
+
*/
|
|
1063
|
+
forceClose() {
|
|
1064
|
+
this.isVisible = false;
|
|
1065
|
+
this.animationClass = null;
|
|
1066
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1067
|
+
this.removeOutsideClickListener();
|
|
738
1068
|
}
|
|
739
|
-
|
|
740
|
-
this.
|
|
1069
|
+
handleAnimationEnd() {
|
|
1070
|
+
if (this.animationClass === 'slide-out') {
|
|
1071
|
+
this.isVisible = false;
|
|
1072
|
+
this.animationClass = null;
|
|
1073
|
+
this.postToggleMegadropdown.emit(this.isVisible);
|
|
1074
|
+
this.removeOutsideClickListener();
|
|
1075
|
+
}
|
|
741
1076
|
}
|
|
742
|
-
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
1077
|
+
handleClickOutside = (event) => {
|
|
1078
|
+
const target = event.target;
|
|
1079
|
+
if (this.host.contains(target)) {
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
if (target instanceof HTMLElement) {
|
|
1083
|
+
const trigger = target.closest('post-megadropdown-trigger');
|
|
1084
|
+
if (trigger) {
|
|
1085
|
+
const targetDropdownId = trigger.getAttribute('for');
|
|
1086
|
+
if (targetDropdownId !== this.host.id) {
|
|
1087
|
+
return;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
this.hide();
|
|
1092
|
+
};
|
|
1093
|
+
addOutsideClickListener() {
|
|
1094
|
+
document.addEventListener('mousedown', this.handleClickOutside);
|
|
1095
|
+
}
|
|
1096
|
+
removeOutsideClickListener() {
|
|
1097
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
1098
|
+
}
|
|
1099
|
+
getFocusableElements() {
|
|
1100
|
+
const focusableEls = Array.from(this.host.querySelectorAll('post-list-item, h3, .back-button'));
|
|
1101
|
+
const focusableChildren = focusableEls.flatMap(el => Array.from(getFocusableChildren(el)));
|
|
1102
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
1103
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
1104
|
+
}
|
|
1105
|
+
// Loop through the focusable children
|
|
1106
|
+
keyboardHandler(e) {
|
|
1107
|
+
if (e.key === 'Tab' && this.device !== 'desktop') {
|
|
1108
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
1109
|
+
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
1110
|
+
e.preventDefault();
|
|
1111
|
+
this.lastFocusableEl.focus();
|
|
1112
|
+
}
|
|
1113
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
1114
|
+
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
1115
|
+
e.preventDefault();
|
|
1116
|
+
this.firstFocusableEl.focus();
|
|
1117
|
+
}
|
|
747
1118
|
}
|
|
748
1119
|
}
|
|
749
1120
|
render() {
|
|
750
|
-
|
|
1121
|
+
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
1122
|
+
return (index.h(index.Host, { key: '5aa08b01be715325182c245e1b0ae2456bcc5df6' }, index.h("div", { key: '0737c9368ecbffac59bbdf47fabac3f3b94ae7bb', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, index.h("div", { key: 'efe49f3f9cdcd99e2feca78b772c944405e19f21', class: "megadropdown" }, index.h("div", { key: '14dd7ff2f7e7b1eb91f2673a25d7ccafffe4f9d0', onClick: () => this.hide(), class: "back-button" }, index.h("slot", { key: '554e30e6408c0bef0549f5e2c31dcd8b90ceee40', name: "back-button" })), index.h("div", { key: '4e7335152d7b6649918adf075213ebbf8b8ddeaa', onClick: () => this.hide(), class: "close-button" }, index.h("slot", { key: 'db90f3a5334ce723c0ee672a96167197ca25b545', name: "close-button" })), index.h("slot", { key: 'b11b1d16147f88103f2eb24c8dd21394de53f69c', name: "megadropdown-title" }), index.h("div", { key: '6d837c1a70f66f00097fb531058750fbac6fd41a', class: "megadropdown-content" }, index.h("slot", { key: 'be685185f04e44d867167f918494d086856b5928' }))))));
|
|
751
1123
|
}
|
|
752
1124
|
};
|
|
753
1125
|
PostMegadropdown.style = PostMegadropdownStyle0;
|
|
754
1126
|
|
|
755
|
-
const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100
|
|
1127
|
+
const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100%;position:relative;z-index:3}";
|
|
756
1128
|
const PostMegadropdownTriggerStyle0 = postMegadropdownTriggerCss;
|
|
757
1129
|
|
|
758
1130
|
const PostMegadropdownTrigger = class {
|
|
759
1131
|
constructor(hostRef) {
|
|
760
1132
|
index.registerInstance(this, hostRef);
|
|
761
|
-
this.for = undefined;
|
|
762
|
-
this.ariaExpanded = false;
|
|
763
1133
|
}
|
|
1134
|
+
/**
|
|
1135
|
+
* ID of the mega dropdown element that this trigger is linked to. Used to open and close the specified mega dropdown.
|
|
1136
|
+
*/
|
|
1137
|
+
for;
|
|
764
1138
|
get host() { return index.getElement(this); }
|
|
1139
|
+
/**
|
|
1140
|
+
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated mega dropdown is expanded or collapsed.
|
|
1141
|
+
*/
|
|
1142
|
+
ariaExpanded = false;
|
|
765
1143
|
/**
|
|
766
1144
|
* Reference to the slotted button within the trigger, if present.
|
|
767
1145
|
* Used to manage click and key events for mega dropdown control.
|
|
@@ -782,7 +1160,7 @@ const PostMegadropdownTrigger = class {
|
|
|
782
1160
|
}
|
|
783
1161
|
handleToggle() {
|
|
784
1162
|
if (this.megadropdown) {
|
|
785
|
-
this.megadropdown.toggle(
|
|
1163
|
+
this.megadropdown.toggle();
|
|
786
1164
|
}
|
|
787
1165
|
else {
|
|
788
1166
|
console.warn(`No post-megadropdown found with ID: ${this.for}`);
|
|
@@ -811,7 +1189,7 @@ const PostMegadropdownTrigger = class {
|
|
|
811
1189
|
}
|
|
812
1190
|
}
|
|
813
1191
|
render() {
|
|
814
|
-
return (index.h(index.Host, { key: '
|
|
1192
|
+
return (index.h(index.Host, { key: '2e009cb0dbfd81785d3a8ce5802a4fab0e84a52e', "data-version": _package.version, "tab-index": "-1" }, index.h("button", { key: 'd77d9a5eb5786a63cf7453c639647adc705892bc' }, index.h("slot", { key: '19f4b17dc2d073b0770c33d6acfb763c1e47735a' }))));
|
|
815
1193
|
}
|
|
816
1194
|
static get watchers() { return {
|
|
817
1195
|
"for": ["validateControlFor"]
|
|
@@ -819,34 +1197,6 @@ const PostMegadropdownTrigger = class {
|
|
|
819
1197
|
};
|
|
820
1198
|
PostMegadropdownTrigger.style = PostMegadropdownTriggerStyle0;
|
|
821
1199
|
|
|
822
|
-
const focusableSelector = `:where(${[
|
|
823
|
-
'button',
|
|
824
|
-
'input:not([type="hidden"])',
|
|
825
|
-
'[tabindex]',
|
|
826
|
-
'select',
|
|
827
|
-
'textarea',
|
|
828
|
-
'[contenteditable]',
|
|
829
|
-
'a[href]',
|
|
830
|
-
'iframe',
|
|
831
|
-
'audio[controls]',
|
|
832
|
-
'video[controls]',
|
|
833
|
-
'area[href]',
|
|
834
|
-
'details > summary:first-of-type',
|
|
835
|
-
].join(',')})`;
|
|
836
|
-
const focusDisablingSelector = `:where(${[
|
|
837
|
-
'[inert]',
|
|
838
|
-
'[inert] *',
|
|
839
|
-
':disabled',
|
|
840
|
-
'dialog:not([open]) *',
|
|
841
|
-
'[popover]:not(:popover-open) *',
|
|
842
|
-
'details:not([open]) > *:not(details > summary:first-of-type)',
|
|
843
|
-
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
844
|
-
'[tabindex^="-"]',
|
|
845
|
-
].join(',')})`;
|
|
846
|
-
function getFocusableChildren(element) {
|
|
847
|
-
return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
|
|
848
|
-
}
|
|
849
|
-
|
|
850
1200
|
const postMenuCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}post-popovercontainer{padding:var(--post-menu-padding);background-color:var(--post-menu-bg, #ffffff);border-color:var(--post-menu-bg, #ffffff)}.popover-container{display:flex;flex-direction:column}";
|
|
851
1201
|
const PostMenuStyle0 = postMenuCss;
|
|
852
1202
|
|
|
@@ -854,8 +1204,6 @@ const PostMenu = class {
|
|
|
854
1204
|
constructor(hostRef) {
|
|
855
1205
|
index.registerInstance(this, hostRef);
|
|
856
1206
|
this.toggleMenu = index.createEvent(this, "toggleMenu", 7);
|
|
857
|
-
this.placement = 'bottom';
|
|
858
|
-
this.isVisible = false;
|
|
859
1207
|
}
|
|
860
1208
|
popoverRef;
|
|
861
1209
|
lastFocusedElement = null;
|
|
@@ -870,6 +1218,18 @@ const PostMenu = class {
|
|
|
870
1218
|
ESCAPE: 'Escape',
|
|
871
1219
|
};
|
|
872
1220
|
get host() { return index.getElement(this); }
|
|
1221
|
+
/**
|
|
1222
|
+
* Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
1223
|
+
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
1224
|
+
* towards the viewport if they would overlap edge boundaries.
|
|
1225
|
+
*/
|
|
1226
|
+
placement = 'bottom';
|
|
1227
|
+
/**
|
|
1228
|
+
* Holds the current visibility state of the menu.
|
|
1229
|
+
* This state is internally managed to track whether the menu is open (`true`) or closed (`false`),
|
|
1230
|
+
* and updates automatically when the menu is toggled.
|
|
1231
|
+
*/
|
|
1232
|
+
isVisible = false;
|
|
873
1233
|
/**
|
|
874
1234
|
* Emits when the menu is shown or hidden.
|
|
875
1235
|
* The event payload is a boolean: `true` when the menu was opened, `false` when it was closed.
|
|
@@ -998,7 +1358,7 @@ const PostMenu = class {
|
|
|
998
1358
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
999
1359
|
}
|
|
1000
1360
|
render() {
|
|
1001
|
-
return (index.h(index.Host, { key: '
|
|
1361
|
+
return (index.h(index.Host, { key: '071532c327f80197dda662f77e5cb2444281087d', "data-version": _package.version }, index.h("post-popovercontainer", { key: '9f70ca4009139e0547026b26be610a02f4f1a95a', placement: this.placement, ref: e => (this.popoverRef = e) }, index.h("div", { key: '3ff1048a8fb27402a82cedc3dc300366063c9601', class: "popover-container", part: "popover-container" }, index.h("slot", { key: 'bed6c96b7502e0032b746ac6fdf8c3dd6d782e48' })))));
|
|
1002
1362
|
}
|
|
1003
1363
|
};
|
|
1004
1364
|
PostMenu.style = PostMenuStyle0;
|
|
@@ -1009,10 +1369,16 @@ const PostMenuTriggerStyle0 = postMenuTriggerCss;
|
|
|
1009
1369
|
const PostMenuTrigger = class {
|
|
1010
1370
|
constructor(hostRef) {
|
|
1011
1371
|
index.registerInstance(this, hostRef);
|
|
1012
|
-
this.for = undefined;
|
|
1013
|
-
this.ariaExpanded = false;
|
|
1014
1372
|
}
|
|
1373
|
+
/**
|
|
1374
|
+
* ID of the menu element that this trigger is linked to. Used to open and close the specified menu.
|
|
1375
|
+
*/
|
|
1376
|
+
for;
|
|
1015
1377
|
get host() { return index.getElement(this); }
|
|
1378
|
+
/**
|
|
1379
|
+
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated menu is expanded or collapsed.
|
|
1380
|
+
*/
|
|
1381
|
+
ariaExpanded = false;
|
|
1016
1382
|
/**
|
|
1017
1383
|
* Reference to the slotted button within the trigger, if present.
|
|
1018
1384
|
* Used to manage click and key events for menu control.
|
|
@@ -1073,7 +1439,7 @@ const PostMenuTrigger = class {
|
|
|
1073
1439
|
}
|
|
1074
1440
|
}
|
|
1075
1441
|
render() {
|
|
1076
|
-
return (index.h(index.Host, { key: '
|
|
1442
|
+
return (index.h(index.Host, { key: 'a0fff619978087ce0c67d7d327982424e3784ff0', "data-version": _package.version, "tab-index": "-1" }, index.h("slot", { key: '93e26150b59e9a01275a6815096e09ff5fac146b' })));
|
|
1077
1443
|
}
|
|
1078
1444
|
static get watchers() { return {
|
|
1079
1445
|
"for": ["validateControlFor"]
|
|
@@ -3183,7 +3549,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
3183
3549
|
}
|
|
3184
3550
|
`,E=null;function I(e){if(E===null)try{E=new CSSStyleSheet,E.replaceSync(C);}catch{E=!1;}if(E===!1){let t=document.createElement("style");t.textContent=C,e instanceof Document?e.head.prepend(t):e.prepend(t);}else e.adoptedStyleSheets=[E,...e.adoptedStyleSheets];}function K(){window.ToggleEvent=window.ToggleEvent||c;function e(n){return n?.includes(":popover-open")&&(n=n.replace(J,"$1.\\:popover-open")),n}f(Document.prototype,"querySelector",e),f(Document.prototype,"querySelectorAll",e),f(Element.prototype,"querySelector",e),f(Element.prototype,"querySelectorAll",e),f(Element.prototype,"matches",e),f(Element.prototype,"closest",e),f(DocumentFragment.prototype,"querySelectorAll",e),f(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let n=(this.getAttribute("popover")||"").toLowerCase();return n===""||n=="auto"?"auto":"manual"},set(n){this.setAttribute("popover",n);}},showPopover:{enumerable:!0,configurable:!0,value(){S(this);}},hidePopover:{enumerable:!0,configurable:!0,value(){m(this,!0,!0);}},togglePopover:{enumerable:!0,configurable:!0,value(n){h.get(this)==="showing"&&n===void 0||n===!1?m(this,!0,!0):(n===void 0||n===!0)&&S(this);}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(n){let s=t.call(this,n);return I(s),s}}});let o=HTMLElement.prototype.attachInternals;o&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let n=o.call(this);return n.shadowRoot&&I(n.shadowRoot),n}}});let r=new WeakMap;function i(n){Object.defineProperties(n.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(s){if(s===null)this.removeAttribute("popovertarget"),r.delete(this);else if(s instanceof Element)this.setAttribute("popovertarget",""),r.set(this,s);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let s=r.get(this);if(s&&s.isConnected)return s;if(s&&!s.isConnected)return r.delete(this),null;let u=v(this),w=this.getAttribute("popovertarget");return (u instanceof Document||u instanceof B)&&w&&u.getElementById(w)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let s=(this.getAttribute("popovertargetaction")||"").toLowerCase();return s==="show"||s==="hide"?s:"toggle"},set(s){this.setAttribute("popovertargetaction",s);}}});}i(HTMLButtonElement),i(HTMLInputElement);let l=n=>{if(!n.isTrusted)return;let s=n.composedPath()[0];if(!(s instanceof Element)||s?.shadowRoot)return;let u=v(s);if(!(u instanceof B||u instanceof Document))return;let w=s.closest("[popovertargetaction],[popovertarget]");if(w){O(w),n.preventDefault();return}},a=n=>{let s=n.key,u=n.target;!n.defaultPrevented&&u&&(s==="Escape"||s==="Esc")&&T(u.ownerDocument,!0,!0);};(n=>{n.addEventListener("click",l),n.addEventListener("keydown",a),n.addEventListener("pointerdown",x),n.addEventListener("pointerup",x);})(document),I(document);}j()||K();})();
|
|
3185
3551
|
|
|
3186
|
-
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow
|
|
3552
|
+
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow:var(--post-device-elevation-300);background:var(--post-current-palette-bg);color:var(--post-current-palette-fg);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer):not(:has(.arrow)){box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow){filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top){filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left){filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right){filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
|
|
3187
3553
|
const PostPopovercontainerStyle0 = postPopovercontainerCss;
|
|
3188
3554
|
|
|
3189
3555
|
const SIDE_MAP = {
|
|
@@ -3196,9 +3562,6 @@ const PostPopovercontainer = class {
|
|
|
3196
3562
|
constructor(hostRef) {
|
|
3197
3563
|
index.registerInstance(this, hostRef);
|
|
3198
3564
|
this.postToggle = index.createEvent(this, "postToggle", 7);
|
|
3199
|
-
this.placement = 'top';
|
|
3200
|
-
this.edgeGap = 8;
|
|
3201
|
-
this.arrow = false;
|
|
3202
3565
|
}
|
|
3203
3566
|
get host() { return index.getElement(this); }
|
|
3204
3567
|
arrowRef;
|
|
@@ -3209,8 +3572,25 @@ const PostPopovercontainer = class {
|
|
|
3209
3572
|
* Fires whenever the popover gets shown or hidden, passing the new state in event.details as a boolean
|
|
3210
3573
|
*/
|
|
3211
3574
|
postToggle;
|
|
3575
|
+
/**
|
|
3576
|
+
* Whether or not the popover should close when user clicks outside of it
|
|
3577
|
+
*/
|
|
3578
|
+
manualClose = false;
|
|
3579
|
+
/**
|
|
3580
|
+
* Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
3581
|
+
* Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
3582
|
+
* towards the viewport if they would overlap edge boundaries.
|
|
3583
|
+
*/
|
|
3584
|
+
placement = 'top';
|
|
3585
|
+
/**
|
|
3586
|
+
* Gap between the edge of the page and the popover
|
|
3587
|
+
*/
|
|
3588
|
+
edgeGap = 8;
|
|
3589
|
+
/**
|
|
3590
|
+
* Wheter or not to display a little pointer arrow
|
|
3591
|
+
*/
|
|
3592
|
+
arrow = false;
|
|
3212
3593
|
componentDidLoad() {
|
|
3213
|
-
this.host.setAttribute('popover', '');
|
|
3214
3594
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
3215
3595
|
}
|
|
3216
3596
|
disconnectedCallback() {
|
|
@@ -3328,9 +3708,9 @@ const PostPopovercontainer = class {
|
|
|
3328
3708
|
}
|
|
3329
3709
|
}
|
|
3330
3710
|
render() {
|
|
3331
|
-
return (index.h(index.Host, { key: '
|
|
3711
|
+
return (index.h(index.Host, { key: '6bebf9ab3013796d0eebb3d543411a0e80d2e913', "data-version": _package.version, popover: this.manualClose ? 'manual' : 'auto' }, this.arrow && (index.h("span", { key: 'd6eca10452a54073a293128e8faf76e45e35c4c5', class: "arrow", ref: el => {
|
|
3332
3712
|
this.arrowRef = el;
|
|
3333
|
-
} })), index.h("slot", { key: '
|
|
3713
|
+
} })), index.h("slot", { key: '3b6674dfa1b3ffac10c6640717c7ae713577c965' })));
|
|
3334
3714
|
}
|
|
3335
3715
|
};
|
|
3336
3716
|
PostPopovercontainer.style = PostPopovercontainerStyle0;
|
|
@@ -3341,9 +3721,12 @@ const PostTogglebuttonStyle0 = postTogglebuttonCss;
|
|
|
3341
3721
|
const PostTogglebutton = class {
|
|
3342
3722
|
constructor(hostRef) {
|
|
3343
3723
|
index.registerInstance(this, hostRef);
|
|
3344
|
-
this.toggled = false;
|
|
3345
3724
|
}
|
|
3346
3725
|
get host() { return index.getElement(this); }
|
|
3726
|
+
/**
|
|
3727
|
+
* If `true`, the button is in the "on" state, otherwise it is in the "off" state.
|
|
3728
|
+
*/
|
|
3729
|
+
toggled = false;
|
|
3347
3730
|
validateToggled(value = this.toggled) {
|
|
3348
3731
|
checkType.checkType(value, 'boolean', 'The "toggled" property of the post-togglebutton must be a boolean.');
|
|
3349
3732
|
}
|
|
@@ -3364,7 +3747,7 @@ const PostTogglebutton = class {
|
|
|
3364
3747
|
}
|
|
3365
3748
|
};
|
|
3366
3749
|
render() {
|
|
3367
|
-
return (index.h(index.Host, { key: '
|
|
3750
|
+
return (index.h(index.Host, { key: 'e4974336def6dbf244b3d63b9aa00e2e7bce1920', "data-version": _package.version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, index.h("slot", { key: 'b1179664b0f0651865e973c7afe951102b048877' })));
|
|
3368
3751
|
}
|
|
3369
3752
|
static get watchers() { return {
|
|
3370
3753
|
"toggled": ["validateToggled"]
|