@swisspost/design-system-components 10.0.0-next.66 → 10.0.0-next.67
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-BTxzC_Qv.js} +4 -7
- package/dist/cjs/{get-focusable-children-SdEe5tt7.js → get-focusable-children-CL2gimr1.js} +4 -4
- package/dist/cjs/{get-root-CUAv4k4C.js → get-root-BIh00Adr.js} +2 -2
- package/dist/cjs/{index-YVR3WTTS.js → index-Byyrsgop.js} +17 -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-BMq-R5Xi.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 -22
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +7 -8
- package/dist/cjs/{post-closebutton_13.cjs.entry.js → post-closebutton_14.cjs.entry.js} +88 -68
- package/dist/cjs/post-collapsible_2.cjs.entry.js +10 -11
- 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-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 +3 -2
- package/dist/collection/collection-manifest.json +4 -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 +3 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +3 -3
- 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 +2 -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-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 +5 -5
- 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 +2 -2
- package/dist/collection/utils/breakpoints.js +6 -5
- package/dist/collection/utils/get-focusable-children.js +3 -3
- package/dist/collection/utils/get-root.js +2 -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 +2 -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 +3 -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 +6 -2
- package/dist/components/index.js +1 -1
- package/dist/components/package.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-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-htxkyM9X.js → p-6dWji_Xt.js} +1 -1
- package/dist/components/react/p-BIQP_u-p.js +1 -0
- package/dist/components/react/p-BlBcIJe_.js +1 -0
- package/dist/components/react/{p-CmA91vH_.js → p-Bq6Ye6Uc.js} +1 -1
- package/dist/components/react/p-BvY9Yl0A.js +1 -0
- package/dist/components/react/p-ByHBwvly.js +1 -0
- package/dist/components/react/{p-BcBg4WYn.js → p-C7drBbGl.js} +1 -1
- package/dist/components/react/p-CKkmf4_w.js +1 -0
- package/dist/components/react/p-CS77r1AS.js +1 -0
- package/dist/components/react/{p-C9bJM7_1.js → p-CY-_ZlW3.js} +1 -1
- package/dist/components/react/p-D3Tx-0vM.js +1 -0
- package/dist/components/react/p-DVY9jsO7.js +1 -0
- package/dist/components/react/p-Djnfi-_S.js +1 -0
- package/dist/components/react/p-DlHbGhvD.js +1 -0
- package/dist/components/react/p-DxJ0OgPJ.js +1 -0
- package/dist/components/react/{p-CdMrnWjS.js → p-RpVuZS9R.js} +1 -1
- 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-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 +483 -23
- package/dist/esm/{breakpoints-_gmb7vUy.js → breakpoints-CZuqK5QS.js} +4 -7
- package/dist/esm/{get-focusable-children-CFWKPWu9.js → get-focusable-children-CckqSLu_.js} +4 -4
- package/dist/esm/{get-root-CXfAA093.js → get-root-gmtbd8C-.js} +2 -2
- package/dist/esm/{index-Cj-Lzb7i.js → index-8Vx4ywJ4.js} +17 -9
- package/dist/esm/{index-CCMeku7U.js → index-D9bU2pIE.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-DVY9jsO7.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 -22
- package/dist/esm/post-breadcrumbs.entry.js +7 -8
- package/dist/esm/{post-closebutton_13.entry.js → post-closebutton_14.entry.js} +88 -69
- package/dist/esm/post-collapsible_2.entry.js +10 -11
- 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-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-0962f02e.entry.js +1 -0
- package/dist/post-components/p-0c22b6cb.entry.js +1 -0
- package/dist/post-components/p-11dfed23.entry.js +1 -0
- package/dist/post-components/{p-46f30771.entry.js → p-136052d8.entry.js} +1 -1
- package/dist/post-components/p-15d519e6.entry.js +1 -0
- package/dist/post-components/p-16573e00.entry.js +1 -0
- package/dist/post-components/p-29859921.entry.js +1 -0
- package/dist/post-components/p-3a294f1a.entry.js +1 -0
- package/dist/post-components/p-44481053.entry.js +1 -0
- package/dist/post-components/p-61d99723.entry.js +1 -0
- package/dist/post-components/p-68196501.entry.js +1 -0
- package/dist/post-components/p-6badcfb3.entry.js +1 -0
- package/dist/post-components/p-6c2558a3.entry.js +1 -0
- package/dist/post-components/p-6debd1d3.entry.js +1 -0
- package/dist/post-components/p-7b44e7e5.entry.js +1 -0
- package/dist/post-components/p-81aca7ec.entry.js +1 -0
- package/dist/post-components/p-85af10b8.entry.js +1 -0
- package/dist/post-components/p-8Vx4ywJ4.js +2 -0
- package/dist/post-components/p-951b3be6.entry.js +1 -0
- package/dist/post-components/{p-fe35968d.entry.js → p-9a3d4f38.entry.js} +1 -1
- package/dist/post-components/p-D81ozKs6.js +1 -0
- package/dist/post-components/p-D9bU2pIE.js +1 -0
- package/dist/post-components/p-DVY9jsO7.js +1 -0
- package/dist/post-components/p-DkA4Ai8j.js +1 -0
- package/dist/post-components/p-a4dd6a67.entry.js +1 -0
- package/dist/post-components/p-aFKnsRj1.js +1 -0
- package/dist/post-components/p-b13742e1.entry.js +1 -0
- package/dist/post-components/p-c5717005.entry.js +1 -0
- package/dist/post-components/p-ca7796c7.entry.js +1 -0
- package/dist/post-components/p-ce7bfb11.entry.js +1 -0
- package/dist/post-components/p-e14f0dd1.entry.js +1 -0
- package/dist/post-components/p-e5a2d0c3.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-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-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 +176 -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 +565 -1347
- package/hydrate/index.mjs +565 -1347
- package/package.json +8 -6
- 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-C1CrnSak.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-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/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
|
@@ -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: '84866a46bf2fdf8602213582e71fbc624fb3a7a6', "data-version": version, class: {
|
|
92
|
+
'number-input-sm': this.small,
|
|
93
|
+
'disabled': this.isDisabled,
|
|
94
|
+
} }, areButtonsShown && (h("div", { key: '33ed7af27e07a32d4063474889e15c568a140776', "aria-hidden": "true", onPointerDown: () => this.step('down'), class: { 'step-button': true, 'disabled': this.isDecrementDisabled } }, h("post-icon", { key: 'bf88349e2e442d4db77329cdd33332b5249e745a', name: "minus" }))), h("div", { key: '9e7cd209f45ef55f1e91dc5b9842fb9e56513f4b', class: "input-container" }, h("slot", { key: 'c3da29d4836c913f9ba466835afbd9219a6dc980', onSlotchange: () => this.setupInput() })), areButtonsShown && (h("div", { key: '4fe40703c338a8ec8b1efa9922bcd7b96b72aa30', "aria-hidden": "true", onPointerDown: () => this.step('up'), class: { 'step-button': true, 'disabled': this.isIncrementDisabled } }, h("post-icon", { key: 'da54f7441c60c4732cc671022a33ebb8cfae4472', 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: '859812ad40c54e61ea90625d0170cc0336d5eba3', "data-version": version }, h("post-popovercontainer", { key: '47cdd1e48d4bf937d74c90fbb7f8d7ab73af1593', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: 'ec5e72c7d463de0a92220d9a4e7be7fd6f6669a7', class: "popover-container" }, h("div", { key: '4934817369aa06236011af0e34763bd890ac3b4b', class: "popover-content" }, h("slot", { key: 'b3f56b3c9e5642cc210b18bd5a5abc4b4daf36e0' })), h("post-closebutton", { key: '354e2d16c3e4ba475a0cd030539da4a915950b1c', 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: '52d004cbdcb7be0b7df6c10f70f5b3bdbeb89a27', "data-version": version }, h("slot", { key: '5eabc986947a00ed1fad3ce3f8103e615f709d9f', 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: '9da5ddc34b0f749826341154e1893e2ac303ed4d', "data-version": version, popover: "auto" }, h("div", { key: 'd3a56362b6ecd910455873ce62b1f7a753c6eaa8', part: "post-popovercontainer-content", class: "popover-content" }, this.arrow && (h("span", { key: '45b982f1a4d1ca5ca4feae898b1e5ea338409455', "dynamic-placement": this.dynamicPlacement, class: "arrow", ref: el => {
|
|
350
357
|
this.arrowRef = el;
|
|
351
|
-
} })), h("slot", { key: '
|
|
358
|
+
} })), h("slot", { key: 'e9231da953aa6b0e4c63eede8aba900f16fab4b6' }))));
|
|
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: 'c8266ca9d136f7a10f3515e784acad64f4e14aca', "data-version": version }, h("div", { key: '042df9d7d808ce737f56785d3b622c20bad3f280', 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: 'c0f0b43848cf7cf2ad3b909b9ac3977214090f49', "data-version": version }, h("ol", { key: 'fb3b6a002e18355f731caa783c1c183e9d17719a' }, h("slot", { key: '3241341b4427e5b5963d5b2f1c8096752e447894', onSlotchange: () => this.updateSteps() })), h("div", { key: 'd7d4b983c5d038f2a214292882ba44c31a47e53d', class: "active-step", "aria-hidden": "true" }, h("span", { key: '82e9aaf029ed13effb873ee0cfcc44b06be18743', class: "active-step-label" }, this.mobileActiveStepLabel), h("span", { key: 'b1874d60c5fff75813094e93cb00b1249f513a55', 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: '95ebc80981c11cb53b992b55292c8588ece1425d', "data-version": version, role: "listitem" }, h("span", { key: '64a3d6e185d0df66e89e63a09e934129cd51c00f', class: "stepper-item-content" }, h("span", { key: '936c9473e1644a6f77a8b510a9159f3258ab97cc', class: "step-hidden-label visually-hidden" }), h("span", { key: 'd6d256202dd0cc53f106d8452660e96b77557219', class: "label" }, h("slot", { key: 'fe6ce78b72bbb24879fd4b5eba9594d8ef135bc2' })))));
|
|
6
6
|
}
|
|
7
7
|
static get is() { return "post-stepper-item"; }
|
|
8
8
|
static get encapsulation() { return "shadow"; }
|
|
@@ -33,7 +33,7 @@ export class PostTabItem {
|
|
|
33
33
|
this.isNavigationMode = hasAnchor;
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: 'e660f8e1051523a4a88a0ad4808b294c2f80bcbb', id: this.tabId, role: !this.isNavigationMode ? 'tab' : undefined, "data-version": version, "data-navigation-mode": this.isNavigationMode.toString(), "aria-selected": !this.isNavigationMode ? 'false' : undefined, tabindex: !this.isNavigationMode ? '-1' : undefined, class: !this.isNavigationMode ? 'tab-title' : 'nav-item' }, h("slot", { key: '9e5ec2ac67fbf1c56b8f7bd11205438d5ce08956' })));
|
|
37
37
|
}
|
|
38
38
|
static get is() { return "post-tab-item"; }
|
|
39
39
|
static get encapsulation() { return "shadow"; }
|
|
@@ -15,7 +15,7 @@ export class PostTabPanel {
|
|
|
15
15
|
this.panelId = `panel-${this.host.id || nanoid(6)}`;
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: '27d2f9dedd65a3500d477ce979ace6d9eb0d429a', "data-version": version, id: this.panelId, role: "tabpanel", slot: "panels" }, h("slot", { key: '890e7ec2bcf451d3281b224601597db281d6da58' })));
|
|
19
19
|
}
|
|
20
20
|
static get is() { return "post-tab-panel"; }
|
|
21
21
|
static get encapsulation() { return "shadow"; }
|
|
@@ -133,7 +133,7 @@ export class PostTabs {
|
|
|
133
133
|
// This works even before post-tab-item sets data-navigation-mode attribute
|
|
134
134
|
const hasNavigationTabs = this.tabs.some(tab => {
|
|
135
135
|
const hasAnchor = tab.querySelector('a') !== null;
|
|
136
|
-
const navModeAttr = tab.
|
|
136
|
+
const navModeAttr = tab.dataset.navigationMode === 'true';
|
|
137
137
|
return hasAnchor || navModeAttr;
|
|
138
138
|
});
|
|
139
139
|
const hasPanels = this.panels.length > 0;
|
|
@@ -282,7 +282,7 @@ export class PostTabs {
|
|
|
282
282
|
nextTab = this.tabs[activeTabIndex + 1] || this.tabs[0];
|
|
283
283
|
}
|
|
284
284
|
else {
|
|
285
|
-
nextTab = this.tabs[activeTabIndex - 1] || this.tabs
|
|
285
|
+
nextTab = this.tabs[activeTabIndex - 1] || this.tabs.at(-1);
|
|
286
286
|
}
|
|
287
287
|
if (!nextTab)
|
|
288
288
|
return;
|
|
@@ -291,10 +291,10 @@ export class PostTabs {
|
|
|
291
291
|
}
|
|
292
292
|
render() {
|
|
293
293
|
const TabsContainer = this.isNavigationMode ? 'nav' : 'div';
|
|
294
|
-
return (h(Host, { key: '
|
|
294
|
+
return (h(Host, { key: '5ae75fc550faae05dbca22e815a75e05f5cebc54', "data-version": version }, h("div", { key: '606990249519c2504e47e24b1e1b95c660278828', class: "tabs-wrapper", part: "post-tabs" }, h(TabsContainer, { key: 'ed0a4b53c47bc808e0c0713f4d014338e0124e37', class: "tabs", role: this.isNavigationMode ? undefined : 'tablist', "aria-label": this.isNavigationMode ? this.label : undefined }, h("slot", { key: 'ec504e221fb5694fea03630da0671b7c2c827648', onSlotchange: () => {
|
|
295
295
|
this.moveMisplacedTabs();
|
|
296
296
|
this.enableTabs();
|
|
297
|
-
} }))), !this.isNavigationMode && (h("div", { key: '
|
|
297
|
+
} }))), !this.isNavigationMode && (h("div", { key: '4bfd0fb25e0070b0a8ebeef0127cb8ac2b097bc0', class: "tab-content", part: "post-tabs-content" }, h("slot", { key: 'ecf2630c87dce6a797c1c13d31e5ead2b7f903d8', name: "panels", onSlotchange: () => this.moveMisplacedPanels() })))));
|
|
298
298
|
}
|
|
299
299
|
static get is() { return "post-tabs"; }
|
|
300
300
|
static get encapsulation() { return "shadow"; }
|
|
@@ -27,7 +27,7 @@ export class PostTogglebutton {
|
|
|
27
27
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e), { capture: true });
|
|
28
28
|
}
|
|
29
29
|
render() {
|
|
30
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: 'fdf27aa68db2c3e6757176894b5b293a563e444d', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '2be2ca3e516a3ee6f39f9dc943142cf5e138d1b2' })));
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "post-togglebutton"; }
|
|
33
33
|
static get encapsulation() { return "shadow"; }
|
|
@@ -64,7 +64,7 @@ export class PostTooltip {
|
|
|
64
64
|
}
|
|
65
65
|
render() {
|
|
66
66
|
const popoverClass = `${this.arrow ? 'has-arrow' : ''}`;
|
|
67
|
-
return (h(Host, { key: '
|
|
67
|
+
return (h(Host, { key: 'e3dd0e3b779563948a727958237ffb5ee3786c67', "data-version": version }, h("post-popovercontainer", { key: 'bcc80a61fa0292191efc0525c410630b8dbb29e3', safeSpace: "trapezoid", class: popoverClass, role: "tooltip", arrow: this.arrow, placement: this.placement, onPostBeforeToggle: e => this.handleBeforeToggle(e), ref: (el) => (this.popoverRef = el) }, h("slot", { key: '3b07a74f1edc3d7fc49211b4f85188ad8a05acad' }))));
|
|
68
68
|
}
|
|
69
69
|
static get is() { return "post-tooltip"; }
|
|
70
70
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { checkEmptyOrType
|
|
1
|
+
import { h, Host, Build } from "@stencil/core";
|
|
2
|
+
import { checkEmptyOrType } from "../../utils/index";
|
|
3
3
|
import { version } from "../../../../package";
|
|
4
4
|
import isFocusable from "ally.js/is/focusable";
|
|
5
5
|
const TRIGGER_EVENTS = ['pointerenter', 'pointerleave', 'focusin', 'focusout', 'long-press'];
|
|
6
|
-
if (
|
|
6
|
+
if (Build.isBrowser) {
|
|
7
7
|
(async () => {
|
|
8
8
|
await import('long-press-event');
|
|
9
9
|
})();
|
|
@@ -32,7 +32,7 @@ export class PostTooltipTrigger {
|
|
|
32
32
|
checkEmptyOrType(this, 'for', 'string');
|
|
33
33
|
}
|
|
34
34
|
get tooltip() {
|
|
35
|
-
if (
|
|
35
|
+
if (Build.isServer)
|
|
36
36
|
return null;
|
|
37
37
|
const ref = document.getElementById(this.for);
|
|
38
38
|
return ref?.localName === 'post-tooltip' ? ref : null;
|
|
@@ -151,7 +151,7 @@ export class PostTooltipTrigger {
|
|
|
151
151
|
interestHandler() {
|
|
152
152
|
if (this.trigger) {
|
|
153
153
|
if (this.delay > 0) {
|
|
154
|
-
this.delayTimeout =
|
|
154
|
+
this.delayTimeout = globalThis.setTimeout(() => {
|
|
155
155
|
this.tooltip?.show(this.trigger);
|
|
156
156
|
this.delayTimeout = null;
|
|
157
157
|
}, this.delay);
|
|
@@ -169,7 +169,7 @@ export class PostTooltipTrigger {
|
|
|
169
169
|
this.tooltip?.hide();
|
|
170
170
|
}
|
|
171
171
|
render() {
|
|
172
|
-
return (h(Host, { key: '
|
|
172
|
+
return (h(Host, { key: '130a5d8ad8e981ee3f46fbbfcab74afd4c2dce18', "data-version": version }, h("slot", { key: '6718994fc17acb24dbc176110c9a0356c4158e38', onSlotchange: () => this.handleSlotChange() })));
|
|
173
173
|
}
|
|
174
174
|
static get is() { return "post-tooltip-trigger"; }
|
|
175
175
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Build } from "@stencil/core";
|
|
2
2
|
export function getAttributeObserver(attribute, handler) {
|
|
3
3
|
/**
|
|
4
4
|
* Handle attribute changes and childList changes from the observer
|
|
@@ -20,5 +20,5 @@ export function getAttributeObserver(attribute, handler) {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
// Initialize a mutation observer for patching accessibility features
|
|
23
|
-
return
|
|
23
|
+
return Build.isBrowser ? new MutationObserver(observerHandler) : null;
|
|
24
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { throttle } from "throttle-debounce";
|
|
2
|
-
import {
|
|
2
|
+
import { Build } from "@stencil/core";
|
|
3
3
|
class Breakpoint {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.breakpoints = [
|
|
@@ -9,6 +9,7 @@ class Breakpoint {
|
|
|
9
9
|
{ key: 'sm', device: 'tablet', minWidth: 600 },
|
|
10
10
|
{ key: 'xs', device: 'mobile', minWidth: 0 },
|
|
11
11
|
];
|
|
12
|
+
this.resizeObserver = new ResizeObserver(() => this.updateCurrentBreakpoint());
|
|
12
13
|
this.updateCurrentBreakpoint = throttle(50, (options = { emitEvents: true }) => {
|
|
13
14
|
const previousBreakpoint = this.currentBreakpoint;
|
|
14
15
|
const newBreakpoint = this.breakpoints.find(breakpoint => {
|
|
@@ -23,15 +24,15 @@ class Breakpoint {
|
|
|
23
24
|
.filter(key => !previousBreakpoint || this.currentBreakpoint[key] !== previousBreakpoint[key])
|
|
24
25
|
.forEach((key) => this.dispatchEvent(key));
|
|
25
26
|
});
|
|
26
|
-
if (
|
|
27
|
+
if (Build.isServer)
|
|
27
28
|
return;
|
|
28
29
|
this.updateCurrentBreakpoint({ emitEvents: false });
|
|
29
|
-
|
|
30
|
+
this.resizeObserver.observe(document.body);
|
|
30
31
|
}
|
|
31
32
|
dispatchEvent(property) {
|
|
32
|
-
if (
|
|
33
|
+
if (Build.isServer)
|
|
33
34
|
return;
|
|
34
|
-
|
|
35
|
+
globalThis.dispatchEvent(new CustomEvent(`postBreakpoint:${property}`, { detail: this.currentBreakpoint[property] }));
|
|
35
36
|
}
|
|
36
37
|
get(property) {
|
|
37
38
|
this.updateCurrentBreakpoint({ emitEvents: false });
|
|
@@ -37,7 +37,7 @@ export function getDeepFocusableChildren(el, filter, visited = new Set()) {
|
|
|
37
37
|
// SLOT
|
|
38
38
|
if (el instanceof HTMLSlotElement) {
|
|
39
39
|
const assigned = el.assignedElements({ flatten: true });
|
|
40
|
-
nodes = assigned.length ? assigned : Array.from(el.children);
|
|
40
|
+
nodes = assigned.length > 0 ? assigned : Array.from(el.children);
|
|
41
41
|
}
|
|
42
42
|
// SHADOW ROOT
|
|
43
43
|
else if (el instanceof HTMLElement && el.shadowRoot) {
|
|
@@ -70,8 +70,8 @@ function isFocusBlockedByCSS(el) {
|
|
|
70
70
|
if (typeof el.checkVisibility === 'function') {
|
|
71
71
|
return !el.checkVisibility({ visibilityProperty: true });
|
|
72
72
|
}
|
|
73
|
-
const style =
|
|
74
|
-
if (style.display === 'none' || style.visibility !== 'visible') {
|
|
73
|
+
const style = el.ownerDocument?.defaultView?.getComputedStyle(el);
|
|
74
|
+
if (!style || style.display === 'none' || style.visibility !== 'visible') {
|
|
75
75
|
return true;
|
|
76
76
|
}
|
|
77
77
|
if (el.parentElement) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Build } from "@stencil/core";
|
|
2
2
|
/**
|
|
3
3
|
* getRootNode() can only be used after the element has been attached to the document!
|
|
4
4
|
* So use it for example in the componentDidLoad lifecycle hook.
|
|
5
5
|
*/
|
|
6
6
|
export function getRoot(element) {
|
|
7
|
-
const root =
|
|
7
|
+
const root = Build.isBrowser ? element.getRootNode() : element;
|
|
8
8
|
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
9
9
|
return root;
|
|
10
10
|
}
|
|
@@ -3,7 +3,6 @@ export * from './attribute-observer';
|
|
|
3
3
|
export * from './breakpoints';
|
|
4
4
|
export * from './component-on-ready';
|
|
5
5
|
export * from './debounce';
|
|
6
|
-
export * from './environment';
|
|
7
6
|
export * from './event-from';
|
|
8
7
|
export * from './get-focusable-children';
|
|
9
8
|
export * from './get-root';
|
|
@@ -3,7 +3,7 @@ export function isIsoDate(value) {
|
|
|
3
3
|
if (!ISO_REGEX.test(value))
|
|
4
4
|
return false;
|
|
5
5
|
const date = new Date(value); // strict UTC parsing
|
|
6
|
-
if (isNaN(date.getTime()))
|
|
6
|
+
if (Number.isNaN(date.getTime()))
|
|
7
7
|
return false;
|
|
8
8
|
// Roundtrip comparison to catch auto-corrected dates
|
|
9
9
|
// Use UTC getters to match the UTC parsing above - no timezone shift
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Build } from "@stencil/core";
|
|
2
2
|
export function isMotionReduced() {
|
|
3
|
-
return
|
|
3
|
+
return Build.isBrowser ? globalThis.matchMedia('(prefers-reduced-motion: reduce)').matches : true;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const EMPTY_VALUES = [undefined, null, '', NaN];
|
|
1
|
+
export const EMPTY_VALUES = [undefined, null, '', Number.NaN];
|
|
@@ -6,7 +6,6 @@ import { checkUrl } from "./check-url";
|
|
|
6
6
|
import { checkDate } from "./check-date";
|
|
7
7
|
import { emptyOr } from "./empty-or";
|
|
8
8
|
import { checkArrayOf } from "./check-array-of";
|
|
9
|
-
import { checkIsoDate } from "./check-iso-date";
|
|
10
9
|
export const checkEmptyOrOneOf = emptyOr(checkOneOf);
|
|
11
10
|
export const checkEmptyOrPattern = emptyOr(checkPattern);
|
|
12
11
|
export const checkEmptyOrType = emptyOr(checkType);
|
|
@@ -18,4 +17,4 @@ export const checkRequiredAndPattern = requiredAnd(checkPattern);
|
|
|
18
17
|
export const checkRequiredAndType = requiredAnd(checkType);
|
|
19
18
|
export const checkRequiredAndUrl = requiredAnd(checkUrl);
|
|
20
19
|
export const checkRequiredAndArrayOf = requiredAnd(checkArrayOf);
|
|
21
|
-
export { checkIsoDate };
|
|
20
|
+
export { checkIsoDate } from './check-iso-date';
|
|
@@ -2,13 +2,13 @@ export function repeatOnLongPress(callback, options) {
|
|
|
2
2
|
const stop = repeat(callback, options);
|
|
3
3
|
const handler = () => {
|
|
4
4
|
stop();
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
globalThis.removeEventListener('pointerup', handler);
|
|
6
|
+
globalThis.removeEventListener('pointercancel', handler);
|
|
7
|
+
globalThis.removeEventListener('pointerleave', handler);
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
globalThis.addEventListener('pointerup', handler);
|
|
10
|
+
globalThis.addEventListener('pointercancel', handler);
|
|
11
|
+
globalThis.addEventListener('pointerleave', handler);
|
|
12
12
|
}
|
|
13
13
|
function repeat(callback, { delayMs = 300, intervalMs = 100 } = {}) {
|
|
14
14
|
callback(); // immediate action
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Mock the browser's matchMedia API on the global object
|
|
2
|
+
export const mockConfig = { matches: false };
|
|
3
|
+
Object.defineProperty(globalThis, 'matchMedia', {
|
|
4
|
+
writable: true,
|
|
5
|
+
value: jest.fn(() => ({
|
|
6
|
+
writable: true,
|
|
7
|
+
matches: mockConfig.matches,
|
|
8
|
+
addListener: jest.fn(),
|
|
9
|
+
removeListener: jest.fn(),
|
|
10
|
+
})),
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Mock Stencil's isBrowser and isServer to simulate a browser environment
|
|
2
|
+
jest.mock('@stencil/core', () => {
|
|
3
|
+
const module = jest.requireActual('@stencil/core');
|
|
4
|
+
return {
|
|
5
|
+
...module,
|
|
6
|
+
Build: {
|
|
7
|
+
...module.Build,
|
|
8
|
+
isBrowser: true,
|
|
9
|
+
isServer: false,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"componentNames": [
|
|
3
3
|
"post-accordion",
|
|
4
4
|
"post-accordion-item",
|
|
5
|
+
"post-autocomplete",
|
|
5
6
|
"post-avatar",
|
|
6
7
|
"post-back-to-top",
|
|
7
8
|
"post-banner",
|
|
@@ -17,6 +18,8 @@
|
|
|
17
18
|
"post-language-menu",
|
|
18
19
|
"post-language-menu-item",
|
|
19
20
|
"post-linkarea",
|
|
21
|
+
"post-listbox",
|
|
22
|
+
"post-listbox-option",
|
|
20
23
|
"post-logo",
|
|
21
24
|
"post-mainnavigation",
|
|
22
25
|
"post-megadropdown",
|