@swisspost/design-system-components 9.0.0 → 10.0.0-next.37
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/breakpoints-cdf1b747.js +59 -0
- package/dist/cjs/check-non-empty-bd99d236.js +15 -0
- package/dist/cjs/check-one-of-75d270b5.js +13 -0
- package/dist/cjs/check-type-cdbf6d29.js +21 -0
- package/dist/cjs/check-url-220a286c.js +19 -0
- package/dist/cjs/event-guard-efabc84f.js +47 -0
- package/dist/cjs/fade-72d5ef55.js +14 -0
- package/dist/cjs/get-root-8102fecd.js +17 -0
- package/dist/cjs/index-23e36ff7.js +37 -0
- package/dist/cjs/{index-e1f32cce.js → index-b60129c4.js} +35 -15
- package/dist/cjs/index.browser-4af21c17.js +16 -0
- package/dist/cjs/index.cjs.js +57 -28
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/long-press-event-6e62d113.js +266 -0
- package/dist/cjs/{package-3ed88bb9.js → package-8121f093.js} +1 -1
- package/dist/cjs/{post-accordion-9ef382e8.js → post-accordion-beac7c9f.js} +11 -12
- package/dist/cjs/post-accordion-item-4846fbee.js +64 -0
- package/dist/cjs/post-accordion-item.cjs.entry.js +10 -6
- package/dist/cjs/post-accordion.cjs.entry.js +6 -4
- package/dist/cjs/post-avatar-a36991fb.js +145 -0
- package/dist/cjs/post-avatar.cjs.entry.js +14 -0
- package/dist/cjs/post-back-to-top-32aa9017.js +96 -0
- package/dist/cjs/post-back-to-top.cjs.entry.js +16 -0
- package/dist/cjs/post-banner-be0e8909.js +92 -0
- package/dist/cjs/post-banner.cjs.entry.js +20 -0
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +18 -0
- package/dist/cjs/post-breadcrumbs-6ef82a41.js +120 -0
- package/dist/cjs/post-breadcrumbs.cjs.entry.js +13 -0
- package/dist/cjs/post-card-control-fe919333.js +269 -0
- package/dist/cjs/post-card-control.cjs.entry.js +6 -5
- package/dist/cjs/post-closebutton_15.cjs.entry.js +36 -0
- package/dist/cjs/{post-collapsible-trigger-1764e6dc.js → post-collapsible-trigger-f42be607.js} +62 -76
- package/dist/cjs/post-collapsible_2.cjs.entry.js +11 -7
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/post-footer-5179aa17.js +38 -0
- package/dist/cjs/post-footer.cjs.entry.js +12 -0
- package/dist/cjs/post-linkarea-27125078.js +30 -0
- package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
- package/dist/cjs/post-menu-item-d78a9121.js +68 -0
- package/dist/cjs/post-popover-feb1e773.js +135 -0
- package/dist/cjs/post-popover.cjs.entry.js +4 -3
- package/dist/cjs/{post-rating-d5073d8d.js → post-rating-6d153a2c.js} +4 -4
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/post-tab-header-e4532918.js +34 -0
- package/dist/cjs/post-tab-header.cjs.entry.js +6 -4
- package/dist/cjs/{post-tab-panel-97b79ecd.js → post-tab-panel-40df21ad.js} +5 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +4 -3
- package/dist/cjs/{post-tabs-834497f2.js → post-tabs-45db2696.js} +14 -16
- package/dist/cjs/post-tabs.cjs.entry.js +5 -4
- package/dist/cjs/post-tag-0967bb1e.js +47 -0
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/post-togglebutton-42b7d166.js +4494 -0
- package/dist/cjs/{post-tooltip-20ebe011.js → post-tooltip-f833d51d.js} +10 -6
- package/dist/cjs/{post-tooltip-trigger-6f4c9748.js → post-tooltip-trigger-3ceac010.js} +17 -280
- package/dist/cjs/post-tooltip-trigger.cjs.entry.js +5 -4
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
- package/dist/cjs/slide-cd1f09b3.js +28 -0
- package/dist/collection/animations/collapse.js +8 -6
- package/dist/collection/animations/fade.js +6 -2
- package/dist/collection/animations/slide.js +23 -0
- package/dist/collection/collection-manifest.json +22 -3
- package/dist/collection/components/post-accordion/post-accordion.css +1 -1
- package/dist/collection/components/post-accordion/post-accordion.js +8 -10
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +30 -16
- package/dist/collection/components/post-avatar/post-avatar.css +1 -0
- package/dist/collection/components/post-avatar/post-avatar.js +233 -0
- package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -0
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +127 -0
- package/dist/collection/components/post-banner/banner-types.js +1 -0
- package/dist/collection/components/post-banner/post-banner.css +1 -0
- package/dist/collection/components/{post-alert/post-alert.js → post-banner/post-banner.js} +44 -72
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -0
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +96 -0
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.css +1 -0
- package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +160 -0
- package/dist/collection/components/post-card-control/post-card-control.css +1 -31
- package/dist/collection/components/post-card-control/post-card-control.js +20 -24
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -0
- package/dist/collection/components/post-closebutton/post-closebutton.js +23 -0
- package/dist/collection/components/post-collapsible/post-collapsible.css +1 -1
- package/dist/collection/components/post-collapsible/post-collapsible.js +6 -3
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +43 -45
- package/dist/collection/components/post-footer/post-footer.css +1 -0
- package/dist/collection/components/post-footer/post-footer.js +75 -0
- package/dist/collection/components/post-header/post-header.css +1 -0
- package/dist/collection/components/post-header/post-header.js +320 -0
- package/dist/collection/components/post-icon/post-icon.js +58 -55
- package/dist/collection/components/post-language-option/post-language-option.css +1 -0
- package/dist/collection/components/post-language-option/post-language-option.js +237 -0
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -0
- package/dist/collection/components/post-language-switch/post-language-switch.js +186 -0
- package/dist/collection/components/post-language-switch/switch-variants.js +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
- package/dist/collection/components/post-linkarea/post-linkarea.js +30 -0
- package/dist/collection/components/post-list/post-list.css +1 -0
- package/dist/collection/components/post-list/post-list.js +88 -0
- package/dist/collection/components/post-list-item/post-list-item.css +1 -0
- package/dist/collection/components/post-list-item/post-list-item.js +26 -0
- package/dist/collection/components/post-logo/post-logo.css +1 -1
- package/dist/collection/components/post-logo/post-logo.js +2 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -0
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +184 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +275 -0
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -0
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +133 -0
- package/dist/collection/components/post-menu/post-menu.css +1 -0
- package/dist/collection/components/post-menu/post-menu.js +294 -0
- package/dist/collection/components/post-menu-item/post-menu-item.js +8 -0
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.css +1 -0
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +120 -0
- package/dist/collection/components/post-popover/post-popover.css +1 -31
- package/dist/collection/components/post-popover/post-popover.js +16 -13
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -31
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +39 -6
- package/dist/collection/components/post-rating/post-rating.css +1 -31
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.css +1 -31
- package/dist/collection/components/post-tab-header/post-tab-header.js +6 -5
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +4 -3
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +7 -15
- package/dist/collection/components/post-tag/post-tag.css +1 -31
- package/dist/collection/components/post-tag/post-tag.js +2 -2
- package/dist/collection/components/post-togglebutton/post-togglebutton.css +1 -0
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +74 -0
- package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +6 -3
- package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +14 -14
- package/dist/collection/index.js +21 -2
- package/dist/collection/utils/attribute-observer.js +6 -5
- package/dist/collection/utils/breakpoints.js +52 -0
- package/dist/collection/utils/component-on-ready.js +4 -4
- package/dist/collection/utils/debounce.js +2 -1
- package/dist/collection/utils/environment.js +2 -0
- package/dist/collection/utils/event-guard.js +43 -0
- package/dist/collection/utils/get-focusable-children.js +33 -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/collection/utils/property-checkers/check-non-empty.js +6 -2
- package/dist/collection/utils/property-checkers/check-one-of.js +8 -3
- package/dist/collection/utils/property-checkers/check-pattern.js +8 -3
- package/dist/collection/utils/property-checkers/check-type.js +11 -6
- package/dist/collection/utils/property-checkers/check-url.js +11 -6
- package/dist/collection/utils/property-checkers/empty-or.js +5 -2
- package/dist/collection/utils/sass-export.js +8 -5
- package/dist/components/breakpoints.js +56 -0
- package/dist/components/check-non-empty.js +6 -2
- package/dist/components/check-one-of.js +8 -3
- package/dist/components/check-type.js +11 -6
- package/dist/components/event-guard.js +45 -0
- package/dist/components/fade.js +6 -2
- package/dist/components/get-focusable-children.js +35 -0
- package/dist/components/get-root.js +15 -0
- package/dist/components/index.browser.js +14 -0
- package/dist/components/index.js +21 -2
- package/dist/components/index2.js +25 -12
- package/dist/components/long-press-event.js +264 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +37 -18
- package/dist/components/post-accordion2.js +8 -9
- package/dist/components/post-avatar.d.ts +11 -0
- package/dist/components/post-avatar.js +6 -0
- package/dist/components/post-avatar2.js +170 -0
- package/dist/components/post-back-to-top.d.ts +11 -0
- package/dist/components/post-back-to-top.js +6 -0
- package/dist/components/post-back-to-top2.js +121 -0
- package/dist/components/post-banner.d.ts +11 -0
- package/dist/components/post-banner.js +6 -0
- package/dist/components/post-banner2.js +127 -0
- package/dist/components/post-breadcrumb-item.d.ts +11 -0
- package/dist/components/post-breadcrumb-item.js +6 -0
- package/dist/components/post-breadcrumb-item2.js +82 -0
- package/dist/components/post-breadcrumbs.d.ts +11 -0
- package/dist/components/post-breadcrumbs.js +6 -0
- package/dist/components/post-breadcrumbs2.js +177 -0
- package/dist/components/post-card-control2.js +16 -19
- package/dist/components/post-closebutton.d.ts +11 -0
- package/dist/components/post-closebutton.js +6 -0
- package/dist/components/post-closebutton2.js +39 -0
- package/dist/components/post-collapsible-trigger2.js +47 -64
- package/dist/components/post-collapsible2.js +17 -12
- package/dist/components/post-footer.d.ts +11 -0
- package/dist/components/post-footer.js +6 -0
- package/dist/components/post-footer2.js +78 -0
- package/dist/components/post-header.d.ts +11 -0
- package/dist/components/post-header.js +6 -0
- package/dist/components/post-header2.js +399 -0
- package/dist/components/post-icon2.js +59 -55
- package/dist/components/post-language-option.d.ts +11 -0
- package/dist/components/post-language-option.js +6 -0
- package/dist/components/post-language-option2.js +103 -0
- package/dist/components/post-language-switch.d.ts +11 -0
- package/dist/components/post-language-switch.js +6 -0
- package/dist/components/post-language-switch2.js +145 -0
- package/dist/components/post-linkarea.d.ts +11 -0
- package/dist/components/post-linkarea.js +6 -0
- package/dist/components/post-linkarea2.js +43 -0
- package/dist/components/post-list-item.d.ts +11 -0
- package/dist/components/post-list-item.js +6 -0
- package/dist/components/post-list-item2.js +36 -0
- package/dist/components/{post-alert.d.ts → post-list.d.ts} +4 -4
- package/dist/components/post-list.js +6 -0
- package/dist/components/post-list2.js +54 -0
- package/dist/components/post-logo2.js +4 -3
- package/dist/components/post-mainnavigation.d.ts +11 -0
- package/dist/components/post-mainnavigation.js +6 -0
- package/dist/components/post-mainnavigation2.js +183 -0
- package/dist/components/post-megadropdown-trigger.d.ts +11 -0
- package/dist/components/post-megadropdown-trigger.js +6 -0
- package/dist/components/post-megadropdown-trigger2.js +121 -0
- package/dist/components/post-megadropdown.d.ts +11 -0
- package/dist/components/post-megadropdown.js +6 -0
- package/dist/components/post-megadropdown2.js +190 -0
- package/dist/components/post-menu-item.d.ts +11 -0
- package/dist/components/post-menu-item.js +6 -0
- package/dist/components/post-menu-item2.js +27 -0
- package/dist/components/post-menu-trigger.d.ts +11 -0
- package/dist/components/post-menu-trigger.js +6 -0
- package/dist/components/post-menu-trigger2.js +109 -0
- package/dist/components/post-menu.d.ts +11 -0
- package/dist/components/post-menu.js +6 -0
- package/dist/components/post-menu2.js +192 -0
- package/dist/components/post-popover2.js +20 -16
- package/dist/components/post-popovercontainer2.js +788 -73
- package/dist/components/post-rating2.js +2 -2
- package/dist/components/post-tab-header2.js +8 -6
- package/dist/components/post-tab-panel2.js +4 -3
- package/dist/components/post-tabs2.js +11 -13
- package/dist/components/post-tag2.js +2 -2
- package/dist/components/post-togglebutton.d.ts +11 -0
- package/dist/components/post-togglebutton.js +6 -0
- package/dist/components/post-togglebutton2.js +62 -0
- package/dist/components/post-tooltip-trigger2.js +14 -277
- package/dist/components/post-tooltip2.js +7 -3
- package/dist/components/slide.js +25 -0
- package/dist/docs.json +1977 -287
- package/dist/esm/breakpoints-7812702e.js +56 -0
- package/dist/esm/check-non-empty-258a56b3.js +13 -0
- package/dist/esm/check-one-of-0bee20f5.js +11 -0
- package/dist/esm/check-type-37d5d307.js +19 -0
- package/dist/esm/check-url-17962bc8.js +17 -0
- package/dist/esm/event-guard-538ee077.js +45 -0
- package/dist/esm/fade-1f3cacf4.js +11 -0
- package/dist/esm/get-root-1b1af46f.js +15 -0
- package/dist/esm/index-8f8fe5b0.js +32 -0
- package/dist/esm/{index-e1b64755.js → index-f4d19816.js} +35 -15
- package/dist/esm/index.browser-ff103197.js +14 -0
- package/dist/esm/index.js +33 -23
- package/dist/esm/loader.js +3 -3
- package/dist/esm/long-press-event-04d24397.js +264 -0
- package/dist/esm/package-d9237b44.js +3 -0
- package/dist/esm/{post-accordion-ad570427.js → post-accordion-fdcf7205.js} +11 -12
- package/dist/esm/post-accordion-item-e11e3804.js +62 -0
- package/dist/esm/post-accordion-item.entry.js +10 -6
- package/dist/esm/post-accordion.entry.js +6 -4
- package/dist/esm/post-avatar-d360c6d2.js +143 -0
- package/dist/esm/post-avatar.entry.js +6 -0
- package/dist/esm/post-back-to-top-85796c8b.js +94 -0
- package/dist/esm/post-back-to-top.entry.js +8 -0
- package/dist/esm/post-banner-a3090f67.js +90 -0
- package/dist/esm/post-banner.entry.js +12 -0
- package/dist/esm/post-breadcrumb-item_2.entry.js +9 -0
- package/dist/esm/post-breadcrumbs-15ec5a26.js +118 -0
- package/dist/esm/post-breadcrumbs.entry.js +5 -0
- package/dist/esm/post-card-control-6142534e.js +267 -0
- package/dist/esm/post-card-control.entry.js +6 -5
- package/dist/esm/post-closebutton_15.entry.js +14 -0
- package/dist/esm/{post-collapsible-trigger-45fe328a.js → post-collapsible-trigger-68306358.js} +62 -76
- package/dist/esm/post-collapsible_2.entry.js +11 -7
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/post-footer-d2a3270e.js +36 -0
- package/dist/esm/post-footer.entry.js +4 -0
- package/dist/esm/post-linkarea-64998c67.js +28 -0
- package/dist/esm/post-linkarea.entry.js +3 -0
- package/dist/esm/post-menu-item-95a0a647.js +65 -0
- package/dist/esm/post-popover-c5f81087.js +133 -0
- package/dist/esm/post-popover.entry.js +4 -3
- package/dist/esm/{post-rating-f60024fa.js → post-rating-7bfedafb.js} +4 -4
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/post-tab-header-08033da4.js +32 -0
- package/dist/esm/post-tab-header.entry.js +6 -4
- package/dist/esm/{post-tab-panel-0ddb05a2.js → post-tab-panel-be701793.js} +5 -4
- package/dist/esm/post-tab-panel.entry.js +4 -3
- package/dist/esm/{post-tabs-ab7853cf.js → post-tabs-c69e2842.js} +14 -16
- package/dist/esm/post-tabs.entry.js +5 -4
- package/dist/esm/post-tag-ebac7f3e.js +45 -0
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/post-togglebutton-706e3af0.js +4478 -0
- package/dist/esm/{post-tooltip-c03cd719.js → post-tooltip-9a195d47.js} +10 -6
- package/dist/esm/{post-tooltip-trigger-1fefc8ad.js → post-tooltip-trigger-7d6f234b.js} +17 -280
- package/dist/esm/post-tooltip-trigger.entry.js +5 -4
- package/dist/esm/post-tooltip.entry.js +5 -4
- package/dist/esm/slide-cd2850ee.js +25 -0
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-034715ec.js +1 -0
- package/dist/post-components/p-0717fe4c.js +1 -0
- package/dist/post-components/p-0889c759.js +1 -0
- package/dist/post-components/p-0c03547b.js +1 -0
- package/dist/post-components/p-0de8d05f.js +1 -0
- package/dist/post-components/p-1373a79b.entry.js +1 -0
- package/dist/post-components/p-17dc4170.js +8 -0
- package/dist/post-components/p-181c73d5.js +1 -0
- package/dist/post-components/p-1a21fd8d.js +1 -0
- package/dist/post-components/p-1ab3eba4.entry.js +1 -0
- package/dist/post-components/p-2d6c0670.js +1 -0
- package/dist/post-components/p-2dc0a2d0.js +1 -0
- package/dist/post-components/p-35ad2e11.entry.js +1 -0
- package/dist/post-components/p-368c473a.js +1 -0
- package/dist/post-components/p-38f778a7.entry.js +1 -0
- package/dist/post-components/p-39a8df3c.entry.js +1 -0
- package/dist/post-components/p-3c7f6003.js +1 -0
- package/dist/post-components/p-474a41bc.entry.js +1 -0
- package/dist/post-components/p-64e3de38.js +1 -0
- package/dist/post-components/p-69bc8eaf.entry.js +1 -0
- package/dist/post-components/p-6b31a76a.js +1 -0
- package/dist/post-components/p-722ffaae.js +1 -0
- package/dist/post-components/p-72310bf0.entry.js +1 -0
- package/dist/post-components/p-7709c14a.js +1 -0
- package/dist/post-components/p-804b61b7.entry.js +1 -0
- package/dist/post-components/p-85fdc2d3.js +1 -0
- package/dist/post-components/p-89247caa.js +1 -0
- package/dist/post-components/p-89dc67c7.entry.js +1 -0
- package/dist/post-components/p-8db32dab.js +8 -0
- package/dist/post-components/p-8f7f5200.entry.js +1 -0
- package/dist/post-components/p-964f9581.js +1 -0
- package/dist/post-components/p-9b052461.js +1 -0
- package/dist/post-components/{p-3eab790d.js → p-9e461613.js} +2 -2
- package/dist/post-components/p-a52b2d34.js +1 -0
- package/dist/post-components/p-ab566526.js +1 -0
- package/dist/post-components/p-b648e537.entry.js +1 -0
- package/dist/post-components/p-bc33a6d9.js +1 -0
- package/dist/post-components/p-bcfdbd0b.entry.js +1 -0
- package/dist/post-components/p-beb67979.js +1 -0
- package/dist/post-components/p-c41868b1.js +1 -0
- package/dist/post-components/p-c65f32b0.js +1 -0
- package/dist/post-components/p-c71700a7.js +1 -0
- package/dist/post-components/p-cb027003.js +1 -0
- package/dist/post-components/p-cc5b1437.js +1 -0
- package/dist/post-components/p-ceda889e.entry.js +1 -0
- package/dist/post-components/p-d45df336.js +1 -0
- package/dist/post-components/p-de4d4274.js +1 -0
- package/dist/post-components/p-deb9efcf.entry.js +1 -0
- package/dist/post-components/p-e585c6fe.js +1 -0
- package/dist/post-components/p-e9f1cc46.entry.js +1 -0
- package/dist/post-components/p-ee4e776d.entry.js +1 -0
- package/dist/post-components/p-ee7c3bcc.entry.js +1 -0
- package/dist/post-components/p-f56482fa.entry.js +1 -0
- package/dist/post-components/p-f8c652ce.entry.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 -0
- package/dist/types/components/post-accordion/post-accordion.d.ts +1 -1
- package/dist/types/components/post-accordion-item/post-accordion-item.d.ts +8 -2
- package/dist/types/components/post-avatar/post-avatar.d.ts +51 -0
- package/dist/types/components/post-back-to-top/post-back-to-top.d.ts +21 -0
- package/dist/types/components/post-banner/banner-types.d.ts +2 -0
- package/dist/types/components/post-banner/post-banner.d.ts +49 -0
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +20 -0
- package/dist/types/components/post-breadcrumbs/post-breadcrumbs.d.ts +30 -0
- package/dist/types/components/post-card-control/post-card-control.d.ts +9 -9
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +7 -0
- package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +9 -14
- package/dist/types/components/post-footer/post-footer.d.ts +23 -0
- package/dist/types/components/post-header/post-header.d.ts +52 -0
- package/dist/types/components/post-icon/post-icon.d.ts +10 -6
- package/dist/types/components/post-language-option/post-language-option.d.ts +49 -0
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +39 -0
- package/dist/types/components/post-language-switch/switch-variants.d.ts +2 -0
- package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
- package/dist/types/components/post-list/post-list.d.ts +24 -0
- package/dist/types/components/post-list-item/post-list-item.d.ts +8 -0
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +46 -0
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +59 -0
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +33 -0
- package/dist/types/components/post-menu/post-menu.d.ts +49 -0
- package/dist/types/components/post-menu-item/post-menu-item.d.ts +3 -0
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +28 -0
- package/dist/types/components/post-popover/post-popover.d.ts +6 -4
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +9 -1
- package/dist/types/components/post-tab-header/post-tab-header.d.ts +1 -1
- package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
- package/dist/types/components/post-tag/post-tag.d.ts +2 -2
- package/dist/types/components/post-togglebutton/post-togglebutton.d.ts +15 -0
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +1 -0
- package/dist/types/components/post-tooltip-trigger/post-tooltip-trigger.d.ts +0 -1
- package/dist/types/components.d.ts +603 -50
- package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
- package/dist/types/index.d.ts +22 -3
- package/dist/types/popover-fn.d.ts +11 -0
- package/dist/types/utils/attribute-observer.d.ts +1 -1
- package/dist/types/utils/breakpoints.d.ts +12 -0
- package/dist/types/utils/component-on-ready.d.ts +1 -1
- package/dist/types/utils/environment.d.ts +2 -0
- package/dist/types/utils/event-guard.d.ts +4 -0
- package/dist/types/utils/get-focusable-children.d.ts +1 -0
- package/dist/types/utils/get-root.d.ts +5 -1
- package/dist/types/utils/index.d.ts +5 -0
- package/dist/types/utils/property-checkers/check-non-empty.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-one-of.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-pattern.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-type.d.ts +3 -1
- package/dist/types/utils/property-checkers/check-url.d.ts +3 -1
- package/dist/types/utils/property-checkers/index.d.ts +12 -4
- package/dist/types/utils/sass-export.d.ts +5 -1
- package/loaders/breakpoints.js +56 -0
- package/loaders/check-non-empty.js +6 -2
- package/loaders/check-one-of.js +8 -3
- package/loaders/check-type.js +11 -6
- package/loaders/event-guard.js +45 -0
- package/loaders/fade.js +6 -2
- package/loaders/get-focusable-children.js +35 -0
- package/loaders/get-root.js +15 -0
- package/loaders/index.browser.js +14 -0
- package/loaders/index.d.ts +40 -2
- package/loaders/index.js +22 -2
- package/loaders/index2.js +25 -12
- package/loaders/long-press-event.js +264 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item.js +1 -82
- package/loaders/post-accordion-item2.js +103 -0
- package/loaders/post-accordion.js +8 -9
- package/loaders/post-avatar.d.ts +11 -0
- package/loaders/post-avatar.js +173 -0
- package/loaders/post-back-to-top.d.ts +11 -0
- package/loaders/post-back-to-top.js +124 -0
- package/loaders/post-banner.d.ts +11 -0
- package/loaders/post-banner.js +130 -0
- package/loaders/post-breadcrumb-item.d.ts +11 -0
- package/loaders/post-breadcrumb-item.js +6 -0
- package/loaders/post-breadcrumb-item2.js +82 -0
- package/loaders/post-breadcrumbs.d.ts +11 -0
- package/loaders/post-breadcrumbs.js +180 -0
- package/loaders/post-card-control.js +16 -19
- package/loaders/post-closebutton.d.ts +11 -0
- package/loaders/post-closebutton.js +42 -0
- package/loaders/post-collapsible-trigger2.js +47 -64
- package/loaders/post-collapsible2.js +16 -11
- package/loaders/post-footer.d.ts +11 -0
- package/loaders/post-footer.js +81 -0
- package/loaders/post-header.d.ts +11 -0
- package/loaders/post-header.js +402 -0
- package/loaders/post-icon2.js +59 -55
- package/loaders/post-language-option.d.ts +11 -0
- package/loaders/post-language-option.js +106 -0
- package/loaders/post-language-switch.d.ts +11 -0
- package/loaders/post-language-switch.js +148 -0
- package/loaders/post-linkarea.d.ts +11 -0
- package/loaders/post-linkarea.js +46 -0
- package/loaders/post-list-item.d.ts +11 -0
- package/loaders/post-list-item.js +39 -0
- package/loaders/{post-alert.d.ts → post-list.d.ts} +4 -4
- package/loaders/post-list.js +57 -0
- package/loaders/post-logo.js +5 -4
- package/loaders/post-mainnavigation.d.ts +11 -0
- package/loaders/post-mainnavigation.js +186 -0
- package/loaders/post-megadropdown-trigger.d.ts +11 -0
- package/loaders/post-megadropdown-trigger.js +124 -0
- package/loaders/post-megadropdown.d.ts +11 -0
- package/loaders/post-megadropdown.js +193 -0
- package/loaders/post-menu-item.d.ts +11 -0
- package/loaders/post-menu-item.js +6 -0
- package/loaders/post-menu-item2.js +27 -0
- package/loaders/post-menu-trigger.d.ts +11 -0
- package/loaders/post-menu-trigger.js +6 -0
- package/loaders/post-menu-trigger2.js +109 -0
- package/loaders/post-menu.d.ts +11 -0
- package/loaders/post-menu.js +6 -0
- package/loaders/post-menu2.js +192 -0
- package/loaders/post-popover.js +20 -16
- package/loaders/post-popovercontainer2.js +788 -73
- package/loaders/post-rating.js +2 -2
- package/loaders/post-tab-header.js +8 -6
- package/loaders/post-tab-panel.js +4 -3
- package/loaders/post-tabs.js +11 -13
- package/loaders/post-tag.js +2 -2
- package/loaders/post-togglebutton.d.ts +11 -0
- package/loaders/post-togglebutton.js +65 -0
- package/loaders/post-tooltip-trigger.js +14 -277
- package/loaders/post-tooltip.js +7 -3
- package/loaders/slide.js +25 -0
- package/package.json +45 -33
- package/dist/cjs/check-non-empty-eeaa8f77.js +0 -11
- package/dist/cjs/check-one-of-f4f5d0c0.js +0 -8
- package/dist/cjs/check-type-64af82a9.js +0 -16
- package/dist/cjs/fade-35a3633a.js +0 -10
- package/dist/cjs/index-824d2b71.js +0 -39
- package/dist/cjs/post-accordion-item-5f685bee.js +0 -52
- package/dist/cjs/post-alert-88adc668.js +0 -99
- package/dist/cjs/post-alert.cjs.entry.js +0 -17
- package/dist/cjs/post-card-control-c6e5c427.js +0 -272
- package/dist/cjs/post-icon-f735da00.js +0 -139
- package/dist/cjs/post-icon.cjs.entry.js +0 -16
- package/dist/cjs/post-logo-2cd8ae98.js +0 -39
- package/dist/cjs/post-logo.cjs.entry.js +0 -15
- package/dist/cjs/post-popover-36c854a4.js +0 -131
- package/dist/cjs/post-popovercontainer-cb4793c1.js +0 -2281
- package/dist/cjs/post-popovercontainer.cjs.entry.js +0 -11
- package/dist/cjs/post-tab-header-b756d9b1.js +0 -32
- package/dist/cjs/post-tag-c70fb945.js +0 -47
- package/dist/collection/components/post-alert/alert-types.js +0 -1
- package/dist/collection/components/post-alert/post-alert.css +0 -35
- package/dist/components/post-alert.js +0 -6
- package/dist/components/post-alert2.js +0 -136
- package/dist/esm/check-non-empty-58bd6b17.js +0 -9
- package/dist/esm/check-one-of-6b3ef8eb.js +0 -6
- package/dist/esm/check-type-8828dbe4.js +0 -14
- package/dist/esm/fade-7fd71785.js +0 -7
- package/dist/esm/index-69587a51.js +0 -34
- package/dist/esm/package-983f957d.js +0 -3
- package/dist/esm/post-accordion-item-4db0aa2a.js +0 -50
- package/dist/esm/post-alert-1e9fbdfa.js +0 -97
- package/dist/esm/post-alert.entry.js +0 -9
- package/dist/esm/post-card-control-ccb189a8.js +0 -270
- package/dist/esm/post-icon-3fc4dd7d.js +0 -137
- package/dist/esm/post-icon.entry.js +0 -8
- package/dist/esm/post-logo-e6cdea13.js +0 -37
- package/dist/esm/post-logo.entry.js +0 -7
- package/dist/esm/post-popover-afdf4906.js +0 -129
- package/dist/esm/post-popovercontainer-b19b7606.js +0 -2279
- package/dist/esm/post-popovercontainer.entry.js +0 -3
- package/dist/esm/post-tab-header-333e15d5.js +0 -30
- package/dist/esm/post-tag-4a7d14b9.js +0 -45
- package/dist/post-components/p-0a45da5e.entry.js +0 -1
- package/dist/post-components/p-12e82863.entry.js +0 -1
- package/dist/post-components/p-1386b77d.js +0 -1
- package/dist/post-components/p-1528b798.js +0 -1
- package/dist/post-components/p-18dc1299.entry.js +0 -1
- package/dist/post-components/p-1a8f6c84.entry.js +0 -1
- package/dist/post-components/p-256453ca.js +0 -1
- package/dist/post-components/p-2737eaf5.js +0 -1
- package/dist/post-components/p-3272ebad.js +0 -1
- package/dist/post-components/p-3596035e.js +0 -1
- package/dist/post-components/p-3668f4fa.entry.js +0 -1
- package/dist/post-components/p-375845d4.js +0 -1
- package/dist/post-components/p-381de59d.entry.js +0 -1
- package/dist/post-components/p-4a3f67ab.js +0 -1
- package/dist/post-components/p-4e68c514.js +0 -1
- package/dist/post-components/p-4eb5d9a1.entry.js +0 -1
- package/dist/post-components/p-611b3c41.js +0 -1
- package/dist/post-components/p-61a7d216.js +0 -1
- package/dist/post-components/p-788e64fb.js +0 -1
- package/dist/post-components/p-7d5b41d1.js +0 -1
- package/dist/post-components/p-82ea24e7.js +0 -1
- package/dist/post-components/p-85c4d04f.js +0 -1
- package/dist/post-components/p-85c6d001.entry.js +0 -1
- package/dist/post-components/p-8e555dda.js +0 -15
- package/dist/post-components/p-962a6f36.entry.js +0 -1
- package/dist/post-components/p-a76c71bc.js +0 -1
- package/dist/post-components/p-a7e8fd41.entry.js +0 -1
- package/dist/post-components/p-ac216bd0.entry.js +0 -1
- package/dist/post-components/p-b095519d.js +0 -1
- package/dist/post-components/p-b17ecbee.entry.js +0 -1
- package/dist/post-components/p-bb4227ad.entry.js +0 -1
- package/dist/post-components/p-bc294d0b.js +0 -1
- package/dist/post-components/p-d0b3c5d3.entry.js +0 -1
- package/dist/post-components/p-d4e148d8.entry.js +0 -1
- package/dist/post-components/p-d9809281.js +0 -1
- package/dist/post-components/p-eb1e7a49.js +0 -1
- package/dist/post-components/p-f35291d5.entry.js +0 -1
- package/dist/post-components/p-fc3bfe08.js +0 -1
- package/dist/types/components/post-alert/alert-types.d.ts +0 -2
- package/dist/types/components/post-alert/post-alert.d.ts +0 -54
- package/loaders/post-alert.js +0 -139
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
|
|
4
|
+
const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
|
|
5
|
+
export class PostMainnavigation {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.canScrollLeft = false;
|
|
8
|
+
this.canScrollRight = false;
|
|
9
|
+
this.scrollRight = this.scrollRight.bind(this);
|
|
10
|
+
this.scrollLeft = this.scrollLeft.bind(this);
|
|
11
|
+
this.handleMutations = this.handleMutations.bind(this);
|
|
12
|
+
this.checkScrollability = this.checkScrollability.bind(this);
|
|
13
|
+
this.resizeObserver = new ResizeObserver(this.checkScrollability);
|
|
14
|
+
this.mutationObserver = new MutationObserver(this.handleMutations);
|
|
15
|
+
}
|
|
16
|
+
componentDidLoad() {
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
this.fixLayoutShift();
|
|
19
|
+
this.checkScrollability();
|
|
20
|
+
});
|
|
21
|
+
// Observe the navbar for size changes
|
|
22
|
+
this.resizeObserver.observe(this.navbar);
|
|
23
|
+
// Observe the navabar for mutation changes
|
|
24
|
+
this.mutationObserver.observe(this.navbar, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
|
|
25
|
+
// Ensure the scroll buttons are correctly displayed or hidden whenever the navbar is scrolled
|
|
26
|
+
this.navbar.addEventListener('scrollend', this.checkScrollability);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Disconnects observers and remove event listeners when the main navigation is removed from the DOM.
|
|
30
|
+
*/
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
this.mutationObserver.disconnect();
|
|
33
|
+
this.resizeObserver.disconnect();
|
|
34
|
+
this.navbar.removeEventListener('scrollend', this.checkScrollability);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Stops the repeated scrolling when the mouse button is released.
|
|
38
|
+
*/
|
|
39
|
+
stopScrolling() {
|
|
40
|
+
if (this.scrollRepeatInterval)
|
|
41
|
+
clearInterval(this.scrollRepeatInterval);
|
|
42
|
+
}
|
|
43
|
+
async handleMutations(mutations) {
|
|
44
|
+
const addedNodes = mutations.flatMap((mutation) => {
|
|
45
|
+
return Array.from(mutation.addedNodes);
|
|
46
|
+
});
|
|
47
|
+
// Wait for all elements to be hydrated
|
|
48
|
+
await Promise.all(addedNodes.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
|
|
49
|
+
this.fixLayoutShift();
|
|
50
|
+
this.checkScrollability();
|
|
51
|
+
}
|
|
52
|
+
get navigationItems() {
|
|
53
|
+
return Array.from(this.navbar.querySelectorAll(':is(a, button):not(post-megadropdown *)'));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Hack to fix the layout shift due to bold text on active elements
|
|
57
|
+
*/
|
|
58
|
+
fixLayoutShift() {
|
|
59
|
+
this.navigationItems
|
|
60
|
+
.filter(item => !item.matches(':has(.nav-el-active)'))
|
|
61
|
+
.forEach(item => {
|
|
62
|
+
item.innerHTML = `
|
|
63
|
+
<span class="nav-el-active">${item.innerHTML}</span>
|
|
64
|
+
<span class="nav-el-inactive" aria-hidden="true">${item.innerHTML}</span>
|
|
65
|
+
`;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
handleBackButtonClick() {
|
|
69
|
+
const header = this.navbar.closest('post-header');
|
|
70
|
+
if (header)
|
|
71
|
+
header.toggleMobileMenu();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns whether scrolling is enabled in either the left or right direction.
|
|
75
|
+
*/
|
|
76
|
+
get canScroll() {
|
|
77
|
+
return this.canScrollLeft || this.canScrollRight;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Checks if scrolling is possible in either direction (left or right) and updates the state accordingly.
|
|
81
|
+
*/
|
|
82
|
+
checkScrollability() {
|
|
83
|
+
const { scrollLeft, scrollWidth, clientWidth } = this.navbar;
|
|
84
|
+
if (scrollWidth === clientWidth) {
|
|
85
|
+
// If scroll width equals client width, scrolling is disabled in both directions
|
|
86
|
+
this.canScrollLeft = this.canScrollRight = false;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.canScrollLeft = Math.floor(scrollLeft) > 0; // Scrolling left is possible if not at the start
|
|
90
|
+
this.canScrollRight = Math.ceil(clientWidth + scrollLeft) < scrollWidth; // Scrolling right is possible if not at the end
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Handles the scrolling behavior when a user clicks on the left or right scroll buttons.
|
|
95
|
+
*/
|
|
96
|
+
handleScrollButtonClick(e, direction) {
|
|
97
|
+
if (!this.canScroll || e.button !== 0)
|
|
98
|
+
return;
|
|
99
|
+
// Disable interaction with the navbar during scrolling
|
|
100
|
+
this.temporarilyDisableNavbar();
|
|
101
|
+
// Set up the correct scroll function
|
|
102
|
+
const scroll = direction === 'right' ? this.scrollRight : this.scrollLeft;
|
|
103
|
+
scroll();
|
|
104
|
+
// Repeat the scrolling action while the button is held down
|
|
105
|
+
this.scrollRepeatInterval = setInterval(() => {
|
|
106
|
+
scroll();
|
|
107
|
+
}, SCROLL_REPEAT_INTERVAL);
|
|
108
|
+
}
|
|
109
|
+
scrollRight() {
|
|
110
|
+
const scrollRightLeftEdge = document
|
|
111
|
+
.querySelector('.scroll-right')
|
|
112
|
+
.getBoundingClientRect().left;
|
|
113
|
+
for (const navigationItem of this.navigationItems) {
|
|
114
|
+
const { right, width } = navigationItem.getBoundingClientRect();
|
|
115
|
+
// Scroll to the first navigation item that is less than 75% visible
|
|
116
|
+
const isThreeQuartersVisible = right - 0.25 * width < scrollRightLeftEdge;
|
|
117
|
+
if (!isThreeQuartersVisible) {
|
|
118
|
+
this.navbar.scrollBy({ left: right - scrollRightLeftEdge });
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
scrollLeft() {
|
|
124
|
+
const scrollLeftRightEdge = document
|
|
125
|
+
.querySelector('.scroll-left')
|
|
126
|
+
.getBoundingClientRect().right;
|
|
127
|
+
for (const navigationItem of this.navigationItems.reverse()) {
|
|
128
|
+
const { left, width } = navigationItem.getBoundingClientRect();
|
|
129
|
+
// Scroll to the first navigation item that is less than 75% visible
|
|
130
|
+
const isThreeQuartersVisible = left + 0.25 * width > scrollLeftRightEdge;
|
|
131
|
+
if (!isThreeQuartersVisible) {
|
|
132
|
+
this.navbar.scrollBy({ left: left - scrollLeftRightEdge });
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Temporarily disables interactions with the navbar during scrolling to prevent accidental clicks.
|
|
139
|
+
* Re-enables interactions after a brief delay to avoid blocking the user entirely.
|
|
140
|
+
*/
|
|
141
|
+
temporarilyDisableNavbar() {
|
|
142
|
+
if (this.navbarDisableTimer)
|
|
143
|
+
clearTimeout(this.navbarDisableTimer);
|
|
144
|
+
this.navbar.setAttribute('inert', '');
|
|
145
|
+
this.navbarDisableTimer = setTimeout(() => {
|
|
146
|
+
this.navbar.removeAttribute('inert');
|
|
147
|
+
}, NAVBAR_DISABLE_DURATION);
|
|
148
|
+
}
|
|
149
|
+
render() {
|
|
150
|
+
return (h(Host, { key: '6cd850555585d87eb25e3f6892b8010f5e4d23d6', slot: "post-mainnavigation", version: version }, h("div", { key: '3411008120d072920f4de0b71c9dc014748f1390', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '2e3747380cb546bd6da77e5ffba2403586205a55', name: "back-button" })), h("div", { key: 'e9eedd836b3f679ba2861109db2d0811c1142677', "aria-hidden": "true", class: { 'scroll-control scroll-left': true, 'd-none': !this.canScrollLeft }, onMouseDown: e => this.handleScrollButtonClick(e, 'left') }, h("post-icon", { key: '628511a2c1812a08828e1aa2b51f26ad01a5a2cf', "aria-hidden": "true", name: "chevronleft" })), h("nav", { key: '1b660d65e1984e8701a98a369046f391fd177338', ref: el => (this.navbar = el) }, h("slot", { key: '0eb35366ac0bd58509afd6a12f68c2b09396a497' })), h("div", { key: '11145ad6602e2df78d3c3f4643cc6e4e960775aa', "aria-hidden": "true", class: { 'scroll-control scroll-right': true, 'd-none': !this.canScrollRight }, onMouseDown: e => this.handleScrollButtonClick(e, 'right') }, h("post-icon", { key: '26e795cd00221dbfb1a7632453d0d48993584b0b', "aria-hidden": "true", name: "chevronright" }))));
|
|
151
|
+
}
|
|
152
|
+
static get is() { return "post-mainnavigation"; }
|
|
153
|
+
static get originalStyleUrls() {
|
|
154
|
+
return {
|
|
155
|
+
"$": ["./post-mainnavigation.scss"]
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
static get styleUrls() {
|
|
159
|
+
return {
|
|
160
|
+
"$": ["post-mainnavigation.css"]
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
static get states() {
|
|
164
|
+
return {
|
|
165
|
+
"canScrollLeft": {},
|
|
166
|
+
"canScrollRight": {}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
static get listeners() {
|
|
170
|
+
return [{
|
|
171
|
+
"name": "mouseup",
|
|
172
|
+
"method": "stopScrolling",
|
|
173
|
+
"target": "window",
|
|
174
|
+
"capture": false,
|
|
175
|
+
"passive": true
|
|
176
|
+
}, {
|
|
177
|
+
"name": "mouseleave",
|
|
178
|
+
"method": "stopScrolling",
|
|
179
|
+
"target": "window",
|
|
180
|
+
"capture": false,
|
|
181
|
+
"passive": true
|
|
182
|
+
}];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;z-index:1;width:100%;inset-block-start:100%;inset-inline-start:0;border-radius:0}@media(forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown-container{border-block-end:1px solid CanvasText}}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{z-index:4;position:fixed;inset-block-start:var(--post-header-navigation-current-inset);inset-inline:0;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));border-block-start:unset;overflow-y:auto;overscroll-behavior:contain}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}@media screen and (min-width: 1024px){.megadropdown-container{max-height:calc(100vh - var(--post-header-height) - 48px);overflow-y:auto}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{display:flex;flex-direction:column;width:inherit;padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-block:0 8px;font-weight:900}.megadropdown h2 a{text-decoration:none;display:none;font-weight:inherit;border-block:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:16px 12px 14px 8px}.megadropdown post-list .list-title h3:not(:has(a)){position:relative}.megadropdown post-list .list-title h3:not(:has(a))::before{content:"";background-color:#050400;inset-block-end:0;inset-inline-start:0;width:100%;height:2px;position:absolute}.megadropdown post-list .list-title h3 a{border-radius:0;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:"";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}.megadropdown post-list .list-title h3 a.selected,.megadropdown post-list .list-title h3 a[aria-expanded=true]{background-color:#050400;color:#fff}.megadropdown post-list .list-title h3 a:hover{background-color:#504f4b;color:#fff}.megadropdown post-list .list-title h3 a:hover::before{background-color:#504f4b}.megadropdown post-list .list-title h3 a::before{height:2px}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)),.megadropdown post-list .list-title h3 a{padding:14px 12px 12px 8px}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px;white-space:normal;word-break:break-word}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-block-end:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{order:-1;display:block}}.megadropdown .close-button{position:absolute;inset-block-start:1rem;inset-inline-end:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { getFocusableChildren } from "../../utils/get-focusable-children";
|
|
2
|
+
import { h, Host } from "@stencil/core";
|
|
3
|
+
import { version } from "../../../../package";
|
|
4
|
+
import { breakpoint } from "../../utils/breakpoints";
|
|
5
|
+
export class PostMegadropdown {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.handleClickOutside = (event) => {
|
|
8
|
+
if (this.device !== 'desktop')
|
|
9
|
+
return;
|
|
10
|
+
const target = event.target;
|
|
11
|
+
if (this.host.contains(target)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (target instanceof HTMLElement) {
|
|
15
|
+
const trigger = target.closest('post-megadropdown-trigger');
|
|
16
|
+
if (trigger) {
|
|
17
|
+
const targetDropdownId = trigger.getAttribute('for');
|
|
18
|
+
if (targetDropdownId !== this.host.id) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
this.hide(false);
|
|
24
|
+
};
|
|
25
|
+
this.device = breakpoint.get('name');
|
|
26
|
+
this.isVisible = false;
|
|
27
|
+
this.animationClass = null;
|
|
28
|
+
}
|
|
29
|
+
breakpointChange(e) {
|
|
30
|
+
this.device = e.detail;
|
|
31
|
+
if (this.device === 'desktop' && this.isVisible) {
|
|
32
|
+
this.animationClass = null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
disconnectedCallback() {
|
|
36
|
+
this.removeListeners();
|
|
37
|
+
window.removeEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
|
|
38
|
+
if (PostMegadropdown.activeDropdown === this) {
|
|
39
|
+
PostMegadropdown.activeDropdown = null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
componentWillRender() {
|
|
43
|
+
this.getFocusableElements();
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Toggles the dropdown visibility based on its current state.
|
|
47
|
+
*/
|
|
48
|
+
async toggle() {
|
|
49
|
+
if (this.isVisible) {
|
|
50
|
+
this.hide();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
await this.show();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Displays the dropdown.
|
|
58
|
+
*/
|
|
59
|
+
async show() {
|
|
60
|
+
if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
|
|
61
|
+
// Close the previously active dropdown without animation
|
|
62
|
+
PostMegadropdown.activeDropdown.forceClose();
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.animationClass = 'slide-in';
|
|
66
|
+
}
|
|
67
|
+
this.isVisible = true;
|
|
68
|
+
PostMegadropdown.activeDropdown = this;
|
|
69
|
+
this.postToggleMegadropdown.emit({ isVisible: this.isVisible });
|
|
70
|
+
if (this.firstFocusableEl &&
|
|
71
|
+
window.getComputedStyle(this.firstFocusableEl).display !== 'none') {
|
|
72
|
+
this.firstFocusableEl.focus();
|
|
73
|
+
}
|
|
74
|
+
this.addListeners();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Hides the dropdown with an animation.
|
|
78
|
+
*/
|
|
79
|
+
async hide(focusParent = true, forceClose = false) {
|
|
80
|
+
this.postToggleMegadropdown.emit({ isVisible: false, focusParent: focusParent });
|
|
81
|
+
if (forceClose) {
|
|
82
|
+
this.forceClose();
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.animationClass = 'slide-out';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Sets focus to the first focusable element within the component.
|
|
90
|
+
*/
|
|
91
|
+
async focusFirst() {
|
|
92
|
+
this.firstFocusableEl?.focus();
|
|
93
|
+
}
|
|
94
|
+
connectedCallback() {
|
|
95
|
+
window.addEventListener('postBreakpoint:name', this.breakpointChange.bind(this));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Forces the dropdown to close without animation.
|
|
99
|
+
*/
|
|
100
|
+
forceClose() {
|
|
101
|
+
this.isVisible = false;
|
|
102
|
+
this.animationClass = null;
|
|
103
|
+
this.postToggleMegadropdown.emit({ isVisible: this.isVisible, focusParent: false });
|
|
104
|
+
this.removeListeners();
|
|
105
|
+
}
|
|
106
|
+
handleAnimationEnd() {
|
|
107
|
+
if (this.animationClass === 'slide-out') {
|
|
108
|
+
this.isVisible = false;
|
|
109
|
+
this.animationClass = null;
|
|
110
|
+
PostMegadropdown.activeDropdown = null;
|
|
111
|
+
this.removeListeners();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
addListeners() {
|
|
115
|
+
this.host.addEventListener('keydown', e => this.keyboardHandler(e));
|
|
116
|
+
document.addEventListener('keyup', e => this.handleTabOutside(e));
|
|
117
|
+
document.addEventListener('mousedown', this.handleClickOutside);
|
|
118
|
+
}
|
|
119
|
+
removeListeners() {
|
|
120
|
+
this.host.removeEventListener('keydown', e => this.keyboardHandler(e));
|
|
121
|
+
document.removeEventListener('keyup', e => this.handleTabOutside(e));
|
|
122
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
123
|
+
}
|
|
124
|
+
getFocusableElements() {
|
|
125
|
+
const focusableEls = Array.from(this.host.querySelectorAll('post-list-item, h3, .back-button'));
|
|
126
|
+
const focusableChildren = focusableEls.flatMap(el => Array.from(getFocusableChildren(el)));
|
|
127
|
+
this.firstFocusableEl = focusableChildren[0];
|
|
128
|
+
this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
|
|
129
|
+
}
|
|
130
|
+
// Loop through the focusable children
|
|
131
|
+
keyboardHandler(e) {
|
|
132
|
+
if (e.key === 'Tab' && this.device !== 'desktop') {
|
|
133
|
+
if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
|
|
134
|
+
// If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
|
|
135
|
+
e.preventDefault();
|
|
136
|
+
this.lastFocusableEl.focus();
|
|
137
|
+
}
|
|
138
|
+
else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
|
|
139
|
+
// If TAB and last element is focused, focus goes back to the first element of the megadropdown
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
this.firstFocusableEl.focus();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
handleTabOutside(e) {
|
|
146
|
+
if (e.key === 'Tab' && this.device === 'desktop') {
|
|
147
|
+
if (!this.host.contains(e.target)) {
|
|
148
|
+
this.hide(false);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
render() {
|
|
153
|
+
const containerStyle = this.isVisible ? {} : { display: 'none' };
|
|
154
|
+
return (h(Host, { key: '7426a12ebaeac0ce3b8402c3da4d5393daca059b', version: version }, h("div", { key: 'd47b60c334577f5662f19912f12ce941b4b52d94', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, h("div", { key: '2798f217b2b3e43c3c63072884bbbbe7d99ed62f', class: "megadropdown" }, h("slot", { key: 'b61f82bbc7f87f65d9b6957e7a4e5d6790b6dd00', name: "megadropdown-title" }), h("div", { key: 'f4996a819511cb59185faeedbdcec4be6e6f8a24', class: "megadropdown-content" }, h("slot", { key: '54f695c3b3d30a6a1aae7f7dc6f65f4d4d27de68' })), h("div", { key: 'b1334295c7d758e20c85b6c6c8cefc31dcf09e20', onClick: () => this.hide(true), class: "back-button" }, h("slot", { key: 'c4db69fa3207ce4cb47b725e37b1993820a2a64c', name: "back-button" })), h("div", { key: '68b22a3222382586fc749dec63e36edae84360c1', onClick: () => this.hide(true), class: "close-button" }, h("slot", { key: '8023b75c931a95dbd9552c1a713790e77e40f526', name: "close-button" }))))));
|
|
155
|
+
}
|
|
156
|
+
static get is() { return "post-megadropdown"; }
|
|
157
|
+
static get originalStyleUrls() {
|
|
158
|
+
return {
|
|
159
|
+
"$": ["post-megadropdown.scss"]
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
static get styleUrls() {
|
|
163
|
+
return {
|
|
164
|
+
"$": ["post-megadropdown.css"]
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
static get states() {
|
|
168
|
+
return {
|
|
169
|
+
"device": {},
|
|
170
|
+
"isVisible": {},
|
|
171
|
+
"animationClass": {}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
static get events() {
|
|
175
|
+
return [{
|
|
176
|
+
"method": "postToggleMegadropdown",
|
|
177
|
+
"name": "postToggleMegadropdown",
|
|
178
|
+
"bubbles": true,
|
|
179
|
+
"cancelable": true,
|
|
180
|
+
"composed": true,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "Emits when the dropdown is shown or hidden.\nThe event payload is an object.\n`isVisible` is true when the dropdown gets opened and false when it gets closed\n`focusParent` determines whether after the closing of the mega dropdown, the focus should go back to the trigger parent or naturally go to the next focusable element in the page"
|
|
184
|
+
},
|
|
185
|
+
"complexType": {
|
|
186
|
+
"original": "{ isVisible: boolean; focusParent?: boolean }",
|
|
187
|
+
"resolved": "{ isVisible: boolean; focusParent?: boolean; }",
|
|
188
|
+
"references": {}
|
|
189
|
+
}
|
|
190
|
+
}];
|
|
191
|
+
}
|
|
192
|
+
static get methods() {
|
|
193
|
+
return {
|
|
194
|
+
"toggle": {
|
|
195
|
+
"complexType": {
|
|
196
|
+
"signature": "() => Promise<void>",
|
|
197
|
+
"parameters": [],
|
|
198
|
+
"references": {
|
|
199
|
+
"Promise": {
|
|
200
|
+
"location": "global",
|
|
201
|
+
"id": "global::Promise"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"return": "Promise<void>"
|
|
205
|
+
},
|
|
206
|
+
"docs": {
|
|
207
|
+
"text": "Toggles the dropdown visibility based on its current state.",
|
|
208
|
+
"tags": []
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"show": {
|
|
212
|
+
"complexType": {
|
|
213
|
+
"signature": "() => Promise<void>",
|
|
214
|
+
"parameters": [],
|
|
215
|
+
"references": {
|
|
216
|
+
"Promise": {
|
|
217
|
+
"location": "global",
|
|
218
|
+
"id": "global::Promise"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"return": "Promise<void>"
|
|
222
|
+
},
|
|
223
|
+
"docs": {
|
|
224
|
+
"text": "Displays the dropdown.",
|
|
225
|
+
"tags": []
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"hide": {
|
|
229
|
+
"complexType": {
|
|
230
|
+
"signature": "(focusParent?: boolean, forceClose?: boolean) => Promise<void>",
|
|
231
|
+
"parameters": [{
|
|
232
|
+
"name": "focusParent",
|
|
233
|
+
"type": "boolean",
|
|
234
|
+
"docs": ""
|
|
235
|
+
}, {
|
|
236
|
+
"name": "forceClose",
|
|
237
|
+
"type": "boolean",
|
|
238
|
+
"docs": ""
|
|
239
|
+
}],
|
|
240
|
+
"references": {
|
|
241
|
+
"Promise": {
|
|
242
|
+
"location": "global",
|
|
243
|
+
"id": "global::Promise"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"return": "Promise<void>"
|
|
247
|
+
},
|
|
248
|
+
"docs": {
|
|
249
|
+
"text": "Hides the dropdown with an animation.",
|
|
250
|
+
"tags": []
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"focusFirst": {
|
|
254
|
+
"complexType": {
|
|
255
|
+
"signature": "() => Promise<void>",
|
|
256
|
+
"parameters": [],
|
|
257
|
+
"references": {
|
|
258
|
+
"Promise": {
|
|
259
|
+
"location": "global",
|
|
260
|
+
"id": "global::Promise"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"return": "Promise<void>"
|
|
264
|
+
},
|
|
265
|
+
"docs": {
|
|
266
|
+
"text": "Sets focus to the first focusable element within the component.",
|
|
267
|
+
"tags": []
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
static get elementRef() { return "host"; }
|
|
273
|
+
}
|
|
274
|
+
/** Tracks the currently active dropdown instance. */
|
|
275
|
+
PostMegadropdown.activeDropdown = null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
post-megadropdown-trigger{width:100%;position:relative;z-index:3}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
import { checkType } from "../../utils/index";
|
|
4
|
+
import { eventGuard } from "../../utils/event-gua";
|
|
5
|
+
export class PostMegadropdownTrigger {
|
|
6
|
+
constructor() {
|
|
7
|
+
/**
|
|
8
|
+
* Reference to the slotted button within the trigger, if present.
|
|
9
|
+
* Used to manage click and key events for mega dropdown control.
|
|
10
|
+
*/
|
|
11
|
+
this.slottedButton = null;
|
|
12
|
+
/**
|
|
13
|
+
* Tracks whether this trigger's dropdown was expanded before a state change.
|
|
14
|
+
* Used to determine if this trigger should handle focus when its dropdown closes.
|
|
15
|
+
*/
|
|
16
|
+
this.wasExpanded = false;
|
|
17
|
+
this.handleKeyDown = (event) => {
|
|
18
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
19
|
+
event.preventDefault();
|
|
20
|
+
this.handleToggle();
|
|
21
|
+
if (this.megadropdown && !this.ariaExpanded) {
|
|
22
|
+
setTimeout(() => this.megadropdown.focusFirst(), 100);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.handleToggleMegadropdown = (event) => {
|
|
27
|
+
eventGuard(this.host, event, { targetLocalName: 'post-megadropdown' }, () => {
|
|
28
|
+
if (event.target.id === this.for) {
|
|
29
|
+
this.ariaExpanded = event.detail.isVisible;
|
|
30
|
+
// Focus on the trigger parent of the dropdown after it's closed if the close button had been clicked
|
|
31
|
+
if (this.wasExpanded && !this.ariaExpanded && event.detail.focusParent) {
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
this.slottedButton?.focus();
|
|
34
|
+
}, 100);
|
|
35
|
+
}
|
|
36
|
+
this.wasExpanded = this.ariaExpanded;
|
|
37
|
+
if (this.slottedButton) {
|
|
38
|
+
this.slottedButton.setAttribute('aria-expanded', this.ariaExpanded.toString());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
this.for = undefined;
|
|
44
|
+
this.ariaExpanded = false;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Watch for changes to the `for` property to validate its type and ensure it is a string.
|
|
48
|
+
* @param forValue - The new value of the `for` property.
|
|
49
|
+
*/
|
|
50
|
+
validateControlFor() {
|
|
51
|
+
checkType(this, 'for', 'string');
|
|
52
|
+
}
|
|
53
|
+
get megadropdown() {
|
|
54
|
+
const ref = document.getElementById(this.for);
|
|
55
|
+
return ref && ref.localName === 'post-megadropdown'
|
|
56
|
+
? ref
|
|
57
|
+
: null;
|
|
58
|
+
}
|
|
59
|
+
handleToggle() {
|
|
60
|
+
if (this.megadropdown) {
|
|
61
|
+
this.megadropdown.toggle();
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.warn(`No post-megadropdown found with ID: ${this.for}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
componentDidLoad() {
|
|
68
|
+
this.validateControlFor();
|
|
69
|
+
// Check if the mega dropdown attached to the trigger is expanded or not
|
|
70
|
+
document.addEventListener('postToggleMegadropdown', this.handleToggleMegadropdown);
|
|
71
|
+
this.slottedButton = this.host.querySelector('button');
|
|
72
|
+
if (this.slottedButton) {
|
|
73
|
+
this.slottedButton.setAttribute('aria-haspopup', 'menu');
|
|
74
|
+
this.slottedButton.addEventListener('click', () => {
|
|
75
|
+
this.handleToggle();
|
|
76
|
+
});
|
|
77
|
+
this.slottedButton.addEventListener('keydown', this.handleKeyDown);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.warn('No button found within post-megadropdown-trigger');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
document.removeEventListener('postToggleMegadropdown', this.handleToggleMegadropdown);
|
|
85
|
+
}
|
|
86
|
+
render() {
|
|
87
|
+
return (h(Host, { key: '86b85efede8d9b19f3f0560f500f33f5e172177f', "data-version": version, "tab-index": "-1" }, h("button", { key: '0f810e4c38bc4abf23ac60ab27b36d408e7ced0d' }, h("slot", { key: '2a522ac7e15ef8ac077b73cdebf629b89ea173c6' }))));
|
|
88
|
+
}
|
|
89
|
+
static get is() { return "post-megadropdown-trigger"; }
|
|
90
|
+
static get originalStyleUrls() {
|
|
91
|
+
return {
|
|
92
|
+
"$": ["post-megadropdown-trigger.scss"]
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
static get styleUrls() {
|
|
96
|
+
return {
|
|
97
|
+
"$": ["post-megadropdown-trigger.css"]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
static get properties() {
|
|
101
|
+
return {
|
|
102
|
+
"for": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"mutable": false,
|
|
105
|
+
"complexType": {
|
|
106
|
+
"original": "string",
|
|
107
|
+
"resolved": "string",
|
|
108
|
+
"references": {}
|
|
109
|
+
},
|
|
110
|
+
"required": true,
|
|
111
|
+
"optional": false,
|
|
112
|
+
"docs": {
|
|
113
|
+
"tags": [],
|
|
114
|
+
"text": "ID of the mega dropdown element that this trigger is linked to. Used to open and close the specified mega dropdown."
|
|
115
|
+
},
|
|
116
|
+
"attribute": "for",
|
|
117
|
+
"reflect": false
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static get states() {
|
|
122
|
+
return {
|
|
123
|
+
"ariaExpanded": {}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static get elementRef() { return "host"; }
|
|
127
|
+
static get watchers() {
|
|
128
|
+
return [{
|
|
129
|
+
"propName": "for",
|
|
130
|
+
"methodName": "validateControlFor"
|
|
131
|
+
}];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@keyframes popIn{from{transform:scale(0.9);opacity:0;transition-property:transform,opacity,overlay,display;transition-behavior:allow-discrete;transition-duration:var(--post-transition-duration, 0.35s);transition-timing-function:linear(0, 0.007, 0.029 2.2%, 0.118 4.7%, 0.625 14.4%, 0.826 19%, 0.902, 0.962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.061 40.5%, 1.015 53.4%, 0.999 61.6%, 0.995 71.2%, 1)}to{opacity:1;transform:scale(1)}}: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}
|