@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,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
|
}
|
|
@@ -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
|
}; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
4
|
+
import './breakpoints.js';
|
|
4
5
|
|
|
5
6
|
const postAvatarCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{--post-avatar-bg:var(--post-scheme-color-interactive-primary-enabled-bg2);--post-avatar-fg:var(--post-scheme-color-interactive-primary-enabled-fg3);display:inline-flex;position:relative;width:var(--post-device-sizing-interactive-icon-size3);height:var(--post-device-sizing-interactive-icon-size3);background-color:var(--post-scheme-color-interactive-primary-enabled-stroke3);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-primary-enabled-stroke3);border-radius:var(--post-device-border-radius-round);font-size:var(--post-device-font-size-8);vertical-align:top;line-height:1}:host::after{display:block;content:\"\";position:absolute;inset:0;z-index:1;border-radius:inherit}*,*::before,*::after{box-sizing:border-box}slot,img,::slotted(img){display:block;width:100%;height:100%}img,::slotted(img){border-radius:var(--post-device-border-radius-round)}::slotted(:not(img)){display:none !important}.initials{display:flex;justify-content:center;align-items:center;position:relative;z-index:2;width:100%;height:100%;background-color:var(--post-avatar-bg);border-radius:var(--post-device-border-radius-round);color:var(--post-avatar-fg);text-transform:uppercase}.initials span{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}.initials span:not(caption){position:absolute !important}";
|
|
6
7
|
const PostAvatarStyle0 = postAvatarCss;
|
|
@@ -32,8 +33,6 @@ const PostAvatar = /*@__PURE__*/ proxyCustomElement(class PostAvatar extends HTM
|
|
|
32
33
|
this.imageAlt = '';
|
|
33
34
|
this.initials = '';
|
|
34
35
|
}
|
|
35
|
-
static INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
36
|
-
get host() { return this; }
|
|
37
36
|
validateFirstname() {
|
|
38
37
|
checkNonEmpty(this, 'firstname');
|
|
39
38
|
}
|
|
@@ -135,12 +134,13 @@ const PostAvatar = /*@__PURE__*/ proxyCustomElement(class PostAvatar extends HTM
|
|
|
135
134
|
}, []);
|
|
136
135
|
return (h(Host, { "data-version": version }, h("slot", { onSlotchange: this.onSlotDefaultChange.bind(this) }, this.avatarType === 'image' && h("img", { src: this.imageUrl, alt: this.imageAlt }), this.avatarType === 'initials' && h("div", { class: "initials" }, initials))));
|
|
137
136
|
}
|
|
137
|
+
get host() { return this; }
|
|
138
138
|
static get watchers() { return {
|
|
139
139
|
"firstname": ["validateFirstname"]
|
|
140
140
|
}; }
|
|
141
141
|
static get style() { return PostAvatarStyle0; }
|
|
142
142
|
}, [1, "post-avatar", {
|
|
143
|
-
"firstname": [
|
|
143
|
+
"firstname": [513],
|
|
144
144
|
"lastname": [1],
|
|
145
145
|
"userid": [1],
|
|
146
146
|
"email": [1],
|
|
@@ -152,6 +152,7 @@ const PostAvatar = /*@__PURE__*/ proxyCustomElement(class PostAvatar extends HTM
|
|
|
152
152
|
}, undefined, {
|
|
153
153
|
"firstname": ["validateFirstname"]
|
|
154
154
|
}]);
|
|
155
|
+
PostAvatar.INTERNAL_USERID_IMAGE_SRC = 'https://web.post.ch/UserProfileImage/{userid}.png';
|
|
155
156
|
function defineCustomElement() {
|
|
156
157
|
if (typeof customElements === "undefined") {
|
|
157
158
|
return;
|
|
@@ -3,6 +3,7 @@ import { s as slideDown, a as slideUp } from './slide.js';
|
|
|
3
3
|
import { v as version } from './package.js';
|
|
4
4
|
import { c as checkType } from './check-type.js';
|
|
5
5
|
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
6
|
+
import './breakpoints.js';
|
|
6
7
|
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
7
8
|
|
|
8
9
|
const postBackToTopCss = ":host{--post-floating-button-position-top:var(--post-device-position-4);--post-back-to-top-position-top:calc( var(--post-header-height) + var(--post-floating-button-position-top) );--post-back-to-top-elevation:var(--post-device-elevation-300);position:fixed;inset-block-start:var(--post-back-to-top-position-top);inset-inline-end:var(--post-device-position-1)}:host .back-to-top{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;box-shadow:var(--post-back-to-top-elevation);cursor:pointer;border-radius:var(--post-device-border-radius-round);width:var(--post-device-sizing-interactive-button-height-2);height:var(--post-device-sizing-interactive-button-height-2);border:var(--post-device-border-width-default) solid var(--post-scheme-color-interactive-button-secondary-enabled-stroke);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);display:flex;align-items:center;justify-content:center}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top{background-color:ButtonFace !important}:host .back-to-top:hover{background-color:Highlight !important}}:host .back-to-top{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}:host .back-to-top:hover{border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke);color:var(--post-scheme-color-interactive-button-secondary-hover-fg);background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host .back-to-top:hover{color:HighlightText !important}}:host .back-to-top post-icon{height:var(--post-device-sizing-interactive-button-icon-3);width:var(--post-device-sizing-interactive-button-icon-3)}:host .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}";
|
|
@@ -13,17 +14,15 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
13
14
|
super();
|
|
14
15
|
this.__registerHost();
|
|
15
16
|
this.__attachShadow();
|
|
17
|
+
this.handleScroll = () => {
|
|
18
|
+
this.belowFold = this.isBelowFold();
|
|
19
|
+
};
|
|
16
20
|
this.label = undefined;
|
|
17
21
|
this.belowFold = false;
|
|
18
22
|
}
|
|
19
|
-
get host() { return this; }
|
|
20
|
-
translateY;
|
|
21
23
|
isBelowFold() {
|
|
22
24
|
return window.scrollY > window.innerHeight;
|
|
23
25
|
}
|
|
24
|
-
handleScroll = () => {
|
|
25
|
-
this.belowFold = this.isBelowFold();
|
|
26
|
-
};
|
|
27
26
|
/*Watch for changes in belowFold to show/hide the back to top button*/
|
|
28
27
|
watchBelowFold(newValue) {
|
|
29
28
|
if (newValue) {
|
|
@@ -69,8 +68,8 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
69
68
|
}
|
|
70
69
|
// Validate the label
|
|
71
70
|
validateLabel() {
|
|
72
|
-
checkType(this, 'label', 'string');
|
|
73
71
|
checkNonEmpty(this, 'label');
|
|
72
|
+
checkType(this, 'label', 'string');
|
|
74
73
|
}
|
|
75
74
|
// Set the initial state
|
|
76
75
|
componentWillLoad() {
|
|
@@ -85,15 +84,16 @@ const PostBackToTop = /*@__PURE__*/ proxyCustomElement(class PostBackToTop exten
|
|
|
85
84
|
window.removeEventListener('scroll', this.handleScroll);
|
|
86
85
|
}
|
|
87
86
|
render() {
|
|
88
|
-
return (h(Host, { key: '
|
|
87
|
+
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))));
|
|
89
88
|
}
|
|
89
|
+
get host() { return this; }
|
|
90
90
|
static get watchers() { return {
|
|
91
91
|
"belowFold": ["watchBelowFold"],
|
|
92
92
|
"label": ["validateLabel"]
|
|
93
93
|
}; }
|
|
94
94
|
static get style() { return PostBackToTopStyle0; }
|
|
95
95
|
}, [1, "post-back-to-top", {
|
|
96
|
-
"label": [
|
|
96
|
+
"label": [513],
|
|
97
97
|
"belowFold": [32]
|
|
98
98
|
}, undefined, {
|
|
99
99
|
"belowFold": ["watchBelowFold"],
|
|
@@ -2,6 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { f as fadeOut } from './fade.js';
|
|
4
4
|
import { a as checkEmptyOrPattern, c as checkEmptyOrOneOf } from './index2.js';
|
|
5
|
+
import './breakpoints.js';
|
|
5
6
|
import { n as nanoid } from './index.browser.js';
|
|
6
7
|
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
7
8
|
import { c as checkType } from './check-type.js';
|
|
@@ -28,7 +29,6 @@ const PostBanner = /*@__PURE__*/ proxyCustomElement(class PostBanner extends HTM
|
|
|
28
29
|
this.icon = undefined;
|
|
29
30
|
this.type = 'neutral';
|
|
30
31
|
}
|
|
31
|
-
get host() { return this; }
|
|
32
32
|
validateDismissible() {
|
|
33
33
|
checkType(this, 'dismissible', 'boolean');
|
|
34
34
|
setTimeout(() => this.validateDismissLabel());
|
|
@@ -44,11 +44,6 @@ const PostBanner = /*@__PURE__*/ proxyCustomElement(class PostBanner extends HTM
|
|
|
44
44
|
validateType() {
|
|
45
45
|
checkEmptyOrOneOf(this, 'type', BANNER_TYPES);
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
48
|
-
* An event emitted when the banner element is dismissed, after the transition.
|
|
49
|
-
* It has no payload and only relevant for dismissible banners.
|
|
50
|
-
*/
|
|
51
|
-
postDismissed;
|
|
52
47
|
componentDidLoad() {
|
|
53
48
|
this.validateDismissible();
|
|
54
49
|
this.validateIcon();
|
|
@@ -85,6 +80,7 @@ const PostBanner = /*@__PURE__*/ proxyCustomElement(class PostBanner extends HTM
|
|
|
85
80
|
];
|
|
86
81
|
return (h(Host, { key: 'ec72012fa82e03b0dca2368025449e1942731c21', "data-version": version }, h("div", { key: 'acae7ac34af951ca9176769ab4bcdc388d769931', role: "alert", class: this.classes, part: this.classes }, this.dismissible && (h("button", { key: '23cc4d77c2825bc76cedcdc321b80b9b0f333e71', class: "btn-close", onClick: this.onDismissButtonClick }, h("span", { key: '2f0753d49fc86f19df743f33a086c14b2a0686f7', class: "visually-hidden" }, this.dismissLabel))), this.icon && this.icon !== 'none' && (h("post-icon", { key: `${this.bannerId}-icon`, name: this.icon })), this.hasActions ? actionBannerContent : defaultBannerContent)));
|
|
87
82
|
}
|
|
83
|
+
get host() { return this; }
|
|
88
84
|
static get watchers() { return {
|
|
89
85
|
"dismissible": ["validateDismissible"],
|
|
90
86
|
"dismissLabel": ["validateDismissLabel"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { d as checkEmptyOrUrl } from './index2.js';
|
|
4
|
+
import './breakpoints.js';
|
|
4
5
|
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
5
6
|
|
|
6
7
|
const postBreadcrumbItemCss = ":host{display:flex;align-items:center;justify-content:start;gap:var(--post-device-spacing-gap-inline-5)}:host post-icon{box-sizing:border-box;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);padding-block:var(--post-core-dimension-4);padding-inline:var(--post-core-dimension-4)}.breadcrumb-item{white-space:nowrap;line-height:150%;padding-block:var(--post-device-spacing-padding-block-7);color:var(--post-scheme-color-interactive-primary-enabled-fg1);text-decoration:var(--post-core-text-decoration-none)}.breadcrumb-item{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.breadcrumb-item:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1);text-decoration:var(--post-core-text-decoration-underline)}.breadcrumb-item:focus-visible{border-radius:var(--post-device-border-radius-focus)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.breadcrumb-item,.breadcrumb-item:focus,.breadcrumb-item:hover{color:LinkText !important}.breadcrumb-item:visited{color:VisitedText !important}}";
|
|
@@ -14,8 +15,6 @@ const PostBreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb
|
|
|
14
15
|
this.url = undefined;
|
|
15
16
|
this.fullUrl = undefined;
|
|
16
17
|
}
|
|
17
|
-
get host() { return this; }
|
|
18
|
-
validUrl;
|
|
19
18
|
validateUrl() {
|
|
20
19
|
try {
|
|
21
20
|
this.validUrl = this.constructUrl(this.url);
|
|
@@ -50,6 +49,7 @@ const PostBreadcrumbItem = /*@__PURE__*/ proxyCustomElement(class PostBreadcrumb
|
|
|
50
49
|
const BreadcrumbTag = this.validUrl ? 'a' : 'span';
|
|
51
50
|
return (h(Host, { key: 'd0444118aa031f4cf6f5161d7aa21900e9768348', "data-version": version }, h("post-icon", { key: '719a76e6e86bbb02526c4610acefb3ad253454af', name: "2111", class: "breadcrumb-item-icon" }), h(BreadcrumbTag, { key: '3f5ffb9c77567dba35efa7938029cd519de55474', class: "breadcrumb-item", ...(this.validUrl ? { href: this.validUrl } : {}), onKeyDown: event => this.handleKeyDown(event) }, h("slot", { key: 'bb1be29905c1533f2238a47a346fb35d6a7645fd' }))));
|
|
52
51
|
}
|
|
52
|
+
get host() { return this; }
|
|
53
53
|
static get watchers() { return {
|
|
54
54
|
"url": ["validateUrl"]
|
|
55
55
|
}; }
|