@swisspost/design-system-components 10.0.0-next.66 → 10.0.0-next.68
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-B81j4H4_.js → breakpoints-B0Olgvgc.js} +8 -9
- package/dist/cjs/{get-focusable-children-SdEe5tt7.js → get-focusable-children-BGVgg7Te.js} +4 -4
- package/dist/cjs/{get-root-CUAv4k4C.js → get-root-B1FnQ50K.js} +1 -3
- package/dist/cjs/{index-YVR3WTTS.js → index-Du1lKw8D.js} +21 -9
- package/dist/cjs/{index-ChzLnSU8.js → index-qCzRmwgB.js} +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-Cixsn1Ql.js → package-DB6yM9Rp.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +6 -7
- package/dist/cjs/post-autocomplete.cjs.entry.js +181 -0
- package/dist/cjs/post-avatar.cjs.entry.js +6 -7
- package/dist/cjs/post-back-to-top.cjs.entry.js +8 -9
- package/dist/cjs/post-banner.cjs.entry.js +5 -6
- package/dist/cjs/{post-breadcrumb-item_2.cjs.entry.js → post-breadcrumb-item.cjs.entry.js} +7 -23
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +13 -12
- package/dist/cjs/{post-closebutton_13.cjs.entry.js → post-closebutton_14.cjs.entry.js} +97 -70
- package/dist/cjs/post-collapsible_2.cjs.entry.js +18 -12
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-date-picker.cjs.entry.js +12 -13
- package/dist/cjs/post-footer.cjs.entry.js +8 -9
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/post-listbox-option.cjs.entry.js +26 -0
- package/dist/cjs/post-listbox.cjs.entry.js +151 -0
- package/dist/cjs/post-login-widget.cjs.entry.js +60 -0
- package/dist/cjs/post-number-input.cjs.entry.js +20 -14
- package/dist/cjs/post-pagination.cjs.entry.js +10 -11
- package/dist/cjs/post-popover-trigger.cjs.entry.js +5 -6
- package/dist/cjs/post-popover.cjs.entry.js +7 -8
- package/dist/cjs/post-rating.cjs.entry.js +5 -6
- package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/post-stepper.cjs.entry.js +6 -7
- package/dist/cjs/post-tab-item.cjs.entry.js +5 -6
- package/dist/cjs/post-tab-panel.cjs.entry.js +5 -6
- package/dist/cjs/post-tabs.cjs.entry.js +8 -9
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +7 -10
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -6
- package/dist/collection/animations/collapse.js +10 -3
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/post-accordion/post-accordion.js +2 -2
- package/dist/collection/components/post-autocomplete/post-autocomplete.css +1 -0
- package/dist/collection/components/post-autocomplete/post-autocomplete.js +271 -0
- package/dist/collection/components/post-avatar/post-avatar.js +2 -2
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +4 -4
- package/dist/collection/components/post-banner/post-banner.js +1 -1
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +42 -5
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +9 -7
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +4 -4
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
- package/dist/collection/components/post-date-picker/post-date-picker.js +9 -9
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +3 -3
- package/dist/collection/components/post-header/post-header.js +13 -13
- package/dist/collection/components/post-icon/post-icon.js +16 -13
- package/dist/collection/components/post-language-menu/post-language-menu.css +1 -1
- package/dist/collection/components/post-language-menu/post-language-menu.js +1 -1
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.css +1 -1
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.js +28 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-listbox/post-listbox.css +1 -0
- package/dist/collection/components/post-listbox/post-listbox.js +293 -0
- package/dist/collection/components/post-listbox-option/post-listbox-option.css +1 -0
- package/dist/collection/components/post-listbox-option/post-listbox-option.js +109 -0
- package/dist/collection/components/post-login-widget/post-login-widget.js +120 -0
- 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.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +5 -5
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
- package/dist/collection/components/post-menu/post-menu.js +2 -2
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
- package/dist/collection/components/post-number-input/post-number-input.css +4 -1
- package/dist/collection/components/post-number-input/post-number-input.js +12 -3
- package/dist/collection/components/post-pagination/post-pagination.js +6 -6
- package/dist/collection/components/post-popover/post-popover.js +1 -1
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -19
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-stepper/post-stepper.js +2 -2
- package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
- package/dist/collection/components/post-tab-item/post-tab-item.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +4 -4
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +6 -6
- package/dist/collection/utils/attribute-observer.js +1 -2
- package/dist/collection/utils/breakpoints.js +8 -8
- package/dist/collection/utils/get-focusable-children.js +3 -3
- package/dist/collection/utils/get-root.js +1 -2
- package/dist/collection/utils/index.js +0 -1
- package/dist/collection/utils/is-iso-date.js +1 -1
- package/dist/collection/utils/is-motion-reduced.js +3 -2
- package/dist/collection/utils/property-checkers/check-date.js +1 -1
- package/dist/collection/utils/property-checkers/constants.js +1 -1
- package/dist/collection/utils/property-checkers/index.js +1 -2
- package/dist/collection/utils/repeat-on-long-press.js +6 -6
- package/dist/collection/utils/sass-export.js +1 -1
- package/dist/collection/utils/tests/helpers/mock-match-media.js +11 -0
- package/dist/collection/utils/tests/helpers/mock-stencil-constants.js +12 -0
- package/dist/component-names.json +4 -0
- package/dist/components/breakpoints.js +1 -1
- package/dist/components/get-focusable-children.js +1 -1
- package/dist/components/get-root.js +1 -1
- package/dist/components/index.d.ts +8 -2
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +1 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-accordion2.js +1 -1
- package/dist/components/post-autocomplete.d.ts +11 -0
- package/dist/components/post-autocomplete.js +1 -0
- package/dist/components/post-avatar.js +1 -1
- package/dist/components/post-back-to-top.js +1 -1
- package/dist/components/post-banner.js +1 -1
- package/dist/components/post-breadcrumb-item2.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-language-menu-item.js +1 -1
- package/dist/components/post-language-menu.js +1 -1
- package/dist/components/post-linkarea.js +1 -1
- package/dist/components/post-listbox-option.d.ts +11 -0
- package/dist/components/post-listbox-option.js +1 -0
- package/dist/components/{post-env-test.d.ts → post-listbox.d.ts} +4 -4
- package/dist/components/post-listbox.js +1 -0
- package/dist/components/post-login-widget.d.ts +11 -0
- package/dist/components/post-login-widget.js +1 -0
- 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-item2.js +1 -1
- package/dist/components/post-menu-trigger2.js +1 -1
- package/dist/components/post-menu2.js +1 -1
- package/dist/components/post-number-input.js +1 -1
- package/dist/components/post-pagination.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-rating.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-08F-DB-d.js +1 -0
- package/dist/components/react/p-B2BDAeHI.js +1 -0
- package/dist/components/react/p-BADyL6qQ.js +1 -0
- package/dist/components/react/p-BFAXoyMM.js +1 -0
- package/dist/components/react/p-BOqFllSV.js +1 -0
- package/dist/components/react/p-BQ3HlJPr.js +1 -0
- package/dist/components/react/p-ByN3t9FX.js +1 -0
- package/dist/components/react/{p-CmA91vH_.js → p-CmkOK7QT.js} +1 -1
- package/dist/components/react/p-CuiEdxy9.js +1 -0
- package/dist/components/react/p-DPFq3I2q.js +1 -0
- package/dist/components/react/p-DSw_A3Mh.js +1 -0
- package/dist/components/react/p-DsaGKkkf.js +1 -0
- package/dist/components/react/p-NDMNbu5d.js +1 -0
- package/dist/components/react/p-_AAbD0Gm.js +1 -0
- package/dist/components/react/p-aFH1oGSZ.js +1 -0
- package/dist/components/react/p-rEK_D60T.js +1 -0
- package/dist/components/react/p-wHDwT4JH.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.d.ts +11 -0
- package/dist/components/react/post-autocomplete.js +1 -0
- 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.d.ts +11 -0
- package/dist/components/react/post-listbox-option.js +1 -0
- package/dist/components/react/{post-env-test.d.ts → post-listbox.d.ts} +4 -4
- package/dist/components/react/post-listbox.js +1 -0
- package/dist/components/react/post-login-widget.d.ts +11 -0
- package/dist/components/react/post-login-widget.js +1 -0
- 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-rating.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 +682 -56
- package/dist/esm/{breakpoints-_gmb7vUy.js → breakpoints-BQ3HlJPr.js} +8 -9
- package/dist/esm/{get-focusable-children-CFWKPWu9.js → get-focusable-children-DxYnH2ye.js} +4 -4
- package/dist/esm/{get-root-CXfAA093.js → get-root-08F-DB-d.js} +1 -3
- package/dist/esm/{index-Cj-Lzb7i.js → index-Ci4L1rzN.js} +21 -9
- package/dist/esm/{index-CCMeku7U.js → index-D9bU2pIE.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-NDMNbu5d.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +6 -7
- package/dist/esm/post-autocomplete.entry.js +179 -0
- package/dist/esm/post-avatar.entry.js +6 -7
- package/dist/esm/post-back-to-top.entry.js +8 -9
- package/dist/esm/post-banner.entry.js +5 -6
- package/dist/esm/{post-breadcrumb-item_2.entry.js → post-breadcrumb-item.entry.js} +8 -23
- package/dist/esm/post-breadcrumbs.entry.js +13 -12
- package/dist/esm/{post-closebutton_13.entry.js → post-closebutton_14.entry.js} +97 -71
- package/dist/esm/post-collapsible_2.entry.js +18 -12
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-date-picker.entry.js +12 -13
- package/dist/esm/post-footer.entry.js +8 -9
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/post-listbox-option.entry.js +24 -0
- package/dist/esm/post-listbox.entry.js +149 -0
- package/dist/esm/post-login-widget.entry.js +58 -0
- package/dist/esm/post-number-input.entry.js +20 -14
- package/dist/esm/post-pagination.entry.js +10 -11
- package/dist/esm/post-popover-trigger.entry.js +5 -6
- package/dist/esm/post-popover.entry.js +7 -8
- package/dist/esm/post-rating.entry.js +5 -6
- package/dist/esm/post-stepper-item.entry.js +3 -3
- package/dist/esm/post-stepper.entry.js +6 -7
- package/dist/esm/post-tab-item.entry.js +5 -6
- package/dist/esm/post-tab-panel.entry.js +5 -6
- package/dist/esm/post-tabs.entry.js +8 -9
- package/dist/esm/post-tooltip-trigger.entry.js +7 -10
- package/dist/esm/post-tooltip.entry.js +5 -6
- package/dist/post-components/p-08F-DB-d.js +1 -0
- package/dist/post-components/p-1edd4d7c.entry.js +1 -0
- package/dist/post-components/p-319959ee.entry.js +1 -0
- package/dist/post-components/p-3364b421.entry.js +1 -0
- package/dist/post-components/p-38880c61.entry.js +1 -0
- package/dist/post-components/p-39b2b086.entry.js +1 -0
- package/dist/post-components/p-4ad6993e.entry.js +1 -0
- package/dist/post-components/p-4c021d5f.entry.js +1 -0
- package/dist/post-components/p-5c66d070.entry.js +1 -0
- package/dist/post-components/p-5f86479f.entry.js +1 -0
- package/dist/post-components/{p-fe35968d.entry.js → p-602960ff.entry.js} +1 -1
- package/dist/post-components/p-631f4bdd.entry.js +1 -0
- package/dist/post-components/p-6336ea0b.entry.js +1 -0
- package/dist/post-components/p-7ad4e293.entry.js +1 -0
- package/dist/post-components/p-82871134.entry.js +1 -0
- package/dist/post-components/p-8c91a9d8.entry.js +1 -0
- package/dist/post-components/p-9bdb92c0.entry.js +1 -0
- package/dist/post-components/p-BQ3HlJPr.js +1 -0
- package/dist/post-components/p-Ci4L1rzN.js +2 -0
- package/dist/post-components/p-D9bU2pIE.js +1 -0
- package/dist/post-components/p-DYYpZAAV.js +1 -0
- package/dist/post-components/p-NDMNbu5d.js +1 -0
- package/dist/post-components/p-cdc11592.entry.js +1 -0
- package/dist/post-components/p-df54677a.entry.js +1 -0
- package/dist/post-components/{p-46f30771.entry.js → p-e01ce660.entry.js} +1 -1
- package/dist/post-components/p-e331093d.entry.js +1 -0
- package/dist/post-components/p-e4fd234d.entry.js +1 -0
- package/dist/post-components/p-eb89eecb.entry.js +1 -0
- package/dist/post-components/p-ee03eed0.entry.js +1 -0
- package/dist/post-components/p-f1813327.entry.js +1 -0
- package/dist/post-components/p-f1bff988.entry.js +1 -0
- package/dist/post-components/p-f64c6491.entry.js +1 -0
- package/dist/post-components/p-fd10d5b9.entry.js +1 -0
- package/dist/post-components/post-components.css +6 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-autocomplete/post-autocomplete.d.ts +34 -0
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +8 -0
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +8 -5
- package/dist/types/components/post-language-menu-item/post-language-menu-item.d.ts +5 -0
- package/dist/types/components/post-listbox/post-listbox.d.ts +37 -0
- package/dist/types/components/post-listbox-option/post-listbox-option.d.ts +13 -0
- package/dist/types/components/post-login-widget/post-login-widget.d.ts +30 -0
- package/dist/types/components/post-number-input/post-number-input.d.ts +2 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +2 -0
- package/dist/types/components.d.ts +240 -13
- package/dist/types/utils/breakpoints.d.ts +1 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/property-checkers/index.d.ts +1 -2
- package/dist/types/utils/tests/helpers/mock-match-media.d.ts +4 -0
- package/dist/types/utils/tests/helpers/mock-stencil-constants.d.ts +0 -0
- package/hydrate/index.js +699 -1388
- package/hydrate/index.mjs +699 -1388
- package/package.json +9 -7
- package/dist/cjs/environment-BQE9Unf_.js +0 -52
- package/dist/cjs/post-env-test.cjs.entry.js +0 -15
- package/dist/collection/utils/environment.js +0 -47
- package/dist/collection/utils/tests/environment/hydrate-app-helper.js +0 -16
- package/dist/collection/utils/tests/environment/post-env-test.js +0 -9
- package/dist/components/environment.js +0 -1
- package/dist/components/post-env-test.js +0 -1
- package/dist/components/react/p-BVGcVycs.js +0 -1
- package/dist/components/react/p-Bb0ejJa3.js +0 -1
- package/dist/components/react/p-BbnDcq_W.js +0 -1
- package/dist/components/react/p-BcBg4WYn.js +0 -1
- package/dist/components/react/p-C1CrnSak.js +0 -1
- package/dist/components/react/p-C9bJM7_1.js +0 -1
- package/dist/components/react/p-CApN7QUn.js +0 -1
- package/dist/components/react/p-CGeIHu-8.js +0 -1
- package/dist/components/react/p-CVM28gRr.js +0 -1
- package/dist/components/react/p-CdMrnWjS.js +0 -1
- package/dist/components/react/p-CfXYLM9Y.js +0 -1
- package/dist/components/react/p-DH6JtVW9.js +0 -1
- package/dist/components/react/p-Dgo_BJCW.js +0 -1
- package/dist/components/react/p-Dne0jb7e.js +0 -1
- package/dist/components/react/p-FxUVQ4Tx.js +0 -1
- package/dist/components/react/p-htxkyM9X.js +0 -1
- package/dist/components/react/post-env-test.js +0 -1
- package/dist/esm/environment-CEmnRoA6.js +0 -49
- package/dist/esm/package-CApN7QUn.js +0 -3
- package/dist/esm/post-env-test.entry.js +0 -13
- package/dist/post-components/p-054c0046.entry.js +0 -1
- package/dist/post-components/p-102b69dd.entry.js +0 -1
- package/dist/post-components/p-1221cdd6.entry.js +0 -1
- package/dist/post-components/p-14ca5d65.entry.js +0 -1
- package/dist/post-components/p-38404768.entry.js +0 -1
- package/dist/post-components/p-388ac19f.entry.js +0 -1
- package/dist/post-components/p-5088354d.entry.js +0 -1
- package/dist/post-components/p-53c3195b.entry.js +0 -1
- package/dist/post-components/p-6e79a981.entry.js +0 -1
- package/dist/post-components/p-700c3e20.entry.js +0 -1
- package/dist/post-components/p-7fc1291f.entry.js +0 -1
- package/dist/post-components/p-84905b89.entry.js +0 -1
- package/dist/post-components/p-9127ee5c.entry.js +0 -1
- package/dist/post-components/p-91fbf90f.entry.js +0 -1
- package/dist/post-components/p-9e6b8aae.entry.js +0 -1
- package/dist/post-components/p-CApN7QUn.js +0 -1
- package/dist/post-components/p-CCMeku7U.js +0 -1
- package/dist/post-components/p-CEmnRoA6.js +0 -1
- package/dist/post-components/p-Cj-Lzb7i.js +0 -2
- package/dist/post-components/p-DI-h_mEL.js +0 -1
- package/dist/post-components/p-DppMBmK1.js +0 -1
- package/dist/post-components/p-Rr097A6n.js +0 -1
- package/dist/post-components/p-b7c02b48.entry.js +0 -1
- package/dist/post-components/p-bb2dc205.entry.js +0 -1
- package/dist/post-components/p-dd2d35fd.entry.js +0 -1
- package/dist/post-components/p-dde0c46e.entry.js +0 -1
- package/dist/post-components/p-e4978408.entry.js +0 -1
- package/dist/post-components/p-eb4eabe2.entry.js +0 -1
- package/dist/post-components/p-ece3d263.entry.js +0 -1
- package/dist/types/utils/environment.d.ts +0 -26
- package/dist/types/utils/tests/environment/hydrate-app-helper.d.ts +0 -5
- package/dist/types/utils/tests/environment/post-env-test.d.ts +0 -3
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Build, Host, h, } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
const SESSION_URL = 'https://n.account.post.ch/v1/session/subscribe';
|
|
4
|
+
/**
|
|
5
|
+
* @slot authenticated - Content rendered when the user is authenticated (e.g. user menu).
|
|
6
|
+
* @slot unauthenticated - Content rendered when the user is not authenticated (e.g. login link).
|
|
7
|
+
*/
|
|
8
|
+
export class PostLoginWidget {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.authenticated = null;
|
|
11
|
+
}
|
|
12
|
+
async componentWillLoad() {
|
|
13
|
+
if (Build.isBrowser) {
|
|
14
|
+
await this.fetchAuthState();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns the current authentication state:
|
|
19
|
+
* `null` when the component is still loading, `true` when authenticated, `false` when not.
|
|
20
|
+
*/
|
|
21
|
+
async isAuthenticated() {
|
|
22
|
+
return this.authenticated;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Re-fetches the authentication state from the session API and updates
|
|
26
|
+
* the component rendering accordingly.
|
|
27
|
+
*/
|
|
28
|
+
async refresh() {
|
|
29
|
+
await this.fetchAuthState();
|
|
30
|
+
}
|
|
31
|
+
async fetchAuthState() {
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch(SESSION_URL, {
|
|
34
|
+
credentials: 'include',
|
|
35
|
+
});
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
this.setAuthState(false);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const json = await response.json();
|
|
41
|
+
const isAuthenticated = json?.data?.email !== undefined;
|
|
42
|
+
this.setAuthState(isAuthenticated);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
this.setAuthState(false);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
setAuthState(next) {
|
|
49
|
+
if (this.authenticated === next)
|
|
50
|
+
return;
|
|
51
|
+
this.authenticated = next;
|
|
52
|
+
this.postChange.emit({ authenticated: next });
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
return (h(Host, { key: '18fab2f7f7e699565e179362a43f7ada87f443fa', "data-version": version }, this.authenticated === true ? h("slot", { name: "authenticated" }) : h("slot", { name: "unauthenticated" })));
|
|
56
|
+
}
|
|
57
|
+
static get is() { return "post-login-widget"; }
|
|
58
|
+
static get encapsulation() { return "shadow"; }
|
|
59
|
+
static get states() {
|
|
60
|
+
return {
|
|
61
|
+
"authenticated": {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
static get events() {
|
|
65
|
+
return [{
|
|
66
|
+
"method": "postChange",
|
|
67
|
+
"name": "postChange",
|
|
68
|
+
"bubbles": true,
|
|
69
|
+
"cancelable": true,
|
|
70
|
+
"composed": true,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": "Emitted when the authentication state changes.\nThe event payload is an object with an `authenticated` property:\n`true` when the user is logged in, `false` when the user is not logged in or the API request failed."
|
|
74
|
+
},
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "{ authenticated: boolean }",
|
|
77
|
+
"resolved": "{ authenticated: boolean; }",
|
|
78
|
+
"references": {}
|
|
79
|
+
}
|
|
80
|
+
}];
|
|
81
|
+
}
|
|
82
|
+
static get methods() {
|
|
83
|
+
return {
|
|
84
|
+
"isAuthenticated": {
|
|
85
|
+
"complexType": {
|
|
86
|
+
"signature": "() => Promise<boolean | null>",
|
|
87
|
+
"parameters": [],
|
|
88
|
+
"references": {
|
|
89
|
+
"Promise": {
|
|
90
|
+
"location": "global",
|
|
91
|
+
"id": "global::Promise"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"return": "Promise<boolean>"
|
|
95
|
+
},
|
|
96
|
+
"docs": {
|
|
97
|
+
"text": "Returns the current authentication state:\n`null` when the component is still loading, `true` when authenticated, `false` when not.",
|
|
98
|
+
"tags": []
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"refresh": {
|
|
102
|
+
"complexType": {
|
|
103
|
+
"signature": "() => Promise<void>",
|
|
104
|
+
"parameters": [],
|
|
105
|
+
"references": {
|
|
106
|
+
"Promise": {
|
|
107
|
+
"location": "global",
|
|
108
|
+
"id": "global::Promise"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"return": "Promise<void>"
|
|
112
|
+
},
|
|
113
|
+
"docs": {
|
|
114
|
+
"text": "Re-fetches the authentication state from the session API and updates\nthe component rendering accordingly.",
|
|
115
|
+
"tags": []
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -20,7 +20,7 @@ export class PostLogo {
|
|
|
20
20
|
render() {
|
|
21
21
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
22
22
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
23
|
-
return (h(Host, { key: '
|
|
23
|
+
return (h(Host, { key: '5528ee847f979c29d8d9725a13d51f7ae88cb82c', "data-version": version }, h(LogoTag, { key: '01fea0f610e8d05d3ae60b5dc48e0d38cbb829ea', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: '69d1b9f22d0be6ce4e7610826e6c2704fcd18562', class: "description" }, h("slot", { key: '01757e716e2802f8925f1500562f1dae07d1be5d', onSlotchange: () => this.checkDescription() })), h("svg", { key: '0c5b19b4d86dc497cd65776185d886c4a7efcef6', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '67f81f4c92ed9f31f75a8e5f79e28aef39751176', id: "Logo" }, h("rect", { key: '61d495c7f120e9687167debd4786f2df86f6b782', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: 'a973c44179ceea3f79519940717328d88d7c9c8c', 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: 'b2baa874a1297b5a12cb154628c6a1622d525eaf', 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" }))))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "post-logo"; }
|
|
26
26
|
static get encapsulation() { return "shadow"; }
|
|
@@ -123,7 +123,7 @@ export class PostMainnavigation {
|
|
|
123
123
|
}, NAVBAR_DISABLE_DURATION);
|
|
124
124
|
}
|
|
125
125
|
render() {
|
|
126
|
-
return (h(Host, { key: '
|
|
126
|
+
return (h(Host, { key: '8ca88f8aefeb3f86f8fef5e8a2c700080d08cc23', version: version, class: this.canScroll ? 'scrollable' : '' }, h("div", { key: '19802d74560b506bae61ba2bae6436345c92ff19', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: '2ddb3c7e59aeea3d22c80c2406ba7fddef415212', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: '094c4573ff3546c58d8a87eb7202619497003f1c', ref: el => (this.navbar = el), "aria-label": this.textMain }, h("slot", { key: 'e4d33b589fdd9d170d589bd96df904a7e84834e2' })), h("div", { key: '5197788f1916341260fa3623f41e0966040a3832', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: '3cd0d8dc0e05787f73f5e8f3e310bc430b1fbdaa', "aria-hidden": "true", name: "chevronright" }))));
|
|
127
127
|
}
|
|
128
128
|
static get is() { return "post-mainnavigation"; }
|
|
129
129
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
*,::before,::after{box-sizing:border-box}.megadropdown{position:absolute;inset-inline:0;overflow-y:auto;
|
|
1
|
+
*,::before,::after{box-sizing:border-box}.megadropdown{position:absolute;inset-inline:0;overflow-y:auto;box-shadow:var(--post-device-elevation-300)}@media screen and (min-width: 1024px){.megadropdown{background-color:#f0efed;z-index:-1;inset-block-start:100%}.megadropdown.slide-in{animation:slide-down 350ms forwards}.megadropdown.slide-out{animation:slide-up 350ms forwards}}@media screen and (max-width: 1023.98px){.megadropdown{background-color:#fafafa;z-index:1;inset-block-start:var(--post-header-navigation-current-inset);overscroll-behavior:contain}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown{border-block-end:1px solid CanvasText}}.section{width:100%;max-width:var(--post-header-content-max-width);margin-inline:auto;position:relative}@media screen and (min-width: 1024px){.section{max-height:calc(100vh - var(--post-header-height) - 3rem);padding:3rem 2.5rem 2.5rem}}@media screen and (max-width: 1023.98px){.section{display:flex;flex-direction:column;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));padding-inline:var(--post-burger-menu-padding-inline);padding-block:1.5rem}}.megadropdown-title{margin-block:0 1rem;font-weight:950}@media screen and (min-width: 600px)and (max-width: 1023.98px){.megadropdown-title{font-size:1.25rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.megadropdown-title{font-size:1.125rem}}.back-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-4);gap:var(--post-device-spacing-gap-inline-11);padding:0 var(--post-device-spacing-padding-inline-7);border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);order:-1;width:fit-content;padding-inline:0}.back-button:hover{text-decoration:none}.back-button:disabled{border-style:var(--post-core-border-style-dash)}.back-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.back-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:is(a){color:LinkText;border:unset}.back-button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.back-button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.back-button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.back-button>post-icon{width:var(--post-device-sizing-interactive-button-icon-5);height:var(--post-device-sizing-interactive-button-icon-5)}.back-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}@media screen and (min-width: 600px)and (max-width: 1023.98px){.back-button{margin-block-end:2rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.back-button{margin-block-end:1.5rem}}.close-button{position:absolute;inset-block-start:.5rem;inset-inline-end:.5rem}@media screen and (max-width: 1023.98px){.close-button{display:none}}
|
|
@@ -61,7 +61,7 @@ export class PostMegadropdown {
|
|
|
61
61
|
this.handleClickOutside = this.handleClickOutside.bind(this);
|
|
62
62
|
}
|
|
63
63
|
connectedCallback() {
|
|
64
|
-
|
|
64
|
+
globalThis.addEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
65
65
|
}
|
|
66
66
|
componentDidRender() {
|
|
67
67
|
this.getFocusableElements();
|
|
@@ -74,7 +74,7 @@ export class PostMegadropdown {
|
|
|
74
74
|
this.handleAriaCurrentChange([]);
|
|
75
75
|
}
|
|
76
76
|
disconnectedCallback() {
|
|
77
|
-
|
|
77
|
+
globalThis.removeEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
78
78
|
if (PostMegadropdown.activeDropdown === this)
|
|
79
79
|
PostMegadropdown.activeDropdown = null;
|
|
80
80
|
this.removeListeners();
|
|
@@ -222,7 +222,7 @@ export class PostMegadropdown {
|
|
|
222
222
|
...getFocusableChildren(this.host.shadowRoot),
|
|
223
223
|
];
|
|
224
224
|
this.firstFocusableEl = focusableElements[0];
|
|
225
|
-
this.lastFocusableEl = focusableElements
|
|
225
|
+
this.lastFocusableEl = focusableElements.at(-1);
|
|
226
226
|
}
|
|
227
227
|
// Loop through the focusable children
|
|
228
228
|
keyboardHandler(e) {
|
|
@@ -277,7 +277,7 @@ export class PostMegadropdown {
|
|
|
277
277
|
* and sets the trigger as active accordingly.
|
|
278
278
|
*/
|
|
279
279
|
handleAriaCurrentChange(mutations) {
|
|
280
|
-
if (
|
|
280
|
+
if (mutations.length === 0)
|
|
281
281
|
return;
|
|
282
282
|
const hasCurrentPage = mutations.some(m => m.target instanceof HTMLElement && m.target.getAttribute('aria-current') === 'page');
|
|
283
283
|
this.setTriggerActive(hasCurrentPage);
|
|
@@ -293,7 +293,7 @@ export class PostMegadropdown {
|
|
|
293
293
|
}
|
|
294
294
|
render() {
|
|
295
295
|
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
296
|
-
return (h(Host, { key: '
|
|
296
|
+
return (h(Host, { key: '6961721fc95306bdde7808d14555fba7fe984f1f', version: version }, h("div", { key: '1e1ae3f0610d666f4007762a6e8538e60423ab19', ref: el => (this.animatedContainer = el), class: "megadropdown", style: containerStyle }, h("div", { key: 'bd26a45af7ef5258d2ac19b86f4e6ffa246e8135', class: "section" }, this.device !== 'desktop' && this.megadropdownTitle && (h("p", { key: '7ad8428c845d35403eb74f1b01d695d91bb9f318', class: "megadropdown-title" }, this.megadropdownTitle)), h("div", { key: '60dbccee09c3fe8b52d530a953128172d6350d95', class: "megadropdown-content" }, h("slot", { key: 'e00a6ac942735d8029292cf77302940b2a117ae6' })), 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))))));
|
|
297
297
|
}
|
|
298
298
|
static get is() { return "post-megadropdown"; }
|
|
299
299
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:.25rem .625rem;gap:.375rem;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}button:hover{text-decoration:none}button:disabled{border-style:var(--post-core-border-style-dash)}button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(a){color:LinkText;border:unset}button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg);color:var(--post-scheme-color-interactive-button-primary-enabled-fg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg)}button{--post-nav-item-border-width: 1px;width:100%;justify-content:start;position:relative;padding:.75rem .75rem calc(.75rem - var(--post-nav-item-border-width)) .5rem;gap:1rem;border-radius:0;line-height:1.5;outline-color:currentColor !important;border-bottom:var(--post-nav-item-border-width) solid currentColor;height:100%}button:hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg);border-bottom-color:rgba(0,0,0,0)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:none}button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline:none !important}button:is(:focus-visible,:has(:focus-visible),.pretend-focus)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:is(:focus-visible,:has(:focus-visible),.pretend-focus):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:is(:focus-visible,:has(:focus-visible),.pretend-focus):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@supports not selector(:has(:focus-visible)){button:is(:focus-visible,:focus-within,.pretend-focus){outline:none !important}button:is(:focus-visible,:focus-within,.pretend-focus)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:is(:focus-visible,:focus-within,.pretend-focus):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:is(:focus-visible,:focus-within,.pretend-focus):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}}button>post-icon:where(:last-child){margin-inline-start:auto}@media screen and (min-width: 0)and (max-width: 599.98px){button{padding:calc(.5rem + 1.5px) .75rem calc(.5rem + 1.5px - var(--post-nav-item-border-width)) .5rem;gap:.5rem;font-size:.875rem}button>post-icon{font-size:1rem}}@media screen and (min-width: 600px)and (max-width: 1023.98px){button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){button{padding:1rem .75rem;gap:.5rem;border-bottom:none}}:host{position:relative;display:inline-block}button post-icon{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true]) post-icon{transform:rotate(180deg)}button>span{position:relative}button>span>span[aria-hidden]{font-weight:700;visibility:hidden}button>span>span[aria-hidden]:where(span:empty+*){visibility:visible}button>span>span:not([aria-hidden]){position:absolute;inset:0}@media screen and (min-width: 1024px){button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){font-weight:700}}@media screen and (max-width: 1023.98px){button post-icon{margin-inline-start:auto;transform:rotate(-90deg) !important}}
|
|
1
|
+
button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:.25rem .625rem;gap:.375rem;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg)}button:hover{text-decoration:none}button:disabled{border-style:var(--post-core-border-style-dash)}button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(a){color:LinkText;border:unset}button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg);color:var(--post-scheme-color-interactive-button-primary-enabled-fg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg)}button{--post-nav-item-border-width: 1px;width:100%;justify-content:start;position:relative;padding:.75rem .75rem calc(.75rem - var(--post-nav-item-border-width)) .5rem;gap:1rem;border-radius:0;line-height:1.5;outline-color:currentColor !important;border-bottom:var(--post-nav-item-border-width) solid currentColor;height:100%}button:hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);color:var(--post-scheme-color-interactive-button-primary-hover-fg);border-bottom-color:rgba(0,0,0,0)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:none}button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline:none !important}button:is(:focus-visible,:has(:focus-visible),.pretend-focus)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:is(:focus-visible,:has(:focus-visible),.pretend-focus):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:is(:focus-visible,:has(:focus-visible),.pretend-focus):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@supports not selector(:has(:focus-visible)){button:is(:focus-visible,:focus-within,.pretend-focus){outline:none !important}button:is(:focus-visible,:focus-within,.pretend-focus)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:is(:focus-visible,:focus-within,.pretend-focus):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:is(:focus-visible,:focus-within,.pretend-focus):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}}button>post-icon:where(:last-child){margin-inline-start:auto}@media screen and (min-width: 0)and (max-width: 599.98px){button{padding:calc(.5rem + 1.5px) .75rem calc(.5rem + 1.5px - var(--post-nav-item-border-width)) .5rem;gap:.5rem;font-size:.875rem}button>post-icon{font-size:1rem}}@media screen and (min-width: 600px)and (max-width: 1023.98px){button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){button{padding:1rem .75rem;gap:.5rem;border-bottom:none}}:host{position:relative;display:inline-block}button post-icon{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true]) post-icon{transform:rotate(180deg)}button>span{position:relative}button>span>span[aria-hidden]{font-weight:700;visibility:hidden}button>span>span[aria-hidden]:where(span:empty+*){visibility:visible}button>span>span:not([aria-hidden]){position:absolute;inset:0}@media screen and (min-width: 1024px){button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){font-weight:700}button[aria-expanded=true]{background-color:#f0efed;color:#050400;z-index:2}button[aria-expanded=true]:hover{box-shadow:inset 0 -0.7px 0 0 #f0efed}button[aria-expanded=true]:is(:focus-visible,:has(:focus-visible),.pretend-focus)::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}@supports not selector(:has(:focus-visible)){button[aria-expanded=true]:is(:focus-visible,:focus-within,.pretend-focus)::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}}}@media screen and (max-width: 1023.98px){button post-icon{margin-inline-start:auto;transform:rotate(-90deg) !important}}
|
|
@@ -77,7 +77,7 @@ export class PostMegadropdownTrigger {
|
|
|
77
77
|
this.megadropdown.toggle();
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: 'e70a1f0d724c551389128512ae41ff30a2869866', "data-version": version }, h("button", { key: 'a3beb6e4340c36b2d05a4e3cef8ee59d2fc39be0', 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: 'ebdccdbce9d5073aa2514b839305e330310651c7' }, h("span", { key: '3b0e98926b7dc995e03ac401eaaedcf52317ad2f', innerHTML: this.slottedContent }), h("span", { key: '9d3728e8bd06e3f1a94b4b7dca77d47d30620236', "aria-hidden": "true" }, h("slot", { key: 'c3f3d283e5cef0b4fbf00197aed283492a4f547a' }))), h("post-icon", { key: '859a8d953f7ad844acd724dafdcb5fbb0ec706af', name: "chevrondown" }))));
|
|
81
81
|
}
|
|
82
82
|
static get is() { return "post-megadropdown-trigger"; }
|
|
83
83
|
static get encapsulation() { return "shadow"; }
|
|
@@ -144,7 +144,7 @@ export class PostMenu {
|
|
|
144
144
|
}
|
|
145
145
|
controlKeyDownHandler(e) {
|
|
146
146
|
const menuItems = this.getSlottedItems();
|
|
147
|
-
if (
|
|
147
|
+
if (menuItems.length === 0) {
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
let currentIndex = menuItems.findIndex(el => {
|
|
@@ -191,7 +191,7 @@ export class PostMenu {
|
|
|
191
191
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
192
192
|
}
|
|
193
193
|
render() {
|
|
194
|
-
return (h(Host, { key: '
|
|
194
|
+
return (h(Host, { key: '6a7129370201b73724e51376165ce7ee038b5b86', "data-version": version }, h("post-popovercontainer", { key: '7cfae6f686abce9d6bcdf9667c9b0ef8926f3c2d', onPostShow: this.handlePostShown.bind(this), onPostBeforeToggle: this.handlePostBeforeToggle.bind(this), placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '5676f467dcc64043b27fc9698feae24bbb7f2c97', part: "post-menu" }, h("slot", { key: 'e13b59b81063e52438209ac05f4414f19e2cb9d4', name: "header" }), h("slot", { key: '90e634aa424e18a1340559921db6aca4f8c2e1fd' })))));
|
|
195
195
|
}
|
|
196
196
|
static get is() { return "post-menu"; }
|
|
197
197
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { version } from "../../../../package";
|
|
2
2
|
export class PostMenuItem {
|
|
3
3
|
connectedCallback() {
|
|
4
|
-
this.host.
|
|
4
|
+
this.host.dataset.version = version;
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "post-menu-item"; }
|
|
7
7
|
static get originalStyleUrls() {
|
|
@@ -59,7 +59,7 @@ export class PostMenuTrigger {
|
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
61
|
render() {
|
|
62
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: 'fd213ee318ddc2b8437845af14b9d9cff16d2eaf', "data-version": version }, h("slot", { key: 'bd6d334a734bdc0d964d088131479cf8e6eb2e3b' })));
|
|
63
63
|
}
|
|
64
64
|
static get is() { return "post-menu-trigger"; }
|
|
65
65
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
:host{display:inline-flex;align-items:end}
|
|
1
|
+
:host{display:inline-flex;align-items:end;width:100%}:host ::slotted(input[type=number]),:host .step-button{height:var(--post-device-sizing-interactive-button-height-6) !important}:host ::slotted(input[type=number]){border-radius:0 !important;padding-inline:var(--post-device-spacing-padding-inline-1);padding-block-start:var(--post-device-spacing-padding-block-29);padding-block-end:var(--post-device-spacing-padding-block-3)}:host ::slotted(input[type=number]:focus){outline:none !important}:host .step-button.disabled{background-color:var(--post-scheme-color-interactive-button-secondary-disabled-bg);color:var(--post-scheme-color-interactive-button-secondary-disabled-fg);border-color:var(--post-scheme-color-interactive-button-secondary-disabled-stroke);border-style:var(--post-core-border-style-dash)}:host(.number-input-sm) ::slotted(input[type=number]),:host(.number-input-sm) .step-button{height:var(--post-device-sizing-interactive-button-height-8) !important}:host(.number-input-sm) ::slotted(input[type=number]){font-size:var(--post-device-font-size-7) !important;padding-inline:var(--post-device-spacing-padding-inline-1) !important;padding-block:var(--post-device-spacing-padding-29) !important}:host(.number-input-sm) ::slotted(input[type=number].is-valid),:host(.number-input-sm) ::slotted(input[type=number].is-invalid){background-size:var(--post-device-sizing-notification-5) !important;padding-inline-end:calc(
|
|
2
|
+
(var(--post-device-spacing-padding-inline-1)* 2) +
|
|
3
|
+
var(--post-device-sizing-notification-5)
|
|
4
|
+
) !important}:host(.number-input-sm) .step-button{padding-inline:var(--post-device-spacing-padding-32);padding-block:var(--post-device-spacing-padding-2)}:host(.number-input-sm) .step-button post-icon{width:var(--post-device-sizing-interactive-icon-size7);height:var(--post-device-sizing-interactive-icon-size7)}:host(:hover) .step-button:not(.disabled){background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg);border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke)}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:hover) .step-button:not(.disabled){border-color:Highlight}}:host(:hover) .step-button:not(.disabled),:host(:hover) .step-button:not(.disabled) post-icon{color:var(--post-scheme-color-interactive-button-secondary-hover-fg)}.input-container{position:relative;flex-grow:1}.input-container:focus-within::after{content:"";pointer-events:none;z-index:2;width:calc(100% + (var(--post-device-border-width-default) * 2));height:calc(100% + (var(--post-device-border-width-default) * 2));border:var(--post-device-border-width-focus) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-focus-stroke);position:absolute;border-radius:var(--post-device-border-radius-1);top:calc((var(--post-device-border-width-default) * 2)*-1);left:calc((var(--post-device-border-width-default) * 2)*-1)}.step-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;transition:unset;box-sizing:border-box;flex:0 0 auto;border-radius:var(--post-device-border-radius-1);padding-inline:var(--post-device-spacing-padding-23);padding-block:var(--post-device-spacing-padding-22);box-shadow:var(--post-device-elevation-100);border:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-button-secondary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg)}.step-button:hover{text-decoration:none}.step-button:disabled{border-style:var(--post-core-border-style-dash)}.step-button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.step-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.step-button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:is(a){color:LinkText;border:unset}.step-button:is(button){background-color:ButtonFace !important;border:1px solid ButtonBorder !important}.step-button:not(:disabled,.disabled):is(button):hover{background-color:Highlight !important}.step-button:not(:disabled,.disabled):is(button):hover>post-icon{color:HighlightText !important}}.step-button post-icon{width:var(--post-device-sizing-interactive-icon-size6);height:var(--post-device-sizing-interactive-icon-size6)}.step-button:first-of-type{border-start-end-radius:0;border-end-end-radius:0;border-inline-end-width:0}.step-button:last-of-type{border-start-start-radius:0;border-end-start-radius:0;border-inline-start-width:0}.step-button.disabled{pointer-events:none;cursor:unset}
|
|
@@ -3,20 +3,24 @@ import { debounce } from "throttle-debounce";
|
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import { getSlottedElement, repeatOnLongPress } from "../../utils/index";
|
|
5
5
|
function parseNumber(input, key) {
|
|
6
|
-
const value = parseFloat(input[key]);
|
|
7
|
-
return isNaN(value) ? undefined : value;
|
|
6
|
+
const value = Number.parseFloat(input[key]);
|
|
7
|
+
return Number.isNaN(value) ? undefined : value;
|
|
8
8
|
}
|
|
9
9
|
function compare(value, bound, comparator) {
|
|
10
10
|
return value !== undefined && bound !== undefined && comparator(value, bound);
|
|
11
11
|
}
|
|
12
12
|
export class PostNumberInput {
|
|
13
13
|
constructor() {
|
|
14
|
+
this.isDisabled = false;
|
|
14
15
|
this.isIncrementDisabled = false;
|
|
15
16
|
this.isDecrementDisabled = false;
|
|
17
|
+
this.small = false;
|
|
16
18
|
this.setupInput = debounce(50, () => {
|
|
17
19
|
this.input = this.input ?? getSlottedElement(this.host, 'input[type="number"]');
|
|
18
20
|
if (!this.input)
|
|
19
21
|
return;
|
|
22
|
+
this.isDisabled = this.input.disabled;
|
|
23
|
+
this.small = this.input.classList.contains('form-control-sm');
|
|
20
24
|
// step buttons may be disabled when the input loads
|
|
21
25
|
this.updateStepButtonState();
|
|
22
26
|
// step buttons may become disabled after the value is changed via keyboard / typing
|
|
@@ -84,7 +88,10 @@ export class PostNumberInput {
|
|
|
84
88
|
}
|
|
85
89
|
render() {
|
|
86
90
|
const areButtonsShown = !!this.input;
|
|
87
|
-
return (h(Host, { key: '
|
|
91
|
+
return (h(Host, { key: '1a1defb8024bc4dcfcf6f979f93420a325bb1012', "data-version": version, class: {
|
|
92
|
+
'number-input-sm': this.small,
|
|
93
|
+
'disabled': this.isDisabled,
|
|
94
|
+
} }, areButtonsShown && (h("div", { key: 'a23952d7f1a43f6ff1e782adcab869371a40e101', "aria-hidden": "true", onPointerDown: () => this.step('down'), class: { 'step-button': true, 'disabled': this.isDecrementDisabled } }, h("post-icon", { key: 'eeb4537e9ac72197acd575ae10229f49f136fd4d', name: "minus" }))), h("div", { key: '1e0c3563ebace9de810a0fe149b7b2b92e226315', class: "input-container" }, h("slot", { key: '7dba31b4f6b4bfb644f9285a9514aa5f927d46ec', onSlotchange: () => this.setupInput() })), areButtonsShown && (h("div", { key: '7d5ab980dc88e22cf707d2c07a862ed3c3c96b42', "aria-hidden": "true", onPointerDown: () => this.step('up'), class: { 'step-button': true, 'disabled': this.isIncrementDisabled } }, h("post-icon", { key: 'ed409eab6593d3077a6f42123d61847bd1766b43', name: "plus" })))));
|
|
88
95
|
}
|
|
89
96
|
static get is() { return "post-number-input"; }
|
|
90
97
|
static get encapsulation() { return "shadow"; }
|
|
@@ -100,8 +107,10 @@ export class PostNumberInput {
|
|
|
100
107
|
}
|
|
101
108
|
static get states() {
|
|
102
109
|
return {
|
|
110
|
+
"isDisabled": {},
|
|
103
111
|
"isIncrementDisabled": {},
|
|
104
112
|
"isDecrementDisabled": {},
|
|
113
|
+
"small": {},
|
|
105
114
|
"input": {}
|
|
106
115
|
};
|
|
107
116
|
}
|
|
@@ -101,7 +101,7 @@ export class PostPagination {
|
|
|
101
101
|
scheduleMeasurement() {
|
|
102
102
|
if (!this.loaded)
|
|
103
103
|
return;
|
|
104
|
-
this.measurementTimeoutId =
|
|
104
|
+
this.measurementTimeoutId = globalThis.setTimeout(() => {
|
|
105
105
|
const canMeasure = this.navRef?.clientWidth > 0 && this.hiddenItemsRef;
|
|
106
106
|
if (canMeasure) {
|
|
107
107
|
this.measureAndCalculateVisiblePages();
|
|
@@ -173,9 +173,9 @@ export class PostPagination {
|
|
|
173
173
|
getPaginationPadding() {
|
|
174
174
|
if (!this.navRef)
|
|
175
175
|
return 0;
|
|
176
|
-
const computedStyle =
|
|
177
|
-
const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
|
178
|
-
const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
|
176
|
+
const computedStyle = globalThis.getComputedStyle(this.navRef);
|
|
177
|
+
const paddingLeft = Number.parseFloat(computedStyle.paddingLeft) || 0;
|
|
178
|
+
const paddingRight = Number.parseFloat(computedStyle.paddingRight) || 0;
|
|
179
179
|
return paddingLeft + paddingRight;
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
@@ -196,8 +196,8 @@ export class PostPagination {
|
|
|
196
196
|
* Clamps the page number to valid range
|
|
197
197
|
*/
|
|
198
198
|
clampPageToValidRange(totalPages) {
|
|
199
|
-
const invalidTotalPages = totalPages === 0 || this.invalidSize || isNaN(totalPages);
|
|
200
|
-
const invalidPage = !this.page || this.page < 1 || isNaN(this.page);
|
|
199
|
+
const invalidTotalPages = totalPages === 0 || this.invalidSize || Number.isNaN(totalPages);
|
|
200
|
+
const invalidPage = !this.page || this.page < 1 || Number.isNaN(this.page);
|
|
201
201
|
const pageExceedsTotal = this.page > totalPages;
|
|
202
202
|
if (invalidTotalPages || invalidPage) {
|
|
203
203
|
return 1;
|
|
@@ -62,7 +62,7 @@ export class PostPopover {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: '6c2562d4387dcbbd298bf438da50053a8737585f', "data-version": version }, h("post-popovercontainer", { key: '1652f2a6647c0fae7ee9e371db0d6a2ceedc1396', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '9788322373590a2e63043999991cd783dff00c63', class: "popover-container" }, h("div", { key: '9e0df1357a3d2e774065995d0a43414f5c8ecca8', class: "popover-content" }, h("slot", { key: 'a407102dccd542eac230099ef577fce7e99b52cc' })), h("post-closebutton", { key: '490d4e82c6266cd277e98c4a079096b38b60d2aa', onClick: () => this.hide() }, this.textClose)))));
|
|
66
66
|
}
|
|
67
67
|
static get is() { return "post-popover"; }
|
|
68
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -105,7 +105,7 @@ export class PostPopoverTrigger {
|
|
|
105
105
|
this.popover?.removeEventListener('postToggle', this.boundHandlePostToggle);
|
|
106
106
|
}
|
|
107
107
|
render() {
|
|
108
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: '1ee10390dbe3667e8f61a36c0c64712b3c9b6fe9', "data-version": version }, h("slot", { key: 'c26260df89de55ccb71a29ddb53e559b6fae8bda', onSlotchange: () => this.setupTrigger() })));
|
|
109
109
|
}
|
|
110
110
|
static get is() { return "post-popover-trigger"; }
|
|
111
111
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Host, h, } from "@stencil/core";
|
|
2
|
-
import {
|
|
1
|
+
import { Host, h, Build, } from "@stencil/core";
|
|
2
|
+
import { checkEmptyOrOneOf, checkEmptyOrType } from "../../utils/index";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import { arrow, autoUpdate, computePosition, flip, inline, limitShift, offset, shift, size, } from "@floating-ui/dom";
|
|
5
5
|
import { PLACEMENT_TYPES } from "../../types/index";
|
|
@@ -14,6 +14,7 @@ const ANIMATIONS = {
|
|
|
14
14
|
*/
|
|
15
15
|
export class PostPopovercontainer {
|
|
16
16
|
constructor() {
|
|
17
|
+
this.toggleTimeoutId = null;
|
|
17
18
|
this.hasOpenedOnce = true;
|
|
18
19
|
/**
|
|
19
20
|
* Defines the placement of the popovercontainer according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
|
|
@@ -34,6 +35,7 @@ export class PostPopovercontainer {
|
|
|
34
35
|
*/
|
|
35
36
|
this.animation = 'pop-in';
|
|
36
37
|
this.currentAnimation = null;
|
|
38
|
+
this.boundMouseTrackingHandler = this.mouseTrackingHandler.bind(this);
|
|
37
39
|
}
|
|
38
40
|
validatePlacement() {
|
|
39
41
|
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
@@ -54,7 +56,7 @@ export class PostPopovercontainer {
|
|
|
54
56
|
this.host.style.setProperty('--post-safe-space-cursor-y', `${event.clientY}px`);
|
|
55
57
|
}
|
|
56
58
|
connectedCallback() {
|
|
57
|
-
if (
|
|
59
|
+
if (Build.isBrowser && !isSupported()) {
|
|
58
60
|
apply();
|
|
59
61
|
}
|
|
60
62
|
}
|
|
@@ -129,7 +131,7 @@ export class PostPopovercontainer {
|
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
if (this.safeSpace) {
|
|
132
|
-
|
|
134
|
+
globalThis.addEventListener('mousemove', this.boundMouseTrackingHandler);
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
/**
|
|
@@ -140,7 +142,7 @@ export class PostPopovercontainer {
|
|
|
140
142
|
this.clearAutoUpdate();
|
|
141
143
|
}
|
|
142
144
|
if (this.safeSpace) {
|
|
143
|
-
|
|
145
|
+
globalThis.removeEventListener('mousemove', this.boundMouseTrackingHandler);
|
|
144
146
|
}
|
|
145
147
|
// Cancel any running animation
|
|
146
148
|
if (this.currentAnimation) {
|
|
@@ -196,7 +198,7 @@ export class PostPopovercontainer {
|
|
|
196
198
|
* @param e ToggleEvent
|
|
197
199
|
*/
|
|
198
200
|
handleToggle(e) {
|
|
199
|
-
this.toggleTimeoutId =
|
|
201
|
+
this.toggleTimeoutId = globalThis.setTimeout(() => (this.toggleTimeoutId = null), 10);
|
|
200
202
|
const isOpen = e.newState === 'open';
|
|
201
203
|
if (isOpen) {
|
|
202
204
|
this.open();
|
|
@@ -219,7 +221,7 @@ export class PostPopovercontainer {
|
|
|
219
221
|
*/
|
|
220
222
|
getHeaderHeight() {
|
|
221
223
|
const header = document.querySelector('post-header');
|
|
222
|
-
return header ? parseFloat(getComputedStyle(header).height) : 0;
|
|
224
|
+
return header ? Number.parseFloat(getComputedStyle(header).height) : 0;
|
|
223
225
|
}
|
|
224
226
|
async calculatePosition() {
|
|
225
227
|
const { x, y, middlewareData, placement } = await this.computeMainPosition();
|
|
@@ -256,17 +258,23 @@ export class PostPopovercontainer {
|
|
|
256
258
|
}
|
|
257
259
|
async computeMainPosition() {
|
|
258
260
|
const gap = this.edgeGap;
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
|
|
261
|
+
const isAligned = (this.placement || 'top').includes('-');
|
|
262
|
+
const flipMiddleware = flip({
|
|
263
|
+
padding: this.getHeaderHeight(),
|
|
264
|
+
crossAxis: false,
|
|
265
|
+
});
|
|
266
|
+
const shiftMiddleware = shift({
|
|
267
|
+
padding: gap,
|
|
268
|
+
limiter: limitShift({
|
|
269
|
+
offset: 32,
|
|
262
270
|
}),
|
|
271
|
+
});
|
|
272
|
+
const middleware = [
|
|
273
|
+
offset(this.offset ?? (this.arrow ? gap + 4 : gap)),
|
|
263
274
|
inline(),
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
offset: 32,
|
|
268
|
-
}),
|
|
269
|
-
}),
|
|
275
|
+
// Per floating-ui docs: for aligned placements (e.g. bottom-end),
|
|
276
|
+
// flip should come before shift. For non-aligned, shift before flip.
|
|
277
|
+
...(isAligned ? [flipMiddleware, shiftMiddleware] : [shiftMiddleware, flipMiddleware]),
|
|
270
278
|
size({
|
|
271
279
|
apply({ availableWidth, elements }) {
|
|
272
280
|
Object.assign(elements.floating.style, {
|
|
@@ -274,7 +282,6 @@ export class PostPopovercontainer {
|
|
|
274
282
|
});
|
|
275
283
|
},
|
|
276
284
|
}),
|
|
277
|
-
offset(this.offset ?? (this.arrow ? gap + 4 : gap)),
|
|
278
285
|
];
|
|
279
286
|
if (this.arrow) {
|
|
280
287
|
middleware.push(arrow({ element: this.arrowRef, padding: gap }));
|
|
@@ -346,9 +353,9 @@ export class PostPopovercontainer {
|
|
|
346
353
|
}
|
|
347
354
|
}
|
|
348
355
|
render() {
|
|
349
|
-
return (h(Host, { key: '
|
|
356
|
+
return (h(Host, { key: 'ef2247b951044fe3b26af9ab90e269812345c04b', "data-version": version, popover: "auto" }, h("div", { key: '81a28e7873922a830c193e31a14523245315f3e2', part: "post-popovercontainer-content", class: "popover-content" }, this.arrow && (h("span", { key: '01bba4ef926779defb660d3d2b2d25c8cd030707', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
350
357
|
this.arrowRef = el;
|
|
351
|
-
} })), h("slot", { key: '
|
|
358
|
+
} })), h("slot", { key: '8fa288a638da1cfed3285b6605c64e3b3ff7bc07' }))));
|
|
352
359
|
}
|
|
353
360
|
static get is() { return "post-popovercontainer"; }
|
|
354
361
|
static get encapsulation() { return "shadow"; }
|
|
@@ -87,7 +87,7 @@ export class PostRating {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
render() {
|
|
90
|
-
return (h(Host, { key: '
|
|
90
|
+
return (h(Host, { key: 'bd452616dc47e25ae0f97eb77869e558eb0e199c', "data-version": version }, h("div", { key: 'a2d59f6007b337d906af31f7ebc4cc57022b0e67', 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: {
|
|
91
91
|
'star': true,
|
|
92
92
|
'before-hover': i < this.hoveredIndex,
|
|
93
93
|
'active': i < Math.round(this.currentRating),
|
|
@@ -53,7 +53,7 @@ export class PostStepper {
|
|
|
53
53
|
updateActiveStepNumber() {
|
|
54
54
|
if (this.textStepNumber) {
|
|
55
55
|
const labelTemplate = this.textStepNumber;
|
|
56
|
-
this.mobileActiveStepLabel = labelTemplate.
|
|
56
|
+
this.mobileActiveStepLabel = labelTemplate.replaceAll('#number', `${this.selectedIndex + 1}`);
|
|
57
57
|
if (this.stepItems) {
|
|
58
58
|
this.updateMobileActiveStepVisibility();
|
|
59
59
|
}
|
|
@@ -107,7 +107,7 @@ export class PostStepper {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
render() {
|
|
110
|
-
return (h(Host, { key: '
|
|
110
|
+
return (h(Host, { key: '3d406fc950ca7648c4c0588ddd059b872cdb9677', "data-version": version }, h("ol", { key: 'c6b626cce3debd84887b7bc3646d5e30bd08abb1' }, h("slot", { key: '235d456eae8d6d8b7422e2600e17e29e6c3cbc21', onSlotchange: () => this.updateSteps() })), h("div", { key: '9cd98332dfbf95ba548badb4d887a556a7d9a956', class: "active-step", "aria-hidden": "true" }, h("span", { key: 'c5302583b07195b093d1da4cc081215fdfc49337', class: "active-step-label" }, this.mobileActiveStepLabel), h("span", { key: 'bf6bf2724b8876641459e88ca27ed0b725a77d32', innerHTML: this.mobileActiveStepName }))));
|
|
111
111
|
}
|
|
112
112
|
static get is() { return "post-stepper"; }
|
|
113
113
|
static get encapsulation() { return "shadow"; }
|
|
@@ -2,7 +2,7 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
import { version } from "../../../../package";
|
|
3
3
|
export class PostStepperItem {
|
|
4
4
|
render() {
|
|
5
|
-
return (h(Host, { key: '
|
|
5
|
+
return (h(Host, { key: '7f3df658eb7640f582e438f218e3ec62fbb4edee', "data-version": version, role: "listitem" }, h("span", { key: 'bb7b02a3cca04d16626f66c52eb08085a8e9cb26', class: "stepper-item-content" }, h("span", { key: '78ca87ae8956838bc7fffec8e6d9121aa4aa14da', class: "step-hidden-label visually-hidden" }), h("span", { key: '6beecc79f02ed51046e6b7cc5006c305c821f9bc', class: "label" }, h("slot", { key: '5701a12b73a29bd629fa361bcd838c9a7ec88869' })))));
|
|
6
6
|
}
|
|
7
7
|
static get is() { return "post-stepper-item"; }
|
|
8
8
|
static get encapsulation() { return "shadow"; }
|