@swisspost/internet-header 10.4.0 → 10.6.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/{breakpoints-CI0Xuh1L.js → breakpoints-Kruvy8Dm.js} +11 -10
- package/dist/cjs/{event-from-CwMw19f8.js → event-from-CTcQxB9-.js} +19 -13
- package/dist/cjs/index-B5ypPkK3.js +4 -4
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-HZ6bBKwJ.js → package-D7UYFbVU.js} +1 -1
- package/dist/cjs/{package-CL8OSAS4.js → package-pKyFPwiA.js} +1 -1
- package/dist/cjs/post-accordion_4.cjs.entry.js +5 -5
- package/dist/cjs/post-autocomplete.cjs.entry.js +65 -50
- package/dist/cjs/post-avatar.cjs.entry.js +1 -1
- package/dist/cjs/post-back-to-top.cjs.entry.js +20 -8
- package/dist/cjs/post-banner.cjs.entry.js +2 -9
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +35 -5
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +215 -65
- package/dist/cjs/post-closebutton.cjs.entry.js +46 -8
- package/dist/cjs/post-date-picker.cjs.entry.js +13 -11
- package/dist/cjs/post-footer.cjs.entry.js +4 -5
- package/dist/cjs/post-header.cjs.entry.js +5 -5
- package/dist/cjs/post-icon.cjs.entry.js +2 -2
- package/dist/cjs/post-language-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/post-language-menu.cjs.entry.js +3 -3
- package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
- package/dist/cjs/post-listbox-option.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox.cjs.entry.js +4 -4
- package/dist/cjs/post-logo.cjs.entry.js +2 -2
- package/dist/cjs/post-mainnavigation.cjs.entry.js +2 -2
- package/dist/cjs/post-megadropdown-trigger.cjs.entry.js +3 -3
- package/dist/cjs/post-megadropdown.cjs.entry.js +5 -6
- package/dist/cjs/post-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/post-menu_2.cjs.entry.js +25 -10
- package/dist/cjs/post-number-input.cjs.entry.js +3 -3
- package/dist/cjs/post-pagination.cjs.entry.js +1 -1
- package/dist/cjs/post-popover-trigger.cjs.entry.js +4 -4
- package/dist/cjs/post-popover.cjs.entry.js +5 -5
- package/dist/cjs/post-popovercontainer.cjs.entry.js +341 -196
- package/dist/cjs/post-progressbar.cjs.entry.js +1 -1
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +3 -3
- package/dist/cjs/post-side-navigation.cjs.entry.js +4 -5
- package/dist/cjs/post-stepper-item.cjs.entry.js +2 -2
- package/dist/cjs/post-stepper.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-item.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/post-tabs.cjs.entry.js +4 -4
- package/dist/cjs/post-togglebutton.cjs.entry.js +2 -2
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +3 -3
- package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js +3 -11
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +51 -69
- package/dist/cjs/swisspost-internet-header.cjs.js +1 -1
- package/dist/collection/components/post-internet-footer/post-internet-footer.js +2 -10
- package/dist/collection/components/post-internet-header/post-internet-header.js +16 -66
- package/dist/collection/config/klp-urls.js +33 -0
- package/dist/collection/services/config.service.js +1 -2
- package/dist/collection/tests/setup-tests.js +1 -0
- package/dist/components/breakpoints.js +1 -1
- package/dist/components/event-from.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/package2.js +1 -1
- package/dist/components/post-autocomplete.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-collapsible-trigger2.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-icon2.js +1 -1
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-listbox-option.js +1 -1
- package/dist/components/post-listbox.js +1 -1
- package/dist/components/post-logo2.js +1 -1
- package/dist/components/post-mainnavigation2.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-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-popover-trigger.js +1 -1
- package/dist/components/post-popover.js +1 -1
- package/dist/components/post-popovercontainer2.js +1 -1
- package/dist/components/post-progressbar.js +1 -1
- package/dist/components/post-rating.js +1 -1
- package/dist/components/post-side-navigation-trigger.js +1 -1
- package/dist/components/post-side-navigation.js +1 -1
- package/dist/components/post-stepper-item.js +1 -1
- package/dist/components/post-stepper.js +1 -1
- package/dist/components/post-tab-item.js +1 -1
- package/dist/components/post-tab-panel.js +1 -1
- package/dist/components/post-tabs.js +1 -1
- package/dist/components/post-togglebutton2.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-footer.js +1 -1
- package/dist/components/swisspost-internet-header.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{breakpoints-C3jWktf-.js → breakpoints-I1j7a0bW.js} +11 -10
- package/dist/esm/{event-from-rEfV4v4a.js → event-from-BEcxHjuM.js} +19 -14
- package/dist/esm/index-h3opCZqH.js +4 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-B4lS4y6E.js → package-Dy8-dzD8.js} +1 -1
- package/dist/esm/{package-tTf1w3A9.js → package-T8T3po4z.js} +1 -1
- package/dist/esm/post-accordion_4.entry.js +5 -5
- package/dist/esm/post-autocomplete.entry.js +65 -50
- package/dist/esm/post-avatar.entry.js +1 -1
- package/dist/esm/post-back-to-top.entry.js +20 -8
- package/dist/esm/post-banner.entry.js +2 -9
- package/dist/esm/post-breadcrumb-item.entry.js +35 -5
- package/dist/esm/post-breadcrumbs.entry.js +215 -65
- package/dist/esm/post-closebutton.entry.js +46 -8
- package/dist/esm/post-date-picker.entry.js +13 -11
- package/dist/esm/post-footer.entry.js +4 -5
- package/dist/esm/post-header.entry.js +5 -5
- package/dist/esm/post-icon.entry.js +2 -2
- package/dist/esm/post-language-menu-item.entry.js +1 -1
- package/dist/esm/post-language-menu.entry.js +3 -3
- package/dist/esm/post-linkarea.entry.js +2 -2
- package/dist/esm/post-listbox-option.entry.js +3 -3
- package/dist/esm/post-listbox.entry.js +4 -4
- package/dist/esm/post-logo.entry.js +2 -2
- package/dist/esm/post-mainnavigation.entry.js +2 -2
- package/dist/esm/post-megadropdown-trigger.entry.js +3 -3
- package/dist/esm/post-megadropdown.entry.js +5 -6
- package/dist/esm/post-menu-item.entry.js +2 -2
- package/dist/esm/post-menu_2.entry.js +25 -10
- package/dist/esm/post-number-input.entry.js +3 -3
- package/dist/esm/post-pagination.entry.js +1 -1
- package/dist/esm/post-popover-trigger.entry.js +4 -4
- package/dist/esm/post-popover.entry.js +5 -5
- package/dist/esm/post-popovercontainer.entry.js +341 -196
- package/dist/esm/post-progressbar.entry.js +1 -1
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/post-side-navigation-trigger.entry.js +3 -3
- package/dist/esm/post-side-navigation.entry.js +4 -5
- package/dist/esm/post-stepper-item.entry.js +2 -2
- package/dist/esm/post-stepper.entry.js +2 -2
- package/dist/esm/post-tab-item.entry.js +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/post-tabs.entry.js +4 -4
- package/dist/esm/post-togglebutton.entry.js +2 -2
- package/dist/esm/post-tooltip-trigger.entry.js +3 -3
- package/dist/esm/post-tooltip.entry.js +2 -2
- package/dist/esm/swisspost-internet-footer.entry.js +3 -11
- package/dist/esm/swisspost-internet-header.entry.js +51 -69
- package/dist/esm/swisspost-internet-header.js +1 -1
- package/dist/esm-es5/breakpoints-I1j7a0bW.js +1 -0
- package/dist/esm-es5/event-from-BEcxHjuM.js +1 -0
- package/dist/esm-es5/index-h3opCZqH.js +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{package-B4lS4y6E.js → package-Dy8-dzD8.js} +1 -1
- package/dist/esm-es5/package-T8T3po4z.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-progressbar.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-80993537.system.entry.js → p-000978a2.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-31f0de1e.entry.js → p-03587cd5.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-09d4521f.entry.js → p-068b1e2b.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-087b1e22.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-bc470741.entry.js → p-089412b9.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-f523050e.entry.js → p-094ef16a.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-ab97669b.system.entry.js → p-0c651391.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-0d4d5c56.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-bf2996de.system.entry.js → p-0f501e99.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-1502d221.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-d7e470ff.system.entry.js → p-155f5b00.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-161b1a45.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-16623b05.entry.js +1 -0
- package/dist/swisspost-internet-header/p-1780039a.entry.js +1 -0
- package/dist/swisspost-internet-header/p-1a18ac48.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-06de7983.entry.js → p-1b2b7af5.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-2196012d.entry.js +1 -0
- package/dist/swisspost-internet-header/p-2197ca9e.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-21e537be.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-25407470.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-79512699.entry.js → p-255b2067.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-2b0f93fb.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-c1e959fb.entry.js → p-2da6fba5.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-2e8c0f26.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-f7a9a615.system.entry.js → p-31af5cf2.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-35b6e07c.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-8e61f407.system.entry.js → p-39af32a0.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-3d38ab21.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-25a5281d.entry.js → p-3ff138ba.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-42806d60.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-658dd74d.entry.js → p-4557a744.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-4562d9d8.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-17a3d14a.system.entry.js → p-4bdbf9e9.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-53c33e94.entry.js +1 -0
- package/dist/swisspost-internet-header/p-5443664a.entry.js +1 -0
- package/dist/swisspost-internet-header/p-547d9572.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-52e305d7.system.entry.js → p-57f1f9e2.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-be97ff93.system.entry.js → p-586ee1e8.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-80cb2bdb.entry.js → p-599e94e7.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-f2ed3863.entry.js → p-613fa3a4.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-651b9efe.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-120a2867.entry.js → p-6d6fb84b.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-6f187e15.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-a9c5178f.system.entry.js → p-6f79a60d.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-1f30f235.system.entry.js → p-72377b16.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-0da236b6.system.entry.js → p-7ad0de4b.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-429f04bc.system.entry.js → p-81f34993.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-e3515572.entry.js → p-826d0669.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-de258c90.system.entry.js → p-84ebaf4b.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-8717e0ce.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-8f21a530.entry.js +1 -0
- package/dist/swisspost-internet-header/p-98d2dfb3.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-9b6c8533.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-756574fd.entry.js → p-9c5941a2.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-B4kfqOjJ.js → p-B-DGLCj0.js} +1 -1
- package/dist/swisspost-internet-header/p-BEcxHjuM.js +1 -0
- package/dist/swisspost-internet-header/p-BT1GO8tc.system.js +1 -0
- package/dist/swisspost-internet-header/{p-BhneAPKT.system.js → p-COm5Sc71.system.js} +1 -1
- package/dist/swisspost-internet-header/p-D1A3ltXC.system.js +1 -0
- package/dist/swisspost-internet-header/{p-CHYNOqn0.system.js → p-D_rLPX5e.system.js} +1 -1
- package/dist/swisspost-internet-header/p-I1j7a0bW.js +1 -0
- package/dist/swisspost-internet-header/p-R5BnOD0U.system.js +1 -1
- package/dist/swisspost-internet-header/p-T8T3po4z.js +1 -0
- package/dist/swisspost-internet-header/p-a435a51d.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-9b4f74a6.system.entry.js → p-a46ef8a8.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-a75d1e4f.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-db9eae5a.system.entry.js → p-a8b0c0ec.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-abe2eefe.entry.js +1 -0
- package/dist/swisspost-internet-header/p-b344fa82.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-4876e706.system.entry.js → p-b4de053e.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-b85fabc2.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-bb4c3ac1.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-36be5234.entry.js → p-bfc4a6a9.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-2501eb09.entry.js → p-c1e818d2.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-3c228ed0.system.entry.js → p-c96dbc97.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-9e57bd5a.entry.js → p-ca68b8cf.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-caed751e.entry.js +1 -0
- package/dist/swisspost-internet-header/p-cb52e42c.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-1801d35d.system.entry.js → p-cec19e1d.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-d45690b3.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-bda3094c.entry.js → p-d68a1179.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-0de83906.entry.js → p-d7c2cce3.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-2b04e974.system.entry.js → p-d7df13be.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-e5ebe099.system.entry.js +1 -0
- package/dist/swisspost-internet-header/p-e69e8fa4.entry.js +1 -0
- package/dist/swisspost-internet-header/p-e6ec5fa5.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-90e78f26.system.entry.js → p-ede58236.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-a204bb79.system.entry.js → p-f3e68437.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-f4489f68.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-7c53064b.entry.js → p-f4ce6247.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-f783b224.system.entry.js +1 -0
- package/dist/swisspost-internet-header/{p-fe440b79.entry.js → p-fcfd3134.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-fdbcf065.entry.js +1 -0
- package/dist/swisspost-internet-header/p-iSGRM5O1.system.js +1 -0
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/types/config/klp-urls.d.ts +23 -0
- package/package.json +20 -23
- package/readme.md +2 -2
- package/dist/esm-es5/breakpoints-C3jWktf-.js +0 -1
- package/dist/esm-es5/event-from-rEfV4v4a.js +0 -1
- package/dist/esm-es5/package-tTf1w3A9.js +0 -1
- package/dist/swisspost-internet-header/p-16182f34.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-1a39c0c7.entry.js +0 -1
- package/dist/swisspost-internet-header/p-1aeb1d6c.entry.js +0 -1
- package/dist/swisspost-internet-header/p-1ec41382.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-1fe8276f.entry.js +0 -1
- package/dist/swisspost-internet-header/p-2738143c.entry.js +0 -1
- package/dist/swisspost-internet-header/p-2990978f.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-2ec721b4.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-3373f238.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-34259104.entry.js +0 -1
- package/dist/swisspost-internet-header/p-3c917e9d.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-42394464.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-48cace4d.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-4b44ce5f.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-4d3939eb.entry.js +0 -1
- package/dist/swisspost-internet-header/p-5efffa89.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-65cfb55b.entry.js +0 -1
- package/dist/swisspost-internet-header/p-7a66d431.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-7baa1968.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-805ee472.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-83410f32.entry.js +0 -1
- package/dist/swisspost-internet-header/p-85087a43.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-8b9c9fda.entry.js +0 -1
- package/dist/swisspost-internet-header/p-925c8906.entry.js +0 -1
- package/dist/swisspost-internet-header/p-92e0402a.entry.js +0 -1
- package/dist/swisspost-internet-header/p-999af688.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-C1pxTt7y.system.js +0 -1
- package/dist/swisspost-internet-header/p-CGtndO2e.system.js +0 -1
- package/dist/swisspost-internet-header/p-Ck6UMUSA.js +0 -1
- package/dist/swisspost-internet-header/p-D8meK6Dd.system.js +0 -1
- package/dist/swisspost-internet-header/p-acabba28.entry.js +0 -1
- package/dist/swisspost-internet-header/p-aefc1c4c.entry.js +0 -1
- package/dist/swisspost-internet-header/p-b05dd248.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-b8bb2c10.entry.js +0 -1
- package/dist/swisspost-internet-header/p-c546bebe.entry.js +0 -1
- package/dist/swisspost-internet-header/p-ca9c885e.entry.js +0 -1
- package/dist/swisspost-internet-header/p-e26d9136.entry.js +0 -1
- package/dist/swisspost-internet-header/p-e9582f72.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-ec06df2f.entry.js +0 -1
- package/dist/swisspost-internet-header/p-ec43767f.entry.js +0 -1
- package/dist/swisspost-internet-header/p-ec45ed63.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-ecb554c7.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-f32d49d7.entry.js +0 -1
- package/dist/swisspost-internet-header/p-f56fe63d.entry.js +0 -1
- package/dist/swisspost-internet-header/p-fe9ac5ca.system.entry.js +0 -1
- package/dist/swisspost-internet-header/p-rEfV4v4a.js +0 -1
- package/dist/swisspost-internet-header/p-tTf1w3A9.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
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-T8T3po4z.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';
|
|
@@ -10,6 +10,7 @@ import './create-validator-decorator--a-qkYfP.js';
|
|
|
10
10
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
13
14
|
const min = Math.min;
|
|
14
15
|
const max = Math.max;
|
|
15
16
|
const round = Math.round;
|
|
@@ -102,12 +103,12 @@ function getOppositePlacement(placement) {
|
|
|
102
103
|
return oppositeSideMap[side] + placement.slice(side.length);
|
|
103
104
|
}
|
|
104
105
|
function expandPaddingObject(padding) {
|
|
106
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
105
107
|
return {
|
|
106
|
-
top: 0,
|
|
107
|
-
right: 0,
|
|
108
|
-
bottom: 0,
|
|
109
|
-
left: 0
|
|
110
|
-
...padding
|
|
108
|
+
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
109
|
+
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
110
|
+
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
111
|
+
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
function getPaddingObject(padding) {
|
|
@@ -182,13 +183,9 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
182
183
|
y: reference.y
|
|
183
184
|
};
|
|
184
185
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
break;
|
|
189
|
-
case 'end':
|
|
190
|
-
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
191
|
-
break;
|
|
186
|
+
const alignment = getAlignment(placement);
|
|
187
|
+
if (alignment) {
|
|
188
|
+
coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
192
189
|
}
|
|
193
190
|
return coords;
|
|
194
191
|
}
|
|
@@ -237,10 +234,7 @@ async function detectOverflow(state, options) {
|
|
|
237
234
|
height: rects.floating.height
|
|
238
235
|
} : rects.reference;
|
|
239
236
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
240
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)))
|
|
241
|
-
x: 1,
|
|
242
|
-
y: 1
|
|
243
|
-
} : {
|
|
237
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
244
238
|
x: 1,
|
|
245
239
|
y: 1
|
|
246
240
|
};
|
|
@@ -413,17 +407,16 @@ const arrow$1 = options => ({
|
|
|
413
407
|
|
|
414
408
|
// Make sure the arrow doesn't overflow the floating element if the center
|
|
415
409
|
// point is outside the floating element's bounds.
|
|
416
|
-
const min$1 = minPadding;
|
|
417
410
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
418
411
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
419
|
-
const offset = clamp(
|
|
412
|
+
const offset = clamp(minPadding, center, max);
|
|
420
413
|
|
|
421
414
|
// If the reference is small enough that the arrow's padding causes it to
|
|
422
415
|
// to point to nothing for an aligned placement, adjust the offset of the
|
|
423
416
|
// floating element itself. To ensure `shift()` continues to take action,
|
|
424
417
|
// a single reset is performed when this is true.
|
|
425
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center <
|
|
426
|
-
const alignmentOffset = shouldAddOffset ? center <
|
|
418
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
419
|
+
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;
|
|
427
420
|
return {
|
|
428
421
|
[axis]: coords[axis] + alignmentOffset,
|
|
429
422
|
data: {
|
|
@@ -570,6 +563,76 @@ const flip$1 = function (options) {
|
|
|
570
563
|
};
|
|
571
564
|
};
|
|
572
565
|
|
|
566
|
+
function getSideOffsets(overflow, rect) {
|
|
567
|
+
return {
|
|
568
|
+
top: overflow.top - rect.height,
|
|
569
|
+
right: overflow.right - rect.width,
|
|
570
|
+
bottom: overflow.bottom - rect.height,
|
|
571
|
+
left: overflow.left - rect.width
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
function isAnySideFullyClipped(overflow) {
|
|
575
|
+
return sides.some(side => overflow[side] >= 0);
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
579
|
+
* when it is not in the same clipping context as the reference element.
|
|
580
|
+
* @see https://floating-ui.com/docs/hide
|
|
581
|
+
*/
|
|
582
|
+
const hide$1 = function (options) {
|
|
583
|
+
if (options === void 0) {
|
|
584
|
+
options = {};
|
|
585
|
+
}
|
|
586
|
+
return {
|
|
587
|
+
name: 'hide',
|
|
588
|
+
options,
|
|
589
|
+
async fn(state) {
|
|
590
|
+
const {
|
|
591
|
+
rects,
|
|
592
|
+
platform
|
|
593
|
+
} = state;
|
|
594
|
+
const {
|
|
595
|
+
strategy = 'referenceHidden',
|
|
596
|
+
...detectOverflowOptions
|
|
597
|
+
} = evaluate(options, state);
|
|
598
|
+
switch (strategy) {
|
|
599
|
+
case 'referenceHidden':
|
|
600
|
+
{
|
|
601
|
+
const overflow = await platform.detectOverflow(state, {
|
|
602
|
+
...detectOverflowOptions,
|
|
603
|
+
elementContext: 'reference'
|
|
604
|
+
});
|
|
605
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
606
|
+
return {
|
|
607
|
+
data: {
|
|
608
|
+
referenceHiddenOffsets: offsets,
|
|
609
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
case 'escaped':
|
|
614
|
+
{
|
|
615
|
+
const overflow = await platform.detectOverflow(state, {
|
|
616
|
+
...detectOverflowOptions,
|
|
617
|
+
altBoundary: true
|
|
618
|
+
});
|
|
619
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
620
|
+
return {
|
|
621
|
+
data: {
|
|
622
|
+
escapedOffsets: offsets,
|
|
623
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
default:
|
|
628
|
+
{
|
|
629
|
+
return {};
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
};
|
|
635
|
+
|
|
573
636
|
function getBoundingRect(rects) {
|
|
574
637
|
const minX = min(...rects.map(rect => rect.left));
|
|
575
638
|
const minY = min(...rects.map(rect => rect.top));
|
|
@@ -626,12 +689,19 @@ const inline$1 = function (options) {
|
|
|
626
689
|
y
|
|
627
690
|
} = evaluate(options, state);
|
|
628
691
|
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
|
|
692
|
+
|
|
693
|
+
// No rects (e.g. a hidden or detached reference, or a collapsed range) —
|
|
694
|
+
// keep the existing reference rect rather than resetting to an invalid
|
|
695
|
+
// one with non-finite values.
|
|
696
|
+
if (!nativeClientRects.length) {
|
|
697
|
+
return {};
|
|
698
|
+
}
|
|
629
699
|
const clientRects = getRectsByLine(nativeClientRects);
|
|
630
700
|
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
631
701
|
const paddingObject = getPaddingObject(padding);
|
|
632
702
|
function getBoundingClientRect() {
|
|
633
703
|
// There are two rects and they are disjoined.
|
|
634
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
704
|
+
if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {
|
|
635
705
|
// Find the first rect in which the point is fully inside.
|
|
636
706
|
return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
|
|
637
707
|
}
|
|
@@ -646,18 +716,12 @@ const inline$1 = function (options) {
|
|
|
646
716
|
const bottom = lastRect.bottom;
|
|
647
717
|
const left = isTop ? firstRect.left : lastRect.left;
|
|
648
718
|
const right = isTop ? firstRect.right : lastRect.right;
|
|
649
|
-
|
|
650
|
-
const height = bottom - top;
|
|
651
|
-
return {
|
|
652
|
-
top,
|
|
653
|
-
bottom,
|
|
654
|
-
left,
|
|
655
|
-
right,
|
|
656
|
-
width,
|
|
657
|
-
height,
|
|
719
|
+
return rectToClientRect({
|
|
658
720
|
x: left,
|
|
659
|
-
y: top
|
|
660
|
-
|
|
721
|
+
y: top,
|
|
722
|
+
width: right - left,
|
|
723
|
+
height: bottom - top
|
|
724
|
+
});
|
|
661
725
|
}
|
|
662
726
|
const isLeftSide = getSide(placement) === 'left';
|
|
663
727
|
const maxRight = max(...clientRects.map(rect => rect.right));
|
|
@@ -665,20 +729,12 @@ const inline$1 = function (options) {
|
|
|
665
729
|
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
666
730
|
const top = measureRects[0].top;
|
|
667
731
|
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
bottom,
|
|
675
|
-
left,
|
|
676
|
-
right,
|
|
677
|
-
width,
|
|
678
|
-
height,
|
|
679
|
-
x: left,
|
|
680
|
-
y: top
|
|
681
|
-
};
|
|
732
|
+
return rectToClientRect({
|
|
733
|
+
x: minLeft,
|
|
734
|
+
y: top,
|
|
735
|
+
width: maxRight - minLeft,
|
|
736
|
+
height: bottom - top
|
|
737
|
+
});
|
|
682
738
|
}
|
|
683
739
|
return fallback;
|
|
684
740
|
}
|
|
@@ -828,23 +884,16 @@ const shift$1 = function (options) {
|
|
|
828
884
|
y
|
|
829
885
|
};
|
|
830
886
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
831
|
-
const crossAxis = getSideAxis(
|
|
887
|
+
const crossAxis = getSideAxis(placement);
|
|
832
888
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
833
889
|
let mainAxisCoord = coords[mainAxis];
|
|
834
890
|
let crossAxisCoord = coords[crossAxis];
|
|
891
|
+
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);
|
|
835
892
|
if (checkMainAxis) {
|
|
836
|
-
|
|
837
|
-
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
838
|
-
const min = mainAxisCoord + overflow[minSide];
|
|
839
|
-
const max = mainAxisCoord - overflow[maxSide];
|
|
840
|
-
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
893
|
+
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
841
894
|
}
|
|
842
895
|
if (checkCrossAxis) {
|
|
843
|
-
|
|
844
|
-
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
845
|
-
const min = crossAxisCoord + overflow[minSide];
|
|
846
|
-
const max = crossAxisCoord - overflow[maxSide];
|
|
847
|
-
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
896
|
+
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
848
897
|
}
|
|
849
898
|
const limitedCoords = limiter.fn({
|
|
850
899
|
...state,
|
|
@@ -875,6 +924,7 @@ const limitShift$1 = function (options) {
|
|
|
875
924
|
return {
|
|
876
925
|
options,
|
|
877
926
|
fn(state) {
|
|
927
|
+
var _rawOffset$mainAxis, _rawOffset$crossAxis;
|
|
878
928
|
const {
|
|
879
929
|
x,
|
|
880
930
|
y,
|
|
@@ -900,9 +950,8 @@ const limitShift$1 = function (options) {
|
|
|
900
950
|
mainAxis: rawOffset,
|
|
901
951
|
crossAxis: 0
|
|
902
952
|
} : {
|
|
903
|
-
mainAxis: 0,
|
|
904
|
-
crossAxis: 0
|
|
905
|
-
...rawOffset
|
|
953
|
+
mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
|
|
954
|
+
crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
|
|
906
955
|
};
|
|
907
956
|
if (checkMainAxis) {
|
|
908
957
|
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
@@ -934,6 +983,12 @@ const limitShift$1 = function (options) {
|
|
|
934
983
|
};
|
|
935
984
|
};
|
|
936
985
|
|
|
986
|
+
// Method syntax keeps callback parameters bivariant, but expressing the
|
|
987
|
+
// explicit `| undefined` required by `exactOptionalPropertyTypes` needs
|
|
988
|
+
// property syntax, which is contravariant under `strictFunctionTypes`.
|
|
989
|
+
// Extracting the function from a method position restores that bivariance so
|
|
990
|
+
// consumers can still assign callbacks with narrower parameter types.
|
|
991
|
+
|
|
937
992
|
/**
|
|
938
993
|
* Provides data that allows you to change the size of the floating element —
|
|
939
994
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
@@ -948,7 +1003,6 @@ const size$1 = function (options) {
|
|
|
948
1003
|
name: 'size',
|
|
949
1004
|
options,
|
|
950
1005
|
async fn(state) {
|
|
951
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
952
1006
|
const {
|
|
953
1007
|
placement,
|
|
954
1008
|
rects,
|
|
@@ -980,24 +1034,21 @@ const size$1 = function (options) {
|
|
|
980
1034
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
981
1035
|
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
982
1036
|
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
983
|
-
const
|
|
1037
|
+
const shiftData = state.middlewareData.shift;
|
|
1038
|
+
const noShift = !shiftData;
|
|
984
1039
|
let availableHeight = overflowAvailableHeight;
|
|
985
1040
|
let availableWidth = overflowAvailableWidth;
|
|
986
|
-
if (
|
|
1041
|
+
if (shiftData != null && shiftData.enabled.x) {
|
|
987
1042
|
availableWidth = maximumClippingWidth;
|
|
988
1043
|
}
|
|
989
|
-
if (
|
|
1044
|
+
if (shiftData != null && shiftData.enabled.y) {
|
|
990
1045
|
availableHeight = maximumClippingHeight;
|
|
991
1046
|
}
|
|
992
1047
|
if (noShift && !alignment) {
|
|
993
|
-
const xMin = max(overflow.left, 0);
|
|
994
|
-
const xMax = max(overflow.right, 0);
|
|
995
|
-
const yMin = max(overflow.top, 0);
|
|
996
|
-
const yMax = max(overflow.bottom, 0);
|
|
997
1048
|
if (isYAxis) {
|
|
998
|
-
availableWidth = width - 2 *
|
|
1049
|
+
availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
999
1050
|
} else {
|
|
1000
|
-
availableHeight = height - 2 *
|
|
1051
|
+
availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
1001
1052
|
}
|
|
1002
1053
|
}
|
|
1003
1054
|
await apply({
|
|
@@ -1153,7 +1204,7 @@ function getParentNode(node) {
|
|
|
1153
1204
|
function getNearestOverflowAncestor(node) {
|
|
1154
1205
|
const parentNode = getParentNode(node);
|
|
1155
1206
|
if (isLastTraversableNode(parentNode)) {
|
|
1156
|
-
return node.ownerDocument
|
|
1207
|
+
return (node.ownerDocument || node).body;
|
|
1157
1208
|
}
|
|
1158
1209
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1159
1210
|
return parentNode;
|
|
@@ -1250,10 +1301,7 @@ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
|
1250
1301
|
if (isFixed === void 0) {
|
|
1251
1302
|
isFixed = false;
|
|
1252
1303
|
}
|
|
1253
|
-
|
|
1254
|
-
return false;
|
|
1255
|
-
}
|
|
1256
|
-
return isFixed;
|
|
1304
|
+
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
|
|
1257
1305
|
}
|
|
1258
1306
|
|
|
1259
1307
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
@@ -1280,12 +1328,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1280
1328
|
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1281
1329
|
let width = clientRect.width / scale.x;
|
|
1282
1330
|
let height = clientRect.height / scale.y;
|
|
1283
|
-
if (domElement) {
|
|
1331
|
+
if (domElement && offsetParent) {
|
|
1284
1332
|
const win = getWindow(domElement);
|
|
1285
|
-
const offsetWin =
|
|
1333
|
+
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1286
1334
|
let currentWin = win;
|
|
1287
1335
|
let currentIFrame = getFrameElement(currentWin);
|
|
1288
|
-
while (currentIFrame &&
|
|
1336
|
+
while (currentIFrame && offsetWin !== currentWin) {
|
|
1289
1337
|
const iframeScale = getScale(currentIFrame);
|
|
1290
1338
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1291
1339
|
const css = getComputedStyle$1(currentIFrame);
|
|
@@ -1349,7 +1397,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1349
1397
|
let scale = createCoords(1);
|
|
1350
1398
|
const offsets = createCoords(0);
|
|
1351
1399
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1352
|
-
if (isOffsetParentAnElement || !
|
|
1400
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
1353
1401
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1354
1402
|
scroll = getNodeScroll(offsetParent);
|
|
1355
1403
|
}
|
|
@@ -1370,18 +1418,17 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1370
1418
|
}
|
|
1371
1419
|
|
|
1372
1420
|
function getClientRects(element) {
|
|
1373
|
-
return Array.from(element.getClientRects());
|
|
1421
|
+
return element.getClientRects ? Array.from(element.getClientRects()) : [];
|
|
1374
1422
|
}
|
|
1375
1423
|
|
|
1376
1424
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
1377
1425
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1378
|
-
function getDocumentRect(
|
|
1379
|
-
const
|
|
1380
|
-
const
|
|
1381
|
-
const body = element.ownerDocument.body;
|
|
1426
|
+
function getDocumentRect(html) {
|
|
1427
|
+
const scroll = getNodeScroll(html);
|
|
1428
|
+
const body = html.ownerDocument.body;
|
|
1382
1429
|
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1383
1430
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1384
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(
|
|
1431
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
|
|
1385
1432
|
const y = -scroll.scrollTop;
|
|
1386
1433
|
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
1387
1434
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
@@ -1398,7 +1445,11 @@ function getDocumentRect(element) {
|
|
|
1398
1445
|
// calculation is affected by unusual styles.
|
|
1399
1446
|
// Most scrollbars leave 15-18px of space.
|
|
1400
1447
|
const SCROLLBAR_MAX = 25;
|
|
1401
|
-
function getViewportRect(element, strategy) {
|
|
1448
|
+
function getViewportRect(element, strategy, rootBoundary) {
|
|
1449
|
+
if (rootBoundary === void 0) {
|
|
1450
|
+
rootBoundary = 'viewport';
|
|
1451
|
+
}
|
|
1452
|
+
const isLayoutViewport = rootBoundary === 'layoutViewport';
|
|
1402
1453
|
const win = getWindow(element);
|
|
1403
1454
|
const html = getDocumentElement(element);
|
|
1404
1455
|
const visualViewport = win.visualViewport;
|
|
@@ -1407,31 +1458,42 @@ function getViewportRect(element, strategy) {
|
|
|
1407
1458
|
let x = 0;
|
|
1408
1459
|
let y = 0;
|
|
1409
1460
|
if (visualViewport) {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1461
|
+
// Client coordinates are relative to the layout viewport, except in
|
|
1462
|
+
// WebKit with an `absolute` strategy, where they are relative to the
|
|
1463
|
+
// visual viewport.
|
|
1464
|
+
const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';
|
|
1465
|
+
if (isLayoutViewport) {
|
|
1466
|
+
if (!layoutRelativeClientCoords) {
|
|
1467
|
+
x = -visualViewport.offsetLeft;
|
|
1468
|
+
y = -visualViewport.offsetTop;
|
|
1469
|
+
}
|
|
1470
|
+
} else {
|
|
1471
|
+
width = visualViewport.width;
|
|
1472
|
+
height = visualViewport.height;
|
|
1473
|
+
if (layoutRelativeClientCoords) {
|
|
1474
|
+
x = visualViewport.offsetLeft;
|
|
1475
|
+
y = visualViewport.offsetTop;
|
|
1476
|
+
}
|
|
1416
1477
|
}
|
|
1417
1478
|
}
|
|
1418
1479
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1419
|
-
//
|
|
1420
|
-
// visual width
|
|
1421
|
-
//
|
|
1480
|
+
// `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks
|
|
1481
|
+
// the visual width but isn't reflected in `html.clientWidth`, so subtract it.
|
|
1482
|
+
// Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also
|
|
1483
|
+
// reserves an empty inline-start gutter that clips nothing, so exclude just
|
|
1484
|
+
// the one scrollbar-side gutter — halve the measured (two-gutter) total. A
|
|
1485
|
+
// left-side scrollbar (`windowScrollbarX > 0`) is already handled by
|
|
1486
|
+
// `getHTMLOffset`/`visualViewport.width`; skip it here.
|
|
1422
1487
|
if (windowScrollbarX <= 0) {
|
|
1423
1488
|
const doc = html.ownerDocument;
|
|
1424
1489
|
const body = doc.body;
|
|
1425
1490
|
const bodyStyles = getComputedStyle(body);
|
|
1426
1491
|
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1429
|
-
|
|
1492
|
+
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1493
|
+
const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;
|
|
1494
|
+
if (gutter <= SCROLLBAR_MAX) {
|
|
1495
|
+
width -= gutter;
|
|
1430
1496
|
}
|
|
1431
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1432
|
-
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1433
|
-
// by the scrollbar amount so there isn't extra space on the right.
|
|
1434
|
-
width += windowScrollbarX;
|
|
1435
1497
|
}
|
|
1436
1498
|
return {
|
|
1437
1499
|
width,
|
|
@@ -1446,7 +1508,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
1446
1508
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1447
1509
|
const top = clientRect.top + element.clientTop;
|
|
1448
1510
|
const left = clientRect.left + element.clientLeft;
|
|
1449
|
-
const scale =
|
|
1511
|
+
const scale = getScale(element);
|
|
1450
1512
|
const width = element.clientWidth * scale.x;
|
|
1451
1513
|
const height = element.clientHeight * scale.y;
|
|
1452
1514
|
const x = left * scale.x;
|
|
@@ -1460,8 +1522,8 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
1460
1522
|
}
|
|
1461
1523
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1462
1524
|
let rect;
|
|
1463
|
-
if (clippingAncestor === 'viewport') {
|
|
1464
|
-
rect = getViewportRect(element, strategy);
|
|
1525
|
+
if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {
|
|
1526
|
+
rect = getViewportRect(element, strategy, clippingAncestor);
|
|
1465
1527
|
} else if (clippingAncestor === 'document') {
|
|
1466
1528
|
rect = getDocumentRect(getDocumentElement(element));
|
|
1467
1529
|
} else if (isElement(clippingAncestor)) {
|
|
@@ -1477,13 +1539,6 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1477
1539
|
}
|
|
1478
1540
|
return rectToClientRect(rect);
|
|
1479
1541
|
}
|
|
1480
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
1481
|
-
const parentNode = getParentNode(element);
|
|
1482
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1483
|
-
return false;
|
|
1484
|
-
}
|
|
1485
|
-
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1486
|
-
}
|
|
1487
1542
|
|
|
1488
1543
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1489
1544
|
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
@@ -1494,7 +1549,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1494
1549
|
return cachedResult;
|
|
1495
1550
|
}
|
|
1496
1551
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1497
|
-
let
|
|
1552
|
+
let lastKeptComputedStyle = null;
|
|
1498
1553
|
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1499
1554
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1500
1555
|
|
|
@@ -1502,16 +1557,20 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1502
1557
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1503
1558
|
const computedStyle = getComputedStyle$1(currentNode);
|
|
1504
1559
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1560
|
+
// Position of the containing block chain below the current node. A fixed
|
|
1561
|
+
// element whose containing block hasn't been found yet is a fixed chain.
|
|
1562
|
+
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';
|
|
1563
|
+
|
|
1564
|
+
// A non-containing ancestor does not clip the element when the chain
|
|
1565
|
+
// below it escapes it: a fixed chain escapes all ancestors up to the
|
|
1566
|
+
// next containing block, an absolute chain escapes static ancestors.
|
|
1567
|
+
const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');
|
|
1509
1568
|
if (shouldDropCurrentNode) {
|
|
1510
1569
|
// Drop non-containing blocks.
|
|
1511
1570
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1512
1571
|
} else {
|
|
1513
|
-
//
|
|
1514
|
-
|
|
1572
|
+
// The kept node carries the chain position for the next iteration.
|
|
1573
|
+
lastKeptComputedStyle = computedStyle;
|
|
1515
1574
|
}
|
|
1516
1575
|
currentNode = getParentNode(currentNode);
|
|
1517
1576
|
}
|
|
@@ -1521,7 +1580,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1521
1580
|
|
|
1522
1581
|
// Gets the maximum area that the element is visible in due to any number of
|
|
1523
1582
|
// clipping ancestors.
|
|
1524
|
-
function getClippingRect(_ref) {
|
|
1583
|
+
function getClippingRect$1(_ref) {
|
|
1525
1584
|
let {
|
|
1526
1585
|
element,
|
|
1527
1586
|
boundary,
|
|
@@ -1571,13 +1630,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1571
1630
|
scrollTop: 0
|
|
1572
1631
|
};
|
|
1573
1632
|
const offsets = createCoords(0);
|
|
1574
|
-
|
|
1575
|
-
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1576
|
-
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1577
|
-
function setLeftRTLScrollbarOffset() {
|
|
1578
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
1579
|
-
}
|
|
1580
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1633
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
1581
1634
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1582
1635
|
scroll = getNodeScroll(offsetParent);
|
|
1583
1636
|
}
|
|
@@ -1585,12 +1638,13 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1585
1638
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1586
1639
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1587
1640
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1588
|
-
} else if (documentElement) {
|
|
1589
|
-
setLeftRTLScrollbarOffset();
|
|
1590
1641
|
}
|
|
1591
1642
|
}
|
|
1592
|
-
|
|
1593
|
-
|
|
1643
|
+
|
|
1644
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1645
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1646
|
+
if (!isOffsetParentAnElement && documentElement) {
|
|
1647
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1594
1648
|
}
|
|
1595
1649
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1596
1650
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
@@ -1675,7 +1729,7 @@ function isRTL(element) {
|
|
|
1675
1729
|
const platform = {
|
|
1676
1730
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1677
1731
|
getDocumentElement,
|
|
1678
|
-
getClippingRect,
|
|
1732
|
+
getClippingRect: getClippingRect$1,
|
|
1679
1733
|
getOffsetParent,
|
|
1680
1734
|
getElementRects,
|
|
1681
1735
|
getClientRects,
|
|
@@ -1690,7 +1744,7 @@ function rectsAreEqual(a, b) {
|
|
|
1690
1744
|
}
|
|
1691
1745
|
|
|
1692
1746
|
// https://samthor.au/2021/observing-dom/
|
|
1693
|
-
function observeMove(element, onMove) {
|
|
1747
|
+
function observeMove(element, onMove, ancestorResize) {
|
|
1694
1748
|
let io = null;
|
|
1695
1749
|
let timeoutId;
|
|
1696
1750
|
const root = getDocumentElement(element);
|
|
@@ -1733,13 +1787,22 @@ function observeMove(element, onMove) {
|
|
|
1733
1787
|
let isFirstUpdate = true;
|
|
1734
1788
|
function handleObserve(entries) {
|
|
1735
1789
|
const ratio = entries[0].intersectionRatio;
|
|
1790
|
+
|
|
1791
|
+
// The entry is a snapshot, so the reference may have moved since the
|
|
1792
|
+
// intersection was computed (under performance constraints, or between
|
|
1793
|
+
// consecutive frames of a multi-frame layout shift). The reported ratio
|
|
1794
|
+
// and the observed area are stale in that case and cannot be trusted to
|
|
1795
|
+
// detect subsequent movement, so refresh regardless of the ratio.
|
|
1796
|
+
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1797
|
+
return refresh();
|
|
1798
|
+
}
|
|
1736
1799
|
if (ratio !== threshold) {
|
|
1737
1800
|
if (!isFirstUpdate) {
|
|
1738
1801
|
return refresh();
|
|
1739
1802
|
}
|
|
1740
1803
|
if (!ratio) {
|
|
1741
|
-
// If the reference is clipped, the ratio is 0. Throttle
|
|
1742
|
-
// to prevent an infinite loop of updates.
|
|
1804
|
+
// If the reference is clipped in place, the ratio is 0. Throttle
|
|
1805
|
+
// the refresh to prevent an infinite loop of updates.
|
|
1743
1806
|
timeoutId = setTimeout(() => {
|
|
1744
1807
|
refresh(false, 1e-7);
|
|
1745
1808
|
}, 1000);
|
|
@@ -1747,16 +1810,6 @@ function observeMove(element, onMove) {
|
|
|
1747
1810
|
refresh(false, ratio);
|
|
1748
1811
|
}
|
|
1749
1812
|
}
|
|
1750
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1751
|
-
// It's possible that even though the ratio is reported as 1, the
|
|
1752
|
-
// element is not actually fully within the IntersectionObserver's root
|
|
1753
|
-
// area anymore. This can happen under performance constraints. This may
|
|
1754
|
-
// be a bug in the browser's IntersectionObserver implementation. To
|
|
1755
|
-
// work around this, we compare the element's bounding rect now with
|
|
1756
|
-
// what it was at the time we created the IntersectionObserver. If they
|
|
1757
|
-
// are not equal then the element moved, so we refresh.
|
|
1758
|
-
refresh();
|
|
1759
|
-
}
|
|
1760
1813
|
isFirstUpdate = false;
|
|
1761
1814
|
}
|
|
1762
1815
|
|
|
@@ -1773,8 +1826,18 @@ function observeMove(element, onMove) {
|
|
|
1773
1826
|
}
|
|
1774
1827
|
io.observe(element);
|
|
1775
1828
|
}
|
|
1829
|
+
const win = getWindow(element);
|
|
1830
|
+
// The window is a resize ancestor, so when `ancestorResize` is enabled its
|
|
1831
|
+
// listener already runs the update on resize. Here we only need to rebuild
|
|
1832
|
+
// the `IntersectionObserver` for the new root size, skipping a redundant
|
|
1833
|
+
// update. When `ancestorResize` is disabled, this becomes the sole update.
|
|
1834
|
+
const handleResize = () => refresh(ancestorResize);
|
|
1835
|
+
win.addEventListener('resize', handleResize);
|
|
1776
1836
|
refresh(true);
|
|
1777
|
-
return
|
|
1837
|
+
return () => {
|
|
1838
|
+
win.removeEventListener('resize', handleResize);
|
|
1839
|
+
cleanup();
|
|
1840
|
+
};
|
|
1778
1841
|
}
|
|
1779
1842
|
|
|
1780
1843
|
/**
|
|
@@ -1799,12 +1862,10 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1799
1862
|
const referenceEl = unwrapElement(reference);
|
|
1800
1863
|
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];
|
|
1801
1864
|
ancestors.forEach(ancestor => {
|
|
1802
|
-
ancestorScroll && ancestor.addEventListener('scroll', update
|
|
1803
|
-
passive: true
|
|
1804
|
-
});
|
|
1865
|
+
ancestorScroll && ancestor.addEventListener('scroll', update);
|
|
1805
1866
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1806
1867
|
});
|
|
1807
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1868
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
|
|
1808
1869
|
let reobserveFrame = -1;
|
|
1809
1870
|
let resizeObserver = null;
|
|
1810
1871
|
if (elementResize) {
|
|
@@ -1890,6 +1951,13 @@ const flip = flip$1;
|
|
|
1890
1951
|
*/
|
|
1891
1952
|
const size = size$1;
|
|
1892
1953
|
|
|
1954
|
+
/**
|
|
1955
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1956
|
+
* when it is not in the same clipping context as the reference element.
|
|
1957
|
+
* @see https://floating-ui.com/docs/hide
|
|
1958
|
+
*/
|
|
1959
|
+
const hide = hide$1;
|
|
1960
|
+
|
|
1893
1961
|
/**
|
|
1894
1962
|
* Provides data to position an inner element of the floating element so that it
|
|
1895
1963
|
* appears centered to the reference element.
|
|
@@ -1918,11 +1986,9 @@ const computePosition = (reference, floating, options) => {
|
|
|
1918
1986
|
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1919
1987
|
// single call. If other functions become expensive, we can add them as well.
|
|
1920
1988
|
const cache = new Map();
|
|
1921
|
-
const mergedOptions = {
|
|
1922
|
-
platform,
|
|
1923
|
-
...options
|
|
1924
|
-
};
|
|
1989
|
+
const mergedOptions = options != null ? options : {};
|
|
1925
1990
|
const platformWithCache = {
|
|
1991
|
+
...platform,
|
|
1926
1992
|
...mergedOptions.platform,
|
|
1927
1993
|
_c: cache
|
|
1928
1994
|
};
|
|
@@ -2739,6 +2805,77 @@ function apply() {
|
|
|
2739
2805
|
injectStyles(document);
|
|
2740
2806
|
}
|
|
2741
2807
|
|
|
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
|
+
|
|
2742
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))}`;
|
|
2743
2880
|
|
|
2744
2881
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -2755,6 +2892,30 @@ const ANIMATIONS = {
|
|
|
2755
2892
|
'pop-in': popIn,
|
|
2756
2893
|
};
|
|
2757
2894
|
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
|
+
}
|
|
2758
2919
|
constructor(hostRef) {
|
|
2759
2920
|
registerInstance(this, hostRef);
|
|
2760
2921
|
this.postBeforeShow = createEvent(this, "postBeforeShow");
|
|
@@ -2816,7 +2977,7 @@ const PostPopovercontainer = class {
|
|
|
2816
2977
|
if (this.toggleTimeoutId || !target)
|
|
2817
2978
|
return;
|
|
2818
2979
|
this.eventTarget = target;
|
|
2819
|
-
this.
|
|
2980
|
+
this.updatePosition();
|
|
2820
2981
|
this.host.showPopover();
|
|
2821
2982
|
}
|
|
2822
2983
|
/**
|
|
@@ -2842,7 +3003,7 @@ const PostPopovercontainer = class {
|
|
|
2842
3003
|
this.eventTarget = target;
|
|
2843
3004
|
// Prevent instant double toggle
|
|
2844
3005
|
if (!this.toggleTimeoutId) {
|
|
2845
|
-
this.
|
|
3006
|
+
this.updatePosition();
|
|
2846
3007
|
this.host.togglePopover(force);
|
|
2847
3008
|
this.toggleTimeoutId = null;
|
|
2848
3009
|
}
|
|
@@ -2954,17 +3115,14 @@ const PostPopovercontainer = class {
|
|
|
2954
3115
|
startAutoupdates() {
|
|
2955
3116
|
if (!this.eventTarget || !this.host)
|
|
2956
3117
|
return;
|
|
2957
|
-
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.
|
|
3118
|
+
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.updatePosition.bind(this));
|
|
2958
3119
|
}
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
}
|
|
2966
|
-
async calculatePosition() {
|
|
2967
|
-
const { x, y, middlewareData, placement } = await this.computeMainPosition();
|
|
3120
|
+
async updatePosition() {
|
|
3121
|
+
const { x, y, middlewareData, placement } = await this.calculatePosition();
|
|
3122
|
+
// Hide the popover if the target is outside the viewport
|
|
3123
|
+
if (middlewareData.hide?.referenceHidden) {
|
|
3124
|
+
this.host.hidePopover();
|
|
3125
|
+
}
|
|
2968
3126
|
const currentPlacement = placement.split('-')[0];
|
|
2969
3127
|
this.dynamicPlacement = currentPlacement;
|
|
2970
3128
|
// Position popover
|
|
@@ -2989,13 +3147,15 @@ const PostPopovercontainer = class {
|
|
|
2989
3147
|
await this.updateSafeSpaceBoundaries(currentPlacement);
|
|
2990
3148
|
}
|
|
2991
3149
|
}
|
|
2992
|
-
async
|
|
3150
|
+
async calculatePosition() {
|
|
2993
3151
|
const gap = this.edgeGap;
|
|
2994
3152
|
const isAligned = (this.placement || 'top').includes('-');
|
|
2995
|
-
const flipMiddleware =
|
|
2996
|
-
|
|
2997
|
-
crossAxis: false,
|
|
2998
|
-
|
|
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
|
+
];
|
|
2999
3159
|
const shiftMiddleware = shift({
|
|
3000
3160
|
padding: gap,
|
|
3001
3161
|
limiter: limitShift({
|
|
@@ -3007,7 +3167,7 @@ const PostPopovercontainer = class {
|
|
|
3007
3167
|
inline(),
|
|
3008
3168
|
// Per floating-ui docs: for aligned placements (e.g. bottom-end),
|
|
3009
3169
|
// flip should come before shift. For non-aligned, shift before flip.
|
|
3010
|
-
...(isAligned ? [flipMiddleware, shiftMiddleware] : [shiftMiddleware, flipMiddleware]),
|
|
3170
|
+
...(isAligned ? [...flipMiddleware, shiftMiddleware] : [shiftMiddleware, ...flipMiddleware]),
|
|
3011
3171
|
size({
|
|
3012
3172
|
apply({ availableWidth, elements }) {
|
|
3013
3173
|
Object.assign(elements.floating.style, {
|
|
@@ -3019,7 +3179,12 @@ const PostPopovercontainer = class {
|
|
|
3019
3179
|
if (this.arrow) {
|
|
3020
3180
|
middleware.push(arrow({ element: this.arrowRef, padding: gap }));
|
|
3021
3181
|
}
|
|
3022
|
-
|
|
3182
|
+
// Automatically hide the popover if the target moves outside the scrollport.
|
|
3183
|
+
if (this.autoHide) {
|
|
3184
|
+
// Per floating-ui docs: hide should generally be placed at the end.
|
|
3185
|
+
middleware.push(hide({ strategy: 'referenceHidden' }));
|
|
3186
|
+
}
|
|
3187
|
+
return computePositionWithSafeArea(this.eventTarget, this.host, {
|
|
3023
3188
|
placement: this.placement || 'top',
|
|
3024
3189
|
strategy: 'fixed',
|
|
3025
3190
|
middleware,
|
|
@@ -3086,32 +3251,12 @@ const PostPopovercontainer = class {
|
|
|
3086
3251
|
}
|
|
3087
3252
|
}
|
|
3088
3253
|
render() {
|
|
3089
|
-
return (h(Host, { key: '
|
|
3254
|
+
return (h(Host, { key: 'f3ea4bfc9a59faa2fbf1e413a1ec648f598a6779', "data-version": version, popover: "auto" }, h("div", { key: 'a328c73c7e08eca1e423fcbe736798188cca2a87', part: "post-popovercontainer-content", class: "popover-content" }, this.arrow && (h("span", { key: '8fad0095fb8d8c903ba84a639b4efc3e321c6aef', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
3090
3255
|
this.arrowRef = el;
|
|
3091
|
-
} })), h("span", { key: '
|
|
3256
|
+
} })), h("span", { key: 'deadbcc5892ed545a64b4a0e5e0936e0dd1feb70', part: "post-popovercontainer-border-mask" }), h("slot", { key: '48c4db7ab222f3ef18157ce19d8ba15d75441f98' }))));
|
|
3092
3257
|
}
|
|
3093
3258
|
get host() { return getElement(this); }
|
|
3094
3259
|
};
|
|
3095
|
-
PostPopovercontainer.STATIC_SIDES = {
|
|
3096
|
-
top: 'bottom',
|
|
3097
|
-
right: 'left',
|
|
3098
|
-
bottom: 'top',
|
|
3099
|
-
left: 'right',
|
|
3100
|
-
};
|
|
3101
|
-
PostPopovercontainer.PROPERTIES_TO_CLEAR = [
|
|
3102
|
-
'--post-safe-space-popover-x',
|
|
3103
|
-
'--post-safe-space-popover-y',
|
|
3104
|
-
'--post-safe-space-popover-x-start',
|
|
3105
|
-
'--post-safe-space-popover-x-end',
|
|
3106
|
-
'--post-safe-space-popover-y-start',
|
|
3107
|
-
'--post-safe-space-popover-y-end',
|
|
3108
|
-
'--post-safe-space-trigger-x',
|
|
3109
|
-
'--post-safe-space-trigger-y',
|
|
3110
|
-
'--post-safe-space-trigger-x-start',
|
|
3111
|
-
'--post-safe-space-trigger-x-end',
|
|
3112
|
-
'--post-safe-space-trigger-y-start',
|
|
3113
|
-
'--post-safe-space-trigger-y-end',
|
|
3114
|
-
];
|
|
3115
3260
|
__decorate([
|
|
3116
3261
|
OneOf(PLACEMENT_TYPES)
|
|
3117
3262
|
], PostPopovercontainer.prototype, "placement", void 0);
|