@swisspost/design-system-components 9.0.0-next.33 → 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/get-root-8102fecd.js +17 -0
- package/dist/cjs/{index-d6bf2c66.js → index-b60129c4.js} +2 -2
- package/dist/cjs/index.cjs.js +24 -25
- 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-3426e8f7.js} +1 -1
- package/dist/cjs/{post-accordion-6c5681ba.js → post-accordion-3ac8dca8.js} +5 -5
- package/dist/cjs/{post-accordion-item-05a78451.js → post-accordion-item-aace6bc2.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-53abd22f.js} +5 -4
- package/dist/cjs/post-avatar.cjs.entry.js +4 -3
- package/dist/cjs/{post-back-to-top-d0662842.js → post-back-to-top-b231fc1c.js} +9 -9
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -3
- package/dist/cjs/{post-banner-bd97db9c.js → post-banner-e6d14bf1.js} +4 -8
- package/dist/cjs/post-banner.cjs.entry.js +4 -3
- package/dist/cjs/{post-breadcrumb-36ab841c.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-155fb433.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 +5 -5
- package/dist/cjs/{post-collapsible-trigger-6601c554.js → post-collapsible-trigger-d1cb592a.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-4290dafc.js} +11 -11
- package/dist/cjs/post-footer.cjs.entry.js +4 -4
- package/dist/cjs/{post-linkarea-8e5e1a9f.js → post-linkarea-f22f4f92.js} +5 -5
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/{post-menu-item-8dd94792.js → post-menu-item-afabaa61.js} +4 -4
- package/dist/cjs/{post-popover-858cbd12.js → post-popover-a4c72d38.js} +16 -14
- package/dist/cjs/post-popover.cjs.entry.js +5 -4
- package/dist/cjs/{post-rating-ef592484.js → post-rating-b87616fc.js} +4 -14
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-d785e7fc.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-41ea371e.js → post-tab-panel-00d16ba7.js} +4 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-c6f00130.js → post-tabs-2c3a89d0.js} +5 -12
- package/dist/cjs/post-tabs.cjs.entry.js +4 -3
- package/dist/cjs/{post-tag-d1a1176c.js → post-tag-370a2f4d.js} +3 -3
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-02c56b7b.js → post-togglebutton-2c9552e3.js} +935 -460
- package/dist/cjs/{post-tooltip-3176e280.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 +1 -3
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +0 -2
- 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.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 +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.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.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.js +45 -53
- 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/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/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 +4 -3
- package/dist/components/post-back-to-top2.js +8 -8
- 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 +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 +3 -10
- 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 +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 +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 +48 -54
- 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/get-root-1b1af46f.js +15 -0
- package/dist/esm/{index-3419e46d.js → index-f4d19816.js} +2 -2
- 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-8986a24c.js +3 -0
- package/dist/esm/{post-accordion-024451fa.js → post-accordion-577b52a0.js} +5 -5
- package/dist/esm/{post-accordion-item-19b996d1.js → post-accordion-item-99053b41.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-2914706c.js} +5 -4
- package/dist/esm/post-avatar.entry.js +4 -3
- package/dist/esm/{post-back-to-top-7dd43c3b.js → post-back-to-top-4c7b1b47.js} +9 -9
- package/dist/esm/post-back-to-top.entry.js +4 -3
- package/dist/esm/{post-banner-28d18721.js → post-banner-295fd0f5.js} +4 -8
- package/dist/esm/post-banner.entry.js +4 -3
- package/dist/esm/{post-breadcrumb-d86fae7b.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-aa043898.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 +5 -5
- package/dist/esm/{post-collapsible-trigger-b1612866.js → post-collapsible-trigger-6b4ece20.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-a5105e66.js} +11 -11
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/{post-linkarea-802bf774.js → post-linkarea-22f97a88.js} +5 -5
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/{post-menu-item-d97611d8.js → post-menu-item-9465a1f3.js} +4 -4
- package/dist/esm/{post-popover-e51a7a18.js → post-popover-e9b4569c.js} +16 -14
- package/dist/esm/post-popover.entry.js +5 -4
- package/dist/esm/{post-rating-e1ac47ce.js → post-rating-ae16e3c9.js} +4 -14
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-06dcbf7f.js → post-tab-header-11f23150.js} +5 -4
- package/dist/esm/post-tab-header.entry.js +4 -3
- package/dist/esm/{post-tab-panel-75932601.js → post-tab-panel-0f3a952e.js} +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-3ef2ea23.js → post-tabs-1192509c.js} +5 -12
- package/dist/esm/post-tabs.entry.js +4 -3
- package/dist/esm/{post-tag-a3b989e0.js → post-tag-8be0a71c.js} +3 -3
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-db251030.js → post-togglebutton-b634fc7c.js} +935 -460
- package/dist/esm/{post-tooltip-c256d714.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-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-dbe31632.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-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-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/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.js +3 -3
- 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 +4 -3
- package/loaders/post-back-to-top.js +8 -8
- 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 +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 +3 -10
- 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 +2 -3
- 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 +48 -54
- 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/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-da68ab5a.js +0 -3
- 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-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,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const
|
|
5
|
-
const attributeObserver = require('./attribute-observer-6d8b886b.js');
|
|
3
|
+
const index = require('./index-b60129c4.js');
|
|
4
|
+
const attributeObserver = require('./attribute-observer-c3a805b2.js');
|
|
6
5
|
const index$1 = require('./index-23e36ff7.js');
|
|
6
|
+
const breakpoints = require('./breakpoints-cdf1b747.js');
|
|
7
|
+
const _package = require('./package-3426e8f7.js');
|
|
7
8
|
|
|
8
9
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
9
10
|
|
|
@@ -4509,274 +4510,14 @@ module.exports = exports['default'];
|
|
|
4509
4510
|
|
|
4510
4511
|
const isFocusable = /*@__PURE__*/getDefaultExportFromCjs(focusable.exports);
|
|
4511
4512
|
|
|
4512
|
-
/*!
|
|
4513
|
-
* long-press-event - v@version@
|
|
4514
|
-
* Pure JavaScript long-press-event
|
|
4515
|
-
* https://github.com/john-doherty/long-press-event
|
|
4516
|
-
* @author John Doherty <www.johndoherty.info>
|
|
4517
|
-
* @license MIT
|
|
4518
|
-
*/
|
|
4519
|
-
(function (window, document) {
|
|
4520
|
-
|
|
4521
|
-
// local timer object based on rAF
|
|
4522
|
-
var timer = null;
|
|
4523
|
-
|
|
4524
|
-
// check if we're using a touch screen
|
|
4525
|
-
var hasPointerEvents = (('PointerEvent' in window) || (window.navigator && 'msPointerEnabled' in window.navigator));
|
|
4526
|
-
var isTouch = (('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
|
|
4527
|
-
|
|
4528
|
-
// switch to pointer events or touch events if using a touch screen
|
|
4529
|
-
var mouseDown = hasPointerEvents ? 'pointerdown' : isTouch ? 'touchstart' : 'mousedown';
|
|
4530
|
-
var mouseUp = hasPointerEvents ? 'pointerup' : isTouch ? 'touchend' : 'mouseup';
|
|
4531
|
-
var mouseMove = hasPointerEvents ? 'pointermove' : isTouch ? 'touchmove' : 'mousemove';
|
|
4532
|
-
var mouseLeave = hasPointerEvents ? 'pointerleave' : isTouch ? 'touchleave' : 'mouseleave';
|
|
4533
|
-
|
|
4534
|
-
// track number of pixels the mouse moves during long press
|
|
4535
|
-
var startX = 0; // mouse x position when timer started
|
|
4536
|
-
var startY = 0; // mouse y position when timer started
|
|
4537
|
-
var maxDiffX = 10; // max number of X pixels the mouse can move during long press before it is canceled
|
|
4538
|
-
var maxDiffY = 10; // max number of Y pixels the mouse can move during long press before it is canceled
|
|
4539
|
-
|
|
4540
|
-
// patch CustomEvent to allow constructor creation (IE/Chrome)
|
|
4541
|
-
if (typeof window.CustomEvent !== 'function') {
|
|
4542
|
-
|
|
4543
|
-
window.CustomEvent = function (event, params) {
|
|
4544
|
-
|
|
4545
|
-
params = params || { bubbles: false, cancelable: false, detail: undefined };
|
|
4546
|
-
|
|
4547
|
-
var evt = document.createEvent('CustomEvent');
|
|
4548
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
4549
|
-
return evt;
|
|
4550
|
-
};
|
|
4551
|
-
|
|
4552
|
-
window.CustomEvent.prototype = window.Event.prototype;
|
|
4553
|
-
}
|
|
4554
|
-
|
|
4555
|
-
// requestAnimationFrame() shim by Paul Irish
|
|
4556
|
-
window.requestAnimFrame = (function () {
|
|
4557
|
-
return window.requestAnimationFrame ||
|
|
4558
|
-
window.webkitRequestAnimationFrame ||
|
|
4559
|
-
window.mozRequestAnimationFrame ||
|
|
4560
|
-
window.oRequestAnimationFrame ||
|
|
4561
|
-
window.msRequestAnimationFrame || function (callback) {
|
|
4562
|
-
window.setTimeout(callback, 1000 / 60);
|
|
4563
|
-
};
|
|
4564
|
-
})();
|
|
4565
|
-
|
|
4566
|
-
/**
|
|
4567
|
-
* Behaves the same as setTimeout except uses requestAnimationFrame() where possible for better performance
|
|
4568
|
-
* @param {function} fn The callback function
|
|
4569
|
-
* @param {int} delay The delay in milliseconds
|
|
4570
|
-
* @returns {object} handle to the timeout object
|
|
4571
|
-
*/
|
|
4572
|
-
function requestTimeout(fn, delay) {
|
|
4573
|
-
|
|
4574
|
-
if (!window.requestAnimationFrame && !window.webkitRequestAnimationFrame &&
|
|
4575
|
-
!(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
|
|
4576
|
-
!window.oRequestAnimationFrame && !window.msRequestAnimationFrame) return window.setTimeout(fn, delay);
|
|
4577
|
-
|
|
4578
|
-
var start = new Date().getTime();
|
|
4579
|
-
var handle = {};
|
|
4580
|
-
|
|
4581
|
-
var loop = function () {
|
|
4582
|
-
var current = new Date().getTime();
|
|
4583
|
-
var delta = current - start;
|
|
4584
|
-
|
|
4585
|
-
if (delta >= delay) {
|
|
4586
|
-
fn.call();
|
|
4587
|
-
}
|
|
4588
|
-
else {
|
|
4589
|
-
handle.value = requestAnimFrame(loop);
|
|
4590
|
-
}
|
|
4591
|
-
};
|
|
4592
|
-
|
|
4593
|
-
handle.value = requestAnimFrame(loop);
|
|
4594
|
-
|
|
4595
|
-
return handle;
|
|
4596
|
-
}
|
|
4597
|
-
|
|
4598
|
-
/**
|
|
4599
|
-
* Behaves the same as clearTimeout except uses cancelRequestAnimationFrame() where possible for better performance
|
|
4600
|
-
* @param {object} handle The callback function
|
|
4601
|
-
* @returns {void}
|
|
4602
|
-
*/
|
|
4603
|
-
function clearRequestTimeout(handle) {
|
|
4604
|
-
if (handle) {
|
|
4605
|
-
window.cancelAnimationFrame ? window.cancelAnimationFrame(handle.value) :
|
|
4606
|
-
window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(handle.value) :
|
|
4607
|
-
window.webkitCancelRequestAnimationFrame ? window.webkitCancelRequestAnimationFrame(handle.value) : /* Support for legacy API */
|
|
4608
|
-
window.mozCancelRequestAnimationFrame ? window.mozCancelRequestAnimationFrame(handle.value) :
|
|
4609
|
-
window.oCancelRequestAnimationFrame ? window.oCancelRequestAnimationFrame(handle.value) :
|
|
4610
|
-
window.msCancelRequestAnimationFrame ? window.msCancelRequestAnimationFrame(handle.value) :
|
|
4611
|
-
clearTimeout(handle);
|
|
4612
|
-
}
|
|
4613
|
-
}
|
|
4614
|
-
|
|
4615
|
-
/**
|
|
4616
|
-
* Fires the 'long-press' event on element
|
|
4617
|
-
* @param {MouseEvent|PointerEvent|TouchEvent} originalEvent The original event being fired
|
|
4618
|
-
* @returns {void}
|
|
4619
|
-
*/
|
|
4620
|
-
function fireLongPressEvent(originalEvent) {
|
|
4621
|
-
|
|
4622
|
-
clearLongPressTimer();
|
|
4623
|
-
|
|
4624
|
-
originalEvent = unifyEvent(originalEvent);
|
|
4625
|
-
|
|
4626
|
-
// fire the long-press event
|
|
4627
|
-
var allowClickEvent = this.dispatchEvent(new CustomEvent('long-press', {
|
|
4628
|
-
bubbles: true,
|
|
4629
|
-
cancelable: true,
|
|
4630
|
-
|
|
4631
|
-
// custom event data (legacy)
|
|
4632
|
-
detail: {
|
|
4633
|
-
clientX: originalEvent.clientX,
|
|
4634
|
-
clientY: originalEvent.clientY,
|
|
4635
|
-
offsetX: originalEvent.offsetX,
|
|
4636
|
-
offsetY: originalEvent.offsetY,
|
|
4637
|
-
pageX: originalEvent.pageX,
|
|
4638
|
-
pageY: originalEvent.pageY
|
|
4639
|
-
},
|
|
4640
|
-
|
|
4641
|
-
// add coordinate data that would typically acompany a touch/click event
|
|
4642
|
-
clientX: originalEvent.clientX,
|
|
4643
|
-
clientY: originalEvent.clientY,
|
|
4644
|
-
offsetX: originalEvent.offsetX,
|
|
4645
|
-
offsetY: originalEvent.offsetY,
|
|
4646
|
-
pageX: originalEvent.pageX,
|
|
4647
|
-
pageY: originalEvent.pageY,
|
|
4648
|
-
screenX: originalEvent.screenX,
|
|
4649
|
-
screenY: originalEvent.screenY
|
|
4650
|
-
}));
|
|
4651
|
-
|
|
4652
|
-
if (!allowClickEvent) {
|
|
4653
|
-
// suppress the next click event if e.preventDefault() was called in long-press handler
|
|
4654
|
-
document.addEventListener('click', function suppressEvent(e) {
|
|
4655
|
-
document.removeEventListener('click', suppressEvent, true);
|
|
4656
|
-
cancelEvent(e);
|
|
4657
|
-
}, true);
|
|
4658
|
-
}
|
|
4659
|
-
}
|
|
4660
|
-
|
|
4661
|
-
/**
|
|
4662
|
-
* consolidates mouse, touch, and Pointer events
|
|
4663
|
-
* @param {MouseEvent|PointerEvent|TouchEvent} e The original event being fired
|
|
4664
|
-
* @returns {MouseEvent|PointerEvent|Touch}
|
|
4665
|
-
*/
|
|
4666
|
-
function unifyEvent(e) {
|
|
4667
|
-
if (e.changedTouches !== undefined) {
|
|
4668
|
-
return e.changedTouches[0];
|
|
4669
|
-
}
|
|
4670
|
-
return e;
|
|
4671
|
-
}
|
|
4672
|
-
|
|
4673
|
-
/**
|
|
4674
|
-
* method responsible for starting the long press timer
|
|
4675
|
-
* @param {event} e - event object
|
|
4676
|
-
* @returns {void}
|
|
4677
|
-
*/
|
|
4678
|
-
function startLongPressTimer(e) {
|
|
4679
|
-
|
|
4680
|
-
clearLongPressTimer();
|
|
4681
|
-
|
|
4682
|
-
var el = e.target;
|
|
4683
|
-
|
|
4684
|
-
// get delay from html attribute if it exists, otherwise default to 1500
|
|
4685
|
-
var longPressDelayInMs = parseInt(getNearestAttribute(el, 'data-long-press-delay', '1500'), 10); // default 1500
|
|
4686
|
-
|
|
4687
|
-
// start the timer
|
|
4688
|
-
timer = requestTimeout(fireLongPressEvent.bind(el, e), longPressDelayInMs);
|
|
4689
|
-
}
|
|
4690
|
-
|
|
4691
|
-
/**
|
|
4692
|
-
* method responsible for clearing a pending long press timer
|
|
4693
|
-
* @param {event} e - event object
|
|
4694
|
-
* @returns {void}
|
|
4695
|
-
*/
|
|
4696
|
-
function clearLongPressTimer(e) {
|
|
4697
|
-
clearRequestTimeout(timer);
|
|
4698
|
-
timer = null;
|
|
4699
|
-
}
|
|
4700
|
-
|
|
4701
|
-
/**
|
|
4702
|
-
* Cancels the current event
|
|
4703
|
-
* @param {object} e - browser event object
|
|
4704
|
-
* @returns {void}
|
|
4705
|
-
*/
|
|
4706
|
-
function cancelEvent(e) {
|
|
4707
|
-
e.stopImmediatePropagation();
|
|
4708
|
-
e.preventDefault();
|
|
4709
|
-
e.stopPropagation();
|
|
4710
|
-
}
|
|
4711
|
-
|
|
4712
|
-
/**
|
|
4713
|
-
* Starts the timer on mouse down and logs current position
|
|
4714
|
-
* @param {object} e - browser event object
|
|
4715
|
-
* @returns {void}
|
|
4716
|
-
*/
|
|
4717
|
-
function mouseDownHandler(e) {
|
|
4718
|
-
startX = e.clientX;
|
|
4719
|
-
startY = e.clientY;
|
|
4720
|
-
startLongPressTimer(e);
|
|
4721
|
-
}
|
|
4722
|
-
|
|
4723
|
-
/**
|
|
4724
|
-
* If the mouse moves n pixels during long-press, cancel the timer
|
|
4725
|
-
* @param {object} e - browser event object
|
|
4726
|
-
* @returns {void}
|
|
4727
|
-
*/
|
|
4728
|
-
function mouseMoveHandler(e) {
|
|
4729
|
-
|
|
4730
|
-
// calculate total number of pixels the pointer has moved
|
|
4731
|
-
var diffX = Math.abs(startX - e.clientX);
|
|
4732
|
-
var diffY = Math.abs(startY - e.clientY);
|
|
4733
|
-
|
|
4734
|
-
// if pointer has moved more than allowed, cancel the long-press timer and therefore the event
|
|
4735
|
-
if (diffX >= maxDiffX || diffY >= maxDiffY) {
|
|
4736
|
-
clearLongPressTimer();
|
|
4737
|
-
}
|
|
4738
|
-
}
|
|
4739
|
-
|
|
4740
|
-
/**
|
|
4741
|
-
* Gets attribute off HTML element or nearest parent
|
|
4742
|
-
* @param {object} el - HTML element to retrieve attribute from
|
|
4743
|
-
* @param {string} attributeName - name of the attribute
|
|
4744
|
-
* @param {any} defaultValue - default value to return if no match found
|
|
4745
|
-
* @returns {any} attribute value or defaultValue
|
|
4746
|
-
*/
|
|
4747
|
-
function getNearestAttribute(el, attributeName, defaultValue) {
|
|
4748
|
-
|
|
4749
|
-
// walk up the dom tree looking for data-action and data-trigger
|
|
4750
|
-
while (el && el !== document.documentElement) {
|
|
4751
|
-
|
|
4752
|
-
var attributeValue = el.getAttribute(attributeName);
|
|
4753
|
-
|
|
4754
|
-
if (attributeValue) {
|
|
4755
|
-
return attributeValue;
|
|
4756
|
-
}
|
|
4757
|
-
|
|
4758
|
-
el = el.parentNode;
|
|
4759
|
-
}
|
|
4760
|
-
|
|
4761
|
-
return defaultValue;
|
|
4762
|
-
}
|
|
4763
|
-
|
|
4764
|
-
// hook events that clear a pending long press event
|
|
4765
|
-
document.addEventListener(mouseUp, clearLongPressTimer, true);
|
|
4766
|
-
document.addEventListener(mouseLeave, clearLongPressTimer, true);
|
|
4767
|
-
document.addEventListener(mouseMove, mouseMoveHandler, true);
|
|
4768
|
-
document.addEventListener('wheel', clearLongPressTimer, true);
|
|
4769
|
-
document.addEventListener('scroll', clearLongPressTimer, true);
|
|
4770
|
-
document.addEventListener('contextmenu', clearLongPressTimer, true);
|
|
4771
|
-
|
|
4772
|
-
// hook events that can trigger a long press event
|
|
4773
|
-
document.addEventListener(mouseDown, mouseDownHandler, true); // <- start
|
|
4774
|
-
|
|
4775
|
-
}(window, document));
|
|
4776
|
-
|
|
4777
4513
|
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)}";
|
|
4778
4514
|
const PostTooltipStyle0 = postTooltipCss;
|
|
4779
4515
|
|
|
4516
|
+
if (breakpoints.IS_BROWSER) {
|
|
4517
|
+
(async () => {
|
|
4518
|
+
await Promise.resolve().then(function () { return require('./long-press-event-6e62d113.js'); });
|
|
4519
|
+
})();
|
|
4520
|
+
}
|
|
4780
4521
|
const OPEN_DELAY = 650; // matches HTML title delay
|
|
4781
4522
|
/**
|
|
4782
4523
|
* @slot default - Slot for the content of the tooltip.
|
|
@@ -4801,7 +4542,8 @@ let tooltipTimeout = null;
|
|
|
4801
4542
|
* @returns
|
|
4802
4543
|
*/
|
|
4803
4544
|
const globalInterestHandler = (e) => {
|
|
4804
|
-
const
|
|
4545
|
+
const eventTarget = e.target;
|
|
4546
|
+
const targetElement = eventTarget.closest(tooltipTargetAttributeSelector);
|
|
4805
4547
|
globalCurrentTarget = targetElement;
|
|
4806
4548
|
if (!targetElement || !('getAttribute' in targetElement)) {
|
|
4807
4549
|
clearTimeout(tooltipTimeout);
|
|
@@ -4813,7 +4555,7 @@ const globalInterestHandler = (e) => {
|
|
|
4813
4555
|
const tooltip = document.getElementById(tooltipTarget);
|
|
4814
4556
|
// Determine if the tooltip was triggered by a focus event
|
|
4815
4557
|
const triggeredByFocus = e.type === 'focusin';
|
|
4816
|
-
|
|
4558
|
+
tooltip?.show(targetElement, triggeredByFocus);
|
|
4817
4559
|
if (hideTooltipTimeout) {
|
|
4818
4560
|
window.clearTimeout(hideTooltipTimeout);
|
|
4819
4561
|
hideTooltipTimeout = null;
|
|
@@ -4846,35 +4588,18 @@ const globalHideTooltip = (tooltip) => {
|
|
|
4846
4588
|
hideTooltipTimeout = null;
|
|
4847
4589
|
}, 42);
|
|
4848
4590
|
};
|
|
4849
|
-
/**
|
|
4850
|
-
* Patch some accessibility features that are hard to remember or understand
|
|
4851
|
-
* @param {HTMLElement} trigger
|
|
4852
|
-
*/
|
|
4853
|
-
const patchAccessibilityFeatures = (trigger) => {
|
|
4854
|
-
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4855
|
-
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
4856
|
-
// Add tooltip to aria-describedby
|
|
4857
|
-
if (!describedBy?.includes(id)) {
|
|
4858
|
-
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
4859
|
-
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4860
|
-
}
|
|
4861
|
-
// Make element focusable
|
|
4862
|
-
if (!isFocusable(trigger)) {
|
|
4863
|
-
trigger.setAttribute('tabindex', '0');
|
|
4864
|
-
}
|
|
4865
|
-
};
|
|
4866
|
-
// Initialize a mutation observer for patching accessibility features
|
|
4867
|
-
const triggerObserver = attributeObserver.getAttributeObserver(tooltipTargetAttribute, patchAccessibilityFeatures);
|
|
4868
4591
|
const PostTooltip = class {
|
|
4869
4592
|
constructor(hostRef) {
|
|
4870
4593
|
index.registerInstance(this, hostRef);
|
|
4594
|
+
this.wasOpenedByFocus = false;
|
|
4595
|
+
// Initialize a mutation observer for patching accessibility features
|
|
4596
|
+
this.triggerObserver = breakpoints.IS_BROWSER
|
|
4597
|
+
? attributeObserver.getAttributeObserver(tooltipTargetAttribute, this.patchAccessibilityFeatures)
|
|
4598
|
+
: null;
|
|
4871
4599
|
this.placement = 'top';
|
|
4872
4600
|
this.arrow = true;
|
|
4873
4601
|
this.delayed = false;
|
|
4874
4602
|
}
|
|
4875
|
-
popoverRef;
|
|
4876
|
-
wasOpenedByFocus = false;
|
|
4877
|
-
get host() { return index.getElement(this); }
|
|
4878
4603
|
validateDelayed() {
|
|
4879
4604
|
index$1.checkEmptyOrType(this, 'delayed', 'boolean');
|
|
4880
4605
|
}
|
|
@@ -4901,9 +4626,9 @@ const PostTooltip = class {
|
|
|
4901
4626
|
document.addEventListener('focusout', globalInterestLostHandler);
|
|
4902
4627
|
document.addEventListener('long-press', globalInterestHandler);
|
|
4903
4628
|
// Initially run the accessibility patcher on all triggers
|
|
4904
|
-
document.querySelectorAll('[data-tooltip-target]').forEach(patchAccessibilityFeatures);
|
|
4629
|
+
document.querySelectorAll('[data-tooltip-target]').forEach(this.patchAccessibilityFeatures);
|
|
4905
4630
|
// Start watching for future triggers
|
|
4906
|
-
triggerObserver
|
|
4631
|
+
this.triggerObserver?.observe(document.body, {
|
|
4907
4632
|
subtree: true,
|
|
4908
4633
|
childList: true,
|
|
4909
4634
|
attributeFilter: [tooltipTargetAttribute],
|
|
@@ -4924,7 +4649,7 @@ const PostTooltip = class {
|
|
|
4924
4649
|
document.removeEventListener('focusin', globalInterestHandler);
|
|
4925
4650
|
document.removeEventListener('focusout', globalInterestLostHandler);
|
|
4926
4651
|
document.removeEventListener('long-press', globalInterestHandler);
|
|
4927
|
-
triggerObserver
|
|
4652
|
+
this.triggerObserver?.disconnect();
|
|
4928
4653
|
}
|
|
4929
4654
|
}
|
|
4930
4655
|
/**
|
|
@@ -4988,10 +4713,28 @@ const PostTooltip = class {
|
|
|
4988
4713
|
globalHideTooltip(this);
|
|
4989
4714
|
this.host.style.pointerEvents = 'auto';
|
|
4990
4715
|
}
|
|
4716
|
+
/**
|
|
4717
|
+
* Patch some accessibility features that are hard to remember or understand
|
|
4718
|
+
* @param {HTMLElement} trigger
|
|
4719
|
+
*/
|
|
4720
|
+
patchAccessibilityFeatures(trigger) {
|
|
4721
|
+
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4722
|
+
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
4723
|
+
// Add tooltip to aria-describedby
|
|
4724
|
+
if (!describedBy?.includes(id)) {
|
|
4725
|
+
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
4726
|
+
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4727
|
+
}
|
|
4728
|
+
// Make element focusable
|
|
4729
|
+
if (!isFocusable(trigger)) {
|
|
4730
|
+
trigger.setAttribute('tabindex', '0');
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4991
4733
|
render() {
|
|
4992
4734
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
4993
|
-
return (index.h(index.Host, { key: '
|
|
4735
|
+
return (index.h(index.Host, { key: 'f6e535d23220c3b53840913882b7302d54cc6a89', "data-version": _package.version, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, index.h("post-popovercontainer", { key: '25aaaee555958fdacd3aa204b90d09ab14289b51', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, index.h("slot", { key: '81ae53f9ab5189253a256861b6df5a2cd31fe678' }))));
|
|
4994
4736
|
}
|
|
4737
|
+
get host() { return index.getElement(this); }
|
|
4995
4738
|
static get watchers() { return {
|
|
4996
4739
|
"delayed": ["validateDelayed"]
|
|
4997
4740
|
}; }
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postTooltip = require('./post-tooltip-
|
|
6
|
-
require('./index-
|
|
7
|
-
require('./
|
|
8
|
-
require('./
|
|
5
|
+
const postTooltip = require('./post-tooltip-4d4d2ea9.js');
|
|
6
|
+
require('./index-b60129c4.js');
|
|
7
|
+
require('./attribute-observer-c3a805b2.js');
|
|
8
|
+
require('./breakpoints-cdf1b747.js');
|
|
9
9
|
require('./index-23e36ff7.js');
|
|
10
10
|
require('./constants-238701d3.js');
|
|
11
11
|
require('./check-one-of-75d270b5.js');
|
|
12
12
|
require('./check-type-cdbf6d29.js');
|
|
13
13
|
require('./check-url-220a286c.js');
|
|
14
|
+
require('./package-3426e8f7.js');
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IS_BROWSER } from "../utils/index";
|
|
1
2
|
const collapseDuration = 350;
|
|
2
3
|
const collapseEasing = 'ease';
|
|
3
4
|
const collapsedKeyframe = { height: '0', overflow: 'hidden' };
|
|
@@ -7,7 +8,8 @@ const animationOptions = {
|
|
|
7
8
|
fill: 'forwards',
|
|
8
9
|
};
|
|
9
10
|
export function collapse(el) {
|
|
10
|
-
const
|
|
11
|
+
const elHeight = IS_BROWSER ? window.getComputedStyle(el).height : `${el.scrollHeight}px`;
|
|
12
|
+
const expandedKeyframe = { height: elHeight };
|
|
11
13
|
return el.animate([expandedKeyframe, collapsedKeyframe], animationOptions);
|
|
12
14
|
}
|
|
13
15
|
export function expand(el) {
|
|
@@ -8,12 +8,10 @@ import { eventGuard } from "../../utils/event-gua"; // Import eventGuard
|
|
|
8
8
|
*/
|
|
9
9
|
export class PostAccordion {
|
|
10
10
|
constructor() {
|
|
11
|
+
this.expandedItems = new Set();
|
|
11
12
|
this.headingLevel = undefined;
|
|
12
13
|
this.multiple = false;
|
|
13
14
|
}
|
|
14
|
-
accordionItems;
|
|
15
|
-
expandedItems = new Set();
|
|
16
|
-
host;
|
|
17
15
|
validateHeadingLevel(newValue = this.headingLevel) {
|
|
18
16
|
if (!newValue)
|
|
19
17
|
return;
|
|
@@ -18,8 +18,6 @@ export class PostAccordionItem {
|
|
|
18
18
|
this.collapsed = false;
|
|
19
19
|
this.headingLevel = undefined;
|
|
20
20
|
}
|
|
21
|
-
collapsible;
|
|
22
|
-
host;
|
|
23
21
|
validateHeadingLevel() {
|
|
24
22
|
checkEmptyOrOneOf(this, 'headingLevel', HEADING_LEVELS, 'The `heading-level` property of the `post-accordion-item` must be a number between 1 and 6.');
|
|
25
23
|
}
|
|
@@ -28,8 +28,6 @@ export class PostAvatar {
|
|
|
28
28
|
this.imageAlt = '';
|
|
29
29
|
this.initials = '';
|
|
30
30
|
}
|
|
31
|
-
static INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
32
|
-
host;
|
|
33
31
|
validateFirstname() {
|
|
34
32
|
checkNonEmpty(this, 'firstname');
|
|
35
33
|
}
|
|
@@ -160,7 +158,7 @@ export class PostAvatar {
|
|
|
160
158
|
"text": "Defines the users firstname."
|
|
161
159
|
},
|
|
162
160
|
"attribute": "firstname",
|
|
163
|
-
"reflect":
|
|
161
|
+
"reflect": true
|
|
164
162
|
},
|
|
165
163
|
"lastname": {
|
|
166
164
|
"type": "string",
|
|
@@ -191,7 +189,7 @@ export class PostAvatar {
|
|
|
191
189
|
"optional": true,
|
|
192
190
|
"docs": {
|
|
193
191
|
"tags": [],
|
|
194
|
-
"text": "Defines the company internal userId.<div className=\"mb-
|
|
192
|
+
"text": "Defines the company internal userId.<div className=\"mb-4 banner banner-warning banner-sm\">Can only be used on post.ch domains!</div>"
|
|
195
193
|
},
|
|
196
194
|
"attribute": "userid",
|
|
197
195
|
"reflect": false
|
|
@@ -232,3 +230,4 @@ export class PostAvatar {
|
|
|
232
230
|
}];
|
|
233
231
|
}
|
|
234
232
|
}
|
|
233
|
+
PostAvatar.INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
@@ -4,17 +4,15 @@ import { version } from "../../../../package";
|
|
|
4
4
|
import { checkType, checkNonEmpty } from "../../utils/index";
|
|
5
5
|
export class PostBackToTop {
|
|
6
6
|
constructor() {
|
|
7
|
+
this.handleScroll = () => {
|
|
8
|
+
this.belowFold = this.isBelowFold();
|
|
9
|
+
};
|
|
7
10
|
this.label = undefined;
|
|
8
11
|
this.belowFold = false;
|
|
9
12
|
}
|
|
10
|
-
host;
|
|
11
|
-
translateY;
|
|
12
13
|
isBelowFold() {
|
|
13
14
|
return window.scrollY > window.innerHeight;
|
|
14
15
|
}
|
|
15
|
-
handleScroll = () => {
|
|
16
|
-
this.belowFold = this.isBelowFold();
|
|
17
|
-
};
|
|
18
16
|
/*Watch for changes in belowFold to show/hide the back to top button*/
|
|
19
17
|
watchBelowFold(newValue) {
|
|
20
18
|
if (newValue) {
|
|
@@ -60,8 +58,8 @@ export class PostBackToTop {
|
|
|
60
58
|
}
|
|
61
59
|
// Validate the label
|
|
62
60
|
validateLabel() {
|
|
63
|
-
checkType(this, 'label', 'string');
|
|
64
61
|
checkNonEmpty(this, 'label');
|
|
62
|
+
checkType(this, 'label', 'string');
|
|
65
63
|
}
|
|
66
64
|
// Set the initial state
|
|
67
65
|
componentWillLoad() {
|
|
@@ -76,7 +74,7 @@ export class PostBackToTop {
|
|
|
76
74
|
window.removeEventListener('scroll', this.handleScroll);
|
|
77
75
|
}
|
|
78
76
|
render() {
|
|
79
|
-
return (h(Host, { key: '
|
|
77
|
+
return (h(Host, { key: 'c1ab6c5e7619ad829d64aea16c59a923310cf091', "data-version": version }, h("button", { key: '99e10e4d16c8d82521b001c3b3d902d8ba47ee92', class: "back-to-top", "aria-hidden": this.belowFold ? 'false' : 'true', tabindex: this.belowFold ? '0' : '-1', onClick: this.scrollToTop }, h("post-icon", { key: '5a6a1b472b45fcc466127ece7091617e4700ee16', "aria-hidden": "true", name: "3026" }), h("span", { key: 'c8502e4822347d48034f6a936203e3314c7ae91e', class: "visually-hidden" }, this.label))));
|
|
80
78
|
}
|
|
81
79
|
static get is() { return "post-back-to-top"; }
|
|
82
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -107,7 +105,7 @@ export class PostBackToTop {
|
|
|
107
105
|
"text": "The label of the back-to-top button, intended solely for accessibility purposes.\nThis label is always hidden from view."
|
|
108
106
|
},
|
|
109
107
|
"attribute": "label",
|
|
110
|
-
"reflect":
|
|
108
|
+
"reflect": true
|
|
111
109
|
}
|
|
112
110
|
};
|
|
113
111
|
}
|
|
@@ -21,7 +21,6 @@ export class PostBanner {
|
|
|
21
21
|
this.icon = undefined;
|
|
22
22
|
this.type = 'neutral';
|
|
23
23
|
}
|
|
24
|
-
host;
|
|
25
24
|
validateDismissible() {
|
|
26
25
|
checkType(this, 'dismissible', 'boolean');
|
|
27
26
|
setTimeout(() => this.validateDismissLabel());
|
|
@@ -37,11 +36,6 @@ export class PostBanner {
|
|
|
37
36
|
validateType() {
|
|
38
37
|
checkEmptyOrOneOf(this, 'type', BANNER_TYPES);
|
|
39
38
|
}
|
|
40
|
-
/**
|
|
41
|
-
* An event emitted when the banner element is dismissed, after the transition.
|
|
42
|
-
* It has no payload and only relevant for dismissible banners.
|
|
43
|
-
*/
|
|
44
|
-
postDismissed;
|
|
45
39
|
componentDidLoad() {
|
|
46
40
|
this.validateDismissible();
|
|
47
41
|
this.validateIcon();
|
|
@@ -3,15 +3,28 @@ import { version } from "../../../../package";
|
|
|
3
3
|
import { checkUrl, debounce } from "../../utils/index";
|
|
4
4
|
export class PostBreadcrumb {
|
|
5
5
|
constructor() {
|
|
6
|
+
// Waits for breadcrumb navigation reference to be available
|
|
7
|
+
this.waitForBreadcrumbRef = debounce(() => {
|
|
8
|
+
if (this.breadcrumbNavRef?.clientWidth > 0) {
|
|
9
|
+
this.checkConcatenation();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
this.waitForBreadcrumbRef();
|
|
13
|
+
}
|
|
14
|
+
}, 50);
|
|
15
|
+
// Handles resizing to check concatenation
|
|
16
|
+
this.handleResize = () => {
|
|
17
|
+
if (window.innerWidth === this.lastWindowWidth)
|
|
18
|
+
return;
|
|
19
|
+
this.lastWindowWidth = window.innerWidth;
|
|
20
|
+
this.checkConcatenation();
|
|
21
|
+
};
|
|
6
22
|
this.homeUrl = undefined;
|
|
7
23
|
this.homeText = 'Home';
|
|
8
24
|
this.breadcrumbItems = [];
|
|
9
25
|
this.isConcatenated = undefined;
|
|
10
26
|
this.lastWindowWidth = undefined;
|
|
11
27
|
}
|
|
12
|
-
host;
|
|
13
|
-
breadcrumbNavRef;
|
|
14
|
-
lastItem;
|
|
15
28
|
validateUrl() {
|
|
16
29
|
checkUrl(this, 'homeUrl');
|
|
17
30
|
}
|
|
@@ -25,15 +38,6 @@ export class PostBreadcrumb {
|
|
|
25
38
|
disconnectedCallback() {
|
|
26
39
|
window.removeEventListener('resize', this.handleResize);
|
|
27
40
|
}
|
|
28
|
-
// Waits for breadcrumb navigation reference to be available
|
|
29
|
-
waitForBreadcrumbRef = debounce(() => {
|
|
30
|
-
if (this.breadcrumbNavRef?.clientWidth > 0) {
|
|
31
|
-
this.checkConcatenation();
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this.waitForBreadcrumbRef();
|
|
35
|
-
}
|
|
36
|
-
}, 50);
|
|
37
41
|
// Updates breadcrumb items and sets the last item
|
|
38
42
|
updateBreadcrumbItems() {
|
|
39
43
|
this.breadcrumbItems = Array.from(this.host.querySelectorAll('post-breadcrumb-item')).map(item => ({
|
|
@@ -42,13 +46,6 @@ export class PostBreadcrumb {
|
|
|
42
46
|
}));
|
|
43
47
|
this.lastItem = this.breadcrumbItems[this.breadcrumbItems.length - 1];
|
|
44
48
|
}
|
|
45
|
-
// Handles resizing to check concatenation
|
|
46
|
-
handleResize = () => {
|
|
47
|
-
if (window.innerWidth === this.lastWindowWidth)
|
|
48
|
-
return;
|
|
49
|
-
this.lastWindowWidth = window.innerWidth;
|
|
50
|
-
this.checkConcatenation();
|
|
51
|
-
};
|
|
52
49
|
// Determines parent width for concatenation logic
|
|
53
50
|
getParentWidth() {
|
|
54
51
|
let parent = this.host.parentNode;
|