@swisspost/design-system-components 9.0.0-next.33 → 9.0.0-next.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{attribute-observer-6d8b886b.js → attribute-observer-c3a805b2.js} +3 -1
- package/dist/cjs/{breakpoints-c6247c71.js → breakpoints-cdf1b747.js} +12 -7
- package/dist/cjs/get-root-8102fecd.js +17 -0
- package/dist/cjs/{index-d6bf2c66.js → index-b60129c4.js} +2 -2
- package/dist/cjs/index.cjs.js +24 -25
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/long-press-event-6e62d113.js +266 -0
- package/dist/cjs/{package-3562c265.js → package-3426e8f7.js} +1 -1
- package/dist/cjs/{post-accordion-6c5681ba.js → post-accordion-3ac8dca8.js} +5 -5
- package/dist/cjs/{post-accordion-item-05a78451.js → post-accordion-item-aace6bc2.js} +5 -5
- package/dist/cjs/post-accordion-item.cjs.entry.js +5 -4
- package/dist/cjs/post-accordion.cjs.entry.js +4 -3
- package/dist/cjs/{post-avatar-6710a77a.js → post-avatar-53abd22f.js} +5 -4
- package/dist/cjs/post-avatar.cjs.entry.js +4 -3
- package/dist/cjs/{post-back-to-top-d0662842.js → post-back-to-top-b231fc1c.js} +9 -9
- package/dist/cjs/post-back-to-top.cjs.entry.js +4 -3
- package/dist/cjs/{post-banner-bd97db9c.js → post-banner-e6d14bf1.js} +4 -8
- package/dist/cjs/post-banner.cjs.entry.js +4 -3
- package/dist/cjs/{post-breadcrumb-36ab841c.js → post-breadcrumb-a929f2a6.js} +30 -22
- package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +4 -3
- package/dist/cjs/post-breadcrumb.cjs.entry.js +4 -4
- package/dist/cjs/{post-card-control-155fb433.js → post-card-control-cbee7b86.js} +26 -40
- package/dist/cjs/post-card-control.cjs.entry.js +4 -3
- package/dist/cjs/post-closebutton_15.cjs.entry.js +5 -5
- package/dist/cjs/{post-collapsible-trigger-6601c554.js → post-collapsible-trigger-d1cb592a.js} +24 -41
- package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
- package/dist/cjs/post-components.cjs.js +2 -2
- package/dist/cjs/{post-footer-23699aef.js → post-footer-4290dafc.js} +11 -11
- package/dist/cjs/post-footer.cjs.entry.js +4 -4
- package/dist/cjs/{post-linkarea-8e5e1a9f.js → post-linkarea-f22f4f92.js} +5 -5
- package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
- package/dist/cjs/{post-menu-item-8dd94792.js → post-menu-item-afabaa61.js} +4 -4
- package/dist/cjs/{post-popover-858cbd12.js → post-popover-a4c72d38.js} +16 -14
- package/dist/cjs/post-popover.cjs.entry.js +5 -4
- package/dist/cjs/{post-rating-ef592484.js → post-rating-b87616fc.js} +4 -14
- package/dist/cjs/post-rating.cjs.entry.js +3 -3
- package/dist/cjs/{post-tab-header-d785e7fc.js → post-tab-header-45cb6bb4.js} +5 -4
- package/dist/cjs/post-tab-header.cjs.entry.js +4 -3
- package/dist/cjs/{post-tab-panel-41ea371e.js → post-tab-panel-00d16ba7.js} +4 -4
- package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
- package/dist/cjs/{post-tabs-c6f00130.js → post-tabs-2c3a89d0.js} +5 -12
- package/dist/cjs/post-tabs.cjs.entry.js +4 -3
- package/dist/cjs/{post-tag-d1a1176c.js → post-tag-370a2f4d.js} +3 -3
- package/dist/cjs/post-tag.cjs.entry.js +3 -3
- package/dist/cjs/{post-togglebutton-02c56b7b.js → post-togglebutton-2c9552e3.js} +935 -460
- package/dist/cjs/{post-tooltip-3176e280.js → post-tooltip-4d4d2ea9.js} +39 -296
- package/dist/cjs/post-tooltip.cjs.entry.js +5 -4
- package/dist/collection/animations/collapse.js +3 -1
- package/dist/collection/components/post-accordion/post-accordion.js +1 -3
- package/dist/collection/components/post-accordion-item/post-accordion-item.js +0 -2
- package/dist/collection/components/post-avatar/post-avatar.js +3 -4
- package/dist/collection/components/post-back-to-top/post-back-to-top.js +6 -8
- package/dist/collection/components/post-banner/post-banner.js +0 -6
- package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +16 -19
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +0 -2
- package/dist/collection/components/post-card-control/post-card-control.js +24 -40
- package/dist/collection/components/post-closebutton/post-closebutton.css +1 -0
- package/dist/collection/components/post-closebutton/post-closebutton.js +12 -2
- package/dist/collection/components/post-collapsible/post-collapsible.js +4 -10
- package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +15 -28
- package/dist/collection/components/post-footer/post-footer.js +8 -9
- package/dist/collection/components/post-header/post-header.css +1 -1
- package/dist/collection/components/post-header/post-header.js +13 -22
- package/dist/collection/components/post-icon/post-icon.js +4 -6
- package/dist/collection/components/post-language-option/post-language-option.js +1 -10
- package/dist/collection/components/post-language-switch/post-language-switch.js +7 -19
- package/dist/collection/components/post-linkarea/post-linkarea.css +1 -1
- package/dist/collection/components/post-linkarea/post-linkarea.js +2 -2
- package/dist/collection/components/post-list/post-list.js +1 -3
- package/dist/collection/components/post-list-item/post-list-item.js +1 -2
- package/dist/collection/components/post-logo/post-logo.js +1 -2
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +98 -182
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +20 -30
- package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +36 -37
- package/dist/collection/components/post-menu/post-menu.js +45 -53
- package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +13 -15
- package/dist/collection/components/post-popover/post-popover.js +12 -12
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +30 -33
- package/dist/collection/components/post-rating/post-rating.js +1 -12
- package/dist/collection/components/post-tab-header/post-tab-header.js +2 -3
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +2 -3
- package/dist/collection/components/post-tabs/post-tabs.js +1 -10
- package/dist/collection/components/post-tag/post-tag.js +0 -1
- package/dist/collection/components/post-togglebutton/post-togglebutton.js +10 -11
- package/dist/collection/components/post-tooltip/post-tooltip.js +36 -32
- package/dist/collection/utils/attribute-observer.js +2 -1
- package/dist/collection/utils/breakpoints.js +9 -7
- package/dist/collection/utils/environment.js +2 -0
- package/dist/collection/utils/get-root.js +6 -1
- package/dist/collection/utils/index.js +5 -0
- package/dist/collection/utils/is-motion-reduced.js +2 -1
- package/dist/components/attribute-observer.js +3 -1
- package/dist/components/breakpoints.js +12 -8
- package/dist/components/get-root.js +7 -1
- package/dist/components/long-press-event.js +264 -0
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +3 -3
- package/dist/components/post-accordion2.js +3 -3
- package/dist/components/post-avatar2.js +4 -3
- package/dist/components/post-back-to-top2.js +8 -8
- package/dist/components/post-banner2.js +2 -6
- package/dist/components/post-breadcrumb-item2.js +2 -2
- package/dist/components/post-breadcrumb2.js +28 -20
- package/dist/components/post-card-control2.js +25 -39
- package/dist/components/post-closebutton2.js +8 -3
- package/dist/components/post-collapsible-trigger2.js +19 -31
- package/dist/components/post-collapsible2.js +9 -12
- package/dist/components/post-footer2.js +8 -8
- package/dist/components/post-header2.js +15 -23
- package/dist/components/post-icon2.js +5 -5
- package/dist/components/post-language-option2.js +3 -10
- package/dist/components/post-language-switch2.js +9 -18
- package/dist/components/post-linkarea2.js +5 -4
- package/dist/components/post-list-item2.js +2 -2
- package/dist/components/post-list2.js +2 -3
- package/dist/components/post-logo2.js +3 -2
- package/dist/components/post-mainnavigation2.js +94 -182
- package/dist/components/post-megadropdown-trigger2.js +38 -37
- package/dist/components/post-megadropdown2.js +21 -30
- package/dist/components/post-menu-trigger2.js +15 -15
- package/dist/components/post-menu2.js +48 -54
- package/dist/components/post-popover2.js +14 -12
- package/dist/components/post-popovercontainer2.js +638 -36
- package/dist/components/post-rating2.js +2 -12
- package/dist/components/post-tab-header2.js +4 -3
- package/dist/components/post-tab-panel2.js +3 -3
- package/dist/components/post-tabs2.js +3 -10
- package/dist/components/post-tag2.js +1 -1
- package/dist/components/post-togglebutton2.js +12 -11
- package/dist/components/post-tooltip2.js +37 -294
- package/dist/docs.json +21 -15
- package/dist/esm/{attribute-observer-2f203993.js → attribute-observer-009deee5.js} +3 -1
- package/dist/esm/{breakpoints-bbe0c54e.js → breakpoints-7812702e.js} +12 -8
- package/dist/esm/get-root-1b1af46f.js +15 -0
- package/dist/esm/{index-3419e46d.js → index-f4d19816.js} +2 -2
- package/dist/esm/index.js +24 -25
- package/dist/esm/loader.js +3 -3
- package/dist/esm/long-press-event-04d24397.js +264 -0
- package/dist/esm/package-8986a24c.js +3 -0
- package/dist/esm/{post-accordion-024451fa.js → post-accordion-577b52a0.js} +5 -5
- package/dist/esm/{post-accordion-item-19b996d1.js → post-accordion-item-99053b41.js} +5 -5
- package/dist/esm/post-accordion-item.entry.js +5 -4
- package/dist/esm/post-accordion.entry.js +4 -3
- package/dist/esm/{post-avatar-33aed045.js → post-avatar-2914706c.js} +5 -4
- package/dist/esm/post-avatar.entry.js +4 -3
- package/dist/esm/{post-back-to-top-7dd43c3b.js → post-back-to-top-4c7b1b47.js} +9 -9
- package/dist/esm/post-back-to-top.entry.js +4 -3
- package/dist/esm/{post-banner-28d18721.js → post-banner-295fd0f5.js} +4 -8
- package/dist/esm/post-banner.entry.js +4 -3
- package/dist/esm/{post-breadcrumb-d86fae7b.js → post-breadcrumb-1abfb312.js} +30 -22
- package/dist/esm/post-breadcrumb-item_2.entry.js +4 -3
- package/dist/esm/post-breadcrumb.entry.js +4 -4
- package/dist/esm/{post-card-control-aa043898.js → post-card-control-ad72d4f8.js} +26 -40
- package/dist/esm/post-card-control.entry.js +4 -3
- package/dist/esm/post-closebutton_15.entry.js +5 -5
- package/dist/esm/{post-collapsible-trigger-b1612866.js → post-collapsible-trigger-6b4ece20.js} +24 -41
- package/dist/esm/post-collapsible_2.entry.js +5 -5
- package/dist/esm/post-components.js +3 -3
- package/dist/esm/{post-footer-2ed5e520.js → post-footer-a5105e66.js} +11 -11
- package/dist/esm/post-footer.entry.js +4 -4
- package/dist/esm/{post-linkarea-802bf774.js → post-linkarea-22f97a88.js} +5 -5
- package/dist/esm/post-linkarea.entry.js +3 -3
- package/dist/esm/{post-menu-item-d97611d8.js → post-menu-item-9465a1f3.js} +4 -4
- package/dist/esm/{post-popover-e51a7a18.js → post-popover-e9b4569c.js} +16 -14
- package/dist/esm/post-popover.entry.js +5 -4
- package/dist/esm/{post-rating-e1ac47ce.js → post-rating-ae16e3c9.js} +4 -14
- package/dist/esm/post-rating.entry.js +3 -3
- package/dist/esm/{post-tab-header-06dcbf7f.js → post-tab-header-11f23150.js} +5 -4
- package/dist/esm/post-tab-header.entry.js +4 -3
- package/dist/esm/{post-tab-panel-75932601.js → post-tab-panel-0f3a952e.js} +4 -4
- package/dist/esm/post-tab-panel.entry.js +3 -3
- package/dist/esm/{post-tabs-3ef2ea23.js → post-tabs-1192509c.js} +5 -12
- package/dist/esm/post-tabs.entry.js +4 -3
- package/dist/esm/{post-tag-a3b989e0.js → post-tag-8be0a71c.js} +3 -3
- package/dist/esm/post-tag.entry.js +3 -3
- package/dist/esm/{post-togglebutton-db251030.js → post-togglebutton-b634fc7c.js} +935 -460
- package/dist/esm/{post-tooltip-c256d714.js → post-tooltip-f64bd0cc.js} +39 -296
- package/dist/esm/post-tooltip.entry.js +5 -4
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-0f398677.js +1 -0
- package/dist/post-components/p-1038fc25.js +1 -0
- package/dist/post-components/p-30f94eca.entry.js +1 -0
- package/dist/post-components/p-31bb6dc5.entry.js +1 -0
- package/dist/post-components/p-32173742.js +1 -0
- package/dist/post-components/p-338a2507.js +1 -0
- package/dist/post-components/p-36540dd6.entry.js +1 -0
- package/dist/post-components/p-3aa766a6.js +1 -0
- package/dist/post-components/p-3b0158b3.js +1 -0
- package/dist/post-components/p-40db8cd5.js +1 -0
- package/dist/post-components/p-44f13ce4.entry.js +1 -0
- package/dist/post-components/p-46a9324f.entry.js +1 -0
- package/dist/post-components/p-49c5aa99.js +1 -0
- package/dist/post-components/p-4cd4a936.entry.js +1 -0
- package/dist/post-components/p-548ef2f5.entry.js +1 -0
- package/dist/post-components/p-58f453dd.js +1 -0
- package/dist/post-components/p-5f54b77f.js +1 -0
- package/dist/post-components/p-60bb7f26.js +1 -0
- package/dist/post-components/p-60bfa4be.entry.js +1 -0
- package/dist/post-components/p-6b31a76a.js +1 -0
- package/dist/post-components/p-6ee81c5d.js +1 -0
- package/dist/post-components/p-6faad212.entry.js +1 -0
- package/dist/post-components/p-722ffaae.js +1 -0
- package/dist/post-components/p-74a0b44c.entry.js +1 -0
- package/dist/post-components/{p-dbe31632.js → p-78b4c699.js} +1 -1
- package/dist/post-components/p-7aa0468b.entry.js +1 -0
- package/dist/post-components/p-7afc495e.entry.js +1 -0
- package/dist/post-components/p-8db32dab.js +8 -0
- package/dist/post-components/p-96034ba4.entry.js +1 -0
- package/dist/post-components/p-9aaf9f54.js +1 -0
- package/dist/post-components/{p-5c758f41.js → p-9e461613.js} +1 -1
- package/dist/post-components/p-ab4073be.js +1 -0
- package/dist/post-components/p-abd7eb91.js +8 -0
- package/dist/post-components/p-afb8a487.entry.js +1 -0
- package/dist/post-components/p-b003b381.js +1 -0
- package/dist/post-components/p-b97dea1e.entry.js +1 -0
- package/dist/post-components/p-be37cf2a.js +1 -0
- package/dist/post-components/p-c31b56ed.js +1 -0
- package/dist/post-components/p-ccbb51fe.js +1 -0
- package/dist/post-components/p-d3900385.entry.js +1 -0
- package/dist/post-components/p-ef49153c.entry.js +1 -0
- package/dist/post-components/p-f27e5691.js +1 -0
- package/dist/post-components/p-f553019f.entry.js +1 -0
- package/dist/post-components/p-ffc1db17.entry.js +1 -0
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-avatar/post-avatar.d.ts +1 -1
- package/dist/types/components/post-card-control/post-card-control.d.ts +1 -1
- package/dist/types/components/post-collapsible-trigger/post-collapsible-trigger.d.ts +4 -14
- package/dist/types/components/post-footer/post-footer.d.ts +2 -2
- package/dist/types/components/post-header/post-header.d.ts +1 -0
- package/dist/types/components/post-icon/post-icon.d.ts +0 -1
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +2 -5
- package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +14 -39
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +1 -1
- package/dist/types/components/post-popover/post-popover.d.ts +3 -1
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +1 -1
- package/dist/types/components/post-tooltip/post-tooltip.d.ts +6 -1
- package/dist/types/components.d.ts +4 -4
- package/dist/types/popover-fn.d.ts +11 -0
- package/dist/types/utils/environment.d.ts +2 -0
- package/dist/types/utils/get-root.d.ts +4 -0
- package/dist/types/utils/index.d.ts +5 -0
- package/loaders/attribute-observer.js +3 -1
- package/loaders/breakpoints.js +12 -8
- package/loaders/get-root.js +7 -1
- package/loaders/index.js +3 -3
- package/loaders/long-press-event.js +264 -0
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item2.js +3 -3
- package/loaders/post-accordion.js +3 -3
- package/loaders/post-avatar.js +4 -3
- package/loaders/post-back-to-top.js +8 -8
- package/loaders/post-banner.js +2 -6
- package/loaders/post-breadcrumb-item2.js +2 -2
- package/loaders/post-breadcrumb.js +28 -20
- package/loaders/post-card-control.js +25 -39
- package/loaders/post-closebutton.js +8 -3
- package/loaders/post-collapsible-trigger2.js +19 -31
- package/loaders/post-collapsible2.js +9 -12
- package/loaders/post-footer.js +8 -8
- package/loaders/post-header.js +15 -23
- package/loaders/post-icon2.js +5 -5
- package/loaders/post-language-option.js +3 -10
- package/loaders/post-language-switch.js +9 -18
- package/loaders/post-linkarea.js +5 -4
- package/loaders/post-list-item.js +2 -2
- package/loaders/post-list.js +2 -3
- package/loaders/post-logo.js +3 -2
- package/loaders/post-mainnavigation.js +94 -182
- package/loaders/post-megadropdown-trigger.js +38 -37
- package/loaders/post-megadropdown.js +21 -30
- package/loaders/post-menu-trigger2.js +15 -15
- package/loaders/post-menu2.js +48 -54
- package/loaders/post-popover.js +14 -12
- package/loaders/post-popovercontainer2.js +638 -36
- package/loaders/post-rating.js +2 -12
- package/loaders/post-tab-header.js +4 -3
- package/loaders/post-tab-panel.js +3 -3
- package/loaders/post-tabs.js +3 -10
- package/loaders/post-tag.js +1 -1
- package/loaders/post-togglebutton.js +12 -11
- package/loaders/post-tooltip.js +37 -294
- package/package.json +5 -5
- package/dist/cjs/debounce-158fd76f.js +0 -13
- package/dist/cjs/get-root-7a3498ef.js +0 -11
- package/dist/components/debounce.js +0 -11
- package/dist/esm/debounce-e54c7131.js +0 -11
- package/dist/esm/get-root-7af2e0d1.js +0 -9
- package/dist/esm/package-da68ab5a.js +0 -3
- package/dist/post-components/p-1376c653.js +0 -1
- package/dist/post-components/p-13835969.js +0 -1
- package/dist/post-components/p-13fdbaf6.entry.js +0 -1
- package/dist/post-components/p-1e2169ae.entry.js +0 -1
- package/dist/post-components/p-23e4c270.entry.js +0 -1
- package/dist/post-components/p-2641e06b.js +0 -1
- package/dist/post-components/p-2d3b16c7.js +0 -1
- package/dist/post-components/p-33c35e15.js +0 -1
- package/dist/post-components/p-3b247d71.entry.js +0 -1
- package/dist/post-components/p-42a5fdf8.js +0 -1
- package/dist/post-components/p-4ed7bab6.js +0 -1
- package/dist/post-components/p-5aeb3656.js +0 -1
- package/dist/post-components/p-5c518421.js +0 -1
- package/dist/post-components/p-6db1a2e0.entry.js +0 -1
- package/dist/post-components/p-6fe98184.entry.js +0 -1
- package/dist/post-components/p-7d731077.entry.js +0 -1
- package/dist/post-components/p-7ee47334.entry.js +0 -1
- package/dist/post-components/p-8223e97b.js +0 -1
- package/dist/post-components/p-8a8376d0.js +0 -1
- package/dist/post-components/p-8bb828cf.entry.js +0 -1
- package/dist/post-components/p-8e55ddd2.js +0 -1
- package/dist/post-components/p-9681efce.js +0 -1
- package/dist/post-components/p-96a59372.entry.js +0 -1
- package/dist/post-components/p-9748a355.js +0 -1
- package/dist/post-components/p-99c8fd43.entry.js +0 -1
- package/dist/post-components/p-ac042f7a.entry.js +0 -1
- package/dist/post-components/p-c34cacb7.js +0 -1
- package/dist/post-components/p-c3a970c5.js +0 -1
- package/dist/post-components/p-c4651d32.entry.js +0 -1
- package/dist/post-components/p-c9b61d31.entry.js +0 -1
- package/dist/post-components/p-d16dd7f9.js +0 -1
- package/dist/post-components/p-d81c5908.entry.js +0 -1
- package/dist/post-components/p-e1baac59.js +0 -1
- package/dist/post-components/p-e2294014.js +0 -15
- package/dist/post-components/p-e8ff8122.js +0 -1
- package/dist/post-components/p-ed78d04a.entry.js +0 -1
- package/dist/post-components/p-f1c0924a.js +0 -1
- package/dist/post-components/p-f1db96d0.entry.js +0 -1
- package/dist/post-components/p-f7aa917f.entry.js +0 -1
- package/dist/post-components/p-f96b80cc.entry.js +0 -1
- package/dist/post-components/p-fc91cbc2.js +0 -1
- package/dist/post-components/p-fd78716d.js +0 -1
- package/loaders/debounce.js +0 -11
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { e as checkEmptyOrType } from './index2.js';
|
|
3
|
+
import './breakpoints.js';
|
|
3
4
|
import { v as version } from './package.js';
|
|
4
5
|
import { c as checkType } from './check-type.js';
|
|
5
6
|
|
|
@@ -18,7 +19,6 @@ const PostLanguageOption = /*@__PURE__*/ proxyCustomElement(class PostLanguageOp
|
|
|
18
19
|
this.name = undefined;
|
|
19
20
|
this.url = undefined;
|
|
20
21
|
}
|
|
21
|
-
get host() { return this; }
|
|
22
22
|
validateCode() {
|
|
23
23
|
checkType(this, 'code', 'string');
|
|
24
24
|
}
|
|
@@ -43,14 +43,6 @@ const PostLanguageOption = /*@__PURE__*/ proxyCustomElement(class PostLanguageOp
|
|
|
43
43
|
this.postLanguageOptionInitiallyActive.emit(this.code);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
47
|
-
* An event emitted when the language option is clicked. The payload is the ISO 639 code of the language.
|
|
48
|
-
*/
|
|
49
|
-
postChange;
|
|
50
|
-
/**
|
|
51
|
-
* An event emitted when the language option is initially active. The payload is the ISO 639 code of the language.
|
|
52
|
-
*/
|
|
53
|
-
postLanguageOptionInitiallyActive;
|
|
54
46
|
/**
|
|
55
47
|
* Selects the language option programmatically.
|
|
56
48
|
*/
|
|
@@ -71,8 +63,9 @@ const PostLanguageOption = /*@__PURE__*/ proxyCustomElement(class PostLanguageOp
|
|
|
71
63
|
this.emitChange();
|
|
72
64
|
}
|
|
73
65
|
};
|
|
74
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: '3a6b9a8f63c90f431a13c1df529a2e4716ede5d8', "data-version": version }, this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null))) : (h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null)))));
|
|
75
67
|
}
|
|
68
|
+
get host() { return this; }
|
|
76
69
|
static get watchers() { return {
|
|
77
70
|
"code": ["validateCode"],
|
|
78
71
|
"active": ["validateActiveProp"],
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as checkEmptyOrOneOf } from './index2.js';
|
|
3
|
+
import './breakpoints.js';
|
|
4
|
+
import { e as eventGuard } from './event-guard.js';
|
|
3
5
|
import { v as version } from './package.js';
|
|
4
6
|
import { n as nanoid } from './index.browser.js';
|
|
5
|
-
import { e as eventGuard } from './event-guard.js';
|
|
6
7
|
import { d as defineCustomElement$4 } from './post-icon2.js';
|
|
7
8
|
import { d as defineCustomElement$3 } from './post-menu2.js';
|
|
8
9
|
import { d as defineCustomElement$2 } from './post-menu-trigger2.js';
|
|
@@ -19,12 +20,15 @@ const PostLanguageSwitch = /*@__PURE__*/ proxyCustomElement(class PostLanguageSw
|
|
|
19
20
|
super();
|
|
20
21
|
this.__registerHost();
|
|
21
22
|
this.__attachShadow();
|
|
23
|
+
this.menuId = `p${nanoid(11)}`;
|
|
22
24
|
this.caption = undefined;
|
|
23
25
|
this.description = undefined;
|
|
24
26
|
this.variant = 'list';
|
|
25
27
|
this.activeLang = undefined;
|
|
26
28
|
}
|
|
27
|
-
get
|
|
29
|
+
get languageOptions() {
|
|
30
|
+
return Array.from(this.host.querySelectorAll('post-language-option'));
|
|
31
|
+
}
|
|
28
32
|
validateCaption() {
|
|
29
33
|
checkType(this, 'caption', 'string');
|
|
30
34
|
}
|
|
@@ -42,7 +46,6 @@ const PostLanguageSwitch = /*@__PURE__*/ proxyCustomElement(class PostLanguageSw
|
|
|
42
46
|
// Initially set variants and active language
|
|
43
47
|
// Handles cases where the language-switch is rendered after the language-options have been rendered
|
|
44
48
|
this.updateChildrenVariant();
|
|
45
|
-
this.updateActiveLanguage();
|
|
46
49
|
}
|
|
47
50
|
/**
|
|
48
51
|
* Listen for the postChange event and guard it to run only for events originating from a <post-language-option> element.
|
|
@@ -73,34 +76,22 @@ const PostLanguageSwitch = /*@__PURE__*/ proxyCustomElement(class PostLanguageSw
|
|
|
73
76
|
handleInitiallyActive(event) {
|
|
74
77
|
this.activeLang = event.detail;
|
|
75
78
|
}
|
|
76
|
-
get languageOptions() {
|
|
77
|
-
return this.host.querySelectorAll('post-language-option');
|
|
78
|
-
}
|
|
79
|
-
get activeLanguageOption() {
|
|
80
|
-
return this.host.querySelector('post-language-option[active]:not([active="false"])');
|
|
81
|
-
}
|
|
82
|
-
handleSlotChange() {
|
|
83
|
-
this.updateActiveLanguage();
|
|
84
|
-
}
|
|
85
|
-
updateActiveLanguage() {
|
|
86
|
-
this.activeLang = this.activeLanguageOption.getAttribute('code');
|
|
87
|
-
}
|
|
88
79
|
// Update post-language-option variant to have the correct style
|
|
89
80
|
updateChildrenVariant() {
|
|
90
81
|
this.languageOptions.forEach(el => {
|
|
91
82
|
el.setAttribute('variant', this.variant);
|
|
92
83
|
});
|
|
93
84
|
}
|
|
94
|
-
menuId = `p${nanoid(11)}`;
|
|
95
85
|
renderList() {
|
|
96
|
-
return (h(Host, { "data-version": version, role: "list", "aria-label": this.caption }, h("div", { class: "post-language-switch-list", role: "group", "aria-label": this.description }, h("slot",
|
|
86
|
+
return (h(Host, { "data-version": version, role: "list", "aria-label": this.caption }, h("div", { class: "post-language-switch-list", role: "group", "aria-label": this.description }, h("slot", null))));
|
|
97
87
|
}
|
|
98
88
|
renderDropdown() {
|
|
99
|
-
return (h(Host, { "data-version": version }, h("post-menu-trigger", { for: this.menuId }, h("button", { class: "post-language-switch-trigger", "aria-label": this.description }, this.activeLang, h("post-icon", { "aria-hidden": "true", name: "chevrondown" }))), h("post-menu", { id: this.menuId, class: "post-language-switch-dropdown-container", "aria-label": this.caption }, h("slot",
|
|
89
|
+
return (h(Host, { "data-version": version }, h("post-menu-trigger", { for: this.menuId }, h("button", { class: "post-language-switch-trigger", "aria-label": this.description }, this.activeLang, h("post-icon", { "aria-hidden": "true", name: "chevrondown" }))), h("post-menu", { id: this.menuId, class: "post-language-switch-dropdown-container", "aria-label": this.caption }, h("slot", null))));
|
|
100
90
|
}
|
|
101
91
|
render() {
|
|
102
92
|
return this.variant === 'list' ? this.renderList() : this.renderDropdown();
|
|
103
93
|
}
|
|
94
|
+
get host() { return this; }
|
|
104
95
|
static get watchers() { return {
|
|
105
96
|
"caption": ["validateCaption"],
|
|
106
97
|
"description": ["validateDescription"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
|
|
4
|
-
const postLinkareaCss = "
|
|
4
|
+
const postLinkareaCss = ":host{display:contents;cursor:pointer}";
|
|
5
5
|
const PostLinkareaStyle0 = postLinkareaCss;
|
|
6
6
|
|
|
7
7
|
const INTERACTIVE_ELEMENTS = ['a'].join(',');
|
|
@@ -10,8 +10,8 @@ const PostLinkarea = /*@__PURE__*/ proxyCustomElement(class PostLinkarea extends
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
12
12
|
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
13
14
|
}
|
|
14
|
-
get host() { return this; }
|
|
15
15
|
dispatchClick({ ctrlKey, shiftKey, altKey, metaKey }) {
|
|
16
16
|
const interactiveElement = this.host.querySelector(`[data-link]${INTERACTIVE_ELEMENTS_SELECTOR}`) ??
|
|
17
17
|
this.host.querySelector(INTERACTIVE_ELEMENTS_SELECTOR);
|
|
@@ -21,10 +21,11 @@ const PostLinkarea = /*@__PURE__*/ proxyCustomElement(class PostLinkarea extends
|
|
|
21
21
|
interactiveElement.dispatchEvent(new MouseEvent('click', { ctrlKey, shiftKey, altKey, metaKey }));
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '56e4b032fa8976cc120bff5f1c36d55167e54e98', "data-version": version, onClick: (e) => this.dispatchClick(e), tabindex: "0" }, h("slot", { key: '25568fab2a47d765757c00fbee4f2999c1da16d1' })));
|
|
25
25
|
}
|
|
26
|
+
get host() { return this; }
|
|
26
27
|
static get style() { return PostLinkareaStyle0; }
|
|
27
|
-
}, [
|
|
28
|
+
}, [1, "post-linkarea"]);
|
|
28
29
|
function defineCustomElement() {
|
|
29
30
|
if (typeof customElements === "undefined") {
|
|
30
31
|
return;
|
|
@@ -10,13 +10,13 @@ const PostListItem = /*@__PURE__*/ proxyCustomElement(class PostListItem extends
|
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
}
|
|
13
|
-
get host() { return this; }
|
|
14
13
|
connectedCallback() {
|
|
15
14
|
this.host.setAttribute('slot', 'post-list-item');
|
|
16
15
|
}
|
|
17
16
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
17
|
+
return (h(Host, { key: 'c826293ea2a7446bea2f5b223934b444655198a0', role: "listitem", slot: "post-list-item", version: version }, h("slot", { key: 'b997f79da2fbc87fbc6a388c118a03c008ad2c23' })));
|
|
19
18
|
}
|
|
19
|
+
get host() { return this; }
|
|
20
20
|
static get style() { return PostListItemStyle0; }
|
|
21
21
|
}, [1, "post-list-item"]);
|
|
22
22
|
function defineCustomElement() {
|
|
@@ -13,8 +13,6 @@ const PostList = /*@__PURE__*/ proxyCustomElement(class PostList extends HTMLEle
|
|
|
13
13
|
this.titleHidden = false;
|
|
14
14
|
this.horizontal = false;
|
|
15
15
|
}
|
|
16
|
-
get host() { return this; }
|
|
17
|
-
titleEl;
|
|
18
16
|
componentWillLoad() {
|
|
19
17
|
/**
|
|
20
18
|
* Get the id set on the host element or use a random id by default
|
|
@@ -30,8 +28,9 @@ const PostList = /*@__PURE__*/ proxyCustomElement(class PostList extends HTMLEle
|
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
render() {
|
|
33
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: 'b003aa61735359b6a1d95aad8d29c609d5bb3c8b', "data-version": version }, h("div", { key: '2f69a2c72dd357767735e10d16f1b7586da6d5a3', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: '3982783d438519673a676323339a013d3edb84db' })), h("div", { key: 'b8a91c4430774f019cc46aa19393e2a1566204a5', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: '378a51785c4d52df8ae422657a16e8295b405149', name: "post-list-item" }))));
|
|
34
32
|
}
|
|
33
|
+
get host() { return this; }
|
|
35
34
|
static get style() { return PostListStyle0; }
|
|
36
35
|
}, [4, "post-list", {
|
|
37
36
|
"titleHidden": [4, "title-hidden"],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { d as checkEmptyOrUrl } from './index2.js';
|
|
4
|
+
import './breakpoints.js';
|
|
4
5
|
|
|
5
6
|
const postLogoCss = ":host,.logo{display:inline-block}:host,:host .logo>svg,.logo,.logo .logo>svg{height:100%}.description{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.logo-link{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}.logo-link:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.logo-link:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.logo-link:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.logo-link:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.logo-link :focus,:focus-visible{border-radius:2px}";
|
|
6
7
|
const PostLogoStyle0 = postLogoCss;
|
|
@@ -12,7 +13,6 @@ const PostLogo = /*@__PURE__*/ proxyCustomElement(class PostLogo extends HTMLEle
|
|
|
12
13
|
this.__attachShadow();
|
|
13
14
|
this.url = undefined;
|
|
14
15
|
}
|
|
15
|
-
get host() { return this; }
|
|
16
16
|
validateUrl() {
|
|
17
17
|
checkEmptyOrUrl(this, 'url');
|
|
18
18
|
}
|
|
@@ -28,8 +28,9 @@ const PostLogo = /*@__PURE__*/ proxyCustomElement(class PostLogo extends HTMLEle
|
|
|
28
28
|
render() {
|
|
29
29
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
30
30
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
31
|
-
return (h(Host, { key: '
|
|
31
|
+
return (h(Host, { key: '7dee19302c0c560b29f09b1675135f10d41fc44a', "data-version": version }, h(LogoTag, { key: '1d851ca305d1bfc24666b416ad5f210b96d39811', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'cd75bd4040bc2f0d62e5cec2afc9529fa7c43c49', class: "description" }, h("slot", { key: 'caf63c4f823873181fa52cfb0cf38217b6a45823', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'd41c14973b829eb35764c9e562fe449e65f410b4', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '90c52e528bf4fc8e075e6517c18a59686ffd39f6', id: "Logo" }, h("rect", { key: '50633d1110596123232f07272406ebd0a32ffce8', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '7a617412c094669a66914edf769fba9ee9448b83', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: '74213b21fad18ba6a1dbb07e0b0b7dcf4a89b855', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
|
|
32
32
|
}
|
|
33
|
+
get host() { return this; }
|
|
33
34
|
static get watchers() { return {
|
|
34
35
|
"url": ["validateUrl"]
|
|
35
36
|
}; }
|
|
@@ -2,253 +2,165 @@ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal
|
|
|
2
2
|
import { v as version } from './package.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './post-icon2.js';
|
|
4
4
|
|
|
5
|
-
const postMainnavigationCss = "post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button{background-color:ButtonFace !important}post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:Highlight !important}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item post-megadropdown-trigger button{flex:0 0 fit-content;white-space:nowrap;display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:4px;outline-offset:-2px !important}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.98px){post-mainnavigation .back-button{font-size:16px}}@media screen and (max-width: 599.98px){post-mainnavigation .back-button{font-size:14px}}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{content:\"\";mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:24px;width:24px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation>button,post-mainnavigation post-megadropdown-trigger button{border:1px solid ButtonBorder !important}post-mainnavigation>button:hover::after,post-mainnavigation>button[aria-expanded=true]::after,post-mainnavigation post-megadropdown-trigger button:hover::after,post-mainnavigation post-megadropdown-trigger button[aria-expanded=true]::after{color:HighlightText}}@media screen and (min-width: 1024px){post-mainnavigation{display:block;overflow-x:hidden}post-mainnavigation nav{max-width:100%;background:#fff;max-height:var(--post-main-navigation-height);user-select:none;transition:margin 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{z-index:4;position:absolute;inset-block-end:0;overflow:hidden}post-mainnavigation .left-scroll-button button,post-mainnavigation .right-scroll-button button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;background:#fff;padding:16px;box-shadow:var(--post-device-elevation-500);line-height:100%;height:var(--post-main-navigation-height)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){post-mainnavigation .left-scroll-button button,post-mainnavigation .right-scroll-button button{background-color:ButtonFace !important}post-mainnavigation .left-scroll-button button:hover,post-mainnavigation .right-scroll-button button:hover{background-color:Highlight !important}}@media screen and (min-width: 1024px){post-mainnavigation .left-scroll-button button post-icon,post-mainnavigation .right-scroll-button button post-icon{font-size:1rem}}@media screen and (min-width: 1024px){post-mainnavigation .left-scroll-button.d-none,post-mainnavigation .right-scroll-button.d-none{display:none}}@media screen and (min-width: 1024px){post-mainnavigation .left-scroll-button{inset-inline-start:0;padding-inline-end:2rem}}@media screen and (min-width: 1024px){post-mainnavigation .right-scroll-button{inset-inline-end:0;padding-inline-start:2rem}}@media screen and (min-width: 1024px){post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{position:sticky;padding-inline:12px;height:var(--post-main-navigation-height);gap:4px;font-size:16px;z-index:4}post-mainnavigation post-list-item>a .nav-el-active,post-mainnavigation post-list-item>button .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-active{font-weight:700;text-align:center;opacity:0}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{position:absolute;opacity:1;text-align:center;width:100%;inset-inline-start:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff;font-weight:700}post-mainnavigation post-list-item>a.selected .nav-el-active,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item>button.selected .nav-el-active,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-active{opacity:1}post-mainnavigation post-list-item>a.selected .nav-el-inactive,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item>button.selected .nav-el-inactive,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-inactive{opacity:0}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}}@media screen and (min-width: 1024px)and (max-width: 599.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{font-size:14px}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:12px;transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{width:calc(100% - 28px)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}}@media screen and (min-width: 1024px){post-mainnavigation post-megadropdown button:not(.btn-icon-close),post-mainnavigation post-megadropdown a{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-megadropdown button:not(.btn-icon-close)::before,post-mainnavigation post-megadropdown a::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-megadropdown button:not(.btn-icon-close).selected,post-mainnavigation post-megadropdown button:not(.btn-icon-close)[aria-expanded=true],post-mainnavigation post-megadropdown a.selected,post-mainnavigation post-megadropdown a[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover,post-mainnavigation post-megadropdown a:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::before,post-mainnavigation post-megadropdown a:hover::before{background-color:#504f4b}}@media screen and (min-width: 1024px){post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.98px){post-mainnavigation nav{transform:none !important}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{display:none}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-list-item>a::before,post-mainnavigation post-list-item>button::before,post-mainnavigation post-list-item post-megadropdown-trigger button::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-list-item>a:hover::before,post-mainnavigation post-list-item>button:hover::before,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::before{background-color:#504f4b}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{display:none}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{transform:rotate(-90deg)}}post-mainnavigation .back-button .btn{padding-inline:0}";
|
|
5
|
+
const postMainnavigationCss = "post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:var(--post-scheme-color-interactive-button-secondary-enabled-fg);font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button{background-color:ButtonFace !important}post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:Highlight !important}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item post-megadropdown-trigger button{flex:0 0 fit-content;white-space:nowrap;display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:4px;outline-offset:-2px !important}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.98px){post-mainnavigation .back-button{font-size:16px}}@media screen and (max-width: 599.98px){post-mainnavigation .back-button{font-size:14px}}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{content:\"\";mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:24px;width:24px}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation>button,post-mainnavigation post-megadropdown-trigger button{border:1px solid ButtonBorder !important}post-mainnavigation>button:hover::after,post-mainnavigation>button[aria-expanded=true]::after,post-mainnavigation post-megadropdown-trigger button:hover::after,post-mainnavigation post-megadropdown-trigger button[aria-expanded=true]::after{color:HighlightText}}@media screen and (min-width: 1024px){post-mainnavigation{display:block;position:relative;height:var(--post-main-navigation-height);background:#fff;user-select:none}post-mainnavigation nav{flex:1 1 auto;overflow:hidden;scroll-behavior:smooth}post-mainnavigation .scroll-control{cursor:pointer;position:absolute;inset-block:0;z-index:5;padding:16px;background:#fff;box-shadow:var(--post-device-elevation-500);line-height:1}post-mainnavigation .scroll-control.scroll-left{inset-inline-start:0}post-mainnavigation .scroll-control.scroll-right{inset-inline-end:0}post-mainnavigation .scroll-control.d-none{display:none}post-mainnavigation .scroll-control post-icon{font-size:1rem}post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{position:sticky;padding-inline:12px;height:var(--post-main-navigation-height);gap:4px;font-size:16px;z-index:4}post-mainnavigation post-list-item>a .nav-el-active,post-mainnavigation post-list-item>button .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-active{font-weight:700;text-align:center;opacity:0}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{position:absolute;opacity:1;text-align:center;width:100%;inset-inline-start:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff;font-weight:700}post-mainnavigation post-list-item>a.selected .nav-el-active,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item>button.selected .nav-el-active,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-active,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-active{opacity:1}post-mainnavigation post-list-item>a.selected .nav-el-inactive,post-mainnavigation post-list-item>a[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item>button.selected .nav-el-inactive,post-mainnavigation post-list-item>button[aria-expanded=true] .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button.selected .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true] .nav-el-inactive{opacity:0}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}}@media screen and (min-width: 1024px)and (max-width: 599.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{font-size:14px}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:12px;transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{width:calc(100% - 28px)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}}@media screen and (min-width: 1024px){post-mainnavigation post-megadropdown button:not(.btn-icon-close),post-mainnavigation post-megadropdown a{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-megadropdown button:not(.btn-icon-close)::before,post-mainnavigation post-megadropdown a::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-megadropdown button:not(.btn-icon-close).selected,post-mainnavigation post-megadropdown button:not(.btn-icon-close)[aria-expanded=true],post-mainnavigation post-megadropdown a.selected,post-mainnavigation post-megadropdown a[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover,post-mainnavigation post-megadropdown a:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::before,post-mainnavigation post-megadropdown a:hover::before{background-color:#504f4b}}@media screen and (min-width: 1024px){post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.98px){post-mainnavigation nav{transform:none !important}post-mainnavigation .scroll-control{display:none}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;min-width:100%;height:48px;padding-inline:8px 12px;gap:16px;font-weight:400;position:relative}post-mainnavigation post-list-item>a::before,post-mainnavigation post-list-item>button::before,post-mainnavigation post-list-item post-megadropdown-trigger button::before{content:\"\";background-color:#050400;bottom:0;width:100%;height:1px;position:absolute;left:0}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{background-color:#050400;color:#fff}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{background-color:#504f4b;color:#fff}post-mainnavigation post-list-item>a:hover::before,post-mainnavigation post-list-item>button:hover::before,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::before{background-color:#504f4b}post-mainnavigation post-list-item>a .nav-el-inactive,post-mainnavigation post-list-item>button .nav-el-inactive,post-mainnavigation post-list-item post-megadropdown-trigger button .nav-el-inactive{display:none}post-mainnavigation>button::after,post-mainnavigation post-megadropdown-trigger button::after{transform:rotate(-90deg)}}post-mainnavigation .back-button .btn{padding-inline:0}";
|
|
6
6
|
const PostMainnavigationStyle0 = postMainnavigationCss;
|
|
7
7
|
|
|
8
8
|
const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
|
|
9
9
|
const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
|
|
10
|
-
const NAVIGATION_LIST_SELECTOR = 'post-list > [role="list"]:not(post-megadropdown *)';
|
|
11
|
-
const NAVIGATION_ITEM_SELECTOR = 'post-list-item :is(a, button):not(post-megadropdown *)';
|
|
12
10
|
const PostMainnavigation = /*@__PURE__*/ proxyCustomElement(class PostMainnavigation extends HTMLElement {
|
|
13
11
|
constructor() {
|
|
14
12
|
super();
|
|
15
13
|
this.__registerHost();
|
|
16
14
|
this.canScrollLeft = false;
|
|
17
15
|
this.canScrollRight = false;
|
|
18
|
-
this.
|
|
16
|
+
this.scrollRight = this.scrollRight.bind(this);
|
|
17
|
+
this.scrollLeft = this.scrollLeft.bind(this);
|
|
18
|
+
this.handleMutations = this.handleMutations.bind(this);
|
|
19
|
+
this.checkScrollability = this.checkScrollability.bind(this);
|
|
20
|
+
this.resizeObserver = new ResizeObserver(this.checkScrollability);
|
|
21
|
+
this.mutationObserver = new MutationObserver(this.handleMutations);
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
|
|
32
|
-
// Recalculate scrollability after DOM changes
|
|
33
|
-
this.checkScrollability();
|
|
34
|
-
});
|
|
35
|
-
get host() { return this; }
|
|
36
|
-
/**
|
|
37
|
-
* Update navbar translation when 'translateAmount' changes and recalculate scrollability
|
|
38
|
-
*/
|
|
39
|
-
onTranslateAmountChanges(value) {
|
|
40
|
-
this.navbar.style.marginInlineStart = `-${value}px`;
|
|
41
|
-
this.checkScrollability();
|
|
23
|
+
componentDidLoad() {
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
this.fixLayoutShift();
|
|
26
|
+
this.checkScrollability();
|
|
27
|
+
});
|
|
28
|
+
// Observe the navbar for size changes
|
|
29
|
+
this.resizeObserver.observe(this.navbar);
|
|
30
|
+
// Observe the navabar for mutation changes
|
|
31
|
+
this.mutationObserver.observe(this.navbar, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
|
|
32
|
+
// Ensure the scroll buttons are correctly displayed or hidden whenever the navbar is scrolled
|
|
33
|
+
this.navbar.addEventListener('scrollend', this.checkScrollability);
|
|
42
34
|
}
|
|
43
35
|
/**
|
|
44
|
-
*
|
|
45
|
-
* This ensures that we can interact with the header for mobile menu toggling.
|
|
36
|
+
* Disconnects observers and remove event listeners when the main navigation is removed from the DOM.
|
|
46
37
|
*/
|
|
47
|
-
|
|
48
|
-
this.
|
|
38
|
+
disconnectedCallback() {
|
|
39
|
+
this.mutationObserver.disconnect();
|
|
40
|
+
this.resizeObserver.disconnect();
|
|
41
|
+
this.navbar.removeEventListener('scrollend', this.checkScrollability);
|
|
49
42
|
}
|
|
50
43
|
/**
|
|
51
|
-
*
|
|
44
|
+
* Stops the repeated scrolling when the mouse button is released.
|
|
52
45
|
*/
|
|
53
|
-
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
if (this.resizeObserver) {
|
|
57
|
-
this.resizeObserver.disconnect();
|
|
58
|
-
}
|
|
46
|
+
stopScrolling() {
|
|
47
|
+
if (this.scrollRepeatInterval)
|
|
48
|
+
clearInterval(this.scrollRepeatInterval);
|
|
59
49
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.checkScrollability();
|
|
50
|
+
async handleMutations(mutations) {
|
|
51
|
+
const addedNodes = mutations.flatMap((mutation) => {
|
|
52
|
+
return Array.from(mutation.addedNodes);
|
|
64
53
|
});
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
this.resizeObserver.observe(this.navbar);
|
|
68
|
-
const navList = this.navigationList;
|
|
69
|
-
if (navList) {
|
|
70
|
-
this.resizeObserver.observe(navList);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
this.mutationObserver.observe(this.navigationList, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
|
|
54
|
+
// Wait for all elements to be hydrated
|
|
55
|
+
await Promise.all(addedNodes.map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
|
|
74
56
|
this.fixLayoutShift();
|
|
75
|
-
|
|
76
|
-
this.navbar.addEventListener('focusin', e => this.adjustTranslation(e));
|
|
57
|
+
this.checkScrollability();
|
|
77
58
|
}
|
|
78
|
-
|
|
59
|
+
get navigationItems() {
|
|
60
|
+
return Array.from(this.navbar.querySelectorAll(':is(a, button):not(post-megadropdown *)'));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Hack to fix the layout shift due to bold text on active elements
|
|
64
|
+
*/
|
|
79
65
|
fixLayoutShift() {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
this.navigationItems
|
|
67
|
+
.filter(item => !item.matches(':has(.nav-el-active)'))
|
|
68
|
+
.forEach(item => {
|
|
69
|
+
item.innerHTML = `
|
|
70
|
+
<span class="nav-el-active">${item.innerHTML}</span>
|
|
71
|
+
<span class="nav-el-inactive" aria-hidden="true">${item.innerHTML}</span>
|
|
72
|
+
`;
|
|
73
|
+
});
|
|
84
74
|
}
|
|
85
75
|
handleBackButtonClick() {
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
const header = this.navbar.closest('post-header');
|
|
77
|
+
if (header)
|
|
78
|
+
header.toggleMobileMenu();
|
|
88
79
|
}
|
|
89
80
|
/**
|
|
90
|
-
*
|
|
81
|
+
* Returns whether scrolling is enabled in either the left or right direction.
|
|
91
82
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (!this.canScroll || !focusedElement.matches(NAVIGATION_ITEM_SELECTOR))
|
|
95
|
-
return;
|
|
96
|
-
// We need to move the element into the view before it is focused to avoid browser default behavior
|
|
97
|
-
e.preventDefault();
|
|
98
|
-
this.withoutTransition(() => {
|
|
99
|
-
// Try scrolling in both directions, only the necessary translation will actually occur
|
|
100
|
-
this.translateRightTo(focusedElement);
|
|
101
|
-
this.translateLeftTo(focusedElement);
|
|
102
|
-
focusedElement.focus();
|
|
103
|
-
});
|
|
83
|
+
get canScroll() {
|
|
84
|
+
return this.canScrollLeft || this.canScrollRight;
|
|
104
85
|
}
|
|
105
86
|
/**
|
|
106
87
|
* Checks if scrolling is possible in either direction (left or right) and updates the state accordingly.
|
|
107
88
|
*/
|
|
108
89
|
checkScrollability() {
|
|
109
|
-
const { scrollWidth, clientWidth } = this.navbar;
|
|
110
|
-
const couldScroll = this.canScroll;
|
|
90
|
+
const { scrollLeft, scrollWidth, clientWidth } = this.navbar;
|
|
111
91
|
if (scrollWidth === clientWidth) {
|
|
112
92
|
// If scroll width equals client width, scrolling is disabled in both directions
|
|
113
93
|
this.canScrollLeft = this.canScrollRight = false;
|
|
114
94
|
}
|
|
115
95
|
else {
|
|
116
|
-
this.canScrollLeft =
|
|
117
|
-
this.canScrollRight = clientWidth +
|
|
96
|
+
this.canScrollLeft = Math.floor(scrollLeft) > 0; // Scrolling left is possible if not at the start
|
|
97
|
+
this.canScrollRight = Math.ceil(clientWidth + scrollLeft) < scrollWidth; // Scrolling right is possible if not at the end
|
|
118
98
|
}
|
|
119
|
-
if (couldScroll && !this.canScroll) {
|
|
120
|
-
this.withoutTransition(() => (this.translationAmount = 0));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Returns whether scrolling is enabled in either the left or right direction.
|
|
125
|
-
*/
|
|
126
|
-
get canScroll() {
|
|
127
|
-
return this.canScrollLeft || this.canScrollRight;
|
|
128
99
|
}
|
|
129
100
|
/**
|
|
130
101
|
* Handles the scrolling behavior when a user clicks on the left or right scroll buttons.
|
|
131
102
|
*/
|
|
132
|
-
handleScrollButtonClick(direction) {
|
|
133
|
-
if (!this.canScroll)
|
|
103
|
+
handleScrollButtonClick(e, direction) {
|
|
104
|
+
if (!this.canScroll || e.button !== 0)
|
|
134
105
|
return;
|
|
135
106
|
// Disable interaction with the navbar during scrolling
|
|
136
|
-
this.
|
|
137
|
-
//
|
|
138
|
-
this.
|
|
107
|
+
this.temporarilyDisableNavbar();
|
|
108
|
+
// Set up the correct scroll function
|
|
109
|
+
const scroll = direction === 'right' ? this.scrollRight : this.scrollLeft;
|
|
110
|
+
scroll();
|
|
139
111
|
// Repeat the scrolling action while the button is held down
|
|
140
112
|
this.scrollRepeatInterval = setInterval(() => {
|
|
141
|
-
|
|
113
|
+
scroll();
|
|
142
114
|
}, SCROLL_REPEAT_INTERVAL);
|
|
143
115
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const couldScroll = direction === 'left' ? this.translateLeftTo(item, true) : this.translateRightTo(item, true);
|
|
157
|
-
if (couldScroll)
|
|
158
|
-
break;
|
|
116
|
+
scrollRight() {
|
|
117
|
+
const scrollRightLeftEdge = document
|
|
118
|
+
.querySelector('.scroll-right')
|
|
119
|
+
.getBoundingClientRect().left;
|
|
120
|
+
for (const navigationItem of this.navigationItems) {
|
|
121
|
+
const { right, width } = navigationItem.getBoundingClientRect();
|
|
122
|
+
// Scroll to the first navigation item that is less than 75% visible
|
|
123
|
+
const isThreeQuartersVisible = right - 0.25 * width < scrollRightLeftEdge;
|
|
124
|
+
if (!isThreeQuartersVisible) {
|
|
125
|
+
this.navbar.scrollBy({ left: right - scrollRightLeftEdge });
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
159
128
|
}
|
|
160
129
|
}
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
// Calculate the maximum translation amount to prevent scrolling past the end of the content
|
|
175
|
-
const maximumTranslation = this.navbar.scrollWidth - this.host.clientWidth;
|
|
176
|
-
// Adjust the translation amount, ensuring it doesn't exceed the maximum scrollable area
|
|
177
|
-
const { marginRight } = getComputedStyle(this.navigationList);
|
|
178
|
-
this.translationAmount =
|
|
179
|
-
Math.min(this.translationAmount + translationIncrease, maximumTranslation) +
|
|
180
|
-
parseInt(marginRight);
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
183
|
-
translateLeftTo(navigationItem, skipSmallTranslation = false) {
|
|
184
|
-
const listItem = navigationItem.closest('post-list-item');
|
|
185
|
-
// Get the left edge position of the list item relative to the left of the screen
|
|
186
|
-
const leftEdgePosition = listItem.offsetLeft;
|
|
187
|
-
// Calculate the first visible position on the screen to the left, right after the left scroll button
|
|
188
|
-
const firstVisiblePosition = this.leftScrollButton.clientWidth;
|
|
189
|
-
// If the item is already fully visible, no translation is needed
|
|
190
|
-
if (leftEdgePosition > firstVisiblePosition)
|
|
191
|
-
return false;
|
|
192
|
-
const translationDecrease = firstVisiblePosition - leftEdgePosition + 1; // + 1 because offset values are rounded
|
|
193
|
-
// If the required scroll distance is too small (less than half the width of the item), don't perform the scroll
|
|
194
|
-
if (skipSmallTranslation && translationDecrease < listItem.clientWidth / 2)
|
|
195
|
-
return false;
|
|
196
|
-
// Calculate the minimum allowed translation amount (no negative scrolling allowed)
|
|
197
|
-
const minimumTranslation = 0;
|
|
198
|
-
// Adjust the translation amount, ensuring it doesn't go below the minimum scrollable area
|
|
199
|
-
const { marginLeft } = getComputedStyle(this.navigationList);
|
|
200
|
-
this.translationAmount = Math.max(this.translationAmount - translationDecrease - parseInt(marginLeft), minimumTranslation);
|
|
201
|
-
return true;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Returns the navigation list container element
|
|
205
|
-
*/
|
|
206
|
-
get navigationList() {
|
|
207
|
-
return this.navbar.querySelector(NAVIGATION_LIST_SELECTOR);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Returns the navigation items
|
|
211
|
-
*/
|
|
212
|
-
get navigationItems() {
|
|
213
|
-
return this.navbar.querySelectorAll(NAVIGATION_ITEM_SELECTOR);
|
|
130
|
+
scrollLeft() {
|
|
131
|
+
const scrollLeftRightEdge = document
|
|
132
|
+
.querySelector('.scroll-left')
|
|
133
|
+
.getBoundingClientRect().right;
|
|
134
|
+
for (const navigationItem of this.navigationItems.reverse()) {
|
|
135
|
+
const { left, width } = navigationItem.getBoundingClientRect();
|
|
136
|
+
// Scroll to the first navigation item that is less than 75% visible
|
|
137
|
+
const isThreeQuartersVisible = left + 0.25 * width > scrollLeftRightEdge;
|
|
138
|
+
if (!isThreeQuartersVisible) {
|
|
139
|
+
this.navbar.scrollBy({ left: left - scrollLeftRightEdge });
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
214
143
|
}
|
|
215
144
|
/**
|
|
216
145
|
* Temporarily disables interactions with the navbar during scrolling to prevent accidental clicks.
|
|
217
146
|
* Re-enables interactions after a brief delay to avoid blocking the user entirely.
|
|
218
147
|
*/
|
|
219
|
-
|
|
148
|
+
temporarilyDisableNavbar() {
|
|
220
149
|
if (this.navbarDisableTimer)
|
|
221
150
|
clearTimeout(this.navbarDisableTimer);
|
|
222
|
-
this.navbar.
|
|
151
|
+
this.navbar.setAttribute('inert', '');
|
|
223
152
|
this.navbarDisableTimer = setTimeout(() => {
|
|
224
|
-
this.navbar.
|
|
153
|
+
this.navbar.removeAttribute('inert');
|
|
225
154
|
}, NAVBAR_DISABLE_DURATION);
|
|
226
155
|
}
|
|
227
|
-
/**
|
|
228
|
-
* Allows to translate the navbar without a transition
|
|
229
|
-
*/
|
|
230
|
-
withoutTransition(callback) {
|
|
231
|
-
const transition = this.navbar.style.transition;
|
|
232
|
-
this.navbar.style.transition = 'none';
|
|
233
|
-
callback();
|
|
234
|
-
setTimeout(() => {
|
|
235
|
-
this.navbar.style.transition = transition;
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
156
|
render() {
|
|
239
|
-
return (h(Host, { key: '
|
|
157
|
+
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" }))));
|
|
240
158
|
}
|
|
241
|
-
static get watchers() { return {
|
|
242
|
-
"translationAmount": ["onTranslateAmountChanges"]
|
|
243
|
-
}; }
|
|
244
159
|
static get style() { return PostMainnavigationStyle0; }
|
|
245
160
|
}, [4, "post-mainnavigation", {
|
|
246
161
|
"canScrollLeft": [32],
|
|
247
|
-
"canScrollRight": [32]
|
|
248
|
-
|
|
249
|
-
}, [[9, "mouseup", "stopScrolling"]], {
|
|
250
|
-
"translationAmount": ["onTranslateAmountChanges"]
|
|
251
|
-
}]);
|
|
162
|
+
"canScrollRight": [32]
|
|
163
|
+
}, [[9, "mouseup", "stopScrolling"], [9, "mouseleave", "stopScrolling"]]]);
|
|
252
164
|
function defineCustomElement() {
|
|
253
165
|
if (typeof customElements === "undefined") {
|
|
254
166
|
return;
|