@swisspost/design-system-components 10.0.0-next.55 → 10.0.0-next.57
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/{components/react/p-CJ80BZ06.js → cjs/breakpoints-Df03Ct7n.js} +103 -5
- package/dist/cjs/debounce-BsIBi_-2.js +13 -0
- package/dist/cjs/environment-BQE9Unf_.js +52 -0
- package/dist/cjs/{event-from-CLvtSUKf.js → event-from-CwMw19f8.js} +2 -2
- package/dist/cjs/fade-CPQhl1fP.js +26 -0
- package/dist/cjs/fade-slide-dPhQa-I1.js +38 -0
- package/dist/cjs/{get-focusable-children-Bx63XUQg.js → get-focusable-children-ChETM1wK.js} +29 -21
- package/dist/cjs/{get-root-CyMf3Vsd.js → get-root-CUAv4k4C.js} +2 -2
- package/dist/cjs/{index-B4gYpuJF.js → index-B4rc1pqu.js} +2150 -292
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{package-DkJrv93P.js → package-uQ5oiSiN.js} +1 -1
- package/dist/cjs/post-accordion_2.cjs.entry.js +19 -15
- package/dist/cjs/post-avatar.cjs.entry.js +27 -17
- package/dist/cjs/post-back-to-top.cjs.entry.js +23 -43
- package/dist/cjs/post-banner.cjs.entry.js +15 -12
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +14 -12
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +33 -34
- package/dist/cjs/post-card-control.cjs.entry.js +42 -26
- package/dist/cjs/{post-closebutton_15.cjs.entry.js → post-closebutton_13.cjs.entry.js} +618 -531
- package/dist/cjs/post-collapsible_2.cjs.entry.js +41 -37
- package/dist/cjs/post-components.cjs.js +3 -3
- package/dist/cjs/post-env-test.cjs.entry.js +15 -0
- package/dist/cjs/post-footer.cjs.entry.js +24 -20
- package/dist/cjs/post-linkarea.cjs.entry.js +5 -5
- package/dist/cjs/post-pagination.cjs.entry.js +615 -0
- package/dist/cjs/post-popover-trigger.cjs.entry.js +54 -34
- package/dist/cjs/post-popover.cjs.entry.js +26 -17
- package/dist/cjs/post-rating.cjs.entry.js +24 -18
- package/dist/cjs/post-stepper-item.cjs.entry.js +5 -5
- package/dist/cjs/post-stepper.cjs.entry.js +40 -29
- package/dist/cjs/post-tab-item.cjs.entry.js +51 -0
- package/dist/cjs/post-tab-panel.cjs.entry.js +13 -11
- package/dist/cjs/post-tabs.cjs.entry.js +195 -40
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +13 -11
- package/dist/cjs/post-tooltip.cjs.entry.js +14 -12
- package/dist/cjs/utils-s05L2ulk.js +26 -0
- package/dist/collection/animations/collapse.js +3 -3
- package/dist/collection/animations/fade-slide.js +33 -0
- package/dist/collection/animations/fade.js +19 -7
- package/dist/collection/animations/index.js +2 -0
- package/dist/collection/animations/slide.js +25 -21
- package/dist/collection/animations/types.js +14 -0
- package/dist/collection/animations/utils.js +8 -0
- package/dist/collection/collection-manifest.json +8 -8
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +5 -4
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +9 -8
- package/dist/collection/components/post-avatar/post-avatar.js +11 -11
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +15 -15
- package/dist/collection/components/post-banner/post-banner.css +4 -1
- package/dist/collection/components/post-banner/post-banner.js +6 -5
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +3 -3
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +29 -29
- package/dist/collection/components/post-card-control/post-card-control.js +18 -18
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
- package/dist/collection/components/post-closebutton/post-closebutton.js +4 -3
- package/dist/collection/components/post-collapsible/post-collapsible.js +28 -28
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +3 -3
- package/dist/collection/components/post-footer/post-footer.css +1 -1
- package/dist/collection/components/post-footer/post-footer.js +18 -16
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +144 -82
- package/dist/collection/components/post-icon/post-icon.js +18 -16
- package/dist/collection/components/post-language-menu/post-language-menu.css +1 -0
- package/dist/collection/components/{post-language-switch/post-language-switch.js → post-language-menu/post-language-menu.js} +45 -36
- package/dist/collection/components/post-language-menu-item/post-language-menu-item.css +1 -0
- package/dist/collection/components/{post-language-option/post-language-option.js → post-language-menu-item/post-language-menu-item.js} +24 -23
- package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
- package/dist/collection/components/post-logo/post-logo.css +3 -1
- package/dist/collection/components/post-logo/post-logo.js +3 -3
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +41 -29
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +183 -74
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +3 -1
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +81 -75
- package/dist/collection/components/post-menu/post-menu.css +1 -1
- package/dist/collection/components/post-menu/post-menu.js +39 -38
- package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +3 -3
- package/dist/collection/components/post-pagination/post-pagination.css +1 -0
- package/dist/collection/components/post-pagination/post-pagination.js +838 -0
- package/dist/collection/components/post-popover/post-popover.js +22 -16
- package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +45 -29
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +82 -131
- package/dist/collection/components/post-rating/post-rating.js +7 -7
- package/dist/collection/components/post-stepper/post-stepper.js +38 -35
- package/dist/collection/components/post-stepper-item/post-stepper-item.css +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.css +1 -0
- package/dist/collection/components/post-tab-item/post-tab-item.js +86 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +10 -10
- package/dist/collection/components/post-tabs/post-tabs.js +232 -59
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +2 -2
- package/dist/collection/components/post-tooltip/post-tooltip.js +9 -27
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +4 -4
- package/dist/collection/utils/environment.js +47 -2
- package/dist/collection/utils/event-from.js +2 -2
- package/dist/collection/utils/get-focusable-children.js +29 -21
- package/dist/collection/utils/is-motion-reduced.js +1 -1
- package/dist/collection/utils/tests/environment/hydrate-app-helper.js +16 -0
- package/dist/collection/utils/tests/environment/post-env-test.js +9 -0
- package/dist/component-names.json +4 -5
- package/dist/components/breakpoints.js +1 -178
- package/dist/components/debounce.js +1 -0
- package/dist/components/environment.js +1 -0
- package/dist/components/event-from.js +1 -119
- package/dist/components/fade-slide.js +1 -0
- package/dist/components/fade.js +1 -11
- package/dist/components/focusable.js +1 -5018
- package/dist/components/get-focusable-children.js +1 -64
- package/dist/components/get-root.js +1 -15
- package/dist/components/heading-levels.js +1 -3
- package/dist/components/index.browser.js +1 -14
- package/dist/components/index.d.ts +11 -10
- package/dist/components/index.js +1 -39
- package/dist/components/long-press-event.js +1 -257
- package/dist/components/package.js +1 -3
- package/dist/components/post-accordion-item.js +1 -6
- package/dist/components/post-accordion-item2.js +1 -113
- package/dist/components/post-accordion.js +1 -6
- package/dist/components/post-accordion2.js +1 -138
- package/dist/components/post-avatar.js +1 -217
- package/dist/components/post-back-to-top.js +1 -144
- package/dist/components/post-banner.js +1 -98
- package/dist/components/post-breadcrumb-item.js +1 -6
- package/dist/components/post-breadcrumb-item2.js +1 -79
- package/dist/components/post-breadcrumbs.js +1 -196
- package/dist/components/post-card-control.js +1 -326
- package/dist/components/post-closebutton.js +1 -6
- package/dist/components/post-closebutton2.js +1 -77
- package/dist/components/post-collapsible-trigger.js +1 -6
- package/dist/components/post-collapsible-trigger2.js +1 -136
- package/dist/components/post-collapsible.js +1 -6
- package/dist/components/post-collapsible2.js +1 -110
- package/dist/components/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/post-env-test.js +1 -0
- package/dist/components/post-footer.js +1 -116
- package/dist/components/post-header.js +1 -372
- package/dist/components/post-icon.js +1 -6
- package/dist/components/post-icon2.js +1 -159
- package/dist/components/post-language-menu-item.d.ts +11 -0
- package/dist/components/post-language-menu-item.js +1 -0
- package/dist/components/{post-language-switch.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/post-language-menu.js +1 -0
- package/dist/components/post-linkarea.js +1 -58
- package/dist/components/post-logo.js +1 -58
- package/dist/components/post-mainnavigation.js +1 -180
- package/dist/components/post-megadropdown-trigger.js +1 -136
- package/dist/components/post-megadropdown.js +1 -267
- package/dist/components/post-menu-item.js +1 -6
- package/dist/components/post-menu-item2.js +1 -30
- package/dist/components/post-menu-trigger.js +1 -6
- package/dist/components/post-menu-trigger2.js +1 -110
- package/dist/components/post-menu.js +1 -6
- package/dist/components/post-menu2.js +1 -242
- package/dist/components/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/post-pagination.js +1 -0
- package/dist/components/post-popover-trigger.js +1 -132
- package/dist/components/post-popover.js +1 -118
- package/dist/components/post-popovercontainer.js +1 -6
- package/dist/components/post-popovercontainer2.js +1 -3127
- package/dist/components/post-rating.js +1 -148
- package/dist/components/post-stepper-item.js +1 -33
- package/dist/components/post-stepper.js +1 -134
- package/dist/components/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/post-tab-item.js +1 -0
- package/dist/components/post-tab-panel.js +1 -54
- package/dist/components/post-tabs.js +1 -196
- package/dist/components/post-togglebutton.js +1 -56
- package/dist/components/post-togglebutton2.js +1 -0
- package/dist/components/post-tooltip-trigger.js +1 -206
- package/dist/components/post-tooltip.js +1 -114
- package/dist/components/react/index.d.ts +2 -0
- package/dist/components/react/index.js +1 -2315
- package/dist/components/react/p-B8YiQ3mz.js +1 -0
- package/dist/components/react/p-BC5nlBvn.js +1 -0
- package/dist/components/react/p-BLchVpF6.js +1 -14
- package/dist/components/react/p-BVCjnh6Q.js +1 -0
- package/dist/{post-components/p-CBFgkSgY.js → components/react/p-BVGcVycs.js} +1 -1
- package/dist/components/react/p-B_XPj2c8.js +1 -0
- package/dist/components/react/p-BllOMLDs.js +1 -0
- package/dist/components/react/p-BmRNjQUZ.js +1 -0
- package/dist/components/react/p-ByFh05IW.js +1 -0
- package/dist/components/react/p-C9hMpmsD.js +1 -0
- package/dist/components/react/p-CJ13r5fi.js +1 -0
- package/dist/components/react/p-CZvbetqX.js +1 -0
- package/dist/components/react/p-C_2k3G1c.js +1 -257
- package/dist/components/react/p-CoDiS_Ik.js +1 -0
- package/dist/components/react/p-Cou17ld8.js +1 -0
- package/dist/components/react/p-D5knoiyy.js +1 -0
- package/dist/components/react/p-D9DDtvFM.js +1 -0
- package/dist/components/react/p-DY2U5CQt.js +1 -0
- package/dist/components/react/p-DjIHLduJ.js +1 -3
- package/dist/components/react/p-DpATRD2W.js +1 -0
- package/dist/components/react/p-FxUVQ4Tx.js +1 -0
- package/dist/components/react/p-HygIVKXC.js +1 -5018
- package/dist/components/react/p-YR7U0Z_g.js +1 -0
- package/dist/components/react/p-ZeKXASQs.js +1 -0
- package/dist/components/react/p-r4txK0AC.js +1 -3
- package/dist/components/react/p-sSn0kXFi.js +1 -0
- package/dist/components/react/post-accordion-item.js +1 -6
- package/dist/components/react/post-accordion.js +1 -6
- package/dist/components/react/post-avatar.js +1 -218
- package/dist/components/react/post-back-to-top.js +1 -145
- package/dist/components/react/post-banner.js +1 -99
- package/dist/components/react/post-breadcrumb-item.js +1 -6
- package/dist/components/react/post-breadcrumbs.js +1 -197
- package/dist/components/react/post-card-control.js +1 -327
- package/dist/components/react/post-closebutton.js +1 -6
- package/dist/components/react/post-collapsible-trigger.js +1 -6
- package/dist/components/react/post-collapsible.js +1 -6
- package/dist/components/react/{post-list.d.ts → post-env-test.d.ts} +4 -4
- package/dist/components/react/post-env-test.js +1 -0
- package/dist/components/react/post-footer.js +1 -117
- package/dist/components/react/post-header.js +1 -373
- package/dist/components/react/post-icon.js +1 -6
- package/dist/components/react/post-language-menu-item.d.ts +11 -0
- package/dist/components/react/post-language-menu-item.js +1 -0
- package/dist/components/react/{post-language-option.d.ts → post-language-menu.d.ts} +4 -4
- package/dist/components/react/post-language-menu.js +1 -0
- package/dist/components/react/post-linkarea.js +1 -59
- package/dist/components/react/post-logo.js +1 -59
- package/dist/components/react/post-mainnavigation.js +1 -181
- package/dist/components/react/post-megadropdown-trigger.js +1 -137
- package/dist/components/react/post-megadropdown.js +1 -268
- package/dist/components/react/post-menu-item.js +1 -6
- package/dist/components/react/post-menu-trigger.js +1 -6
- package/dist/components/react/post-menu.js +1 -6
- package/dist/components/react/{post-tab-header.d.ts → post-pagination.d.ts} +4 -4
- package/dist/components/react/post-pagination.js +1 -0
- package/dist/components/react/post-popover-trigger.js +1 -133
- package/dist/components/react/post-popover.js +1 -119
- package/dist/components/react/post-popovercontainer.js +1 -6
- package/dist/components/react/post-rating.js +1 -149
- package/dist/components/react/post-stepper-item.js +1 -34
- package/dist/components/react/post-stepper.js +1 -135
- package/dist/components/react/{post-list-item.d.ts → post-tab-item.d.ts} +4 -4
- package/dist/components/react/post-tab-item.js +1 -0
- package/dist/components/react/post-tab-panel.js +1 -55
- package/dist/components/react/post-tabs.js +1 -197
- package/dist/components/react/post-togglebutton.js +1 -57
- package/dist/components/react/post-tooltip-trigger.js +1 -207
- package/dist/components/react/post-tooltip.js +1 -115
- package/dist/components/switch-variants.js +1 -3
- package/dist/components/utils.js +1 -0
- package/dist/docs.d.ts +11 -0
- package/dist/docs.json +873 -631
- package/dist/{cjs/breakpoints-CEkeixld.js → esm/breakpoints-DYoSKGHO.js} +89 -6
- package/dist/esm/debounce-C9hMpmsD.js +11 -0
- package/dist/esm/environment-CEmnRoA6.js +49 -0
- package/dist/{components/react/p-CzIKqBrS.js → esm/event-from-rEfV4v4a.js} +2 -2
- package/dist/esm/fade-DsgPYmAa.js +24 -0
- package/dist/esm/fade-slide-CvOvauo9.js +36 -0
- package/dist/esm/{get-focusable-children-D9ZHp2FP.js → get-focusable-children-BXNs2_sw.js} +29 -21
- package/dist/{components/react/p-CBFgkSgY.js → esm/get-root-CXfAA093.js} +1 -1
- package/dist/esm/{index-wEFJ-c34.js → index-CDZBzSdV.js} +2150 -292
- package/dist/esm/loader.js +3 -3
- package/dist/esm/package-CZvbetqX.js +3 -0
- package/dist/esm/post-accordion_2.entry.js +17 -13
- package/dist/esm/post-avatar.entry.js +22 -12
- package/dist/esm/post-back-to-top.entry.js +23 -43
- package/dist/esm/post-banner.entry.js +14 -11
- package/dist/esm/post-breadcrumb-item_2.entry.js +13 -11
- package/dist/esm/post-breadcrumbs.entry.js +31 -32
- package/dist/esm/post-card-control.entry.js +32 -16
- package/dist/esm/{post-closebutton_15.entry.js → post-closebutton_13.entry.js} +599 -510
- package/dist/esm/post-collapsible_2.entry.js +38 -34
- package/dist/esm/post-components.js +4 -4
- package/dist/esm/post-env-test.entry.js +13 -0
- package/dist/esm/post-footer.entry.js +21 -17
- package/dist/esm/post-linkarea.entry.js +5 -5
- package/dist/esm/post-pagination.entry.js +613 -0
- package/dist/esm/post-popover-trigger.entry.js +52 -32
- package/dist/esm/post-popover.entry.js +25 -16
- package/dist/esm/post-rating.entry.js +16 -10
- package/dist/esm/post-stepper-item.entry.js +5 -5
- package/dist/esm/post-stepper.entry.js +39 -28
- package/dist/esm/post-tab-item.entry.js +49 -0
- package/dist/esm/post-tab-panel.entry.js +13 -11
- package/dist/esm/post-tabs.entry.js +195 -40
- package/dist/esm/post-tooltip-trigger.entry.js +10 -8
- package/dist/esm/post-tooltip.entry.js +13 -11
- package/dist/esm/utils-CoDiS_Ik.js +24 -0
- package/dist/post-components/p-09ba7cf9.entry.js +1 -0
- package/dist/post-components/p-0c091898.entry.js +1 -0
- package/dist/post-components/{p-cd03e6f2.entry.js → p-0e97fcfd.entry.js} +1 -1
- package/dist/post-components/p-296f1dd5.entry.js +1 -0
- package/dist/post-components/p-32ad2b21.entry.js +1 -0
- package/dist/post-components/p-366c28cb.entry.js +1 -0
- package/dist/post-components/p-41ae68d5.entry.js +1 -0
- package/dist/post-components/p-448e7265.entry.js +1 -0
- package/dist/post-components/p-554da188.entry.js +1 -0
- package/dist/post-components/p-5912f8f1.entry.js +1 -0
- package/dist/post-components/p-790f300d.entry.js +1 -0
- package/dist/post-components/p-7ed5a493.entry.js +1 -0
- package/dist/post-components/p-85bea1b6.entry.js +1 -0
- package/dist/post-components/p-8bcff4d2.entry.js +1 -0
- package/dist/post-components/p-9dc9c245.entry.js +1 -0
- package/dist/post-components/p-B7ebLhHc.js +1 -0
- package/dist/post-components/p-BVCjnh6Q.js +1 -0
- package/dist/post-components/p-BXNs2_sw.js +1 -0
- package/dist/post-components/p-C9hMpmsD.js +1 -0
- package/dist/post-components/p-CDZBzSdV.js +2 -0
- package/dist/post-components/p-CEmnRoA6.js +1 -0
- package/dist/post-components/p-CZvbetqX.js +1 -0
- package/dist/post-components/p-CoDiS_Ik.js +1 -0
- package/dist/post-components/p-D5knoiyy.js +1 -0
- package/dist/post-components/p-DI-h_mEL.js +1 -0
- package/dist/post-components/p-a06f9695.entry.js +1 -0
- package/dist/post-components/p-a191f1df.entry.js +1 -0
- package/dist/post-components/p-c5d19d62.entry.js +1 -0
- package/dist/post-components/{p-24dc54d1.entry.js → p-c8c4d05b.entry.js} +1 -1
- package/dist/post-components/{p-57288cb2.entry.js → p-d1a5c980.entry.js} +1 -1
- package/dist/post-components/p-d4e2c556.entry.js +1 -0
- package/dist/post-components/p-f96a310c.entry.js +1 -0
- package/dist/post-components/p-fab2327d.entry.js +1 -0
- package/dist/post-components/p-rEfV4v4a.js +1 -0
- package/dist/post-components/post-components.css +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/prebuild.js +46 -0
- package/dist/types/animations/collapse.d.ts +1 -0
- package/dist/types/animations/fade-slide.d.ts +11 -0
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/index.d.ts +2 -0
- package/dist/types/animations/slide.d.ts +9 -2
- package/dist/types/animations/types.d.ts +13 -0
- package/dist/types/animations/utils.d.ts +2 -0
- package/dist/types/components/post-accordion-item/heading-levels.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +2 -2
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +2 -2
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +6 -6
- package/dist/types/components/post-collapsible/post-collapsible.d.ts +4 -5
- package/dist/types/components/post-footer/post-footer.d.ts +4 -4
- package/dist/types/components/post-header/post-header.d.ts +23 -13
- package/dist/types/components/{post-language-switch/post-language-switch.d.ts → post-language-menu/post-language-menu.d.ts} +12 -11
- package/dist/types/components/{post-language-option/post-language-option.d.ts → post-language-menu-item/post-language-menu-item.d.ts} +5 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +6 -5
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +20 -2
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +17 -23
- package/dist/types/components/post-menu/post-menu.d.ts +4 -4
- package/dist/types/components/post-pagination/post-pagination.d.ts +224 -0
- package/dist/types/components/post-popover/post-popover.d.ts +4 -3
- package/dist/types/components/post-popover-trigger/post-popover-trigger.d.ts +2 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +23 -21
- package/dist/types/components/post-rating/post-rating.d.ts +1 -1
- package/dist/types/components/post-stepper/post-stepper.d.ts +9 -8
- package/dist/types/components/post-tab-item/post-tab-item.d.ts +19 -0
- package/dist/types/components/post-tab-panel/post-tab-panel.d.ts +3 -3
- package/dist/types/components/post-tabs/post-tabs.d.ts +33 -12
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -5
- package/dist/types/components.d.ts +322 -219
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/prebuild.d.ts +9 -0
- package/dist/types/stencil-public-runtime.d.ts +147 -10
- package/dist/types/types/heading-levels.d.ts +1 -1
- package/dist/types/utils/environment.d.ts +25 -1
- package/dist/types/utils/get-focusable-children.d.ts +2 -2
- package/dist/types/utils/tests/environment/hydrate-app-helper.d.ts +5 -0
- package/dist/types/utils/tests/environment/post-env-test.d.ts +3 -0
- package/hydrate/index.d.ts +14 -0
- package/hydrate/index.js +7494 -2714
- package/hydrate/index.mjs +7493 -2715
- package/package.json +7 -8
- package/dist/cjs/fade-nS5zzDQS.js +0 -14
- package/dist/cjs/index-UFKR6Ok0.js +0 -98
- package/dist/cjs/post-tab-header.cjs.entry.js +0 -31
- package/dist/collection/animations/slide-and-fade.js +0 -25
- package/dist/collection/components/post-language-option/post-language-option.css +0 -1
- package/dist/collection/components/post-language-switch/post-language-switch.css +0 -1
- package/dist/collection/components/post-list/post-list.css +0 -1
- package/dist/collection/components/post-list/post-list.js +0 -97
- package/dist/collection/components/post-list-item/post-list-item.css +0 -1
- package/dist/collection/components/post-list-item/post-list-item.js +0 -26
- package/dist/collection/components/post-tab-header/post-tab-header.css +0 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +0 -65
- package/dist/components/index2.js +0 -89
- package/dist/components/post-language-option.d.ts +0 -11
- package/dist/components/post-language-option.js +0 -99
- package/dist/components/post-language-switch.js +0 -157
- package/dist/components/post-list-item.js +0 -38
- package/dist/components/post-list.js +0 -61
- package/dist/components/post-tab-header.js +0 -52
- package/dist/components/react/p-BVXiQdHq.js +0 -64
- package/dist/components/react/p-BhxZzOEC.js +0 -3
- package/dist/components/react/p-CSAMO7iJ.js +0 -243
- package/dist/components/react/p-CYkf_7Y5.js +0 -89
- package/dist/components/react/p-Ccrl2AQn.js +0 -111
- package/dist/components/react/p-CewRvBtg.js +0 -139
- package/dist/components/react/p-Cwiv86_f.js +0 -111
- package/dist/components/react/p-D2waO0Zc.js +0 -31
- package/dist/components/react/p-DBPOV12C.js +0 -160
- package/dist/components/react/p-DVGEExot.js +0 -3128
- package/dist/components/react/p-Djvj8fd2.js +0 -80
- package/dist/components/react/p-LtiDhYis.js +0 -137
- package/dist/components/react/p-SbIC4aZX.js +0 -11
- package/dist/components/react/p-XrZzCOKT.js +0 -78
- package/dist/components/react/p-v3pOrMNQ.js +0 -114
- package/dist/components/react/post-language-option.js +0 -100
- package/dist/components/react/post-language-switch.d.ts +0 -11
- package/dist/components/react/post-language-switch.js +0 -158
- package/dist/components/react/post-list-item.js +0 -39
- package/dist/components/react/post-list.js +0 -62
- package/dist/components/react/post-tab-header.js +0 -53
- package/dist/esm/breakpoints-CJ80BZ06.js +0 -178
- package/dist/esm/event-from-CzIKqBrS.js +0 -119
- package/dist/esm/fade-SbIC4aZX.js +0 -11
- package/dist/esm/get-root-BkQ3CrLq.js +0 -15
- package/dist/esm/index-Beaz8wEe.js +0 -89
- package/dist/esm/package-BhxZzOEC.js +0 -3
- package/dist/esm/post-tab-header.entry.js +0 -29
- package/dist/post-components/p-01e678c9.entry.js +0 -1
- package/dist/post-components/p-034a453f.entry.js +0 -1
- package/dist/post-components/p-15a4cdbf.entry.js +0 -1
- package/dist/post-components/p-2a2030bf.entry.js +0 -1
- package/dist/post-components/p-2ed84cc3.entry.js +0 -1
- package/dist/post-components/p-3228968f.entry.js +0 -1
- package/dist/post-components/p-3c01ddfe.entry.js +0 -1
- package/dist/post-components/p-748b1f01.entry.js +0 -1
- package/dist/post-components/p-7745e46e.entry.js +0 -1
- package/dist/post-components/p-7f635728.entry.js +0 -1
- package/dist/post-components/p-82c178a3.entry.js +0 -1
- package/dist/post-components/p-9b5f8319.entry.js +0 -1
- package/dist/post-components/p-Beaz8wEe.js +0 -1
- package/dist/post-components/p-BhxZzOEC.js +0 -1
- package/dist/post-components/p-CJ80BZ06.js +0 -1
- package/dist/post-components/p-D9ZHp2FP.js +0 -1
- package/dist/post-components/p-SbIC4aZX.js +0 -1
- package/dist/post-components/p-a9644e54.entry.js +0 -1
- package/dist/post-components/p-af030a3a.entry.js +0 -1
- package/dist/post-components/p-b8ba8139.entry.js +0 -1
- package/dist/post-components/p-db935e8e.entry.js +0 -1
- package/dist/post-components/p-e62e1f57.entry.js +0 -1
- package/dist/post-components/p-fb4b1641.entry.js +0 -1
- package/dist/post-components/p-wEFJ-c34.js +0 -2
- package/dist/types/animations/slide-and-fade.d.ts +0 -2
- package/dist/types/components/post-list/post-list.d.ts +0 -24
- package/dist/types/components/post-list-item/post-list-item.d.ts +0 -8
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +0 -14
- /package/dist/collection/components/{post-language-switch → post-language-menu}/switch-variants.js +0 -0
- /package/dist/{post-components/p-CzIKqBrS.js → components/react/p-rEfV4v4a.js} +0 -0
- /package/dist/types/components/{post-language-switch → post-language-menu}/switch-variants.d.ts +0 -0
|
@@ -1,268 +1 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h, a as Host } from './index.js';
|
|
2
|
-
import { g as getFocusableChildren } from './p-BVXiQdHq.js';
|
|
3
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
4
|
-
import { b as breakpoint } from './p-CJ80BZ06.js';
|
|
5
|
-
|
|
6
|
-
const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;width:100%;inset-block-start:100%;inset-inline-start:0;border-radius:0}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown-container{border-block-end:1px solid CanvasText}}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{z-index:1;position:absolute;inset-block-start:var(--post-header-navigation-current-inset);inset-inline:0;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));border-block-start:unset;overflow-y:auto;overscroll-behavior:contain}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}@media screen and (min-width: 1024px){.megadropdown-container{z-index:-1;max-height:calc(100vh - var(--post-header-height) - 48px);overflow-y:auto}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{display:flex;flex-direction:column;width:inherit;padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown [slot=megadropdown-overview-link]{text-decoration:none;border-radius:0;padding-block:13px 12px;margin-block-end:16px;display:flex;align-items:center;min-height:56px;width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative;height:unset}.megadropdown [slot=megadropdown-overview-link]:focus-visible{border-radius:4px}.megadropdown [slot=megadropdown-overview-link]::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}.megadropdown [slot=megadropdown-overview-link].active,.megadropdown [slot=megadropdown-overview-link][aria-current=page],.megadropdown [slot=megadropdown-overview-link][aria-expanded=true]{background-color:#050400;color:#fff}.megadropdown [slot=megadropdown-overview-link]:hover{background-color:#504f4b;color:#fff}.megadropdown [slot=megadropdown-overview-link]:hover::before{background-color:#504f4b}@media screen and (max-width: 1023.98px){.megadropdown [slot=megadropdown-overview-link]{padding-block:12px 11px;min-height:unset}}@media screen and (max-width: 599.98px){.megadropdown [slot=megadropdown-overview-link]{padding-block:10px 9px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-block:0 8px;font-weight:900}.megadropdown h2 a{text-decoration:none;display:none;font-weight:inherit;border-block:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:16px 12px 14px 8px}.megadropdown post-list .list-title h3:not(:has(a)){position:relative}.megadropdown post-list .list-title h3:not(:has(a))::before{content:\"\";background-color:#050400;inset-block-end:0;inset-inline-start:0;width:100%;height:2px;position:absolute}.megadropdown post-list .list-title h3 a{border-radius:4px;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}.megadropdown post-list .list-title h3 a.active,.megadropdown post-list .list-title h3 a[aria-current=page],.megadropdown post-list .list-title h3 a[aria-expanded=true]{background-color:#050400;color:#fff}.megadropdown post-list .list-title h3 a:hover{background-color:#504f4b;color:#fff}.megadropdown post-list .list-title h3 a:hover::before{background-color:#504f4b}.megadropdown post-list .list-title h3 a::before{height:2px}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:14px 12px 12px 8px}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px;white-space:normal;word-break:break-word}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-block-end:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{order:-1;display:block}}.megadropdown .close-button{position:absolute;inset-block-start:1rem;inset-inline-end:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}";
|
|
7
|
-
|
|
8
|
-
const PostMegadropdown$1 = /*@__PURE__*/ proxyCustomElement(class PostMegadropdown extends H {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this.__registerHost();
|
|
12
|
-
this.postToggleMegadropdown = createEvent(this, "postToggleMegadropdown");
|
|
13
|
-
this.device = breakpoint.get('device');
|
|
14
|
-
/**
|
|
15
|
-
* Holds the current visibility state of the dropdown.
|
|
16
|
-
* This state is internally managed to track whether the dropdown is open (`true`) or closed (`false`),
|
|
17
|
-
* and updates automatically when the dropdown is toggled.
|
|
18
|
-
*/
|
|
19
|
-
this.isVisible = false;
|
|
20
|
-
this.trigger = false;
|
|
21
|
-
/** Holds the current animation class. */
|
|
22
|
-
this.animationClass = null;
|
|
23
|
-
this.handleClickOutside = (event) => {
|
|
24
|
-
if (this.device !== 'desktop')
|
|
25
|
-
return;
|
|
26
|
-
const target = event.target;
|
|
27
|
-
if (this.host.contains(target)) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (target instanceof H) {
|
|
31
|
-
const trigger = target.closest('post-megadropdown-trigger');
|
|
32
|
-
if (trigger) {
|
|
33
|
-
const targetDropdownId = trigger.getAttribute('for');
|
|
34
|
-
if (targetDropdownId !== this.host.id) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
this.hide(false);
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
get megadropdownTrigger() {
|
|
43
|
-
const hostId = this.host.getAttribute('id');
|
|
44
|
-
return hostId
|
|
45
|
-
? document.querySelector(`post-megadropdown-trigger[for="${hostId}"] > button`)
|
|
46
|
-
: null;
|
|
47
|
-
}
|
|
48
|
-
connectedCallback() {
|
|
49
|
-
window.addEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
50
|
-
}
|
|
51
|
-
componentDidRender() {
|
|
52
|
-
this.getFocusableElements();
|
|
53
|
-
}
|
|
54
|
-
componentDidLoad() {
|
|
55
|
-
this.checkInitialAriaCurrent();
|
|
56
|
-
this.setupObserver();
|
|
57
|
-
this.handleAriaCurrentChange([]);
|
|
58
|
-
}
|
|
59
|
-
disconnectedCallback() {
|
|
60
|
-
this.removeListeners();
|
|
61
|
-
window.removeEventListener('postBreakpoint:device', this.breakpointChange.bind(this));
|
|
62
|
-
if (PostMegadropdown.activeDropdown === this) {
|
|
63
|
-
PostMegadropdown.activeDropdown = null;
|
|
64
|
-
}
|
|
65
|
-
if (this.defaultSlotObserver) {
|
|
66
|
-
this.defaultSlotObserver.disconnect();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Toggles the dropdown visibility based on its current state.
|
|
71
|
-
*/
|
|
72
|
-
async toggle() {
|
|
73
|
-
if (this.isVisible) {
|
|
74
|
-
this.hide();
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
await this.show();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Displays the dropdown.
|
|
82
|
-
*/
|
|
83
|
-
async show() {
|
|
84
|
-
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
85
|
-
// Close the previously active dropdown without animation
|
|
86
|
-
PostMegadropdown.activeDropdown.forceClose();
|
|
87
|
-
}
|
|
88
|
-
this.animationClass = 'slide-in';
|
|
89
|
-
this.isVisible = true;
|
|
90
|
-
PostMegadropdown.activeDropdown = this;
|
|
91
|
-
this.postToggleMegadropdown.emit({ isVisible: this.isVisible });
|
|
92
|
-
if (this.firstFocusableEl &&
|
|
93
|
-
window.getComputedStyle(this.firstFocusableEl).display !== 'none') {
|
|
94
|
-
this.firstFocusableEl.focus();
|
|
95
|
-
}
|
|
96
|
-
this.addListeners();
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Hides the dropdown with an animation.
|
|
100
|
-
*/
|
|
101
|
-
async hide(focusParent = true, forceClose = false) {
|
|
102
|
-
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
|
|
103
|
-
if (forceClose) {
|
|
104
|
-
this.forceClose();
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.animationClass = 'slide-out';
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Sets focus to the first focusable element within the component.
|
|
112
|
-
*/
|
|
113
|
-
async focusFirst() {
|
|
114
|
-
this.firstFocusableEl?.focus();
|
|
115
|
-
}
|
|
116
|
-
breakpointChange(e) {
|
|
117
|
-
this.device = e.detail;
|
|
118
|
-
if (this.device === 'desktop' && this.isVisible) {
|
|
119
|
-
this.animationClass = null;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Forces the dropdown to close without animation.
|
|
124
|
-
*/
|
|
125
|
-
forceClose() {
|
|
126
|
-
this.isVisible = false;
|
|
127
|
-
this.animationClass = null;
|
|
128
|
-
this.postToggleMegadropdown.emit({ isVisible: this.isVisible, focusParent: false });
|
|
129
|
-
this.removeListeners();
|
|
130
|
-
}
|
|
131
|
-
handleAnimationEnd() {
|
|
132
|
-
if (this.animationClass === 'slide-out') {
|
|
133
|
-
this.isVisible = false;
|
|
134
|
-
this.animationClass = null;
|
|
135
|
-
PostMegadropdown.activeDropdown = null;
|
|
136
|
-
this.removeListeners();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
addListeners() {
|
|
140
|
-
this.host.addEventListener('keydown', e => this.keyboardHandler(e));
|
|
141
|
-
document.addEventListener('keyup', e => this.handleTabOutside(e));
|
|
142
|
-
document.addEventListener('mousedown', this.handleClickOutside);
|
|
143
|
-
}
|
|
144
|
-
removeListeners() {
|
|
145
|
-
this.host.removeEventListener('keydown', e => this.keyboardHandler(e));
|
|
146
|
-
document.removeEventListener('keyup', e => this.handleTabOutside(e));
|
|
147
|
-
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
148
|
-
}
|
|
149
|
-
getFocusableElements() {
|
|
150
|
-
const focusableEls = Array.from(this.host.querySelectorAll('post-list-item, h3, .back-button'));
|
|
151
|
-
const focusableChildren = focusableEls.flatMap(el => Array.from(getFocusableChildren(el)));
|
|
152
|
-
// Check for an overview link
|
|
153
|
-
const overviewLink = this.host.querySelector('a[slot="megadropdown-overview-link"]');
|
|
154
|
-
if (overviewLink) {
|
|
155
|
-
focusableChildren.unshift(overviewLink);
|
|
156
|
-
}
|
|
157
|
-
this.firstFocusableEl = focusableChildren[0];
|
|
158
|
-
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
159
|
-
}
|
|
160
|
-
// Loop through the focusable children
|
|
161
|
-
keyboardHandler(e) {
|
|
162
|
-
if (e.key === 'Tab' && this.device !== 'desktop') {
|
|
163
|
-
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
164
|
-
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
165
|
-
e.preventDefault();
|
|
166
|
-
this.lastFocusableEl.focus();
|
|
167
|
-
}
|
|
168
|
-
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
169
|
-
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
170
|
-
e.preventDefault();
|
|
171
|
-
this.firstFocusableEl.focus();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
handleTabOutside(e) {
|
|
176
|
-
if (e.key === 'Tab' && this.device === 'desktop') {
|
|
177
|
-
if (this.isVisible && !this.host.contains(e.target)) {
|
|
178
|
-
this.hide(false);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Sets up a MutationObserver on the host to watch for changes
|
|
184
|
-
* in `aria-current` attributes.
|
|
185
|
-
*/
|
|
186
|
-
setupObserver() {
|
|
187
|
-
const config = {
|
|
188
|
-
subtree: true,
|
|
189
|
-
attributes: true,
|
|
190
|
-
attributeFilter: ['aria-current'],
|
|
191
|
-
};
|
|
192
|
-
this.defaultSlotObserver = new MutationObserver(this.handleAriaCurrentChange.bind(this));
|
|
193
|
-
this.defaultSlotObserver.observe(this.host, config);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Adds or removes the 'active' class on the megadropdown trigger button
|
|
197
|
-
* based on the active state.
|
|
198
|
-
*
|
|
199
|
-
* @param isActive - Whether the trigger should appear active
|
|
200
|
-
*/
|
|
201
|
-
setTriggerActive(isActive) {
|
|
202
|
-
const trigger = this.megadropdownTrigger;
|
|
203
|
-
if (!trigger)
|
|
204
|
-
return;
|
|
205
|
-
if (isActive) {
|
|
206
|
-
trigger.classList.add('active');
|
|
207
|
-
}
|
|
208
|
-
else {
|
|
209
|
-
trigger.classList.remove('active');
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Updates the megadropdown trigger state when the megadropdown content changes.
|
|
214
|
-
* Checks if any element inside the megadropdown has `aria-current="page"`
|
|
215
|
-
* and sets the trigger as active accordingly.
|
|
216
|
-
*/
|
|
217
|
-
handleAriaCurrentChange(mutations) {
|
|
218
|
-
if (!mutations.length)
|
|
219
|
-
return;
|
|
220
|
-
const hasCurrentPage = mutations.some(m => m.target instanceof H && m.target.getAttribute('aria-current') === 'page');
|
|
221
|
-
this.setTriggerActive(hasCurrentPage);
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Checks on initialization if any element inside the megadropdown
|
|
225
|
-
* has `aria-current="page"` and sets the trigger as active if so.
|
|
226
|
-
*/
|
|
227
|
-
checkInitialAriaCurrent() {
|
|
228
|
-
const hasCurrentPage = this.host.querySelector('[aria-current="page"]');
|
|
229
|
-
if (hasCurrentPage)
|
|
230
|
-
this.setTriggerActive(true);
|
|
231
|
-
}
|
|
232
|
-
render() {
|
|
233
|
-
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
234
|
-
return (h(Host, { key: 'd189f35bb1b66459d6f50bd3326495fe79429be2', version: version }, h("div", { key: 'a9d7d8e25af433b18548a40be4e724c1a3a57374', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, h("div", { key: 'a9886e9c1797eb11c6988e2b17bb73097ca9fb24', class: "megadropdown" }, h("slot", { key: 'e93c659a3ba85dbecebfaa2b2ed435d05cfc4ecc', name: "megadropdown-title" }), h("slot", { key: 'c6d4952fd218d2c31399b31ebea905a19892461d', name: "megadropdown-overview-link" }), h("div", { key: '82a157f8c6225ccec231d660d55b49abf456ba60', class: "megadropdown-content" }, h("slot", { key: '0c2ad616e2e999bb30cc9e9593fcfa4e4b8d71f0' })), h("div", { key: 'b501280cb3c05bb0210e5fe2380d5c338416df90', onClick: () => this.hide(true), class: "back-button" }, h("slot", { key: '2b60695fac34563724f09b1e6c51b4b386606f17', name: "back-button" })), h("div", { key: '1554073e2476baf7416937f54203e2e404805360', onClick: () => this.hide(true), class: "close-button" }, h("slot", { key: '29e8f43ddadfa66c405c6ad0ffbf43237fae97ec', name: "close-button" }))))));
|
|
235
|
-
}
|
|
236
|
-
get host() { return this; }
|
|
237
|
-
static get style() { return postMegadropdownCss; }
|
|
238
|
-
}, [4, "post-megadropdown", {
|
|
239
|
-
"device": [32],
|
|
240
|
-
"isVisible": [32],
|
|
241
|
-
"trigger": [32],
|
|
242
|
-
"animationClass": [32],
|
|
243
|
-
"toggle": [64],
|
|
244
|
-
"show": [64],
|
|
245
|
-
"hide": [64],
|
|
246
|
-
"focusFirst": [64]
|
|
247
|
-
}]);
|
|
248
|
-
/** Tracks the currently active dropdown instance. */
|
|
249
|
-
PostMegadropdown$1.activeDropdown = null;
|
|
250
|
-
function defineCustomElement$1() {
|
|
251
|
-
if (typeof customElements === "undefined") {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
const components = ["post-megadropdown"];
|
|
255
|
-
components.forEach(tagName => { switch (tagName) {
|
|
256
|
-
case "post-megadropdown":
|
|
257
|
-
if (!customElements.get(tagName)) {
|
|
258
|
-
customElements.define(tagName, PostMegadropdown$1);
|
|
259
|
-
}
|
|
260
|
-
break;
|
|
261
|
-
} });
|
|
262
|
-
}
|
|
263
|
-
defineCustomElement$1();
|
|
264
|
-
|
|
265
|
-
const PostMegadropdown = PostMegadropdown$1;
|
|
266
|
-
const defineCustomElement = defineCustomElement$1;
|
|
267
|
-
|
|
268
|
-
export { PostMegadropdown, defineCustomElement };
|
|
1
|
+
import{p as t,H as e,c as i,h as s,a as o,t as n}from"./index.js";import{g as a}from"./p-CJ13r5fi.js";import{v as r}from"./p-CZvbetqX.js";import{c,g as d}from"./p-B8YiQ3mz.js";import{r as h}from"./p-CoDiS_Ik.js";import{f as l}from"./p-BVCjnh6Q.js";import{d as p}from"./p-ByFh05IW.js";import{d as b}from"./p-DY2U5CQt.js";const u={translate:100,duration:500,easing:"ease",fill:"none"};const m=t(class t extends e{validateTextClose(){c(this,"textClose","string")}validateTextBack(){c(this,"textBack","string")}get megadropdownTrigger(){const t=this.host.getAttribute("id");return t?document.querySelector(`post-megadropdown-trigger[for="${t}"]`):null}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postToggleMegadropdown=i(this,"postToggleMegadropdown"),this.currentAnimation=null,this.isAnimating=!1,this.fsAnimationOptions={translate:-10,duration:350,easing:"headerEase"},this.device=d.get("device"),this.isVisible=!1,this.trigger=!1,this.animationClass=null,this.handleClickOutside=async t=>{if("desktop"!==this.device)return;const i=t.target;if(!this.host.contains(i)&&!this.megadropdownTrigger.contains(i)){if(i instanceof e){const t=i.closest("post-megadropdown-trigger");if(t&&t.getAttribute("for")!==this.host.id)return}await this.hide(!1)}},this.keyboardHandler=this.keyboardHandler.bind(this),this.handleTabOutside=this.handleTabOutside.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){window.addEventListener("postBreakpoint:device",this.breakpointChange.bind(this))}componentDidRender(){this.getFocusableElements()}componentDidLoad(){this.validateTextClose(),this.validateTextBack(),this.checkInitialAriaCurrent(),this.setupObserver(),this.handleAriaCurrentChange([])}disconnectedCallback(){window.removeEventListener("postBreakpoint:device",this.breakpointChange.bind(this)),t.activeDropdown===this&&(t.activeDropdown=null),this.removeListeners(),this.defaultSlotObserver&&this.defaultSlotObserver.disconnect()}async toggle(){return this.isAnimating?this.isVisible?this.show():this.hide():this.isVisible?this.hide():this.show()}async show(){if("desktop"!==this.device){const t=this.megadropdownTrigger;t&&(this.megadropdownTitle=t.innerHTML)}t.activeDropdown&&t.activeDropdown!==this&&t.activeDropdown.forceClose(),this.cancelAnimation(),this.isVisible=!0,t.activeDropdown=this,this.postToggleMegadropdown.emit({isVisible:!0});try{await this.animate("in"),this.focusFirst(),this.addListeners()}catch{this.removeListeners(),this.isVisible=!1,t.activeDropdown===this&&(t.activeDropdown=null),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!0})}}async hide(e=!0,i=!1){if(i)this.forceClose();else{this.postToggleMegadropdown.emit({isVisible:!1,focusParent:e});try{await this.animate("out"),this.isVisible=!1,this.removeListeners(),t.activeDropdown===this&&(t.activeDropdown=null)}catch{t.activeDropdown=this,this.addListeners(),this.isVisible=!0,this.postToggleMegadropdown.emit({isVisible:!0,focusParent:!1})}}}async focusFirst(){this.firstFocusableEl?.focus()}forceClose(){this.removeListeners(),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!1}),this.isVisible=!1}createAnimation(t){return"desktop"===this.device?l(this.animatedContainer,t,this.fsAnimationOptions):function(t,e,i={}){const s={...u,...i},{translate:o}=s,n=[{transform:`translateX(${o}%)`},{transform:"translateX(0)"}];return function(t,e,i){const{duration:s,easing:o,fill:n}={...u,...i};return t.animate(e,{duration:s,easing:h(o),fill:n})}(t,"in"===e?n:[...n].reverse(),i)}(this.animatedContainer,t,{translate:100,duration:350,easing:"in"===t?"ease-in":"ease-out"})}async animate(t){this.cancelAnimation(),this.currentAnimation=this.createAnimation(t),this.isAnimating=!0,await this.currentAnimation.finished,this.isAnimating=!1,this.currentAnimation=null}cancelAnimation(){this.currentAnimation?.cancel(),this.currentAnimation=null}breakpointChange(t){this.device=t.detail,this.cancelAnimation()}addListeners(){this.host.addEventListener("keydown",this.keyboardHandler),document.addEventListener("keyup",this.handleTabOutside),document.addEventListener("mousedown",this.handleClickOutside)}removeListeners(){this.host.removeEventListener("keydown",this.keyboardHandler),document.removeEventListener("keyup",this.handleTabOutside),document.removeEventListener("mousedown",this.handleClickOutside)}getFocusableElements(){const t=[...a(this.host),...a(this.host.shadowRoot)];this.firstFocusableEl=t[0],this.lastFocusableEl=t[t.length-1]}keyboardHandler(t){if("Tab"!==t.key||"desktop"===this.device)return;const e=this.host.shadowRoot.activeElement||document.activeElement;t.shiftKey&&e===this.firstFocusableEl?(t.preventDefault(),this.lastFocusableEl.focus()):t.shiftKey||e!==this.lastFocusableEl||(t.preventDefault(),this.firstFocusableEl.focus())}handleTabOutside(t){"Tab"===t.key&&"desktop"===this.device&&this.isVisible&&!this.host.contains(t.target)&&this.hide(!1)}setupObserver(){this.defaultSlotObserver=new MutationObserver(this.handleAriaCurrentChange.bind(this)),this.defaultSlotObserver.observe(this.host,{subtree:!0,attributes:!0,attributeFilter:["aria-current"]})}setTriggerActive(t){const e=this.megadropdownTrigger;e&&e.setAttribute("active",""+t)}handleAriaCurrentChange(t){if(!t.length)return;const i=t.some((t=>t.target instanceof e&&"page"===t.target.getAttribute("aria-current")));this.setTriggerActive(i)}checkInitialAriaCurrent(){this.host.querySelector('[aria-current="page"]')&&this.setTriggerActive(!0)}render(){return s(o,{key:"02194ee3593dd471e2fc3aadb1d69041d613ce0a",version:r},s("div",{key:"77ab3faeb3705ac0d97ab0d72cc3fbf12c19badc",ref:t=>this.animatedContainer=t,class:"megadropdown",style:this.isVisible?{}:{display:"none"}},s("div",{key:"5d8b3ef651c3eb19f08e3ccd6c9356e01463a2e0",class:"section"},"desktop"!==this.device&&this.megadropdownTitle&&s("p",{key:"e99a5751ea896f3ab55dc9bf58635f7b2fef2a1c",class:"megadropdown-title"},this.megadropdownTitle),s("div",{key:"a0a1bfa04de139d48c825df8fdb24f93e031ea66",class:"megadropdown-content"},s("slot",{key:"68e44ce30fec1efed2855490b5d9af56ba41e004"})),"desktop"===this.device?s("post-closebutton",{onClick:()=>this.hide(!0),class:"close-button"},this.textClose):s("button",{onClick:()=>this.hide(!0),class:"back-button"},s("post-icon",{name:"arrowleft"}),this.textBack))))}get host(){return this}static get watchers(){return{textClose:[{validateTextClose:0}],textBack:[{validateTextBack:0}]}}static get style(){return"*,::before,::after{box-sizing:border-box}.megadropdown{position:absolute;inset-inline:0;overflow-y:auto;background-color:#fafafa;box-shadow:var(--post-device-elevation-300)}@media screen and (min-width: 1024px){.megadropdown{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{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:2rem 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:1rem;inset-inline-end:1rem}@media screen and (max-width: 1023.98px){.close-button{display:none}}"}},[257,"post-megadropdown",{textClose:[513,"text-close"],textBack:[513,"text-back"],device:[32],isVisible:[32],trigger:[32],megadropdownTitle:[32],animationClass:[32],toggle:[64],show:[64],hide:[64],focusFirst:[64]},void 0,{textClose:[{validateTextClose:0}],textBack:[{validateTextBack:0}]}]);function g(){"undefined"!=typeof customElements&&["post-megadropdown","post-closebutton","post-icon"].forEach((t=>{switch(t){case"post-megadropdown":customElements.get(n(t))||customElements.define(n(t),m);break;case"post-closebutton":customElements.get(n(t))||p();break;case"post-icon":customElements.get(n(t))||b()}}))}m.activeDropdown=null,g();const f=m,v=g;export{f as PostMegadropdown,v as defineCustomElement}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const PostMenuItem = PostMenuItem$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { PostMenuItem, defineCustomElement };
|
|
1
|
+
import{P as o,d as s}from"./p-YR7U0Z_g.js";const p=o,r=s;export{p as PostMenuItem,r as defineCustomElement}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const PostMenuTrigger = PostMenuTrigger$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { PostMenuTrigger, defineCustomElement };
|
|
1
|
+
import{P as o,d as s}from"./p-BC5nlBvn.js";const n=o,p=s;export{n as PostMenuTrigger,p as defineCustomElement}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const PostMenu = PostMenu$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { PostMenu, defineCustomElement };
|
|
1
|
+
import{P as o,d as p}from"./p-DpATRD2W.js";const s=o,r=p;export{s as PostMenu,r as defineCustomElement}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Components, JSX } from "../../types/components";
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
export const
|
|
5
|
-
prototype:
|
|
6
|
-
new ():
|
|
3
|
+
interface PostPagination extends Components.PostPagination, HTMLElement {}
|
|
4
|
+
export const PostPagination: {
|
|
5
|
+
prototype: PostPagination;
|
|
6
|
+
new (): PostPagination;
|
|
7
7
|
};
|
|
8
8
|
/**
|
|
9
9
|
* Used to define this component and all nested components recursively.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as i,H as e,c as n,h as a,a as s}from"./index.js";import{v as o}from"./p-CZvbetqX.js";import{n as l}from"./p-BLchVpF6.js";import{c as r,e as h}from"./p-B8YiQ3mz.js";import{d}from"./p-C9hMpmsD.js";import{d as p}from"./p-DY2U5CQt.js";const g=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postChange=n(this,"postChange"),this.items=[],this.lastWindowWidth=window.innerWidth,this.loaded=!1,this.debouncedResize=d(this.handleResizeInternal.bind(this),150),this.measurementTimeoutId=null}validatePage(){this.validateProp("page","number",!1)}validatePageSize(){this.validateProp("pageSize","number",!0)}validateCollectionSize(){this.validateProp("collectionSize","number",!0)}validateLabel(){this.validateProp("label","string",!0)}validateTextPrevious(){this.validateProp("textPrevious","string",!0)}validateTextNext(){this.validateProp("textNext","string",!0)}validateTextPage(){this.validateProp("textPage","string",!0)}validateTextFirst(){this.validateProp("textFirst","string",!0)}validateTextLast(){this.validateProp("textLast","string",!0)}validateDisabled(){this.validateProp("disabled","boolean",!1)}handlePropsChange(){this.updatePagesWithValidation()}componentWillLoad(){this.paginationId="pagination-"+(this.host.id||l(6)),null==this.page&&(this.page=1)}connectedCallback(){window.addEventListener("resize",this.debouncedResize)}componentDidLoad(){this.loaded=!0,this.runAllValidations(),this.scheduleMeasurement()}disconnectedCallback(){this.loaded=!1,window.removeEventListener("resize",this.debouncedResize),null!==this.measurementTimeoutId&&(clearTimeout(this.measurementTimeoutId),this.measurementTimeoutId=null)}validateProp(t,i,e=!0){e?r(this,t,i):h(this,t,i)}runAllValidations(){this.validateProp("page","number",!1),this.validateProp("pageSize","number",!0),this.validateProp("collectionSize","number",!0),this.validateProp("label","string",!0),this.validateProp("textPrevious","string",!0),this.validateProp("textNext","string",!0),this.validateProp("textPage","string",!0),this.validateProp("textFirst","string",!0),this.validateProp("textLast","string",!0),this.validateProp("disabled","boolean",!1)}scheduleMeasurement(){this.loaded&&(this.measurementTimeoutId=window.setTimeout((()=>{this.navRef?.clientWidth>0&&this.hiddenItemsRef?this.measureAndCalculateVisiblePages():this.scheduleMeasurement()}),50))}handleResizeInternal(){this.loaded&&window.innerWidth!==this.lastWindowWidth&&(this.lastWindowWidth=window.innerWidth,this.measureAndCalculateVisiblePages())}calculateGap(t,i){const e=t.getBoundingClientRect();return i.getBoundingClientRect().left-e.right}measureAndCalculateVisiblePages(){if(!this.navRef||!this.hiddenItemsRef||!this.loaded)return;const t=this.getTotalPages();if(t<=1)return;const i=this.getPaginationPadding(),e=this.getAvailableWidth()-i,n=this.getControlButtonsWidth(),a=this.hiddenItemsRef.querySelector(".hidden-page-button"),s=this.hiddenItemsRef.querySelector(".hidden-ellipsis");if(!a)return;const o=a.getBoundingClientRect().width,l=a&&s?this.calculateGap(a,s):0;this.maxVisiblePages=Math.max(3,Math.min(Math.floor((e-n-2*l+l)/(o+l)),t)),this.updatePagesWithValidation()}getControlButtonsWidth(){return this.hiddenItemsRef?Array.from(this.hiddenItemsRef.querySelectorAll(".hidden-control-button")).reduce(((t,i)=>t+i.getBoundingClientRect().width),0):0}getPaginationPadding(){if(!this.navRef)return 0;const t=window.getComputedStyle(this.navRef);return(parseFloat(t.paddingLeft)||0)+(parseFloat(t.paddingRight)||0)}getAvailableWidth(){return this.navRef?this.host.parentElement?.clientWidth??window.innerWidth:0}get invalidSize(){return 0===this.collectionSize||0===this.pageSize}clampPageToValidRange(t){return 0===t||this.invalidSize||isNaN(t)||!this.page||this.page<1||isNaN(this.page)?1:this.page>t?t:this.page}updatePagesWithValidation(){const t=this.getTotalPages();this.page=this.clampPageToValidRange(t),this.generatePages(t)}getTotalPages(){return this.invalidSize?1:Math.ceil(this.collectionSize/this.pageSize)}sectionForGap(t){return t<=1?"none":2===t?"page":"ellipsis"}getSections(t,i,e){const n=t-1,a=e-i;return{leftSection:this.sectionForGap(n),rightSection:this.sectionForGap(a),leftGap:n,rightGap:a}}computeTotalItems(t,i,e){const{leftSection:n,rightSection:a}=this.getSections(t,i,e);return 2+("none"===n?0:1)+("none"===a?0:1)+Math.max(0,i-t+1)}buildAllPages(t){const i=[];for(let e=1;e<=t;e++)i.push({type:"page",page:e});return i}adjustForGapTwo(t,i,e,n){const a={startPage:t,endPage:i};return 2==e-i&&(a.endPage=e-1,a.startPage=Math.max(2,a.endPage-n+1)),2==a.startPage-1&&(a.startPage=2,a.endPage=Math.min(e-1,a.startPage+n-1)),a}ensureMiddleSlots(t,i,e,n){const a={startPage:t,endPage:i},s=i-t+1;return s<n&&i<e-1&&(a.endPage=Math.min(e-1,t+n-1)),s<n&&t>2&&(a.startPage=Math.max(2,i-n+1)),a}trimExcessItems(t,i,e,n,a){const s={startPage:t,endPage:i};let o=this.computeTotalItems(s.startPage,s.endPage,e);for(;o>n;){if(s.endPage-a>=a-s.startPage&&s.endPage>s.startPage)s.endPage=Math.max(s.startPage-1,s.endPage-1);else{if(!(s.startPage<s.endPage))break;s.startPage=Math.min(s.endPage+1,s.startPage+1)}const t=this.computeTotalItems(s.startPage,s.endPage,e);if(t===o)break;o=t}return s}expandToFillSlots(t,i,e,n){const a={startPage:t,endPage:i};let s=this.computeTotalItems(a.startPage,a.endPage,e);for(;s<n;){const t=a.endPage<e-1;if(a.startPage>2)a.startPage=Math.max(2,a.startPage-1);else{if(!t)break;a.endPage=Math.min(e-1,a.endPage+1)}const i=this.computeTotalItems(a.startPage,a.endPage,e);if(i===s)break;s=i}return a}balanceTotalItems(t,i,e,n,a){const s=this.trimExcessItems(t,i,e,n,a);return this.expandToFillSlots(s.startPage,s.endPage,e,n)}calculatePageRange(t,i,e){const n=Math.max(0,e-2-2);if(n<=0)return{startPage:2,endPage:1};let a=t-Math.floor(n/2),s=a+n-1;a<2&&(a=2,s=a+n-1),s>i-1&&(s=i-1,a=s-n+1),a=Math.max(2,a),s=Math.min(i-1,s);const o=this.adjustForGapTwo(a,s,i,n),l=this.ensureMiddleSlots(o.startPage,o.endPage,i,n);return this.balanceTotalItems(l.startPage,l.endPage,i,e,t)}buildPaginationItems(t,i,e){const n=[],a=t<=i;if(n.push({type:"page",page:1}),a){const{leftSection:a,rightSection:s}=this.getSections(t,i,e);"page"===a?n.push({type:"page",page:2}):"ellipsis"===a&&n.push({type:"ellipsis"});for(let e=t;e<=i;e++)n.push({type:"page",page:e});return"page"===s?n.push({type:"page",page:e-1}):"ellipsis"===s&&n.push({type:"ellipsis"}),n.push({type:"page",page:e}),n}}generateSmallPagination(t,i){return 1===t||t===i?[{type:"page",page:1},{type:"ellipsis"},{type:"page",page:i}]:[{type:"ellipsis"},{type:"page",page:t},{type:"ellipsis"}]}generatePages(t){const i=this.maxVisiblePages,e=this.page||1;if(t<=i)return void(this.items=this.buildAllPages(t));if(i<=4)return void(this.items=this.generateSmallPagination(e,t));const{startPage:n,endPage:a}=this.calculatePageRange(e,t,i);this.items=this.buildPaginationItems(n,a,t)}emitPageChange(t){this.page=t,this.postChange.emit(t)}handlePageClick(t){this.disabled||t===this.page||this.emitPageChange(t)}handlePrevious(){this.disabled||this.page<=1||this.emitPageChange(this.page-1)}handleNext(){const t=this.getTotalPages();this.disabled||this.page>=t||this.emitPageChange(this.page+1)}handleKeyDown(t,i){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),i())}buildPageLabel(t){const i=this.getTotalPages();return 1===t?`${this.textFirst}, ${this.textPage} ${t}`:t===i?`${this.textLast}, ${this.textPage} ${t}`:`${this.textPage} ${t}`}renderEllipsis(t){return a("li",{class:"pagination-item pagination-ellipsis",key:t},a("span",{class:"pagination-ellipsis-content","aria-hidden":"true"},"..."))}renderPageButton(t){const i=t===this.page;return a("li",{class:"pagination-item",key:"page-"+t},a("button",{type:"button",class:{"pagination-link":!0,"pagination-link-active":i},"aria-label":this.buildPageLabel(t),"aria-current":i?"page":void 0,onClick:()=>this.handlePageClick(t),onKeyDown:i=>this.handleKeyDown(i,(()=>this.handlePageClick(t))),disabled:!!this.disabled||void 0,tabIndex:this.disabled?-1:0},a("span",{"aria-hidden":"true"},t)))}renderItem(t,i){return"ellipsis"===t.type?this.renderEllipsis("ellipsis-"+i):this.renderPageButton(t.page)}renderControlButton(t,i,e,n,s=!1){return a("li",{class:"pagination-item pagination-control"},a("button",{type:"button",class:{"pagination-link":!0,"pagination-control-button":!0,"pagination-link-disabled":e},"aria-label":i,onClick:n,onKeyDown:t=>this.handleKeyDown(t,n),disabled:e,tabIndex:e?-1:0},a("post-icon",{name:t,class:s?"pagination-icon-rotated":void 0,"aria-hidden":"true"}),a("span",{class:"visually-hidden"},i)))}renderHiddenItems(t){return[a("button",{class:"pagination-link pagination-control-button hidden-control-button",disabled:!0},a("post-icon",{name:"chevronleft","aria-hidden":"true"})),a("button",{class:"pagination-link pagination-control-button hidden-page-button","aria-label":this.buildPageLabel(t),disabled:!0},a("span",{"aria-hidden":"true"},t)),a("span",{class:"pagination-ellipsis-content hidden-ellipsis","aria-hidden":"true"},"..."),a("button",{class:"pagination-link pagination-control-button hidden-control-button",disabled:!0},a("post-icon",{name:"chevronleft",class:"pagination-icon-rotated","aria-hidden":"true"}))]}render(){const t=this.getTotalPages();if(t<=1)return null;const i=this.disabled||this.page>=t;return a(s,{slot:"post-pagination","data-version":o},a("nav",{class:"pagination","aria-label":this.label,id:this.paginationId,ref:t=>this.navRef=t},a("ul",{class:"pagination-list",role:"list"},this.renderControlButton("chevronleft",this.textPrevious,this.disabled||this.page<=1,(()=>this.handlePrevious())),this.items.map(((t,i)=>this.renderItem(t,i))),this.renderControlButton("chevronleft",this.textNext,i,(()=>this.handleNext()),!0)),a("div",{class:"hidden-items","aria-hidden":"true",ref:t=>this.hiddenItemsRef=t},this.renderHiddenItems(t))))}get host(){return this}static get watchers(){return{page:[{validatePage:0},{handlePropsChange:0}],pageSize:[{validatePageSize:0},{handlePropsChange:0}],collectionSize:[{validateCollectionSize:0},{handlePropsChange:0}],label:[{validateLabel:0}],textPrevious:[{validateTextPrevious:0}],textNext:[{validateTextNext:0}],textPage:[{validateTextPage:0}],textFirst:[{validateTextFirst:0}],textLast:[{validateTextLast:0}],disabled:[{validateDisabled:0}]}}static get style(){return".pagination{position:relative;display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;padding:8px;overflow:hidden}.pagination-list{display:flex;align-items:center;gap:4px;min-width:0;max-width:100%;margin:0;padding:0;list-style:none;flex-wrap:nowrap}.pagination-item{display:flex;align-items:center;margin:0;padding:0;flex-shrink:0;flex-grow:0}.pagination-link{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:32px;height:32px;min-width:32px;padding:0;margin:0;font-size:14px;font-weight:700;color:#050400;text-decoration:none;background-color:rgba(0,0,0,0);border:1px solid #ccc;border-radius:100%;cursor:pointer;appearance:none;outline:none}.pagination-link:hover:not(:disabled):not(.pagination-link-disabled){color:#504f4b;background-color:#f5f5f5;border:2px solid #504f4b}.pagination-link:active:not(:disabled):not(.pagination-link-disabled):not(.pagination-link-active){color:#504f4b;background-color:#f5f5f5;border:2px solid #504f4b}.pagination-link:focus-visible{z-index:1;outline:2px solid #050400;outline-offset:2px}.pagination-link:focus:not(:focus-visible){outline:none}.pagination-link.pagination-link-active{font-weight:700;color:#fff;background-color:#050400;border-color:#050400;cursor:default}.pagination-link.pagination-link-active:hover:not(:disabled):not(.pagination-link-disabled){background-color:#504f4b;border-color:#504f4b;color:#fff}.pagination-link:disabled,.pagination-link.pagination-link-disabled{color:#6b6b6b;background-color:#f0f0f0;border-color:#ccc;opacity:.6;cursor:default}@media (min-width: 600px){.pagination-link{width:40px;height:40px;min-width:40px;font-size:16px}}@media (min-width: 1024px){.pagination-link{width:48px;height:48px;min-width:48px;font-size:20px}}.pagination-control-button post-icon{display:flex;align-items:center;justify-content:center;width:16px;height:16px}@media (min-width: 600px){.pagination-control-button post-icon{width:18px;height:18px}}@media (min-width: 1024px){.pagination-control-button post-icon{width:20px;height:20px}}.pagination-control-button:active:not(:disabled):not(.pagination-link-disabled){background-color:#f5f5f5;border:2px solid #504f4b}.pagination-ellipsis{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0}.pagination-ellipsis-content{display:flex;align-items:center;justify-content:center;width:32px;height:32px;font-size:14px;color:#050400;user-select:none}@media (min-width: 600px){.pagination-ellipsis-content{width:40px;height:40px}}@media (min-width: 1024px){.pagination-ellipsis-content{width:48px;height:48px}}.hidden-items{position:absolute;display:flex;gap:4px;height:0;overflow:hidden;white-space:nowrap;visibility:hidden;pointer-events:none}.pagination-icon-rotated{display:inline-block;transform:rotate(180deg)}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}"}},[1,"post-pagination",{page:[1026],pageSize:[514,"page-size"],collectionSize:[514,"collection-size"],label:[513],textPrevious:[513,"text-previous"],textNext:[513,"text-next"],textPage:[513,"text-page"],textFirst:[513,"text-first"],textLast:[513,"text-last"],disabled:[4],paginationId:[32],maxVisiblePages:[32],items:[32]},void 0,{page:[{validatePage:0},{handlePropsChange:0}],pageSize:[{validatePageSize:0},{handlePropsChange:0}],collectionSize:[{validateCollectionSize:0},{handlePropsChange:0}],label:[{validateLabel:0}],textPrevious:[{validateTextPrevious:0}],textNext:[{validateTextNext:0}],textPage:[{validateTextPage:0}],textFirst:[{validateTextFirst:0}],textLast:[{validateTextLast:0}],disabled:[{validateDisabled:0}]}]);function c(){"undefined"!=typeof customElements&&["post-pagination","post-icon"].forEach((i=>{switch(i){case"post-pagination":customElements.get(t(i))||customElements.define(t(i),g);break;case"post-icon":customElements.get(t(i))||p()}}))}c();const u=g,x=c;export{u as PostPagination,x as defineCustomElement}
|
|
@@ -1,133 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
3
|
-
import { i as isFocusable } from './p-HygIVKXC.js';
|
|
4
|
-
import { c as checkRequiredAndType } from './p-CYkf_7Y5.js';
|
|
5
|
-
import './p-CJ80BZ06.js';
|
|
6
|
-
|
|
7
|
-
const postPopoverTriggerCss = ":host{cursor:pointer}";
|
|
8
|
-
|
|
9
|
-
const PostPopoverTrigger$1 = /*@__PURE__*/ proxyCustomElement(class PostPopoverTrigger extends H {
|
|
10
|
-
syncAriaExpanded(newValue) {
|
|
11
|
-
this.ariaExpanded = newValue;
|
|
12
|
-
if (this.trigger) {
|
|
13
|
-
this.trigger.setAttribute('aria-expanded', String(newValue));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
18
|
-
* @param forValue - The new value of the `for` property.
|
|
19
|
-
*/
|
|
20
|
-
validateFor() {
|
|
21
|
-
checkRequiredAndType(this, 'for', 'string');
|
|
22
|
-
}
|
|
23
|
-
// Gets the associated popover element to the trigger based on 'for'
|
|
24
|
-
get popover() {
|
|
25
|
-
const ref = document.getElementById(this.for);
|
|
26
|
-
return ref?.localName === 'post-popover' ? ref : null;
|
|
27
|
-
}
|
|
28
|
-
setupTrigger() {
|
|
29
|
-
this.trigger = this.host.querySelector('*');
|
|
30
|
-
if (this.trigger) {
|
|
31
|
-
this.trigger.setAttribute('aria-expanded', this.ariaExpanded.toString());
|
|
32
|
-
// check if its not focusable and add aria role and tabindex
|
|
33
|
-
if (!isFocusable(this.trigger)) {
|
|
34
|
-
this.trigger.setAttribute('tabindex', '0');
|
|
35
|
-
this.trigger.setAttribute('role', 'button');
|
|
36
|
-
}
|
|
37
|
-
// Set aria attributes
|
|
38
|
-
this.trigger.setAttribute('aria-haspopup', 'true');
|
|
39
|
-
this.trigger.setAttribute('aria-controls', this.for);
|
|
40
|
-
this.trigger.addEventListener('click', this.boundHandleToggle);
|
|
41
|
-
this.trigger.addEventListener('keydown', this.boundHandleKeyDown);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
console.error('No content found in the post-popover-trigger slot. Please insert a focusable element or content that can receive focus.');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
handleToggle() {
|
|
48
|
-
const popoverEl = this.popover;
|
|
49
|
-
if (popoverEl) {
|
|
50
|
-
popoverEl.toggle(this.trigger);
|
|
51
|
-
this.focusTrigger();
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
console.warn(`No post-popover found with ID: ${this.for}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
focusTrigger() {
|
|
58
|
-
// Restores focus to the trigger
|
|
59
|
-
if (!this.popoverOpen && this.trigger) {
|
|
60
|
-
this.trigger.focus();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
constructor() {
|
|
64
|
-
super();
|
|
65
|
-
this.__registerHost();
|
|
66
|
-
this.__attachShadow();
|
|
67
|
-
/**
|
|
68
|
-
* Manages the accessibility attribute `aria-expanded` to indicate whether the associated popover is expanded or collapsed.
|
|
69
|
-
*/
|
|
70
|
-
this.ariaExpanded = false;
|
|
71
|
-
/**
|
|
72
|
-
* Holds the state of the popover toggle
|
|
73
|
-
*/
|
|
74
|
-
this.popoverOpen = false;
|
|
75
|
-
this.handleKeyDown = (e) => {
|
|
76
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
this.handleToggle();
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
this.boundHandleToggle = this.handleToggle.bind(this);
|
|
82
|
-
this.boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
83
|
-
this.boundHandlePostToggle = (event) => {
|
|
84
|
-
this.popoverOpen = event.detail.isOpen;
|
|
85
|
-
this.focusTrigger();
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
componentDidLoad() {
|
|
89
|
-
this.validateFor();
|
|
90
|
-
this.setupTrigger();
|
|
91
|
-
this.popover?.addEventListener('postToggle', this.boundHandlePostToggle);
|
|
92
|
-
}
|
|
93
|
-
disconnectedCallback() {
|
|
94
|
-
this.trigger.removeEventListener('click', this.boundHandleToggle);
|
|
95
|
-
this.trigger.removeEventListener('keydown', this.boundHandleKeyDown);
|
|
96
|
-
this.popover?.removeEventListener('postToggle', this.boundHandlePostToggle);
|
|
97
|
-
}
|
|
98
|
-
render() {
|
|
99
|
-
return (h(Host, { key: '5beba85bbe276a0f047415c4fefa2a013f922cdc', "data-version": version }, h("slot", { key: '4f1a4834e97275ab8a011888d0c932db6471e727', onSlotchange: () => this.setupTrigger() })));
|
|
100
|
-
}
|
|
101
|
-
get host() { return this; }
|
|
102
|
-
static get watchers() { return {
|
|
103
|
-
"popoverOpen": ["syncAriaExpanded"],
|
|
104
|
-
"for": ["validateFor"]
|
|
105
|
-
}; }
|
|
106
|
-
static get style() { return postPopoverTriggerCss; }
|
|
107
|
-
}, [1, "post-popover-trigger", {
|
|
108
|
-
"for": [513],
|
|
109
|
-
"ariaExpanded": [32],
|
|
110
|
-
"popoverOpen": [32]
|
|
111
|
-
}, undefined, {
|
|
112
|
-
"popoverOpen": ["syncAriaExpanded"],
|
|
113
|
-
"for": ["validateFor"]
|
|
114
|
-
}]);
|
|
115
|
-
function defineCustomElement$1() {
|
|
116
|
-
if (typeof customElements === "undefined") {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const components = ["post-popover-trigger"];
|
|
120
|
-
components.forEach(tagName => { switch (tagName) {
|
|
121
|
-
case "post-popover-trigger":
|
|
122
|
-
if (!customElements.get(tagName)) {
|
|
123
|
-
customElements.define(tagName, PostPopoverTrigger$1);
|
|
124
|
-
}
|
|
125
|
-
break;
|
|
126
|
-
} });
|
|
127
|
-
}
|
|
128
|
-
defineCustomElement$1();
|
|
129
|
-
|
|
130
|
-
const PostPopoverTrigger = PostPopoverTrigger$1;
|
|
131
|
-
const defineCustomElement = defineCustomElement$1;
|
|
132
|
-
|
|
133
|
-
export { PostPopoverTrigger, defineCustomElement };
|
|
1
|
+
import{t,p as s,H as i,h as e,a as o}from"./index.js";import{v as r}from"./p-CZvbetqX.js";import{i as h}from"./p-HygIVKXC.js";import{e as n}from"./p-B8YiQ3mz.js";const a=s(class extends i{syncAriaExpanded(t){this.ariaExpanded=t,this.trigger&&this.trigger.setAttribute("aria-expanded",t+"")}validateFor(){n(this,"for","string")}hasAriaControlsElements(t){return"ariaControlsElements"in t}get popover(){const t=this.host.querySelector("post-popover")??document.getElementById(this.for);return t?"post-popover"===t?.localName?t:null:(console.error(`No post-popover found ${this.for?"with ID: "+this.for:"inside the <post-popover-trigger>"}.`),null)}setupTrigger(){const t=this.popover;this.trigger=this.host.querySelector("*"),this.trigger?(h(this.trigger)||(this.trigger.setAttribute("tabindex","0"),this.trigger.setAttribute("role","button")),t&&(this.trigger.setAttribute("aria-expanded",""+this.ariaExpanded),this.trigger.setAttribute("aria-haspopup","true"),this.for?this.trigger.setAttribute("aria-controls",this.for):this.hasAriaControlsElements(this.trigger)?this.trigger.ariaControlsElements=[t]:(t.id||(t.id="popover-"+crypto.randomUUID()),this.trigger.setAttribute("aria-controls",t.id)),this.trigger.addEventListener("click",this.boundHandleToggle),this.trigger.addEventListener("keydown",this.boundHandleKeyDown))):console.error("No content found in the post-popover-trigger slot. Please insert a focusable element or content that can receive focus.")}handleToggle(){this.popover?.toggle(this.trigger),this.focusTrigger()}focusTrigger(){!this.popoverOpen&&this.trigger&&this.trigger.focus()}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.ariaExpanded=!1,this.popoverOpen=!1,this.handleKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleToggle())},this.boundHandleToggle=this.handleToggle.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this),this.boundHandlePostToggle=t=>{this.popoverOpen=t.detail.isOpen,this.focusTrigger()}}componentDidLoad(){this.validateFor(),this.setupTrigger(),this.popover?.addEventListener("postToggle",this.boundHandlePostToggle)}disconnectedCallback(){this.trigger.removeEventListener("click",this.boundHandleToggle),this.trigger.removeEventListener("keydown",this.boundHandleKeyDown),this.popover?.removeEventListener("postToggle",this.boundHandlePostToggle)}render(){return e(o,{key:"8552f66f45c0cf3f772cb96b4974a447a4a2cf19","data-version":r},e("slot",{key:"06824853f828cc65ba7a7a2b7ae8b762f6b1eaee",onSlotchange:()=>this.setupTrigger()}))}get host(){return this}static get watchers(){return{popoverOpen:[{syncAriaExpanded:0}],for:[{validateFor:0}]}}static get style(){return":host{cursor:pointer}"}},[257,"post-popover-trigger",{for:[513],ariaExpanded:[32],popoverOpen:[32]},void 0,{popoverOpen:[{syncAriaExpanded:0}],for:[{validateFor:0}]}]);function p(){"undefined"!=typeof customElements&&["post-popover-trigger"].forEach((s=>{"post-popover-trigger"===s&&(customElements.get(t(s))||customElements.define(t(s),a))}))}p();const c=a,l=p;export{c as PostPopoverTrigger,l as defineCustomElement}
|
|
@@ -1,119 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { d as defineCustomElement$2, a as PLACEMENT_TYPES } from './p-DVGEExot.js';
|
|
3
|
-
import { v as version } from './p-BhxZzOEC.js';
|
|
4
|
-
import { a as getDeepFocusableChildren } from './p-BVXiQdHq.js';
|
|
5
|
-
import { d as checkEmptyOrOneOf, c as checkRequiredAndType } from './p-CYkf_7Y5.js';
|
|
6
|
-
import './p-CJ80BZ06.js';
|
|
7
|
-
import { d as defineCustomElement$4 } from './p-XrZzCOKT.js';
|
|
8
|
-
import { d as defineCustomElement$3 } from './p-DBPOV12C.js';
|
|
9
|
-
|
|
10
|
-
const postPopoverCss = "*{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:var(--post-popover-max-width, 280px)}.popover-content{padding:.5em;flex-grow:1}";
|
|
11
|
-
|
|
12
|
-
const PostPopover$1 = /*@__PURE__*/ proxyCustomElement(class PostPopover extends H {
|
|
13
|
-
constructor() {
|
|
14
|
-
super();
|
|
15
|
-
this.__registerHost();
|
|
16
|
-
this.__attachShadow();
|
|
17
|
-
/**
|
|
18
|
-
* Defines the position of the popover relative to its trigger.
|
|
19
|
-
* Popovers are automatically flipped to the opposite side if there is not enough available space and are shifted towards the viewport if they would overlap edge boundaries.
|
|
20
|
-
* For supported values and behavior details, see the [Floating UI placement documentation](https://floating-ui.com/docs/computePosition#placement).
|
|
21
|
-
*/
|
|
22
|
-
this.placement = 'top';
|
|
23
|
-
/**
|
|
24
|
-
* Show a little indicator arrow
|
|
25
|
-
*/
|
|
26
|
-
// eslint-disable-next-line @stencil-community/ban-default-true
|
|
27
|
-
this.arrow = true;
|
|
28
|
-
}
|
|
29
|
-
validatePlacement() {
|
|
30
|
-
checkEmptyOrOneOf(this, 'placement', PLACEMENT_TYPES);
|
|
31
|
-
}
|
|
32
|
-
validateCloseButtonCaption() {
|
|
33
|
-
checkRequiredAndType(this, 'closeButtonCaption', 'string');
|
|
34
|
-
}
|
|
35
|
-
componentDidLoad() {
|
|
36
|
-
this.validatePlacement();
|
|
37
|
-
this.validateCloseButtonCaption();
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Programmatically display the popover
|
|
41
|
-
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
42
|
-
*/
|
|
43
|
-
async show(target) {
|
|
44
|
-
this.popoverRef.show(target);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Programmatically hide this popover
|
|
48
|
-
*/
|
|
49
|
-
async hide() {
|
|
50
|
-
this.popoverRef.hide();
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Toggle popover display
|
|
54
|
-
* @param target A focusable element inside the <post-popover-trigger> component that controls the popover
|
|
55
|
-
* @param force Pass true to always show or false to always hide
|
|
56
|
-
*/
|
|
57
|
-
async toggle(target, force) {
|
|
58
|
-
await this.popoverRef.toggle(target, force);
|
|
59
|
-
const focusableChildren = getDeepFocusableChildren(this.host);
|
|
60
|
-
// find first focusable element
|
|
61
|
-
const firstFocusable = focusableChildren[0];
|
|
62
|
-
if (firstFocusable) {
|
|
63
|
-
firstFocusable.focus();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
render() {
|
|
67
|
-
return (h(Host, { key: '5ef2edb171dada1bf701a6583471410e02297a5b', "data-version": version }, h("post-popovercontainer", { key: '3f913ddf3756ecbec65c1ab04423421adbc46f16', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '541a5a7da9eb1362609d7d58717ffde7ef4cbb90', class: "popover-container" }, h("div", { key: '1b3d22349574f7fb542cfa662aca0d34c85c1d2f', class: "popover-content" }, h("slot", { key: 'a17a97f0abe47fb7a1777fa3f9365efc0cfc5b1d' })), h("post-closebutton", { key: '9888084b892be0381c64620a534c45231533fa59', onClick: () => this.hide() }, this.closeButtonCaption)))));
|
|
68
|
-
}
|
|
69
|
-
get host() { return this; }
|
|
70
|
-
static get watchers() { return {
|
|
71
|
-
"placement": ["validatePlacement"],
|
|
72
|
-
"closeButtonCaption": ["validateCloseButtonCaption"]
|
|
73
|
-
}; }
|
|
74
|
-
static get style() { return postPopoverCss; }
|
|
75
|
-
}, [1, "post-popover", {
|
|
76
|
-
"placement": [1],
|
|
77
|
-
"closeButtonCaption": [513, "close-button-caption"],
|
|
78
|
-
"arrow": [4],
|
|
79
|
-
"show": [64],
|
|
80
|
-
"hide": [64],
|
|
81
|
-
"toggle": [64]
|
|
82
|
-
}, undefined, {
|
|
83
|
-
"placement": ["validatePlacement"],
|
|
84
|
-
"closeButtonCaption": ["validateCloseButtonCaption"]
|
|
85
|
-
}]);
|
|
86
|
-
function defineCustomElement$1() {
|
|
87
|
-
if (typeof customElements === "undefined") {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const components = ["post-popover", "post-closebutton", "post-icon", "post-popovercontainer"];
|
|
91
|
-
components.forEach(tagName => { switch (tagName) {
|
|
92
|
-
case "post-popover":
|
|
93
|
-
if (!customElements.get(tagName)) {
|
|
94
|
-
customElements.define(tagName, PostPopover$1);
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
case "post-closebutton":
|
|
98
|
-
if (!customElements.get(tagName)) {
|
|
99
|
-
defineCustomElement$4();
|
|
100
|
-
}
|
|
101
|
-
break;
|
|
102
|
-
case "post-icon":
|
|
103
|
-
if (!customElements.get(tagName)) {
|
|
104
|
-
defineCustomElement$3();
|
|
105
|
-
}
|
|
106
|
-
break;
|
|
107
|
-
case "post-popovercontainer":
|
|
108
|
-
if (!customElements.get(tagName)) {
|
|
109
|
-
defineCustomElement$2();
|
|
110
|
-
}
|
|
111
|
-
break;
|
|
112
|
-
} });
|
|
113
|
-
}
|
|
114
|
-
defineCustomElement$1();
|
|
115
|
-
|
|
116
|
-
const PostPopover = PostPopover$1;
|
|
117
|
-
const defineCustomElement = defineCustomElement$1;
|
|
118
|
-
|
|
119
|
-
export { PostPopover, defineCustomElement };
|
|
1
|
+
import{t,p as e,H as o,h as s,a}from"./index.js";import{d as i,a as c}from"./p-D9DDtvFM.js";import{v as r}from"./p-CZvbetqX.js";import{a as p}from"./p-CJ13r5fi.js";import{d as n,c as d}from"./p-B8YiQ3mz.js";import{d as l}from"./p-ByFh05IW.js";import{d as m}from"./p-DY2U5CQt.js";const h=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.placement="top",this.arrow=!0}validatePlacement(){n(this,"placement",c)}validateTextClose(){d(this,"textClose","string")}componentDidLoad(){this.validatePlacement(),this.validateTextClose()}async show(t){await this.popoverRef.show(t),this.focusFirstEl()}async hide(){this.popoverRef.hide()}async toggle(t,e){await this.popoverRef.toggle(t,e)&&this.focusFirstEl()}focusFirstEl(){const t=p(this.host)[0];t&&t.focus()}render(){return s(a,{key:"d015a324a7c9fe1c3508ccd3e434435d92d74f85","data-version":r},s("post-popovercontainer",{key:"01c575c2b9370d512858e9c71a402ee08843d052",arrow:this.arrow,placement:this.placement,ref:t=>this.popoverRef=t},s("div",{key:"4be3ccad4885493091a9572c6bf95ea137ad66f9",class:"popover-container"},s("div",{key:"3b9e69e7e84f7acdb2a14cb27e11d10d4aa2900b",class:"popover-content"},s("slot",{key:"de871fc377dfdc17f64f9bb40e5421e00a103ce0"})),s("post-closebutton",{key:"d73a44affc7e09a3452988f63f16cc4eea83aa66",onClick:()=>this.hide()},this.textClose))))}get host(){return this}static get watchers(){return{placement:[{validatePlacement:0}],textClose:[{validateTextClose:0}]}}static get style(){return"*{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{color:var(--post-current-fg);background-color:var(--post-current-bg);display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:var(--post-popover-max-width, 280px)}.popover-content{padding:.5em;flex-grow:1}"}},[257,"post-popover",{placement:[1],textClose:[513,"text-close"],arrow:[4],show:[64],hide:[64],toggle:[64]},void 0,{placement:[{validatePlacement:0}],textClose:[{validateTextClose:0}]}]);function f(){"undefined"!=typeof customElements&&["post-popover","post-closebutton","post-icon","post-popovercontainer"].forEach((e=>{switch(e){case"post-popover":customElements.get(t(e))||customElements.define(t(e),h);break;case"post-closebutton":customElements.get(t(e))||l();break;case"post-icon":customElements.get(t(e))||m();break;case"post-popovercontainer":customElements.get(t(e))||i()}}))}f();const v=h,b=f;export{v as PostPopover,b as defineCustomElement}
|