@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,10 +1,25 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-h3opCZqH.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-BdiQsTQm.js';
|
|
3
3
|
import { O as OneOf } from './one-of-w2eXPAzD.js';
|
|
4
4
|
import { P as PLACEMENT_TYPES } from './placement-DRiVosES.js';
|
|
5
5
|
import { T as Type } from './type-Daxpt5v6.js';
|
|
6
6
|
import './create-validator-decorator--a-qkYfP.js';
|
|
7
7
|
|
|
8
|
+
const duration = 250;
|
|
9
|
+
const easing = 'ease-out';
|
|
10
|
+
function popIn(el) {
|
|
11
|
+
if (!el)
|
|
12
|
+
return;
|
|
13
|
+
return el.animate([
|
|
14
|
+
{ transform: 'scale(0.9)', opacity: 0 },
|
|
15
|
+
{ transform: 'scale(1)', opacity: 1 },
|
|
16
|
+
], {
|
|
17
|
+
duration,
|
|
18
|
+
easing,
|
|
19
|
+
fill: 'forwards',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
8
23
|
/**
|
|
9
24
|
* Custom positioning reference element.
|
|
10
25
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
@@ -50,23 +65,6 @@ function getSideAxis(placement) {
|
|
|
50
65
|
function getAlignmentAxis(placement) {
|
|
51
66
|
return getOppositeAxis(getSideAxis(placement));
|
|
52
67
|
}
|
|
53
|
-
function getAlignmentSides(placement, rects, rtl) {
|
|
54
|
-
if (rtl === void 0) {
|
|
55
|
-
rtl = false;
|
|
56
|
-
}
|
|
57
|
-
const alignment = getAlignment(placement);
|
|
58
|
-
const alignmentAxis = getAlignmentAxis(placement);
|
|
59
|
-
const length = getAxisLength(alignmentAxis);
|
|
60
|
-
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
61
|
-
if (rects.reference[length] > rects.floating[length]) {
|
|
62
|
-
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
63
|
-
}
|
|
64
|
-
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
65
|
-
}
|
|
66
|
-
function getExpandedPlacements(placement) {
|
|
67
|
-
const oppositePlacement = getOppositePlacement(placement);
|
|
68
|
-
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
69
|
-
}
|
|
70
68
|
function getOppositeAlignmentPlacement(placement) {
|
|
71
69
|
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
|
|
72
70
|
}
|
|
@@ -92,7 +90,7 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
|
92
90
|
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
93
91
|
if (alignment) {
|
|
94
92
|
list = list.map(side => side + "-" + alignment);
|
|
95
|
-
|
|
93
|
+
{
|
|
96
94
|
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
97
95
|
}
|
|
98
96
|
}
|
|
@@ -198,7 +196,7 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
198
196
|
* - 0 = lies flush with the boundary
|
|
199
197
|
* @see https://floating-ui.com/docs/detectOverflow
|
|
200
198
|
*/
|
|
201
|
-
async function detectOverflow(state, options) {
|
|
199
|
+
async function detectOverflow$1(state, options) {
|
|
202
200
|
var _await$platform$isEle;
|
|
203
201
|
if (options === void 0) {
|
|
204
202
|
options = {};
|
|
@@ -271,7 +269,7 @@ const computePosition$1 = async (reference, floating, config) => {
|
|
|
271
269
|
} = config;
|
|
272
270
|
const platformWithDetectOverflow = platform.detectOverflow ? platform : {
|
|
273
271
|
...platform,
|
|
274
|
-
detectOverflow
|
|
272
|
+
detectOverflow: detectOverflow$1
|
|
275
273
|
};
|
|
276
274
|
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
277
275
|
let rects = await platform.getElementRects({
|
|
@@ -431,138 +429,6 @@ const arrow$1 = options => ({
|
|
|
431
429
|
}
|
|
432
430
|
});
|
|
433
431
|
|
|
434
|
-
/**
|
|
435
|
-
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
436
|
-
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
437
|
-
* clipping boundary. Alternative to `autoPlacement`.
|
|
438
|
-
* @see https://floating-ui.com/docs/flip
|
|
439
|
-
*/
|
|
440
|
-
const flip$1 = function (options) {
|
|
441
|
-
if (options === void 0) {
|
|
442
|
-
options = {};
|
|
443
|
-
}
|
|
444
|
-
return {
|
|
445
|
-
name: 'flip',
|
|
446
|
-
options,
|
|
447
|
-
async fn(state) {
|
|
448
|
-
var _middlewareData$arrow, _middlewareData$flip;
|
|
449
|
-
const {
|
|
450
|
-
placement,
|
|
451
|
-
middlewareData,
|
|
452
|
-
rects,
|
|
453
|
-
initialPlacement,
|
|
454
|
-
platform,
|
|
455
|
-
elements
|
|
456
|
-
} = state;
|
|
457
|
-
const {
|
|
458
|
-
mainAxis: checkMainAxis = true,
|
|
459
|
-
crossAxis: checkCrossAxis = true,
|
|
460
|
-
fallbackPlacements: specifiedFallbackPlacements,
|
|
461
|
-
fallbackStrategy = 'bestFit',
|
|
462
|
-
fallbackAxisSideDirection = 'none',
|
|
463
|
-
flipAlignment = true,
|
|
464
|
-
...detectOverflowOptions
|
|
465
|
-
} = evaluate(options, state);
|
|
466
|
-
|
|
467
|
-
// If a reset by the arrow was caused due to an alignment offset being
|
|
468
|
-
// added, we should skip any logic now since `flip()` has already done its
|
|
469
|
-
// work.
|
|
470
|
-
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
471
|
-
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
472
|
-
return {};
|
|
473
|
-
}
|
|
474
|
-
const side = getSide(placement);
|
|
475
|
-
const initialSideAxis = getSideAxis(initialPlacement);
|
|
476
|
-
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
477
|
-
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
478
|
-
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
479
|
-
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
480
|
-
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
481
|
-
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
482
|
-
}
|
|
483
|
-
const placements = [initialPlacement, ...fallbackPlacements];
|
|
484
|
-
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
485
|
-
const overflows = [];
|
|
486
|
-
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
487
|
-
if (checkMainAxis) {
|
|
488
|
-
overflows.push(overflow[side]);
|
|
489
|
-
}
|
|
490
|
-
if (checkCrossAxis) {
|
|
491
|
-
const sides = getAlignmentSides(placement, rects, rtl);
|
|
492
|
-
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
493
|
-
}
|
|
494
|
-
overflowsData = [...overflowsData, {
|
|
495
|
-
placement,
|
|
496
|
-
overflows
|
|
497
|
-
}];
|
|
498
|
-
|
|
499
|
-
// One or more sides is overflowing.
|
|
500
|
-
if (!overflows.every(side => side <= 0)) {
|
|
501
|
-
var _middlewareData$flip2, _overflowsData$filter;
|
|
502
|
-
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
503
|
-
const nextPlacement = placements[nextIndex];
|
|
504
|
-
if (nextPlacement) {
|
|
505
|
-
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
506
|
-
if (!ignoreCrossAxisOverflow ||
|
|
507
|
-
// We leave the current main axis only if every placement on that axis
|
|
508
|
-
// overflows the main axis.
|
|
509
|
-
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
510
|
-
// Try next placement and re-run the lifecycle.
|
|
511
|
-
return {
|
|
512
|
-
data: {
|
|
513
|
-
index: nextIndex,
|
|
514
|
-
overflows: overflowsData
|
|
515
|
-
},
|
|
516
|
-
reset: {
|
|
517
|
-
placement: nextPlacement
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
524
|
-
// then find the placement that fits the best on the main crossAxis side.
|
|
525
|
-
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;
|
|
526
|
-
|
|
527
|
-
// Otherwise fallback.
|
|
528
|
-
if (!resetPlacement) {
|
|
529
|
-
switch (fallbackStrategy) {
|
|
530
|
-
case 'bestFit':
|
|
531
|
-
{
|
|
532
|
-
var _overflowsData$filter2;
|
|
533
|
-
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
534
|
-
if (hasFallbackAxisSideDirection) {
|
|
535
|
-
const currentSideAxis = getSideAxis(d.placement);
|
|
536
|
-
return currentSideAxis === initialSideAxis ||
|
|
537
|
-
// Create a bias to the `y` side axis due to horizontal
|
|
538
|
-
// reading directions favoring greater width.
|
|
539
|
-
currentSideAxis === 'y';
|
|
540
|
-
}
|
|
541
|
-
return true;
|
|
542
|
-
}).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];
|
|
543
|
-
if (placement) {
|
|
544
|
-
resetPlacement = placement;
|
|
545
|
-
}
|
|
546
|
-
break;
|
|
547
|
-
}
|
|
548
|
-
case 'initialPlacement':
|
|
549
|
-
resetPlacement = initialPlacement;
|
|
550
|
-
break;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
if (placement !== resetPlacement) {
|
|
554
|
-
return {
|
|
555
|
-
reset: {
|
|
556
|
-
placement: resetPlacement
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
return {};
|
|
562
|
-
}
|
|
563
|
-
};
|
|
564
|
-
};
|
|
565
|
-
|
|
566
432
|
function getSideOffsets(overflow, rect) {
|
|
567
433
|
return {
|
|
568
434
|
top: overflow.top - rect.height,
|
|
@@ -1445,7 +1311,7 @@ function getDocumentRect(html) {
|
|
|
1445
1311
|
// calculation is affected by unusual styles.
|
|
1446
1312
|
// Most scrollbars leave 15-18px of space.
|
|
1447
1313
|
const SCROLLBAR_MAX = 25;
|
|
1448
|
-
function getViewportRect(element, strategy, rootBoundary) {
|
|
1314
|
+
function getViewportRect$1(element, strategy, rootBoundary) {
|
|
1449
1315
|
if (rootBoundary === void 0) {
|
|
1450
1316
|
rootBoundary = 'viewport';
|
|
1451
1317
|
}
|
|
@@ -1523,7 +1389,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
1523
1389
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1524
1390
|
let rect;
|
|
1525
1391
|
if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {
|
|
1526
|
-
rect = getViewportRect(element, strategy, clippingAncestor);
|
|
1392
|
+
rect = getViewportRect$1(element, strategy, clippingAncestor);
|
|
1527
1393
|
} else if (clippingAncestor === 'document') {
|
|
1528
1394
|
rect = getDocumentRect(getDocumentElement(element));
|
|
1529
1395
|
} else if (isElement(clippingAncestor)) {
|
|
@@ -1919,6 +1785,16 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1919
1785
|
};
|
|
1920
1786
|
}
|
|
1921
1787
|
|
|
1788
|
+
/**
|
|
1789
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
1790
|
+
* element is overflowing a given clipping boundary on each side.
|
|
1791
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
1792
|
+
* - negative = how many pixels left before it will overflow
|
|
1793
|
+
* - 0 = lies flush with the boundary
|
|
1794
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
1795
|
+
*/
|
|
1796
|
+
const detectOverflow = detectOverflow$1;
|
|
1797
|
+
|
|
1922
1798
|
/**
|
|
1923
1799
|
* Modifies the placement by translating the floating element along the
|
|
1924
1800
|
* specified axes.
|
|
@@ -1935,14 +1811,6 @@ const offset = offset$1;
|
|
|
1935
1811
|
*/
|
|
1936
1812
|
const shift = shift$1;
|
|
1937
1813
|
|
|
1938
|
-
/**
|
|
1939
|
-
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1940
|
-
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1941
|
-
* clipping boundary. Alternative to `autoPlacement`.
|
|
1942
|
-
* @see https://floating-ui.com/docs/flip
|
|
1943
|
-
*/
|
|
1944
|
-
const flip = flip$1;
|
|
1945
|
-
|
|
1946
1814
|
/**
|
|
1947
1815
|
* Provides data that allows you to change the size of the floating element —
|
|
1948
1816
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
@@ -1998,19 +1866,211 @@ const computePosition = (reference, floating, options) => {
|
|
|
1998
1866
|
});
|
|
1999
1867
|
};
|
|
2000
1868
|
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
1869
|
+
/**
|
|
1870
|
+
* Returns the nth side in clockwise direction relative to the given side.
|
|
1871
|
+
*/
|
|
1872
|
+
function getRelativeSide(side, n) {
|
|
1873
|
+
return sides[(sides.indexOf(side) + n) % 4];
|
|
1874
|
+
}
|
|
1875
|
+
const getNextSide = (side) => getRelativeSide(side, 1);
|
|
1876
|
+
const getOppositeSide = (side) => getRelativeSide(side, 2);
|
|
1877
|
+
const getPreviousSide = (side) => getRelativeSide(side, 3);
|
|
1878
|
+
|
|
1879
|
+
const FLIP_MIDDLEWARE = 'post-flip';
|
|
1880
|
+
/**
|
|
1881
|
+
* Changes the placement of the floating element to keep it in view.
|
|
1882
|
+
*
|
|
1883
|
+
* Unlike the Floating UI `flip` middleware, placements are measured against `minSize` rather than
|
|
1884
|
+
* against the current size of the floating element, and the placement with the smallest deficit is
|
|
1885
|
+
* used when none of them fits.
|
|
1886
|
+
*/
|
|
1887
|
+
function flip(options = {}) {
|
|
1888
|
+
return {
|
|
1889
|
+
name: FLIP_MIDDLEWARE,
|
|
1890
|
+
options,
|
|
1891
|
+
async fn(state) {
|
|
1892
|
+
const { middlewareData, placement } = state;
|
|
1893
|
+
// see https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
1894
|
+
if (middlewareData.arrow?.alignmentOffset)
|
|
1895
|
+
return {};
|
|
1896
|
+
const { minSize = {}, ...detectOverflowOptions } = evaluate(options, state);
|
|
1897
|
+
const gap = Math.abs(middlewareData.offset?.[getSideAxis(placement)] ?? 0);
|
|
1898
|
+
const side = getSide(placement);
|
|
1899
|
+
const referenceOverflow = await detectOverflow(state, {
|
|
1900
|
+
...detectOverflowOptions,
|
|
1901
|
+
elementContext: 'reference',
|
|
1902
|
+
});
|
|
1903
|
+
const floatingOverflow = await detectOverflow(state, {
|
|
1904
|
+
...detectOverflowOptions,
|
|
1905
|
+
elementContext: 'floating',
|
|
1906
|
+
});
|
|
1907
|
+
// The floating element fits at its current placement, there is nothing left to do.
|
|
1908
|
+
if (Math.max(referenceOverflow[side], floatingOverflow[side]) <= 0)
|
|
1909
|
+
return {};
|
|
1910
|
+
const previous = middlewareData[FLIP_MIDDLEWARE];
|
|
1911
|
+
const measurement = { overflow: referenceOverflow, minSize, gap };
|
|
1912
|
+
let deficits = previous?.deficits ?? [];
|
|
1913
|
+
const placements = previous?.placements ?? (await getPlacements(state, measurement));
|
|
1914
|
+
if (deficits.length < placements.length) {
|
|
1915
|
+
deficits = [...deficits, getDeficit(side, measurement)];
|
|
1916
|
+
}
|
|
1917
|
+
const data = { placements, deficits };
|
|
1918
|
+
// If there are still placements to try, move on to the next one.
|
|
1919
|
+
if (deficits.length < placements.length) {
|
|
1920
|
+
return { data, reset: { placement: placements[deficits.length] } };
|
|
1921
|
+
}
|
|
1922
|
+
// If none of the placements fit, fall back to the one that loses the least space.
|
|
1923
|
+
const fallback = data.placements[data.deficits.indexOf(Math.min(...data.deficits))];
|
|
1924
|
+
return fallback === placement ? { data } : { data, reset: { placement: fallback } };
|
|
1925
|
+
},
|
|
1926
|
+
};
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* Returns the placements to try, ordered from most to least promising.
|
|
1930
|
+
*/
|
|
1931
|
+
async function getPlacements(state, measurement) {
|
|
1932
|
+
const { placement, platform, elements } = state;
|
|
1933
|
+
const { overflow } = measurement;
|
|
1934
|
+
const side = getSide(placement);
|
|
1935
|
+
const placements = [placement, getOppositePlacement(placement)];
|
|
1936
|
+
const mainAxisDeficit = Math.min(getDeficit(side, measurement), getDeficit(getOppositeSide(side), measurement));
|
|
1937
|
+
if (mainAxisDeficit <= 0)
|
|
1938
|
+
return placements;
|
|
1939
|
+
const rtl = (await platform.isRTL?.(elements.floating)) ?? false;
|
|
1940
|
+
const crossAxisPlacements = getOppositeAxisPlacements(placement, true, 'start', rtl);
|
|
1941
|
+
// Try the side with the most available space first.
|
|
1942
|
+
crossAxisPlacements.sort((a, b) => overflow[getSide(a)] - overflow[getSide(b)]);
|
|
1943
|
+
return [...placements, ...crossAxisPlacements];
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* Returns the amount of space required to display the floating element at its minimum size on the
|
|
1947
|
+
* given side of the reference element.
|
|
1948
|
+
*/
|
|
1949
|
+
function getDeficit(side, { minSize, overflow, gap }) {
|
|
1950
|
+
const minLength = minSize[getAxisLength(getSideAxis(side))] ?? 0;
|
|
1951
|
+
return gap + minLength + overflow[side];
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
/**
|
|
1955
|
+
* This utility is covered by the end-to-end tests under 'clipping' in `popovercontainer.cy.ts`.
|
|
1956
|
+
*/
|
|
1957
|
+
const CLIPPING_RECT_CACHE = Symbol('Clipping Rect Cache');
|
|
1958
|
+
/**
|
|
1959
|
+
* A custom floating UI platform that restricts clipping rectangles to the safe area.
|
|
1960
|
+
*/
|
|
1961
|
+
const safeAreaPlatform = { ...platform, getClippingRect };
|
|
1962
|
+
/**
|
|
1963
|
+
* Computes the clipping rectangle of an element while accounting for the safe area.
|
|
1964
|
+
*/
|
|
1965
|
+
async function getClippingRect(...args) {
|
|
1966
|
+
const element = args[0].element;
|
|
1967
|
+
// Check whether the clipping rectangle of the given element has already been computed during
|
|
1968
|
+
// this pass.
|
|
1969
|
+
const hit = this[CLIPPING_RECT_CACHE].get(element);
|
|
1970
|
+
if (hit)
|
|
1971
|
+
return hit;
|
|
1972
|
+
// Compute the clipping rectangle with the Floating UI DOM platform, then restrict it to the safe
|
|
1973
|
+
// area.
|
|
1974
|
+
const clippingRect = await platform.getClippingRect.apply(this, args);
|
|
1975
|
+
applySafeArea(clippingRect, element);
|
|
1976
|
+
this[CLIPPING_RECT_CACHE].set(element, clippingRect);
|
|
1977
|
+
return clippingRect;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Restricts the `clippingRect` computed for `element` to the safe area, modifying it in place.
|
|
1981
|
+
*
|
|
1982
|
+
* The safe area only applies to elements that the header can actually cover, which excludes
|
|
1983
|
+
* elements without a header on their page, elements on a top layer and elements within the header.
|
|
1984
|
+
*/
|
|
1985
|
+
function applySafeArea(clippingRect, element) {
|
|
1986
|
+
const headerElement = element.ownerDocument.querySelector('post-header');
|
|
1987
|
+
if (headerElement === null)
|
|
2005
1988
|
return;
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
1989
|
+
let parent = element;
|
|
1990
|
+
while (!isLastTraversableNode(parent)) {
|
|
1991
|
+
parent = getParentNode(parent);
|
|
1992
|
+
if (!isHTMLElement(parent))
|
|
1993
|
+
continue;
|
|
1994
|
+
// Do not apply the safe area of the header to
|
|
1995
|
+
// - elements that are on a top layer, such as a dialog.
|
|
1996
|
+
// - elements that are located within the header itself.
|
|
1997
|
+
if (isTopLayer(parent) || parent === headerElement)
|
|
1998
|
+
return;
|
|
1999
|
+
}
|
|
2000
|
+
const headerRect = headerElement.getBoundingClientRect();
|
|
2001
|
+
const top = Math.max(clippingRect.y, headerRect.bottom);
|
|
2002
|
+
clippingRect.height -= top - clippingRect.y;
|
|
2003
|
+
clippingRect.y = top;
|
|
2004
|
+
}
|
|
2005
|
+
/**
|
|
2006
|
+
* Computes the coordinates that will position the `floating` element next to a given `reference`
|
|
2007
|
+
* element while accounting for the safe area.
|
|
2008
|
+
*
|
|
2009
|
+
* The safe area is the part of the viewport that the header does not cover. Restricting the
|
|
2010
|
+
* clipping rectangles to it makes floating elements behave as if they were clipped by the header.
|
|
2011
|
+
*/
|
|
2012
|
+
const computePositionWithSafeArea = (reference, floating, options) => {
|
|
2013
|
+
// Adapted from https://github.com/floating-ui/floating-ui/blob/27629b74ba36ab8ceb2a968051927b9b69511a3b/packages/dom/src/index.ts#L15
|
|
2014
|
+
options ??= {};
|
|
2015
|
+
return computePosition(reference, floating, {
|
|
2016
|
+
...options,
|
|
2017
|
+
platform: {
|
|
2018
|
+
...safeAreaPlatform,
|
|
2019
|
+
...options.platform,
|
|
2020
|
+
[CLIPPING_RECT_CACHE]: new Map(),
|
|
2021
|
+
},
|
|
2022
|
+
});
|
|
2023
|
+
};
|
|
2024
|
+
|
|
2025
|
+
const SAFE_SPACE_MIDDLEWARE = 'post-safe-space';
|
|
2026
|
+
/**
|
|
2027
|
+
* Computes the safe space, the area the pointer can travel through to get from the reference to
|
|
2028
|
+
* the floating element.
|
|
2029
|
+
*/
|
|
2030
|
+
function safeSpace() {
|
|
2031
|
+
return {
|
|
2032
|
+
name: SAFE_SPACE_MIDDLEWARE,
|
|
2033
|
+
async fn(state) {
|
|
2034
|
+
const { placement, rects, x, y } = state;
|
|
2035
|
+
const side = getSide(placement);
|
|
2036
|
+
const reference = await getViewportRect(state, rects.reference);
|
|
2037
|
+
const floating = await getViewportRect(state, { ...rects.floating, x, y });
|
|
2038
|
+
const path = [
|
|
2039
|
+
...getPathAlongSide(floating, getOppositeSide(side)),
|
|
2040
|
+
...getPathAlongSide(reference, side),
|
|
2041
|
+
];
|
|
2042
|
+
const points = [];
|
|
2043
|
+
for (let i = 0; i < path.length; i += 2) {
|
|
2044
|
+
points.push(`${path[i]}px ${path[i + 1]}px`);
|
|
2045
|
+
}
|
|
2046
|
+
const data = { polygon: `polygon(${points.join(', ')})` };
|
|
2047
|
+
return { data };
|
|
2048
|
+
},
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Converts a rectangle from the floating element's offset parent's coordinate system to viewport
|
|
2053
|
+
* coordinates.
|
|
2054
|
+
*/
|
|
2055
|
+
async function getViewportRect({ elements, platform, strategy }, rect) {
|
|
2056
|
+
const viewportRect = await platform.convertOffsetParentRelativeRectToViewportRelativeRect?.({
|
|
2057
|
+
offsetParent: await platform.getOffsetParent?.(elements.floating),
|
|
2058
|
+
rect,
|
|
2059
|
+
elements,
|
|
2060
|
+
strategy,
|
|
2013
2061
|
});
|
|
2062
|
+
return rectToClientRect(viewportRect ?? rect);
|
|
2063
|
+
}
|
|
2064
|
+
/**
|
|
2065
|
+
* Returns the path along the specified side of the given rectangle.
|
|
2066
|
+
*
|
|
2067
|
+
* The path is a list of coordinates in the form of [x₁, y₁, x₂, y₂] and is given in clockwise order.
|
|
2068
|
+
*/
|
|
2069
|
+
function getPathAlongSide(rect, side) {
|
|
2070
|
+
const self = rect[side];
|
|
2071
|
+
const prev = rect[getPreviousSide(side)];
|
|
2072
|
+
const next = rect[getNextSide(side)];
|
|
2073
|
+
return getSideAxis(side) === 'x' ? [self, prev, self, next] : [prev, self, next, self];
|
|
2014
2074
|
}
|
|
2015
2075
|
|
|
2016
2076
|
// src/events.ts
|
|
@@ -2805,78 +2865,7 @@ function apply() {
|
|
|
2805
2865
|
injectStyles(document);
|
|
2806
2866
|
}
|
|
2807
2867
|
|
|
2808
|
-
|
|
2809
|
-
* This utility is covered by the end-to-end tests under 'clipping' in `popovercontainer.cy.ts`.
|
|
2810
|
-
*/
|
|
2811
|
-
const CLIPPING_RECT_CACHE = Symbol('Clipping Rect Cache');
|
|
2812
|
-
/**
|
|
2813
|
-
* A custom floating UI platform that restricts clipping rectangles to the safe area.
|
|
2814
|
-
*/
|
|
2815
|
-
const safeAreaPlatform = { ...platform, getClippingRect };
|
|
2816
|
-
/**
|
|
2817
|
-
* Computes the clipping rectangle of an element while accounting for the safe area.
|
|
2818
|
-
*/
|
|
2819
|
-
async function getClippingRect(...args) {
|
|
2820
|
-
const element = args[0].element;
|
|
2821
|
-
// Check whether the clipping rectangle of the given element has already been computed during
|
|
2822
|
-
// this pass.
|
|
2823
|
-
const hit = this[CLIPPING_RECT_CACHE].get(element);
|
|
2824
|
-
if (hit)
|
|
2825
|
-
return hit;
|
|
2826
|
-
// Compute the clipping rectangle with the Floating UI DOM platform, then restrict it to the safe
|
|
2827
|
-
// area.
|
|
2828
|
-
const clippingRect = await platform.getClippingRect.apply(this, args);
|
|
2829
|
-
applySafeArea(clippingRect, element);
|
|
2830
|
-
this[CLIPPING_RECT_CACHE].set(element, clippingRect);
|
|
2831
|
-
return clippingRect;
|
|
2832
|
-
}
|
|
2833
|
-
/**
|
|
2834
|
-
* Restricts the `clippingRect` computed for `element` to the safe area, modifying it in place.
|
|
2835
|
-
*
|
|
2836
|
-
* The safe area only applies to elements that the header can actually cover, which excludes
|
|
2837
|
-
* elements without a header on their page, elements on a top layer and elements within the header.
|
|
2838
|
-
*/
|
|
2839
|
-
function applySafeArea(clippingRect, element) {
|
|
2840
|
-
const headerElement = element.ownerDocument.querySelector('post-header');
|
|
2841
|
-
if (headerElement === null)
|
|
2842
|
-
return;
|
|
2843
|
-
let parent = element;
|
|
2844
|
-
while (!isLastTraversableNode(parent)) {
|
|
2845
|
-
parent = getParentNode(parent);
|
|
2846
|
-
if (!isHTMLElement(parent))
|
|
2847
|
-
continue;
|
|
2848
|
-
// Do not apply the safe area of the header to
|
|
2849
|
-
// - elements that are on a top layer, such as a dialog.
|
|
2850
|
-
// - elements that are located within the header itself.
|
|
2851
|
-
if (isTopLayer(parent) || parent === headerElement)
|
|
2852
|
-
return;
|
|
2853
|
-
}
|
|
2854
|
-
const headerRect = headerElement.getBoundingClientRect();
|
|
2855
|
-
const top = Math.max(clippingRect.y, headerRect.bottom);
|
|
2856
|
-
clippingRect.height -= top - clippingRect.y;
|
|
2857
|
-
clippingRect.y = top;
|
|
2858
|
-
}
|
|
2859
|
-
/**
|
|
2860
|
-
* Computes the coordinates that will position the `floating` element next to a given `reference`
|
|
2861
|
-
* element while accounting for the safe area.
|
|
2862
|
-
*
|
|
2863
|
-
* The safe area is the part of the viewport that the header does not cover. Restricting the
|
|
2864
|
-
* clipping rectangles to it makes floating elements behave as if they were clipped by the header.
|
|
2865
|
-
*/
|
|
2866
|
-
const computePositionWithSafeArea = (reference, floating, options) => {
|
|
2867
|
-
// Adapted from https://github.com/floating-ui/floating-ui/blob/27629b74ba36ab8ceb2a968051927b9b69511a3b/packages/dom/src/index.ts#L15
|
|
2868
|
-
options ??= {};
|
|
2869
|
-
return computePosition(reference, floating, {
|
|
2870
|
-
...options,
|
|
2871
|
-
platform: {
|
|
2872
|
-
...safeAreaPlatform,
|
|
2873
|
-
...options.platform,
|
|
2874
|
-
[CLIPPING_RECT_CACHE]: new Map(),
|
|
2875
|
-
},
|
|
2876
|
-
});
|
|
2877
|
-
};
|
|
2878
|
-
|
|
2879
|
-
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))}`;
|
|
2868
|
+
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))}`;
|
|
2880
2869
|
|
|
2881
2870
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2882
2871
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2888,34 +2877,10 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
2888
2877
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2889
2878
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2890
2879
|
};
|
|
2891
|
-
const
|
|
2892
|
-
|
|
2893
|
-
|
|
2880
|
+
const AVAILABLE_WIDTH_PROPERTY = '--post-popovercontainer-available-width';
|
|
2881
|
+
const AVAILABLE_HEIGHT_PROPERTY = '--post-popovercontainer-available-height';
|
|
2882
|
+
const SAFE_SPACE_PROPERTY = '--post-popovercontainer-safe-space';
|
|
2894
2883
|
const PostPopovercontainer = class {
|
|
2895
|
-
static {
|
|
2896
|
-
this.STATIC_SIDES = {
|
|
2897
|
-
top: 'bottom',
|
|
2898
|
-
right: 'left',
|
|
2899
|
-
bottom: 'top',
|
|
2900
|
-
left: 'right',
|
|
2901
|
-
};
|
|
2902
|
-
}
|
|
2903
|
-
static {
|
|
2904
|
-
this.PROPERTIES_TO_CLEAR = [
|
|
2905
|
-
'--post-safe-space-popover-x',
|
|
2906
|
-
'--post-safe-space-popover-y',
|
|
2907
|
-
'--post-safe-space-popover-x-start',
|
|
2908
|
-
'--post-safe-space-popover-x-end',
|
|
2909
|
-
'--post-safe-space-popover-y-start',
|
|
2910
|
-
'--post-safe-space-popover-y-end',
|
|
2911
|
-
'--post-safe-space-trigger-x',
|
|
2912
|
-
'--post-safe-space-trigger-y',
|
|
2913
|
-
'--post-safe-space-trigger-x-start',
|
|
2914
|
-
'--post-safe-space-trigger-x-end',
|
|
2915
|
-
'--post-safe-space-trigger-y-start',
|
|
2916
|
-
'--post-safe-space-trigger-y-end',
|
|
2917
|
-
];
|
|
2918
|
-
}
|
|
2919
2884
|
constructor(hostRef) {
|
|
2920
2885
|
registerInstance(this, hostRef);
|
|
2921
2886
|
this.postBeforeShow = createEvent(this, "postBeforeShow");
|
|
@@ -2923,37 +2888,25 @@ const PostPopovercontainer = class {
|
|
|
2923
2888
|
this.postHide = createEvent(this, "postHide");
|
|
2924
2889
|
this.postBeforeToggle = createEvent(this, "postBeforeToggle");
|
|
2925
2890
|
this.postToggle = createEvent(this, "postToggle");
|
|
2891
|
+
/** The element the popover is anchored to */
|
|
2892
|
+
this.anchorRef = null;
|
|
2893
|
+
this.arrowRef = null;
|
|
2894
|
+
this.hasBeenOpened = false;
|
|
2926
2895
|
this.toggleTimeoutId = null;
|
|
2927
|
-
this.
|
|
2896
|
+
this.runningAnimation = null;
|
|
2897
|
+
this.stopAutoUpdate = null;
|
|
2928
2898
|
/**
|
|
2929
|
-
*
|
|
2930
|
-
* Popovercontainers are automatically flipped to the opposite side if there is not enough available space and are shifted
|
|
2931
|
-
* towards the viewport if they would overlap edge boundaries.
|
|
2899
|
+
* Placement of the popover according to the floating-ui options.
|
|
2932
2900
|
*/
|
|
2933
2901
|
this.placement = 'top';
|
|
2934
2902
|
/**
|
|
2935
|
-
* Gap between the edge of the
|
|
2903
|
+
* Gap between the edge of the viewport and the popover.
|
|
2936
2904
|
*/
|
|
2937
2905
|
this.edgeGap = 8;
|
|
2938
2906
|
/**
|
|
2939
|
-
*
|
|
2907
|
+
* Show a little indicator arrow
|
|
2940
2908
|
*/
|
|
2941
2909
|
this.arrow = false;
|
|
2942
|
-
/**
|
|
2943
|
-
* Animation style
|
|
2944
|
-
*/
|
|
2945
|
-
this.animation = 'pop-in';
|
|
2946
|
-
this.currentAnimation = null;
|
|
2947
|
-
this.boundMouseTrackingHandler = this.mouseTrackingHandler.bind(this);
|
|
2948
|
-
}
|
|
2949
|
-
/**
|
|
2950
|
-
* Updates cursor position for safe space feature when popover is open.
|
|
2951
|
-
* Sets CSS custom properties for dynamic styling of safe area.
|
|
2952
|
-
* @param event MouseEvent with cursor position
|
|
2953
|
-
*/
|
|
2954
|
-
mouseTrackingHandler(event) {
|
|
2955
|
-
this.host.style.setProperty('--post-safe-space-cursor-x', `${event.clientX}px`);
|
|
2956
|
-
this.host.style.setProperty('--post-safe-space-cursor-y', `${event.clientY}px`);
|
|
2957
2910
|
}
|
|
2958
2911
|
connectedCallback() {
|
|
2959
2912
|
if (!isSupported()) {
|
|
@@ -2964,296 +2917,197 @@ const PostPopovercontainer = class {
|
|
|
2964
2917
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
2965
2918
|
}
|
|
2966
2919
|
disconnectedCallback() {
|
|
2967
|
-
|
|
2968
|
-
this.clearAutoUpdate();
|
|
2969
|
-
}
|
|
2920
|
+
this.cleanup();
|
|
2970
2921
|
this.host.removeEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
2971
2922
|
}
|
|
2923
|
+
cleanup() {
|
|
2924
|
+
this.stopAutoUpdate?.();
|
|
2925
|
+
if (this.runningAnimation) {
|
|
2926
|
+
this.runningAnimation.cancel();
|
|
2927
|
+
this.runningAnimation = null;
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
isOpen() {
|
|
2931
|
+
return this.host?.matches(':where(:popover-open, .popover-open)');
|
|
2932
|
+
}
|
|
2933
|
+
getContent() {
|
|
2934
|
+
return this.host?.shadowRoot.querySelector('[part="post-popovercontainer-content"]');
|
|
2935
|
+
}
|
|
2936
|
+
getContentMinSize() {
|
|
2937
|
+
const content = this.getContent();
|
|
2938
|
+
if (!content)
|
|
2939
|
+
return {};
|
|
2940
|
+
const { minWidth, minHeight } = getComputedStyle(content);
|
|
2941
|
+
return {
|
|
2942
|
+
width: Number.parseFloat(minWidth) || 0,
|
|
2943
|
+
height: Number.parseFloat(minHeight) || 0,
|
|
2944
|
+
};
|
|
2945
|
+
}
|
|
2972
2946
|
/**
|
|
2973
|
-
*
|
|
2974
|
-
* @param
|
|
2947
|
+
* Shows the popover.
|
|
2948
|
+
* @param anchor the element that the popover is visually anchored to.
|
|
2975
2949
|
*/
|
|
2976
|
-
async show(
|
|
2977
|
-
if (this.toggleTimeoutId || !
|
|
2950
|
+
async show(anchor) {
|
|
2951
|
+
if (this.toggleTimeoutId || !anchor || this.isOpen())
|
|
2978
2952
|
return;
|
|
2979
|
-
this.
|
|
2980
|
-
this.updatePosition();
|
|
2953
|
+
this.anchorRef = anchor;
|
|
2981
2954
|
this.host.showPopover();
|
|
2982
2955
|
}
|
|
2983
2956
|
/**
|
|
2984
|
-
*
|
|
2957
|
+
* Hides the popover.
|
|
2985
2958
|
*/
|
|
2986
2959
|
async hide() {
|
|
2987
|
-
if (!this.
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2960
|
+
if (this.toggleTimeoutId || !this.isOpen())
|
|
2961
|
+
return;
|
|
2962
|
+
this.anchorRef = null;
|
|
2963
|
+
this.host.hidePopover();
|
|
2964
|
+
this.postHide.emit();
|
|
2992
2965
|
}
|
|
2993
2966
|
/**
|
|
2994
|
-
*
|
|
2995
|
-
*
|
|
2996
|
-
*
|
|
2967
|
+
* Toggles the popover's state from hidden to showing and vice versa.
|
|
2968
|
+
*
|
|
2969
|
+
* If `state` is specified, the popover is forced to be shown if the is set to `true`, or hidden
|
|
2970
|
+
* if it is set to `false`.
|
|
2971
|
+
*
|
|
2972
|
+
* @param anchor the element that the popover is visually anchored to.
|
|
2973
|
+
* @param force the next state of the popover.
|
|
2974
|
+
* @returns the new state of the popover: `true` if it is shown, `false` if it is hidden.
|
|
2997
2975
|
*/
|
|
2998
|
-
async toggle(
|
|
2999
|
-
const isOpen = this.
|
|
3000
|
-
|
|
3001
|
-
if (willOpen && !target)
|
|
2976
|
+
async toggle(anchor, force) {
|
|
2977
|
+
const isOpen = this.isOpen();
|
|
2978
|
+
if (!this.host || this.toggleTimeoutId)
|
|
3002
2979
|
return isOpen;
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
return this.host.matches(':where(:popover-open, .popover-open)');
|
|
2980
|
+
const shouldOpen = force === true || (force === undefined && !isOpen);
|
|
2981
|
+
if (isOpen === shouldOpen || (shouldOpen && !anchor))
|
|
2982
|
+
return isOpen;
|
|
2983
|
+
this.anchorRef = shouldOpen ? anchor : null;
|
|
2984
|
+
this.host.togglePopover(force);
|
|
2985
|
+
this.toggleTimeoutId = null;
|
|
2986
|
+
return this.isOpen();
|
|
3011
2987
|
}
|
|
3012
2988
|
/**
|
|
3013
|
-
* Handles the popover
|
|
2989
|
+
* Handles the popover's state transition from hidden to showing and vice versa.
|
|
3014
2990
|
*/
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
if (typeof animationFn === 'function') {
|
|
3022
|
-
this.runOpenAnimation(animationFn, content);
|
|
3023
|
-
}
|
|
3024
|
-
else {
|
|
3025
|
-
// No animation case
|
|
3026
|
-
this.postBeforeToggle.emit({ willOpen: true });
|
|
3027
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3028
|
-
this.postToggle.emit({ isOpen: true });
|
|
3029
|
-
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
3030
|
-
if (this.hasOpenedOnce)
|
|
3031
|
-
this.hasOpenedOnce = false;
|
|
3032
|
-
}
|
|
3033
|
-
}
|
|
3034
|
-
if (this.safeSpace) {
|
|
3035
|
-
globalThis.addEventListener('mousemove', this.boundMouseTrackingHandler);
|
|
3036
|
-
}
|
|
2991
|
+
async handleToggle(event) {
|
|
2992
|
+
this.toggleTimeoutId = globalThis.setTimeout(() => (this.toggleTimeoutId = null), 10);
|
|
2993
|
+
if (event.newState === 'open')
|
|
2994
|
+
await this.handleOpen();
|
|
2995
|
+
else
|
|
2996
|
+
await this.handleClose();
|
|
3037
2997
|
}
|
|
3038
2998
|
/**
|
|
3039
|
-
* Handles the popover
|
|
2999
|
+
* Handles the popover's state transition from hidden to showing, emitting related events.
|
|
3040
3000
|
*/
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3001
|
+
async handleOpen() {
|
|
3002
|
+
this.postBeforeToggle.emit({ willOpen: true });
|
|
3003
|
+
this.postBeforeShow.emit({ first: !this.hasBeenOpened });
|
|
3004
|
+
await this.updatePosition(true);
|
|
3005
|
+
this.startAutoUpdate();
|
|
3006
|
+
try {
|
|
3007
|
+
await this.runOpenAnimation();
|
|
3047
3008
|
}
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
this.currentAnimation.cancel();
|
|
3051
|
-
this.currentAnimation = null;
|
|
3009
|
+
catch {
|
|
3010
|
+
return;
|
|
3052
3011
|
}
|
|
3053
|
-
this.
|
|
3054
|
-
this.
|
|
3055
|
-
this.
|
|
3012
|
+
this.postToggle.emit({ isOpen: true });
|
|
3013
|
+
this.postShow.emit({ first: !this.hasBeenOpened });
|
|
3014
|
+
this.hasBeenOpened = true;
|
|
3056
3015
|
}
|
|
3057
3016
|
/**
|
|
3058
|
-
*
|
|
3017
|
+
* Run the open animation for the popover.
|
|
3059
3018
|
*/
|
|
3060
|
-
async runOpenAnimation(
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
this.postBeforeToggle.emit({ willOpen: true });
|
|
3067
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3068
|
-
this.postToggle.emit({ isOpen: true });
|
|
3069
|
-
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
3070
|
-
return;
|
|
3071
|
-
}
|
|
3072
|
-
this.currentAnimation = animation;
|
|
3073
|
-
if (animation.playState === 'running') {
|
|
3074
|
-
this.postBeforeToggle.emit({ willOpen: true });
|
|
3075
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3076
|
-
}
|
|
3077
|
-
await animation.finished;
|
|
3078
|
-
this.postToggle.emit({ isOpen: true });
|
|
3079
|
-
this.postShow.emit({ first: this.hasOpenedOnce });
|
|
3080
|
-
this.hasOpenedOnce = true;
|
|
3081
|
-
}
|
|
3082
|
-
catch (err) {
|
|
3083
|
-
console.warn('Animation failed or was interrupted:', err);
|
|
3084
|
-
// Reset all states to closing
|
|
3085
|
-
this.postBeforeToggle.emit({ willOpen: false });
|
|
3086
|
-
this.postBeforeShow.emit({ first: this.hasOpenedOnce });
|
|
3087
|
-
this.postToggle.emit({ isOpen: false });
|
|
3088
|
-
}
|
|
3089
|
-
finally {
|
|
3090
|
-
if (this.currentAnimation === animation) {
|
|
3091
|
-
this.currentAnimation = null;
|
|
3092
|
-
}
|
|
3093
|
-
}
|
|
3019
|
+
async runOpenAnimation() {
|
|
3020
|
+
const content = this.getContent();
|
|
3021
|
+
if (!content)
|
|
3022
|
+
return;
|
|
3023
|
+
this.runningAnimation = popIn(content);
|
|
3024
|
+
await this.runningAnimation.finished;
|
|
3094
3025
|
}
|
|
3095
3026
|
/**
|
|
3096
|
-
*
|
|
3097
|
-
* Popovercontainers can be closed or opened with other methods than class members,
|
|
3098
|
-
* therefore listening to the toggle event is safer for cleaning up.
|
|
3099
|
-
* @param e ToggleEvent
|
|
3027
|
+
* Handles the popover's state transition from showing to hidden, emitting related events.
|
|
3100
3028
|
*/
|
|
3101
|
-
|
|
3102
|
-
this.
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
}
|
|
3029
|
+
async handleClose() {
|
|
3030
|
+
this.postBeforeToggle.emit({ willOpen: false });
|
|
3031
|
+
this.cleanup();
|
|
3032
|
+
this.host.style.removeProperty(AVAILABLE_WIDTH_PROPERTY);
|
|
3033
|
+
this.host.style.removeProperty(AVAILABLE_HEIGHT_PROPERTY);
|
|
3034
|
+
this.host.style.removeProperty(SAFE_SPACE_PROPERTY);
|
|
3035
|
+
this.postToggle.emit({ isOpen: false });
|
|
3036
|
+
this.postHide.emit();
|
|
3110
3037
|
}
|
|
3111
3038
|
/**
|
|
3112
|
-
*
|
|
3113
|
-
* an influence on popovercontainer positioning
|
|
3039
|
+
* Listen for changes that affect the popover's position and update it accordingly.
|
|
3114
3040
|
*/
|
|
3115
|
-
|
|
3116
|
-
if (!this.
|
|
3041
|
+
startAutoUpdate() {
|
|
3042
|
+
if (!this.host || !this.anchorRef)
|
|
3117
3043
|
return;
|
|
3118
|
-
this.
|
|
3044
|
+
this.stopAutoUpdate = autoUpdate(this.anchorRef, this.host, () => this.updatePosition(this.autoResize));
|
|
3119
3045
|
}
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3046
|
+
/**
|
|
3047
|
+
* Updates the position of the popover based on the anchor's position and the specified placement.
|
|
3048
|
+
* @param withSize whether to resize the popover based on the available space.
|
|
3049
|
+
*/
|
|
3050
|
+
async updatePosition(withSize = false) {
|
|
3051
|
+
const { x, y, middlewareData, placement } = await this.computePosition(withSize);
|
|
3052
|
+
// Hide the popover if the anchor is outside the scrollport.
|
|
3123
3053
|
if (middlewareData.hide?.referenceHidden) {
|
|
3124
3054
|
this.host.hidePopover();
|
|
3055
|
+
return;
|
|
3125
3056
|
}
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
// Position popover
|
|
3057
|
+
this.side = getSide(placement);
|
|
3058
|
+
// Position the popover.
|
|
3129
3059
|
this.host.style.left = `${x}px`;
|
|
3130
3060
|
this.host.style.top = `${y}px`;
|
|
3131
|
-
// Position
|
|
3132
|
-
if (
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
const halfSide = -0.5 * arrowSizePx;
|
|
3137
|
-
if (staticSide) {
|
|
3138
|
-
Object.assign(this.arrowRef.style, {
|
|
3139
|
-
left: arrowX ? `${arrowX}px` : '',
|
|
3140
|
-
top: arrowY ? `${arrowY}px` : '',
|
|
3141
|
-
[staticSide]: `${halfSide}px`,
|
|
3142
|
-
});
|
|
3143
|
-
}
|
|
3061
|
+
// Position the indicator arrow.
|
|
3062
|
+
if (middlewareData.arrow) {
|
|
3063
|
+
this.arrowRef.style.left = middlewareData.arrow.x ? `${middlewareData.arrow.x}px` : '';
|
|
3064
|
+
this.arrowRef.style.top = middlewareData.arrow.y ? `${middlewareData.arrow.y}px` : '';
|
|
3065
|
+
this.arrowRef.style[getOppositeSide(this.side)] = `-${this.arrowRef.offsetWidth / 2}px`;
|
|
3144
3066
|
}
|
|
3145
|
-
//
|
|
3146
|
-
if (
|
|
3147
|
-
|
|
3067
|
+
// Set the safe space polygon.
|
|
3068
|
+
if (middlewareData[SAFE_SPACE_MIDDLEWARE]) {
|
|
3069
|
+
this.host.style.setProperty(SAFE_SPACE_PROPERTY, middlewareData[SAFE_SPACE_MIDDLEWARE].polygon);
|
|
3148
3070
|
}
|
|
3149
3071
|
}
|
|
3150
|
-
async
|
|
3151
|
-
const
|
|
3152
|
-
const isAligned = (this.placement || 'top').includes('-');
|
|
3153
|
-
const flipMiddleware = [
|
|
3154
|
-
// Flip the popover if the target moves outside the viewport
|
|
3155
|
-
flip({ elementContext: 'reference', crossAxis: false }),
|
|
3156
|
-
// Flip the popover if the popover itself moves outside the viewport
|
|
3157
|
-
flip({ elementContext: 'floating', crossAxis: false }),
|
|
3158
|
-
];
|
|
3159
|
-
const shiftMiddleware = shift({
|
|
3160
|
-
padding: gap,
|
|
3161
|
-
limiter: limitShift({
|
|
3162
|
-
offset: 32,
|
|
3163
|
-
}),
|
|
3164
|
-
});
|
|
3072
|
+
async computePosition(withSize) {
|
|
3073
|
+
const padding = this.edgeGap ?? 0;
|
|
3165
3074
|
const middleware = [
|
|
3166
|
-
offset(this.offset ?? (this.arrow ?
|
|
3075
|
+
offset(this.offset ?? (this.arrow ? padding + 4 : padding)),
|
|
3167
3076
|
inline(),
|
|
3168
|
-
// Per floating-ui docs: for aligned placements (e.g. bottom-end),
|
|
3169
|
-
// flip should come before shift. For non-aligned, shift before flip.
|
|
3170
|
-
...(isAligned ? [...flipMiddleware, shiftMiddleware] : [shiftMiddleware, ...flipMiddleware]),
|
|
3171
|
-
size({
|
|
3172
|
-
apply({ availableWidth, elements }) {
|
|
3173
|
-
Object.assign(elements.floating.style, {
|
|
3174
|
-
maxWidth: `${availableWidth - gap * 2}px`,
|
|
3175
|
-
});
|
|
3176
|
-
},
|
|
3177
|
-
}),
|
|
3178
3077
|
];
|
|
3179
|
-
|
|
3180
|
-
|
|
3078
|
+
const flipMiddleware = flip({ padding, minSize: this.getContentMinSize() });
|
|
3079
|
+
const shiftMiddleware = shift({ limiter: limitShift({ offset: 32 }), padding });
|
|
3080
|
+
// `flip` should come before `shift` for edge-aligned placements
|
|
3081
|
+
// (see https://floating-ui.com/docs/flip#combining-with-shift).
|
|
3082
|
+
if (this.placement?.includes('-'))
|
|
3083
|
+
middleware.push(flipMiddleware, shiftMiddleware);
|
|
3084
|
+
else
|
|
3085
|
+
middleware.push(shiftMiddleware, flipMiddleware);
|
|
3086
|
+
if (withSize) {
|
|
3087
|
+
middleware.push(size({
|
|
3088
|
+
padding,
|
|
3089
|
+
apply({ availableWidth, availableHeight, elements }) {
|
|
3090
|
+
elements.floating.style.setProperty(AVAILABLE_WIDTH_PROPERTY, `${Math.max(0, availableWidth)}px`);
|
|
3091
|
+
elements.floating.style.setProperty(AVAILABLE_HEIGHT_PROPERTY, `${Math.max(0, availableHeight)}px`);
|
|
3092
|
+
},
|
|
3093
|
+
}));
|
|
3181
3094
|
}
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3095
|
+
if (this.arrow)
|
|
3096
|
+
middleware.push(arrow({ element: this.arrowRef, padding }));
|
|
3097
|
+
if (this.safeSpace)
|
|
3098
|
+
middleware.push(safeSpace());
|
|
3099
|
+
// `hide` should generally be placed at the end of the middleware chain
|
|
3100
|
+
// (see https://floating-ui.com/docs/hide#order).
|
|
3101
|
+
if (this.autoHide)
|
|
3185
3102
|
middleware.push(hide({ strategy: 'referenceHidden' }));
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
placement: this.placement || 'top',
|
|
3103
|
+
return computePositionWithSafeArea(this.anchorRef, this.host, {
|
|
3104
|
+
placement: this.placement ?? 'top',
|
|
3189
3105
|
strategy: 'fixed',
|
|
3190
3106
|
middleware,
|
|
3191
3107
|
});
|
|
3192
3108
|
}
|
|
3193
|
-
async updateSafeSpaceBoundaries(currentPlacement) {
|
|
3194
|
-
const targetRect = this.eventTarget.getBoundingClientRect();
|
|
3195
|
-
const popoverRect = this.host.getBoundingClientRect();
|
|
3196
|
-
const isVertical = currentPlacement === 'top' || currentPlacement === 'bottom';
|
|
3197
|
-
// Helper function to get positioning data based on placement
|
|
3198
|
-
const getPositioningData = (placement, popoverRect, targetRect) => {
|
|
3199
|
-
if (placement === 'top' || placement === 'bottom') {
|
|
3200
|
-
return {
|
|
3201
|
-
popover: {
|
|
3202
|
-
y: placement === 'top' ? popoverRect.bottom : popoverRect.top,
|
|
3203
|
-
xStart: popoverRect.left,
|
|
3204
|
-
xEnd: popoverRect.right,
|
|
3205
|
-
},
|
|
3206
|
-
trigger: {
|
|
3207
|
-
y: placement === 'top' ? targetRect.top : targetRect.bottom,
|
|
3208
|
-
xStart: targetRect.left,
|
|
3209
|
-
xEnd: targetRect.right,
|
|
3210
|
-
},
|
|
3211
|
-
};
|
|
3212
|
-
}
|
|
3213
|
-
else {
|
|
3214
|
-
// left or right
|
|
3215
|
-
return {
|
|
3216
|
-
popover: {
|
|
3217
|
-
x: placement === 'left' ? popoverRect.right : popoverRect.left,
|
|
3218
|
-
yStart: popoverRect.top,
|
|
3219
|
-
yEnd: popoverRect.bottom,
|
|
3220
|
-
},
|
|
3221
|
-
trigger: {
|
|
3222
|
-
x: placement === 'left' ? targetRect.left : targetRect.right,
|
|
3223
|
-
yStart: targetRect.top,
|
|
3224
|
-
yEnd: targetRect.bottom,
|
|
3225
|
-
},
|
|
3226
|
-
};
|
|
3227
|
-
}
|
|
3228
|
-
};
|
|
3229
|
-
const posData = getPositioningData(currentPlacement, popoverRect, targetRect);
|
|
3230
|
-
// Clear previous values
|
|
3231
|
-
PostPopovercontainer.PROPERTIES_TO_CLEAR.forEach(prop => {
|
|
3232
|
-
this.host.style.removeProperty(prop);
|
|
3233
|
-
});
|
|
3234
|
-
if (isVertical) {
|
|
3235
|
-
// For top/bottom placement
|
|
3236
|
-
this.host.style.setProperty('--post-safe-space-popover-y', `${posData.popover.y}px`);
|
|
3237
|
-
this.host.style.setProperty('--post-safe-space-popover-x-start', `${posData.popover.xStart}px`);
|
|
3238
|
-
this.host.style.setProperty('--post-safe-space-popover-x-end', `${posData.popover.xEnd}px`);
|
|
3239
|
-
this.host.style.setProperty('--post-safe-space-trigger-y', `${posData.trigger.y}px`);
|
|
3240
|
-
this.host.style.setProperty('--post-safe-space-trigger-x-start', `${posData.trigger.xStart}px`);
|
|
3241
|
-
this.host.style.setProperty('--post-safe-space-trigger-x-end', `${posData.trigger.xEnd}px`);
|
|
3242
|
-
}
|
|
3243
|
-
else {
|
|
3244
|
-
// For left/right placement
|
|
3245
|
-
this.host.style.setProperty('--post-safe-space-popover-x', `${posData.popover.x}px`);
|
|
3246
|
-
this.host.style.setProperty('--post-safe-space-popover-y-start', `${posData.popover.yStart}px`);
|
|
3247
|
-
this.host.style.setProperty('--post-safe-space-popover-y-end', `${posData.popover.yEnd}px`);
|
|
3248
|
-
this.host.style.setProperty('--post-safe-space-trigger-x', `${posData.trigger.x}px`);
|
|
3249
|
-
this.host.style.setProperty('--post-safe-space-trigger-y-start', `${posData.trigger.yStart}px`);
|
|
3250
|
-
this.host.style.setProperty('--post-safe-space-trigger-y-end', `${posData.trigger.yEnd}px`);
|
|
3251
|
-
}
|
|
3252
|
-
}
|
|
3253
3109
|
render() {
|
|
3254
|
-
return (h(Host, { key: '
|
|
3255
|
-
this.arrowRef = el;
|
|
3256
|
-
} })), h("span", { key: 'deadbcc5892ed545a64b4a0e5e0936e0dd1feb70', part: "post-popovercontainer-border-mask" }), h("slot", { key: '48c4db7ab222f3ef18157ce19d8ba15d75441f98' }))));
|
|
3110
|
+
return (h(Host, { key: 'd48b21174f74b790f8a72b4294e9f741c3b64d14', "data-version": version, popover: "auto" }, h("div", { key: '455e84294ecb36e25cc62582eb6c41058f24f6bc', part: "post-popovercontainer-content" }, this.arrow && (h("span", { key: '9d11f2596443876123eeaf5a02430d049c1c8b25', "data-side": this.side, class: "arrow", ref: el => (this.arrowRef = el) })), h("span", { key: 'a562460cdfa5539e7d9c23f1d044a2c045df5b9f', part: "post-popovercontainer-border-mask" }), h("slot", { key: '5aa546bbdf6c70e2a0afabf818d421581060f8a7' }))));
|
|
3257
3111
|
}
|
|
3258
3112
|
get host() { return getElement(this); }
|
|
3259
3113
|
};
|
|
@@ -3263,9 +3117,6 @@ __decorate([
|
|
|
3263
3117
|
__decorate([
|
|
3264
3118
|
Type('number')
|
|
3265
3119
|
], PostPopovercontainer.prototype, "edgeGap", void 0);
|
|
3266
|
-
__decorate([
|
|
3267
|
-
OneOf(['triangle', 'trapezoid'])
|
|
3268
|
-
], PostPopovercontainer.prototype, "safeSpace", void 0);
|
|
3269
3120
|
PostPopovercontainer.style = postPopovercontainerCss();
|
|
3270
3121
|
|
|
3271
3122
|
export { PostPopovercontainer as post_popovercontainer };
|