@swisspost/design-system-components 9.0.0-next.32 → 9.0.0-next.34
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/{attribute-observer-6d8b886b.js → attribute-observer-c3a805b2.js} +3 -1
- package/dist/cjs/{breakpoints-c6247c71.js → breakpoints-cdf1b747.js} +12 -7
- package/dist/cjs/event-guard-efabc84f.js +47 -0
- package/dist/cjs/get-root-8102fecd.js +17 -0
- package/dist/cjs/{index-d6bf2c66.js → index-b60129c4.js} +2 -2
- package/dist/cjs/index.cjs.js +25 -25
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/long-press-event-6e62d113.js +266 -0
- package/dist/cjs/{package-6f8f430c.js → package-3426e8f7.js} +1 -1
- package/dist/cjs/{post-accordion-e3a6d78e.js → post-accordion-3ac8dca8.js} +10 -12
- package/dist/cjs/{post-accordion-item-7ed1f630.js → post-accordion-item-aace6bc2.js} +10 -10
- package/dist/cjs/post-accordion-item.cjs.entry.js +5 -3
- package/dist/cjs/post-accordion.cjs.entry.js +5 -3
- package/dist/cjs/{post-avatar-de8ec197.js → post-avatar-53abd22f.js} +5 -4
- package/dist/cjs/post-avatar.cjs.entry.js +4 -3
- package/dist/cjs/post-back-to-top-b231fc1c.js +96 -0
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -3
- package/dist/cjs/{post-banner-bf523706.js → post-banner-e6d14bf1.js} +4 -8
- package/dist/cjs/post-banner.cjs.entry.js +4 -3
- package/dist/cjs/{post-breadcrumb-da55143a.js → post-breadcrumb-a929f2a6.js} +30 -22
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +4 -3
- package/dist/cjs/post-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/{post-card-control-0bcd7d16.js → post-card-control-cbee7b86.js} +26 -40
- package/dist/cjs/post-card-control.cjs.entry.js +4 -3
- package/dist/cjs/post-closebutton_15.cjs.entry.js +6 -5
- package/dist/cjs/{post-collapsible-trigger-a5e4451d.js → post-collapsible-trigger-d1cb592a.js} +39 -46
- package/dist/cjs/post-collapsible_2.cjs.entry.js +6 -5
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/{post-footer-b15fee73.js → post-footer-4290dafc.js} +11 -11
- package/dist/cjs/post-footer.cjs.entry.js +4 -4
- package/dist/cjs/{post-linkarea-8c85bf5e.js → post-linkarea-f22f4f92.js} +5 -5
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/{post-menu-item-509877cd.js → post-menu-item-afabaa61.js} +4 -4
- package/dist/cjs/{post-popover-1213aa19.js → post-popover-a4c72d38.js} +16 -14
- package/dist/cjs/post-popover.cjs.entry.js +5 -4
- package/dist/cjs/{post-rating-e1f8a668.js → post-rating-b87616fc.js} +4 -14
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-889a6c64.js → post-tab-header-45cb6bb4.js} +5 -4
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -3
- package/dist/cjs/{post-tab-panel-300f39a9.js → post-tab-panel-00d16ba7.js} +4 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-dc281228.js → post-tabs-2c3a89d0.js} +5 -12
- package/dist/cjs/post-tabs.cjs.entry.js +4 -3
- package/dist/cjs/{post-tag-fd9e586f.js → post-tag-370a2f4d.js} +3 -3
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-ad6ae1e4.js → post-togglebutton-2c9552e3.js} +969 -471
- package/dist/cjs/{post-tooltip-52d690e4.js → post-tooltip-4d4d2ea9.js} +39 -296
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
- package/dist/collection/animations/collapse.js +3 -1
- package/dist/collection/components/post-accordion/post-accordion.js +6 -10
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +6 -8
- package/dist/collection/components/post-avatar/post-avatar.js +3 -4
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -1
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +37 -19
- package/dist/collection/components/post-banner/post-banner.js +0 -6
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +16 -19
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -2
- package/dist/collection/components/post-card-control/post-card-control.js +24 -40
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -0
- package/dist/collection/components/post-closebutton/post-closebutton.js +12 -2
- package/dist/collection/components/post-collapsible/post-collapsible.js +4 -10
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +29 -32
- package/dist/collection/components/post-footer/post-footer.js +8 -9
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +16 -19
- package/dist/collection/components/post-icon/post-icon.js +5 -7
- package/dist/collection/components/post-language-option/post-language-option.js +1 -10
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +25 -31
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +2 -2
- package/dist/collection/components/post-list/post-list.js +1 -3
- package/dist/collection/components/post-list-item/post-list-item.js +1 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +98 -182
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +20 -30
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +42 -36
- package/dist/collection/components/post-menu/post-menu.js +51 -52
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +13 -15
- package/dist/collection/components/post-popover/post-popover.js +12 -12
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +30 -33
- package/dist/collection/components/post-rating/post-rating.js +1 -12
- package/dist/collection/components/post-tab-header/post-tab-header.js +2 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
- package/dist/collection/components/post-tabs/post-tabs.js +1 -10
- package/dist/collection/components/post-tag/post-tag.js +0 -1
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +10 -11
- package/dist/collection/components/post-tooltip/post-tooltip.js +36 -32
- package/dist/collection/utils/attribute-observer.js +2 -1
- package/dist/collection/utils/breakpoints.js +9 -7
- package/dist/collection/utils/environment.js +2 -0
- package/dist/collection/utils/event-guard.js +43 -0
- package/dist/collection/utils/get-root.js +6 -1
- package/dist/collection/utils/index.js +5 -0
- package/dist/collection/utils/is-motion-reduced.js +2 -1
- package/dist/components/attribute-observer.js +3 -1
- package/dist/components/breakpoints.js +12 -8
- package/dist/components/event-guard.js +45 -0
- package/dist/components/get-root.js +7 -1
- package/dist/components/long-press-event.js +264 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +8 -8
- package/dist/components/post-accordion2.js +8 -10
- package/dist/components/post-avatar2.js +4 -3
- package/dist/components/post-back-to-top2.js +40 -20
- package/dist/components/post-banner2.js +2 -6
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/post-breadcrumb2.js +28 -20
- package/dist/components/post-card-control2.js +25 -39
- package/dist/components/post-closebutton2.js +8 -3
- package/dist/components/post-collapsible-trigger2.js +33 -35
- package/dist/components/post-collapsible2.js +9 -12
- package/dist/components/post-footer2.js +8 -8
- package/dist/components/post-header2.js +18 -20
- package/dist/components/post-icon2.js +6 -6
- package/dist/components/post-language-option2.js +3 -10
- package/dist/components/post-language-switch2.js +28 -31
- package/dist/components/post-linkarea2.js +5 -4
- package/dist/components/post-list-item2.js +2 -2
- package/dist/components/post-list2.js +2 -3
- package/dist/components/post-logo2.js +3 -2
- package/dist/components/post-mainnavigation2.js +94 -182
- package/dist/components/post-megadropdown-trigger2.js +44 -36
- package/dist/components/post-megadropdown2.js +22 -31
- package/dist/components/post-menu-trigger2.js +15 -15
- package/dist/components/post-menu2.js +53 -52
- package/dist/components/post-popover2.js +14 -12
- package/dist/components/post-popovercontainer2.js +638 -36
- package/dist/components/post-rating2.js +2 -12
- package/dist/components/post-tab-header2.js +4 -3
- package/dist/components/post-tab-panel2.js +3 -3
- package/dist/components/post-tabs2.js +3 -10
- package/dist/components/post-tag2.js +1 -1
- package/dist/components/post-togglebutton2.js +12 -11
- package/dist/components/post-tooltip2.js +37 -294
- package/dist/docs.json +21 -15
- package/dist/esm/{attribute-observer-2f203993.js → attribute-observer-009deee5.js} +3 -1
- package/dist/esm/{breakpoints-bbe0c54e.js → breakpoints-7812702e.js} +12 -8
- package/dist/esm/event-guard-538ee077.js +45 -0
- package/dist/esm/get-root-1b1af46f.js +15 -0
- package/dist/esm/{index-3419e46d.js → index-f4d19816.js} +2 -2
- package/dist/esm/index.js +25 -25
- package/dist/esm/loader.js +3 -3
- package/dist/esm/long-press-event-04d24397.js +264 -0
- package/dist/esm/package-8986a24c.js +3 -0
- package/dist/esm/{post-accordion-7b6fb9c3.js → post-accordion-577b52a0.js} +10 -12
- package/dist/esm/{post-accordion-item-d40c0b26.js → post-accordion-item-99053b41.js} +10 -10
- package/dist/esm/post-accordion-item.entry.js +5 -3
- package/dist/esm/post-accordion.entry.js +5 -3
- package/dist/esm/{post-avatar-04ca6e3e.js → post-avatar-2914706c.js} +5 -4
- package/dist/esm/post-avatar.entry.js +4 -3
- package/dist/esm/post-back-to-top-4c7b1b47.js +94 -0
- package/dist/esm/post-back-to-top.entry.js +4 -3
- package/dist/esm/{post-banner-7c37e3ef.js → post-banner-295fd0f5.js} +4 -8
- package/dist/esm/post-banner.entry.js +4 -3
- package/dist/esm/{post-breadcrumb-59e4d655.js → post-breadcrumb-1abfb312.js} +30 -22
- package/dist/esm/post-breadcrumb-item_2.entry.js +4 -3
- package/dist/esm/post-breadcrumb.entry.js +4 -4
- package/dist/esm/{post-card-control-5471488b.js → post-card-control-ad72d4f8.js} +26 -40
- package/dist/esm/post-card-control.entry.js +4 -3
- package/dist/esm/post-closebutton_15.entry.js +6 -5
- package/dist/esm/{post-collapsible-trigger-1f6d816e.js → post-collapsible-trigger-6b4ece20.js} +39 -46
- package/dist/esm/post-collapsible_2.entry.js +6 -5
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/{post-footer-d30f4dc8.js → post-footer-a5105e66.js} +11 -11
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/{post-linkarea-8e1a561e.js → post-linkarea-22f97a88.js} +5 -5
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/{post-menu-item-0c8477eb.js → post-menu-item-9465a1f3.js} +4 -4
- package/dist/esm/{post-popover-c43969ca.js → post-popover-e9b4569c.js} +16 -14
- package/dist/esm/post-popover.entry.js +5 -4
- package/dist/esm/{post-rating-94148df7.js → post-rating-ae16e3c9.js} +4 -14
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-82df0ba9.js → post-tab-header-11f23150.js} +5 -4
- package/dist/esm/post-tab-header.entry.js +4 -3
- package/dist/esm/{post-tab-panel-a6512f53.js → post-tab-panel-0f3a952e.js} +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-d26ce341.js → post-tabs-1192509c.js} +5 -12
- package/dist/esm/post-tabs.entry.js +4 -3
- package/dist/esm/{post-tag-41d1667e.js → post-tag-8be0a71c.js} +3 -3
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-4f94bddb.js → post-togglebutton-b634fc7c.js} +969 -471
- package/dist/esm/{post-tooltip-20f916db.js → post-tooltip-f64bd0cc.js} +39 -296
- package/dist/esm/post-tooltip.entry.js +5 -4
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-0889c759.js +1 -0
- package/dist/post-components/p-0f398677.js +1 -0
- package/dist/post-components/p-1038fc25.js +1 -0
- package/dist/post-components/p-30f94eca.entry.js +1 -0
- package/dist/post-components/p-31bb6dc5.entry.js +1 -0
- package/dist/post-components/p-32173742.js +1 -0
- package/dist/post-components/p-338a2507.js +1 -0
- package/dist/post-components/p-36540dd6.entry.js +1 -0
- package/dist/post-components/p-3aa766a6.js +1 -0
- package/dist/post-components/p-3b0158b3.js +1 -0
- package/dist/post-components/p-40db8cd5.js +1 -0
- package/dist/post-components/p-44f13ce4.entry.js +1 -0
- package/dist/post-components/p-46a9324f.entry.js +1 -0
- package/dist/post-components/p-49c5aa99.js +1 -0
- package/dist/post-components/p-4cd4a936.entry.js +1 -0
- package/dist/post-components/p-548ef2f5.entry.js +1 -0
- package/dist/post-components/p-58f453dd.js +1 -0
- package/dist/post-components/p-5f54b77f.js +1 -0
- package/dist/post-components/p-60bb7f26.js +1 -0
- package/dist/post-components/p-60bfa4be.entry.js +1 -0
- package/dist/post-components/p-6b31a76a.js +1 -0
- package/dist/post-components/p-6ee81c5d.js +1 -0
- package/dist/post-components/p-6faad212.entry.js +1 -0
- package/dist/post-components/p-722ffaae.js +1 -0
- package/dist/post-components/p-74a0b44c.entry.js +1 -0
- package/dist/post-components/{p-28e77ad3.js → p-78b4c699.js} +1 -1
- package/dist/post-components/p-7aa0468b.entry.js +1 -0
- package/dist/post-components/p-7afc495e.entry.js +1 -0
- package/dist/post-components/p-8db32dab.js +8 -0
- package/dist/post-components/p-96034ba4.entry.js +1 -0
- package/dist/post-components/p-9aaf9f54.js +1 -0
- package/dist/post-components/{p-5c758f41.js → p-9e461613.js} +1 -1
- package/dist/post-components/p-ab4073be.js +1 -0
- package/dist/post-components/p-abd7eb91.js +8 -0
- package/dist/post-components/p-afb8a487.entry.js +1 -0
- package/dist/post-components/p-b003b381.js +1 -0
- package/dist/post-components/p-b97dea1e.entry.js +1 -0
- package/dist/post-components/p-be37cf2a.js +1 -0
- package/dist/post-components/p-c31b56ed.js +1 -0
- package/dist/post-components/p-ccbb51fe.js +1 -0
- package/dist/post-components/p-d3900385.entry.js +1 -0
- package/dist/post-components/p-ef49153c.entry.js +1 -0
- package/dist/post-components/p-f27e5691.js +1 -0
- package/dist/post-components/p-f553019f.entry.js +1 -0
- package/dist/post-components/p-ffc1db17.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +1 -1
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +3 -1
- package/dist/types/components/post-card-control/post-card-control.d.ts +1 -1
- package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +9 -14
- package/dist/types/components/post-footer/post-footer.d.ts +2 -2
- package/dist/types/components/post-header/post-header.d.ts +1 -0
- package/dist/types/components/post-icon/post-icon.d.ts +0 -1
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +5 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +14 -39
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +2 -0
- package/dist/types/components/post-menu/post-menu.d.ts +1 -0
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +3 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +6 -1
- package/dist/types/components.d.ts +4 -4
- package/dist/types/popover-fn.d.ts +11 -0
- package/dist/types/utils/environment.d.ts +2 -0
- package/dist/types/utils/event-guard.d.ts +4 -0
- package/dist/types/utils/get-root.d.ts +4 -0
- package/dist/types/utils/index.d.ts +5 -0
- package/loaders/attribute-observer.js +3 -1
- package/loaders/breakpoints.js +12 -8
- package/loaders/event-guard.js +45 -0
- package/loaders/get-root.js +7 -1
- package/loaders/index.js +3 -3
- package/loaders/long-press-event.js +264 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +8 -8
- package/loaders/post-accordion.js +8 -10
- package/loaders/post-avatar.js +4 -3
- package/loaders/post-back-to-top.js +40 -20
- package/loaders/post-banner.js +2 -6
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/post-breadcrumb.js +28 -20
- package/loaders/post-card-control.js +25 -39
- package/loaders/post-closebutton.js +8 -3
- package/loaders/post-collapsible-trigger2.js +33 -35
- package/loaders/post-collapsible2.js +9 -12
- package/loaders/post-footer.js +8 -8
- package/loaders/post-header.js +18 -20
- package/loaders/post-icon2.js +6 -6
- package/loaders/post-language-option.js +3 -10
- package/loaders/post-language-switch.js +28 -31
- package/loaders/post-linkarea.js +5 -4
- package/loaders/post-list-item.js +2 -2
- package/loaders/post-list.js +2 -3
- package/loaders/post-logo.js +3 -2
- package/loaders/post-mainnavigation.js +94 -182
- package/loaders/post-megadropdown-trigger.js +44 -36
- package/loaders/post-megadropdown.js +22 -31
- package/loaders/post-menu-trigger2.js +15 -15
- package/loaders/post-menu2.js +53 -52
- package/loaders/post-popover.js +14 -12
- package/loaders/post-popovercontainer2.js +638 -36
- package/loaders/post-rating.js +2 -12
- package/loaders/post-tab-header.js +4 -3
- package/loaders/post-tab-panel.js +3 -3
- package/loaders/post-tabs.js +3 -10
- package/loaders/post-tag.js +1 -1
- package/loaders/post-togglebutton.js +12 -11
- package/loaders/post-tooltip.js +37 -294
- package/package.json +5 -5
- package/dist/cjs/debounce-158fd76f.js +0 -13
- package/dist/cjs/get-root-7a3498ef.js +0 -11
- package/dist/cjs/post-back-to-top-6a1c1ba4.js +0 -76
- package/dist/components/debounce.js +0 -11
- package/dist/esm/debounce-e54c7131.js +0 -11
- package/dist/esm/get-root-7af2e0d1.js +0 -9
- package/dist/esm/package-70367d05.js +0 -3
- package/dist/esm/post-back-to-top-abe253c1.js +0 -74
- package/dist/post-components/p-015361b5.entry.js +0 -1
- package/dist/post-components/p-077edb8c.js +0 -1
- package/dist/post-components/p-08a13d05.js +0 -1
- package/dist/post-components/p-08c3b919.entry.js +0 -1
- package/dist/post-components/p-0d7b0c2e.entry.js +0 -1
- package/dist/post-components/p-12f9a91e.entry.js +0 -1
- package/dist/post-components/p-20137c6a.entry.js +0 -1
- package/dist/post-components/p-21254d9c.entry.js +0 -1
- package/dist/post-components/p-22513a27.entry.js +0 -1
- package/dist/post-components/p-3638e50d.js +0 -1
- package/dist/post-components/p-4397f28e.js +0 -1
- package/dist/post-components/p-494a2a31.js +0 -1
- package/dist/post-components/p-509987da.entry.js +0 -1
- package/dist/post-components/p-5aeb3656.js +0 -1
- package/dist/post-components/p-5d0bb74d.js +0 -1
- package/dist/post-components/p-5e0f6c12.js +0 -1
- package/dist/post-components/p-5f89f4e8.entry.js +0 -1
- package/dist/post-components/p-6213f0dc.entry.js +0 -1
- package/dist/post-components/p-6ad7bf0f.js +0 -1
- package/dist/post-components/p-6f058a98.js +0 -1
- package/dist/post-components/p-737d76cb.js +0 -15
- package/dist/post-components/p-753a1935.js +0 -1
- package/dist/post-components/p-88a2cdaa.js +0 -1
- package/dist/post-components/p-90935fdd.js +0 -1
- package/dist/post-components/p-931c4523.js +0 -1
- package/dist/post-components/p-9748a355.js +0 -1
- package/dist/post-components/p-97865e22.entry.js +0 -1
- package/dist/post-components/p-a200c9c7.js +0 -1
- package/dist/post-components/p-a35c235a.entry.js +0 -1
- package/dist/post-components/p-a4264a61.entry.js +0 -1
- package/dist/post-components/p-a54c63d0.entry.js +0 -1
- package/dist/post-components/p-aebe402d.entry.js +0 -1
- package/dist/post-components/p-b43e79e3.entry.js +0 -1
- package/dist/post-components/p-c0c71e37.js +0 -1
- package/dist/post-components/p-c0ca344d.js +0 -1
- package/dist/post-components/p-c554fcf3.js +0 -1
- package/dist/post-components/p-cff7c06f.entry.js +0 -1
- package/dist/post-components/p-d1f70a05.entry.js +0 -1
- package/dist/post-components/p-dc67e6de.entry.js +0 -1
- package/dist/post-components/p-e1baac59.js +0 -1
- package/dist/post-components/p-f1ceccf3.js +0 -1
- package/dist/post-components/p-fc91cbc2.js +0 -1
- package/loaders/debounce.js +0 -11
package/loaders/post-rating.js
CHANGED
|
@@ -6,24 +6,13 @@ const postRatingCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technol
|
|
|
6
6
|
const PostRatingStyle0 = postRatingCss;
|
|
7
7
|
|
|
8
8
|
const PostRating$1 = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTMLElement {
|
|
9
|
-
hasChanged = false;
|
|
10
|
-
get host() { return this; }
|
|
11
|
-
/**
|
|
12
|
-
* An event emitted whenever the component's value has changed (on input).
|
|
13
|
-
* The event payload can be used like so: `event.detail.value`.
|
|
14
|
-
*/
|
|
15
|
-
postInput;
|
|
16
|
-
/**
|
|
17
|
-
* An event emitted whenever the component's value has changed (on blur).
|
|
18
|
-
* The event payload can be used like so: `event.detail.value`.
|
|
19
|
-
*/
|
|
20
|
-
postChange;
|
|
21
9
|
constructor() {
|
|
22
10
|
super();
|
|
23
11
|
this.__registerHost();
|
|
24
12
|
this.__attachShadow();
|
|
25
13
|
this.postInput = createEvent(this, "postInput", 7);
|
|
26
14
|
this.postChange = createEvent(this, "postChange", 7);
|
|
15
|
+
this.hasChanged = false;
|
|
27
16
|
this.hoveredIndex = undefined;
|
|
28
17
|
this.label = 'Rating';
|
|
29
18
|
this.stars = 5;
|
|
@@ -93,6 +82,7 @@ const PostRating$1 = /*@__PURE__*/ proxyCustomElement(class PostRating extends H
|
|
|
93
82
|
'after-active': i > this.hoveredIndex && i < this.currentRating,
|
|
94
83
|
}, onClick: () => this.update(i + 1), onMouseEnter: e => this.hoverHandler(i, e), onMouseLeave: e => this.hoverHandler(i, e) }, h("post-icon", { name: "2062", class: "stroke" }), h("post-icon", { name: "2574", class: "fill" })))))));
|
|
95
84
|
}
|
|
85
|
+
get host() { return this; }
|
|
96
86
|
static get style() { return PostRatingStyle0; }
|
|
97
87
|
}, [1, "post-rating", {
|
|
98
88
|
"label": [1],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
4
|
+
import './breakpoints.js';
|
|
4
5
|
import { n as nanoid } from './index.browser.js';
|
|
5
6
|
|
|
6
7
|
const postTabHeaderCss = ".tab-title[role=tab]{display:inline-block;cursor:pointer;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:#000;text-decoration:none;background-color:rgba(0,0,0,0)}.tab-title[role=tab]:focus{background-color:unset;color:#000}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(0,0,0,.6);color:#fff}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(0,0,0,.6);color:#fff;box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:\"\";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:#fff;color:#000;font-weight:700}.tab-title[role=tab].active::before{content:\"\";display:block;position:absolute;top:0;right:-1px;left:-1px;height:var(--post-core-dimension-4);background-color:#fc0}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:var(--post-core-dimension-2) solid Highlight;outline-offset:calc(var(--post-core-dimension-4)*-1)}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title{background-color:ButtonFace !important}.tab-title:hover{background-color:Highlight !important}}";
|
|
@@ -14,7 +15,6 @@ const PostTabHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostTabHeader ext
|
|
|
14
15
|
this.tabId = undefined;
|
|
15
16
|
this.panel = undefined;
|
|
16
17
|
}
|
|
17
|
-
get host() { return this; }
|
|
18
18
|
validateFor() {
|
|
19
19
|
checkNonEmpty(this, 'panel');
|
|
20
20
|
}
|
|
@@ -22,14 +22,15 @@ const PostTabHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostTabHeader ext
|
|
|
22
22
|
this.tabId = `tab-${this.host.id || nanoid(6)}`;
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
return (h(Host, { key: '
|
|
25
|
+
return (h(Host, { key: '5046c46fa27fd6586c694420abf197b227b56520', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '78c2f660e4f2307ca95a63f4cfd90d08cc6942df' })));
|
|
26
26
|
}
|
|
27
|
+
get host() { return this; }
|
|
27
28
|
static get watchers() { return {
|
|
28
29
|
"panel": ["validateFor"]
|
|
29
30
|
}; }
|
|
30
31
|
static get style() { return PostTabHeaderStyle0; }
|
|
31
32
|
}, [1, "post-tab-header", {
|
|
32
|
-
"panel": [
|
|
33
|
+
"panel": [513],
|
|
33
34
|
"tabId": [32]
|
|
34
35
|
}, undefined, {
|
|
35
36
|
"panel": ["validateFor"]
|
|
@@ -13,17 +13,17 @@ const PostTabPanel$1 = /*@__PURE__*/ proxyCustomElement(class PostTabPanel exten
|
|
|
13
13
|
this.panelId = undefined;
|
|
14
14
|
this.name = undefined;
|
|
15
15
|
}
|
|
16
|
-
get host() { return this; }
|
|
17
16
|
componentWillLoad() {
|
|
18
17
|
// get the id set on the host element or use a random id by default
|
|
19
18
|
this.panelId = `panel-${this.host.id || nanoid(6)}`;
|
|
20
19
|
}
|
|
21
20
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: '98427b35c6637af65930b69b75ea56facf044000', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '4fa02667e8ff088c10122e010cfd7efe8ff3af57' })));
|
|
23
22
|
}
|
|
23
|
+
get host() { return this; }
|
|
24
24
|
static get style() { return PostTabPanelStyle0; }
|
|
25
25
|
}, [1, "post-tab-panel", {
|
|
26
|
-
"name": [
|
|
26
|
+
"name": [513],
|
|
27
27
|
"panelId": [32]
|
|
28
28
|
}]);
|
|
29
29
|
function defineCustomElement$1() {
|
package/loaders/post-tabs.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { f as fadeOut, a as fadeIn } from './fade.js';
|
|
4
|
+
import './breakpoints.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Invoke the `componentOnReady` method if it is available, simulate it otherwise
|
|
@@ -32,21 +33,12 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
32
33
|
this.__registerHost();
|
|
33
34
|
this.__attachShadow();
|
|
34
35
|
this.postChange = createEvent(this, "postChange", 7);
|
|
36
|
+
this.isLoaded = false;
|
|
35
37
|
this.activePanel = undefined;
|
|
36
38
|
}
|
|
37
|
-
activeTab;
|
|
38
|
-
showing;
|
|
39
|
-
hiding;
|
|
40
|
-
isLoaded = false;
|
|
41
39
|
get tabs() {
|
|
42
40
|
return Array.from(this.host.querySelectorAll('post-tab-header')).filter(tab => tab.closest('post-tabs') === this.host);
|
|
43
41
|
}
|
|
44
|
-
get host() { return this; }
|
|
45
|
-
/**
|
|
46
|
-
* An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.
|
|
47
|
-
* The payload is the name of the newly shown panel.
|
|
48
|
-
*/
|
|
49
|
-
postChange;
|
|
50
42
|
componentDidLoad() {
|
|
51
43
|
this.moveMisplacedTabs();
|
|
52
44
|
this.enableTabs();
|
|
@@ -174,6 +166,7 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
174
166
|
render() {
|
|
175
167
|
return (h(Host, { key: 'dae24eee55a75f9b825f590883a9c1e896c1e9fc', "data-version": version }, h("div", { key: '0a26de80b8267ddc30455b0b5afbf10ae521232b', class: "tabs-wrapper", part: "tabs" }, h("div", { key: '826cb0a4355eeb5ddc07288e1e68fc72785c095f', class: "tabs", role: "tablist" }, h("slot", { key: '94ce90bc3dc8ff4b5012fcfa3c0039b188c14002', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '462f80f3368431344910cc317f1c0f42112dc99a', class: "tab-content", part: "content" }, h("slot", { key: '57a80ac790ca75f3b62382994c21a3a3c78004cc', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
176
168
|
}
|
|
169
|
+
get host() { return this; }
|
|
177
170
|
static get style() { return PostTabsStyle0; }
|
|
178
171
|
}, [1, "post-tabs", {
|
|
179
172
|
"activePanel": [1, "active-panel"],
|
package/loaders/post-tag.js
CHANGED
|
@@ -6,7 +6,6 @@ const postTagCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology
|
|
|
6
6
|
const PostTagStyle0 = postTagCss;
|
|
7
7
|
|
|
8
8
|
const PostTag$1 = /*@__PURE__*/ proxyCustomElement(class PostTag extends HTMLElement {
|
|
9
|
-
get host() { return this; }
|
|
10
9
|
constructor() {
|
|
11
10
|
super();
|
|
12
11
|
this.__registerHost();
|
|
@@ -38,6 +37,7 @@ const PostTag$1 = /*@__PURE__*/ proxyCustomElement(class PostTag extends HTMLEle
|
|
|
38
37
|
render() {
|
|
39
38
|
return (h(Host, { key: '4ca273166b81099dd8fc0f69d3d38215e3d7ccbc', "data-version": version }, h("div", { key: 'b6c4eb6a3bf8cbaad18cf6277dab79bd6e350f0a', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '4f9e8cf6b2c723e31d60e30464c1106a9f72b5b4', class: "tag-text" }, h("slot", { key: '819a4e6ff743386f8d5d6b1d94dea9ee4a612784' })))));
|
|
40
39
|
}
|
|
40
|
+
get host() { return this; }
|
|
41
41
|
static get watchers() { return {
|
|
42
42
|
"variant": ["variantChanged"],
|
|
43
43
|
"size": ["sizeChanged"]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { c as checkType } from './check-type.js';
|
|
4
|
+
import './breakpoints.js';
|
|
4
5
|
|
|
5
6
|
const postTogglebuttonCss = ":host{cursor:pointer;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}:host(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-visible){outline-color:Highlight !important}}:host([aria-pressed=true]) ::slotted([data-showwhen=untoggled]){display:none}:host([aria-pressed=false]) ::slotted([data-showwhen=toggled]){display:none}";
|
|
6
7
|
const PostTogglebuttonStyle0 = postTogglebuttonCss;
|
|
@@ -10,9 +11,18 @@ const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutt
|
|
|
10
11
|
super();
|
|
11
12
|
this.__registerHost();
|
|
12
13
|
this.__attachShadow();
|
|
14
|
+
this.handleClick = () => {
|
|
15
|
+
this.toggled = !this.toggled;
|
|
16
|
+
};
|
|
17
|
+
this.handleKeydown = (event) => {
|
|
18
|
+
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
19
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
20
|
+
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
21
|
+
this.host.click();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
13
24
|
this.toggled = false;
|
|
14
25
|
}
|
|
15
|
-
get host() { return this; }
|
|
16
26
|
validateToggled() {
|
|
17
27
|
checkType(this, 'toggled', 'boolean');
|
|
18
28
|
}
|
|
@@ -22,19 +32,10 @@ const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutt
|
|
|
22
32
|
this.host.addEventListener('click', () => this.handleClick());
|
|
23
33
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
24
34
|
}
|
|
25
|
-
handleClick = () => {
|
|
26
|
-
this.toggled = !this.toggled;
|
|
27
|
-
};
|
|
28
|
-
handleKeydown = (event) => {
|
|
29
|
-
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
30
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
31
|
-
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
32
|
-
this.host.click();
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
35
|
render() {
|
|
36
36
|
return (h(Host, { key: '3a1429a9b67b8cfafae184fe0d060ee3a04974e0', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: '9ab1537574423740fc335fde732c699698acac25' })));
|
|
37
37
|
}
|
|
38
|
+
get host() { return this; }
|
|
38
39
|
static get watchers() { return {
|
|
39
40
|
"toggled": ["validateToggled"]
|
|
40
41
|
}; }
|
package/loaders/post-tooltip.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement as HTMLElement$1, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { v as version$1 } from './package.js';
|
|
3
2
|
import { g as getAttributeObserver } from './attribute-observer.js';
|
|
4
3
|
import { c as checkEmptyOrType } from './index2.js';
|
|
4
|
+
import { I as IS_BROWSER } from './breakpoints.js';
|
|
5
|
+
import { v as version$1 } from './package.js';
|
|
5
6
|
import { d as defineCustomElement$2 } from './post-popovercontainer2.js';
|
|
6
7
|
|
|
7
8
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -4508,274 +4509,14 @@ module.exports = exports['default'];
|
|
|
4508
4509
|
|
|
4509
4510
|
const isFocusable = /*@__PURE__*/getDefaultExportFromCjs(focusable.exports);
|
|
4510
4511
|
|
|
4511
|
-
/*!
|
|
4512
|
-
* long-press-event - v@version@
|
|
4513
|
-
* Pure JavaScript long-press-event
|
|
4514
|
-
* https://github.com/john-doherty/long-press-event
|
|
4515
|
-
* @author John Doherty <www.johndoherty.info>
|
|
4516
|
-
* @license MIT
|
|
4517
|
-
*/
|
|
4518
|
-
(function (window, document) {
|
|
4519
|
-
|
|
4520
|
-
// local timer object based on rAF
|
|
4521
|
-
var timer = null;
|
|
4522
|
-
|
|
4523
|
-
// check if we're using a touch screen
|
|
4524
|
-
var hasPointerEvents = (('PointerEvent' in window) || (window.navigator && 'msPointerEnabled' in window.navigator));
|
|
4525
|
-
var isTouch = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
|
|
4526
|
-
|
|
4527
|
-
// switch to pointer events or touch events if using a touch screen
|
|
4528
|
-
var mouseDown = hasPointerEvents ? 'pointerdown' : isTouch ? 'touchstart' : 'mousedown';
|
|
4529
|
-
var mouseUp = hasPointerEvents ? 'pointerup' : isTouch ? 'touchend' : 'mouseup';
|
|
4530
|
-
var mouseMove = hasPointerEvents ? 'pointermove' : isTouch ? 'touchmove' : 'mousemove';
|
|
4531
|
-
var mouseLeave = hasPointerEvents ? 'pointerleave' : isTouch ? 'touchleave' : 'mouseleave';
|
|
4532
|
-
|
|
4533
|
-
// track number of pixels the mouse moves during long press
|
|
4534
|
-
var startX = 0; // mouse x position when timer started
|
|
4535
|
-
var startY = 0; // mouse y position when timer started
|
|
4536
|
-
var maxDiffX = 10; // max number of X pixels the mouse can move during long press before it is canceled
|
|
4537
|
-
var maxDiffY = 10; // max number of Y pixels the mouse can move during long press before it is canceled
|
|
4538
|
-
|
|
4539
|
-
// patch CustomEvent to allow constructor creation (IE/Chrome)
|
|
4540
|
-
if (typeof window.CustomEvent !== 'function') {
|
|
4541
|
-
|
|
4542
|
-
window.CustomEvent = function (event, params) {
|
|
4543
|
-
|
|
4544
|
-
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
|
4545
|
-
|
|
4546
|
-
var evt = document.createEvent('CustomEvent');
|
|
4547
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
4548
|
-
return evt;
|
|
4549
|
-
};
|
|
4550
|
-
|
|
4551
|
-
window.CustomEvent.prototype = window.Event.prototype;
|
|
4552
|
-
}
|
|
4553
|
-
|
|
4554
|
-
// requestAnimationFrame() shim by Paul Irish
|
|
4555
|
-
window.requestAnimFrame = (function () {
|
|
4556
|
-
return window.requestAnimationFrame ||
|
|
4557
|
-
window.webkitRequestAnimationFrame ||
|
|
4558
|
-
window.mozRequestAnimationFrame ||
|
|
4559
|
-
window.oRequestAnimationFrame ||
|
|
4560
|
-
window.msRequestAnimationFrame || function (callback) {
|
|
4561
|
-
window.setTimeout(callback, 1000 / 60);
|
|
4562
|
-
};
|
|
4563
|
-
})();
|
|
4564
|
-
|
|
4565
|
-
/**
|
|
4566
|
-
* Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance
|
|
4567
|
-
* @param {function} fn The callback function
|
|
4568
|
-
* @param {int} delay The delay in milliseconds
|
|
4569
|
-
* @returns {object} handle to the timeout object
|
|
4570
|
-
*/
|
|
4571
|
-
function requestTimeout(fn, delay) {
|
|
4572
|
-
|
|
4573
|
-
if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame &&
|
|
4574
|
-
!(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
|
|
4575
|
-
!window.oRequestAnimationFrame && !window.msRequestAnimationFrame) return window.setTimeout(fn, delay);
|
|
4576
|
-
|
|
4577
|
-
var start = new Date().getTime();
|
|
4578
|
-
var handle = {};
|
|
4579
|
-
|
|
4580
|
-
var loop = function () {
|
|
4581
|
-
var current = new Date().getTime();
|
|
4582
|
-
var delta = current - start;
|
|
4583
|
-
|
|
4584
|
-
if (delta >= delay) {
|
|
4585
|
-
fn.call();
|
|
4586
|
-
}
|
|
4587
|
-
else {
|
|
4588
|
-
handle.value = requestAnimFrame(loop);
|
|
4589
|
-
}
|
|
4590
|
-
};
|
|
4591
|
-
|
|
4592
|
-
handle.value = requestAnimFrame(loop);
|
|
4593
|
-
|
|
4594
|
-
return handle;
|
|
4595
|
-
}
|
|
4596
|
-
|
|
4597
|
-
/**
|
|
4598
|
-
* Behaves the same as clearTimeout except uses cancelRequestAnimationFrame() where possible for better performance
|
|
4599
|
-
* @param {object} handle The callback function
|
|
4600
|
-
* @returns {void}
|
|
4601
|
-
*/
|
|
4602
|
-
function clearRequestTimeout(handle) {
|
|
4603
|
-
if (handle) {
|
|
4604
|
-
window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) :
|
|
4605
|
-
window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) :
|
|
4606
|
-
window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */
|
|
4607
|
-
window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) :
|
|
4608
|
-
window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) :
|
|
4609
|
-
window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) :
|
|
4610
|
-
clearTimeout(handle);
|
|
4611
|
-
}
|
|
4612
|
-
}
|
|
4613
|
-
|
|
4614
|
-
/**
|
|
4615
|
-
* Fires the 'long-press' event on element
|
|
4616
|
-
* @param {MouseEvent|PointerEvent|TouchEvent} originalEvent The original event being fired
|
|
4617
|
-
* @returns {void}
|
|
4618
|
-
*/
|
|
4619
|
-
function fireLongPressEvent(originalEvent) {
|
|
4620
|
-
|
|
4621
|
-
clearLongPressTimer();
|
|
4622
|
-
|
|
4623
|
-
originalEvent = unifyEvent(originalEvent);
|
|
4624
|
-
|
|
4625
|
-
// fire the long-press event
|
|
4626
|
-
var allowClickEvent = this.dispatchEvent(new CustomEvent('long-press', {
|
|
4627
|
-
bubbles: true,
|
|
4628
|
-
cancelable: true,
|
|
4629
|
-
|
|
4630
|
-
// custom event data (legacy)
|
|
4631
|
-
detail: {
|
|
4632
|
-
clientX: originalEvent.clientX,
|
|
4633
|
-
clientY: originalEvent.clientY,
|
|
4634
|
-
offsetX: originalEvent.offsetX,
|
|
4635
|
-
offsetY: originalEvent.offsetY,
|
|
4636
|
-
pageX: originalEvent.pageX,
|
|
4637
|
-
pageY: originalEvent.pageY
|
|
4638
|
-
},
|
|
4639
|
-
|
|
4640
|
-
// add coordinate data that would typically acompany a touch/click event
|
|
4641
|
-
clientX: originalEvent.clientX,
|
|
4642
|
-
clientY: originalEvent.clientY,
|
|
4643
|
-
offsetX: originalEvent.offsetX,
|
|
4644
|
-
offsetY: originalEvent.offsetY,
|
|
4645
|
-
pageX: originalEvent.pageX,
|
|
4646
|
-
pageY: originalEvent.pageY,
|
|
4647
|
-
screenX: originalEvent.screenX,
|
|
4648
|
-
screenY: originalEvent.screenY
|
|
4649
|
-
}));
|
|
4650
|
-
|
|
4651
|
-
if (!allowClickEvent) {
|
|
4652
|
-
// suppress the next click event if e.preventDefault() was called in long-press handler
|
|
4653
|
-
document.addEventListener('click', function suppressEvent(e) {
|
|
4654
|
-
document.removeEventListener('click', suppressEvent, true);
|
|
4655
|
-
cancelEvent(e);
|
|
4656
|
-
}, true);
|
|
4657
|
-
}
|
|
4658
|
-
}
|
|
4659
|
-
|
|
4660
|
-
/**
|
|
4661
|
-
* consolidates mouse, touch, and Pointer events
|
|
4662
|
-
* @param {MouseEvent|PointerEvent|TouchEvent} e The original event being fired
|
|
4663
|
-
* @returns {MouseEvent|PointerEvent|Touch}
|
|
4664
|
-
*/
|
|
4665
|
-
function unifyEvent(e) {
|
|
4666
|
-
if (e.changedTouches !== undefined) {
|
|
4667
|
-
return e.changedTouches[0];
|
|
4668
|
-
}
|
|
4669
|
-
return e;
|
|
4670
|
-
}
|
|
4671
|
-
|
|
4672
|
-
/**
|
|
4673
|
-
* method responsible for starting the long press timer
|
|
4674
|
-
* @param {event} e - event object
|
|
4675
|
-
* @returns {void}
|
|
4676
|
-
*/
|
|
4677
|
-
function startLongPressTimer(e) {
|
|
4678
|
-
|
|
4679
|
-
clearLongPressTimer();
|
|
4680
|
-
|
|
4681
|
-
var el = e.target;
|
|
4682
|
-
|
|
4683
|
-
// get delay from html attribute if it exists, otherwise default to 1500
|
|
4684
|
-
var longPressDelayInMs = parseInt(getNearestAttribute(el, 'data-long-press-delay', '1500'), 10); // default 1500
|
|
4685
|
-
|
|
4686
|
-
// start the timer
|
|
4687
|
-
timer = requestTimeout(fireLongPressEvent.bind(el, e), longPressDelayInMs);
|
|
4688
|
-
}
|
|
4689
|
-
|
|
4690
|
-
/**
|
|
4691
|
-
* method responsible for clearing a pending long press timer
|
|
4692
|
-
* @param {event} e - event object
|
|
4693
|
-
* @returns {void}
|
|
4694
|
-
*/
|
|
4695
|
-
function clearLongPressTimer(e) {
|
|
4696
|
-
clearRequestTimeout(timer);
|
|
4697
|
-
timer = null;
|
|
4698
|
-
}
|
|
4699
|
-
|
|
4700
|
-
/**
|
|
4701
|
-
* Cancels the current event
|
|
4702
|
-
* @param {object} e - browser event object
|
|
4703
|
-
* @returns {void}
|
|
4704
|
-
*/
|
|
4705
|
-
function cancelEvent(e) {
|
|
4706
|
-
e.stopImmediatePropagation();
|
|
4707
|
-
e.preventDefault();
|
|
4708
|
-
e.stopPropagation();
|
|
4709
|
-
}
|
|
4710
|
-
|
|
4711
|
-
/**
|
|
4712
|
-
* Starts the timer on mouse down and logs current position
|
|
4713
|
-
* @param {object} e - browser event object
|
|
4714
|
-
* @returns {void}
|
|
4715
|
-
*/
|
|
4716
|
-
function mouseDownHandler(e) {
|
|
4717
|
-
startX = e.clientX;
|
|
4718
|
-
startY = e.clientY;
|
|
4719
|
-
startLongPressTimer(e);
|
|
4720
|
-
}
|
|
4721
|
-
|
|
4722
|
-
/**
|
|
4723
|
-
* If the mouse moves n pixels during long-press, cancel the timer
|
|
4724
|
-
* @param {object} e - browser event object
|
|
4725
|
-
* @returns {void}
|
|
4726
|
-
*/
|
|
4727
|
-
function mouseMoveHandler(e) {
|
|
4728
|
-
|
|
4729
|
-
// calculate total number of pixels the pointer has moved
|
|
4730
|
-
var diffX = Math.abs(startX - e.clientX);
|
|
4731
|
-
var diffY = Math.abs(startY - e.clientY);
|
|
4732
|
-
|
|
4733
|
-
// if pointer has moved more than allowed, cancel the long-press timer and therefore the event
|
|
4734
|
-
if (diffX >= maxDiffX || diffY >= maxDiffY) {
|
|
4735
|
-
clearLongPressTimer();
|
|
4736
|
-
}
|
|
4737
|
-
}
|
|
4738
|
-
|
|
4739
|
-
/**
|
|
4740
|
-
* Gets attribute off HTML element or nearest parent
|
|
4741
|
-
* @param {object} el - HTML element to retrieve attribute from
|
|
4742
|
-
* @param {string} attributeName - name of the attribute
|
|
4743
|
-
* @param {any} defaultValue - default value to return if no match found
|
|
4744
|
-
* @returns {any} attribute value or defaultValue
|
|
4745
|
-
*/
|
|
4746
|
-
function getNearestAttribute(el, attributeName, defaultValue) {
|
|
4747
|
-
|
|
4748
|
-
// walk up the dom tree looking for data-action and data-trigger
|
|
4749
|
-
while (el && el !== document.documentElement) {
|
|
4750
|
-
|
|
4751
|
-
var attributeValue = el.getAttribute(attributeName);
|
|
4752
|
-
|
|
4753
|
-
if (attributeValue) {
|
|
4754
|
-
return attributeValue;
|
|
4755
|
-
}
|
|
4756
|
-
|
|
4757
|
-
el = el.parentNode;
|
|
4758
|
-
}
|
|
4759
|
-
|
|
4760
|
-
return defaultValue;
|
|
4761
|
-
}
|
|
4762
|
-
|
|
4763
|
-
// hook events that clear a pending long press event
|
|
4764
|
-
document.addEventListener(mouseUp, clearLongPressTimer, true);
|
|
4765
|
-
document.addEventListener(mouseLeave, clearLongPressTimer, true);
|
|
4766
|
-
document.addEventListener(mouseMove, mouseMoveHandler, true);
|
|
4767
|
-
document.addEventListener('wheel', clearLongPressTimer, true);
|
|
4768
|
-
document.addEventListener('scroll', clearLongPressTimer, true);
|
|
4769
|
-
document.addEventListener('contextmenu', clearLongPressTimer, true);
|
|
4770
|
-
|
|
4771
|
-
// hook events that can trigger a long press event
|
|
4772
|
-
document.addEventListener(mouseDown, mouseDownHandler, true); // <- start
|
|
4773
|
-
|
|
4774
|
-
}(window, document));
|
|
4775
|
-
|
|
4776
4512
|
const postTooltipCss = "post-popovercontainer[arrow]::after{position:absolute;content:\"\";inset:-13px;z-index:-1}post-popovercontainer>div{padding:var(--post-core-dimension-4) var(--post-core-dimension-8);max-width:calc(224px - var(--post-core-dimension-8));min-height:var(--post-core-dimension-16)}";
|
|
4777
4513
|
const PostTooltipStyle0 = postTooltipCss;
|
|
4778
4514
|
|
|
4515
|
+
if (IS_BROWSER) {
|
|
4516
|
+
(async () => {
|
|
4517
|
+
await import('./long-press-event.js');
|
|
4518
|
+
})();
|
|
4519
|
+
}
|
|
4779
4520
|
const OPEN_DELAY = 650; // matches HTML title delay
|
|
4780
4521
|
/**
|
|
4781
4522
|
* @slot default - Slot for the content of the tooltip.
|
|
@@ -4800,7 +4541,8 @@ let tooltipTimeout = null;
|
|
|
4800
4541
|
* @returns
|
|
4801
4542
|
*/
|
|
4802
4543
|
const globalInterestHandler = (e) => {
|
|
4803
|
-
const
|
|
4544
|
+
const eventTarget = e.target;
|
|
4545
|
+
const targetElement = eventTarget.closest(tooltipTargetAttributeSelector);
|
|
4804
4546
|
globalCurrentTarget = targetElement;
|
|
4805
4547
|
if (!targetElement || !('getAttribute' in targetElement)) {
|
|
4806
4548
|
clearTimeout(tooltipTimeout);
|
|
@@ -4812,7 +4554,7 @@ const globalInterestHandler = (e) => {
|
|
|
4812
4554
|
const tooltip = document.getElementById(tooltipTarget);
|
|
4813
4555
|
// Determine if the tooltip was triggered by a focus event
|
|
4814
4556
|
const triggeredByFocus = e.type === 'focusin';
|
|
4815
|
-
|
|
4557
|
+
tooltip?.show(targetElement, triggeredByFocus);
|
|
4816
4558
|
if (hideTooltipTimeout) {
|
|
4817
4559
|
window.clearTimeout(hideTooltipTimeout);
|
|
4818
4560
|
hideTooltipTimeout = null;
|
|
@@ -4845,37 +4587,20 @@ const globalHideTooltip = (tooltip) => {
|
|
|
4845
4587
|
hideTooltipTimeout = null;
|
|
4846
4588
|
}, 42);
|
|
4847
4589
|
};
|
|
4848
|
-
/**
|
|
4849
|
-
* Patch some accessibility features that are hard to remember or understand
|
|
4850
|
-
* @param {HTMLElement} trigger
|
|
4851
|
-
*/
|
|
4852
|
-
const patchAccessibilityFeatures = (trigger) => {
|
|
4853
|
-
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4854
|
-
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
4855
|
-
// Add tooltip to aria-describedby
|
|
4856
|
-
if (!describedBy?.includes(id)) {
|
|
4857
|
-
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
4858
|
-
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4859
|
-
}
|
|
4860
|
-
// Make element focusable
|
|
4861
|
-
if (!isFocusable(trigger)) {
|
|
4862
|
-
trigger.setAttribute('tabindex', '0');
|
|
4863
|
-
}
|
|
4864
|
-
};
|
|
4865
|
-
// Initialize a mutation observer for patching accessibility features
|
|
4866
|
-
const triggerObserver = getAttributeObserver(tooltipTargetAttribute, patchAccessibilityFeatures);
|
|
4867
4590
|
const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends HTMLElement$1 {
|
|
4868
4591
|
constructor() {
|
|
4869
4592
|
super();
|
|
4870
4593
|
this.__registerHost();
|
|
4871
4594
|
this.__attachShadow();
|
|
4595
|
+
this.wasOpenedByFocus = false;
|
|
4596
|
+
// Initialize a mutation observer for patching accessibility features
|
|
4597
|
+
this.triggerObserver = IS_BROWSER
|
|
4598
|
+
? getAttributeObserver(tooltipTargetAttribute, this.patchAccessibilityFeatures)
|
|
4599
|
+
: null;
|
|
4872
4600
|
this.placement = 'top';
|
|
4873
4601
|
this.arrow = true;
|
|
4874
4602
|
this.delayed = false;
|
|
4875
4603
|
}
|
|
4876
|
-
popoverRef;
|
|
4877
|
-
wasOpenedByFocus = false;
|
|
4878
|
-
get host() { return this; }
|
|
4879
4604
|
validateDelayed() {
|
|
4880
4605
|
checkEmptyOrType(this, 'delayed', 'boolean');
|
|
4881
4606
|
}
|
|
@@ -4902,9 +4627,9 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
4902
4627
|
document.addEventListener('focusout', globalInterestLostHandler);
|
|
4903
4628
|
document.addEventListener('long-press', globalInterestHandler);
|
|
4904
4629
|
// Initially run the accessibility patcher on all triggers
|
|
4905
|
-
document.querySelectorAll('[data-tooltip-target]').forEach(patchAccessibilityFeatures);
|
|
4630
|
+
document.querySelectorAll('[data-tooltip-target]').forEach(this.patchAccessibilityFeatures);
|
|
4906
4631
|
// Start watching for future triggers
|
|
4907
|
-
triggerObserver
|
|
4632
|
+
this.triggerObserver?.observe(document.body, {
|
|
4908
4633
|
subtree: true,
|
|
4909
4634
|
childList: true,
|
|
4910
4635
|
attributeFilter: [tooltipTargetAttribute],
|
|
@@ -4925,7 +4650,7 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
4925
4650
|
document.removeEventListener('focusin', globalInterestHandler);
|
|
4926
4651
|
document.removeEventListener('focusout', globalInterestLostHandler);
|
|
4927
4652
|
document.removeEventListener('long-press', globalInterestHandler);
|
|
4928
|
-
triggerObserver
|
|
4653
|
+
this.triggerObserver?.disconnect();
|
|
4929
4654
|
}
|
|
4930
4655
|
}
|
|
4931
4656
|
/**
|
|
@@ -4989,10 +4714,28 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
4989
4714
|
globalHideTooltip(this);
|
|
4990
4715
|
this.host.style.pointerEvents = 'auto';
|
|
4991
4716
|
}
|
|
4717
|
+
/**
|
|
4718
|
+
* Patch some accessibility features that are hard to remember or understand
|
|
4719
|
+
* @param {HTMLElement} trigger
|
|
4720
|
+
*/
|
|
4721
|
+
patchAccessibilityFeatures(trigger) {
|
|
4722
|
+
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4723
|
+
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
4724
|
+
// Add tooltip to aria-describedby
|
|
4725
|
+
if (!describedBy?.includes(id)) {
|
|
4726
|
+
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
4727
|
+
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4728
|
+
}
|
|
4729
|
+
// Make element focusable
|
|
4730
|
+
if (!isFocusable(trigger)) {
|
|
4731
|
+
trigger.setAttribute('tabindex', '0');
|
|
4732
|
+
}
|
|
4733
|
+
}
|
|
4992
4734
|
render() {
|
|
4993
4735
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
4994
|
-
return (h(Host, { key: '
|
|
4736
|
+
return (h(Host, { key: 'f6e535d23220c3b53840913882b7302d54cc6a89', "data-version": version$1, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '25aaaee555958fdacd3aa204b90d09ab14289b51', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '81ae53f9ab5189253a256861b6df5a2cd31fe678' }))));
|
|
4995
4737
|
}
|
|
4738
|
+
get host() { return this; }
|
|
4996
4739
|
static get watchers() { return {
|
|
4997
4740
|
"delayed": ["validateDelayed"]
|
|
4998
4741
|
}; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.34",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@floating-ui/dom": "1.6.13",
|
|
28
|
-
"@oddbird/popover-polyfill": "0.
|
|
29
|
-
"@swisspost/design-system-icons": "9.0.0-next.
|
|
30
|
-
"@swisspost/design-system-styles": "9.0.0-next.
|
|
28
|
+
"@oddbird/popover-polyfill": "0.5.2",
|
|
29
|
+
"@swisspost/design-system-icons": "9.0.0-next.34",
|
|
30
|
+
"@swisspost/design-system-styles": "9.0.0-next.34",
|
|
31
31
|
"ally.js": "1.4.1",
|
|
32
32
|
"long-press-event": "2.5.0",
|
|
33
33
|
"nanoid": "5.0.9"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"play": "stencil build --dev --port 9200 --serve --watch --docs --docs-readme",
|
|
73
73
|
"start": "stencil build --dev --watch --docs --docs-readme",
|
|
74
74
|
"build": "pnpm clean && stencil build --docs-readme",
|
|
75
|
-
"clean": "rimraf
|
|
75
|
+
"clean": "rimraf dist hydrate loader loaders www ../components-react/src/components/stencil-generated/ ../components-angular/projects/components/src/lib/stencil-generated/",
|
|
76
76
|
"unit": "stencil test --spec",
|
|
77
77
|
"unit:watch": "stencil test --spec --watchAll --silent",
|
|
78
78
|
"e2e": "cypress run --browser chrome",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function getRoot(element) {
|
|
4
|
-
const root = element.getRootNode();
|
|
5
|
-
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
6
|
-
return root;
|
|
7
|
-
}
|
|
8
|
-
throw new Error('Attempting to access root node before the element is attached to the document or shadow tree.');
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
exports.getRoot = getRoot;
|