@swisspost/design-system-components 9.0.0-next.33 → 9.0.0-next.35
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/get-root-8102fecd.js +17 -0
- package/dist/cjs/{index-d6bf2c66.js → index-b60129c4.js} +4 -4
- package/dist/cjs/index.cjs.js +25 -26
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/long-press-event-6e62d113.js +266 -0
- package/dist/cjs/{package-3562c265.js → package-19b74b08.js} +1 -1
- package/dist/cjs/{post-accordion-6c5681ba.js → post-accordion-785f602b.js} +5 -5
- package/dist/cjs/{post-accordion-item-05a78451.js → post-accordion-item-8e1c9bdb.js} +5 -5
- package/dist/cjs/post-accordion-item.cjs.entry.js +5 -4
- package/dist/cjs/post-accordion.cjs.entry.js +4 -3
- package/dist/cjs/{post-avatar-6710a77a.js → post-avatar-eecfd222.js} +6 -5
- package/dist/cjs/post-avatar.cjs.entry.js +4 -3
- package/dist/cjs/{post-back-to-top-d0662842.js → post-back-to-top-49a3abcb.js} +9 -9
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -3
- package/dist/cjs/{post-banner-bd97db9c.js → post-banner-249ec2ff.js} +5 -9
- package/dist/cjs/post-banner.cjs.entry.js +4 -3
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +4 -3
- package/dist/cjs/{post-breadcrumb-36ab841c.js → post-breadcrumbs-f51590d1.js} +39 -31
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +13 -0
- package/dist/cjs/post-card-control-d0a47015.js +269 -0
- package/dist/cjs/post-card-control.cjs.entry.js +4 -3
- package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -5
- package/dist/cjs/{post-collapsible-trigger-6601c554.js → post-collapsible-trigger-4784edb2.js} +24 -41
- package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/{post-footer-23699aef.js → post-footer-9d078cb1.js} +11 -11
- package/dist/cjs/post-footer.cjs.entry.js +4 -4
- package/dist/cjs/{post-linkarea-8e5e1a9f.js → post-linkarea-e4ce3960.js} +5 -5
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/{post-menu-item-8dd94792.js → post-menu-item-e9ebd27a.js} +4 -4
- package/dist/cjs/post-popover-5db53ead.js +112 -0
- package/dist/cjs/post-popover.cjs.entry.js +5 -4
- package/dist/cjs/{post-rating-ef592484.js → post-rating-98a06828.js} +5 -15
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-d785e7fc.js → post-tab-header-c8e92f77.js} +6 -5
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -3
- package/dist/cjs/{post-tab-panel-41ea371e.js → post-tab-panel-d966ee38.js} +4 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-c6f00130.js → post-tabs-83d99b69.js} +5 -12
- package/dist/cjs/post-tabs.cjs.entry.js +4 -3
- package/dist/cjs/post-tag-a1d78e75.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-02c56b7b.js → post-togglebutton-e4651aad.js} +939 -464
- package/dist/cjs/{post-tooltip-3176e280.js → post-tooltip-bb862241.js} +39 -296
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
- package/dist/collection/animations/collapse.js +3 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +1 -3
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +0 -2
- package/dist/collection/components/post-avatar/post-avatar.css +1 -3
- package/dist/collection/components/post-avatar/post-avatar.js +3 -4
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +6 -8
- package/dist/collection/components/post-banner/post-banner.css +1 -3
- package/dist/collection/components/post-banner/post-banner.js +0 -6
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -2
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -0
- package/dist/collection/components/{post-breadcrumb/post-breadcrumb.js → post-breadcrumbs/post-breadcrumbs.js} +24 -27
- package/dist/collection/components/post-card-control/post-card-control.css +1 -3
- 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 +15 -28
- 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 +13 -22
- package/dist/collection/components/post-icon/post-icon.js +4 -6
- package/dist/collection/components/post-language-option/post-language-option.css +1 -3
- package/dist/collection/components/post-language-option/post-language-option.js +1 -10
- package/dist/collection/components/post-language-switch/post-language-switch.js +7 -19
- 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.css +1 -3
- 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.js +20 -30
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +36 -37
- package/dist/collection/components/post-menu/post-menu.css +1 -3
- package/dist/collection/components/post-menu/post-menu.js +47 -55
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +13 -15
- package/dist/collection/components/post-popover/post-popover.css +1 -3
- package/dist/collection/components/post-popover/post-popover.js +13 -13
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +30 -33
- package/dist/collection/components/post-rating/post-rating.css +1 -3
- package/dist/collection/components/post-rating/post-rating.js +1 -12
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -3
- 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.css +1 -3
- package/dist/collection/components/post-tag/post-tag.js +1 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +10 -11
- package/dist/collection/components/post-tooltip/post-tooltip.js +37 -33
- package/dist/collection/index.js +1 -1
- 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/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/get-root.js +7 -1
- package/dist/components/index.js +1 -1
- package/dist/components/long-press-event.js +264 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +3 -3
- package/dist/components/post-accordion2.js +3 -3
- package/dist/components/post-avatar2.js +5 -4
- package/dist/components/post-back-to-top2.js +8 -8
- package/dist/components/post-banner2.js +3 -7
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/{post-breadcrumb.d.ts → post-breadcrumbs.d.ts} +4 -4
- package/dist/components/post-breadcrumbs.js +6 -0
- package/dist/components/{post-breadcrumb2.js → post-breadcrumbs2.js} +41 -33
- package/dist/components/post-card-control2.js +26 -40
- package/dist/components/post-closebutton2.js +8 -3
- package/dist/components/post-collapsible-trigger2.js +19 -31
- package/dist/components/post-collapsible2.js +9 -12
- package/dist/components/post-footer2.js +8 -8
- package/dist/components/post-header2.js +15 -23
- package/dist/components/post-icon2.js +5 -5
- package/dist/components/post-language-option2.js +4 -11
- package/dist/components/post-language-switch2.js +9 -18
- package/dist/components/post-linkarea2.js +5 -4
- package/dist/components/post-list-item2.js +2 -2
- package/dist/components/post-list2.js +3 -4
- package/dist/components/post-logo2.js +3 -2
- package/dist/components/post-mainnavigation2.js +94 -182
- package/dist/components/post-megadropdown-trigger2.js +38 -37
- package/dist/components/post-megadropdown2.js +21 -30
- package/dist/components/post-menu-trigger2.js +15 -15
- package/dist/components/post-menu2.js +50 -56
- package/dist/components/post-popover2.js +15 -13
- package/dist/components/post-popovercontainer2.js +638 -36
- package/dist/components/post-rating2.js +3 -13
- package/dist/components/post-tab-header2.js +5 -4
- package/dist/components/post-tab-panel2.js +3 -3
- package/dist/components/post-tabs2.js +3 -10
- package/dist/components/post-tag2.js +2 -2
- package/dist/components/post-togglebutton2.js +12 -11
- package/dist/components/post-tooltip2.js +37 -294
- package/dist/docs.json +107 -101
- 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/get-root-1b1af46f.js +15 -0
- package/dist/esm/{index-3419e46d.js → index-f4d19816.js} +4 -4
- package/dist/esm/index.js +24 -25
- package/dist/esm/loader.js +3 -3
- package/dist/esm/long-press-event-04d24397.js +264 -0
- package/dist/esm/package-791f9257.js +3 -0
- package/dist/esm/{post-accordion-024451fa.js → post-accordion-4de9963b.js} +5 -5
- package/dist/esm/{post-accordion-item-19b996d1.js → post-accordion-item-2cbb32f9.js} +5 -5
- package/dist/esm/post-accordion-item.entry.js +5 -4
- package/dist/esm/post-accordion.entry.js +4 -3
- package/dist/esm/{post-avatar-33aed045.js → post-avatar-0aaefe87.js} +6 -5
- package/dist/esm/post-avatar.entry.js +4 -3
- package/dist/esm/{post-back-to-top-7dd43c3b.js → post-back-to-top-24eef0a0.js} +9 -9
- package/dist/esm/post-back-to-top.entry.js +4 -3
- package/dist/esm/{post-banner-28d18721.js → post-banner-1f37f9f0.js} +5 -9
- package/dist/esm/post-banner.entry.js +4 -3
- package/dist/esm/post-breadcrumb-item_2.entry.js +4 -3
- package/dist/esm/{post-breadcrumb-d86fae7b.js → post-breadcrumbs-2fcccf9f.js} +39 -31
- package/dist/esm/post-breadcrumbs.entry.js +5 -0
- package/dist/esm/post-card-control-75e8d336.js +267 -0
- package/dist/esm/post-card-control.entry.js +4 -3
- package/dist/esm/post-closebutton_15.entry.js +5 -5
- package/dist/esm/{post-collapsible-trigger-b1612866.js → post-collapsible-trigger-08b79162.js} +24 -41
- package/dist/esm/post-collapsible_2.entry.js +5 -5
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/{post-footer-2ed5e520.js → post-footer-01677010.js} +11 -11
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/{post-linkarea-802bf774.js → post-linkarea-4a178d51.js} +5 -5
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/{post-menu-item-d97611d8.js → post-menu-item-199477fd.js} +4 -4
- package/dist/esm/post-popover-2a6a13d8.js +110 -0
- package/dist/esm/post-popover.entry.js +5 -4
- package/dist/esm/{post-rating-e1ac47ce.js → post-rating-fcf24658.js} +5 -15
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-06dcbf7f.js → post-tab-header-aaa2f0b8.js} +6 -5
- package/dist/esm/post-tab-header.entry.js +4 -3
- package/dist/esm/{post-tab-panel-75932601.js → post-tab-panel-91f35995.js} +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-3ef2ea23.js → post-tabs-8657f2d6.js} +5 -12
- package/dist/esm/post-tabs.entry.js +4 -3
- package/dist/esm/post-tag-19141551.js +45 -0
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-db251030.js → post-togglebutton-40cac8c2.js} +939 -464
- package/dist/esm/{post-tooltip-c256d714.js → post-tooltip-165eb353.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-01544069.js +1 -0
- package/dist/post-components/p-02d0c370.js +1 -0
- package/dist/post-components/p-03169497.js +1 -0
- package/dist/post-components/p-06bf6b81.entry.js +1 -0
- package/dist/post-components/p-0ca39161.entry.js +1 -0
- package/dist/post-components/p-0f398677.js +1 -0
- package/dist/post-components/p-10f9d25e.js +1 -0
- package/dist/post-components/p-15da2cf9.js +1 -0
- package/dist/post-components/p-1622ed8c.js +1 -0
- package/dist/post-components/p-1d5e275b.js +1 -0
- package/dist/post-components/p-2a90f66c.js +1 -0
- package/dist/post-components/p-32aa68ac.entry.js +1 -0
- package/dist/post-components/p-3d30acad.entry.js +1 -0
- package/dist/post-components/p-48cd3157.js +1 -0
- package/dist/post-components/p-56da2097.entry.js +1 -0
- package/dist/post-components/p-65824049.entry.js +1 -0
- package/dist/post-components/p-6b31a76a.js +1 -0
- package/dist/post-components/p-722ffaae.js +1 -0
- package/dist/post-components/p-7c6f4c29.js +1 -0
- package/dist/post-components/p-817effd4.js +1 -0
- package/dist/post-components/p-8579ac14.js +8 -0
- package/dist/post-components/p-86859a7b.entry.js +1 -0
- package/dist/post-components/p-8db32dab.js +8 -0
- package/dist/post-components/p-936682bc.entry.js +1 -0
- package/dist/post-components/p-9597127a.js +1 -0
- package/dist/post-components/p-9818ad52.entry.js +1 -0
- package/dist/post-components/{p-5c758f41.js → p-9e461613.js} +1 -1
- package/dist/post-components/p-9ec20111.js +1 -0
- package/dist/post-components/p-a1a39a27.js +1 -0
- package/dist/post-components/p-a1bae666.entry.js +1 -0
- package/dist/post-components/p-a27907cc.js +1 -0
- package/dist/post-components/p-a77a6729.entry.js +1 -0
- package/dist/post-components/p-ab3ab29b.js +1 -0
- package/dist/post-components/p-ad9ffd61.entry.js +1 -0
- package/dist/post-components/p-b8241188.js +1 -0
- package/dist/post-components/p-bece917c.js +1 -0
- package/dist/post-components/p-bf3c80a3.entry.js +1 -0
- package/dist/post-components/p-cd8aef45.entry.js +1 -0
- package/dist/post-components/p-cdd3a06a.entry.js +1 -0
- package/dist/post-components/p-dc702c39.entry.js +1 -0
- package/dist/post-components/p-e077239a.entry.js +1 -0
- package/dist/post-components/p-e653daec.entry.js +1 -0
- package/dist/post-components/p-e8861c07.entry.js +1 -0
- package/dist/post-components/p-f2478a7d.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-breadcrumb/post-breadcrumb.d.ts → post-breadcrumbs/post-breadcrumbs.d.ts} +4 -4
- 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 +4 -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 +2 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +14 -39
- package/dist/types/components/post-menu/post-menu.d.ts +3 -3
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +6 -4
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +9 -4
- package/dist/types/components.d.ts +35 -35
- package/dist/types/index.d.ts +1 -1
- package/dist/types/popover-fn.d.ts +11 -0
- package/dist/types/utils/environment.d.ts +2 -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/get-root.js +7 -1
- package/loaders/index.d.ts +2 -2
- package/loaders/index.js +4 -4
- package/loaders/long-press-event.js +264 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +3 -3
- package/loaders/post-accordion.js +3 -3
- package/loaders/post-avatar.js +5 -4
- package/loaders/post-back-to-top.js +8 -8
- package/loaders/post-banner.js +3 -7
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/{post-breadcrumb.d.ts → post-breadcrumbs.d.ts} +4 -4
- package/loaders/{post-breadcrumb.js → post-breadcrumbs.js} +42 -34
- package/loaders/post-card-control.js +26 -40
- package/loaders/post-closebutton.js +8 -3
- package/loaders/post-collapsible-trigger2.js +19 -31
- package/loaders/post-collapsible2.js +9 -12
- package/loaders/post-footer.js +8 -8
- package/loaders/post-header.js +15 -23
- package/loaders/post-icon2.js +5 -5
- package/loaders/post-language-option.js +4 -11
- package/loaders/post-language-switch.js +9 -18
- package/loaders/post-linkarea.js +5 -4
- package/loaders/post-list-item.js +2 -2
- package/loaders/post-list.js +3 -4
- package/loaders/post-logo.js +3 -2
- package/loaders/post-mainnavigation.js +94 -182
- package/loaders/post-megadropdown-trigger.js +38 -37
- package/loaders/post-megadropdown.js +21 -30
- package/loaders/post-menu-trigger2.js +15 -15
- package/loaders/post-menu2.js +50 -56
- package/loaders/post-popover.js +15 -13
- package/loaders/post-popovercontainer2.js +638 -36
- package/loaders/post-rating.js +3 -13
- package/loaders/post-tab-header.js +5 -4
- package/loaders/post-tab-panel.js +3 -3
- package/loaders/post-tabs.js +3 -10
- package/loaders/post-tag.js +2 -2
- package/loaders/post-togglebutton.js +12 -11
- package/loaders/post-tooltip.js +37 -294
- package/package.json +20 -15
- package/dist/cjs/debounce-158fd76f.js +0 -13
- package/dist/cjs/get-root-7a3498ef.js +0 -11
- package/dist/cjs/post-breadcrumb.cjs.entry.js +0 -13
- package/dist/cjs/post-card-control-155fb433.js +0 -283
- package/dist/cjs/post-popover-858cbd12.js +0 -110
- package/dist/cjs/post-tag-d1a1176c.js +0 -47
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.css +0 -3
- package/dist/components/debounce.js +0 -11
- package/dist/components/post-breadcrumb.js +0 -6
- package/dist/esm/debounce-e54c7131.js +0 -11
- package/dist/esm/get-root-7af2e0d1.js +0 -9
- package/dist/esm/package-da68ab5a.js +0 -3
- package/dist/esm/post-breadcrumb.entry.js +0 -5
- package/dist/esm/post-card-control-aa043898.js +0 -281
- package/dist/esm/post-popover-e51a7a18.js +0 -108
- package/dist/esm/post-tag-a3b989e0.js +0 -45
- package/dist/post-components/p-1376c653.js +0 -1
- package/dist/post-components/p-13835969.js +0 -1
- package/dist/post-components/p-13fdbaf6.entry.js +0 -1
- package/dist/post-components/p-1e2169ae.entry.js +0 -1
- package/dist/post-components/p-23e4c270.entry.js +0 -1
- package/dist/post-components/p-2641e06b.js +0 -1
- package/dist/post-components/p-2d3b16c7.js +0 -1
- package/dist/post-components/p-33c35e15.js +0 -1
- package/dist/post-components/p-3b247d71.entry.js +0 -1
- package/dist/post-components/p-42a5fdf8.js +0 -1
- package/dist/post-components/p-4ed7bab6.js +0 -1
- package/dist/post-components/p-5aeb3656.js +0 -1
- package/dist/post-components/p-5c518421.js +0 -1
- package/dist/post-components/p-6db1a2e0.entry.js +0 -1
- package/dist/post-components/p-6fe98184.entry.js +0 -1
- package/dist/post-components/p-7d731077.entry.js +0 -1
- package/dist/post-components/p-7ee47334.entry.js +0 -1
- package/dist/post-components/p-8223e97b.js +0 -1
- package/dist/post-components/p-8a8376d0.js +0 -1
- package/dist/post-components/p-8bb828cf.entry.js +0 -1
- package/dist/post-components/p-8e55ddd2.js +0 -1
- package/dist/post-components/p-9681efce.js +0 -1
- package/dist/post-components/p-96a59372.entry.js +0 -1
- package/dist/post-components/p-9748a355.js +0 -1
- package/dist/post-components/p-99c8fd43.entry.js +0 -1
- package/dist/post-components/p-ac042f7a.entry.js +0 -1
- package/dist/post-components/p-c34cacb7.js +0 -1
- package/dist/post-components/p-c3a970c5.js +0 -1
- package/dist/post-components/p-c4651d32.entry.js +0 -1
- package/dist/post-components/p-c9b61d31.entry.js +0 -1
- package/dist/post-components/p-d16dd7f9.js +0 -1
- package/dist/post-components/p-d81c5908.entry.js +0 -1
- package/dist/post-components/p-dbe31632.js +0 -1
- package/dist/post-components/p-e1baac59.js +0 -1
- package/dist/post-components/p-e2294014.js +0 -15
- package/dist/post-components/p-e8ff8122.js +0 -1
- package/dist/post-components/p-ed78d04a.entry.js +0 -1
- package/dist/post-components/p-f1c0924a.js +0 -1
- package/dist/post-components/p-f1db96d0.entry.js +0 -1
- package/dist/post-components/p-f7aa917f.entry.js +0 -1
- package/dist/post-components/p-f96b80cc.entry.js +0 -1
- package/dist/post-components/p-fc91cbc2.js +0 -1
- package/dist/post-components/p-fd78716d.js +0 -1
- package/loaders/debounce.js +0 -11
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { version } from "../../../../package";
|
|
3
2
|
import isFocusable from "ally.js/is/focusable";
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { IS_BROWSER, checkEmptyOrType, getAttributeObserver } from "../../utils/index";
|
|
4
|
+
import { version } from "../../../../package";
|
|
5
|
+
if (IS_BROWSER) {
|
|
6
|
+
(async () => {
|
|
7
|
+
await import('long-press-event');
|
|
8
|
+
})();
|
|
9
|
+
}
|
|
7
10
|
const OPEN_DELAY = 650; // matches HTML title delay
|
|
8
11
|
/**
|
|
9
12
|
* @slot default - Slot for the content of the tooltip.
|
|
@@ -28,7 +31,8 @@ let tooltipTimeout = null;
|
|
|
28
31
|
* @returns
|
|
29
32
|
*/
|
|
30
33
|
const globalInterestHandler = (e) => {
|
|
31
|
-
const
|
|
34
|
+
const eventTarget = e.target;
|
|
35
|
+
const targetElement = eventTarget.closest(tooltipTargetAttributeSelector);
|
|
32
36
|
globalCurrentTarget = targetElement;
|
|
33
37
|
if (!targetElement || !('getAttribute' in targetElement)) {
|
|
34
38
|
clearTimeout(tooltipTimeout);
|
|
@@ -40,7 +44,7 @@ const globalInterestHandler = (e) => {
|
|
|
40
44
|
const tooltip = document.getElementById(tooltipTarget);
|
|
41
45
|
// Determine if the tooltip was triggered by a focus event
|
|
42
46
|
const triggeredByFocus = e.type === 'focusin';
|
|
43
|
-
|
|
47
|
+
tooltip?.show(targetElement, triggeredByFocus);
|
|
44
48
|
if (hideTooltipTimeout) {
|
|
45
49
|
window.clearTimeout(hideTooltipTimeout);
|
|
46
50
|
hideTooltipTimeout = null;
|
|
@@ -73,34 +77,17 @@ const globalHideTooltip = (tooltip) => {
|
|
|
73
77
|
hideTooltipTimeout = null;
|
|
74
78
|
}, 42);
|
|
75
79
|
};
|
|
76
|
-
/**
|
|
77
|
-
* Patch some accessibility features that are hard to remember or understand
|
|
78
|
-
* @param {HTMLElement} trigger
|
|
79
|
-
*/
|
|
80
|
-
const patchAccessibilityFeatures = (trigger) => {
|
|
81
|
-
const describedBy = trigger.getAttribute('aria-describedby');
|
|
82
|
-
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
83
|
-
// Add tooltip to aria-describedby
|
|
84
|
-
if (!describedBy?.includes(id)) {
|
|
85
|
-
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
86
|
-
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
87
|
-
}
|
|
88
|
-
// Make element focusable
|
|
89
|
-
if (!isFocusable(trigger)) {
|
|
90
|
-
trigger.setAttribute('tabindex', '0');
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
// Initialize a mutation observer for patching accessibility features
|
|
94
|
-
const triggerObserver = getAttributeObserver(tooltipTargetAttribute, patchAccessibilityFeatures);
|
|
95
80
|
export class PostTooltip {
|
|
96
81
|
constructor() {
|
|
82
|
+
this.wasOpenedByFocus = false;
|
|
83
|
+
// Initialize a mutation observer for patching accessibility features
|
|
84
|
+
this.triggerObserver = IS_BROWSER
|
|
85
|
+
? getAttributeObserver(tooltipTargetAttribute, this.patchAccessibilityFeatures)
|
|
86
|
+
: null;
|
|
97
87
|
this.placement = 'top';
|
|
98
88
|
this.arrow = true;
|
|
99
89
|
this.delayed = false;
|
|
100
90
|
}
|
|
101
|
-
popoverRef;
|
|
102
|
-
wasOpenedByFocus = false;
|
|
103
|
-
host;
|
|
104
91
|
validateDelayed() {
|
|
105
92
|
checkEmptyOrType(this, 'delayed', 'boolean');
|
|
106
93
|
}
|
|
@@ -127,9 +114,9 @@ export class PostTooltip {
|
|
|
127
114
|
document.addEventListener('focusout', globalInterestLostHandler);
|
|
128
115
|
document.addEventListener('long-press', globalInterestHandler);
|
|
129
116
|
// Initially run the accessibility patcher on all triggers
|
|
130
|
-
document.querySelectorAll('[data-tooltip-target]').forEach(patchAccessibilityFeatures);
|
|
117
|
+
document.querySelectorAll('[data-tooltip-target]').forEach(this.patchAccessibilityFeatures);
|
|
131
118
|
// Start watching for future triggers
|
|
132
|
-
triggerObserver
|
|
119
|
+
this.triggerObserver?.observe(document.body, {
|
|
133
120
|
subtree: true,
|
|
134
121
|
childList: true,
|
|
135
122
|
attributeFilter: [tooltipTargetAttribute],
|
|
@@ -150,7 +137,7 @@ export class PostTooltip {
|
|
|
150
137
|
document.removeEventListener('focusin', globalInterestHandler);
|
|
151
138
|
document.removeEventListener('focusout', globalInterestLostHandler);
|
|
152
139
|
document.removeEventListener('long-press', globalInterestHandler);
|
|
153
|
-
triggerObserver
|
|
140
|
+
this.triggerObserver?.disconnect();
|
|
154
141
|
}
|
|
155
142
|
}
|
|
156
143
|
/**
|
|
@@ -214,9 +201,26 @@ export class PostTooltip {
|
|
|
214
201
|
globalHideTooltip(this);
|
|
215
202
|
this.host.style.pointerEvents = 'auto';
|
|
216
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Patch some accessibility features that are hard to remember or understand
|
|
206
|
+
* @param {HTMLElement} trigger
|
|
207
|
+
*/
|
|
208
|
+
patchAccessibilityFeatures(trigger) {
|
|
209
|
+
const describedBy = trigger.getAttribute('aria-describedby');
|
|
210
|
+
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
211
|
+
// Add tooltip to aria-describedby
|
|
212
|
+
if (!describedBy?.includes(id)) {
|
|
213
|
+
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
214
|
+
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
215
|
+
}
|
|
216
|
+
// Make element focusable
|
|
217
|
+
if (!isFocusable(trigger)) {
|
|
218
|
+
trigger.setAttribute('tabindex', '0');
|
|
219
|
+
}
|
|
220
|
+
}
|
|
217
221
|
render() {
|
|
218
222
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
219
|
-
return (h(Host, { key: '
|
|
223
|
+
return (h(Host, { key: '9e041dbc11a0ad98e581074ca17db997226a129d', "data-version": version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '77f9068a4a174ec861bc09ed046bab8a326b8ee7', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '4490380ebda34ed649e2cdb9654308ad941a6ee5' }))));
|
|
220
224
|
}
|
|
221
225
|
static get is() { return "post-tooltip"; }
|
|
222
226
|
static get encapsulation() { return "shadow"; }
|
|
@@ -250,7 +254,7 @@ export class PostTooltip {
|
|
|
250
254
|
"optional": true,
|
|
251
255
|
"docs": {
|
|
252
256
|
"tags": [],
|
|
253
|
-
"text": "Defines the
|
|
257
|
+
"text": "Defines the position of the tooltip relative to its trigger.\nTooltips 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.\nFor supported values and behavior details, see the [Floating UI placement documentation](https://floating-ui.com/docs/computePosition#placement)."
|
|
254
258
|
},
|
|
255
259
|
"attribute": "placement",
|
|
256
260
|
"reflect": false,
|
package/dist/collection/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { PostAccordionItem } from './components/post-accordion-item/post-accordi
|
|
|
4
4
|
export { PostAvatar } from './components/post-avatar/post-avatar';
|
|
5
5
|
export { PostBackToTop } from './components/post-back-to-top/post-back-to-top';
|
|
6
6
|
export { PostBanner } from './components/post-banner/post-banner';
|
|
7
|
-
export {
|
|
7
|
+
export { PostBreadcrumbs } from './components/post-breadcrumbs/post-breadcrumbs';
|
|
8
8
|
export { PostBreadcrumbItem } from './components/post-breadcrumb-item/post-breadcrumb-item';
|
|
9
9
|
export { PostCardControl } from './components/post-card-control/post-card-control';
|
|
10
10
|
export { PostClosebutton } from './components/post-closebutton/post-closebutton';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IS_BROWSER } from "./environment";
|
|
1
2
|
export function getAttributeObserver(attribute, handler) {
|
|
2
3
|
/**
|
|
3
4
|
* Handle attribute changes and childList changes from the observer
|
|
@@ -19,5 +20,5 @@ export function getAttributeObserver(attribute, handler) {
|
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
// Initialize a mutation observer for patching accessibility features
|
|
22
|
-
return new MutationObserver(observerHandler);
|
|
23
|
+
return IS_BROWSER ? new MutationObserver(observerHandler) : null;
|
|
23
24
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { IS_BROWSER } from "./environment";
|
|
1
2
|
export class Breakpoint {
|
|
2
|
-
breakpointMap;
|
|
3
|
-
current = {
|
|
4
|
-
key: '',
|
|
5
|
-
name: '',
|
|
6
|
-
};
|
|
7
3
|
constructor() {
|
|
8
|
-
|
|
4
|
+
this.current = {
|
|
5
|
+
key: '',
|
|
6
|
+
name: '',
|
|
7
|
+
};
|
|
8
|
+
if (IS_BROWSER && !this.breakpointMap) {
|
|
9
9
|
const keys = this.getStyles('--post-breakpoint-keys');
|
|
10
10
|
const names = this.getStyles('--post-breakpoint-names');
|
|
11
11
|
const widths = this.getStyles('--post-breakpoint-widths');
|
|
@@ -40,7 +40,9 @@ export class Breakpoint {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
dispatchEvent(type) {
|
|
43
|
-
|
|
43
|
+
if (IS_BROWSER) {
|
|
44
|
+
window.dispatchEvent(new CustomEvent(`postBreakpoint:${type}`, { detail: this.current[type] }));
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
get(type) {
|
|
46
48
|
this.updateHandler(false);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { IS_BROWSER } from "./environment";
|
|
2
|
+
/**
|
|
3
|
+
* getRootNode() can only be used after the element has been attached to the document!
|
|
4
|
+
* So use it for example in the componentDidLoad lifecycle hook.
|
|
5
|
+
*/
|
|
1
6
|
export function getRoot(element) {
|
|
2
|
-
const root = element.getRootNode();
|
|
7
|
+
const root = IS_BROWSER ? element.getRootNode() : element;
|
|
3
8
|
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
4
9
|
return root;
|
|
5
10
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
export * from './get-focusable-children';
|
|
2
|
+
export * from './attribute-observer';
|
|
1
3
|
export * from './component-on-ready';
|
|
2
4
|
export * from './property-checkers';
|
|
5
|
+
export * from './breakpoints';
|
|
3
6
|
export * from './debounce';
|
|
7
|
+
export * from './event-guard';
|
|
4
8
|
export * from './get-root';
|
|
5
9
|
export * from './is-motion-reduced';
|
|
6
10
|
export * from './sass-export';
|
|
7
11
|
export * from './timeout';
|
|
12
|
+
export * from './environment';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { I as IS_BROWSER } from './breakpoints.js';
|
|
2
|
+
|
|
1
3
|
function getAttributeObserver(attribute, handler) {
|
|
2
4
|
/**
|
|
3
5
|
* Handle attribute changes and childList changes from the observer
|
|
@@ -19,7 +21,7 @@ function getAttributeObserver(attribute, handler) {
|
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
// Initialize a mutation observer for patching accessibility features
|
|
22
|
-
return new MutationObserver(observerHandler);
|
|
24
|
+
return IS_BROWSER ? new MutationObserver(observerHandler) : null;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export { getAttributeObserver as g };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
const IS_SERVER = typeof window === 'undefined';
|
|
2
|
+
const IS_BROWSER = !IS_SERVER;
|
|
3
|
+
|
|
1
4
|
class Breakpoint {
|
|
2
|
-
breakpointMap;
|
|
3
|
-
current = {
|
|
4
|
-
key: '',
|
|
5
|
-
name: '',
|
|
6
|
-
};
|
|
7
5
|
constructor() {
|
|
8
|
-
|
|
6
|
+
this.current = {
|
|
7
|
+
key: '',
|
|
8
|
+
name: '',
|
|
9
|
+
};
|
|
10
|
+
if (IS_BROWSER && !this.breakpointMap) {
|
|
9
11
|
const keys = this.getStyles('--post-breakpoint-keys');
|
|
10
12
|
const names = this.getStyles('--post-breakpoint-names');
|
|
11
13
|
const widths = this.getStyles('--post-breakpoint-widths');
|
|
@@ -40,7 +42,9 @@ class Breakpoint {
|
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
dispatchEvent(type) {
|
|
43
|
-
|
|
45
|
+
if (IS_BROWSER) {
|
|
46
|
+
window.dispatchEvent(new CustomEvent(`postBreakpoint:${type}`, { detail: this.current[type] }));
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
49
|
get(type) {
|
|
46
50
|
this.updateHandler(false);
|
|
@@ -49,4 +53,4 @@ class Breakpoint {
|
|
|
49
53
|
}
|
|
50
54
|
const breakpoint = new Breakpoint();
|
|
51
55
|
|
|
52
|
-
export { breakpoint as b };
|
|
56
|
+
export { IS_BROWSER as I, breakpoint as b };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { I as IS_BROWSER } from './breakpoints.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* getRootNode() can only be used after the element has been attached to the document!
|
|
5
|
+
* So use it for example in the componentDidLoad lifecycle hook.
|
|
6
|
+
*/
|
|
1
7
|
function getRoot(element) {
|
|
2
|
-
const root = element.getRootNode();
|
|
8
|
+
const root = IS_BROWSER ? element.getRootNode() : element;
|
|
3
9
|
if (root instanceof Document || root instanceof ShadowRoot) {
|
|
4
10
|
return root;
|
|
5
11
|
}
|
package/dist/components/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { P as PostAccordionItem } from './post-accordion-item2.js';
|
|
|
4
4
|
export { P as PostAvatar } from './post-avatar2.js';
|
|
5
5
|
export { P as PostBackToTop } from './post-back-to-top2.js';
|
|
6
6
|
export { P as PostBanner } from './post-banner2.js';
|
|
7
|
-
export { P as
|
|
7
|
+
export { P as PostBreadcrumbs } from './post-breadcrumbs2.js';
|
|
8
8
|
export { P as PostBreadcrumbItem } from './post-breadcrumb-item2.js';
|
|
9
9
|
export { P as PostCardControl } from './post-card-control2.js';
|
|
10
10
|
export { P as PostClosebutton } from './post-closebutton2.js';
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* long-press-event - v@version@
|
|
3
|
+
* Pure JavaScript long-press-event
|
|
4
|
+
* https://github.com/john-doherty/long-press-event
|
|
5
|
+
* @author John Doherty <www.johndoherty.info>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/
|
|
8
|
+
(function (window, document) {
|
|
9
|
+
|
|
10
|
+
// local timer object based on rAF
|
|
11
|
+
var timer = null;
|
|
12
|
+
|
|
13
|
+
// check if we're using a touch screen
|
|
14
|
+
var hasPointerEvents = (('PointerEvent' in window) || (window.navigator && 'msPointerEnabled' in window.navigator));
|
|
15
|
+
var isTouch = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
|
|
16
|
+
|
|
17
|
+
// switch to pointer events or touch events if using a touch screen
|
|
18
|
+
var mouseDown = hasPointerEvents ? 'pointerdown' : isTouch ? 'touchstart' : 'mousedown';
|
|
19
|
+
var mouseUp = hasPointerEvents ? 'pointerup' : isTouch ? 'touchend' : 'mouseup';
|
|
20
|
+
var mouseMove = hasPointerEvents ? 'pointermove' : isTouch ? 'touchmove' : 'mousemove';
|
|
21
|
+
var mouseLeave = hasPointerEvents ? 'pointerleave' : isTouch ? 'touchleave' : 'mouseleave';
|
|
22
|
+
|
|
23
|
+
// track number of pixels the mouse moves during long press
|
|
24
|
+
var startX = 0; // mouse x position when timer started
|
|
25
|
+
var startY = 0; // mouse y position when timer started
|
|
26
|
+
var maxDiffX = 10; // max number of X pixels the mouse can move during long press before it is canceled
|
|
27
|
+
var maxDiffY = 10; // max number of Y pixels the mouse can move during long press before it is canceled
|
|
28
|
+
|
|
29
|
+
// patch CustomEvent to allow constructor creation (IE/Chrome)
|
|
30
|
+
if (typeof window.CustomEvent !== 'function') {
|
|
31
|
+
|
|
32
|
+
window.CustomEvent = function (event, params) {
|
|
33
|
+
|
|
34
|
+
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
|
35
|
+
|
|
36
|
+
var evt = document.createEvent('CustomEvent');
|
|
37
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
38
|
+
return evt;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
window.CustomEvent.prototype = window.Event.prototype;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// requestAnimationFrame() shim by Paul Irish
|
|
45
|
+
window.requestAnimFrame = (function () {
|
|
46
|
+
return window.requestAnimationFrame ||
|
|
47
|
+
window.webkitRequestAnimationFrame ||
|
|
48
|
+
window.mozRequestAnimationFrame ||
|
|
49
|
+
window.oRequestAnimationFrame ||
|
|
50
|
+
window.msRequestAnimationFrame || function (callback) {
|
|
51
|
+
window.setTimeout(callback, 1000 / 60);
|
|
52
|
+
};
|
|
53
|
+
})();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance
|
|
57
|
+
* @param {function} fn The callback function
|
|
58
|
+
* @param {int} delay The delay in milliseconds
|
|
59
|
+
* @returns {object} handle to the timeout object
|
|
60
|
+
*/
|
|
61
|
+
function requestTimeout(fn, delay) {
|
|
62
|
+
|
|
63
|
+
if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame &&
|
|
64
|
+
!(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
|
|
65
|
+
!window.oRequestAnimationFrame && !window.msRequestAnimationFrame) return window.setTimeout(fn, delay);
|
|
66
|
+
|
|
67
|
+
var start = new Date().getTime();
|
|
68
|
+
var handle = {};
|
|
69
|
+
|
|
70
|
+
var loop = function () {
|
|
71
|
+
var current = new Date().getTime();
|
|
72
|
+
var delta = current - start;
|
|
73
|
+
|
|
74
|
+
if (delta >= delay) {
|
|
75
|
+
fn.call();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
handle.value = requestAnimFrame(loop);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
handle.value = requestAnimFrame(loop);
|
|
83
|
+
|
|
84
|
+
return handle;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Behaves the same as clearTimeout except uses cancelRequestAnimationFrame() where possible for better performance
|
|
89
|
+
* @param {object} handle The callback function
|
|
90
|
+
* @returns {void}
|
|
91
|
+
*/
|
|
92
|
+
function clearRequestTimeout(handle) {
|
|
93
|
+
if (handle) {
|
|
94
|
+
window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) :
|
|
95
|
+
window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) :
|
|
96
|
+
window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */
|
|
97
|
+
window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) :
|
|
98
|
+
window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) :
|
|
99
|
+
window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) :
|
|
100
|
+
clearTimeout(handle);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Fires the 'long-press' event on element
|
|
106
|
+
* @param {MouseEvent|PointerEvent|TouchEvent} originalEvent The original event being fired
|
|
107
|
+
* @returns {void}
|
|
108
|
+
*/
|
|
109
|
+
function fireLongPressEvent(originalEvent) {
|
|
110
|
+
|
|
111
|
+
clearLongPressTimer();
|
|
112
|
+
|
|
113
|
+
originalEvent = unifyEvent(originalEvent);
|
|
114
|
+
|
|
115
|
+
// fire the long-press event
|
|
116
|
+
var allowClickEvent = this.dispatchEvent(new CustomEvent('long-press', {
|
|
117
|
+
bubbles: true,
|
|
118
|
+
cancelable: true,
|
|
119
|
+
|
|
120
|
+
// custom event data (legacy)
|
|
121
|
+
detail: {
|
|
122
|
+
clientX: originalEvent.clientX,
|
|
123
|
+
clientY: originalEvent.clientY,
|
|
124
|
+
offsetX: originalEvent.offsetX,
|
|
125
|
+
offsetY: originalEvent.offsetY,
|
|
126
|
+
pageX: originalEvent.pageX,
|
|
127
|
+
pageY: originalEvent.pageY
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
// add coordinate data that would typically acompany a touch/click event
|
|
131
|
+
clientX: originalEvent.clientX,
|
|
132
|
+
clientY: originalEvent.clientY,
|
|
133
|
+
offsetX: originalEvent.offsetX,
|
|
134
|
+
offsetY: originalEvent.offsetY,
|
|
135
|
+
pageX: originalEvent.pageX,
|
|
136
|
+
pageY: originalEvent.pageY,
|
|
137
|
+
screenX: originalEvent.screenX,
|
|
138
|
+
screenY: originalEvent.screenY
|
|
139
|
+
}));
|
|
140
|
+
|
|
141
|
+
if (!allowClickEvent) {
|
|
142
|
+
// suppress the next click event if e.preventDefault() was called in long-press handler
|
|
143
|
+
document.addEventListener('click', function suppressEvent(e) {
|
|
144
|
+
document.removeEventListener('click', suppressEvent, true);
|
|
145
|
+
cancelEvent(e);
|
|
146
|
+
}, true);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* consolidates mouse, touch, and Pointer events
|
|
152
|
+
* @param {MouseEvent|PointerEvent|TouchEvent} e The original event being fired
|
|
153
|
+
* @returns {MouseEvent|PointerEvent|Touch}
|
|
154
|
+
*/
|
|
155
|
+
function unifyEvent(e) {
|
|
156
|
+
if (e.changedTouches !== undefined) {
|
|
157
|
+
return e.changedTouches[0];
|
|
158
|
+
}
|
|
159
|
+
return e;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* method responsible for starting the long press timer
|
|
164
|
+
* @param {event} e - event object
|
|
165
|
+
* @returns {void}
|
|
166
|
+
*/
|
|
167
|
+
function startLongPressTimer(e) {
|
|
168
|
+
|
|
169
|
+
clearLongPressTimer();
|
|
170
|
+
|
|
171
|
+
var el = e.target;
|
|
172
|
+
|
|
173
|
+
// get delay from html attribute if it exists, otherwise default to 1500
|
|
174
|
+
var longPressDelayInMs = parseInt(getNearestAttribute(el, 'data-long-press-delay', '1500'), 10); // default 1500
|
|
175
|
+
|
|
176
|
+
// start the timer
|
|
177
|
+
timer = requestTimeout(fireLongPressEvent.bind(el, e), longPressDelayInMs);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* method responsible for clearing a pending long press timer
|
|
182
|
+
* @param {event} e - event object
|
|
183
|
+
* @returns {void}
|
|
184
|
+
*/
|
|
185
|
+
function clearLongPressTimer(e) {
|
|
186
|
+
clearRequestTimeout(timer);
|
|
187
|
+
timer = null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Cancels the current event
|
|
192
|
+
* @param {object} e - browser event object
|
|
193
|
+
* @returns {void}
|
|
194
|
+
*/
|
|
195
|
+
function cancelEvent(e) {
|
|
196
|
+
e.stopImmediatePropagation();
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Starts the timer on mouse down and logs current position
|
|
203
|
+
* @param {object} e - browser event object
|
|
204
|
+
* @returns {void}
|
|
205
|
+
*/
|
|
206
|
+
function mouseDownHandler(e) {
|
|
207
|
+
startX = e.clientX;
|
|
208
|
+
startY = e.clientY;
|
|
209
|
+
startLongPressTimer(e);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* If the mouse moves n pixels during long-press, cancel the timer
|
|
214
|
+
* @param {object} e - browser event object
|
|
215
|
+
* @returns {void}
|
|
216
|
+
*/
|
|
217
|
+
function mouseMoveHandler(e) {
|
|
218
|
+
|
|
219
|
+
// calculate total number of pixels the pointer has moved
|
|
220
|
+
var diffX = Math.abs(startX - e.clientX);
|
|
221
|
+
var diffY = Math.abs(startY - e.clientY);
|
|
222
|
+
|
|
223
|
+
// if pointer has moved more than allowed, cancel the long-press timer and therefore the event
|
|
224
|
+
if (diffX >= maxDiffX || diffY >= maxDiffY) {
|
|
225
|
+
clearLongPressTimer();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Gets attribute off HTML element or nearest parent
|
|
231
|
+
* @param {object} el - HTML element to retrieve attribute from
|
|
232
|
+
* @param {string} attributeName - name of the attribute
|
|
233
|
+
* @param {any} defaultValue - default value to return if no match found
|
|
234
|
+
* @returns {any} attribute value or defaultValue
|
|
235
|
+
*/
|
|
236
|
+
function getNearestAttribute(el, attributeName, defaultValue) {
|
|
237
|
+
|
|
238
|
+
// walk up the dom tree looking for data-action and data-trigger
|
|
239
|
+
while (el && el !== document.documentElement) {
|
|
240
|
+
|
|
241
|
+
var attributeValue = el.getAttribute(attributeName);
|
|
242
|
+
|
|
243
|
+
if (attributeValue) {
|
|
244
|
+
return attributeValue;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
el = el.parentNode;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return defaultValue;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// hook events that clear a pending long press event
|
|
254
|
+
document.addEventListener(mouseUp, clearLongPressTimer, true);
|
|
255
|
+
document.addEventListener(mouseLeave, clearLongPressTimer, true);
|
|
256
|
+
document.addEventListener(mouseMove, mouseMoveHandler, true);
|
|
257
|
+
document.addEventListener('wheel', clearLongPressTimer, true);
|
|
258
|
+
document.addEventListener('scroll', clearLongPressTimer, true);
|
|
259
|
+
document.addEventListener('contextmenu', clearLongPressTimer, true);
|
|
260
|
+
|
|
261
|
+
// hook events that can trigger a long press event
|
|
262
|
+
document.addEventListener(mouseDown, mouseDownHandler, true); // <- start
|
|
263
|
+
|
|
264
|
+
}(window, document));
|
|
@@ -2,8 +2,9 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './heading-levels.js';
|
|
4
4
|
import { c as checkEmptyOrOneOf } from './index2.js';
|
|
5
|
-
import
|
|
5
|
+
import './breakpoints.js';
|
|
6
6
|
import { e as eventGuard } from './event-guard.js';
|
|
7
|
+
import { n as nanoid } from './index.browser.js';
|
|
7
8
|
import { d as defineCustomElement$3 } from './post-collapsible2.js';
|
|
8
9
|
import { d as defineCustomElement$2 } from './post-collapsible-trigger2.js';
|
|
9
10
|
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
@@ -21,8 +22,6 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
21
22
|
this.collapsed = false;
|
|
22
23
|
this.headingLevel = undefined;
|
|
23
24
|
}
|
|
24
|
-
collapsible;
|
|
25
|
-
get host() { return this; }
|
|
26
25
|
validateHeadingLevel() {
|
|
27
26
|
checkEmptyOrOneOf(this, 'headingLevel', HEADING_LEVELS, 'The `heading-level` property of the `post-accordion-item` must be a number between 1 and 6.');
|
|
28
27
|
}
|
|
@@ -58,6 +57,7 @@ const PostAccordionItem = /*@__PURE__*/ proxyCustomElement(class PostAccordionIt
|
|
|
58
57
|
'has-image': !!this.slottedLogo,
|
|
59
58
|
} }, h("slot", { key: '1a42494db72a7b437b1d98fa2e8159d73ece22fa', name: "logo", onSlotchange: this.onSlotLogoChange.bind(this) })), h("slot", { key: '049865bb25f833780ef8e27fe8477e06476a2427', name: "header" }), h("post-icon", { key: 'da0cf7078e4f51710dbfd39c0afa90465fcb53c6', name: "2051" })))), h("post-collapsible", { key: '7c3b268e34d3e4f52820b11a6c090aefbc16e3b9', id: `${this.id}--collapse`, collapsed: this.collapsed, ref: el => (this.collapsible = el) }, h("div", { key: '993a7fffbccb557aed2842305f3927e5c3b5047a', class: "accordion-body", part: "body" }, h("slot", { key: '580eb87b1cb4f88acd7dddddecaa1c1982b7f6e3' }))))));
|
|
60
59
|
}
|
|
60
|
+
get host() { return this; }
|
|
61
61
|
static get watchers() { return {
|
|
62
62
|
"headingLevel": ["validateHeadingLevel"]
|
|
63
63
|
}; }
|
|
@@ -2,6 +2,7 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { H as HEADING_LEVELS } from './heading-levels.js';
|
|
4
4
|
import { c as checkOneOf } from './check-one-of.js';
|
|
5
|
+
import './breakpoints.js';
|
|
5
6
|
import { e as eventGuard } from './event-guard.js';
|
|
6
7
|
|
|
7
8
|
const postAccordionCss = ":host{display:block}::slotted(post-accordion-item){display:block}::slotted(post-accordion-item:not(:only-of-type:first-of-type)){margin-block-start:calc(var(--post-device-border-width-default)*-1)}::slotted(post-accordion-item:not(:only-of-type):first-of-type){--post-accordion-button-border-top:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-primary-enabled-stroke)}";
|
|
@@ -12,12 +13,10 @@ const PostAccordion = /*@__PURE__*/ proxyCustomElement(class PostAccordion exten
|
|
|
12
13
|
super();
|
|
13
14
|
this.__registerHost();
|
|
14
15
|
this.__attachShadow();
|
|
16
|
+
this.expandedItems = new Set();
|
|
15
17
|
this.headingLevel = undefined;
|
|
16
18
|
this.multiple = false;
|
|
17
19
|
}
|
|
18
|
-
accordionItems;
|
|
19
|
-
expandedItems = new Set();
|
|
20
|
-
get host() { return this; }
|
|
21
20
|
validateHeadingLevel(newValue = this.headingLevel) {
|
|
22
21
|
if (!newValue)
|
|
23
22
|
return;
|
|
@@ -96,6 +95,7 @@ const PostAccordion = /*@__PURE__*/ proxyCustomElement(class PostAccordion exten
|
|
|
96
95
|
render() {
|
|
97
96
|
return (h(Host, { key: '80e15cf7835f213cfee1ca7cf83cc2fd24bba3ff', "data-version": version }, h("div", { key: '1cf03d4960115b52394b5cb07cd2286747c728dd', class: "accordion" }, h("slot", { key: 'b94328a45a3cba6a8d3b418061036eb8af2cf027', onSlotchange: () => this.registerAccordionItems() }))));
|
|
98
97
|
}
|
|
98
|
+
get host() { return this; }
|
|
99
99
|
static get watchers() { return {
|
|
100
100
|
"headingLevel": ["validateHeadingLevel"]
|
|
101
101
|
}; }
|