@swisspost/internet-header 10.6.0 → 10.8.0
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-B5ypPkK3.js +4 -4
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/is-focus-visible-B3CqVQsX.js +19 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-pKyFPwiA.js → package-DAEQGHsE.js} +1 -1
- package/dist/cjs/{package-D7UYFbVU.js → package-DV0YNR6p.js} +1 -1
- package/dist/cjs/post-accordion_4.cjs.entry.js +11 -5
- package/dist/cjs/post-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/post-avatar.cjs.entry.js +80 -56
- package/dist/cjs/post-back-to-top.cjs.entry.js +2 -2
- package/dist/cjs/post-banner.cjs.entry.js +2 -2
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +2 -2
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +2 -2
- package/dist/cjs/post-closebutton.cjs.entry.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +39 -23
- package/dist/cjs/post-footer.cjs.entry.js +2 -2
- package/dist/cjs/post-header.cjs.entry.js +40 -15
- package/dist/cjs/post-icon.cjs.entry.js +1 -1
- package/dist/cjs/post-language-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/post-language-menu.cjs.entry.js +2 -2
- package/dist/cjs/post-linkarea.cjs.entry.js +1 -1
- package/dist/cjs/post-listbox-option.cjs.entry.js +1 -1
- package/dist/cjs/post-listbox.cjs.entry.js +1 -1
- package/dist/cjs/post-logo.cjs.entry.js +2 -2
- package/dist/cjs/post-mainnavigation.cjs.entry.js +1 -1
- package/dist/cjs/post-megadropdown-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-megadropdown.cjs.entry.js +36 -18
- package/dist/cjs/post-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/post-menu_2.cjs.entry.js +5 -15
- package/dist/cjs/post-number-input.cjs.entry.js +2 -2
- package/dist/cjs/post-pagination.cjs.entry.js +2 -2
- package/dist/cjs/post-popover-trigger.cjs.entry.js +1 -1
- package/dist/cjs/post-popover.cjs.entry.js +4 -4
- package/dist/cjs/post-popovercontainer.cjs.entry.js +387 -536
- package/dist/cjs/post-rating.cjs.entry.js +1 -1
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +1 -1
- package/dist/cjs/post-side-navigation.cjs.entry.js +9 -4
- package/dist/cjs/post-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/post-stepper.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-item.cjs.entry.js +1 -1
- package/dist/cjs/post-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/post-tabs.cjs.entry.js +4 -4
- package/dist/cjs/post-togglebutton.cjs.entry.js +1 -1
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -3
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +34 -17
- package/dist/cjs/swisspost-internet-header.cjs.js +1 -1
- package/dist/collection/components/internal/UserMenu.js +8 -6
- package/dist/collection/services/config.service.js +25 -10
- package/dist/components/is-focus-visible.js +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/package2.js +1 -1
- package/dist/components/post-accordion-item2.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-breadcrumbs.js +1 -1
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible2.js +1 -1
- package/dist/components/post-date-picker.js +1 -1
- package/dist/components/post-footer2.js +1 -1
- package/dist/components/post-header2.js +1 -1
- package/dist/components/post-language-menu2.js +1 -1
- package/dist/components/post-logo2.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-item2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-pagination.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-side-navigation.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-tooltip-trigger.js +1 -1
- package/dist/components/post-tooltip.js +1 -1
- package/dist/components/swisspost-internet-header.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/index-h3opCZqH.js +4 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/is-focus-visible-BWwWKRO5.js +17 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-Dy8-dzD8.js → package--a_K3g1E.js} +1 -1
- package/dist/esm/{package-T8T3po4z.js → package-BdiQsTQm.js} +1 -1
- package/dist/esm/post-accordion_4.entry.js +11 -5
- package/dist/esm/post-autocomplete.entry.js +1 -1
- package/dist/esm/post-avatar.entry.js +80 -56
- package/dist/esm/post-back-to-top.entry.js +2 -2
- package/dist/esm/post-banner.entry.js +2 -2
- package/dist/esm/post-breadcrumb-item.entry.js +2 -2
- package/dist/esm/post-breadcrumbs.entry.js +2 -2
- package/dist/esm/post-closebutton.entry.js +2 -2
- package/dist/esm/post-date-picker.entry.js +39 -23
- package/dist/esm/post-footer.entry.js +2 -2
- package/dist/esm/post-header.entry.js +40 -15
- package/dist/esm/post-icon.entry.js +1 -1
- package/dist/esm/post-language-menu-item.entry.js +1 -1
- package/dist/esm/post-language-menu.entry.js +2 -2
- package/dist/esm/post-linkarea.entry.js +1 -1
- package/dist/esm/post-listbox-option.entry.js +1 -1
- package/dist/esm/post-listbox.entry.js +1 -1
- package/dist/esm/post-logo.entry.js +2 -2
- package/dist/esm/post-mainnavigation.entry.js +1 -1
- package/dist/esm/post-megadropdown-trigger.entry.js +2 -2
- package/dist/esm/post-megadropdown.entry.js +36 -18
- package/dist/esm/post-menu-item.entry.js +2 -2
- package/dist/esm/post-menu_2.entry.js +5 -15
- package/dist/esm/post-number-input.entry.js +2 -2
- package/dist/esm/post-pagination.entry.js +2 -2
- package/dist/esm/post-popover-trigger.entry.js +1 -1
- package/dist/esm/post-popover.entry.js +4 -4
- package/dist/esm/post-popovercontainer.entry.js +387 -536
- package/dist/esm/post-rating.entry.js +1 -1
- package/dist/esm/post-side-navigation-trigger.entry.js +1 -1
- package/dist/esm/post-side-navigation.entry.js +9 -4
- package/dist/esm/post-stepper-item.entry.js +1 -1
- package/dist/esm/post-stepper.entry.js +1 -1
- package/dist/esm/post-tab-item.entry.js +1 -1
- package/dist/esm/post-tab-panel.entry.js +1 -1
- package/dist/esm/post-tabs.entry.js +4 -4
- package/dist/esm/post-togglebutton.entry.js +1 -1
- package/dist/esm/post-tooltip-trigger.entry.js +2 -2
- package/dist/esm/post-tooltip.entry.js +5 -3
- package/dist/esm/swisspost-internet-footer.entry.js +1 -1
- package/dist/esm/swisspost-internet-header.entry.js +34 -17
- package/dist/esm/swisspost-internet-header.js +1 -1
- package/dist/esm-es5/index-h3opCZqH.js +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/is-focus-visible-BWwWKRO5.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{package-Dy8-dzD8.js → package--a_K3g1E.js} +1 -1
- package/dist/esm-es5/package-BdiQsTQm.js +1 -0
- package/dist/esm-es5/post-accordion_4.entry.js +1 -1
- package/dist/esm-es5/post-autocomplete.entry.js +1 -1
- package/dist/esm-es5/post-avatar.entry.js +1 -1
- package/dist/esm-es5/post-back-to-top.entry.js +1 -1
- package/dist/esm-es5/post-banner.entry.js +1 -1
- package/dist/esm-es5/post-breadcrumb-item.entry.js +1 -1
- package/dist/esm-es5/post-breadcrumbs.entry.js +1 -1
- package/dist/esm-es5/post-closebutton.entry.js +1 -1
- package/dist/esm-es5/post-date-picker.entry.js +1 -1
- package/dist/esm-es5/post-footer.entry.js +1 -1
- package/dist/esm-es5/post-header.entry.js +1 -1
- package/dist/esm-es5/post-icon.entry.js +1 -1
- package/dist/esm-es5/post-language-menu-item.entry.js +1 -1
- package/dist/esm-es5/post-language-menu.entry.js +1 -1
- package/dist/esm-es5/post-linkarea.entry.js +1 -1
- package/dist/esm-es5/post-listbox-option.entry.js +1 -1
- package/dist/esm-es5/post-listbox.entry.js +1 -1
- package/dist/esm-es5/post-logo.entry.js +1 -1
- package/dist/esm-es5/post-mainnavigation.entry.js +1 -1
- package/dist/esm-es5/post-megadropdown-trigger.entry.js +1 -1
- package/dist/esm-es5/post-megadropdown.entry.js +1 -1
- package/dist/esm-es5/post-menu-item.entry.js +1 -1
- package/dist/esm-es5/post-menu_2.entry.js +1 -1
- package/dist/esm-es5/post-number-input.entry.js +1 -1
- package/dist/esm-es5/post-pagination.entry.js +1 -1
- package/dist/esm-es5/post-popover-trigger.entry.js +1 -1
- package/dist/esm-es5/post-popover.entry.js +1 -1
- package/dist/esm-es5/post-popovercontainer.entry.js +1 -1
- package/dist/esm-es5/post-rating.entry.js +1 -1
- package/dist/esm-es5/post-side-navigation-trigger.entry.js +1 -1
- package/dist/esm-es5/post-side-navigation.entry.js +1 -1
- package/dist/esm-es5/post-stepper-item.entry.js +1 -1
- package/dist/esm-es5/post-stepper.entry.js +1 -1
- package/dist/esm-es5/post-tab-item.entry.js +1 -1
- package/dist/esm-es5/post-tab-panel.entry.js +1 -1
- package/dist/esm-es5/post-tabs.entry.js +1 -1
- package/dist/esm-es5/post-togglebutton.entry.js +1 -1
- package/dist/esm-es5/post-tooltip-trigger.entry.js +1 -1
- package/dist/esm-es5/post-tooltip.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-footer.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.js +1 -1
- package/dist/swisspost-internet-header/index.esm.js +1 -1
- package/dist/swisspost-internet-header/{p-fcfd3134.entry.js → p-0c6839cd.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-f4ce6247.entry.js → p-148cfacf.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-1617517b.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-255b2067.entry.js → p-174e2b92.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-613fa3a4.entry.js → p-1ab10b94.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-0d4d5c56.entry.js → p-1d145a3d.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-1df3d147.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-3d38ab21.entry.js → p-22da79ea.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-72377b16.system.entry.js → p-238c919d.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-26ac0464.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-ca68b8cf.entry.js → p-2d56ef1f.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-4bdbf9e9.system.entry.js → p-3124582e.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-000978a2.system.entry.js → p-36232387.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-1780039a.entry.js → p-381ac502.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-81f34993.system.entry.js → p-3995eead.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-3afac939.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-6f187e15.entry.js → p-3ef5a7c0.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-f3e68437.system.entry.js → p-42fe4c65.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-bfc4a6a9.entry.js → p-4466ee14.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-45398826.entry.js +1 -0
- package/dist/swisspost-internet-header/p-45d989e5.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-84ebaf4b.system.entry.js → p-49c132a1.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-4ab5590e.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-31af5cf2.system.entry.js → p-4b39fa0b.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-bb4c3ac1.entry.js → p-4d94cb9d.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-089412b9.entry.js → p-518f5952.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-8f21a530.entry.js → p-546f0429.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-5550933f.entry.js +1 -0
- package/dist/swisspost-internet-header/p-576e3b55.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-03587cd5.entry.js → p-57b73dd7.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-d68a1179.entry.js → p-5a929d5c.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-a8b0c0ec.system.entry.js → p-5aa3e212.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-0f501e99.system.entry.js → p-5ac46ce3.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-b344fa82.entry.js → p-5e112c81.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-61e37660.entry.js +1 -0
- package/dist/swisspost-internet-header/p-629dfdba.entry.js +1 -0
- package/dist/swisspost-internet-header/p-62a14cc2.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-62b7473b.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-25407470.system.entry.js → p-65fb1a64.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-6c284cd6.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-6f0c2a5c.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-745c3c76.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-39af32a0.system.entry.js → p-74b8b73a.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-155f5b00.system.entry.js → p-79dc7e1b.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-7a8d9175.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-7f953da2.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-599e94e7.entry.js → p-80ce5ec8.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-851c2112.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-8b90f7d2.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-8ff4691a.entry.js +1 -0
- package/dist/swisspost-internet-header/p-925203fb.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-94aae5c3.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-e69e8fa4.entry.js → p-94c7624f.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-a46ef8a8.system.entry.js → p-9ac136f3.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-D_rLPX5e.system.js → p-B1oFB_zk.system.js} +1 -1
- package/dist/swisspost-internet-header/p-BVux4d1J.system.js +1 -0
- package/dist/swisspost-internet-header/p-BWwWKRO5.js +1 -0
- package/dist/swisspost-internet-header/{p-B-DGLCj0.js → p-BXoqlxOG.js} +1 -1
- package/dist/swisspost-internet-header/p-BdiQsTQm.js +1 -0
- package/dist/swisspost-internet-header/{p-COm5Sc71.system.js → p-CYBchhbg.system.js} +1 -1
- package/dist/swisspost-internet-header/p-Ctf1S46w.system.js +1 -0
- package/dist/swisspost-internet-header/p-R5BnOD0U.system.js +1 -1
- package/dist/swisspost-internet-header/p-a00eb4a0.entry.js +1 -0
- package/dist/swisspost-internet-header/p-a1237171.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-a12be1fd.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-a1ed3c1d.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-a21c305f.entry.js +1 -0
- package/dist/swisspost-internet-header/p-a4bfe46c.entry.js +1 -0
- package/dist/swisspost-internet-header/p-a9045c62.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-ac9d7b3f.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-bc0fcd50.entry.js +1 -0
- package/dist/swisspost-internet-header/p-bc30850c.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-bf861c95.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-d7c2cce3.entry.js → p-c36c9d88.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-2e8c0f26.entry.js → p-cd3f5447.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-d1eab2a3.entry.js +1 -0
- package/dist/swisspost-internet-header/p-d28a58ec.entry.js +1 -0
- package/dist/swisspost-internet-header/p-d390eac9.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-d52b2e2e.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-d8384d86.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-dae00825.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-dcc3e62f.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-c1e818d2.entry.js → p-de1eae9a.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-21e537be.system.entry.js → p-ef4aec35.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-0c651391.system.entry.js → p-f2794080.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-586ee1e8.system.entry.js → p-f78ac8af.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-8717e0ce.system.entry.js → p-f8f292cf.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-fb0e4425.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-fd8106f1.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-fea21512.entry.js +1 -0
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/types/services/config.service.d.ts +2 -1
- package/package.json +9 -7
- package/dist/esm-es5/package-T8T3po4z.js +0 -1
- package/dist/swisspost-internet-header/p-068b1e2b.entry.js +0 -1
- package/dist/swisspost-internet-header/p-087b1e22.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-094ef16a.entry.js +0 -1
- package/dist/swisspost-internet-header/p-1502d221.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-161b1a45.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-16623b05.entry.js +0 -1
- package/dist/swisspost-internet-header/p-1a18ac48.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-2196012d.entry.js +0 -1
- package/dist/swisspost-internet-header/p-2197ca9e.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-2b0f93fb.entry.js +0 -1
- package/dist/swisspost-internet-header/p-2da6fba5.entry.js +0 -1
- package/dist/swisspost-internet-header/p-35b6e07c.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-3ff138ba.entry.js +0 -1
- package/dist/swisspost-internet-header/p-42806d60.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-4557a744.entry.js +0 -1
- package/dist/swisspost-internet-header/p-4562d9d8.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-53c33e94.entry.js +0 -1
- package/dist/swisspost-internet-header/p-5443664a.entry.js +0 -1
- package/dist/swisspost-internet-header/p-547d9572.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-57f1f9e2.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-651b9efe.entry.js +0 -1
- package/dist/swisspost-internet-header/p-6d6fb84b.entry.js +0 -1
- package/dist/swisspost-internet-header/p-6f79a60d.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-7ad0de4b.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-826d0669.entry.js +0 -1
- package/dist/swisspost-internet-header/p-98d2dfb3.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-9b6c8533.entry.js +0 -1
- package/dist/swisspost-internet-header/p-9c5941a2.entry.js +0 -1
- package/dist/swisspost-internet-header/p-BT1GO8tc.system.js +0 -1
- package/dist/swisspost-internet-header/p-T8T3po4z.js +0 -1
- package/dist/swisspost-internet-header/p-a435a51d.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-a75d1e4f.entry.js +0 -1
- package/dist/swisspost-internet-header/p-abe2eefe.entry.js +0 -1
- package/dist/swisspost-internet-header/p-b4de053e.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-b85fabc2.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-c96dbc97.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-caed751e.entry.js +0 -1
- package/dist/swisspost-internet-header/p-cb52e42c.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-cec19e1d.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-d45690b3.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-e5ebe099.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-e6ec5fa5.entry.js +0 -1
- package/dist/swisspost-internet-header/p-ede58236.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-f4489f68.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-f783b224.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-fdbcf065.entry.js +0 -1
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-B5ypPkK3.js');
|
|
4
|
-
var _package = require('./package-
|
|
4
|
+
var _package = require('./package-DAEQGHsE.js');
|
|
5
5
|
var oneOf = require('./one-of-7TSi182P.js');
|
|
6
6
|
var placement = require('./placement-qEFR9hmI.js');
|
|
7
7
|
var type = require('./type-CAeEC3oM.js');
|
|
8
8
|
require('./create-validator-decorator-CJK3Xf77.js');
|
|
9
9
|
|
|
10
|
+
const duration = 250;
|
|
11
|
+
const easing = 'ease-out';
|
|
12
|
+
function popIn(el) {
|
|
13
|
+
if (!el)
|
|
14
|
+
return;
|
|
15
|
+
return el.animate([
|
|
16
|
+
{ transform: 'scale(0.9)', opacity: 0 },
|
|
17
|
+
{ transform: 'scale(1)', opacity: 1 },
|
|
18
|
+
], {
|
|
19
|
+
duration,
|
|
20
|
+
easing,
|
|
21
|
+
fill: 'forwards',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
10
25
|
/**
|
|
11
26
|
* Custom positioning reference element.
|
|
12
27
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
@@ -52,23 +67,6 @@ function getSideAxis(placement) {
|
|
|
52
67
|
function getAlignmentAxis(placement) {
|
|
53
68
|
return getOppositeAxis(getSideAxis(placement));
|
|
54
69
|
}
|
|
55
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
56
|
-
if (rtl === void 0) {
|
|
57
|
-
rtl = false;
|
|
58
|
-
}
|
|
59
|
-
const alignment = getAlignment(placement);
|
|
60
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
61
|
-
const length = getAxisLength(alignmentAxis);
|
|
62
|
-
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
63
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
64
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
65
|
-
}
|
|
66
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
67
|
-
}
|
|
68
|
-
function getExpandedPlacements(placement) {
|
|
69
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
70
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
71
|
-
}
|
|
72
70
|
function getOppositeAlignmentPlacement(placement) {
|
|
73
71
|
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
|
|
74
72
|
}
|
|
@@ -94,7 +92,7 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
|
94
92
|
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
95
93
|
if (alignment) {
|
|
96
94
|
list = list.map(side => side + "-" + alignment);
|
|
97
|
-
|
|
95
|
+
{
|
|
98
96
|
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
99
97
|
}
|
|
100
98
|
}
|
|
@@ -200,7 +198,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
200
198
|
* - 0 = lies flush with the boundary
|
|
201
199
|
* @see https://floating-ui.com/docs/detectOverflow
|
|
202
200
|
*/
|
|
203
|
-
async function detectOverflow(state, options) {
|
|
201
|
+
async function detectOverflow$1(state, options) {
|
|
204
202
|
var _await$platform$isEle;
|
|
205
203
|
if (options === void 0) {
|
|
206
204
|
options = {};
|
|
@@ -273,7 +271,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
273
271
|
} = config;
|
|
274
272
|
const platformWithDetectOverflow = platform.detectOverflow ? platform : {
|
|
275
273
|
...platform,
|
|
276
|
-
detectOverflow
|
|
274
|
+
detectOverflow: detectOverflow$1
|
|
277
275
|
};
|
|
278
276
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
279
277
|
let rects = await platform.getElementRects({
|
|
@@ -433,138 +431,6 @@ const arrow$1 = options => ({
|
|
|
433
431
|
}
|
|
434
432
|
});
|
|
435
433
|
|
|
436
|
-
/**
|
|
437
|
-
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
438
|
-
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
439
|
-
* clipping boundary. Alternative to `autoPlacement`.
|
|
440
|
-
* @see https://floating-ui.com/docs/flip
|
|
441
|
-
*/
|
|
442
|
-
const flip$1 = function (options) {
|
|
443
|
-
if (options === void 0) {
|
|
444
|
-
options = {};
|
|
445
|
-
}
|
|
446
|
-
return {
|
|
447
|
-
name: 'flip',
|
|
448
|
-
options,
|
|
449
|
-
async fn(state) {
|
|
450
|
-
var _middlewareData$arrow, _middlewareData$flip;
|
|
451
|
-
const {
|
|
452
|
-
placement,
|
|
453
|
-
middlewareData,
|
|
454
|
-
rects,
|
|
455
|
-
initialPlacement,
|
|
456
|
-
platform,
|
|
457
|
-
elements
|
|
458
|
-
} = state;
|
|
459
|
-
const {
|
|
460
|
-
mainAxis: checkMainAxis = true,
|
|
461
|
-
crossAxis: checkCrossAxis = true,
|
|
462
|
-
fallbackPlacements: specifiedFallbackPlacements,
|
|
463
|
-
fallbackStrategy = 'bestFit',
|
|
464
|
-
fallbackAxisSideDirection = 'none',
|
|
465
|
-
flipAlignment = true,
|
|
466
|
-
...detectOverflowOptions
|
|
467
|
-
} = evaluate(options, state);
|
|
468
|
-
|
|
469
|
-
// If a reset by the arrow was caused due to an alignment offset being
|
|
470
|
-
// added, we should skip any logic now since `flip()` has already done its
|
|
471
|
-
// work.
|
|
472
|
-
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
473
|
-
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
474
|
-
return {};
|
|
475
|
-
}
|
|
476
|
-
const side = getSide(placement);
|
|
477
|
-
const initialSideAxis = getSideAxis(initialPlacement);
|
|
478
|
-
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
479
|
-
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
480
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
481
|
-
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
482
|
-
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
483
|
-
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
484
|
-
}
|
|
485
|
-
const placements = [initialPlacement, ...fallbackPlacements];
|
|
486
|
-
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
487
|
-
const overflows = [];
|
|
488
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
489
|
-
if (checkMainAxis) {
|
|
490
|
-
overflows.push(overflow[side]);
|
|
491
|
-
}
|
|
492
|
-
if (checkCrossAxis) {
|
|
493
|
-
const sides = getAlignmentSides(placement, rects, rtl);
|
|
494
|
-
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
495
|
-
}
|
|
496
|
-
overflowsData = [...overflowsData, {
|
|
497
|
-
placement,
|
|
498
|
-
overflows
|
|
499
|
-
}];
|
|
500
|
-
|
|
501
|
-
// One or more sides is overflowing.
|
|
502
|
-
if (!overflows.every(side => side <= 0)) {
|
|
503
|
-
var _middlewareData$flip2, _overflowsData$filter;
|
|
504
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
505
|
-
const nextPlacement = placements[nextIndex];
|
|
506
|
-
if (nextPlacement) {
|
|
507
|
-
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
508
|
-
if (!ignoreCrossAxisOverflow ||
|
|
509
|
-
// We leave the current main axis only if every placement on that axis
|
|
510
|
-
// overflows the main axis.
|
|
511
|
-
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
512
|
-
// Try next placement and re-run the lifecycle.
|
|
513
|
-
return {
|
|
514
|
-
data: {
|
|
515
|
-
index: nextIndex,
|
|
516
|
-
overflows: overflowsData
|
|
517
|
-
},
|
|
518
|
-
reset: {
|
|
519
|
-
placement: nextPlacement
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
526
|
-
// then find the placement that fits the best on the main crossAxis side.
|
|
527
|
-
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
528
|
-
|
|
529
|
-
// Otherwise fallback.
|
|
530
|
-
if (!resetPlacement) {
|
|
531
|
-
switch (fallbackStrategy) {
|
|
532
|
-
case 'bestFit':
|
|
533
|
-
{
|
|
534
|
-
var _overflowsData$filter2;
|
|
535
|
-
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
536
|
-
if (hasFallbackAxisSideDirection) {
|
|
537
|
-
const currentSideAxis = getSideAxis(d.placement);
|
|
538
|
-
return currentSideAxis === initialSideAxis ||
|
|
539
|
-
// Create a bias to the `y` side axis due to horizontal
|
|
540
|
-
// reading directions favoring greater width.
|
|
541
|
-
currentSideAxis === 'y';
|
|
542
|
-
}
|
|
543
|
-
return true;
|
|
544
|
-
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
545
|
-
if (placement) {
|
|
546
|
-
resetPlacement = placement;
|
|
547
|
-
}
|
|
548
|
-
break;
|
|
549
|
-
}
|
|
550
|
-
case 'initialPlacement':
|
|
551
|
-
resetPlacement = initialPlacement;
|
|
552
|
-
break;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
if (placement !== resetPlacement) {
|
|
556
|
-
return {
|
|
557
|
-
reset: {
|
|
558
|
-
placement: resetPlacement
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
return {};
|
|
564
|
-
}
|
|
565
|
-
};
|
|
566
|
-
};
|
|
567
|
-
|
|
568
434
|
function getSideOffsets(overflow, rect) {
|
|
569
435
|
return {
|
|
570
436
|
top: overflow.top - rect.height,
|
|
@@ -1447,7 +1313,7 @@ function getDocumentRect(html) {
|
|
|
1447
1313
|
// calculation is affected by unusual styles.
|
|
1448
1314
|
// Most scrollbars leave 15-18px of space.
|
|
1449
1315
|
const SCROLLBAR_MAX = 25;
|
|
1450
|
-
function getViewportRect(element, strategy, rootBoundary) {
|
|
1316
|
+
function getViewportRect$1(element, strategy, rootBoundary) {
|
|
1451
1317
|
if (rootBoundary === void 0) {
|
|
1452
1318
|
rootBoundary = 'viewport';
|
|
1453
1319
|
}
|
|
@@ -1525,7 +1391,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
1525
1391
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1526
1392
|
let rect;
|
|
1527
1393
|
if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {
|
|
1528
|
-
rect = getViewportRect(element, strategy, clippingAncestor);
|
|
1394
|
+
rect = getViewportRect$1(element, strategy, clippingAncestor);
|
|
1529
1395
|
} else if (clippingAncestor === 'document') {
|
|
1530
1396
|
rect = getDocumentRect(getDocumentElement(element));
|
|
1531
1397
|
} else if (isElement(clippingAncestor)) {
|
|
@@ -1921,6 +1787,16 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1921
1787
|
};
|
|
1922
1788
|
}
|
|
1923
1789
|
|
|
1790
|
+
/**
|
|
1791
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
1792
|
+
* element is overflowing a given clipping boundary on each side.
|
|
1793
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
1794
|
+
* - negative = how many pixels left before it will overflow
|
|
1795
|
+
* - 0 = lies flush with the boundary
|
|
1796
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
1797
|
+
*/
|
|
1798
|
+
const detectOverflow = detectOverflow$1;
|
|
1799
|
+
|
|
1924
1800
|
/**
|
|
1925
1801
|
* Modifies the placement by translating the floating element along the
|
|
1926
1802
|
* specified axes.
|
|
@@ -1937,14 +1813,6 @@ const offset = offset$1;
|
|
|
1937
1813
|
*/
|
|
1938
1814
|
const shift = shift$1;
|
|
1939
1815
|
|
|
1940
|
-
/**
|
|
1941
|
-
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1942
|
-
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1943
|
-
* clipping boundary. Alternative to `autoPlacement`.
|
|
1944
|
-
* @see https://floating-ui.com/docs/flip
|
|
1945
|
-
*/
|
|
1946
|
-
const flip = flip$1;
|
|
1947
|
-
|
|
1948
1816
|
/**
|
|
1949
1817
|
* Provides data that allows you to change the size of the floating element —
|
|
1950
1818
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
@@ -2000,19 +1868,211 @@ const computePosition = (reference, floating, options) => {
|
|
|
2000
1868
|
});
|
|
2001
1869
|
};
|
|
2002
1870
|
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
1871
|
+
/**
|
|
1872
|
+
* Returns the nth side in clockwise direction relative to the given side.
|
|
1873
|
+
*/
|
|
1874
|
+
function getRelativeSide(side, n) {
|
|
1875
|
+
return sides[(sides.indexOf(side) + n) % 4];
|
|
1876
|
+
}
|
|
1877
|
+
const getNextSide = (side) => getRelativeSide(side, 1);
|
|
1878
|
+
const getOppositeSide = (side) => getRelativeSide(side, 2);
|
|
1879
|
+
const getPreviousSide = (side) => getRelativeSide(side, 3);
|
|
1880
|
+
|
|
1881
|
+
const FLIP_MIDDLEWARE = 'post-flip';
|
|
1882
|
+
/**
|
|
1883
|
+
* Changes the placement of the floating element to keep it in view.
|
|
1884
|
+
*
|
|
1885
|
+
* Unlike the Floating UI `flip` middleware, placements are measured against `minSize` rather than
|
|
1886
|
+
* against the current size of the floating element, and the placement with the smallest deficit is
|
|
1887
|
+
* used when none of them fits.
|
|
1888
|
+
*/
|
|
1889
|
+
function flip(options = {}) {
|
|
1890
|
+
return {
|
|
1891
|
+
name: FLIP_MIDDLEWARE,
|
|
1892
|
+
options,
|
|
1893
|
+
async fn(state) {
|
|
1894
|
+
const { middlewareData, placement } = state;
|
|
1895
|
+
// see https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
1896
|
+
if (middlewareData.arrow?.alignmentOffset)
|
|
1897
|
+
return {};
|
|
1898
|
+
const { minSize = {}, ...detectOverflowOptions } = evaluate(options, state);
|
|
1899
|
+
const gap = Math.abs(middlewareData.offset?.[getSideAxis(placement)] ?? 0);
|
|
1900
|
+
const side = getSide(placement);
|
|
1901
|
+
const referenceOverflow = await detectOverflow(state, {
|
|
1902
|
+
...detectOverflowOptions,
|
|
1903
|
+
elementContext: 'reference',
|
|
1904
|
+
});
|
|
1905
|
+
const floatingOverflow = await detectOverflow(state, {
|
|
1906
|
+
...detectOverflowOptions,
|
|
1907
|
+
elementContext: 'floating',
|
|
1908
|
+
});
|
|
1909
|
+
// The floating element fits at its current placement, there is nothing left to do.
|
|
1910
|
+
if (Math.max(referenceOverflow[side], floatingOverflow[side]) <= 0)
|
|
1911
|
+
return {};
|
|
1912
|
+
const previous = middlewareData[FLIP_MIDDLEWARE];
|
|
1913
|
+
const measurement = { overflow: referenceOverflow, minSize, gap };
|
|
1914
|
+
let deficits = previous?.deficits ?? [];
|
|
1915
|
+
const placements = previous?.placements ?? (await getPlacements(state, measurement));
|
|
1916
|
+
if (deficits.length < placements.length) {
|
|
1917
|
+
deficits = [...deficits, getDeficit(side, measurement)];
|
|
1918
|
+
}
|
|
1919
|
+
const data = { placements, deficits };
|
|
1920
|
+
// If there are still placements to try, move on to the next one.
|
|
1921
|
+
if (deficits.length < placements.length) {
|
|
1922
|
+
return { data, reset: { placement: placements[deficits.length] } };
|
|
1923
|
+
}
|
|
1924
|
+
// If none of the placements fit, fall back to the one that loses the least space.
|
|
1925
|
+
const fallback = data.placements[data.deficits.indexOf(Math.min(...data.deficits))];
|
|
1926
|
+
return fallback === placement ? { data } : { data, reset: { placement: fallback } };
|
|
1927
|
+
},
|
|
1928
|
+
};
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Returns the placements to try, ordered from most to least promising.
|
|
1932
|
+
*/
|
|
1933
|
+
async function getPlacements(state, measurement) {
|
|
1934
|
+
const { placement, platform, elements } = state;
|
|
1935
|
+
const { overflow } = measurement;
|
|
1936
|
+
const side = getSide(placement);
|
|
1937
|
+
const placements = [placement, getOppositePlacement(placement)];
|
|
1938
|
+
const mainAxisDeficit = Math.min(getDeficit(side, measurement), getDeficit(getOppositeSide(side), measurement));
|
|
1939
|
+
if (mainAxisDeficit <= 0)
|
|
1940
|
+
return placements;
|
|
1941
|
+
const rtl = (await platform.isRTL?.(elements.floating)) ?? false;
|
|
1942
|
+
const crossAxisPlacements = getOppositeAxisPlacements(placement, true, 'start', rtl);
|
|
1943
|
+
// Try the side with the most available space first.
|
|
1944
|
+
crossAxisPlacements.sort((a, b) => overflow[getSide(a)] - overflow[getSide(b)]);
|
|
1945
|
+
return [...placements, ...crossAxisPlacements];
|
|
1946
|
+
}
|
|
1947
|
+
/**
|
|
1948
|
+
* Returns the amount of space required to display the floating element at its minimum size on the
|
|
1949
|
+
* given side of the reference element.
|
|
1950
|
+
*/
|
|
1951
|
+
function getDeficit(side, { minSize, overflow, gap }) {
|
|
1952
|
+
const minLength = minSize[getAxisLength(getSideAxis(side))] ?? 0;
|
|
1953
|
+
return gap + minLength + overflow[side];
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
/**
|
|
1957
|
+
* This utility is covered by the end-to-end tests under 'clipping' in `popovercontainer.cy.ts`.
|
|
1958
|
+
*/
|
|
1959
|
+
const CLIPPING_RECT_CACHE = Symbol('Clipping Rect Cache');
|
|
1960
|
+
/**
|
|
1961
|
+
* A custom floating UI platform that restricts clipping rectangles to the safe area.
|
|
1962
|
+
*/
|
|
1963
|
+
const safeAreaPlatform = { ...platform, getClippingRect };
|
|
1964
|
+
/**
|
|
1965
|
+
* Computes the clipping rectangle of an element while accounting for the safe area.
|
|
1966
|
+
*/
|
|
1967
|
+
async function getClippingRect(...args) {
|
|
1968
|
+
const element = args[0].element;
|
|
1969
|
+
// Check whether the clipping rectangle of the given element has already been computed during
|
|
1970
|
+
// this pass.
|
|
1971
|
+
const hit = this[CLIPPING_RECT_CACHE].get(element);
|
|
1972
|
+
if (hit)
|
|
1973
|
+
return hit;
|
|
1974
|
+
// Compute the clipping rectangle with the Floating UI DOM platform, then restrict it to the safe
|
|
1975
|
+
// area.
|
|
1976
|
+
const clippingRect = await platform.getClippingRect.apply(this, args);
|
|
1977
|
+
applySafeArea(clippingRect, element);
|
|
1978
|
+
this[CLIPPING_RECT_CACHE].set(element, clippingRect);
|
|
1979
|
+
return clippingRect;
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* Restricts the `clippingRect` computed for `element` to the safe area, modifying it in place.
|
|
1983
|
+
*
|
|
1984
|
+
* The safe area only applies to elements that the header can actually cover, which excludes
|
|
1985
|
+
* elements without a header on their page, elements on a top layer and elements within the header.
|
|
1986
|
+
*/
|
|
1987
|
+
function applySafeArea(clippingRect, element) {
|
|
1988
|
+
const headerElement = element.ownerDocument.querySelector('post-header');
|
|
1989
|
+
if (headerElement === null)
|
|
2007
1990
|
return;
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
1991
|
+
let parent = element;
|
|
1992
|
+
while (!isLastTraversableNode(parent)) {
|
|
1993
|
+
parent = getParentNode(parent);
|
|
1994
|
+
if (!isHTMLElement(parent))
|
|
1995
|
+
continue;
|
|
1996
|
+
// Do not apply the safe area of the header to
|
|
1997
|
+
// - elements that are on a top layer, such as a dialog.
|
|
1998
|
+
// - elements that are located within the header itself.
|
|
1999
|
+
if (isTopLayer(parent) || parent === headerElement)
|
|
2000
|
+
return;
|
|
2001
|
+
}
|
|
2002
|
+
const headerRect = headerElement.getBoundingClientRect();
|
|
2003
|
+
const top = Math.max(clippingRect.y, headerRect.bottom);
|
|
2004
|
+
clippingRect.height -= top - clippingRect.y;
|
|
2005
|
+
clippingRect.y = top;
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Computes the coordinates that will position the `floating` element next to a given `reference`
|
|
2009
|
+
* element while accounting for the safe area.
|
|
2010
|
+
*
|
|
2011
|
+
* The safe area is the part of the viewport that the header does not cover. Restricting the
|
|
2012
|
+
* clipping rectangles to it makes floating elements behave as if they were clipped by the header.
|
|
2013
|
+
*/
|
|
2014
|
+
const computePositionWithSafeArea = (reference, floating, options) => {
|
|
2015
|
+
// Adapted from https://github.com/floating-ui/floating-ui/blob/27629b74ba36ab8ceb2a968051927b9b69511a3b/packages/dom/src/index.ts#L15
|
|
2016
|
+
options ??= {};
|
|
2017
|
+
return computePosition(reference, floating, {
|
|
2018
|
+
...options,
|
|
2019
|
+
platform: {
|
|
2020
|
+
...safeAreaPlatform,
|
|
2021
|
+
...options.platform,
|
|
2022
|
+
[CLIPPING_RECT_CACHE]: new Map(),
|
|
2023
|
+
},
|
|
2024
|
+
});
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
const SAFE_SPACE_MIDDLEWARE = 'post-safe-space';
|
|
2028
|
+
/**
|
|
2029
|
+
* Computes the safe space, the area the pointer can travel through to get from the reference to
|
|
2030
|
+
* the floating element.
|
|
2031
|
+
*/
|
|
2032
|
+
function safeSpace() {
|
|
2033
|
+
return {
|
|
2034
|
+
name: SAFE_SPACE_MIDDLEWARE,
|
|
2035
|
+
async fn(state) {
|
|
2036
|
+
const { placement, rects, x, y } = state;
|
|
2037
|
+
const side = getSide(placement);
|
|
2038
|
+
const reference = await getViewportRect(state, rects.reference);
|
|
2039
|
+
const floating = await getViewportRect(state, { ...rects.floating, x, y });
|
|
2040
|
+
const path = [
|
|
2041
|
+
...getPathAlongSide(floating, getOppositeSide(side)),
|
|
2042
|
+
...getPathAlongSide(reference, side),
|
|
2043
|
+
];
|
|
2044
|
+
const points = [];
|
|
2045
|
+
for (let i = 0; i < path.length; i += 2) {
|
|
2046
|
+
points.push(`${path[i]}px ${path[i + 1]}px`);
|
|
2047
|
+
}
|
|
2048
|
+
const data = { polygon: `polygon(${points.join(', ')})` };
|
|
2049
|
+
return { data };
|
|
2050
|
+
},
|
|
2051
|
+
};
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* Converts a rectangle from the floating element's offset parent's coordinate system to viewport
|
|
2055
|
+
* coordinates.
|
|
2056
|
+
*/
|
|
2057
|
+
async function getViewportRect({ elements, platform, strategy }, rect) {
|
|
2058
|
+
const viewportRect = await platform.convertOffsetParentRelativeRectToViewportRelativeRect?.({
|
|
2059
|
+
offsetParent: await platform.getOffsetParent?.(elements.floating),
|
|
2060
|
+
rect,
|
|
2061
|
+
elements,
|
|
2062
|
+
strategy,
|
|
2015
2063
|
});
|
|
2064
|
+
return rectToClientRect(viewportRect ?? rect);
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* Returns the path along the specified side of the given rectangle.
|
|
2068
|
+
*
|
|
2069
|
+
* The path is a list of coordinates in the form of [x₁, y₁, x₂, y₂] and is given in clockwise order.
|
|
2070
|
+
*/
|
|
2071
|
+
function getPathAlongSide(rect, side) {
|
|
2072
|
+
const self = rect[side];
|
|
2073
|
+
const prev = rect[getPreviousSide(side)];
|
|
2074
|
+
const next = rect[getNextSide(side)];
|
|
2075
|
+
return getSideAxis(side) === 'x' ? [self, prev, self, next] : [prev, self, next, self];
|
|
2016
2076
|
}
|
|
2017
2077
|
|
|
2018
2078
|
// src/events.ts
|
|
@@ -2807,78 +2867,7 @@ function apply() {
|
|
|
2807
2867
|
injectStyles(document);
|
|
2808
2868
|
}
|
|
2809
2869
|
|
|
2810
|
-
|
|
2811
|
-
* This utility is covered by the end-to-end tests under 'clipping' in `popovercontainer.cy.ts`.
|
|
2812
|
-
*/
|
|
2813
|
-
const CLIPPING_RECT_CACHE = Symbol('Clipping Rect Cache');
|
|
2814
|
-
/**
|
|
2815
|
-
* A custom floating UI platform that restricts clipping rectangles to the safe area.
|
|
2816
|
-
*/
|
|
2817
|
-
const safeAreaPlatform = { ...platform, getClippingRect };
|
|
2818
|
-
/**
|
|
2819
|
-
* Computes the clipping rectangle of an element while accounting for the safe area.
|
|
2820
|
-
*/
|
|
2821
|
-
async function getClippingRect(...args) {
|
|
2822
|
-
const element = args[0].element;
|
|
2823
|
-
// Check whether the clipping rectangle of the given element has already been computed during
|
|
2824
|
-
// this pass.
|
|
2825
|
-
const hit = this[CLIPPING_RECT_CACHE].get(element);
|
|
2826
|
-
if (hit)
|
|
2827
|
-
return hit;
|
|
2828
|
-
// Compute the clipping rectangle with the Floating UI DOM platform, then restrict it to the safe
|
|
2829
|
-
// area.
|
|
2830
|
-
const clippingRect = await platform.getClippingRect.apply(this, args);
|
|
2831
|
-
applySafeArea(clippingRect, element);
|
|
2832
|
-
this[CLIPPING_RECT_CACHE].set(element, clippingRect);
|
|
2833
|
-
return clippingRect;
|
|
2834
|
-
}
|
|
2835
|
-
/**
|
|
2836
|
-
* Restricts the `clippingRect` computed for `element` to the safe area, modifying it in place.
|
|
2837
|
-
*
|
|
2838
|
-
* The safe area only applies to elements that the header can actually cover, which excludes
|
|
2839
|
-
* elements without a header on their page, elements on a top layer and elements within the header.
|
|
2840
|
-
*/
|
|
2841
|
-
function applySafeArea(clippingRect, element) {
|
|
2842
|
-
const headerElement = element.ownerDocument.querySelector('post-header');
|
|
2843
|
-
if (headerElement === null)
|
|
2844
|
-
return;
|
|
2845
|
-
let parent = element;
|
|
2846
|
-
while (!isLastTraversableNode(parent)) {
|
|
2847
|
-
parent = getParentNode(parent);
|
|
2848
|
-
if (!isHTMLElement(parent))
|
|
2849
|
-
continue;
|
|
2850
|
-
// Do not apply the safe area of the header to
|
|
2851
|
-
// - elements that are on a top layer, such as a dialog.
|
|
2852
|
-
// - elements that are located within the header itself.
|
|
2853
|
-
if (isTopLayer(parent) || parent === headerElement)
|
|
2854
|
-
return;
|
|
2855
|
-
}
|
|
2856
|
-
const headerRect = headerElement.getBoundingClientRect();
|
|
2857
|
-
const top = Math.max(clippingRect.y, headerRect.bottom);
|
|
2858
|
-
clippingRect.height -= top - clippingRect.y;
|
|
2859
|
-
clippingRect.y = top;
|
|
2860
|
-
}
|
|
2861
|
-
/**
|
|
2862
|
-
* Computes the coordinates that will position the `floating` element next to a given `reference`
|
|
2863
|
-
* element while accounting for the safe area.
|
|
2864
|
-
*
|
|
2865
|
-
* The safe area is the part of the viewport that the header does not cover. Restricting the
|
|
2866
|
-
* clipping rectangles to it makes floating elements behave as if they were clipped by the header.
|
|
2867
|
-
*/
|
|
2868
|
-
const computePositionWithSafeArea = (reference, floating, options) => {
|
|
2869
|
-
// Adapted from https://github.com/floating-ui/floating-ui/blob/27629b74ba36ab8ceb2a968051927b9b69511a3b/packages/dom/src/index.ts#L15
|
|
2870
|
-
options ??= {};
|
|
2871
|
-
return computePosition(reference, floating, {
|
|
2872
|
-
...options,
|
|
2873
|
-
platform: {
|
|
2874
|
-
...safeAreaPlatform,
|
|
2875
|
-
...options.platform,
|
|
2876
|
-
[CLIPPING_RECT_CACHE]: new Map(),
|
|
2877
|
-
},
|
|
2878
|
-
});
|
|
2879
|
-
};
|
|
2880
|
-
|
|
2881
|
-
const postPopovercontainerCss = () => `@layer polyfill{@supports not selector(:popover-open){:host([popover]:not(.\\:popover-open)){display:none}}}:host{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:host>div{-webkit-box-shadow:var(--post-device-elevation-300);box-shadow:var(--post-device-elevation-300);width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:100%;color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px;position:relative}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host>div{border:2px solid rgba(0,0,0,0)}}:host [part=post-popovercontainer-border-mask]{display:none;position:absolute;inset:0;border-radius:4px;pointer-events:none}:host .arrow{--post-popovercontainer-arrow-border: var(--post-popovercontainer-arrow-border-width, 0px) solid var(--post-popovercontainer-arrow-border-color, transparent);position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:host .arrow[dynamic-placement=top]{border-bottom-right-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=right]{border-bottom-left-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=bottom]{border-top-left-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[dynamic-placement=left]{border-top-right-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .arrow[dynamic-placement=top]{-webkit-border-after:2px solid rgba(0,0,0,0);border-block-end:2px solid rgba(0,0,0,0);-webkit-border-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:host .arrow[dynamic-placement=left]{-webkit-border-before:2px solid rgba(0,0,0,0);border-block-start:2px solid rgba(0,0,0,0);-webkit-border-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:host .arrow[dynamic-placement=right]{-webkit-border-after:2px solid rgba(0,0,0,0);border-block-end:2px solid rgba(0,0,0,0);-webkit-border-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:host .arrow[dynamic-placement=bottom]{-webkit-border-before:2px solid rgba(0,0,0,0);border-block-start:2px solid rgba(0,0,0,0);-webkit-border-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}:host([tooltip]){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:host([safe-space])::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto}:host([safe-space=triangle])::after{-webkit-clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)));clip-path:polygon(var(--post-safe-space-cursor-x, 0) var(--post-safe-space-cursor-y, 0), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)))}:host([safe-space=trapezoid])::after{-webkit-clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)));clip-path:polygon(var(--post-safe-space-trigger-x-start, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-start, 0)), var(--post-safe-space-trigger-x-end, var(--post-safe-space-trigger-x, 0)) var(--post-safe-space-trigger-y, var(--post-safe-space-trigger-y-end, 0)), var(--post-safe-space-popover-x-end, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-end, 0)), var(--post-safe-space-popover-x-start, var(--post-safe-space-popover-x, 0)) var(--post-safe-space-popover-y, var(--post-safe-space-popover-y-start, 0)))}:host(:not(:has(.arrow)))>div{-webkit-box-shadow:var(--post-device-elevation-300);box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{-webkit-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));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))}:host(:has(.arrow[dynamic-placement=top]))>div{-webkit-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));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))}:host(:has(.arrow[dynamic-placement=left]))>div{-webkit-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));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))}:host(:has(.arrow[dynamic-placement=right]))>div{-webkit-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));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))}`;
|
|
2870
|
+
const postPopovercontainerCss = () => `@layer polyfill{@supports not selector(:popover-open){:host([popover]:not(.\\:popover-open)){display:none}}}:host{background-color:rgba(0,0,0,0);border:rgba(0,0,0,0);position:fixed;margin:0;padding:0;overflow:visible}:host [part=post-popovercontainer-content]{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:var(--post-device-elevation-300);box-shadow:var(--post-device-elevation-300);width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:var(--post-popovercontainer-available-width);max-height:var(--post-popovercontainer-available-height);color:var(--post-current-fg);background-color:var(--post-current-bg);border-radius:4px;position:relative;display:-ms-flexbox;display:flex}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host [part=post-popovercontainer-content]{border:2px solid rgba(0,0,0,0)}}:host [part=post-popovercontainer-border-mask]{display:none;position:absolute;inset:0;border-radius:4px;pointer-events:none}:host .arrow{--post-popovercontainer-arrow-border: var(--post-popovercontainer-arrow-border-width, 0px) solid var(--post-popovercontainer-arrow-border-color, transparent);position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:host .arrow[data-side=top]{border-bottom-right-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}:host .arrow[data-side=right]{border-bottom-left-radius:2px;border-bottom:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[data-side=bottom]{border-top-left-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-left:var(--post-popovercontainer-arrow-border)}:host .arrow[data-side=left]{border-top-right-radius:2px;border-top:var(--post-popovercontainer-arrow-border);border-right:var(--post-popovercontainer-arrow-border)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .arrow[data-side=top]{-webkit-border-after:2px solid rgba(0,0,0,0);border-block-end:2px solid rgba(0,0,0,0);-webkit-border-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);bottom:-0.3796735336rem !important}:host .arrow[data-side=left]{-webkit-border-before:2px solid rgba(0,0,0,0);border-block-start:2px solid rgba(0,0,0,0);-webkit-border-end:2px solid rgba(0,0,0,0);border-inline-end:2px solid rgba(0,0,0,0);right:-0.3796735336rem !important}:host .arrow[data-side=right]{-webkit-border-after:2px solid rgba(0,0,0,0);border-block-end:2px solid rgba(0,0,0,0);-webkit-border-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);left:-0.3796735336rem !important}:host .arrow[data-side=bottom]{-webkit-border-before:2px solid rgba(0,0,0,0);border-block-start:2px solid rgba(0,0,0,0);-webkit-border-start:2px solid rgba(0,0,0,0);border-inline-start:2px solid rgba(0,0,0,0);top:-0.3796735336rem !important}}:host([tooltip]){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:host([safe-space])::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:auto;-webkit-clip-path:var(--post-popovercontainer-safe-space, polygon(0 0, 0 0, 0 0));clip-path:var(--post-popovercontainer-safe-space, polygon(0 0, 0 0, 0 0))}:host(:not(:has(.arrow)))>div{-webkit-box-shadow:var(--post-device-elevation-300);box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{-webkit-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));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))}:host(:has(.arrow[data-side=top]))>div{-webkit-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));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))}:host(:has(.arrow[data-side=left]))>div{-webkit-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));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))}:host(:has(.arrow[data-side=right]))>div{-webkit-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));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))}`;
|
|
2882
2871
|
|
|
2883
2872
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2884
2873
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2890,34 +2879,10 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
2890
2879
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2891
2880
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2892
2881
|
};
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2895
|
-
|
|
2882
|
+
const AVAILABLE_WIDTH_PROPERTY = '--post-popovercontainer-available-width';
|
|
2883
|
+
const AVAILABLE_HEIGHT_PROPERTY = '--post-popovercontainer-available-height';
|
|
2884
|
+
const SAFE_SPACE_PROPERTY = '--post-popovercontainer-safe-space';
|
|
2896
2885
|
const PostPopovercontainer = class {
|
|
2897
|
-
static {
|
|
2898
|
-
this.STATIC_SIDES = {
|
|
2899
|
-
top: 'bottom',
|
|
2900
|
-
right: 'left',
|
|
2901
|
-
bottom: 'top',
|
|
2902
|
-
left: 'right',
|
|
2903
|
-
};
|
|
2904
|
-
}
|
|
2905
|
-
static {
|
|
2906
|
-
this.PROPERTIES_TO_CLEAR = [
|
|
2907
|
-
'--post-safe-space-popover-x',
|
|
2908
|
-
'--post-safe-space-popover-y',
|
|
2909
|
-
'--post-safe-space-popover-x-start',
|
|
2910
|
-
'--post-safe-space-popover-x-end',
|
|
2911
|
-
'--post-safe-space-popover-y-start',
|
|
2912
|
-
'--post-safe-space-popover-y-end',
|
|
2913
|
-
'--post-safe-space-trigger-x',
|
|
2914
|
-
'--post-safe-space-trigger-y',
|
|
2915
|
-
'--post-safe-space-trigger-x-start',
|
|
2916
|
-
'--post-safe-space-trigger-x-end',
|
|
2917
|
-
'--post-safe-space-trigger-y-start',
|
|
2918
|
-
'--post-safe-space-trigger-y-end',
|
|
2919
|
-
];
|
|
2920
|
-
}
|
|
2921
2886
|
constructor(hostRef) {
|
|
2922
2887
|
index.registerInstance(this, hostRef);
|
|
2923
2888
|
this.postBeforeShow = index.createEvent(this, "postBeforeShow");
|
|
@@ -2925,37 +2890,25 @@ const PostPopovercontainer = class {
|
|
|
2925
2890
|
this.postHide = index.createEvent(this, "postHide");
|
|
2926
2891
|
this.postBeforeToggle = index.createEvent(this, "postBeforeToggle");
|
|
2927
2892
|
this.postToggle = index.createEvent(this, "postToggle");
|
|
2893
|
+
/** The element the popover is anchored to */
|
|
2894
|
+
this.anchorRef = null;
|
|
2895
|
+
this.arrowRef = null;
|
|
2896
|
+
this.hasBeenOpened = false;
|
|
2928
2897
|
this.toggleTimeoutId = null;
|
|
2929
|
-
this.
|
|
2898
|
+
this.runningAnimation = null;
|
|
2899
|
+
this.stopAutoUpdate = null;
|
|
2930
2900
|
/**
|
|
2931
|
-
*
|
|
2932
|
-
* Popovercontainers are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
2933
|
-
* towards the viewport if they would overlap edge boundaries.
|
|
2901
|
+
* Placement of the popover according to the floating-ui options.
|
|
2934
2902
|
*/
|
|
2935
2903
|
this.placement = 'top';
|
|
2936
2904
|
/**
|
|
2937
|
-
* Gap between the edge of the
|
|
2905
|
+
* Gap between the edge of the viewport and the popover.
|
|
2938
2906
|
*/
|
|
2939
2907
|
this.edgeGap = 8;
|
|
2940
2908
|
/**
|
|
2941
|
-
*
|
|
2909
|
+
* Show a little indicator arrow
|
|
2942
2910
|
*/
|
|
2943
2911
|
this.arrow = false;
|
|
2944
|
-
/**
|
|
2945
|
-
* Animation style
|
|
2946
|
-
*/
|
|
2947
|
-
this.animation = 'pop-in';
|
|
2948
|
-
this.currentAnimation = null;
|
|
2949
|
-
this.boundMouseTrackingHandler = this.mouseTrackingHandler.bind(this);
|
|
2950
|
-
}
|
|
2951
|
-
/**
|
|
2952
|
-
* Updates cursor position for safe space feature when popover is open.
|
|
2953
|
-
* Sets CSS custom properties for dynamic styling of safe area.
|
|
2954
|
-
* @param event MouseEvent with cursor position
|
|
2955
|
-
*/
|
|
2956
|
-
mouseTrackingHandler(event) {
|
|
2957
|
-
this.host.style.setProperty('--post-safe-space-cursor-x', `${event.clientX}px`);
|
|
2958
|
-
this.host.style.setProperty('--post-safe-space-cursor-y', `${event.clientY}px`);
|
|
2959
2912
|
}
|
|
2960
2913
|
connectedCallback() {
|
|
2961
2914
|
if (!isSupported()) {
|
|
@@ -2966,296 +2919,197 @@ const PostPopovercontainer = class {
|
|
|
2966
2919
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
2967
2920
|
}
|
|
2968
2921
|
disconnectedCallback() {
|
|
2969
|
-
|
|
2970
|
-
this.clearAutoUpdate();
|
|
2971
|
-
}
|
|
2922
|
+
this.cleanup();
|
|
2972
2923
|
this.host.removeEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
2973
2924
|
}
|
|
2925
|
+
cleanup() {
|
|
2926
|
+
this.stopAutoUpdate?.();
|
|
2927
|
+
if (this.runningAnimation) {
|
|
2928
|
+
this.runningAnimation.cancel();
|
|
2929
|
+
this.runningAnimation = null;
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
isOpen() {
|
|
2933
|
+
return this.host?.matches(':where(:popover-open, .popover-open)');
|
|
2934
|
+
}
|
|
2935
|
+
getContent() {
|
|
2936
|
+
return this.host?.shadowRoot.querySelector('[part="post-popovercontainer-content"]');
|
|
2937
|
+
}
|
|
2938
|
+
getContentMinSize() {
|
|
2939
|
+
const content = this.getContent();
|
|
2940
|
+
if (!content)
|
|
2941
|
+
return {};
|
|
2942
|
+
const { minWidth, minHeight } = getComputedStyle(content);
|
|
2943
|
+
return {
|
|
2944
|
+
width: Number.parseFloat(minWidth) || 0,
|
|
2945
|
+
height: Number.parseFloat(minHeight) || 0,
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2974
2948
|
/**
|
|
2975
|
-
*
|
|
2976
|
-
* @param
|
|
2949
|
+
* Shows the popover.
|
|
2950
|
+
* @param anchor the element that the popover is visually anchored to.
|
|
2977
2951
|
*/
|
|
2978
|
-
async show(
|
|
2979
|
-
if (this.toggleTimeoutId || !
|
|
2952
|
+
async show(anchor) {
|
|
2953
|
+
if (this.toggleTimeoutId || !anchor || this.isOpen())
|
|
2980
2954
|
return;
|
|
2981
|
-
this.
|
|
2982
|
-
this.updatePosition();
|
|
2955
|
+
this.anchorRef = anchor;
|
|
2983
2956
|
this.host.showPopover();
|
|
2984
2957
|
}
|
|
2985
2958
|
/**
|
|
2986
|
-
*
|
|
2959
|
+
* Hides the popover.
|
|
2987
2960
|
*/
|
|
2988
2961
|
async hide() {
|
|
2989
|
-
if (!this.
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2962
|
+
if (this.toggleTimeoutId || !this.isOpen())
|
|
2963
|
+
return;
|
|
2964
|
+
this.anchorRef = null;
|
|
2965
|
+
this.host.hidePopover();
|
|
2966
|
+
this.postHide.emit();
|
|
2994
2967
|
}
|
|
2995
2968
|
/**
|
|
2996
|
-
*
|
|
2997
|
-
*
|
|
2998
|
-
*
|
|
2969
|
+
* Toggles the popover's state from hidden to showing and vice versa.
|
|
2970
|
+
*
|
|
2971
|
+
* If `state` is specified, the popover is forced to be shown if the is set to `true`, or hidden
|
|
2972
|
+
* if it is set to `false`.
|
|
2973
|
+
*
|
|
2974
|
+
* @param anchor the element that the popover is visually anchored to.
|
|
2975
|
+
* @param force the next state of the popover.
|
|
2976
|
+
* @returns the new state of the popover: `true` if it is shown, `false` if it is hidden.
|
|
2999
2977
|
*/
|
|
3000
|
-
async toggle(
|
|
3001
|
-
const isOpen = this.
|
|
3002
|
-
|
|
3003
|
-
if (willOpen && !target)
|
|
2978
|
+
async toggle(anchor, force) {
|
|
2979
|
+
const isOpen = this.isOpen();
|
|
2980
|
+
if (!this.host || this.toggleTimeoutId)
|
|
3004
2981
|
return isOpen;
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
return this.host.matches(':where(:popover-open, .popover-open)');
|
|
2982
|
+
const shouldOpen = force === true || (force === undefined && !isOpen);
|
|
2983
|
+
if (isOpen === shouldOpen || (shouldOpen && !anchor))
|
|
2984
|
+
return isOpen;
|
|
2985
|
+
this.anchorRef = shouldOpen ? anchor : null;
|
|
2986
|
+
this.host.togglePopover(force);
|
|
2987
|
+
this.toggleTimeoutId = null;
|
|
2988
|
+
return this.isOpen();
|
|
3013
2989
|
}
|
|
3014
2990
|
/**
|
|
3015
|
-
* Handles the popover
|
|
2991
|
+
* Handles the popover's state transition from hidden to showing and vice versa.
|
|
3016
2992
|
*/
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
if (typeof animationFn === 'function') {
|
|
3024
|
-
this.runOpenAnimation(animationFn, content);
|
|
3025
|
-
}
|
|
3026
|
-
else {
|
|
3027
|
-
// No animation case
|
|
3028
|
-
this.postBeforeToggle.emit({ willOpen: true });
|
|
3029
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3030
|
-
this.postToggle.emit({ isOpen: true });
|
|
3031
|
-
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
3032
|
-
if (this.hasOpenedOnce)
|
|
3033
|
-
this.hasOpenedOnce = false;
|
|
3034
|
-
}
|
|
3035
|
-
}
|
|
3036
|
-
if (this.safeSpace) {
|
|
3037
|
-
globalThis.addEventListener('mousemove', this.boundMouseTrackingHandler);
|
|
3038
|
-
}
|
|
2993
|
+
async handleToggle(event) {
|
|
2994
|
+
this.toggleTimeoutId = globalThis.setTimeout(() => (this.toggleTimeoutId = null), 10);
|
|
2995
|
+
if (event.newState === 'open')
|
|
2996
|
+
await this.handleOpen();
|
|
2997
|
+
else
|
|
2998
|
+
await this.handleClose();
|
|
3039
2999
|
}
|
|
3040
3000
|
/**
|
|
3041
|
-
* Handles the popover
|
|
3001
|
+
* Handles the popover's state transition from hidden to showing, emitting related events.
|
|
3042
3002
|
*/
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3003
|
+
async handleOpen() {
|
|
3004
|
+
this.postBeforeToggle.emit({ willOpen: true });
|
|
3005
|
+
this.postBeforeShow.emit({ first: !this.hasBeenOpened });
|
|
3006
|
+
await this.updatePosition(true);
|
|
3007
|
+
this.startAutoUpdate();
|
|
3008
|
+
try {
|
|
3009
|
+
await this.runOpenAnimation();
|
|
3049
3010
|
}
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
this.currentAnimation.cancel();
|
|
3053
|
-
this.currentAnimation = null;
|
|
3011
|
+
catch {
|
|
3012
|
+
return;
|
|
3054
3013
|
}
|
|
3055
|
-
this.
|
|
3056
|
-
this.
|
|
3057
|
-
this.
|
|
3014
|
+
this.postToggle.emit({ isOpen: true });
|
|
3015
|
+
this.postShow.emit({ first: !this.hasBeenOpened });
|
|
3016
|
+
this.hasBeenOpened = true;
|
|
3058
3017
|
}
|
|
3059
3018
|
/**
|
|
3060
|
-
*
|
|
3019
|
+
* Run the open animation for the popover.
|
|
3061
3020
|
*/
|
|
3062
|
-
async runOpenAnimation(
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
this.postBeforeToggle.emit({ willOpen: true });
|
|
3069
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3070
|
-
this.postToggle.emit({ isOpen: true });
|
|
3071
|
-
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
3072
|
-
return;
|
|
3073
|
-
}
|
|
3074
|
-
this.currentAnimation = animation;
|
|
3075
|
-
if (animation.playState === 'running') {
|
|
3076
|
-
this.postBeforeToggle.emit({ willOpen: true });
|
|
3077
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3078
|
-
}
|
|
3079
|
-
await animation.finished;
|
|
3080
|
-
this.postToggle.emit({ isOpen: true });
|
|
3081
|
-
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
3082
|
-
this.hasOpenedOnce = true;
|
|
3083
|
-
}
|
|
3084
|
-
catch (err) {
|
|
3085
|
-
console.warn('Animation failed or was interrupted:', err);
|
|
3086
|
-
// Reset all states to closing
|
|
3087
|
-
this.postBeforeToggle.emit({ willOpen: false });
|
|
3088
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3089
|
-
this.postToggle.emit({ isOpen: false });
|
|
3090
|
-
}
|
|
3091
|
-
finally {
|
|
3092
|
-
if (this.currentAnimation === animation) {
|
|
3093
|
-
this.currentAnimation = null;
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3021
|
+
async runOpenAnimation() {
|
|
3022
|
+
const content = this.getContent();
|
|
3023
|
+
if (!content)
|
|
3024
|
+
return;
|
|
3025
|
+
this.runningAnimation = popIn(content);
|
|
3026
|
+
await this.runningAnimation.finished;
|
|
3096
3027
|
}
|
|
3097
3028
|
/**
|
|
3098
|
-
*
|
|
3099
|
-
* Popovercontainers can be closed or opened with other methods than class members,
|
|
3100
|
-
* therefore listening to the toggle event is safer for cleaning up.
|
|
3101
|
-
* @param e ToggleEvent
|
|
3029
|
+
* Handles the popover's state transition from showing to hidden, emitting related events.
|
|
3102
3030
|
*/
|
|
3103
|
-
|
|
3104
|
-
this.
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
}
|
|
3031
|
+
async handleClose() {
|
|
3032
|
+
this.postBeforeToggle.emit({ willOpen: false });
|
|
3033
|
+
this.cleanup();
|
|
3034
|
+
this.host.style.removeProperty(AVAILABLE_WIDTH_PROPERTY);
|
|
3035
|
+
this.host.style.removeProperty(AVAILABLE_HEIGHT_PROPERTY);
|
|
3036
|
+
this.host.style.removeProperty(SAFE_SPACE_PROPERTY);
|
|
3037
|
+
this.postToggle.emit({ isOpen: false });
|
|
3038
|
+
this.postHide.emit();
|
|
3112
3039
|
}
|
|
3113
3040
|
/**
|
|
3114
|
-
*
|
|
3115
|
-
* an influence on popovercontainer positioning
|
|
3041
|
+
* Listen for changes that affect the popover's position and update it accordingly.
|
|
3116
3042
|
*/
|
|
3117
|
-
|
|
3118
|
-
if (!this.
|
|
3043
|
+
startAutoUpdate() {
|
|
3044
|
+
if (!this.host || !this.anchorRef)
|
|
3119
3045
|
return;
|
|
3120
|
-
this.
|
|
3046
|
+
this.stopAutoUpdate = autoUpdate(this.anchorRef, this.host, () => this.updatePosition(this.autoResize));
|
|
3121
3047
|
}
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3048
|
+
/**
|
|
3049
|
+
* Updates the position of the popover based on the anchor's position and the specified placement.
|
|
3050
|
+
* @param withSize whether to resize the popover based on the available space.
|
|
3051
|
+
*/
|
|
3052
|
+
async updatePosition(withSize = false) {
|
|
3053
|
+
const { x, y, middlewareData, placement } = await this.computePosition(withSize);
|
|
3054
|
+
// Hide the popover if the anchor is outside the scrollport.
|
|
3125
3055
|
if (middlewareData.hide?.referenceHidden) {
|
|
3126
3056
|
this.host.hidePopover();
|
|
3057
|
+
return;
|
|
3127
3058
|
}
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
// Position popover
|
|
3059
|
+
this.side = getSide(placement);
|
|
3060
|
+
// Position the popover.
|
|
3131
3061
|
this.host.style.left = `${x}px`;
|
|
3132
3062
|
this.host.style.top = `${y}px`;
|
|
3133
|
-
// Position
|
|
3134
|
-
if (
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
const halfSide = -0.5 * arrowSizePx;
|
|
3139
|
-
if (staticSide) {
|
|
3140
|
-
Object.assign(this.arrowRef.style, {
|
|
3141
|
-
left: arrowX ? `${arrowX}px` : '',
|
|
3142
|
-
top: arrowY ? `${arrowY}px` : '',
|
|
3143
|
-
[staticSide]: `${halfSide}px`,
|
|
3144
|
-
});
|
|
3145
|
-
}
|
|
3063
|
+
// Position the indicator arrow.
|
|
3064
|
+
if (middlewareData.arrow) {
|
|
3065
|
+
this.arrowRef.style.left = middlewareData.arrow.x ? `${middlewareData.arrow.x}px` : '';
|
|
3066
|
+
this.arrowRef.style.top = middlewareData.arrow.y ? `${middlewareData.arrow.y}px` : '';
|
|
3067
|
+
this.arrowRef.style[getOppositeSide(this.side)] = `-${this.arrowRef.offsetWidth / 2}px`;
|
|
3146
3068
|
}
|
|
3147
|
-
//
|
|
3148
|
-
if (
|
|
3149
|
-
|
|
3069
|
+
// Set the safe space polygon.
|
|
3070
|
+
if (middlewareData[SAFE_SPACE_MIDDLEWARE]) {
|
|
3071
|
+
this.host.style.setProperty(SAFE_SPACE_PROPERTY, middlewareData[SAFE_SPACE_MIDDLEWARE].polygon);
|
|
3150
3072
|
}
|
|
3151
3073
|
}
|
|
3152
|
-
async
|
|
3153
|
-
const
|
|
3154
|
-
const isAligned = (this.placement || 'top').includes('-');
|
|
3155
|
-
const flipMiddleware = [
|
|
3156
|
-
// Flip the popover if the target moves outside the viewport
|
|
3157
|
-
flip({ elementContext: 'reference', crossAxis: false }),
|
|
3158
|
-
// Flip the popover if the popover itself moves outside the viewport
|
|
3159
|
-
flip({ elementContext: 'floating', crossAxis: false }),
|
|
3160
|
-
];
|
|
3161
|
-
const shiftMiddleware = shift({
|
|
3162
|
-
padding: gap,
|
|
3163
|
-
limiter: limitShift({
|
|
3164
|
-
offset: 32,
|
|
3165
|
-
}),
|
|
3166
|
-
});
|
|
3074
|
+
async computePosition(withSize) {
|
|
3075
|
+
const padding = this.edgeGap ?? 0;
|
|
3167
3076
|
const middleware = [
|
|
3168
|
-
offset(this.offset ?? (this.arrow ?
|
|
3077
|
+
offset(this.offset ?? (this.arrow ? padding + 4 : padding)),
|
|
3169
3078
|
inline(),
|
|
3170
|
-
// Per floating-ui docs: for aligned placements (e.g. bottom-end),
|
|
3171
|
-
// flip should come before shift. For non-aligned, shift before flip.
|
|
3172
|
-
...(isAligned ? [...flipMiddleware, shiftMiddleware] : [shiftMiddleware, ...flipMiddleware]),
|
|
3173
|
-
size({
|
|
3174
|
-
apply({ availableWidth, elements }) {
|
|
3175
|
-
Object.assign(elements.floating.style, {
|
|
3176
|
-
maxWidth: `${availableWidth - gap * 2}px`,
|
|
3177
|
-
});
|
|
3178
|
-
},
|
|
3179
|
-
}),
|
|
3180
3079
|
];
|
|
3181
|
-
|
|
3182
|
-
|
|
3080
|
+
const flipMiddleware = flip({ padding, minSize: this.getContentMinSize() });
|
|
3081
|
+
const shiftMiddleware = shift({ limiter: limitShift({ offset: 32 }), padding });
|
|
3082
|
+
// `flip` should come before `shift` for edge-aligned placements
|
|
3083
|
+
// (see https://floating-ui.com/docs/flip#combining-with-shift).
|
|
3084
|
+
if (this.placement?.includes('-'))
|
|
3085
|
+
middleware.push(flipMiddleware, shiftMiddleware);
|
|
3086
|
+
else
|
|
3087
|
+
middleware.push(shiftMiddleware, flipMiddleware);
|
|
3088
|
+
if (withSize) {
|
|
3089
|
+
middleware.push(size({
|
|
3090
|
+
padding,
|
|
3091
|
+
apply({ availableWidth, availableHeight, elements }) {
|
|
3092
|
+
elements.floating.style.setProperty(AVAILABLE_WIDTH_PROPERTY, `${Math.max(0, availableWidth)}px`);
|
|
3093
|
+
elements.floating.style.setProperty(AVAILABLE_HEIGHT_PROPERTY, `${Math.max(0, availableHeight)}px`);
|
|
3094
|
+
},
|
|
3095
|
+
}));
|
|
3183
3096
|
}
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3097
|
+
if (this.arrow)
|
|
3098
|
+
middleware.push(arrow({ element: this.arrowRef, padding }));
|
|
3099
|
+
if (this.safeSpace)
|
|
3100
|
+
middleware.push(safeSpace());
|
|
3101
|
+
// `hide` should generally be placed at the end of the middleware chain
|
|
3102
|
+
// (see https://floating-ui.com/docs/hide#order).
|
|
3103
|
+
if (this.autoHide)
|
|
3187
3104
|
middleware.push(hide({ strategy: 'referenceHidden' }));
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
placement: this.placement || 'top',
|
|
3105
|
+
return computePositionWithSafeArea(this.anchorRef, this.host, {
|
|
3106
|
+
placement: this.placement ?? 'top',
|
|
3191
3107
|
strategy: 'fixed',
|
|
3192
3108
|
middleware,
|
|
3193
3109
|
});
|
|
3194
3110
|
}
|
|
3195
|
-
async updateSafeSpaceBoundaries(currentPlacement) {
|
|
3196
|
-
const targetRect = this.eventTarget.getBoundingClientRect();
|
|
3197
|
-
const popoverRect = this.host.getBoundingClientRect();
|
|
3198
|
-
const isVertical = currentPlacement === 'top' || currentPlacement === 'bottom';
|
|
3199
|
-
// Helper function to get positioning data based on placement
|
|
3200
|
-
const getPositioningData = (placement, popoverRect, targetRect) => {
|
|
3201
|
-
if (placement === 'top' || placement === 'bottom') {
|
|
3202
|
-
return {
|
|
3203
|
-
popover: {
|
|
3204
|
-
y: placement === 'top' ? popoverRect.bottom : popoverRect.top,
|
|
3205
|
-
xStart: popoverRect.left,
|
|
3206
|
-
xEnd: popoverRect.right,
|
|
3207
|
-
},
|
|
3208
|
-
trigger: {
|
|
3209
|
-
y: placement === 'top' ? targetRect.top : targetRect.bottom,
|
|
3210
|
-
xStart: targetRect.left,
|
|
3211
|
-
xEnd: targetRect.right,
|
|
3212
|
-
},
|
|
3213
|
-
};
|
|
3214
|
-
}
|
|
3215
|
-
else {
|
|
3216
|
-
// left or right
|
|
3217
|
-
return {
|
|
3218
|
-
popover: {
|
|
3219
|
-
x: placement === 'left' ? popoverRect.right : popoverRect.left,
|
|
3220
|
-
yStart: popoverRect.top,
|
|
3221
|
-
yEnd: popoverRect.bottom,
|
|
3222
|
-
},
|
|
3223
|
-
trigger: {
|
|
3224
|
-
x: placement === 'left' ? targetRect.left : targetRect.right,
|
|
3225
|
-
yStart: targetRect.top,
|
|
3226
|
-
yEnd: targetRect.bottom,
|
|
3227
|
-
},
|
|
3228
|
-
};
|
|
3229
|
-
}
|
|
3230
|
-
};
|
|
3231
|
-
const posData = getPositioningData(currentPlacement, popoverRect, targetRect);
|
|
3232
|
-
// Clear previous values
|
|
3233
|
-
PostPopovercontainer.PROPERTIES_TO_CLEAR.forEach(prop => {
|
|
3234
|
-
this.host.style.removeProperty(prop);
|
|
3235
|
-
});
|
|
3236
|
-
if (isVertical) {
|
|
3237
|
-
// For top/bottom placement
|
|
3238
|
-
this.host.style.setProperty('--post-safe-space-popover-y', `${posData.popover.y}px`);
|
|
3239
|
-
this.host.style.setProperty('--post-safe-space-popover-x-start', `${posData.popover.xStart}px`);
|
|
3240
|
-
this.host.style.setProperty('--post-safe-space-popover-x-end', `${posData.popover.xEnd}px`);
|
|
3241
|
-
this.host.style.setProperty('--post-safe-space-trigger-y', `${posData.trigger.y}px`);
|
|
3242
|
-
this.host.style.setProperty('--post-safe-space-trigger-x-start', `${posData.trigger.xStart}px`);
|
|
3243
|
-
this.host.style.setProperty('--post-safe-space-trigger-x-end', `${posData.trigger.xEnd}px`);
|
|
3244
|
-
}
|
|
3245
|
-
else {
|
|
3246
|
-
// For left/right placement
|
|
3247
|
-
this.host.style.setProperty('--post-safe-space-popover-x', `${posData.popover.x}px`);
|
|
3248
|
-
this.host.style.setProperty('--post-safe-space-popover-y-start', `${posData.popover.yStart}px`);
|
|
3249
|
-
this.host.style.setProperty('--post-safe-space-popover-y-end', `${posData.popover.yEnd}px`);
|
|
3250
|
-
this.host.style.setProperty('--post-safe-space-trigger-x', `${posData.trigger.x}px`);
|
|
3251
|
-
this.host.style.setProperty('--post-safe-space-trigger-y-start', `${posData.trigger.yStart}px`);
|
|
3252
|
-
this.host.style.setProperty('--post-safe-space-trigger-y-end', `${posData.trigger.yEnd}px`);
|
|
3253
|
-
}
|
|
3254
|
-
}
|
|
3255
3111
|
render() {
|
|
3256
|
-
return (index.h(index.Host, { key: '
|
|
3257
|
-
this.arrowRef = el;
|
|
3258
|
-
} })), index.h("span", { key: 'deadbcc5892ed545a64b4a0e5e0936e0dd1feb70', part: "post-popovercontainer-border-mask" }), index.h("slot", { key: '48c4db7ab222f3ef18157ce19d8ba15d75441f98' }))));
|
|
3112
|
+
return (index.h(index.Host, { key: 'd48b21174f74b790f8a72b4294e9f741c3b64d14', "data-version": _package.version, popover: "auto" }, index.h("div", { key: '455e84294ecb36e25cc62582eb6c41058f24f6bc', part: "post-popovercontainer-content" }, this.arrow && (index.h("span", { key: '9d11f2596443876123eeaf5a02430d049c1c8b25', "data-side": this.side, class: "arrow", ref: el => (this.arrowRef = el) })), index.h("span", { key: 'a562460cdfa5539e7d9c23f1d044a2c045df5b9f', part: "post-popovercontainer-border-mask" }), index.h("slot", { key: '5aa546bbdf6c70e2a0afabf818d421581060f8a7' }))));
|
|
3259
3113
|
}
|
|
3260
3114
|
get host() { return index.getElement(this); }
|
|
3261
3115
|
};
|
|
@@ -3265,9 +3119,6 @@ __decorate([
|
|
|
3265
3119
|
__decorate([
|
|
3266
3120
|
type.Type('number')
|
|
3267
3121
|
], PostPopovercontainer.prototype, "edgeGap", void 0);
|
|
3268
|
-
__decorate([
|
|
3269
|
-
oneOf.OneOf(['triangle', 'trapezoid'])
|
|
3270
|
-
], PostPopovercontainer.prototype, "safeSpace", void 0);
|
|
3271
3122
|
PostPopovercontainer.style = postPopovercontainerCss();
|
|
3272
3123
|
|
|
3273
3124
|
exports.post_popovercontainer = PostPopovercontainer;
|