@swisspost/design-system-components 10.4.0 → 10.5.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-Kruvy8Dm.js +47 -0
- package/dist/cjs/{create-validator-decorator-BtgLWaMJ.js → create-validator-decorator-u-Byhihe.js} +1 -1
- package/dist/cjs/{event-from-CwMw19f8.js → event-from-CTcQxB9-.js} +19 -13
- package/dist/cjs/{index-CW10QvjR.js → index-CXnlZiX8.js} +1 -1
- package/dist/cjs/{breakpoints-B0Olgvgc.js → index-CggFmZ8n.js} +0 -42
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{one-of-vJeW7S4_.js → one-of-LGG0uEIi.js} +1 -1
- package/dist/cjs/{package-CL8OSAS4.js → package-DdU-rENe.js} +1 -1
- package/dist/cjs/{pattern-Zmn3wpyp.js → pattern-B-csvfNt.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +7 -7
- package/dist/cjs/post-autocomplete.cjs.entry.js +70 -55
- package/dist/cjs/post-avatar.cjs.entry.js +7 -7
- package/dist/cjs/post-back-to-top.cjs.entry.js +25 -13
- package/dist/cjs/post-banner.cjs.entry.js +6 -13
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +18 -10
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +118 -67
- package/dist/cjs/post-closebutton_14.cjs.entry.js +404 -210
- package/dist/cjs/post-collapsible_2.cjs.entry.js +8 -8
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +8 -8
- package/dist/cjs/post-footer.cjs.entry.js +8 -8
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
- package/dist/cjs/post-listbox.cjs.entry.js +6 -6
- package/dist/cjs/post-number-input.cjs.entry.js +7 -6
- package/dist/cjs/post-pagination.cjs.entry.js +6 -6
- package/dist/cjs/post-popover-trigger.cjs.entry.js +7 -7
- package/dist/cjs/post-popover.cjs.entry.js +10 -10
- package/dist/cjs/post-progressbar.cjs.entry.js +5 -5
- package/dist/cjs/post-rating.cjs.entry.js +7 -7
- package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +8 -8
- package/dist/cjs/post-side-navigation.cjs.entry.js +9 -9
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +8 -8
- package/dist/cjs/post-tab-item.cjs.entry.js +7 -7
- package/dist/cjs/post-tab-panel.cjs.entry.js +7 -7
- package/dist/cjs/post-tabs.cjs.entry.js +8 -8
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -7
- package/dist/cjs/post-tooltip.cjs.entry.js +6 -6
- package/dist/cjs/{required-DRnPokVn.js → required-bJzxBV-V.js} +1 -1
- package/dist/cjs/{type-CNcU_-B2.js → type-CGPnqGY1.js} +1 -1
- package/dist/cjs/{url-DgJ3lXQz.js → url-Dxdd6tWj.js} +1 -1
- package/dist/collection/components/post-autocomplete/post-autocomplete.js +65 -50
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +19 -7
- package/dist/collection/components/post-banner/post-banner.js +2 -17
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +29 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -1
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +113 -62
- package/dist/collection/components/post-closebutton/post-closebutton.js +7 -8
- package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +2 -2
- package/dist/collection/components/post-footer/post-footer.js +2 -2
- package/dist/collection/components/post-header/post-header.js +2 -2
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-language-menu/post-language-menu.js +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.js +2 -2
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +23 -8
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.js +2 -2
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +3 -3
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +2 -2
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +47 -23
- package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.css +1 -1
- package/dist/collection/components/post-side-navigation/post-side-navigation.js +1 -1
- package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
- package/dist/collection/components/post-stepper/post-stepper.js +1 -1
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +2 -2
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +2 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
- package/dist/collection/utils/breakpoints.js +11 -9
- package/dist/collection/utils/closable-target.js +38 -0
- package/dist/collection/utils/event-from.js +18 -13
- package/dist/collection/utils/floating-ui.js +72 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/components/breakpoints.js +1 -1
- package/dist/components/event-from.js +1 -1
- package/dist/components/index2.js +1 -0
- package/dist/components/package.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-footer.js +1 -1
- package/dist/components/post-header.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-logo.js +1 -1
- package/dist/components/post-mainnavigation.js +1 -1
- package/dist/components/post-megadropdown-trigger.js +1 -1
- package/dist/components/post-megadropdown.js +1 -1
- package/dist/components/post-menu-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/react/index.js +1 -1
- package/dist/components/react/p-0nNMdSBr.js +1 -0
- package/dist/components/react/p-5LuCes5o.js +1 -0
- package/dist/components/react/{p-4wtxqxXu.js → p-B2jsM_Ov.js} +1 -1
- package/dist/components/react/p-BEcxHjuM.js +1 -0
- package/dist/{post-components/p-C-lLRsYC.js → components/react/p-BdLRXQqY.js} +1 -1
- package/dist/components/react/{p-Df31eVdi.js → p-C8vlYfD-.js} +1 -1
- package/dist/components/react/{p-9RCG8BWM.js → p-CLeWLMJn.js} +1 -1
- package/dist/components/react/p-CVVXnYLU.js +1 -0
- package/dist/components/react/p-CnN4Jdtv.js +1 -0
- package/dist/components/react/{p-Bwko4UKh.js → p-CoCua20S.js} +1 -1
- package/dist/components/react/p-CuVhOs8F.js +1 -0
- package/dist/components/react/{p-B1kYo1K9.js → p-D3rq_-Qk.js} +1 -1
- package/dist/components/react/{p-CSmrQ__L.js → p-DD-Sl3Ji.js} +1 -1
- package/dist/components/react/{p-D-imniYA.js → p-DasK590W.js} +1 -1
- package/dist/components/react/p-DeO0rZ1T.js +1 -0
- package/dist/components/react/p-DiFAKI9o.js +1 -0
- package/dist/components/react/p-Ny5VnydI.js +1 -0
- package/dist/components/react/{p-BSb74xQy.js → p-PYoaz_Xl.js} +1 -1
- package/dist/components/react/{p-CwmQwirr.js → p-SBBBSmJM.js} +1 -1
- package/dist/components/react/p-bR8vy6-s.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -1
- package/dist/components/react/post-accordion.js +1 -1
- package/dist/components/react/post-autocomplete.js +1 -1
- package/dist/components/react/post-avatar.js +1 -1
- package/dist/components/react/post-back-to-top.js +1 -1
- package/dist/components/react/post-banner.js +1 -1
- package/dist/components/react/post-breadcrumb-item.js +1 -1
- package/dist/components/react/post-breadcrumbs.js +1 -1
- package/dist/components/react/post-closebutton.js +1 -1
- package/dist/components/react/post-collapsible-trigger.js +1 -1
- package/dist/components/react/post-collapsible.js +1 -1
- package/dist/components/react/post-date-picker.js +1 -1
- package/dist/components/react/post-footer.js +1 -1
- package/dist/components/react/post-header.js +1 -1
- package/dist/components/react/post-icon.js +1 -1
- package/dist/components/react/post-language-menu-item.js +1 -1
- package/dist/components/react/post-language-menu.js +1 -1
- package/dist/components/react/post-linkarea.js +1 -1
- package/dist/components/react/post-listbox-option.js +1 -1
- package/dist/components/react/post-listbox.js +1 -1
- package/dist/components/react/post-logo.js +1 -1
- package/dist/components/react/post-mainnavigation.js +1 -1
- package/dist/components/react/post-megadropdown-trigger.js +1 -1
- package/dist/components/react/post-megadropdown.js +1 -1
- package/dist/components/react/post-menu-item.js +1 -1
- package/dist/components/react/post-menu-trigger.js +1 -1
- package/dist/components/react/post-menu.js +1 -1
- package/dist/components/react/post-number-input.js +1 -1
- package/dist/components/react/post-pagination.js +1 -1
- package/dist/components/react/post-popover-trigger.js +1 -1
- package/dist/components/react/post-popover.js +1 -1
- package/dist/components/react/post-popovercontainer.js +1 -1
- package/dist/components/react/post-progressbar.js +1 -1
- package/dist/components/react/post-rating.js +1 -1
- package/dist/components/react/post-side-navigation-trigger.js +1 -1
- package/dist/components/react/post-side-navigation.js +1 -1
- package/dist/components/react/post-stepper-item.js +1 -1
- package/dist/components/react/post-stepper.js +1 -1
- package/dist/components/react/post-tab-item.js +1 -1
- package/dist/components/react/post-tab-panel.js +1 -1
- package/dist/components/react/post-tabs.js +1 -1
- package/dist/components/react/post-togglebutton.js +1 -1
- package/dist/components/react/post-tooltip-trigger.js +1 -1
- package/dist/components/react/post-tooltip.js +1 -1
- package/dist/docs.json +62 -16
- package/dist/esm/breakpoints-I1j7a0bW.js +45 -0
- package/dist/esm/{create-validator-decorator-CNUaQboh.js → create-validator-decorator-CbYxqPSB.js} +1 -1
- package/dist/esm/{event-from-rEfV4v4a.js → event-from-BEcxHjuM.js} +19 -14
- package/dist/esm/{index-sn7oKSwC.js → index-D3NdvMgy.js} +1 -1
- package/dist/esm/{breakpoints-BQ3HlJPr.js → index-bR8vy6-s.js} +1 -42
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{one-of-C6Ironyj.js → one-of-Mx4vYjem.js} +1 -1
- package/dist/esm/{package-tTf1w3A9.js → package-Ny5VnydI.js} +1 -1
- package/dist/esm/{pattern-57oD--q3.js → pattern-CqQVrJPN.js} +1 -1
- package/dist/esm/post-accordion_2.entry.js +7 -7
- package/dist/esm/post-autocomplete.entry.js +70 -55
- package/dist/esm/post-avatar.entry.js +7 -7
- package/dist/esm/post-back-to-top.entry.js +25 -13
- package/dist/esm/post-banner.entry.js +6 -13
- package/dist/esm/post-breadcrumb-item.entry.js +18 -10
- package/dist/esm/post-breadcrumbs.entry.js +118 -67
- package/dist/esm/post-closebutton_14.entry.js +403 -209
- package/dist/esm/post-collapsible_2.entry.js +8 -8
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +8 -8
- package/dist/esm/post-footer.entry.js +8 -8
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +4 -4
- package/dist/esm/post-listbox.entry.js +6 -6
- package/dist/esm/post-number-input.entry.js +6 -5
- package/dist/esm/post-pagination.entry.js +6 -6
- package/dist/esm/post-popover-trigger.entry.js +7 -7
- package/dist/esm/post-popover.entry.js +10 -10
- package/dist/esm/post-progressbar.entry.js +5 -5
- package/dist/esm/post-rating.entry.js +7 -7
- package/dist/esm/post-side-navigation-trigger.entry.js +8 -8
- package/dist/esm/post-side-navigation.entry.js +9 -9
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +8 -8
- package/dist/esm/post-tab-item.entry.js +7 -7
- package/dist/esm/post-tab-panel.entry.js +7 -7
- package/dist/esm/post-tabs.entry.js +8 -8
- package/dist/esm/post-tooltip-trigger.entry.js +7 -7
- package/dist/esm/post-tooltip.entry.js +6 -6
- package/dist/esm/{required-D2rl2XZJ.js → required-CxvSCYJj.js} +1 -1
- package/dist/esm/{type-CGynDrfh.js → type-CYB7_Yi8.js} +1 -1
- package/dist/esm/{url-1wyUfUv-.js → url-DOwgyBfp.js} +1 -1
- package/dist/post-components/p-030bfaa1.entry.js +1 -0
- package/dist/post-components/p-1d67c427.entry.js +1 -0
- package/dist/post-components/{p-212c71e4.entry.js → p-2379e498.entry.js} +1 -1
- package/dist/post-components/p-29e6c2a4.entry.js +1 -0
- package/dist/post-components/{p-a01ea634.entry.js → p-2cb843f4.entry.js} +1 -1
- package/dist/post-components/{p-96bf6b01.entry.js → p-2ee255c1.entry.js} +1 -1
- package/dist/post-components/{p-b535fc10.entry.js → p-3a75186d.entry.js} +1 -1
- package/dist/post-components/{p-3149d866.entry.js → p-44718c1a.entry.js} +1 -1
- package/dist/post-components/{p-167191e5.entry.js → p-4e2bb082.entry.js} +1 -1
- package/dist/post-components/p-5a44b217.entry.js +1 -0
- package/dist/post-components/p-65e12f2c.entry.js +1 -0
- package/dist/post-components/p-665d877f.entry.js +1 -0
- package/dist/post-components/p-781efeb8.entry.js +1 -0
- package/dist/post-components/p-795eb5ad.entry.js +1 -0
- package/dist/post-components/p-894b20dd.entry.js +1 -0
- package/dist/post-components/p-9ad2216e.entry.js +1 -0
- package/dist/post-components/p-BEcxHjuM.js +1 -0
- package/dist/post-components/p-BmpkvdQk.js +1 -0
- package/dist/post-components/p-C-FunIfQ.js +1 -0
- package/dist/post-components/p-CCciE4QO.js +1 -0
- package/dist/post-components/p-D3NdvMgy.js +2 -0
- package/dist/post-components/p-I1j7a0bW.js +1 -0
- package/dist/post-components/p-Ny5VnydI.js +1 -0
- package/dist/post-components/p-X1vWfzMK.js +1 -0
- package/dist/post-components/{p-beed9922.entry.js → p-a9223467.entry.js} +1 -1
- package/dist/post-components/{p-e8d9723e.entry.js → p-b6e231a8.entry.js} +1 -1
- package/dist/post-components/{p-70fbe469.entry.js → p-b856263a.entry.js} +1 -1
- package/dist/post-components/p-bR8vy6-s.js +1 -0
- package/dist/post-components/{p-58422de1.entry.js → p-c7a39444.entry.js} +1 -1
- package/dist/post-components/p-cGcyMrvx.js +1 -0
- package/dist/post-components/{p-b99e6621.entry.js → p-cde00944.entry.js} +1 -1
- package/dist/post-components/p-cf7493ab.entry.js +1 -0
- package/dist/post-components/{p-e08d26f4.entry.js → p-e463e7ac.entry.js} +1 -1
- package/dist/post-components/{p-1cf5bc67.entry.js → p-e7f97f6d.entry.js} +1 -1
- package/dist/post-components/p-e8268a8d.entry.js +1 -0
- package/dist/post-components/{p-cf6eacab.entry.js → p-e8c19f72.entry.js} +1 -1
- package/dist/post-components/p-ecfc494e.entry.js +1 -0
- package/dist/post-components/p-eda4a376.entry.js +1 -0
- package/dist/post-components/{p-da217dbc.entry.js → p-ffec1880.entry.js} +1 -1
- package/dist/post-components/{p-DoNhJ2D7.js → p-sgCfAEQU.js} +1 -1
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-autocomplete/post-autocomplete.d.ts +18 -6
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +2 -1
- package/dist/types/components/post-banner/post-banner.d.ts +0 -1
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +4 -0
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +34 -11
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +1 -1
- package/dist/types/components/post-menu/post-menu.d.ts +1 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +8 -5
- package/dist/types/components.d.ts +20 -0
- package/dist/types/utils/breakpoints.d.ts +1 -0
- package/dist/types/utils/closable-target.d.ts +5 -0
- package/dist/types/utils/event-from.d.ts +8 -0
- package/dist/types/utils/floating-ui.d.ts +12 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/hydrate/index.js +908 -625
- package/hydrate/index.mjs +908 -625
- package/package.json +7 -6
- package/dist/components/react/p-BXqGI600.js +0 -1
- package/dist/components/react/p-B_WnO-QF.js +0 -1
- package/dist/components/react/p-BaB8wJvk.js +0 -1
- package/dist/components/react/p-Bji_4dfL.js +0 -1
- package/dist/components/react/p-CX2E_IXB.js +0 -1
- package/dist/components/react/p-D17tCsFk.js +0 -1
- package/dist/components/react/p-DD1c_IgL.js +0 -1
- package/dist/components/react/p-I0dqoE80.js +0 -1
- package/dist/components/react/p-rEfV4v4a.js +0 -1
- package/dist/components/react/p-tTf1w3A9.js +0 -1
- package/dist/post-components/p-0323b0f3.entry.js +0 -1
- package/dist/post-components/p-06ddd73b.entry.js +0 -1
- package/dist/post-components/p-090e52db.entry.js +0 -1
- package/dist/post-components/p-292a9784.entry.js +0 -1
- package/dist/post-components/p-2de6fe62.entry.js +0 -1
- package/dist/post-components/p-39ff8127.entry.js +0 -1
- package/dist/post-components/p-3a968b19.entry.js +0 -1
- package/dist/post-components/p-472_tiaS.js +0 -1
- package/dist/post-components/p-5873a90c.entry.js +0 -1
- package/dist/post-components/p-986fa1c1.entry.js +0 -1
- package/dist/post-components/p-BQ3HlJPr.js +0 -1
- package/dist/post-components/p-B_FOhVrp.js +0 -1
- package/dist/post-components/p-CeNqFJV7.js +0 -1
- package/dist/post-components/p-DYDdaLz-.js +0 -1
- package/dist/post-components/p-b1d2384a.entry.js +0 -1
- package/dist/post-components/p-bf83a3fb.entry.js +0 -1
- package/dist/post-components/p-c46bc56f.entry.js +0 -1
- package/dist/post-components/p-ce8132a9.entry.js +0 -1
- package/dist/post-components/p-d72e830b.entry.js +0 -1
- package/dist/post-components/p-rEfV4v4a.js +0 -1
- package/dist/post-components/p-sn7oKSwC.js +0 -2
- package/dist/post-components/p-tTf1w3A9.js +0 -1
|
@@ -1,20 +1,59 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, a as getElement, c as createEvent } from './index-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { r as registerInstance, h, H as Host, a as getElement, c as createEvent } from './index-D3NdvMgy.js';
|
|
2
|
+
import { b as breakpoint } from './breakpoints-I1j7a0bW.js';
|
|
3
|
+
import { f as findClosestAcrossShadow, E as EventFrom } from './event-from-BEcxHjuM.js';
|
|
4
|
+
import { v as version } from './package-Ny5VnydI.js';
|
|
5
|
+
import { O as OneOf } from './one-of-Mx4vYjem.js';
|
|
6
|
+
import { R as Required } from './required-CxvSCYJj.js';
|
|
6
7
|
import { f as fade } from './fade-DsgPYmAa.js';
|
|
7
|
-
import { E as EventFrom } from './event-from-rEfV4v4a.js';
|
|
8
8
|
import { g as getDeepFocusableChildren, a as getFocusableChildren } from './get-focusable-children-DxYnH2ye.js';
|
|
9
|
-
import {
|
|
9
|
+
import { t as throttle } from './index-bR8vy6-s.js';
|
|
10
|
+
import { T as Type } from './type-CYB7_Yi8.js';
|
|
10
11
|
import { n as nanoid } from './nanoid-8LXe8Zt_.js';
|
|
11
|
-
import { P as Pattern } from './pattern-
|
|
12
|
-
import { U as Url } from './url-
|
|
12
|
+
import { P as Pattern } from './pattern-CqQVrJPN.js';
|
|
13
|
+
import { U as Url } from './url-DOwgyBfp.js';
|
|
13
14
|
import { r as resolveEasing } from './utils-CoDiS_Ik.js';
|
|
14
15
|
import { f as fadeSlide } from './fade-slide-CvOvauo9.js';
|
|
15
16
|
import { P as PLACEMENT_TYPES } from './placement-DRiVosES.js';
|
|
16
17
|
import { g as getRoot } from './get-root-08F-DB-d.js';
|
|
17
|
-
import './create-validator-decorator-
|
|
18
|
+
import './create-validator-decorator-CbYxqPSB.js';
|
|
19
|
+
|
|
20
|
+
const CLOSABLE_TARGETS = [
|
|
21
|
+
{
|
|
22
|
+
predicate: el => el.localName === 'post-banner',
|
|
23
|
+
close: el => void el.dismiss(),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
predicate: el => el.localName === 'post-popover',
|
|
27
|
+
close: el => void el.hide(),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
predicate: el => el.localName === 'post-popovercontainer',
|
|
31
|
+
close: el => void el.hide(),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
predicate: el => el.localName === 'post-collapsible',
|
|
35
|
+
close: el => void el.toggle(false),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
predicate: el => el.localName === 'post-accordion-item',
|
|
39
|
+
close: el => void el.toggle(false),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
predicate: el => el.localName === 'dialog',
|
|
43
|
+
close: el => el.close(),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
predicate: el => el.hasAttribute('popover'),
|
|
47
|
+
close: el => el.togglePopover(false),
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
function findClosableTarget(start) {
|
|
51
|
+
const el = findClosestAcrossShadow(start, (el) => CLOSABLE_TARGETS.some(t => t.predicate(el)));
|
|
52
|
+
if (!el)
|
|
53
|
+
return null;
|
|
54
|
+
const match = CLOSABLE_TARGETS.find(t => t.predicate(el));
|
|
55
|
+
return { element: el, close: () => match.close(el) };
|
|
56
|
+
}
|
|
18
57
|
|
|
19
58
|
const BUTTON_TYPES = ['button', 'reset'];
|
|
20
59
|
const PLACEMENT = ['manual', 'auto'];
|
|
@@ -44,7 +83,7 @@ const PostClosebutton = class {
|
|
|
44
83
|
}
|
|
45
84
|
/**
|
|
46
85
|
* The "type" attribute used for the close button
|
|
47
|
-
|
|
86
|
+
|
|
48
87
|
*/
|
|
49
88
|
this.buttonType = 'button';
|
|
50
89
|
/**
|
|
@@ -55,6 +94,10 @@ const PostClosebutton = class {
|
|
|
55
94
|
* The size of the close button.
|
|
56
95
|
*/
|
|
57
96
|
this.size = 'default';
|
|
97
|
+
this.handleClick = () => {
|
|
98
|
+
const target = findClosableTarget(this.host);
|
|
99
|
+
target?.close();
|
|
100
|
+
};
|
|
58
101
|
}
|
|
59
102
|
componentDidLoad() {
|
|
60
103
|
if (globalThis.MutationObserver) {
|
|
@@ -79,13 +122,8 @@ const PostClosebutton = class {
|
|
|
79
122
|
console.error(`The \`${this.host.localName}\` component requires content for accessibility.`);
|
|
80
123
|
}
|
|
81
124
|
}
|
|
82
|
-
handleClick() {
|
|
83
|
-
if (this.buttonType === 'reset')
|
|
84
|
-
this.internals.form?.reset();
|
|
85
|
-
this.host.closest('dialog')?.close();
|
|
86
|
-
}
|
|
87
125
|
render() {
|
|
88
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: 'f46ba6cbd82793b2a3d3a72c2f89236f0904eb68', "data-version": version }, h("button", { key: 'd014e76ccce88a087f8dd9caaac002eb09f64699', type: this.buttonType, class: "btn btn-icon btn-secondary btn-sm", onClick: this.handleClick }, h("post-icon", { key: '442305b327aabe61f259b98694118ec1b4ed2f09', "aria-hidden": "true", name: "closex" }), h("span", { key: '530149339a2a983d1e5d23c149abd0faf6f912b5', ref: el => (this.visuallyHidden = el), class: "visually-hidden" }, h("slot", { key: 'b90d5bea08c70c6df33dc5fc74bcf06eb2b6cd14' })))));
|
|
89
127
|
}
|
|
90
128
|
static get formAssociated() { return true; }
|
|
91
129
|
get host() { return getElement(this); }
|
|
@@ -432,10 +470,10 @@ const PostHeader = class {
|
|
|
432
470
|
render() {
|
|
433
471
|
const onDesktop = this.device === 'desktop';
|
|
434
472
|
const onTabletAndMobile = this.device !== 'desktop';
|
|
435
|
-
return (h(Host, { key: '
|
|
473
|
+
return (h(Host, { key: '4ae4873c57cd307d3a4073f3d712bcf975528a90', "data-version": version, "data-color-scheme": "light", "data-burger-menu": this.hasBurgerMenu, "data-menu-extended": this.burgerMenuExtended }, h("header", { key: 'cbc743a8981f4bbc3d42807244d88edba88e6a6c' }, h("div", { key: 'f39c122246336d0de803353d9abb9e573459073e', class: "global-header" }, h("div", { key: 'a76628c6501851bbfd597e0106847da12dc0b705', class: "section" }, h("div", { key: 'b703c54159955ae272378aab5172f0bcd1b638d1', class: "logo" }, h("slot", { key: 'a55336f3bee22b2c9a2cb0426b5e04ba5c8f29c4', name: "post-logo" })), h("div", { key: '9b6db729465dae5c503d461a115af296730b2ce6', class: "sliding-controls" }, onDesktop && (h("div", { key: 'cf4124ae4aaf47c2445499ce08ebb15076ac4bf2', class: "audience" }, h("slot", { key: '830003c8b3b50abeb9d82bdfde83212f20a4da3d', name: "audience" }))), h("slot", { key: '458afb2da52853fbc9bc066fc487fcf77df0d2a0', name: "global-nav-primary" }), (onDesktop || !this.hasMainNav) && [
|
|
436
474
|
h("slot", { key: "global-nav-secondary", name: "global-nav-secondary" }),
|
|
437
475
|
h("slot", { key: "language-menu", name: "language-menu" }),
|
|
438
|
-
], h("slot", { key: '
|
|
476
|
+
], h("slot", { key: 'ffab20101950b7472c97ff0675f36903a6a66ebd', name: "post-login" }), onTabletAndMobile && this.hasMainNav && (h("post-togglebutton", { key: 'd1cb44efb5ae024bc225487be4e592a406acf138', class: "burger-button", ref: el => (this.burgerMenuButton = el), onClick: () => this.toggleBurgerMenu() }, h("span", { key: 'c33d2bb5c415f58829ad10026b9811684eac3d35' }, this.textMenu), h("post-icon", { key: '7acb3d93aec23ef1c1efd9c9d52832395e66abf0', "aria-hidden": "true", name: "burger", "data-showwhen": "untoggled" }), h("post-icon", { key: '7b6fb17d50df4474ddd282d7e202a43c324c3b87', "aria-hidden": "true", name: "closex", "data-showwhen": "toggled" })))))), h("div", { key: 'c7e6d91a0cd4a286b7186d0f41abdf9dc1e9ffd4', ref: el => (this.localHeader = el), class: { 'local-header': true, 'megadropdown-open': this.megadropdownOpen } }, h("div", { key: '670d00fb0a79ecc1f2bb45645887db13c7ea500f', class: "section" }, h("slot", { key: '5d3b0c9b97be561875fc908b2b7bf4d558513318', name: "side-nav" }), h("slot", { key: '39348fb8869f5623da026ed08ce69f727d9de7e6', name: "title" }), this.hasTitle && h("slot", { key: '883097731548de45adec9cbbf7df1c80a37b76b5', name: "local-nav" }), onDesktop && h("slot", { key: 'fbc77dee6ed73d8a13da75d3d695af80ce32c3af', name: "main-nav" }), onDesktop && !this.hasTitle && h("slot", { key: '94a989295ae04cd8259ba22e583d41bcb4701881', name: "local-nav" }))), this.hasBurgerMenu && this.renderBurgerMenu())));
|
|
439
477
|
}
|
|
440
478
|
get host() { return getElement(this); }
|
|
441
479
|
static get watchers() { return {
|
|
@@ -565,7 +603,7 @@ const PostIcon = class {
|
|
|
565
603
|
}).filter(([_key, value]) => value !== null));
|
|
566
604
|
}
|
|
567
605
|
render() {
|
|
568
|
-
return (h(Host, { key: '
|
|
606
|
+
return (h(Host, { key: '917a78dbe4db46244348298b08a2176c9028048e', "data-version": version }, h("span", { key: '06f07755212e2b6a9a5957d7fd37751c62343be6', style: this.getStyles() })));
|
|
569
607
|
}
|
|
570
608
|
get host() { return getElement(this); }
|
|
571
609
|
};
|
|
@@ -630,7 +668,7 @@ const PostLanguageMenu = class {
|
|
|
630
668
|
}
|
|
631
669
|
componentDidLoad() {
|
|
632
670
|
// Initially set variants and active language
|
|
633
|
-
// Handles cases where the language-menu is rendered after the language-
|
|
671
|
+
// Handles cases where the language-menu is rendered after the language-menu-items have been rendered
|
|
634
672
|
this.updateChildrenVariant();
|
|
635
673
|
}
|
|
636
674
|
/**
|
|
@@ -798,7 +836,7 @@ const PostLogo = class {
|
|
|
798
836
|
render() {
|
|
799
837
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
800
838
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
801
|
-
return (h(Host, { key: '
|
|
839
|
+
return (h(Host, { key: 'dd8ddb0dcbed8062ee5adecf2a26ad98b42c94b1', "data-version": version }, h(LogoTag, { key: 'f4d8ad34cdd455c3e2096ce26db7bc775d7e05c3', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: '87a58c2904f3dae5406b5652787ca1d99dbda0dc', class: "description" }, h("slot", { key: 'ae69c86c4bfed42b25aafa948f13989c31833466', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'e51164151a1a53971414ea37af5085f99575fc36', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: 'fa946d3ded62128ca4469b160103b464eb59329b', id: "Logo" }, h("rect", { key: '18424ee0ca3256f9169d8dac6223df3d49cb09b9', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '96381aeedbc8536fd551ec8ac4161db842b3bfc9', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: 'c1bbdb1bb687390d59ec2e6dcf83e80d1606582f', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
802
840
|
}
|
|
803
841
|
get host() { return getElement(this); }
|
|
804
842
|
};
|
|
@@ -938,7 +976,7 @@ const PostMainnavigation = class {
|
|
|
938
976
|
}, NAVBAR_DISABLE_DURATION);
|
|
939
977
|
}
|
|
940
978
|
render() {
|
|
941
|
-
return (h(Host, { key: '
|
|
979
|
+
return (h(Host, { key: '9fe43f86cab360591a15a033e0dc657096a69c00', version: version, class: this.canScroll ? 'scrollable' : '' }, h("div", { key: 'f68ea70e332336e99c0b51b19e33647b40fcfbb4', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: 'fac01a93fd7cbfe2548a4d049d59f0bc6d01af63', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: '7787a27e76350e9e86a97a58a20abe1286786ff7', ref: el => (this.navbar = el), "aria-label": this.textMain }, h("slot", { key: '357a8f5fe1e7b6bea5ae67d87c979f785ea24b82' })), h("div", { key: 'ce6091a9466fcd17aca39fcb5d6c204e1782c95d', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: '92d35b38a453326701a0837e6187abf82fa37bf4', "aria-hidden": "true", name: "chevronright" }))));
|
|
942
980
|
}
|
|
943
981
|
get host() { return getElement(this); }
|
|
944
982
|
};
|
|
@@ -1242,7 +1280,7 @@ const PostMegadropdown = class {
|
|
|
1242
1280
|
}
|
|
1243
1281
|
render() {
|
|
1244
1282
|
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
1245
|
-
return (h(Host, { key: '
|
|
1283
|
+
return (h(Host, { key: '2cc8228a628b2a0380acf4fcac8daa1ef1a7bf2f', version: version }, h("div", { key: '709fe50f23fd355bd97add916b451d5abf653780', ref: el => (this.animatedContainer = el), class: "megadropdown", style: containerStyle }, h("div", { key: 'e2bac29e70e39800ee55c8454f78b6889b241121', class: "section" }, this.device !== 'desktop' && this.megadropdownTitle && (h("p", { key: '6c28bc5d3e3b8c8dab385f13a4b9b8a7b7ba70b9', class: "megadropdown-title" }, this.megadropdownTitle)), h("div", { key: 'bf71d0d7b4a84ae1238f27373d195403d8a1f812', class: "megadropdown-content" }, h("slot", { key: '9812bec733ca678b1a3681d90859082e57fbd64a' })), this.device === 'desktop' ? (h("post-closebutton", { onClick: () => this.hide(true), class: "close-button", size: "small", placement: "manual" }, this.textClose)) : (h("button", { onClick: () => this.hide(true), class: "back-button" }, h("post-icon", { name: "arrowleft" }), this.textBack))))));
|
|
1246
1284
|
}
|
|
1247
1285
|
get host() { return getElement(this); }
|
|
1248
1286
|
};
|
|
@@ -1329,7 +1367,7 @@ const PostMegadropdownTrigger = class {
|
|
|
1329
1367
|
this.megadropdown.toggle();
|
|
1330
1368
|
}
|
|
1331
1369
|
render() {
|
|
1332
|
-
return (h(Host, { key: '
|
|
1370
|
+
return (h(Host, { key: 'd5242fd9126f3486f731ed6f369f3a6c38a5d1e9', "data-version": version }, h("button", { key: '6af086a50a9c788b35ba542531950b69a5e249da', ref: el => (this.interactiveButton = el), type: "button", "aria-haspopup": "menu", "aria-expanded": this.isMegadropdownExpanded.toString(), onClick: this.onClick.bind(this), onKeyDown: this.onKeyDown.bind(this), class: { active: this.active } }, h("span", { key: 'dacf0bd6dc576fa7c70353c98eacb3d81ddf83e5' }, h("span", { key: '0c7b950ea9bfcae62b367900d78f155edc49de72', innerHTML: this.slottedContent }), h("span", { key: '999325546eb3196f6e704ebeb18f436ff3d53756', "aria-hidden": "true" }, h("slot", { key: '08fa107b944a87edf156ea7d5e12692eba64952d' }))), h("post-icon", { key: 'eb32199b1ff6951b6025c1e4919674f5419f7d49', name: "chevrondown" }))));
|
|
1333
1371
|
}
|
|
1334
1372
|
get host() { return getElement(this); }
|
|
1335
1373
|
};
|
|
@@ -1460,17 +1498,32 @@ const PostMenu = class {
|
|
|
1460
1498
|
this.toggleMenu.emit(this.isVisible);
|
|
1461
1499
|
if (this.isVisible) {
|
|
1462
1500
|
this.lastFocusedElement = this.root?.activeElement;
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1501
|
+
// Only focus the first item if the trigger was keyboard-focus-visible
|
|
1502
|
+
// that's the browser's own signal for a keyboard-driven interaction.
|
|
1503
|
+
if (this.wasFocusVisible(this.lastFocusedElement)) {
|
|
1504
|
+
requestAnimationFrame(() => {
|
|
1505
|
+
const menuItems = this.getSlottedItems();
|
|
1506
|
+
if (menuItems.length > 0) {
|
|
1507
|
+
menuItems[0].focus();
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1469
1511
|
}
|
|
1470
1512
|
else if (this.lastFocusedElement) {
|
|
1471
1513
|
this.lastFocusedElement.focus();
|
|
1472
1514
|
}
|
|
1473
1515
|
}
|
|
1516
|
+
wasFocusVisible(element) {
|
|
1517
|
+
if (!element)
|
|
1518
|
+
return false;
|
|
1519
|
+
try {
|
|
1520
|
+
return element.matches(':focus-visible');
|
|
1521
|
+
}
|
|
1522
|
+
catch {
|
|
1523
|
+
// Not supported, fall back to always focusing
|
|
1524
|
+
return true;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1474
1527
|
controlKeyDownHandler(e) {
|
|
1475
1528
|
const menuItems = this.getSlottedItems();
|
|
1476
1529
|
if (menuItems.length === 0) {
|
|
@@ -1522,7 +1575,7 @@ const PostMenu = class {
|
|
|
1522
1575
|
]));
|
|
1523
1576
|
}
|
|
1524
1577
|
render() {
|
|
1525
|
-
return (h(Host, { key: '
|
|
1578
|
+
return (h(Host, { key: 'cc6ede4cdacb722006475de88385b041d7e42dcb', "data-version": version }, h("post-popovercontainer", { key: '3931f604aad477441112fd0b5a4800c8f034abbb', onPostShow: this.handlePostShown.bind(this), onPostBeforeToggle: this.handlePostBeforeToggle.bind(this), placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '1b0adb12bb1369d14a6bcfac3c956090eb66572a', part: "post-menu" }, h("slot", { key: '9c2518e7e9e6ccaa64d486a90b5fc7eec15c24b8', name: "header" }), h("slot", { key: 'd28df1e411010aabe083255cd5e5ece4bd62424d' })))));
|
|
1526
1579
|
}
|
|
1527
1580
|
get host() { return getElement(this); }
|
|
1528
1581
|
};
|
|
@@ -1621,7 +1674,7 @@ const PostMenuTrigger = class {
|
|
|
1621
1674
|
return null;
|
|
1622
1675
|
}
|
|
1623
1676
|
render() {
|
|
1624
|
-
return (h(Host, { key: '
|
|
1677
|
+
return (h(Host, { key: 'fcdfd58ba24cd5269461477ac3d00a53ccf2ea1b', "data-version": version }, h("slot", { key: 'b3a6b137bf61accd32eb1bec5af5e39e68ec6613' })));
|
|
1625
1678
|
}
|
|
1626
1679
|
get host() { return getElement(this); }
|
|
1627
1680
|
};
|
|
@@ -1636,6 +1689,7 @@ PostMenuTrigger.style = postMenuTriggerCss();
|
|
|
1636
1689
|
* @see https://floating-ui.com/docs/virtual-elements
|
|
1637
1690
|
*/
|
|
1638
1691
|
|
|
1692
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
1639
1693
|
const min = Math.min;
|
|
1640
1694
|
const max = Math.max;
|
|
1641
1695
|
const round = Math.round;
|
|
@@ -1728,12 +1782,12 @@ function getOppositePlacement(placement) {
|
|
|
1728
1782
|
return oppositeSideMap[side] + placement.slice(side.length);
|
|
1729
1783
|
}
|
|
1730
1784
|
function expandPaddingObject(padding) {
|
|
1785
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
1731
1786
|
return {
|
|
1732
|
-
top: 0,
|
|
1733
|
-
right: 0,
|
|
1734
|
-
bottom: 0,
|
|
1735
|
-
left: 0
|
|
1736
|
-
...padding
|
|
1787
|
+
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
1788
|
+
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
1789
|
+
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
1790
|
+
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
1737
1791
|
};
|
|
1738
1792
|
}
|
|
1739
1793
|
function getPaddingObject(padding) {
|
|
@@ -1808,13 +1862,9 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
1808
1862
|
y: reference.y
|
|
1809
1863
|
};
|
|
1810
1864
|
}
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
break;
|
|
1815
|
-
case 'end':
|
|
1816
|
-
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
1817
|
-
break;
|
|
1865
|
+
const alignment = getAlignment(placement);
|
|
1866
|
+
if (alignment) {
|
|
1867
|
+
coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
1818
1868
|
}
|
|
1819
1869
|
return coords;
|
|
1820
1870
|
}
|
|
@@ -1863,10 +1913,7 @@ async function detectOverflow(state, options) {
|
|
|
1863
1913
|
height: rects.floating.height
|
|
1864
1914
|
} : rects.reference;
|
|
1865
1915
|
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
1866
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)))
|
|
1867
|
-
x: 1,
|
|
1868
|
-
y: 1
|
|
1869
|
-
} : {
|
|
1916
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
1870
1917
|
x: 1,
|
|
1871
1918
|
y: 1
|
|
1872
1919
|
};
|
|
@@ -2039,17 +2086,16 @@ const arrow$1 = options => ({
|
|
|
2039
2086
|
|
|
2040
2087
|
// Make sure the arrow doesn't overflow the floating element if the center
|
|
2041
2088
|
// point is outside the floating element's bounds.
|
|
2042
|
-
const min$1 = minPadding;
|
|
2043
2089
|
const max = clientSize - arrowDimensions[length] - maxPadding;
|
|
2044
2090
|
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
2045
|
-
const offset = clamp(
|
|
2091
|
+
const offset = clamp(minPadding, center, max);
|
|
2046
2092
|
|
|
2047
2093
|
// If the reference is small enough that the arrow's padding causes it to
|
|
2048
2094
|
// to point to nothing for an aligned placement, adjust the offset of the
|
|
2049
2095
|
// floating element itself. To ensure `shift()` continues to take action,
|
|
2050
2096
|
// a single reset is performed when this is true.
|
|
2051
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center <
|
|
2052
|
-
const alignmentOffset = shouldAddOffset ? center <
|
|
2097
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
2098
|
+
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;
|
|
2053
2099
|
return {
|
|
2054
2100
|
[axis]: coords[axis] + alignmentOffset,
|
|
2055
2101
|
data: {
|
|
@@ -2196,6 +2242,76 @@ const flip$1 = function (options) {
|
|
|
2196
2242
|
};
|
|
2197
2243
|
};
|
|
2198
2244
|
|
|
2245
|
+
function getSideOffsets(overflow, rect) {
|
|
2246
|
+
return {
|
|
2247
|
+
top: overflow.top - rect.height,
|
|
2248
|
+
right: overflow.right - rect.width,
|
|
2249
|
+
bottom: overflow.bottom - rect.height,
|
|
2250
|
+
left: overflow.left - rect.width
|
|
2251
|
+
};
|
|
2252
|
+
}
|
|
2253
|
+
function isAnySideFullyClipped(overflow) {
|
|
2254
|
+
return sides.some(side => overflow[side] >= 0);
|
|
2255
|
+
}
|
|
2256
|
+
/**
|
|
2257
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
2258
|
+
* when it is not in the same clipping context as the reference element.
|
|
2259
|
+
* @see https://floating-ui.com/docs/hide
|
|
2260
|
+
*/
|
|
2261
|
+
const hide$1 = function (options) {
|
|
2262
|
+
if (options === void 0) {
|
|
2263
|
+
options = {};
|
|
2264
|
+
}
|
|
2265
|
+
return {
|
|
2266
|
+
name: 'hide',
|
|
2267
|
+
options,
|
|
2268
|
+
async fn(state) {
|
|
2269
|
+
const {
|
|
2270
|
+
rects,
|
|
2271
|
+
platform
|
|
2272
|
+
} = state;
|
|
2273
|
+
const {
|
|
2274
|
+
strategy = 'referenceHidden',
|
|
2275
|
+
...detectOverflowOptions
|
|
2276
|
+
} = evaluate(options, state);
|
|
2277
|
+
switch (strategy) {
|
|
2278
|
+
case 'referenceHidden':
|
|
2279
|
+
{
|
|
2280
|
+
const overflow = await platform.detectOverflow(state, {
|
|
2281
|
+
...detectOverflowOptions,
|
|
2282
|
+
elementContext: 'reference'
|
|
2283
|
+
});
|
|
2284
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
2285
|
+
return {
|
|
2286
|
+
data: {
|
|
2287
|
+
referenceHiddenOffsets: offsets,
|
|
2288
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
2289
|
+
}
|
|
2290
|
+
};
|
|
2291
|
+
}
|
|
2292
|
+
case 'escaped':
|
|
2293
|
+
{
|
|
2294
|
+
const overflow = await platform.detectOverflow(state, {
|
|
2295
|
+
...detectOverflowOptions,
|
|
2296
|
+
altBoundary: true
|
|
2297
|
+
});
|
|
2298
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
2299
|
+
return {
|
|
2300
|
+
data: {
|
|
2301
|
+
escapedOffsets: offsets,
|
|
2302
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
2303
|
+
}
|
|
2304
|
+
};
|
|
2305
|
+
}
|
|
2306
|
+
default:
|
|
2307
|
+
{
|
|
2308
|
+
return {};
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2199
2315
|
function getBoundingRect(rects) {
|
|
2200
2316
|
const minX = min(...rects.map(rect => rect.left));
|
|
2201
2317
|
const minY = min(...rects.map(rect => rect.top));
|
|
@@ -2252,12 +2368,19 @@ const inline$1 = function (options) {
|
|
|
2252
2368
|
y
|
|
2253
2369
|
} = evaluate(options, state);
|
|
2254
2370
|
const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
|
|
2371
|
+
|
|
2372
|
+
// No rects (e.g. a hidden or detached reference, or a collapsed range) —
|
|
2373
|
+
// keep the existing reference rect rather than resetting to an invalid
|
|
2374
|
+
// one with non-finite values.
|
|
2375
|
+
if (!nativeClientRects.length) {
|
|
2376
|
+
return {};
|
|
2377
|
+
}
|
|
2255
2378
|
const clientRects = getRectsByLine(nativeClientRects);
|
|
2256
2379
|
const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
|
|
2257
2380
|
const paddingObject = getPaddingObject(padding);
|
|
2258
2381
|
function getBoundingClientRect() {
|
|
2259
2382
|
// There are two rects and they are disjoined.
|
|
2260
|
-
if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
|
|
2383
|
+
if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {
|
|
2261
2384
|
// Find the first rect in which the point is fully inside.
|
|
2262
2385
|
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;
|
|
2263
2386
|
}
|
|
@@ -2272,18 +2395,12 @@ const inline$1 = function (options) {
|
|
|
2272
2395
|
const bottom = lastRect.bottom;
|
|
2273
2396
|
const left = isTop ? firstRect.left : lastRect.left;
|
|
2274
2397
|
const right = isTop ? firstRect.right : lastRect.right;
|
|
2275
|
-
|
|
2276
|
-
const height = bottom - top;
|
|
2277
|
-
return {
|
|
2278
|
-
top,
|
|
2279
|
-
bottom,
|
|
2280
|
-
left,
|
|
2281
|
-
right,
|
|
2282
|
-
width,
|
|
2283
|
-
height,
|
|
2398
|
+
return rectToClientRect({
|
|
2284
2399
|
x: left,
|
|
2285
|
-
y: top
|
|
2286
|
-
|
|
2400
|
+
y: top,
|
|
2401
|
+
width: right - left,
|
|
2402
|
+
height: bottom - top
|
|
2403
|
+
});
|
|
2287
2404
|
}
|
|
2288
2405
|
const isLeftSide = getSide(placement) === 'left';
|
|
2289
2406
|
const maxRight = max(...clientRects.map(rect => rect.right));
|
|
@@ -2291,20 +2408,12 @@ const inline$1 = function (options) {
|
|
|
2291
2408
|
const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
|
|
2292
2409
|
const top = measureRects[0].top;
|
|
2293
2410
|
const bottom = measureRects[measureRects.length - 1].bottom;
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
bottom,
|
|
2301
|
-
left,
|
|
2302
|
-
right,
|
|
2303
|
-
width,
|
|
2304
|
-
height,
|
|
2305
|
-
x: left,
|
|
2306
|
-
y: top
|
|
2307
|
-
};
|
|
2411
|
+
return rectToClientRect({
|
|
2412
|
+
x: minLeft,
|
|
2413
|
+
y: top,
|
|
2414
|
+
width: maxRight - minLeft,
|
|
2415
|
+
height: bottom - top
|
|
2416
|
+
});
|
|
2308
2417
|
}
|
|
2309
2418
|
return fallback;
|
|
2310
2419
|
}
|
|
@@ -2454,23 +2563,16 @@ const shift$1 = function (options) {
|
|
|
2454
2563
|
y
|
|
2455
2564
|
};
|
|
2456
2565
|
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
2457
|
-
const crossAxis = getSideAxis(
|
|
2566
|
+
const crossAxis = getSideAxis(placement);
|
|
2458
2567
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
2459
2568
|
let mainAxisCoord = coords[mainAxis];
|
|
2460
2569
|
let crossAxisCoord = coords[crossAxis];
|
|
2570
|
+
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);
|
|
2461
2571
|
if (checkMainAxis) {
|
|
2462
|
-
|
|
2463
|
-
const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
|
|
2464
|
-
const min = mainAxisCoord + overflow[minSide];
|
|
2465
|
-
const max = mainAxisCoord - overflow[maxSide];
|
|
2466
|
-
mainAxisCoord = clamp(min, mainAxisCoord, max);
|
|
2572
|
+
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
2467
2573
|
}
|
|
2468
2574
|
if (checkCrossAxis) {
|
|
2469
|
-
|
|
2470
|
-
const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
|
|
2471
|
-
const min = crossAxisCoord + overflow[minSide];
|
|
2472
|
-
const max = crossAxisCoord - overflow[maxSide];
|
|
2473
|
-
crossAxisCoord = clamp(min, crossAxisCoord, max);
|
|
2575
|
+
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
2474
2576
|
}
|
|
2475
2577
|
const limitedCoords = limiter.fn({
|
|
2476
2578
|
...state,
|
|
@@ -2501,6 +2603,7 @@ const limitShift$1 = function (options) {
|
|
|
2501
2603
|
return {
|
|
2502
2604
|
options,
|
|
2503
2605
|
fn(state) {
|
|
2606
|
+
var _rawOffset$mainAxis, _rawOffset$crossAxis;
|
|
2504
2607
|
const {
|
|
2505
2608
|
x,
|
|
2506
2609
|
y,
|
|
@@ -2526,9 +2629,8 @@ const limitShift$1 = function (options) {
|
|
|
2526
2629
|
mainAxis: rawOffset,
|
|
2527
2630
|
crossAxis: 0
|
|
2528
2631
|
} : {
|
|
2529
|
-
mainAxis: 0,
|
|
2530
|
-
crossAxis: 0
|
|
2531
|
-
...rawOffset
|
|
2632
|
+
mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
|
|
2633
|
+
crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
|
|
2532
2634
|
};
|
|
2533
2635
|
if (checkMainAxis) {
|
|
2534
2636
|
const len = mainAxis === 'y' ? 'height' : 'width';
|
|
@@ -2560,6 +2662,12 @@ const limitShift$1 = function (options) {
|
|
|
2560
2662
|
};
|
|
2561
2663
|
};
|
|
2562
2664
|
|
|
2665
|
+
// Method syntax keeps callback parameters bivariant, but expressing the
|
|
2666
|
+
// explicit `| undefined` required by `exactOptionalPropertyTypes` needs
|
|
2667
|
+
// property syntax, which is contravariant under `strictFunctionTypes`.
|
|
2668
|
+
// Extracting the function from a method position restores that bivariance so
|
|
2669
|
+
// consumers can still assign callbacks with narrower parameter types.
|
|
2670
|
+
|
|
2563
2671
|
/**
|
|
2564
2672
|
* Provides data that allows you to change the size of the floating element —
|
|
2565
2673
|
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
@@ -2574,7 +2682,6 @@ const size$1 = function (options) {
|
|
|
2574
2682
|
name: 'size',
|
|
2575
2683
|
options,
|
|
2576
2684
|
async fn(state) {
|
|
2577
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
2578
2685
|
const {
|
|
2579
2686
|
placement,
|
|
2580
2687
|
rects,
|
|
@@ -2606,24 +2713,21 @@ const size$1 = function (options) {
|
|
|
2606
2713
|
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
2607
2714
|
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
2608
2715
|
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
2609
|
-
const
|
|
2716
|
+
const shiftData = state.middlewareData.shift;
|
|
2717
|
+
const noShift = !shiftData;
|
|
2610
2718
|
let availableHeight = overflowAvailableHeight;
|
|
2611
2719
|
let availableWidth = overflowAvailableWidth;
|
|
2612
|
-
if (
|
|
2720
|
+
if (shiftData != null && shiftData.enabled.x) {
|
|
2613
2721
|
availableWidth = maximumClippingWidth;
|
|
2614
2722
|
}
|
|
2615
|
-
if (
|
|
2723
|
+
if (shiftData != null && shiftData.enabled.y) {
|
|
2616
2724
|
availableHeight = maximumClippingHeight;
|
|
2617
2725
|
}
|
|
2618
2726
|
if (noShift && !alignment) {
|
|
2619
|
-
const xMin = max(overflow.left, 0);
|
|
2620
|
-
const xMax = max(overflow.right, 0);
|
|
2621
|
-
const yMin = max(overflow.top, 0);
|
|
2622
|
-
const yMax = max(overflow.bottom, 0);
|
|
2623
2727
|
if (isYAxis) {
|
|
2624
|
-
availableWidth = width - 2 *
|
|
2728
|
+
availableWidth = width - 2 * max(overflow.left, overflow.right);
|
|
2625
2729
|
} else {
|
|
2626
|
-
availableHeight = height - 2 *
|
|
2730
|
+
availableHeight = height - 2 * max(overflow.top, overflow.bottom);
|
|
2627
2731
|
}
|
|
2628
2732
|
}
|
|
2629
2733
|
await apply({
|
|
@@ -2779,7 +2883,7 @@ function getParentNode(node) {
|
|
|
2779
2883
|
function getNearestOverflowAncestor(node) {
|
|
2780
2884
|
const parentNode = getParentNode(node);
|
|
2781
2885
|
if (isLastTraversableNode(parentNode)) {
|
|
2782
|
-
return node.ownerDocument
|
|
2886
|
+
return (node.ownerDocument || node).body;
|
|
2783
2887
|
}
|
|
2784
2888
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
2785
2889
|
return parentNode;
|
|
@@ -2876,10 +2980,7 @@ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
|
2876
2980
|
if (isFixed === void 0) {
|
|
2877
2981
|
isFixed = false;
|
|
2878
2982
|
}
|
|
2879
|
-
|
|
2880
|
-
return false;
|
|
2881
|
-
}
|
|
2882
|
-
return isFixed;
|
|
2983
|
+
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
|
|
2883
2984
|
}
|
|
2884
2985
|
|
|
2885
2986
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
@@ -2906,12 +3007,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
2906
3007
|
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
2907
3008
|
let width = clientRect.width / scale.x;
|
|
2908
3009
|
let height = clientRect.height / scale.y;
|
|
2909
|
-
if (domElement) {
|
|
3010
|
+
if (domElement && offsetParent) {
|
|
2910
3011
|
const win = getWindow(domElement);
|
|
2911
|
-
const offsetWin =
|
|
3012
|
+
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
2912
3013
|
let currentWin = win;
|
|
2913
3014
|
let currentIFrame = getFrameElement(currentWin);
|
|
2914
|
-
while (currentIFrame &&
|
|
3015
|
+
while (currentIFrame && offsetWin !== currentWin) {
|
|
2915
3016
|
const iframeScale = getScale(currentIFrame);
|
|
2916
3017
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
2917
3018
|
const css = getComputedStyle$1(currentIFrame);
|
|
@@ -2975,7 +3076,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
2975
3076
|
let scale = createCoords(1);
|
|
2976
3077
|
const offsets = createCoords(0);
|
|
2977
3078
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
2978
|
-
if (isOffsetParentAnElement || !
|
|
3079
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
2979
3080
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
2980
3081
|
scroll = getNodeScroll(offsetParent);
|
|
2981
3082
|
}
|
|
@@ -2996,18 +3097,17 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
2996
3097
|
}
|
|
2997
3098
|
|
|
2998
3099
|
function getClientRects(element) {
|
|
2999
|
-
return Array.from(element.getClientRects());
|
|
3100
|
+
return element.getClientRects ? Array.from(element.getClientRects()) : [];
|
|
3000
3101
|
}
|
|
3001
3102
|
|
|
3002
3103
|
// Gets the entire size of the scrollable document area, even extending outside
|
|
3003
3104
|
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
3004
|
-
function getDocumentRect(
|
|
3005
|
-
const
|
|
3006
|
-
const
|
|
3007
|
-
const body = element.ownerDocument.body;
|
|
3105
|
+
function getDocumentRect(html) {
|
|
3106
|
+
const scroll = getNodeScroll(html);
|
|
3107
|
+
const body = html.ownerDocument.body;
|
|
3008
3108
|
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
3009
3109
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
3010
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(
|
|
3110
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
|
|
3011
3111
|
const y = -scroll.scrollTop;
|
|
3012
3112
|
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
3013
3113
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
@@ -3024,7 +3124,11 @@ function getDocumentRect(element) {
|
|
|
3024
3124
|
// calculation is affected by unusual styles.
|
|
3025
3125
|
// Most scrollbars leave 15-18px of space.
|
|
3026
3126
|
const SCROLLBAR_MAX = 25;
|
|
3027
|
-
function getViewportRect(element, strategy) {
|
|
3127
|
+
function getViewportRect(element, strategy, rootBoundary) {
|
|
3128
|
+
if (rootBoundary === void 0) {
|
|
3129
|
+
rootBoundary = 'viewport';
|
|
3130
|
+
}
|
|
3131
|
+
const isLayoutViewport = rootBoundary === 'layoutViewport';
|
|
3028
3132
|
const win = getWindow(element);
|
|
3029
3133
|
const html = getDocumentElement(element);
|
|
3030
3134
|
const visualViewport = win.visualViewport;
|
|
@@ -3033,31 +3137,42 @@ function getViewportRect(element, strategy) {
|
|
|
3033
3137
|
let x = 0;
|
|
3034
3138
|
let y = 0;
|
|
3035
3139
|
if (visualViewport) {
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3140
|
+
// Client coordinates are relative to the layout viewport, except in
|
|
3141
|
+
// WebKit with an `absolute` strategy, where they are relative to the
|
|
3142
|
+
// visual viewport.
|
|
3143
|
+
const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';
|
|
3144
|
+
if (isLayoutViewport) {
|
|
3145
|
+
if (!layoutRelativeClientCoords) {
|
|
3146
|
+
x = -visualViewport.offsetLeft;
|
|
3147
|
+
y = -visualViewport.offsetTop;
|
|
3148
|
+
}
|
|
3149
|
+
} else {
|
|
3150
|
+
width = visualViewport.width;
|
|
3151
|
+
height = visualViewport.height;
|
|
3152
|
+
if (layoutRelativeClientCoords) {
|
|
3153
|
+
x = visualViewport.offsetLeft;
|
|
3154
|
+
y = visualViewport.offsetTop;
|
|
3155
|
+
}
|
|
3042
3156
|
}
|
|
3043
3157
|
}
|
|
3044
3158
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
3045
|
-
//
|
|
3046
|
-
// visual width
|
|
3047
|
-
//
|
|
3159
|
+
// `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks
|
|
3160
|
+
// the visual width but isn't reflected in `html.clientWidth`, so subtract it.
|
|
3161
|
+
// Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also
|
|
3162
|
+
// reserves an empty inline-start gutter that clips nothing, so exclude just
|
|
3163
|
+
// the one scrollbar-side gutter — halve the measured (two-gutter) total. A
|
|
3164
|
+
// left-side scrollbar (`windowScrollbarX > 0`) is already handled by
|
|
3165
|
+
// `getHTMLOffset`/`visualViewport.width`; skip it here.
|
|
3048
3166
|
if (windowScrollbarX <= 0) {
|
|
3049
3167
|
const doc = html.ownerDocument;
|
|
3050
3168
|
const body = doc.body;
|
|
3051
3169
|
const bodyStyles = getComputedStyle(body);
|
|
3052
3170
|
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
3053
|
-
const
|
|
3054
|
-
|
|
3055
|
-
|
|
3171
|
+
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
3172
|
+
const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;
|
|
3173
|
+
if (gutter <= SCROLLBAR_MAX) {
|
|
3174
|
+
width -= gutter;
|
|
3056
3175
|
}
|
|
3057
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
3058
|
-
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
3059
|
-
// by the scrollbar amount so there isn't extra space on the right.
|
|
3060
|
-
width += windowScrollbarX;
|
|
3061
3176
|
}
|
|
3062
3177
|
return {
|
|
3063
3178
|
width,
|
|
@@ -3072,7 +3187,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
3072
3187
|
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
3073
3188
|
const top = clientRect.top + element.clientTop;
|
|
3074
3189
|
const left = clientRect.left + element.clientLeft;
|
|
3075
|
-
const scale =
|
|
3190
|
+
const scale = getScale(element);
|
|
3076
3191
|
const width = element.clientWidth * scale.x;
|
|
3077
3192
|
const height = element.clientHeight * scale.y;
|
|
3078
3193
|
const x = left * scale.x;
|
|
@@ -3086,8 +3201,8 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
3086
3201
|
}
|
|
3087
3202
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
3088
3203
|
let rect;
|
|
3089
|
-
if (clippingAncestor === 'viewport') {
|
|
3090
|
-
rect = getViewportRect(element, strategy);
|
|
3204
|
+
if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {
|
|
3205
|
+
rect = getViewportRect(element, strategy, clippingAncestor);
|
|
3091
3206
|
} else if (clippingAncestor === 'document') {
|
|
3092
3207
|
rect = getDocumentRect(getDocumentElement(element));
|
|
3093
3208
|
} else if (isElement(clippingAncestor)) {
|
|
@@ -3103,13 +3218,6 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
3103
3218
|
}
|
|
3104
3219
|
return rectToClientRect(rect);
|
|
3105
3220
|
}
|
|
3106
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
3107
|
-
const parentNode = getParentNode(element);
|
|
3108
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
3109
|
-
return false;
|
|
3110
|
-
}
|
|
3111
|
-
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
3112
|
-
}
|
|
3113
3221
|
|
|
3114
3222
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
3115
3223
|
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
@@ -3120,7 +3228,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3120
3228
|
return cachedResult;
|
|
3121
3229
|
}
|
|
3122
3230
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
3123
|
-
let
|
|
3231
|
+
let lastKeptComputedStyle = null;
|
|
3124
3232
|
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
3125
3233
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
3126
3234
|
|
|
@@ -3128,16 +3236,20 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3128
3236
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
3129
3237
|
const computedStyle = getComputedStyle$1(currentNode);
|
|
3130
3238
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3239
|
+
// Position of the containing block chain below the current node. A fixed
|
|
3240
|
+
// element whose containing block hasn't been found yet is a fixed chain.
|
|
3241
|
+
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';
|
|
3242
|
+
|
|
3243
|
+
// A non-containing ancestor does not clip the element when the chain
|
|
3244
|
+
// below it escapes it: a fixed chain escapes all ancestors up to the
|
|
3245
|
+
// next containing block, an absolute chain escapes static ancestors.
|
|
3246
|
+
const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');
|
|
3135
3247
|
if (shouldDropCurrentNode) {
|
|
3136
3248
|
// Drop non-containing blocks.
|
|
3137
3249
|
result = result.filter(ancestor => ancestor !== currentNode);
|
|
3138
3250
|
} else {
|
|
3139
|
-
//
|
|
3140
|
-
|
|
3251
|
+
// The kept node carries the chain position for the next iteration.
|
|
3252
|
+
lastKeptComputedStyle = computedStyle;
|
|
3141
3253
|
}
|
|
3142
3254
|
currentNode = getParentNode(currentNode);
|
|
3143
3255
|
}
|
|
@@ -3147,7 +3259,7 @@ function getClippingElementAncestors(element, cache) {
|
|
|
3147
3259
|
|
|
3148
3260
|
// Gets the maximum area that the element is visible in due to any number of
|
|
3149
3261
|
// clipping ancestors.
|
|
3150
|
-
function getClippingRect(_ref) {
|
|
3262
|
+
function getClippingRect$1(_ref) {
|
|
3151
3263
|
let {
|
|
3152
3264
|
element,
|
|
3153
3265
|
boundary,
|
|
@@ -3197,13 +3309,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3197
3309
|
scrollTop: 0
|
|
3198
3310
|
};
|
|
3199
3311
|
const offsets = createCoords(0);
|
|
3200
|
-
|
|
3201
|
-
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
3202
|
-
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
3203
|
-
function setLeftRTLScrollbarOffset() {
|
|
3204
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
3205
|
-
}
|
|
3206
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
3312
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
3207
3313
|
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
3208
3314
|
scroll = getNodeScroll(offsetParent);
|
|
3209
3315
|
}
|
|
@@ -3211,12 +3317,13 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
3211
3317
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
3212
3318
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
3213
3319
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
3214
|
-
} else if (documentElement) {
|
|
3215
|
-
setLeftRTLScrollbarOffset();
|
|
3216
3320
|
}
|
|
3217
3321
|
}
|
|
3218
|
-
|
|
3219
|
-
|
|
3322
|
+
|
|
3323
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
3324
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
3325
|
+
if (!isOffsetParentAnElement && documentElement) {
|
|
3326
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
3220
3327
|
}
|
|
3221
3328
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
3222
3329
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
@@ -3301,7 +3408,7 @@ function isRTL(element) {
|
|
|
3301
3408
|
const platform = {
|
|
3302
3409
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
3303
3410
|
getDocumentElement,
|
|
3304
|
-
getClippingRect,
|
|
3411
|
+
getClippingRect: getClippingRect$1,
|
|
3305
3412
|
getOffsetParent,
|
|
3306
3413
|
getElementRects,
|
|
3307
3414
|
getClientRects,
|
|
@@ -3316,7 +3423,7 @@ function rectsAreEqual(a, b) {
|
|
|
3316
3423
|
}
|
|
3317
3424
|
|
|
3318
3425
|
// https://samthor.au/2021/observing-dom/
|
|
3319
|
-
function observeMove(element, onMove) {
|
|
3426
|
+
function observeMove(element, onMove, ancestorResize) {
|
|
3320
3427
|
let io = null;
|
|
3321
3428
|
let timeoutId;
|
|
3322
3429
|
const root = getDocumentElement(element);
|
|
@@ -3359,13 +3466,22 @@ function observeMove(element, onMove) {
|
|
|
3359
3466
|
let isFirstUpdate = true;
|
|
3360
3467
|
function handleObserve(entries) {
|
|
3361
3468
|
const ratio = entries[0].intersectionRatio;
|
|
3469
|
+
|
|
3470
|
+
// The entry is a snapshot, so the reference may have moved since the
|
|
3471
|
+
// intersection was computed (under performance constraints, or between
|
|
3472
|
+
// consecutive frames of a multi-frame layout shift). The reported ratio
|
|
3473
|
+
// and the observed area are stale in that case and cannot be trusted to
|
|
3474
|
+
// detect subsequent movement, so refresh regardless of the ratio.
|
|
3475
|
+
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3476
|
+
return refresh();
|
|
3477
|
+
}
|
|
3362
3478
|
if (ratio !== threshold) {
|
|
3363
3479
|
if (!isFirstUpdate) {
|
|
3364
3480
|
return refresh();
|
|
3365
3481
|
}
|
|
3366
3482
|
if (!ratio) {
|
|
3367
|
-
// If the reference is clipped, the ratio is 0. Throttle
|
|
3368
|
-
// to prevent an infinite loop of updates.
|
|
3483
|
+
// If the reference is clipped in place, the ratio is 0. Throttle
|
|
3484
|
+
// the refresh to prevent an infinite loop of updates.
|
|
3369
3485
|
timeoutId = setTimeout(() => {
|
|
3370
3486
|
refresh(false, 1e-7);
|
|
3371
3487
|
}, 1000);
|
|
@@ -3373,16 +3489,6 @@ function observeMove(element, onMove) {
|
|
|
3373
3489
|
refresh(false, ratio);
|
|
3374
3490
|
}
|
|
3375
3491
|
}
|
|
3376
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3377
|
-
// It's possible that even though the ratio is reported as 1, the
|
|
3378
|
-
// element is not actually fully within the IntersectionObserver's root
|
|
3379
|
-
// area anymore. This can happen under performance constraints. This may
|
|
3380
|
-
// be a bug in the browser's IntersectionObserver implementation. To
|
|
3381
|
-
// work around this, we compare the element's bounding rect now with
|
|
3382
|
-
// what it was at the time we created the IntersectionObserver. If they
|
|
3383
|
-
// are not equal then the element moved, so we refresh.
|
|
3384
|
-
refresh();
|
|
3385
|
-
}
|
|
3386
3492
|
isFirstUpdate = false;
|
|
3387
3493
|
}
|
|
3388
3494
|
|
|
@@ -3399,8 +3505,18 @@ function observeMove(element, onMove) {
|
|
|
3399
3505
|
}
|
|
3400
3506
|
io.observe(element);
|
|
3401
3507
|
}
|
|
3508
|
+
const win = getWindow(element);
|
|
3509
|
+
// The window is a resize ancestor, so when `ancestorResize` is enabled its
|
|
3510
|
+
// listener already runs the update on resize. Here we only need to rebuild
|
|
3511
|
+
// the `IntersectionObserver` for the new root size, skipping a redundant
|
|
3512
|
+
// update. When `ancestorResize` is disabled, this becomes the sole update.
|
|
3513
|
+
const handleResize = () => refresh(ancestorResize);
|
|
3514
|
+
win.addEventListener('resize', handleResize);
|
|
3402
3515
|
refresh(true);
|
|
3403
|
-
return
|
|
3516
|
+
return () => {
|
|
3517
|
+
win.removeEventListener('resize', handleResize);
|
|
3518
|
+
cleanup();
|
|
3519
|
+
};
|
|
3404
3520
|
}
|
|
3405
3521
|
|
|
3406
3522
|
/**
|
|
@@ -3425,12 +3541,10 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3425
3541
|
const referenceEl = unwrapElement(reference);
|
|
3426
3542
|
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];
|
|
3427
3543
|
ancestors.forEach(ancestor => {
|
|
3428
|
-
ancestorScroll && ancestor.addEventListener('scroll', update
|
|
3429
|
-
passive: true
|
|
3430
|
-
});
|
|
3544
|
+
ancestorScroll && ancestor.addEventListener('scroll', update);
|
|
3431
3545
|
ancestorResize && ancestor.addEventListener('resize', update);
|
|
3432
3546
|
});
|
|
3433
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
3547
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
|
|
3434
3548
|
let reobserveFrame = -1;
|
|
3435
3549
|
let resizeObserver = null;
|
|
3436
3550
|
if (elementResize) {
|
|
@@ -3516,6 +3630,13 @@ const flip = flip$1;
|
|
|
3516
3630
|
*/
|
|
3517
3631
|
const size = size$1;
|
|
3518
3632
|
|
|
3633
|
+
/**
|
|
3634
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
3635
|
+
* when it is not in the same clipping context as the reference element.
|
|
3636
|
+
* @see https://floating-ui.com/docs/hide
|
|
3637
|
+
*/
|
|
3638
|
+
const hide = hide$1;
|
|
3639
|
+
|
|
3519
3640
|
/**
|
|
3520
3641
|
* Provides data to position an inner element of the floating element so that it
|
|
3521
3642
|
* appears centered to the reference element.
|
|
@@ -3544,11 +3665,9 @@ const computePosition = (reference, floating, options) => {
|
|
|
3544
3665
|
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
3545
3666
|
// single call. If other functions become expensive, we can add them as well.
|
|
3546
3667
|
const cache = new Map();
|
|
3547
|
-
const mergedOptions = {
|
|
3548
|
-
platform,
|
|
3549
|
-
...options
|
|
3550
|
-
};
|
|
3668
|
+
const mergedOptions = options != null ? options : {};
|
|
3551
3669
|
const platformWithCache = {
|
|
3670
|
+
...platform,
|
|
3552
3671
|
...mergedOptions.platform,
|
|
3553
3672
|
_c: cache
|
|
3554
3673
|
};
|
|
@@ -4365,6 +4484,77 @@ function apply() {
|
|
|
4365
4484
|
injectStyles(document);
|
|
4366
4485
|
}
|
|
4367
4486
|
|
|
4487
|
+
/**
|
|
4488
|
+
* This utility is covered by the end-to-end tests under 'clipping' in `popovercontainer.cy.ts`.
|
|
4489
|
+
*/
|
|
4490
|
+
const CLIPPING_RECT_CACHE = Symbol('Clipping Rect Cache');
|
|
4491
|
+
/**
|
|
4492
|
+
* A custom floating UI platform that restricts clipping rectangles to the safe area.
|
|
4493
|
+
*/
|
|
4494
|
+
const safeAreaPlatform = { ...platform, getClippingRect };
|
|
4495
|
+
/**
|
|
4496
|
+
* Computes the clipping rectangle of an element while accounting for the safe area.
|
|
4497
|
+
*/
|
|
4498
|
+
async function getClippingRect(...args) {
|
|
4499
|
+
const element = args[0].element;
|
|
4500
|
+
// Check whether the clipping rectangle of the given element has already been computed during
|
|
4501
|
+
// this pass.
|
|
4502
|
+
const hit = this[CLIPPING_RECT_CACHE].get(element);
|
|
4503
|
+
if (hit)
|
|
4504
|
+
return hit;
|
|
4505
|
+
// Compute the clipping rectangle with the Floating UI DOM platform, then restrict it to the safe
|
|
4506
|
+
// area.
|
|
4507
|
+
const clippingRect = await platform.getClippingRect.apply(this, args);
|
|
4508
|
+
applySafeArea(clippingRect, element);
|
|
4509
|
+
this[CLIPPING_RECT_CACHE].set(element, clippingRect);
|
|
4510
|
+
return clippingRect;
|
|
4511
|
+
}
|
|
4512
|
+
/**
|
|
4513
|
+
* Restricts the `clippingRect` computed for `element` to the safe area, modifying it in place.
|
|
4514
|
+
*
|
|
4515
|
+
* The safe area only applies to elements that the header can actually cover, which excludes
|
|
4516
|
+
* elements without a header on their page, elements on a top layer and elements within the header.
|
|
4517
|
+
*/
|
|
4518
|
+
function applySafeArea(clippingRect, element) {
|
|
4519
|
+
const headerElement = element.ownerDocument.querySelector('post-header');
|
|
4520
|
+
if (headerElement === null)
|
|
4521
|
+
return;
|
|
4522
|
+
let parent = element;
|
|
4523
|
+
while (!isLastTraversableNode(parent)) {
|
|
4524
|
+
parent = getParentNode(parent);
|
|
4525
|
+
if (!isHTMLElement(parent))
|
|
4526
|
+
continue;
|
|
4527
|
+
// Do not apply the safe area of the header to
|
|
4528
|
+
// - elements that are on a top layer, such as a dialog.
|
|
4529
|
+
// - elements that are located within the header itself.
|
|
4530
|
+
if (isTopLayer(parent) || parent === headerElement)
|
|
4531
|
+
return;
|
|
4532
|
+
}
|
|
4533
|
+
const headerRect = headerElement.getBoundingClientRect();
|
|
4534
|
+
const top = Math.max(clippingRect.y, headerRect.bottom);
|
|
4535
|
+
clippingRect.height -= top - clippingRect.y;
|
|
4536
|
+
clippingRect.y = top;
|
|
4537
|
+
}
|
|
4538
|
+
/**
|
|
4539
|
+
* Computes the coordinates that will position the `floating` element next to a given `reference`
|
|
4540
|
+
* element while accounting for the safe area.
|
|
4541
|
+
*
|
|
4542
|
+
* The safe area is the part of the viewport that the header does not cover. Restricting the
|
|
4543
|
+
* clipping rectangles to it makes floating elements behave as if they were clipped by the header.
|
|
4544
|
+
*/
|
|
4545
|
+
const computePositionWithSafeArea = (reference, floating, options) => {
|
|
4546
|
+
// Adapted from https://github.com/floating-ui/floating-ui/blob/27629b74ba36ab8ceb2a968051927b9b69511a3b/packages/dom/src/index.ts#L15
|
|
4547
|
+
options ?? (options = {});
|
|
4548
|
+
return computePosition(reference, floating, {
|
|
4549
|
+
...options,
|
|
4550
|
+
platform: {
|
|
4551
|
+
...safeAreaPlatform,
|
|
4552
|
+
...options.platform,
|
|
4553
|
+
[CLIPPING_RECT_CACHE]: new Map(),
|
|
4554
|
+
},
|
|
4555
|
+
});
|
|
4556
|
+
};
|
|
4557
|
+
|
|
4368
4558
|
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{box-shadow:var(--post-device-elevation-300);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]{border-block-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]{border-block-start: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]{border-block-end: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]{border-block-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{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{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{box-shadow:var(--post-device-elevation-300)}:host(:has(.arrow))>div{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{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{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{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))}`;
|
|
4369
4559
|
|
|
4370
4560
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -4442,7 +4632,7 @@ const PostPopovercontainer = class {
|
|
|
4442
4632
|
if (this.toggleTimeoutId || !target)
|
|
4443
4633
|
return;
|
|
4444
4634
|
this.eventTarget = target;
|
|
4445
|
-
this.
|
|
4635
|
+
this.updatePosition();
|
|
4446
4636
|
this.host.showPopover();
|
|
4447
4637
|
}
|
|
4448
4638
|
/**
|
|
@@ -4468,7 +4658,7 @@ const PostPopovercontainer = class {
|
|
|
4468
4658
|
this.eventTarget = target;
|
|
4469
4659
|
// Prevent instant double toggle
|
|
4470
4660
|
if (!this.toggleTimeoutId) {
|
|
4471
|
-
this.
|
|
4661
|
+
this.updatePosition();
|
|
4472
4662
|
this.host.togglePopover(force);
|
|
4473
4663
|
this.toggleTimeoutId = null;
|
|
4474
4664
|
}
|
|
@@ -4580,17 +4770,14 @@ const PostPopovercontainer = class {
|
|
|
4580
4770
|
startAutoupdates() {
|
|
4581
4771
|
if (!this.eventTarget || !this.host)
|
|
4582
4772
|
return;
|
|
4583
|
-
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.
|
|
4584
|
-
}
|
|
4585
|
-
/**
|
|
4586
|
-
* Retrieves the dynamic height of the header
|
|
4587
|
-
*/
|
|
4588
|
-
getHeaderHeight() {
|
|
4589
|
-
const header = document.querySelector('post-header');
|
|
4590
|
-
return header ? Number.parseFloat(getComputedStyle(header).height) : 0;
|
|
4773
|
+
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.updatePosition.bind(this));
|
|
4591
4774
|
}
|
|
4592
|
-
async
|
|
4593
|
-
const { x, y, middlewareData, placement } = await this.
|
|
4775
|
+
async updatePosition() {
|
|
4776
|
+
const { x, y, middlewareData, placement } = await this.calculatePosition();
|
|
4777
|
+
// Hide the popover if the target is outside the viewport
|
|
4778
|
+
if (middlewareData.hide?.referenceHidden) {
|
|
4779
|
+
this.host.hidePopover();
|
|
4780
|
+
}
|
|
4594
4781
|
const currentPlacement = placement.split('-')[0];
|
|
4595
4782
|
this.dynamicPlacement = currentPlacement;
|
|
4596
4783
|
// Position popover
|
|
@@ -4615,13 +4802,15 @@ const PostPopovercontainer = class {
|
|
|
4615
4802
|
await this.updateSafeSpaceBoundaries(currentPlacement);
|
|
4616
4803
|
}
|
|
4617
4804
|
}
|
|
4618
|
-
async
|
|
4805
|
+
async calculatePosition() {
|
|
4619
4806
|
const gap = this.edgeGap;
|
|
4620
4807
|
const isAligned = (this.placement || 'top').includes('-');
|
|
4621
|
-
const flipMiddleware =
|
|
4622
|
-
|
|
4623
|
-
crossAxis: false,
|
|
4624
|
-
|
|
4808
|
+
const flipMiddleware = [
|
|
4809
|
+
// Flip the popover if the target moves outside the viewport
|
|
4810
|
+
flip({ elementContext: 'reference', crossAxis: false }),
|
|
4811
|
+
// Flip the popover if the popover itself moves outside the viewport
|
|
4812
|
+
flip({ elementContext: 'floating', crossAxis: false }),
|
|
4813
|
+
];
|
|
4625
4814
|
const shiftMiddleware = shift({
|
|
4626
4815
|
padding: gap,
|
|
4627
4816
|
limiter: limitShift({
|
|
@@ -4633,7 +4822,7 @@ const PostPopovercontainer = class {
|
|
|
4633
4822
|
inline(),
|
|
4634
4823
|
// Per floating-ui docs: for aligned placements (e.g. bottom-end),
|
|
4635
4824
|
// flip should come before shift. For non-aligned, shift before flip.
|
|
4636
|
-
...(isAligned ? [flipMiddleware, shiftMiddleware] : [shiftMiddleware, flipMiddleware]),
|
|
4825
|
+
...(isAligned ? [...flipMiddleware, shiftMiddleware] : [shiftMiddleware, ...flipMiddleware]),
|
|
4637
4826
|
size({
|
|
4638
4827
|
apply({ availableWidth, elements }) {
|
|
4639
4828
|
Object.assign(elements.floating.style, {
|
|
@@ -4645,7 +4834,12 @@ const PostPopovercontainer = class {
|
|
|
4645
4834
|
if (this.arrow) {
|
|
4646
4835
|
middleware.push(arrow({ element: this.arrowRef, padding: gap }));
|
|
4647
4836
|
}
|
|
4648
|
-
|
|
4837
|
+
// Automatically hide the popover if the target moves outside the scrollport.
|
|
4838
|
+
if (this.autoHide) {
|
|
4839
|
+
// Per floating-ui docs: hide should generally be placed at the end.
|
|
4840
|
+
middleware.push(hide({ strategy: 'referenceHidden' }));
|
|
4841
|
+
}
|
|
4842
|
+
return computePositionWithSafeArea(this.eventTarget, this.host, {
|
|
4649
4843
|
placement: this.placement || 'top',
|
|
4650
4844
|
strategy: 'fixed',
|
|
4651
4845
|
middleware,
|
|
@@ -4712,9 +4906,9 @@ const PostPopovercontainer = class {
|
|
|
4712
4906
|
}
|
|
4713
4907
|
}
|
|
4714
4908
|
render() {
|
|
4715
|
-
return (h(Host, { key: '
|
|
4909
|
+
return (h(Host, { key: 'a6f41ad3ef982f9e9ec0d6450837d1cfdca73d16', "data-version": version, popover: "auto" }, h("div", { key: '40afab436d5550fda44c8995139080161eab5b09', part: "post-popovercontainer-content", class: "popover-content" }, this.arrow && (h("span", { key: '580bd8fcaecb89334aca05001137a4d7cccd254a', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
4716
4910
|
this.arrowRef = el;
|
|
4717
|
-
} })), h("span", { key: '
|
|
4911
|
+
} })), h("span", { key: '61a6e4e8026832afc188edd5a74535716db65945', part: "post-popovercontainer-border-mask" }), h("slot", { key: 'd79cb69a77dbba13ffa3c30e0393db4f3a669a12' }))));
|
|
4718
4912
|
}
|
|
4719
4913
|
get host() { return getElement(this); }
|
|
4720
4914
|
};
|
|
@@ -4778,7 +4972,7 @@ const PostTogglebutton = class {
|
|
|
4778
4972
|
});
|
|
4779
4973
|
}
|
|
4780
4974
|
render() {
|
|
4781
|
-
return (h(Host, { key: '
|
|
4975
|
+
return (h(Host, { key: 'ae46e9fcd82766abcf76c4b37d0341cfd29f2f4f', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '9c71c065225f0f5c68e76fa2cec6d75bdf29fed0' })));
|
|
4782
4976
|
}
|
|
4783
4977
|
get host() { return getElement(this); }
|
|
4784
4978
|
};
|