@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
|
@@ -120,17 +120,32 @@ export class PostMenu {
|
|
|
120
120
|
this.toggleMenu.emit(this.isVisible);
|
|
121
121
|
if (this.isVisible) {
|
|
122
122
|
this.lastFocusedElement = this.root?.activeElement;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
// Only focus the first item if the trigger was keyboard-focus-visible
|
|
124
|
+
// that's the browser's own signal for a keyboard-driven interaction.
|
|
125
|
+
if (this.wasFocusVisible(this.lastFocusedElement)) {
|
|
126
|
+
requestAnimationFrame(() => {
|
|
127
|
+
const menuItems = this.getSlottedItems();
|
|
128
|
+
if (menuItems.length > 0) {
|
|
129
|
+
menuItems[0].focus();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
129
133
|
}
|
|
130
134
|
else if (this.lastFocusedElement) {
|
|
131
135
|
this.lastFocusedElement.focus();
|
|
132
136
|
}
|
|
133
137
|
}
|
|
138
|
+
wasFocusVisible(element) {
|
|
139
|
+
if (!element)
|
|
140
|
+
return false;
|
|
141
|
+
try {
|
|
142
|
+
return element.matches(':focus-visible');
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// Not supported, fall back to always focusing
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
134
149
|
controlKeyDownHandler(e) {
|
|
135
150
|
const menuItems = this.getSlottedItems();
|
|
136
151
|
if (menuItems.length === 0) {
|
|
@@ -184,7 +199,7 @@ export class PostMenu {
|
|
|
184
199
|
]));
|
|
185
200
|
}
|
|
186
201
|
render() {
|
|
187
|
-
return (h(Host, { key: '
|
|
202
|
+
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' })))));
|
|
188
203
|
}
|
|
189
204
|
static get is() { return "post-menu"; }
|
|
190
205
|
static get encapsulation() { return "shadow"; }
|
|
@@ -210,7 +225,7 @@ export class PostMenu {
|
|
|
210
225
|
"Placement": {
|
|
211
226
|
"location": "import",
|
|
212
227
|
"path": "@floating-ui/dom",
|
|
213
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.
|
|
228
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts::Placement",
|
|
214
229
|
"referenceLocation": "Placement"
|
|
215
230
|
}
|
|
216
231
|
}
|
|
@@ -65,7 +65,7 @@ export class PostMenuTrigger {
|
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
67
|
render() {
|
|
68
|
-
return (h(Host, { key: '
|
|
68
|
+
return (h(Host, { key: 'fcdfd58ba24cd5269461477ac3d00a53ccf2ea1b', "data-version": version }, h("slot", { key: 'b3a6b137bf61accd32eb1bec5af5e39e68ec6613' })));
|
|
69
69
|
}
|
|
70
70
|
static get is() { return "post-menu-trigger"; }
|
|
71
71
|
static get encapsulation() { return "shadow"; }
|
|
@@ -89,10 +89,10 @@ export class PostNumberInput {
|
|
|
89
89
|
}
|
|
90
90
|
render() {
|
|
91
91
|
const areButtonsShown = !!this.input;
|
|
92
|
-
return (h(Host, { key: '
|
|
92
|
+
return (h(Host, { key: 'aeb366d1738707172f9ae3e154f9a93a10caa016', "data-version": version, class: {
|
|
93
93
|
'number-input-sm': this.small,
|
|
94
94
|
'disabled': this.isDisabled,
|
|
95
|
-
} }, areButtonsShown && (h("div", { key: '
|
|
95
|
+
} }, areButtonsShown && (h("div", { key: '9037651a4e2f65ca62f1f4ebe0575a25383c77c7', "aria-hidden": "true", onPointerDown: () => this.step('down'), class: { 'step-button': true, 'disabled': this.isDecrementDisabled } }, h("post-icon", { key: '43ac843cc7df50981dc92eeb5405b415d530a415', name: "minus" }))), h("div", { key: 'f49907424a6cc6802ee9066ef42dcc2c43b1bbfd', class: "input-container" }, h("slot", { key: 'f649b968dac37fbb5f5a643853aedbc90653ed6c', onSlotchange: () => this.setupInput() })), areButtonsShown && (h("div", { key: '66d06189252e360f43c3e63fbdce300be9606069', "aria-hidden": "true", onPointerDown: () => this.step('up'), class: { 'step-button': true, 'disabled': this.isIncrementDisabled } }, h("post-icon", { key: '44bcff6c698f87eac09d1aeaa8b6af6436cac572', name: "plus" })))));
|
|
96
96
|
}
|
|
97
97
|
static get is() { return "post-number-input"; }
|
|
98
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*{box-sizing:border-box}:host{display:contents}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:8px;min-width:160px;max-width:var(--post-popover-max-width, 280px)}.popover-content{padding:8px;flex-grow:1}
|
|
1
|
+
*{box-sizing:border-box}:host{display:contents}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:8px;min-width:160px;max-width:var(--post-popover-max-width, 280px)}.popover-content{padding:8px;flex-grow:1}post-closebutton{color-scheme:light}
|
|
@@ -83,10 +83,10 @@ export class PostPopover {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: '61399669708d5983911748d652ef1a0d7e0562a0', "data-version": version }, h("post-popovercontainer", { key: '561bbe71d735acec27421160623169f7f7f8134e', arrow: this.arrow, placement: this.placement, edgeGap: this.edgeGap, autoHide: true, ref: e => {
|
|
87
87
|
if (e)
|
|
88
88
|
this.popoverRef = e;
|
|
89
|
-
} }, h("div", { key: '
|
|
89
|
+
} }, h("div", { key: 'f7e8d0ae5556cfd429c43b12c3d3d0b19e3cdd46', class: "popover-container" }, h("div", { key: '74c9076d67696ff1d1a295560140864b26f59f60', class: "popover-content" }, h("slot", { key: '5c63af09f545ed7fe3fcfd810fccd7db9da05e8a' })), h("post-closebutton", { key: 'f8fd8c7ba548b912c3fe84994810add92fb470d9' }, this.textClose)))));
|
|
90
90
|
}
|
|
91
91
|
static get is() { return "post-popover"; }
|
|
92
92
|
static get encapsulation() { return "shadow"; }
|
|
@@ -112,7 +112,7 @@ export class PostPopover {
|
|
|
112
112
|
"Placement": {
|
|
113
113
|
"location": "import",
|
|
114
114
|
"path": "@floating-ui/dom",
|
|
115
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.
|
|
115
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts::Placement",
|
|
116
116
|
"referenceLocation": "Placement"
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -72,7 +72,7 @@ export class PostPopoverTrigger {
|
|
|
72
72
|
focusTrigger() {
|
|
73
73
|
// Restores focus to the trigger
|
|
74
74
|
if (!this.popoverOpen && this.trigger) {
|
|
75
|
-
this.trigger.focus();
|
|
75
|
+
this.trigger.focus({ preventScroll: true });
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
constructor() {
|
|
@@ -107,7 +107,7 @@ export class PostPopoverTrigger {
|
|
|
107
107
|
this.popover?.removeEventListener('postToggle', this.boundHandlePostToggle);
|
|
108
108
|
}
|
|
109
109
|
render() {
|
|
110
|
-
return (h(Host, { key: '
|
|
110
|
+
return (h(Host, { key: 'a8a3be80d30404564add3fcbef1a24b4f59d4614', "data-version": version }, h("slot", { key: '1fada9d0241aa9e8ab6392e63feb61dc2c686dd5', onSlotchange: () => this.setupTrigger() })));
|
|
111
111
|
}
|
|
112
112
|
static get is() { return "post-popover-trigger"; }
|
|
113
113
|
static get encapsulation() { return "shadow"; }
|
|
@@ -12,10 +12,11 @@ import { Build, h, Host, } from "@stencil/core";
|
|
|
12
12
|
import { OneOf, Type } from "../../utils/index";
|
|
13
13
|
import { version } from "../../../../package";
|
|
14
14
|
import { PLACEMENT_TYPES } from "../../types/index";
|
|
15
|
-
import { arrow, autoUpdate,
|
|
15
|
+
import { arrow, autoUpdate, flip, hide, inline, limitShift, offset, shift, size, } from "@floating-ui/dom";
|
|
16
16
|
// Polyfill for popovers, can be removed when https://caniuse.com/?search=popover is green
|
|
17
17
|
import { popIn } from "../../animations/pop-in";
|
|
18
18
|
import { apply, isSupported } from "@oddbird/popover-polyfill/fn";
|
|
19
|
+
import { computePositionWithSafeArea } from "../../utils/floating-ui";
|
|
19
20
|
const ANIMATIONS = {
|
|
20
21
|
'pop-in': popIn,
|
|
21
22
|
};
|
|
@@ -78,7 +79,7 @@ export class PostPopovercontainer {
|
|
|
78
79
|
if (this.toggleTimeoutId || !target)
|
|
79
80
|
return;
|
|
80
81
|
this.eventTarget = target;
|
|
81
|
-
this.
|
|
82
|
+
this.updatePosition();
|
|
82
83
|
this.host.showPopover();
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
@@ -104,7 +105,7 @@ export class PostPopovercontainer {
|
|
|
104
105
|
this.eventTarget = target;
|
|
105
106
|
// Prevent instant double toggle
|
|
106
107
|
if (!this.toggleTimeoutId) {
|
|
107
|
-
this.
|
|
108
|
+
this.updatePosition();
|
|
108
109
|
this.host.togglePopover(force);
|
|
109
110
|
this.toggleTimeoutId = null;
|
|
110
111
|
}
|
|
@@ -216,17 +217,14 @@ export class PostPopovercontainer {
|
|
|
216
217
|
startAutoupdates() {
|
|
217
218
|
if (!this.eventTarget || !this.host)
|
|
218
219
|
return;
|
|
219
|
-
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.
|
|
220
|
+
this.clearAutoUpdate = autoUpdate(this.eventTarget, this.host, this.updatePosition.bind(this));
|
|
220
221
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
async calculatePosition() {
|
|
229
|
-
const { x, y, middlewareData, placement } = await this.computeMainPosition();
|
|
222
|
+
async updatePosition() {
|
|
223
|
+
const { x, y, middlewareData, placement } = await this.calculatePosition();
|
|
224
|
+
// Hide the popover if the target is outside the viewport
|
|
225
|
+
if (middlewareData.hide?.referenceHidden) {
|
|
226
|
+
this.host.hidePopover();
|
|
227
|
+
}
|
|
230
228
|
const currentPlacement = placement.split('-')[0];
|
|
231
229
|
this.dynamicPlacement = currentPlacement;
|
|
232
230
|
// Position popover
|
|
@@ -251,13 +249,15 @@ export class PostPopovercontainer {
|
|
|
251
249
|
await this.updateSafeSpaceBoundaries(currentPlacement);
|
|
252
250
|
}
|
|
253
251
|
}
|
|
254
|
-
async
|
|
252
|
+
async calculatePosition() {
|
|
255
253
|
const gap = this.edgeGap;
|
|
256
254
|
const isAligned = (this.placement || 'top').includes('-');
|
|
257
|
-
const flipMiddleware =
|
|
258
|
-
|
|
259
|
-
crossAxis: false,
|
|
260
|
-
|
|
255
|
+
const flipMiddleware = [
|
|
256
|
+
// Flip the popover if the target moves outside the viewport
|
|
257
|
+
flip({ elementContext: 'reference', crossAxis: false }),
|
|
258
|
+
// Flip the popover if the popover itself moves outside the viewport
|
|
259
|
+
flip({ elementContext: 'floating', crossAxis: false }),
|
|
260
|
+
];
|
|
261
261
|
const shiftMiddleware = shift({
|
|
262
262
|
padding: gap,
|
|
263
263
|
limiter: limitShift({
|
|
@@ -269,7 +269,7 @@ export class PostPopovercontainer {
|
|
|
269
269
|
inline(),
|
|
270
270
|
// Per floating-ui docs: for aligned placements (e.g. bottom-end),
|
|
271
271
|
// flip should come before shift. For non-aligned, shift before flip.
|
|
272
|
-
...(isAligned ? [flipMiddleware, shiftMiddleware] : [shiftMiddleware, flipMiddleware]),
|
|
272
|
+
...(isAligned ? [...flipMiddleware, shiftMiddleware] : [shiftMiddleware, ...flipMiddleware]),
|
|
273
273
|
size({
|
|
274
274
|
apply({ availableWidth, elements }) {
|
|
275
275
|
Object.assign(elements.floating.style, {
|
|
@@ -281,7 +281,12 @@ export class PostPopovercontainer {
|
|
|
281
281
|
if (this.arrow) {
|
|
282
282
|
middleware.push(arrow({ element: this.arrowRef, padding: gap }));
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
// Automatically hide the popover if the target moves outside the scrollport.
|
|
285
|
+
if (this.autoHide) {
|
|
286
|
+
// Per floating-ui docs: hide should generally be placed at the end.
|
|
287
|
+
middleware.push(hide({ strategy: 'referenceHidden' }));
|
|
288
|
+
}
|
|
289
|
+
return computePositionWithSafeArea(this.eventTarget, this.host, {
|
|
285
290
|
placement: this.placement || 'top',
|
|
286
291
|
strategy: 'fixed',
|
|
287
292
|
middleware,
|
|
@@ -348,9 +353,9 @@ export class PostPopovercontainer {
|
|
|
348
353
|
}
|
|
349
354
|
}
|
|
350
355
|
render() {
|
|
351
|
-
return (h(Host, { key: '
|
|
356
|
+
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 => {
|
|
352
357
|
this.arrowRef = el;
|
|
353
|
-
} })), h("span", { key: '
|
|
358
|
+
} })), h("span", { key: '61a6e4e8026832afc188edd5a74535716db65945', part: "post-popovercontainer-border-mask" }), h("slot", { key: 'd79cb69a77dbba13ffa3c30e0393db4f3a669a12' }))));
|
|
354
359
|
}
|
|
355
360
|
static get is() { return "post-popovercontainer"; }
|
|
356
361
|
static get encapsulation() { return "shadow"; }
|
|
@@ -376,7 +381,7 @@ export class PostPopovercontainer {
|
|
|
376
381
|
"Placement": {
|
|
377
382
|
"location": "import",
|
|
378
383
|
"path": "@floating-ui/dom",
|
|
379
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.
|
|
384
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts::Placement",
|
|
380
385
|
"referenceLocation": "Placement"
|
|
381
386
|
}
|
|
382
387
|
}
|
|
@@ -470,6 +475,25 @@ export class PostPopovercontainer {
|
|
|
470
475
|
"setter": false,
|
|
471
476
|
"reflect": true,
|
|
472
477
|
"attribute": "safe-space"
|
|
478
|
+
},
|
|
479
|
+
"autoHide": {
|
|
480
|
+
"type": "boolean",
|
|
481
|
+
"mutable": false,
|
|
482
|
+
"complexType": {
|
|
483
|
+
"original": "boolean",
|
|
484
|
+
"resolved": "boolean",
|
|
485
|
+
"references": {}
|
|
486
|
+
},
|
|
487
|
+
"required": false,
|
|
488
|
+
"optional": true,
|
|
489
|
+
"docs": {
|
|
490
|
+
"tags": [],
|
|
491
|
+
"text": "Whether to automatically hide the popover when the target moves outside the scrollport.\n\nIf the `post-header` can cover the target, the popover will also be hidden as soon as the\ntarget scrolls behind it."
|
|
492
|
+
},
|
|
493
|
+
"getter": false,
|
|
494
|
+
"setter": false,
|
|
495
|
+
"reflect": false,
|
|
496
|
+
"attribute": "auto-hide"
|
|
473
497
|
}
|
|
474
498
|
};
|
|
475
499
|
}
|
|
@@ -43,7 +43,7 @@ export class PostProgressbar {
|
|
|
43
43
|
const max = this.getEffectiveMax();
|
|
44
44
|
const value = this.getEffectiveValue(min, max);
|
|
45
45
|
const percentage = ((value - min) / (max - min)) * 100;
|
|
46
|
-
return (h(Host, { key: '
|
|
46
|
+
return (h(Host, { key: 'c08b9b976c5cb34018e48c4dafe6b87207710ba5', role: "progressbar", "aria-valuenow": value, "aria-valuemin": min, "aria-valuemax": max }, h("div", { key: '485eb6657d14ad5472bfbe822b1cd0eb50cd0129', class: "progress-value", style: { '--post-progressbar-value': `${percentage}%` } })));
|
|
47
47
|
}
|
|
48
48
|
static get is() { return "post-progressbar"; }
|
|
49
49
|
static get encapsulation() { return "shadow"; }
|
|
@@ -83,7 +83,7 @@ export class PostRating {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
|
-
return (h(Host, { key: '
|
|
86
|
+
return (h(Host, { key: '0cf576670f16d4b8f88b714af12ded14aa1372b2', "data-version": version }, h("div", { key: 'a53c8f8f9c617a2bd3996fd5812c7af091497f55', role: "slider", class: "rating", tabindex: "0", "aria-label": this.label, "aria-valuemin": "0", "aria-valuemax": this.stars, "aria-valuenow": this.currentRating, "aria-valuetext": `${this.currentRating} / ${this.stars}`, "aria-readonly": this.readonly ? 'true' : 'false', onKeyDown: this.keydownHandler, onBlur: this.blurHandler }, Array.from({ length: this.stars }).map((v, i) => (h("div", { key: `star-${v}`, "aria-hidden": "true", class: {
|
|
87
87
|
'star': true,
|
|
88
88
|
'before-hover': i < this.hoveredIndex,
|
|
89
89
|
'active': i < Math.round(this.currentRating),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{
|
|
1
|
+
:host{display:flex}:host,:host dialog{background-color:var(--post-scheme-color-palette-bg-2);border-inline-end:var(--post-device-border-width-alternative1) solid var(--post-scheme-color-interactive-primary-enabled-stroke4)}:host dialog{overflow:visible;width:var(--post-core-dimension-296);bottom:auto;right:auto;border:none;padding:0;max-height:100dvh;transform:translateX(-100%);transition-property:transform,overlay,display;transition-behavior:allow-discrete;transition-duration:350ms;box-shadow:var(--post-device-elevation-300)}:host dialog[open]{transform:translateX(0)}@starting-style{:host dialog[open]{transform:translateX(-100%)}}@media(prefers-reduced-motion: reduce){:host dialog{transition:none}}:host post-closebutton{transform:translate(50%, 0)}
|
|
@@ -129,7 +129,7 @@ export class PostSideNavigation {
|
|
|
129
129
|
} }, h("slot", null), h("post-closebutton", { onClick: () => this.hide() }, this.textClose)));
|
|
130
130
|
}
|
|
131
131
|
render() {
|
|
132
|
-
return (h(Host, { key: '
|
|
132
|
+
return (h(Host, { key: 'd99b96af69d80dc97b44fdc61410768617ca934c', "data-version": version }, this.device === 'desktop' ? this.renderNav() : this.renderDialog()));
|
|
133
133
|
}
|
|
134
134
|
static get is() { return "post-side-navigation"; }
|
|
135
135
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js
CHANGED
|
@@ -85,7 +85,7 @@ export class PostSideNavigationTrigger {
|
|
|
85
85
|
await this.sideNavigation?.toggle();
|
|
86
86
|
}
|
|
87
87
|
render() {
|
|
88
|
-
return (h(Host, { key: '
|
|
88
|
+
return (h(Host, { key: 'e82eb54b68db812c3753a7d027d983fa81f01255', "data-version": version }, h("slot", { key: 'a1ca8877d1a9e0faa653a3f1dec3fd1655b4bcb7' })));
|
|
89
89
|
}
|
|
90
90
|
static get is() { return "post-side-navigation-trigger"; }
|
|
91
91
|
static get encapsulation() { return "shadow"; }
|
|
@@ -104,7 +104,7 @@ export class PostStepper {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
render() {
|
|
107
|
-
return (h(Host, { key: '
|
|
107
|
+
return (h(Host, { key: '917393b196552a6994cfc230bf93f2cd0a5e77e7', "data-version": version }, h("ol", { key: 'ab15bc7eaa44c5a8246c2fcc2d1c3c8e1d8ab4a6' }, h("slot", { key: 'e61ab0edfce06fe1ef7345a6472834a3af38ce9e', onSlotchange: () => this.updateSteps() })), h("div", { key: 'be0556840878de5adb007ef33693ef619d8a19fa', class: "active-step", "aria-hidden": "true" }, h("span", { key: '8a1663a9360d931198f52c699c4e855a1f77bbc6', class: "active-step-label" }, this.mobileActiveStepLabel), h("span", { key: '31f804be237598a5d8b7cbd1f418af1758e42fd6', innerHTML: this.mobileActiveStepName }))));
|
|
108
108
|
}
|
|
109
109
|
static get is() { return "post-stepper"; }
|
|
110
110
|
static get encapsulation() { return "shadow"; }
|
|
@@ -2,7 +2,7 @@ import { version } from "../../../../package";
|
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
export class PostStepperItem {
|
|
4
4
|
render() {
|
|
5
|
-
return (h(Host, { key: '
|
|
5
|
+
return (h(Host, { key: '486be1addaa512c39628cfa2fab567d5dfb4b517', "data-version": version, role: "listitem" }, h("span", { key: 'a89be43022ff5b9d9cbcad1e4f934fdcef8919c3', class: "stepper-item-content" }, h("span", { key: '60e217eab48532d7985b57159251f84217f1b362', class: "step-hidden-label visually-hidden" }), h("span", { key: 'b847451659b699693d168dd8164c878281fb7793', class: "label" }, h("slot", { key: '823229cba3855d597f08ebc6fc4e5a5059ef7f98' })))));
|
|
6
6
|
}
|
|
7
7
|
static get is() { return "post-stepper-item"; }
|
|
8
8
|
static get encapsulation() { return "shadow"; }
|
|
@@ -44,9 +44,9 @@ export class PostTabItem {
|
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
46
|
const isSSR = Build.isServer;
|
|
47
|
-
return (h(Host, { key: '
|
|
47
|
+
return (h(Host, { key: '7a12be83f1b2bd428a4fcba01b4696a253d58daf', id: this.tabId, role: this.isPagesVariant ? undefined : 'tab', "data-version": version, "data-pages-variant": this.isPagesVariant.toString(), "aria-selected": this.isPagesVariant ? undefined : 'false', "aria-disabled": this.disabled ? 'true' : undefined, tabindex: this.isPagesVariant ? undefined : '-1', class: `${this.isPagesVariant ? 'nav-item' : 'tab-title'}${isSSR && !this.isPagesVariant ? ' ssr' : ''}`, style: isSSR && !this.isPagesVariant
|
|
48
48
|
? { '--active': `var(--post-tab-item-${this.name}, 0)` }
|
|
49
|
-
: undefined }, h("slot", { key: '
|
|
49
|
+
: undefined }, h("slot", { key: '7350214640bf0ab1afcd3584c4ccd48e22da1612' })));
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "post-tab-item"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -21,7 +21,7 @@ export class PostTabPanel {
|
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
23
|
const isSSR = Build.isServer;
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: 'a1aa48f24e91af0562683115218d19582309ef6e', "data-version": version, id: this.panelId, role: "tabpanel", slot: "panels", style: isSSR ? { display: `var(--post-tab-panel-${this.for}, none)` } : undefined }, h("slot", { key: '17e0e571302ded052f9586e0754203b772a3fbec' })));
|
|
25
25
|
}
|
|
26
26
|
static get is() { return "post-tab-panel"; }
|
|
27
27
|
static get encapsulation() { return "shadow"; }
|
|
@@ -427,10 +427,10 @@ export class PostTabs {
|
|
|
427
427
|
}
|
|
428
428
|
: undefined;
|
|
429
429
|
const style = isSSR && !this.isPagesVariant ? tabStyle : undefined;
|
|
430
|
-
return (h(Host, { key: '
|
|
430
|
+
return (h(Host, { key: 'ad4f55f50dbd83e1383944984f79d195d1c531e7', "data-version": version, style: style }, h("div", { key: '48456590c7b6cead75b689e3b2b463c641600cdd', class: "tabs-wrapper", part: "post-tabs" }, h("button", { key: '6337fd1ba75f53f09bd80ff0873b129cb2387498', ref: el => (this.leftScrollButton = el), class: "scroll-btn scroll-btn-left", type: "button", "aria-label": this.textPrevTabItems, tabindex: this.showLeftScrollButton ? 0 : -1, hidden: !this.showLeftScrollButton, onClick: () => this.scrollTabs('prev') }, h("post-icon", { key: '97897bb7329a070f40e6ecbacff394b10f660aec', name: "chevronleft" })), h(TabsContainer, { key: 'edc801dcadf41c85ed9aafdd2dda11ff4c87756b', ref: el => (this.tabsContainer = el), class: "tabs", role: this.isPagesVariant ? undefined : 'tablist', "aria-label": this.isPagesVariant ? this.label : undefined }, h("slot", { key: '908aaf787f545de1738236412dc4094cabe87155', onSlotchange: () => {
|
|
431
431
|
this.moveMisplacedTabs();
|
|
432
432
|
this.enableTabs();
|
|
433
|
-
} })), h("button", { key: '
|
|
433
|
+
} })), h("button", { key: 'ed12a602b399e1a8dcd190fca7828fcb2683b925', ref: el => (this.rightScrollButton = el), class: "scroll-btn scroll-btn-right", type: "button", "aria-label": this.textNextTabItems, tabindex: this.showRightScrollButton ? 0 : -1, hidden: !this.showRightScrollButton, onClick: () => this.scrollTabs('next') }, h("post-icon", { key: '0ecd4444455da92f371b300299ff2f1a53f804a2', name: "chevronright" }))), !this.isPagesVariant && (h("div", { key: '2252fefeca18a6135796852e511c779d413aa2c5', class: "tab-content", part: "post-tabs-content" }, h("slot", { key: 'dc553352c6fa9ea4c5780108bc9ed8e3e9b29b24', name: "panels", onSlotchange: () => this.moveMisplacedPanels() })))));
|
|
434
434
|
}
|
|
435
435
|
static get is() { return "post-tabs"; }
|
|
436
436
|
static get encapsulation() { return "shadow"; }
|
|
@@ -29,7 +29,7 @@ export class PostTogglebutton {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: 'ae46e9fcd82766abcf76c4b37d0341cfd29f2f4f', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '9c71c065225f0f5c68e76fa2cec6d75bdf29fed0' })));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "post-togglebutton"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -67,7 +67,7 @@ export class PostTooltip {
|
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
69
|
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
70
|
-
return (h(Host, { key: '
|
|
70
|
+
return (h(Host, { key: '1510f7ec123b7bfaa39cc348a6b496a9051163ea', "data-version": version }, h("post-popovercontainer", { key: '004baf52684bfed3b8af77f773c9487d3b776fa9', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, placement: this.placement, autoHide: true, onPostBeforeToggle: e => this.handleBeforeToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '182f95928a4f70c747073e4585c18cab5f0eb277' }))));
|
|
71
71
|
}
|
|
72
72
|
static get is() { return "post-tooltip"; }
|
|
73
73
|
static get encapsulation() { return "shadow"; }
|
|
@@ -93,7 +93,7 @@ export class PostTooltip {
|
|
|
93
93
|
"Placement": {
|
|
94
94
|
"location": "import",
|
|
95
95
|
"path": "@floating-ui/dom",
|
|
96
|
-
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.
|
|
96
|
+
"id": "../../node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts::Placement",
|
|
97
97
|
"referenceLocation": "Placement"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -180,7 +180,7 @@ export class PostTooltipTrigger {
|
|
|
180
180
|
this.tooltip?.hide();
|
|
181
181
|
}
|
|
182
182
|
render() {
|
|
183
|
-
return (h(Host, { key: '
|
|
183
|
+
return (h(Host, { key: '692a3cda2890f30f0df80366a9610ec70b0872ba', "data-version": version }, h("slot", { key: '0a9df94a1d52ec318ecbec6740b7d3acc915b130', onSlotchange: () => this.handleSlotChange() })));
|
|
184
184
|
}
|
|
185
185
|
static get is() { return "post-tooltip-trigger"; }
|
|
186
186
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { throttle } from "throttle-debounce";
|
|
2
1
|
class Breakpoint {
|
|
3
2
|
constructor() {
|
|
4
3
|
this.breakpoints = [
|
|
5
|
-
{ key: 'xl', device: 'desktop', minWidth: 1280 },
|
|
6
|
-
{ key: 'lg', device: 'desktop', minWidth: 1024 },
|
|
7
|
-
{ key: 'md', device: 'tablet', minWidth: 780 },
|
|
8
|
-
{ key: 'sm', device: 'tablet', minWidth: 600 },
|
|
9
|
-
{ key: 'xs', device: 'mobile', minWidth: 0 },
|
|
4
|
+
{ key: 'xl', device: 'desktop', minWidth: 1280, mediaQuery: '(min-width: 1280px)' },
|
|
5
|
+
{ key: 'lg', device: 'desktop', minWidth: 1024, mediaQuery: '(min-width: 1024px)' },
|
|
6
|
+
{ key: 'md', device: 'tablet', minWidth: 780, mediaQuery: '(min-width: 780px)' },
|
|
7
|
+
{ key: 'sm', device: 'tablet', minWidth: 600, mediaQuery: '(min-width: 600px)' },
|
|
8
|
+
{ key: 'xs', device: 'mobile', minWidth: 0, mediaQuery: '(min-width: 0px)' },
|
|
10
9
|
];
|
|
11
10
|
this.resizeObserver = globalThis.ResizeObserver
|
|
12
11
|
? new ResizeObserver(() => this.updateCurrentBreakpoint())
|
|
13
12
|
: null;
|
|
14
|
-
this.updateCurrentBreakpoint =
|
|
13
|
+
this.updateCurrentBreakpoint = (options = { emitEvents: true }) => {
|
|
15
14
|
const previousBreakpoint = this.currentBreakpoint;
|
|
16
15
|
const newBreakpoint = this.breakpoints.find(breakpoint => {
|
|
17
|
-
return
|
|
16
|
+
return globalThis.matchMedia
|
|
17
|
+
? globalThis.matchMedia(breakpoint.mediaQuery).matches
|
|
18
|
+
: breakpoint.minWidth <= document.documentElement.clientWidth;
|
|
18
19
|
});
|
|
19
20
|
if (!newBreakpoint)
|
|
20
21
|
return;
|
|
@@ -22,9 +23,10 @@ class Breakpoint {
|
|
|
22
23
|
if (!options.emitEvents)
|
|
23
24
|
return;
|
|
24
25
|
Object.keys(this.currentBreakpoint)
|
|
26
|
+
.filter(key => key !== 'mediaQuery')
|
|
25
27
|
.filter(key => !previousBreakpoint || this.currentBreakpoint[key] !== previousBreakpoint[key])
|
|
26
28
|
.forEach((key) => this.dispatchEvent(key));
|
|
27
|
-
}
|
|
29
|
+
};
|
|
28
30
|
if (this.resizeObserver) {
|
|
29
31
|
this.updateCurrentBreakpoint({ emitEvents: false });
|
|
30
32
|
this.resizeObserver.observe(document.body);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { findClosestAcrossShadow } from "./event-from";
|
|
2
|
+
const CLOSABLE_TARGETS = [
|
|
3
|
+
{
|
|
4
|
+
predicate: el => el.localName === 'post-banner',
|
|
5
|
+
close: el => void el.dismiss(),
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
predicate: el => el.localName === 'post-popover',
|
|
9
|
+
close: el => void el.hide(),
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
predicate: el => el.localName === 'post-popovercontainer',
|
|
13
|
+
close: el => void el.hide(),
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
predicate: el => el.localName === 'post-collapsible',
|
|
17
|
+
close: el => void el.toggle(false),
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
predicate: el => el.localName === 'post-accordion-item',
|
|
21
|
+
close: el => void el.toggle(false),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
predicate: el => el.localName === 'dialog',
|
|
25
|
+
close: el => el.close(),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
predicate: el => el.hasAttribute('popover'),
|
|
29
|
+
close: el => el.togglePopover(false),
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
export function findClosableTarget(start) {
|
|
33
|
+
const el = findClosestAcrossShadow(start, (el) => CLOSABLE_TARGETS.some(t => t.predicate(el)));
|
|
34
|
+
if (!el)
|
|
35
|
+
return null;
|
|
36
|
+
const match = CLOSABLE_TARGETS.find(t => t.predicate(el));
|
|
37
|
+
return { element: el, close: () => match.close(el) };
|
|
38
|
+
}
|
|
@@ -89,29 +89,34 @@ export function EventFrom(tag, option) {
|
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Traverses up the DOM (including crossing shadow DOM boundaries) to find the closest ancestor
|
|
92
|
-
*
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
92
|
+
* matching the given predicate.
|
|
93
|
+
* @param start - The starting element
|
|
94
|
+
* @param predicate - A type guard used to test each ancestor
|
|
95
95
|
* @returns The closest matching ancestor or null if none found
|
|
96
96
|
*/
|
|
97
|
-
function
|
|
98
|
-
let current =
|
|
97
|
+
export function findClosestAcrossShadow(start, predicate) {
|
|
98
|
+
let current = start;
|
|
99
99
|
while (current) {
|
|
100
|
-
if (current
|
|
100
|
+
if (predicate(current)) {
|
|
101
101
|
return current;
|
|
102
102
|
}
|
|
103
|
-
// Check regular parent first
|
|
104
103
|
if (current.parentElement) {
|
|
105
104
|
current = current.parentElement;
|
|
106
105
|
}
|
|
107
|
-
// If no parentElement, check if we're in a shadow root
|
|
108
|
-
else if (current.parentNode instanceof ShadowRoot) {
|
|
109
|
-
current = current.parentNode.host;
|
|
110
|
-
}
|
|
111
|
-
// No more parents to check
|
|
112
106
|
else {
|
|
113
|
-
|
|
107
|
+
// Duck-typed ShadowRoot check (nodeType 11 + host) instead of `instanceof ShadowRoot`,
|
|
108
|
+
// since some test environments (e.g. JSDOM) only partially implement it.
|
|
109
|
+
const parent = current.parentNode;
|
|
110
|
+
if (parent !== null && parent.nodeType === 11 && 'host' in parent) {
|
|
111
|
+
current = parent.host;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
current = null;
|
|
115
|
+
}
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
return null;
|
|
117
119
|
}
|
|
120
|
+
function findClosestParentWithTag(element, tagName) {
|
|
121
|
+
return findClosestAcrossShadow(element, (el) => el.localName === tagName);
|
|
122
|
+
}
|