@swisspost/design-system-components 9.0.0-next.12 → 9.0.0-next.13
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/.config/bindings.angular.js +4 -0
- package/dist/cjs/{attribute-observer-10f08c04.js → attribute-observer-6d8b886b.js} +4 -4
- package/dist/cjs/{check-one-of-f4f5d0c0.js → check-one-of-ef931478.js} +2 -1
- package/dist/cjs/{check-type-64af82a9.js → check-type-696d2c51.js} +4 -4
- package/dist/cjs/{check-url-3ffdd2fb.js → check-url-1cf6fb0d.js} +2 -1
- package/dist/cjs/{debounce-1151afe3.js → debounce-158fd76f.js} +2 -1
- package/dist/cjs/fade-72d5ef55.js +14 -0
- package/dist/cjs/{index-5d4e0aed.js → index-bea4ac42.js} +7 -5
- package/dist/cjs/index.cjs.js +27 -27
- package/dist/cjs/{package-0bd6fb0d.js → package-60e57542.js} +1 -1
- package/dist/cjs/{post-accordion-7aadd881.js → post-accordion-1e495c23.js} +5 -4
- package/dist/cjs/{post-accordion-item-bd033c7f.js → post-accordion-item-86b6950a.js} +6 -6
- package/dist/cjs/post-accordion-item.cjs.entry.js +6 -6
- package/dist/cjs/post-accordion.cjs.entry.js +3 -3
- package/dist/cjs/{post-avatar-5dbdf70d.js → post-avatar-067c033b.js} +7 -11
- package/dist/cjs/post-avatar.cjs.entry.js +2 -2
- package/dist/cjs/{post-back-to-top-71bc912c.js → post-back-to-top-7efd1066.js} +8 -7
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -4
- package/dist/cjs/{post-banner-d4e0c73c.js → post-banner-a6808d7d.js} +11 -6
- package/dist/cjs/post-banner.cjs.entry.js +7 -7
- package/dist/cjs/{post-breadcrumb-531c4f79.js → post-breadcrumb-b33abf67.js} +27 -26
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +6 -6
- package/dist/cjs/post-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/post-card-control-7867a104.js +283 -0
- package/dist/cjs/post-card-control.cjs.entry.js +3 -3
- package/dist/cjs/post-closebutton_15.cjs.entry.js +7 -7
- package/dist/cjs/{post-collapsible-trigger-02924200.js → post-collapsible-trigger-6affdc02.js} +37 -31
- package/dist/cjs/post-collapsible_2.cjs.entry.js +7 -7
- package/dist/cjs/{post-footer-96d7bd47.js → post-footer-330e8999.js} +11 -8
- package/dist/cjs/post-footer.cjs.entry.js +2 -2
- package/dist/cjs/{post-menu-item-3f73fb4d.js → post-menu-item-48191dfd.js} +6 -6
- package/dist/cjs/{post-popover-64195ffd.js → post-popover-27f3e9aa.js} +7 -5
- package/dist/cjs/post-popover.cjs.entry.js +3 -3
- package/dist/cjs/{post-rating-bd27ebfc.js → post-rating-28904e91.js} +13 -3
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/post-tab-header-86b129ab.js +33 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-3eedcd19.js → post-tab-panel-94333a7e.js} +2 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-ea94b243.js → post-tabs-f8581050.js} +21 -16
- package/dist/cjs/post-tabs.cjs.entry.js +3 -3
- package/dist/cjs/{post-tag-1d75024b.js → post-tag-3a24c574.js} +3 -3
- package/dist/cjs/post-tag.cjs.entry.js +2 -2
- package/dist/cjs/{post-togglebutton-876f7892.js → post-togglebutton-e7d697bf.js} +184 -106
- package/dist/cjs/{post-tooltip-e4ef3c7e.js → post-tooltip-8c87dfe3.js} +8 -7
- package/dist/cjs/post-tooltip.cjs.entry.js +7 -7
- package/dist/cjs/{slide-5d51abe8.js → slide-8ae17ee4.js} +4 -4
- package/dist/collection/animations/collapse.js +5 -5
- package/dist/collection/animations/fade.js +6 -2
- package/dist/collection/animations/slide.js +4 -4
- package/dist/collection/components/post-accordion/post-accordion.js +3 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +4 -3
- package/dist/collection/components/post-avatar/post-avatar.js +6 -9
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +5 -3
- package/dist/collection/components/post-banner/post-banner.css +1 -1
- package/dist/collection/components/post-banner/post-banner.js +6 -0
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +24 -22
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +4 -3
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +43 -31
- package/dist/collection/components/post-closebutton/post-closebutton.js +1 -0
- package/dist/collection/components/post-collapsible/post-collapsible.js +9 -2
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +19 -18
- package/dist/collection/components/post-footer/post-footer.js +1 -0
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +9 -8
- package/dist/collection/components/post-icon/post-icon.js +51 -14
- package/dist/collection/components/post-language-option/post-language-option.js +5 -0
- package/dist/collection/components/post-language-switch/post-language-switch.js +2 -1
- package/dist/collection/components/post-list/post-list.js +2 -0
- package/dist/collection/components/post-list-item/post-list-item.js +1 -0
- package/dist/collection/components/post-logo/post-logo.js +2 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +6 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +14 -2
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +6 -5
- package/dist/collection/components/post-menu/post-menu.js +42 -29
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +13 -11
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +4 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +9 -0
- package/dist/collection/components/post-rating/post-rating.js +12 -1
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +1 -0
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -0
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +16 -15
- package/dist/collection/components/post-tag/post-tag.css +1 -1
- package/dist/collection/components/post-tag/post-tag.js +1 -0
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +11 -10
- package/dist/collection/components/post-tooltip/post-tooltip.js +5 -3
- package/dist/collection/utils/attribute-observer.js +4 -4
- package/dist/collection/utils/breakpoints.js +9 -6
- package/dist/collection/utils/component-on-ready.js +4 -4
- package/dist/collection/utils/debounce.js +2 -1
- package/dist/collection/utils/get-focusable-children.js +2 -2
- package/dist/collection/utils/property-checkers/check-one-of.js +2 -1
- package/dist/collection/utils/property-checkers/check-pattern.js +2 -1
- package/dist/collection/utils/property-checkers/check-type.js +4 -4
- package/dist/collection/utils/property-checkers/check-url.js +2 -1
- package/dist/collection/utils/property-checkers/empty-or.js +2 -1
- package/dist/collection/utils/sass-export.js +8 -5
- package/dist/components/attribute-observer.js +4 -4
- package/dist/components/check-one-of.js +2 -1
- package/dist/components/check-type.js +4 -4
- package/dist/components/debounce.js +2 -1
- package/dist/components/fade.js +6 -2
- package/dist/components/index2.js +6 -3
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +4 -4
- package/dist/components/post-accordion2.js +3 -2
- package/dist/components/post-avatar2.js +6 -10
- package/dist/components/post-back-to-top2.js +5 -4
- package/dist/components/post-banner2.js +7 -2
- package/dist/components/post-breadcrumb-item2.js +4 -4
- package/dist/components/post-breadcrumb2.js +24 -23
- package/dist/components/post-card-control2.js +44 -33
- package/dist/components/post-closebutton2.js +1 -1
- package/dist/components/post-collapsible-trigger2.js +19 -19
- package/dist/components/post-collapsible2.js +14 -8
- package/dist/components/post-footer2.js +10 -7
- package/dist/components/post-header2.js +10 -10
- package/dist/components/post-icon2.js +51 -15
- package/dist/components/post-language-option2.js +5 -1
- package/dist/components/post-language-switch2.js +2 -2
- package/dist/components/post-list-item2.js +1 -1
- package/dist/components/post-list2.js +2 -1
- package/dist/components/post-logo2.js +2 -2
- package/dist/components/post-mainnavigation2.js +7 -2
- package/dist/components/post-megadropdown-trigger2.js +6 -6
- package/dist/components/post-megadropdown2.js +15 -4
- package/dist/components/post-menu-trigger2.js +13 -12
- package/dist/components/post-menu2.js +44 -32
- package/dist/components/post-popover2.js +5 -3
- package/dist/components/post-popovercontainer2.js +10 -2
- package/dist/components/post-rating2.js +12 -2
- package/dist/components/post-tab-header2.js +2 -2
- package/dist/components/post-tab-panel2.js +1 -1
- package/dist/components/post-tabs2.js +19 -14
- package/dist/components/post-tag2.js +2 -2
- package/dist/components/post-togglebutton2.js +11 -11
- package/dist/components/post-tooltip2.js +5 -4
- package/dist/components/slide.js +4 -4
- package/dist/docs.json +3 -8
- package/dist/esm/{attribute-observer-37fa950a.js → attribute-observer-2f203993.js} +4 -4
- package/dist/esm/{check-one-of-6b3ef8eb.js → check-one-of-0d5858c0.js} +2 -1
- package/dist/esm/{check-type-8828dbe4.js → check-type-a6ccc9a3.js} +4 -4
- package/dist/esm/{check-url-a974431e.js → check-url-0bd876f7.js} +2 -1
- package/dist/esm/{debounce-abe98cc2.js → debounce-e54c7131.js} +2 -1
- package/dist/esm/fade-1f3cacf4.js +11 -0
- package/dist/esm/{index-b49c9904.js → index-d1bbbd88.js} +7 -5
- package/dist/esm/index.js +27 -27
- package/dist/esm/package-495dba42.js +3 -0
- package/dist/esm/{post-accordion-ca48eb18.js → post-accordion-48eb17c3.js} +6 -5
- package/dist/esm/{post-accordion-item-a461f2a7.js → post-accordion-item-e0893bb3.js} +7 -7
- package/dist/esm/post-accordion-item.entry.js +6 -6
- package/dist/esm/post-accordion.entry.js +3 -3
- package/dist/esm/{post-avatar-0da1a2e8.js → post-avatar-20cde806.js} +8 -12
- package/dist/esm/post-avatar.entry.js +2 -2
- package/dist/esm/{post-back-to-top-77471a90.js → post-back-to-top-e422c426.js} +9 -8
- package/dist/esm/post-back-to-top.entry.js +4 -4
- package/dist/esm/{post-banner-b0af5bd3.js → post-banner-7385397e.js} +12 -7
- package/dist/esm/post-banner.entry.js +7 -7
- package/dist/esm/{post-breadcrumb-85ffd02f.js → post-breadcrumb-39203792.js} +28 -27
- package/dist/esm/post-breadcrumb-item_2.entry.js +6 -6
- package/dist/esm/post-breadcrumb.entry.js +4 -4
- package/dist/esm/post-card-control-d2c25c96.js +281 -0
- package/dist/esm/post-card-control.entry.js +3 -3
- package/dist/esm/post-closebutton_15.entry.js +7 -7
- package/dist/esm/{post-collapsible-trigger-883db3bf.js → post-collapsible-trigger-2f9ad9a5.js} +38 -32
- package/dist/esm/post-collapsible_2.entry.js +7 -7
- package/dist/esm/{post-footer-7b0eb067.js → post-footer-e804a967.js} +12 -9
- package/dist/esm/post-footer.entry.js +2 -2
- package/dist/esm/{post-menu-item-37f637a3.js → post-menu-item-f9793958.js} +7 -7
- package/dist/esm/{post-popover-c24ecd38.js → post-popover-8205412a.js} +8 -6
- package/dist/esm/post-popover.entry.js +3 -3
- package/dist/esm/{post-rating-e1c66e5c.js → post-rating-95ecb434.js} +14 -4
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/post-tab-header-d520b99a.js +31 -0
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-73b56a16.js → post-tab-panel-8c8d2332.js} +3 -3
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-02e523b8.js → post-tabs-dd6dfe43.js} +22 -17
- package/dist/esm/post-tabs.entry.js +3 -3
- package/dist/esm/{post-tag-43aba068.js → post-tag-593813a4.js} +4 -4
- package/dist/esm/post-tag.entry.js +2 -2
- package/dist/esm/{post-togglebutton-c2231709.js → post-togglebutton-120df903.js} +185 -107
- package/dist/esm/{post-tooltip-8271950c.js → post-tooltip-a13d6fbb.js} +9 -8
- package/dist/esm/post-tooltip.entry.js +7 -7
- package/dist/esm/{slide-3422b8a3.js → slide-62768431.js} +4 -4
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-0b613350.js +1 -0
- package/dist/post-components/p-1fda117c.js +1 -0
- package/dist/post-components/p-20e1b680.js +1 -0
- package/dist/post-components/p-29bc8ddc.entry.js +1 -0
- package/dist/post-components/p-2b4c7ec7.entry.js +1 -0
- package/dist/post-components/p-2f327006.entry.js +1 -0
- package/dist/post-components/p-3632ace7.js +1 -0
- package/dist/post-components/p-3a978ea9.entry.js +1 -0
- package/dist/post-components/{p-33b64e0c.js → p-3d4fdde0.js} +1 -1
- package/dist/post-components/p-427132e3.entry.js +1 -0
- package/dist/post-components/p-445dfa96.js +1 -0
- package/dist/post-components/p-4af6dbed.js +1 -0
- package/dist/post-components/p-4c0c13a9.js +1 -0
- package/dist/post-components/{p-e2f886ab.js → p-4fc83a1c.js} +2 -2
- package/dist/post-components/p-5384e6f4.js +1 -0
- package/dist/post-components/p-5630677a.entry.js +1 -0
- package/dist/post-components/p-5e5ee06d.entry.js +1 -0
- package/dist/post-components/p-64e3de38.js +1 -0
- package/dist/post-components/p-68c43ef0.entry.js +1 -0
- package/dist/post-components/p-6e39bb59.entry.js +1 -0
- package/dist/post-components/p-6fede961.js +1 -0
- package/dist/post-components/p-72a5ee9b.js +1 -0
- package/dist/post-components/p-72d9d594.entry.js +1 -0
- package/dist/post-components/p-85bf673e.entry.js +1 -0
- package/dist/post-components/p-8decb072.entry.js +1 -0
- package/dist/post-components/p-92f8803c.entry.js +1 -0
- package/dist/post-components/p-9596c7d6.js +1 -0
- package/dist/post-components/p-9748a355.js +1 -0
- package/dist/post-components/p-975b30f5.js +1 -0
- package/dist/post-components/p-9a50697e.entry.js +1 -0
- package/dist/post-components/p-a72cb18c.js +1 -0
- package/dist/post-components/p-aaca7ca7.js +1 -0
- package/dist/post-components/p-ac2189b7.js +1 -0
- package/dist/post-components/p-afe3b28e.js +1 -0
- package/dist/post-components/p-b129c166.js +1 -0
- package/dist/post-components/p-bd49bb7e.entry.js +1 -0
- package/dist/post-components/p-c043686c.entry.js +1 -0
- package/dist/post-components/p-c8544b65.js +1 -0
- package/dist/post-components/p-c9f65844.entry.js +1 -0
- package/dist/post-components/{p-c510d968.entry.js → p-d6449a93.entry.js} +1 -1
- package/dist/post-components/p-f7c5b0c2.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/animations/collapse.d.ts +2 -2
- package/dist/types/animations/fade.d.ts +2 -2
- package/dist/types/animations/slide.d.ts +2 -2
- package/dist/types/components/post-icon/post-icon.d.ts +1 -1
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
- package/dist/types/utils/attribute-observer.d.ts +1 -1
- package/dist/types/utils/component-on-ready.d.ts +1 -1
- package/dist/types/utils/get-focusable-children.d.ts +1 -1
- package/dist/types/utils/sass-export.d.ts +5 -1
- package/loaders/attribute-observer.js +4 -4
- package/loaders/check-one-of.js +2 -1
- package/loaders/check-type.js +4 -4
- package/loaders/debounce.js +2 -1
- package/loaders/fade.js +6 -2
- package/loaders/index2.js +6 -3
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +4 -4
- package/loaders/post-accordion.js +3 -2
- package/loaders/post-avatar.js +6 -10
- package/loaders/post-back-to-top.js +5 -4
- package/loaders/post-banner.js +7 -2
- package/loaders/post-breadcrumb-item2.js +4 -4
- package/loaders/post-breadcrumb.js +24 -23
- package/loaders/post-card-control.js +44 -33
- package/loaders/post-closebutton.js +1 -1
- package/loaders/post-collapsible-trigger2.js +19 -19
- package/loaders/post-collapsible2.js +14 -8
- package/loaders/post-footer.js +10 -7
- package/loaders/post-header.js +10 -10
- package/loaders/post-icon2.js +51 -15
- package/loaders/post-language-option.js +5 -1
- package/loaders/post-language-switch.js +2 -2
- package/loaders/post-list-item.js +1 -1
- package/loaders/post-list.js +2 -1
- package/loaders/post-logo.js +2 -2
- package/loaders/post-mainnavigation.js +7 -2
- package/loaders/post-megadropdown-trigger.js +6 -6
- package/loaders/post-megadropdown.js +15 -4
- package/loaders/post-menu-trigger2.js +13 -12
- package/loaders/post-menu2.js +44 -32
- package/loaders/post-popover.js +5 -3
- package/loaders/post-popovercontainer2.js +10 -2
- package/loaders/post-rating.js +12 -2
- package/loaders/post-tab-header.js +2 -2
- package/loaders/post-tab-panel.js +1 -1
- package/loaders/post-tabs.js +19 -14
- package/loaders/post-tag.js +2 -2
- package/loaders/post-togglebutton.js +11 -11
- package/loaders/post-tooltip.js +5 -4
- package/loaders/slide.js +4 -4
- package/package.json +13 -9
- package/dist/cjs/fade-35a3633a.js +0 -10
- package/dist/cjs/post-card-control-332f6f1f.js +0 -272
- package/dist/cjs/post-tab-header-1f057694.js +0 -33
- package/dist/esm/fade-7fd71785.js +0 -7
- package/dist/esm/package-f8f7bb40.js +0 -3
- package/dist/esm/post-card-control-3225eb57.js +0 -270
- package/dist/esm/post-tab-header-6a9b0153.js +0 -31
- package/dist/post-components/p-025688e5.js +0 -1
- package/dist/post-components/p-08b51b35.entry.js +0 -1
- package/dist/post-components/p-24c92608.js +0 -1
- package/dist/post-components/p-25a57971.js +0 -1
- package/dist/post-components/p-2737eaf5.js +0 -1
- package/dist/post-components/p-2cb4a8f1.js +0 -1
- package/dist/post-components/p-34d70cd5.js +0 -1
- package/dist/post-components/p-350f3900.entry.js +0 -1
- package/dist/post-components/p-35bc4554.js +0 -1
- package/dist/post-components/p-38b259a4.entry.js +0 -1
- package/dist/post-components/p-3c6cef1e.entry.js +0 -1
- package/dist/post-components/p-4a713cf8.js +0 -1
- package/dist/post-components/p-4b5e2b24.js +0 -1
- package/dist/post-components/p-515e0f96.js +0 -1
- package/dist/post-components/p-5467b223.js +0 -1
- package/dist/post-components/p-54e58fc2.entry.js +0 -1
- package/dist/post-components/p-637759d6.js +0 -1
- package/dist/post-components/p-6adeaa6c.js +0 -1
- package/dist/post-components/p-7589a19f.js +0 -1
- package/dist/post-components/p-7cce7342.entry.js +0 -1
- package/dist/post-components/p-819e19de.js +0 -1
- package/dist/post-components/p-82d48128.js +0 -1
- package/dist/post-components/p-85171893.entry.js +0 -1
- package/dist/post-components/p-882fdd0c.entry.js +0 -1
- package/dist/post-components/p-94399c69.js +0 -1
- package/dist/post-components/p-9a02b162.entry.js +0 -1
- package/dist/post-components/p-b1f5bc26.js +0 -1
- package/dist/post-components/p-b2f239a1.entry.js +0 -1
- package/dist/post-components/p-b571e5c8.js +0 -1
- package/dist/post-components/p-ba530822.js +0 -1
- package/dist/post-components/p-bae1c85f.entry.js +0 -1
- package/dist/post-components/p-bdabdec5.js +0 -1
- package/dist/post-components/p-c1225174.entry.js +0 -1
- package/dist/post-components/p-c372a141.entry.js +0 -1
- package/dist/post-components/p-c87c5d59.entry.js +0 -1
- package/dist/post-components/p-d04c1b7f.entry.js +0 -1
- package/dist/post-components/p-da300843.entry.js +0 -1
- package/dist/post-components/p-fec04a15.entry.js +0 -1
- /package/dist/post-components/{p-4a3f67ab.js → p-8562c7dc.js} +0 -0
- /package/dist/post-components/{p-611b3c41.js → p-bacd3e2c.js} +0 -0
- /package/dist/post-components/{p-b22656b1.js → p-cb9ab938.js} +0 -0
- /package/dist/post-components/{p-d4f93f2b.js → p-e1baac59.js} +0 -0
|
@@ -10,20 +10,16 @@ const PostMenuTrigger = /*@__PURE__*/ proxyCustomElement(class PostMenuTrigger e
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
12
12
|
this.__registerHost();
|
|
13
|
-
/**
|
|
14
|
-
* Reference to the slotted button within the trigger, if present.
|
|
15
|
-
* Used to manage click and key events for menu control.
|
|
16
|
-
*/
|
|
17
|
-
this.slottedButton = null;
|
|
18
|
-
this.handleKeyDown = (e) => {
|
|
19
|
-
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
20
|
-
e.preventDefault();
|
|
21
|
-
this.handleToggle();
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
13
|
this.for = undefined;
|
|
25
14
|
this.ariaExpanded = false;
|
|
26
15
|
}
|
|
16
|
+
get host() { return this; }
|
|
17
|
+
/**
|
|
18
|
+
* Reference to the slotted button within the trigger, if present.
|
|
19
|
+
* Used to manage click and key events for menu control.
|
|
20
|
+
*/
|
|
21
|
+
slottedButton = null;
|
|
22
|
+
root;
|
|
27
23
|
/**
|
|
28
24
|
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
29
25
|
* @param forValue - The new value of the `for` property.
|
|
@@ -46,6 +42,12 @@ const PostMenuTrigger = /*@__PURE__*/ proxyCustomElement(class PostMenuTrigger e
|
|
|
46
42
|
console.warn(`No post-menu found with ID: ${this.for}`);
|
|
47
43
|
}
|
|
48
44
|
}
|
|
45
|
+
handleKeyDown = (e) => {
|
|
46
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
this.handleToggle();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
49
51
|
componentDidLoad() {
|
|
50
52
|
this.root = getRoot(this.host);
|
|
51
53
|
this.validateControlFor();
|
|
@@ -74,7 +76,6 @@ const PostMenuTrigger = /*@__PURE__*/ proxyCustomElement(class PostMenuTrigger e
|
|
|
74
76
|
render() {
|
|
75
77
|
return (h(Host, { key: '5bdaebd0c1f46fda5804c0e8d39ab3e714b523c5', "data-version": version, "tab-index": "-1" }, h("slot", { key: 'ffee26535991d712f44cb1859a5976ec89ad772a' })));
|
|
76
78
|
}
|
|
77
|
-
get host() { return this; }
|
|
78
79
|
static get watchers() { return {
|
|
79
80
|
"for": ["validateControlFor"]
|
|
80
81
|
}; }
|
package/loaders/post-menu2.js
CHANGED
|
@@ -27,9 +27,9 @@ const focusDisablingSelector = `:where(${[
|
|
|
27
27
|
'details:not([open]) > *:not(details > summary:first-of-type) *',
|
|
28
28
|
'[tabindex^="-"]',
|
|
29
29
|
].join(',')})`;
|
|
30
|
-
|
|
30
|
+
function getFocusableChildren(element) {
|
|
31
31
|
return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
|
|
32
|
-
}
|
|
32
|
+
}
|
|
33
33
|
|
|
34
34
|
const postMenuCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}post-popovercontainer{padding:var(--post-menu-padding);background-color:var(--post-menu-bg, #ffffff);border-color:var(--post-menu-bg, #ffffff)}.popover-container{display:flex;flex-direction:column}";
|
|
35
35
|
const PostMenuStyle0 = postMenuCss;
|
|
@@ -40,36 +40,28 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
40
40
|
this.__registerHost();
|
|
41
41
|
this.__attachShadow();
|
|
42
42
|
this.toggleMenu = createEvent(this, "toggleMenu", 7);
|
|
43
|
-
this.lastFocusedElement = null;
|
|
44
|
-
this.KEYCODES = {
|
|
45
|
-
SPACE: ' ',
|
|
46
|
-
ENTER: 'Enter',
|
|
47
|
-
UP: 'ArrowUp',
|
|
48
|
-
DOWN: 'ArrowDown',
|
|
49
|
-
TAB: 'Tab',
|
|
50
|
-
HOME: 'Home',
|
|
51
|
-
END: 'End',
|
|
52
|
-
ESCAPE: 'Escape',
|
|
53
|
-
};
|
|
54
|
-
this.handleKeyDown = (e) => {
|
|
55
|
-
e.stopPropagation();
|
|
56
|
-
if (e.key === this.KEYCODES.ESCAPE) {
|
|
57
|
-
this.toggle(this.host);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (Object.values(this.KEYCODES).includes(e.key)) {
|
|
61
|
-
this.controlKeyDownHandler(e);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
this.handleClick = (e) => {
|
|
65
|
-
const target = e.target;
|
|
66
|
-
if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
|
67
|
-
this.toggle(this.host);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
43
|
this.placement = 'bottom';
|
|
71
44
|
this.isVisible = false;
|
|
72
45
|
}
|
|
46
|
+
popoverRef;
|
|
47
|
+
lastFocusedElement = null;
|
|
48
|
+
KEYCODES = {
|
|
49
|
+
SPACE: ' ',
|
|
50
|
+
ENTER: 'Enter',
|
|
51
|
+
UP: 'ArrowUp',
|
|
52
|
+
DOWN: 'ArrowDown',
|
|
53
|
+
TAB: 'Tab',
|
|
54
|
+
HOME: 'Home',
|
|
55
|
+
END: 'End',
|
|
56
|
+
ESCAPE: 'Escape',
|
|
57
|
+
};
|
|
58
|
+
get host() { return this; }
|
|
59
|
+
/**
|
|
60
|
+
* Emits when the menu is shown or hidden.
|
|
61
|
+
* The event payload is a boolean: `true` when the menu was opened, `false` when it was closed.
|
|
62
|
+
**/
|
|
63
|
+
toggleMenu;
|
|
64
|
+
root;
|
|
73
65
|
connectedCallback() {
|
|
74
66
|
this.root = getRoot(this.host);
|
|
75
67
|
this.host.addEventListener('keydown', this.handleKeyDown);
|
|
@@ -89,7 +81,12 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
89
81
|
* Toggles the menu visibility based on its current state.
|
|
90
82
|
*/
|
|
91
83
|
async toggle(target) {
|
|
92
|
-
this.isVisible
|
|
84
|
+
if (this.isVisible) {
|
|
85
|
+
await this.hide();
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
await this.show(target);
|
|
89
|
+
}
|
|
93
90
|
}
|
|
94
91
|
/**
|
|
95
92
|
* Displays the popover menu, focusing the first menu item.
|
|
@@ -123,6 +120,22 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
123
120
|
console.error('hide: popoverRef is null or undefined');
|
|
124
121
|
}
|
|
125
122
|
}
|
|
123
|
+
handleKeyDown = (e) => {
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
if (e.key === this.KEYCODES.ESCAPE) {
|
|
126
|
+
this.toggle(this.host);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (Object.values(this.KEYCODES).includes(e.key)) {
|
|
130
|
+
this.controlKeyDownHandler(e);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
handleClick = (e) => {
|
|
134
|
+
const target = e.target;
|
|
135
|
+
if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
|
|
136
|
+
this.toggle(this.host);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
126
139
|
controlKeyDownHandler(e) {
|
|
127
140
|
const menuItems = this.getSlottedItems();
|
|
128
141
|
if (!menuItems.length) {
|
|
@@ -171,9 +184,8 @@ const PostMenu = /*@__PURE__*/ proxyCustomElement(class PostMenu extends HTMLEle
|
|
|
171
184
|
.flatMap(el => Array.from(getFocusableChildren(el))));
|
|
172
185
|
}
|
|
173
186
|
render() {
|
|
174
|
-
return (h(Host, { key: '
|
|
187
|
+
return (h(Host, { key: '8f16d2fa03fc108a1ee5972811e6c94dc03a8142', "data-version": version }, h("post-popovercontainer", { key: '4c4df2d6de84db121b8a261be6fbdeaf617ab3e2', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '20e5335b60c1cee8d6da80f654abd32c363397b8', class: "popover-container", part: "popover-container" }, h("slot", { key: '0182cda99c5e991a8001cbc594ef4988950657c2' })))));
|
|
175
188
|
}
|
|
176
|
-
get host() { return this; }
|
|
177
189
|
static get style() { return PostMenuStyle0; }
|
|
178
190
|
}, [1, "post-menu", {
|
|
179
191
|
"placement": [1],
|
package/loaders/post-popover.js
CHANGED
|
@@ -3,7 +3,7 @@ import { v as version } from './package.js';
|
|
|
3
3
|
import { g as getAttributeObserver } from './attribute-observer.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './post-popovercontainer2.js';
|
|
5
5
|
|
|
6
|
-
const postPopoverCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:var(--post-device-border-radius-round);color:#000;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close{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}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:#000}.btn-close:disabled{color
|
|
6
|
+
const postPopoverCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.btn-close{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;border-radius:var(--post-device-border-radius-round);color:#000;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;cursor:pointer}.btn-close{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}.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;border-radius:4px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.btn-close::before{mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m16.267 16.667 6.667-6.533-.933-1.067-6.667 6.667-6.667-6.667-.933 1.067 6.667 6.533-6.667 6.667 1.067.933 6.533-6.667 6.667 6.667.933-1.067z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;content:\"\";display:block;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24)}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:#000}.btn-close:disabled{color:#999}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.btn-close{color:CanvasText;forced-color-adjust:none}.btn-close:focus,.btn-close:not(:disabled):hover,.pretend-hover.btn-close{color:Highlight}}.btn-close-white{color:#e6e6e6}.btn-close-white:focus,.btn-close-white:not(:disabled):hover,.btn-close-white.pretend-hover{color:#fff}.btn-close-white:disabled{color:#999}*{box-sizing:border-box}:host{display:block}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.popover-container{display:flex;align-items:self-start;padding:.5em;min-width:160px;max-width:280px;max-width:100%}.popover-content{padding:.5em;flex-grow:1}.btn-close{color:inherit}";
|
|
7
7
|
const PostPopoverStyle0 = postPopoverCss;
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -19,7 +19,7 @@ const globalToggleHandler = (e) => {
|
|
|
19
19
|
if (!popoverTarget || ('key' in e && e.key !== 'Enter'))
|
|
20
20
|
return;
|
|
21
21
|
const popover = document.getElementById(popoverTarget);
|
|
22
|
-
popover
|
|
22
|
+
popover?.toggle(target);
|
|
23
23
|
};
|
|
24
24
|
// Initialize a mutation observer for patching accessibility features
|
|
25
25
|
const triggerObserver = getAttributeObserver(popoverTargetAttribute, trigger => {
|
|
@@ -27,6 +27,9 @@ const triggerObserver = getAttributeObserver(popoverTargetAttribute, trigger =>
|
|
|
27
27
|
trigger.setAttribute('aria-expanded', force ? 'false' : null);
|
|
28
28
|
});
|
|
29
29
|
const PostPopover$1 = /*@__PURE__*/ proxyCustomElement(class PostPopover extends HTMLElement {
|
|
30
|
+
popoverRef;
|
|
31
|
+
localBeforeToggleHandler;
|
|
32
|
+
get host() { return this; }
|
|
30
33
|
constructor() {
|
|
31
34
|
super();
|
|
32
35
|
this.__registerHost();
|
|
@@ -98,7 +101,6 @@ const PostPopover$1 = /*@__PURE__*/ proxyCustomElement(class PostPopover extends
|
|
|
98
101
|
render() {
|
|
99
102
|
return (h(Host, { key: 'c2f53a7ac9d6bbcca8c220d9b8a5ed0dda360cf9', "data-version": version }, h("post-popovercontainer", { key: 'fa5a32cfd4263fcabed5405f2b6bb2ab0ca93c9a', arrow: this.arrow, placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '4799da001d006a47d93be1393618744a0b393841', class: "popover-container" }, h("div", { key: '7a28ea59e07591c8b835dd10157bc5e9b85793c6', class: "popover-content" }, h("slot", { key: '1ba6533577817d1fc2b7762654b5639596b16422' })), h("button", { key: 'f1446964325e49b79bc0fe26a05bb4f12a140c61', class: "btn-close", onClick: () => this.hide() }, h("span", { key: 'dd056bb988df548e8cae61ba226c1d9e124bc32b', class: "visually-hidden" }, this.closeButtonCaption))))));
|
|
100
103
|
}
|
|
101
|
-
get host() { return this; }
|
|
102
104
|
static get style() { return PostPopoverStyle0; }
|
|
103
105
|
}, [1, "post-popover", {
|
|
104
106
|
"placement": [1],
|
|
@@ -2103,7 +2103,7 @@ const computePosition = (reference, floating, options) => {
|
|
|
2103
2103
|
}
|
|
2104
2104
|
`,E=null;function I(e){if(E===null)try{E=new CSSStyleSheet,E.replaceSync(C);}catch{E=!1;}if(E===!1){let t=document.createElement("style");t.textContent=C,e instanceof Document?e.head.prepend(t):e.prepend(t);}else e.adoptedStyleSheets=[E,...e.adoptedStyleSheets];}function K(){window.ToggleEvent=window.ToggleEvent||c;function e(n){return n?.includes(":popover-open")&&(n=n.replace(J,"$1.\\:popover-open")),n}f(Document.prototype,"querySelector",e),f(Document.prototype,"querySelectorAll",e),f(Element.prototype,"querySelector",e),f(Element.prototype,"querySelectorAll",e),f(Element.prototype,"matches",e),f(Element.prototype,"closest",e),f(DocumentFragment.prototype,"querySelectorAll",e),f(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let n=(this.getAttribute("popover")||"").toLowerCase();return n===""||n=="auto"?"auto":"manual"},set(n){this.setAttribute("popover",n);}},showPopover:{enumerable:!0,configurable:!0,value(){S(this);}},hidePopover:{enumerable:!0,configurable:!0,value(){m(this,!0,!0);}},togglePopover:{enumerable:!0,configurable:!0,value(n){h.get(this)==="showing"&&n===void 0||n===!1?m(this,!0,!0):(n===void 0||n===!0)&&S(this);}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(n){let s=t.call(this,n);return I(s),s}}});let o=HTMLElement.prototype.attachInternals;o&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let n=o.call(this);return n.shadowRoot&&I(n.shadowRoot),n}}});let r=new WeakMap;function i(n){Object.defineProperties(n.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(s){if(s===null)this.removeAttribute("popovertarget"),r.delete(this);else if(s instanceof Element)this.setAttribute("popovertarget",""),r.set(this,s);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let s=r.get(this);if(s&&s.isConnected)return s;if(s&&!s.isConnected)return r.delete(this),null;let u=v(this),w=this.getAttribute("popovertarget");return (u instanceof Document||u instanceof B)&&w&&u.getElementById(w)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let s=(this.getAttribute("popovertargetaction")||"").toLowerCase();return s==="show"||s==="hide"?s:"toggle"},set(s){this.setAttribute("popovertargetaction",s);}}});}i(HTMLButtonElement),i(HTMLInputElement);let l=n=>{if(!n.isTrusted)return;let s=n.composedPath()[0];if(!(s instanceof Element)||s?.shadowRoot)return;let u=v(s);if(!(u instanceof B||u instanceof Document))return;let w=s.closest("[popovertargetaction],[popovertarget]");if(w){O(w),n.preventDefault();return}},a=n=>{let s=n.key,u=n.target;!n.defaultPrevented&&u&&(s==="Escape"||s==="Esc")&&T(u.ownerDocument,!0,!0);};(n=>{n.addEventListener("click",l),n.addEventListener("keydown",a),n.addEventListener("pointerdown",x),n.addEventListener("pointerup",x);})(document),I(document);}j()||K();})();
|
|
2105
2105
|
|
|
2106
|
-
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);background:var(--post-current-palette-bg);color:var(--post-current-palette-fg);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
|
|
2106
|
+
const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);background:var(--post-current-palette-bg);color:var(--post-current-palette-fg);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer):not(:has(.arrow)){box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12)}:where(post-popovercontainer):has(.arrow){filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top){filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left){filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right){filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
|
|
2107
2107
|
const PostPopovercontainerStyle0 = postPopovercontainerCss;
|
|
2108
2108
|
|
|
2109
2109
|
const SIDE_MAP = {
|
|
@@ -2121,6 +2121,15 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2121
2121
|
this.edgeGap = 8;
|
|
2122
2122
|
this.arrow = false;
|
|
2123
2123
|
}
|
|
2124
|
+
get host() { return this; }
|
|
2125
|
+
arrowRef;
|
|
2126
|
+
eventTarget;
|
|
2127
|
+
clearAutoUpdate;
|
|
2128
|
+
toggleTimeoutId;
|
|
2129
|
+
/**
|
|
2130
|
+
* Fires whenever the popover gets shown or hidden, passing the new state in event.details as a boolean
|
|
2131
|
+
*/
|
|
2132
|
+
postToggle;
|
|
2124
2133
|
componentDidLoad() {
|
|
2125
2134
|
this.host.setAttribute('popover', '');
|
|
2126
2135
|
this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
|
|
@@ -2244,7 +2253,6 @@ const PostPopovercontainer = /*@__PURE__*/ proxyCustomElement(class PostPopoverc
|
|
|
2244
2253
|
this.arrowRef = el;
|
|
2245
2254
|
} })), h("slot", { key: '61dd3072a5217099028e3dd4b22fa845ea2f5970' })));
|
|
2246
2255
|
}
|
|
2247
|
-
get host() { return this; }
|
|
2248
2256
|
static get style() { return PostPopovercontainerStyle0; }
|
|
2249
2257
|
}, [4, "post-popovercontainer", {
|
|
2250
2258
|
"placement": [1],
|
package/loaders/post-rating.js
CHANGED
|
@@ -6,13 +6,24 @@ const postRatingCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technol
|
|
|
6
6
|
const PostRatingStyle0 = postRatingCss;
|
|
7
7
|
|
|
8
8
|
const PostRating$1 = /*@__PURE__*/ proxyCustomElement(class PostRating extends HTMLElement {
|
|
9
|
+
hasChanged = false;
|
|
10
|
+
get host() { return this; }
|
|
11
|
+
/**
|
|
12
|
+
* An event emitted whenever the component's value has changed (on input).
|
|
13
|
+
* The event payload can be used like so: `event.detail.value`.
|
|
14
|
+
*/
|
|
15
|
+
postInput;
|
|
16
|
+
/**
|
|
17
|
+
* An event emitted whenever the component's value has changed (on blur).
|
|
18
|
+
* The event payload can be used like so: `event.detail.value`.
|
|
19
|
+
*/
|
|
20
|
+
postChange;
|
|
9
21
|
constructor() {
|
|
10
22
|
super();
|
|
11
23
|
this.__registerHost();
|
|
12
24
|
this.__attachShadow();
|
|
13
25
|
this.postInput = createEvent(this, "postInput", 7);
|
|
14
26
|
this.postChange = createEvent(this, "postChange", 7);
|
|
15
|
-
this.hasChanged = false;
|
|
16
27
|
this.hoveredIndex = undefined;
|
|
17
28
|
this.label = 'Rating';
|
|
18
29
|
this.stars = 5;
|
|
@@ -82,7 +93,6 @@ const PostRating$1 = /*@__PURE__*/ proxyCustomElement(class PostRating extends H
|
|
|
82
93
|
'after-active': i > this.hoveredIndex && i < this.currentRating,
|
|
83
94
|
}, onClick: () => this.update(i + 1), onMouseEnter: e => this.hoverHandler(i, e), onMouseLeave: e => this.hoverHandler(i, e) }, h("post-icon", { name: "2062", class: "stroke" }), h("post-icon", { name: "2574", class: "fill" })))))));
|
|
84
95
|
}
|
|
85
|
-
get host() { return this; }
|
|
86
96
|
static get style() { return PostRatingStyle0; }
|
|
87
97
|
}, [1, "post-rating", {
|
|
88
98
|
"label": [1],
|
|
@@ -3,7 +3,7 @@ import { v as version } from './package.js';
|
|
|
3
3
|
import { c as checkNonEmpty } from './check-non-empty.js';
|
|
4
4
|
import { n as nanoid } from './index.browser.js';
|
|
5
5
|
|
|
6
|
-
const postTabHeaderCss = ".tab-title[role=tab]{display:inline-block;cursor:pointer;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color
|
|
6
|
+
const postTabHeaderCss = ".tab-title[role=tab]{display:inline-block;cursor:pointer;position:relative;box-sizing:border-box;padding:1rem;transition:background-color 100ms;border-right:1px solid rgba(0,0,0,0);border-left:1px solid rgba(0,0,0,0);outline-color:currentColor;opacity:.7;color:#000;text-decoration:none;background-color:rgba(0,0,0,0)}.tab-title[role=tab]:focus{background-color:unset;color:#000}.tab-title[role=tab]:hover{opacity:1;background-color:rgba(0,0,0,.6);color:#fff}.tab-title[role=tab]:focus-visible{outline:rgba(0,0,0,0);opacity:1;background-color:rgba(0,0,0,.6);color:#fff;box-shadow:none}.tab-title[role=tab]:focus-visible::after{content:\"\";display:block;position:absolute;top:2px;right:1px;bottom:0;left:1px;box-shadow:0 0 0 1px #fff,0 0 0 2px #333}.tab-title[role=tab].active{z-index:1;border-right-color:#ccc;border-left-color:#ccc;opacity:1;background-color:#fff;color:#000;font-weight:700}.tab-title[role=tab].active::before{content:\"\";display:block;position:absolute;top:0;right:-1px;left:-1px;height:var(--post-core-dimension-4);background-color:#fc0}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:hover{background-color:rgba(255,255,255,.2)}:where(.bg-dark,.bg-black,.bg-primary,.bg-secondary,.bg-success,.bg-error) .tab-title[role=tab]:focus-visible{background-color:rgba(255,255,255,.2)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tab-title[role=tab]{opacity:1;border-left-color:Canvas;border-right-color:Canvas;color:LinkText}.tab-title[role=tab]:hover,.tab-title[role=tab]:focus,.tab-title[role=tab]:focus-within,.tab-title[role=tab]:focus-visible{outline:var(--post-core-dimension-2) solid Highlight;outline-offset:calc(var(--post-core-dimension-4)*-1)}.tab-title[role=tab].active{border-left-color:ButtonText;border-right-color:ButtonText;color:Highlight}.tab-title[role=tab].active::before{background-color:Highlight}}/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}.tab-title{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button}";
|
|
7
7
|
const PostTabHeaderStyle0 = postTabHeaderCss;
|
|
8
8
|
|
|
9
9
|
const PostTabHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostTabHeader extends HTMLElement {
|
|
@@ -14,6 +14,7 @@ const PostTabHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostTabHeader ext
|
|
|
14
14
|
this.tabId = undefined;
|
|
15
15
|
this.panel = undefined;
|
|
16
16
|
}
|
|
17
|
+
get host() { return this; }
|
|
17
18
|
validateFor(newValue) {
|
|
18
19
|
checkNonEmpty(newValue, 'The "panel" prop is required for the post-tab-header.');
|
|
19
20
|
}
|
|
@@ -23,7 +24,6 @@ const PostTabHeader$1 = /*@__PURE__*/ proxyCustomElement(class PostTabHeader ext
|
|
|
23
24
|
render() {
|
|
24
25
|
return (h(Host, { key: '9b12878498f63da83113c081f81a749b4ee47ef4', id: this.tabId, role: "tab", "data-version": version, "aria-selected": "false", tabindex: "-1", class: "tab-title", slot: "tabs" }, h("slot", { key: '3a2e7f3657110d707b49af911e9dd3a4ef323e36' })));
|
|
25
26
|
}
|
|
26
|
-
get host() { return this; }
|
|
27
27
|
static get watchers() { return {
|
|
28
28
|
"panel": ["validateFor"]
|
|
29
29
|
}; }
|
|
@@ -13,6 +13,7 @@ const PostTabPanel$1 = /*@__PURE__*/ proxyCustomElement(class PostTabPanel exten
|
|
|
13
13
|
this.panelId = undefined;
|
|
14
14
|
this.name = undefined;
|
|
15
15
|
}
|
|
16
|
+
get host() { return this; }
|
|
16
17
|
componentWillLoad() {
|
|
17
18
|
// get the id set on the host element or use a random id by default
|
|
18
19
|
this.panelId = `panel-${this.host.id || nanoid(6)}`;
|
|
@@ -20,7 +21,6 @@ const PostTabPanel$1 = /*@__PURE__*/ proxyCustomElement(class PostTabPanel exten
|
|
|
20
21
|
render() {
|
|
21
22
|
return (h(Host, { key: '9e8f9c5dc0c1c3d1b7e63cbb9e9cbb0cf116da9b', "data-version": version, id: this.panelId, role: "tabpanel" }, h("slot", { key: '3ece42346845324cfa0fb9af5721efab2b71e2f1' })));
|
|
22
23
|
}
|
|
23
|
-
get host() { return this; }
|
|
24
24
|
static get style() { return PostTabPanelStyle0; }
|
|
25
25
|
}, [1, "post-tab-panel", {
|
|
26
26
|
"name": [1],
|
package/loaders/post-tabs.js
CHANGED
|
@@ -6,7 +6,7 @@ import { f as fadeOut, a as fadeIn } from './fade.js';
|
|
|
6
6
|
* Invoke the `componentOnReady` method if it is available, simulate it otherwise
|
|
7
7
|
* @see https://stenciljs.com/docs/api#componentonready
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
function componentOnReady(el) {
|
|
10
10
|
if (typeof el.componentOnReady === 'function') {
|
|
11
11
|
return el.componentOnReady();
|
|
12
12
|
}
|
|
@@ -15,15 +15,15 @@ const componentOnReady = (el) => {
|
|
|
15
15
|
resolve(el);
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
18
|
+
}
|
|
19
|
+
function customOnReady(callback) {
|
|
20
20
|
if (typeof requestAnimationFrame === 'function') {
|
|
21
21
|
return requestAnimationFrame(callback);
|
|
22
22
|
}
|
|
23
23
|
return setTimeout(callback);
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:rgba(
|
|
26
|
+
const postTabsCss = ".tabs-wrapper{position:relative;padding-top:1rem;border:0;background-color:rgba(0,0,0,.02)}.tabs-wrapper::after{content:\"\";position:absolute;bottom:0;width:100%;height:1px;background-color:#ccc}.tabs-wrapper .tabs{background-color:rgba(0,0,0,0) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.tabs-wrapper::after{background-color:ButtonBorder}}.tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;white-space:nowrap;margin-block:0;padding-inline-start:0;list-style:none}.tabs::after{content:\"\";display:block;flex:1 0 auto;width:1rem}.tab-content{padding-top:1rem}:host{display:block}";
|
|
27
27
|
const PostTabsStyle0 = postTabsCss;
|
|
28
28
|
|
|
29
29
|
const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLElement {
|
|
@@ -32,17 +32,25 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
32
32
|
this.__registerHost();
|
|
33
33
|
this.__attachShadow();
|
|
34
34
|
this.postChange = createEvent(this, "postChange", 7);
|
|
35
|
-
this.isLoaded = false;
|
|
36
35
|
this.activePanel = undefined;
|
|
37
36
|
}
|
|
37
|
+
activeTab;
|
|
38
|
+
showing;
|
|
39
|
+
hiding;
|
|
40
|
+
isLoaded = false;
|
|
38
41
|
get tabs() {
|
|
39
42
|
return Array.from(this.host.querySelectorAll('post-tab-header')).filter(tab => tab.closest('post-tabs') === this.host);
|
|
40
43
|
}
|
|
44
|
+
get host() { return this; }
|
|
45
|
+
/**
|
|
46
|
+
* An event emitted after the active tab changes, when the fade in transition of its associated panel is finished.
|
|
47
|
+
* The payload is the name of the newly shown panel.
|
|
48
|
+
*/
|
|
49
|
+
postChange;
|
|
41
50
|
componentDidLoad() {
|
|
42
|
-
var _a;
|
|
43
51
|
this.moveMisplacedTabs();
|
|
44
52
|
this.enableTabs();
|
|
45
|
-
const initiallyActivePanel = this.activePanel ||
|
|
53
|
+
const initiallyActivePanel = this.activePanel || this.tabs[0]?.panel;
|
|
46
54
|
void this.show(initiallyActivePanel);
|
|
47
55
|
this.isLoaded = true;
|
|
48
56
|
}
|
|
@@ -51,9 +59,8 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
51
59
|
* Any other panel that was previously shown becomes hidden and its associated tab is unselected.
|
|
52
60
|
*/
|
|
53
61
|
async show(panelName) {
|
|
54
|
-
var _a;
|
|
55
62
|
// do nothing if the tab is already active
|
|
56
|
-
if (panelName ===
|
|
63
|
+
if (panelName === this.activeTab?.panel) {
|
|
57
64
|
return;
|
|
58
65
|
}
|
|
59
66
|
const previousTab = this.activeTab;
|
|
@@ -87,7 +94,6 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
87
94
|
});
|
|
88
95
|
}
|
|
89
96
|
enableTabs() {
|
|
90
|
-
var _a;
|
|
91
97
|
if (!this.tabs)
|
|
92
98
|
return;
|
|
93
99
|
this.tabs.forEach(async (tab) => {
|
|
@@ -114,7 +120,7 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
114
120
|
});
|
|
115
121
|
// if the currently active tab was removed from the DOM then select the first one
|
|
116
122
|
if (this.activeTab && !this.activeTab.isConnected) {
|
|
117
|
-
void this.show(
|
|
123
|
+
void this.show(this.tabs[0]?.panel);
|
|
118
124
|
}
|
|
119
125
|
}
|
|
120
126
|
activateTab(tab) {
|
|
@@ -166,9 +172,8 @@ const PostTabs$1 = /*@__PURE__*/ proxyCustomElement(class PostTabs extends HTMLE
|
|
|
166
172
|
nextTab.focus();
|
|
167
173
|
}
|
|
168
174
|
render() {
|
|
169
|
-
return (h(Host, { key: '
|
|
175
|
+
return (h(Host, { key: '697174a68f4eedabd9170bcad93e60539f0dc778', "data-version": version }, h("div", { key: 'ae39c8fd62edd28113dea0f013ffdd3a76bea739', class: "tabs-wrapper", part: "tabs" }, h("div", { key: 'a638044b8b6ab2d3c2d6e6b59a2e9a02fd137e0d', class: "tabs", role: "tablist" }, h("slot", { key: '2ea6eb60f7d1edcc59eea994cc2fde91c900c286', name: "tabs", onSlotchange: () => this.enableTabs() }))), h("div", { key: '6900fd1914df01fbe5901378611ed0a359bc13f6', class: "tab-content", part: "content" }, h("slot", { key: '464bb9fa7450ddd22517a0e41f692876d6e8bf5b', onSlotchange: () => this.moveMisplacedTabs() }))));
|
|
170
176
|
}
|
|
171
|
-
get host() { return this; }
|
|
172
177
|
static get style() { return PostTabsStyle0; }
|
|
173
178
|
}, [1, "post-tabs", {
|
|
174
179
|
"activePanel": [1, "active-panel"],
|
package/loaders/post-tag.js
CHANGED
|
@@ -2,10 +2,11 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './post-icon2.js';
|
|
4
4
|
|
|
5
|
-
const postTagCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.tag,.tag:where(:has(:not(pre))){--post-tag-bg:hsl(0, 0%, 90%);--post-tag-fg:#000;display:inline-flex;align-items:center;gap:var(--post-core-dimension-4);padding:0 var(--post-core-dimension-8);max-width:100%;background-color:var(--post-tag-bg);border:var(--post-core-dimension-1) solid rgba(0,0,0,0);border-radius:var(--post-core-dimension-4);font-size:1rem;line-height:calc(var(--post-core-dimension-32) - var(--post-core-dimension-1)*2);white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:var(--post-core-dimension-24)}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg:#fff;--post-tag-fg:#000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg:#fc0;--post-tag-fg:#000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg:#2c871d;--post-tag-fg:#fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg:#f49e00;--post-tag-fg:#000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg:#a51728;--post-tag-fg:#fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg:#cce4ee;--post-tag-fg:#000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color
|
|
5
|
+
const postTagCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */.tag,.tag:where(:has(:not(pre))){--post-tag-bg:hsl(0, 0%, 90%);--post-tag-fg:#000;display:inline-flex;align-items:center;gap:var(--post-core-dimension-4);padding:0 var(--post-core-dimension-8);max-width:100%;background-color:var(--post-tag-bg);border:var(--post-core-dimension-1) solid rgba(0,0,0,0);border-radius:var(--post-core-dimension-4);font-size:1rem;line-height:calc(var(--post-core-dimension-32) - var(--post-core-dimension-1)*2);white-space:nowrap;color:var(--post-tag-fg)}.tag post-icon,.tag:where(:has(:not(pre))) post-icon{flex:0 0 auto;width:1.25rem;height:1.25rem}.tag .tag-text,.tag:where(:has(:not(pre))) .tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tag .tag-text svg,.tag .tag-text img,.tag:where(:has(:not(pre))) .tag-text svg,.tag:where(:has(:not(pre))) .tag-text img{display:inline-block;height:1.25rem !important;vertical-align:text-top}.tag.tag-sm,.tag:where(:has(:not(pre))).tag-sm{line-height:var(--post-core-dimension-24)}.tag.tag-sm .tag-icon,.tag:where(:has(:not(pre))).tag-sm .tag-icon{width:1rem;height:1rem}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{--post-tag-bg:#fff;--post-tag-fg:#000}.tag.tag-yellow,.tag:where(:has(:not(pre))).tag-yellow{--post-tag-bg:#fc0;--post-tag-fg:#000}.tag.tag-success,.tag:where(:has(:not(pre))).tag-success{--post-tag-bg:#2c871d;--post-tag-fg:#fff}.tag.tag-warning,.tag:where(:has(:not(pre))).tag-warning{--post-tag-bg:#f49e00;--post-tag-fg:#000}.tag.tag-danger,.tag:where(:has(:not(pre))).tag-danger{--post-tag-bg:#a51728;--post-tag-fg:#fff}.tag.tag-info,.tag:where(:has(:not(pre))).tag-info{--post-tag-bg:#cce4ee;--post-tag-fg:#000}.tag.tag-white,.tag:where(:has(:not(pre))).tag-white{border-color:#000}pre .tag,pre .tag:where(:has(:not(pre))){display:inline;padding:initial;max-width:initial;background:initial;border:initial;border-radius:initial;font-size:inherit;line-height:inherit;white-space:unset}*,*:before,*:after{box-sizing:border-box}.tag-text ::slotted(svg),.tag-text ::slotted(img){display:inline-block !important;height:1.25rem !important;vertical-align:text-top !important}";
|
|
6
6
|
const PostTagStyle0 = postTagCss;
|
|
7
7
|
|
|
8
8
|
const PostTag$1 = /*@__PURE__*/ proxyCustomElement(class PostTag extends HTMLElement {
|
|
9
|
+
get host() { return this; }
|
|
9
10
|
constructor() {
|
|
10
11
|
super();
|
|
11
12
|
this.__registerHost();
|
|
@@ -37,7 +38,6 @@ const PostTag$1 = /*@__PURE__*/ proxyCustomElement(class PostTag extends HTMLEle
|
|
|
37
38
|
render() {
|
|
38
39
|
return (h(Host, { key: 'cda93c397ec81e289c843eaae7694bbba6f3c297', "data-version": version }, h("div", { key: '7fa71d9c0ca5393bc188e5e09107ec931943ed66', class: this.classes }, this.icon ? h("post-icon", { name: this.icon }) : null, h("div", { key: '8d36933c00910e9f36759d101f43b628c0fbf185', class: "tag-text" }, h("slot", { key: '49e2e9dd66cb85df4615c512d8dc0d7cad6606b8' })))));
|
|
39
40
|
}
|
|
40
|
-
get host() { return this; }
|
|
41
41
|
static get watchers() { return {
|
|
42
42
|
"variant": ["variantChanged"],
|
|
43
43
|
"size": ["sizeChanged"]
|
|
@@ -10,18 +10,9 @@ const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutt
|
|
|
10
10
|
super();
|
|
11
11
|
this.__registerHost();
|
|
12
12
|
this.__attachShadow();
|
|
13
|
-
this.handleClick = () => {
|
|
14
|
-
this.toggled = !this.toggled;
|
|
15
|
-
};
|
|
16
|
-
this.handleKeydown = (event) => {
|
|
17
|
-
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
18
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
19
|
-
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
20
|
-
this.host.click();
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
13
|
this.toggled = false;
|
|
24
14
|
}
|
|
15
|
+
get host() { return this; }
|
|
25
16
|
validateToggled(value = this.toggled) {
|
|
26
17
|
checkType(value, 'boolean', 'The "toggled" property of the post-togglebutton must be a boolean.');
|
|
27
18
|
}
|
|
@@ -31,10 +22,19 @@ const PostTogglebutton$1 = /*@__PURE__*/ proxyCustomElement(class PostTogglebutt
|
|
|
31
22
|
this.host.addEventListener('click', () => this.handleClick());
|
|
32
23
|
this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
|
|
33
24
|
}
|
|
25
|
+
handleClick = () => {
|
|
26
|
+
this.toggled = !this.toggled;
|
|
27
|
+
};
|
|
28
|
+
handleKeydown = (event) => {
|
|
29
|
+
// perform a click when enter or spaced are pressed to mimic the button behavior
|
|
30
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
31
|
+
event.preventDefault(); // prevents the page from scrolling when space is pressed
|
|
32
|
+
this.host.click();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
34
35
|
render() {
|
|
35
36
|
return (h(Host, { key: '461f72ebada75a99921b7a166f67f2547aa6465e', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: 'cd5f4cc4df687cceacb3ea6c125b7b62f01b2712' })));
|
|
36
37
|
}
|
|
37
|
-
get host() { return this; }
|
|
38
38
|
static get watchers() { return {
|
|
39
39
|
"toggled": ["validateToggled"]
|
|
40
40
|
}; }
|
package/loaders/post-tooltip.js
CHANGED
|
@@ -4812,7 +4812,7 @@ const globalInterestHandler = (e) => {
|
|
|
4812
4812
|
const tooltip = document.getElementById(tooltipTarget);
|
|
4813
4813
|
// Determine if the tooltip was triggered by a focus event
|
|
4814
4814
|
const triggeredByFocus = e.type === 'focusin';
|
|
4815
|
-
void
|
|
4815
|
+
void tooltip?.show(targetElement, triggeredByFocus);
|
|
4816
4816
|
if (hideTooltipTimeout) {
|
|
4817
4817
|
window.clearTimeout(hideTooltipTimeout);
|
|
4818
4818
|
hideTooltipTimeout = null;
|
|
@@ -4853,7 +4853,7 @@ const patchAccessibilityFeatures = (trigger) => {
|
|
|
4853
4853
|
const describedBy = trigger.getAttribute('aria-describedby');
|
|
4854
4854
|
const id = trigger.getAttribute(tooltipTargetAttribute);
|
|
4855
4855
|
// Add tooltip to aria-describedby
|
|
4856
|
-
if (!
|
|
4856
|
+
if (!describedBy?.includes(id)) {
|
|
4857
4857
|
const newDescribedBy = describedBy ? `${describedBy} ${id}` : id;
|
|
4858
4858
|
trigger.setAttribute('aria-describedby', newDescribedBy);
|
|
4859
4859
|
}
|
|
@@ -4869,11 +4869,13 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
4869
4869
|
super();
|
|
4870
4870
|
this.__registerHost();
|
|
4871
4871
|
this.__attachShadow();
|
|
4872
|
-
this.wasOpenedByFocus = false;
|
|
4873
4872
|
this.placement = 'top';
|
|
4874
4873
|
this.arrow = true;
|
|
4875
4874
|
this.delayed = false;
|
|
4876
4875
|
}
|
|
4876
|
+
popoverRef;
|
|
4877
|
+
wasOpenedByFocus = false;
|
|
4878
|
+
get host() { return this; }
|
|
4877
4879
|
validateDelayed() {
|
|
4878
4880
|
checkEmptyOrType(this.delayed, 'boolean', 'The post-tooltip "delayed" property should be a boolean.');
|
|
4879
4881
|
}
|
|
@@ -4991,7 +4993,6 @@ const PostTooltip$1 = /*@__PURE__*/ proxyCustomElement(class PostTooltip extends
|
|
|
4991
4993
|
const popoverClass = `${this.arrow ? ' has-arrow' : ''}`;
|
|
4992
4994
|
return (h(Host, { key: '492f3f8b1b323417304ffba6c93f277c18f5b3d8', "data-version": version$1, role: "tooltip", onPointerOver: this.handleInterest, onPointerOut: this.handleInterestLost, onFocusIn: this.handleInterest, onFocusOut: this.handleInterestLost }, h("post-popovercontainer", { key: '1b25c36c8351f0471e9acdf1fdf3073fa59683da', class: popoverClass, arrow: this.arrow, placement: this.placement, ref: (el) => (this.popoverRef = el) }, h("slot", { key: '0c1f7d6c81e214155976d1fb6151ec0f97724724' }))));
|
|
4993
4995
|
}
|
|
4994
|
-
get host() { return this; }
|
|
4995
4996
|
static get watchers() { return {
|
|
4996
4997
|
"delayed": ["validateDelayed"]
|
|
4997
4998
|
}; }
|
package/loaders/slide.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const easing = 'ease';
|
|
2
2
|
const duration = 500;
|
|
3
3
|
const fill = 'forwards';
|
|
4
|
-
|
|
4
|
+
function slideUp(el, translateSize = '100%') {
|
|
5
5
|
return el.animate([
|
|
6
6
|
{ transform: `translateY(${translateSize})` }, // Starting position (no translation)
|
|
7
7
|
{ transform: 'translateY(0)' }, // End position
|
|
@@ -10,8 +10,8 @@ const slideUp = (el, translateSize = '100%') => {
|
|
|
10
10
|
easing,
|
|
11
11
|
fill,
|
|
12
12
|
});
|
|
13
|
-
}
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
function slideDown(el, translateSize = '100%') {
|
|
15
15
|
return el.animate([
|
|
16
16
|
{ transform: 'translateY(0)' }, // Starting position (no translation)
|
|
17
17
|
{ transform: `translateY(${translateSize})` }, // End position
|
|
@@ -20,6 +20,6 @@ const slideDown = (el, translateSize = '100%') => {
|
|
|
20
20
|
easing,
|
|
21
21
|
fill,
|
|
22
22
|
});
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
25
|
export { slideDown as a, slideUp as s };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisspost/design-system-components",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.13",
|
|
4
4
|
"description": "A collection of web components built with Stencil JS for the Swiss Post Design System.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -26,36 +26,39 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@floating-ui/dom": "1.6.13",
|
|
28
28
|
"@oddbird/popover-polyfill": "0.3.7",
|
|
29
|
-
"@swisspost/design-system-icons": "9.0.0-next.
|
|
30
|
-
"@swisspost/design-system-styles": "9.0.0-next.
|
|
29
|
+
"@swisspost/design-system-icons": "9.0.0-next.13",
|
|
30
|
+
"@swisspost/design-system-styles": "9.0.0-next.13",
|
|
31
31
|
"ally.js": "1.4.1",
|
|
32
32
|
"long-press-event": "2.5.0",
|
|
33
33
|
"nanoid": "5.0.9"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
+
"@eslint/compat": "1.2.5",
|
|
37
|
+
"@eslint/js": "9.18.0",
|
|
36
38
|
"@percy/cli": "1.30.6",
|
|
37
39
|
"@percy/cypress": "3.1.2",
|
|
38
|
-
"@stencil-community/eslint-plugin": "0.
|
|
40
|
+
"@stencil-community/eslint-plugin": "0.9.0",
|
|
39
41
|
"@stencil/angular-output-target": "0.8.4",
|
|
40
42
|
"@stencil/core": "4.19.2",
|
|
41
43
|
"@stencil/react-output-target": "0.5.3",
|
|
42
44
|
"@stencil/sass": "3.0.12",
|
|
43
45
|
"@types/jest": "29.5.14",
|
|
44
46
|
"@types/node": "22.10.5",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
46
47
|
"@typescript-eslint/parser": "7.18.0",
|
|
47
48
|
"bootstrap": "5.3.3",
|
|
48
49
|
"cypress": "13.13.2",
|
|
49
50
|
"cypress-axe": "1.5.0",
|
|
50
51
|
"cypress-storybook": "1.0.0",
|
|
51
|
-
"eslint": "
|
|
52
|
-
"eslint-plugin-react": "7.37.
|
|
52
|
+
"eslint": "9.18.0",
|
|
53
|
+
"eslint-plugin-react": "7.37.4",
|
|
54
|
+
"globals": "15.14.0",
|
|
53
55
|
"rimraf": "6.0.1",
|
|
54
56
|
"rollup-plugin-postcss": "4.0.2",
|
|
55
57
|
"sass": "1.78.0",
|
|
56
58
|
"throttle-debounce": "5.0.2",
|
|
57
59
|
"ts-jest": "29.2.5",
|
|
58
|
-
"typescript": "5.5.4"
|
|
60
|
+
"typescript": "5.5.4",
|
|
61
|
+
"typescript-eslint": "8.20.0"
|
|
59
62
|
},
|
|
60
63
|
"keywords": [
|
|
61
64
|
"components",
|
|
@@ -77,6 +80,7 @@
|
|
|
77
80
|
"e2e:ci": "xvfb-run -a cypress run --browser chrome",
|
|
78
81
|
"e2e:watch": "cypress open",
|
|
79
82
|
"generate": "stencil generate",
|
|
80
|
-
"lint": "eslint
|
|
83
|
+
"lint": "eslint",
|
|
84
|
+
"lint:fix": "eslint --fix"
|
|
81
85
|
}
|
|
82
86
|
}
|