@swisspost/design-system-components 9.0.0-next.3 → 9.0.0-next.5
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/check-type-64af82a9.js +16 -0
- package/dist/cjs/{index-01f30442.js → index-824d2b71.js} +2 -15
- package/dist/cjs/index-e1f32cce.js +18 -10
- package/dist/cjs/index.cjs.js +36 -22
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-ef26e62c.js → package-53892d3d.js} +1 -1
- package/dist/cjs/{post-accordion-3878bf43.js → post-accordion-7f627ffd.js} +1 -1
- package/dist/cjs/{post-accordion-item-0278e6e2.js → post-accordion-item-ceb5399f.js} +3 -3
- package/dist/cjs/post-accordion-item.cjs.entry.js +4 -3
- package/dist/cjs/post-accordion.cjs.entry.js +2 -2
- package/dist/cjs/post-alert-5333a23c.js +99 -0
- package/dist/cjs/post-alert.cjs.entry.js +4 -3
- package/dist/cjs/{post-avatar-2bcfc016.js → post-avatar-a8123d38.js} +1 -1
- package/dist/cjs/post-avatar.cjs.entry.js +2 -2
- package/dist/cjs/post-breadcrumb-item-6e4704e5.js +49 -0
- package/dist/cjs/post-breadcrumb-item.cjs.entry.js +15 -0
- package/dist/cjs/post-card-control-b289ddcf.js +272 -0
- package/dist/cjs/post-card-control.cjs.entry.js +2 -2
- package/dist/cjs/post-closebutton_10.cjs.entry.js +25 -0
- package/dist/cjs/{post-collapsible-trigger-6ae59c64.js → post-collapsible-trigger-e4862a5b.js} +9 -6
- package/dist/cjs/post-collapsible_2.cjs.entry.js +4 -3
- package/dist/cjs/post-components.cjs.js +1 -1
- package/dist/cjs/{post-language-option-4a3ecaeb.js → post-language-option-62414842.js} +5 -4
- package/dist/cjs/post-language-option.cjs.entry.js +4 -3
- package/dist/cjs/{post-popovercontainer-6a25713a.js → post-megadropdown-trigger-da912fed.js} +522 -19
- package/dist/cjs/post-menu-54fa65d3.js +176 -0
- package/dist/cjs/post-menu-item-8c3090b1.js +20 -0
- package/dist/cjs/post-menu-item.cjs.entry.js +11 -0
- package/dist/cjs/post-menu-trigger-71449876.js +73 -0
- package/dist/cjs/post-menu-trigger.cjs.entry.js +12 -0
- package/dist/cjs/post-menu.cjs.entry.js +11 -0
- package/dist/cjs/{post-popover-de1b8d95.js → post-popover-5f639e4f.js} +3 -3
- package/dist/cjs/post-popover.cjs.entry.js +2 -2
- package/dist/cjs/{post-rating-1d2c59b7.js → post-rating-3d166fed.js} +2 -2
- package/dist/cjs/post-rating.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-header-877676bf.js → post-tab-header-03b20f24.js} +2 -2
- package/dist/cjs/post-tab-header.cjs.entry.js +2 -2
- package/dist/cjs/{post-tab-panel-80b1f3ee.js → post-tab-panel-e5685f3d.js} +2 -2
- package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/{post-tabs-c2d42035.js → post-tabs-e871c911.js} +3 -3
- package/dist/cjs/post-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{post-tag-5e2c7798.js → post-tag-62f31d0e.js} +2 -2
- package/dist/cjs/post-tag.cjs.entry.js +2 -2
- package/dist/cjs/{post-tooltip-9a120b2e.js → post-tooltip-851c342c.js} +3 -3
- package/dist/cjs/post-tooltip.cjs.entry.js +4 -3
- package/dist/collection/collection-manifest.json +12 -1
- package/dist/collection/components/post-accordion-item/post-accordion-item.css +1 -1
- package/dist/collection/components/post-alert/post-alert.css +3 -3
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.css +1 -0
- package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +83 -0
- package/dist/collection/components/post-card-control/post-card-control.css +1 -1
- package/dist/collection/components/post-card-control/post-card-control.js +2 -2
- package/dist/collection/components/post-closebutton/post-closebutton.js +12 -0
- package/dist/collection/components/post-collapsible/post-collapsible.js +5 -3
- package/dist/collection/components/post-header/post-header.css +1 -0
- package/dist/collection/components/post-header/post-header.js +103 -0
- package/dist/collection/components/post-icon/post-icon.js +1 -1
- package/dist/collection/components/post-language-option/post-language-option.js +1 -1
- package/dist/collection/components/post-list/post-list.css +3 -0
- package/dist/collection/components/post-list/post-list.js +87 -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 +25 -0
- package/dist/collection/components/post-logo/post-logo.js +1 -1
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -0
- package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +61 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -0
- package/dist/collection/components/post-megadropdown/post-megadropdown.js +137 -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 +48 -0
- package/dist/collection/components/post-menu/post-menu.css +3 -0
- package/dist/collection/components/post-menu/post-menu.js +278 -0
- package/dist/collection/components/post-menu-item/post-menu-item.css +1 -0
- package/dist/collection/components/post-menu-item/post-menu-item.js +20 -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 +103 -0
- package/dist/collection/components/post-popover/post-popover.css +1 -1
- package/dist/collection/components/post-popover/post-popover.js +1 -1
- package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +26 -6
- package/dist/collection/components/post-rating/post-rating.js +1 -1
- package/dist/collection/components/post-tab-header/post-tab-header.js +1 -1
- package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
- package/dist/collection/components/post-tabs/post-tabs.css +1 -1
- package/dist/collection/components/post-tabs/post-tabs.js +1 -1
- package/dist/collection/components/post-tag/post-tag.js +1 -1
- package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
- package/dist/collection/index.js +11 -0
- package/dist/collection/utils/is-focusable.js +26 -0
- package/dist/components/index.js +11 -0
- package/dist/components/index2.js +1 -1
- package/dist/components/package.js +1 -1
- package/dist/components/post-accordion-item2.js +1 -1
- package/dist/components/post-alert2.js +1 -1
- 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 +72 -0
- package/dist/components/post-card-control2.js +3 -3
- package/dist/components/post-closebutton.d.ts +11 -0
- package/dist/components/post-closebutton.js +6 -0
- package/dist/components/post-closebutton2.js +34 -0
- package/dist/components/post-collapsible2.js +6 -4
- package/dist/components/post-header.d.ts +11 -0
- package/dist/components/post-header.js +6 -0
- package/dist/components/post-header2.js +235 -0
- package/dist/components/post-icon2.js +2 -2
- package/dist/components/post-language-option2.js +2 -2
- 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 +35 -0
- package/dist/components/post-list.d.ts +11 -0
- package/dist/components/post-list.js +6 -0
- package/dist/components/post-list2.js +53 -0
- package/dist/components/post-logo2.js +2 -2
- package/dist/components/post-mainnavigation.d.ts +11 -0
- package/dist/components/post-mainnavigation.js +6 -0
- package/dist/components/post-mainnavigation2.js +48 -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 +39 -0
- package/dist/components/post-megadropdown.d.ts +11 -0
- package/dist/components/post-megadropdown.js +6 -0
- package/dist/components/post-megadropdown2.js +67 -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 +33 -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 +90 -0
- package/dist/components/post-menu.d.ts +11 -0
- package/dist/components/post-menu.js +6 -0
- package/dist/components/post-menu2.js +201 -0
- package/dist/components/post-popover2.js +2 -2
- package/dist/components/post-popovercontainer2.js +9 -6
- package/dist/components/post-rating2.js +1 -1
- package/dist/components/post-tab-header2.js +1 -1
- package/dist/components/post-tab-panel2.js +1 -1
- package/dist/components/post-tabs2.js +2 -2
- package/dist/components/post-tag2.js +1 -1
- package/dist/components/post-tooltip2.js +2 -2
- package/dist/docs.json +832 -45
- package/dist/esm/check-type-8828dbe4.js +14 -0
- package/dist/esm/index-e1b64755.js +18 -10
- package/dist/esm/{index-f41b763f.js → index-f8a00dc0.js} +2 -14
- package/dist/esm/index.js +22 -19
- package/dist/esm/loader.js +1 -1
- package/dist/esm/package-d0380f19.js +3 -0
- package/dist/esm/{post-accordion-01d49d83.js → post-accordion-b2762084.js} +1 -1
- package/dist/esm/{post-accordion-item-366f385b.js → post-accordion-item-82ef1c4a.js} +3 -3
- package/dist/esm/post-accordion-item.entry.js +4 -3
- package/dist/esm/post-accordion.entry.js +2 -2
- package/dist/esm/post-alert-0679e14b.js +97 -0
- package/dist/esm/post-alert.entry.js +4 -3
- package/dist/esm/{post-avatar-6f24d1ab.js → post-avatar-e84c49cb.js} +1 -1
- package/dist/esm/post-avatar.entry.js +2 -2
- package/dist/esm/post-breadcrumb-item-ff752018.js +47 -0
- package/dist/esm/post-breadcrumb-item.entry.js +7 -0
- package/dist/esm/post-card-control-53b9ca94.js +270 -0
- package/dist/esm/post-card-control.entry.js +2 -2
- package/dist/esm/post-closebutton_10.entry.js +8 -0
- package/dist/esm/{post-collapsible-trigger-654bf2b0.js → post-collapsible-trigger-34740fa6.js} +8 -5
- package/dist/esm/post-collapsible_2.entry.js +4 -3
- package/dist/esm/post-components.js +1 -1
- package/dist/esm/{post-language-option-0c2818aa.js → post-language-option-e2a76752.js} +4 -3
- package/dist/esm/post-language-option.entry.js +4 -3
- package/dist/esm/{post-popovercontainer-e6d11d81.js → post-megadropdown-trigger-7e577245.js} +515 -21
- package/dist/esm/post-menu-e6337859.js +174 -0
- package/dist/esm/post-menu-item-c10a0a93.js +18 -0
- package/dist/esm/post-menu-item.entry.js +3 -0
- package/dist/esm/post-menu-trigger-5f31ad60.js +71 -0
- package/dist/esm/post-menu-trigger.entry.js +4 -0
- package/dist/esm/post-menu.entry.js +3 -0
- package/dist/esm/{post-popover-7d44a85c.js → post-popover-d78547b4.js} +3 -3
- package/dist/esm/post-popover.entry.js +2 -2
- package/dist/esm/{post-rating-3cd3e97b.js → post-rating-d04d0349.js} +2 -2
- package/dist/esm/post-rating.entry.js +2 -2
- package/dist/esm/{post-tab-header-776a991a.js → post-tab-header-6efc530f.js} +2 -2
- package/dist/esm/post-tab-header.entry.js +2 -2
- package/dist/esm/{post-tab-panel-163e6c99.js → post-tab-panel-d9ecc10e.js} +2 -2
- package/dist/esm/post-tab-panel.entry.js +2 -2
- package/dist/esm/{post-tabs-8cb1bce9.js → post-tabs-e98a47e8.js} +3 -3
- package/dist/esm/post-tabs.entry.js +2 -2
- package/dist/esm/{post-tag-deefcc86.js → post-tag-40a65871.js} +2 -2
- package/dist/esm/post-tag.entry.js +2 -2
- package/dist/esm/{post-tooltip-dc7e1a21.js → post-tooltip-3b1e121c.js} +3 -3
- package/dist/esm/post-tooltip.entry.js +4 -3
- package/dist/post-components/index.esm.js +1 -1
- package/dist/post-components/p-029c91d8.entry.js +1 -0
- package/dist/post-components/p-0338f9da.js +1 -0
- package/dist/post-components/p-03c850fa.entry.js +1 -0
- package/dist/post-components/p-1d8a41d3.js +1 -0
- package/dist/post-components/p-2069e764.js +1 -0
- package/dist/post-components/p-3705d2b4.js +1 -0
- package/dist/post-components/p-3aaea2a7.js +1 -0
- package/dist/post-components/p-3b4342e4.entry.js +1 -0
- package/dist/post-components/p-3b5bd4a4.entry.js +1 -0
- package/dist/post-components/p-3f785d16.entry.js +1 -0
- package/dist/post-components/p-40a57111.entry.js +1 -0
- package/dist/post-components/p-41f5f626.entry.js +1 -0
- package/dist/post-components/p-42c628fd.js +1 -0
- package/dist/post-components/p-43451d07.js +1 -0
- package/dist/post-components/{p-16d057a6.js → p-49a42850.js} +1 -1
- package/dist/post-components/p-4a3f67ab.js +1 -0
- package/dist/post-components/p-4f1a40dd.entry.js +1 -0
- package/dist/post-components/p-6e7bde44.js +1 -0
- package/dist/post-components/{p-d785856c.js → p-70c016ab.js} +1 -1
- package/dist/post-components/{p-3d3795f9.js → p-75514d7d.js} +1 -1
- package/dist/post-components/p-76dbca34.entry.js +1 -0
- package/dist/post-components/{p-b38eaabf.js → p-77a757d4.js} +1 -1
- package/dist/post-components/p-77af2367.entry.js +1 -0
- package/dist/post-components/{p-60e72b25.js → p-7a20605b.js} +1 -1
- package/dist/post-components/{p-8734876e.js → p-879ae242.js} +1 -1
- package/dist/post-components/p-976c2742.js +1 -0
- package/dist/post-components/p-9cda2b0d.entry.js +1 -0
- package/dist/post-components/p-9fab4d3c.js +1 -0
- package/dist/post-components/p-a0226aec.js +1 -0
- package/dist/post-components/p-aa890e24.entry.js +1 -0
- package/dist/post-components/p-ac6d9496.js +1 -0
- package/dist/post-components/p-ad6e41d5.entry.js +1 -0
- package/dist/post-components/p-af8cfb8e.js +1 -0
- package/dist/post-components/p-c95813b2.entry.js +1 -0
- package/dist/post-components/p-d3814644.entry.js +1 -0
- package/dist/post-components/p-d5b02b44.entry.js +1 -0
- package/dist/post-components/{p-0ad93d89.js → p-e0dc4fac.js} +2 -2
- package/dist/post-components/p-f404d0bb.entry.js +1 -0
- package/dist/post-components/p-f5b933bc.entry.js +1 -0
- package/dist/post-components/p-fbda2556.entry.js +1 -0
- package/dist/post-components/{p-9ac2a947.js → p-fc2c7222.js} +1 -1
- package/dist/post-components/post-components.esm.js +1 -1
- package/dist/types/components/post-breadcrumb-item/post-breadcrumb-item.d.ts +15 -0
- package/dist/types/components/post-closebutton/post-closebutton.d.ts +7 -0
- package/dist/types/components/post-header/post-header.d.ts +16 -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 +10 -0
- package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +23 -0
- package/dist/types/components/post-megadropdown-trigger/post-megadropdown-trigger.d.ts +10 -0
- package/dist/types/components/post-menu/post-menu.d.ts +47 -0
- package/dist/types/components/post-menu-item/post-menu-item.d.ts +4 -0
- package/dist/types/components/post-menu-trigger/post-menu-trigger.d.ts +26 -0
- package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +4 -0
- package/dist/types/components.d.ts +279 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/utils/is-focusable.d.ts +1 -0
- package/loaders/index.d.ts +22 -0
- package/loaders/index.js +12 -1
- package/loaders/package.js +1 -1
- package/loaders/post-accordion-item.js +1 -1
- package/loaders/post-alert.js +1 -1
- package/loaders/post-breadcrumb-item.d.ts +11 -0
- package/loaders/post-breadcrumb-item.js +75 -0
- package/loaders/post-card-control.js +3 -3
- package/loaders/post-closebutton.d.ts +11 -0
- package/loaders/post-closebutton.js +37 -0
- package/loaders/post-collapsible2.js +5 -3
- package/loaders/post-header.d.ts +11 -0
- package/loaders/post-header.js +238 -0
- package/loaders/post-icon2.js +1 -1
- package/loaders/post-language-option.js +1 -1
- package/loaders/post-list-item.d.ts +11 -0
- package/loaders/post-list-item.js +38 -0
- package/loaders/post-list.d.ts +11 -0
- package/loaders/post-list.js +56 -0
- package/loaders/post-logo.js +1 -1
- package/loaders/post-mainnavigation.d.ts +11 -0
- package/loaders/post-mainnavigation.js +51 -0
- package/loaders/post-megadropdown-trigger.d.ts +11 -0
- package/loaders/post-megadropdown-trigger.js +42 -0
- package/loaders/post-megadropdown.d.ts +11 -0
- package/loaders/post-megadropdown.js +70 -0
- package/loaders/post-menu-item.d.ts +11 -0
- package/loaders/post-menu-item.js +36 -0
- package/loaders/post-menu-trigger.d.ts +11 -0
- package/loaders/post-menu-trigger.js +93 -0
- package/loaders/post-menu.d.ts +11 -0
- package/loaders/post-menu.js +204 -0
- package/loaders/post-popover.js +2 -2
- package/loaders/post-popovercontainer2.js +9 -6
- package/loaders/post-rating.js +1 -1
- package/loaders/post-tab-header.js +1 -1
- package/loaders/post-tab-panel.js +1 -1
- package/loaders/post-tabs.js +2 -2
- package/loaders/post-tag.js +1 -1
- package/loaders/post-tooltip.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/post-alert-5f795d9c.js +0 -98
- package/dist/cjs/post-card-control-5ffcd201.js +0 -272
- package/dist/cjs/post-icon-1f71aa0f.js +0 -104
- package/dist/cjs/post-icon.cjs.entry.js +0 -15
- package/dist/cjs/post-logo-7070d727.js +0 -39
- package/dist/cjs/post-logo.cjs.entry.js +0 -14
- package/dist/cjs/post-popovercontainer.cjs.entry.js +0 -11
- package/dist/esm/package-0311770e.js +0 -3
- package/dist/esm/post-alert-5a69f40d.js +0 -96
- package/dist/esm/post-card-control-2a7939c3.js +0 -270
- package/dist/esm/post-icon-885f17e9.js +0 -102
- package/dist/esm/post-icon.entry.js +0 -7
- package/dist/esm/post-logo-dd425f2e.js +0 -37
- package/dist/esm/post-logo.entry.js +0 -6
- package/dist/esm/post-popovercontainer.entry.js +0 -3
- package/dist/post-components/p-048538ea.js +0 -1
- package/dist/post-components/p-0a1f5e13.entry.js +0 -1
- package/dist/post-components/p-0a4318ff.js +0 -1
- package/dist/post-components/p-0d64ef0c.entry.js +0 -1
- package/dist/post-components/p-1198a5f2.entry.js +0 -1
- package/dist/post-components/p-13d1bef7.entry.js +0 -1
- package/dist/post-components/p-1a091fca.entry.js +0 -1
- package/dist/post-components/p-1f35b0ba.entry.js +0 -1
- package/dist/post-components/p-246a6d28.js +0 -1
- package/dist/post-components/p-3aa5e1e5.js +0 -1
- package/dist/post-components/p-3fabf6e4.entry.js +0 -1
- package/dist/post-components/p-4f0617e6.js +0 -1
- package/dist/post-components/p-53bacbbc.js +0 -1
- package/dist/post-components/p-5c8cb76f.entry.js +0 -1
- package/dist/post-components/p-5eee8d31.entry.js +0 -1
- package/dist/post-components/p-66ed33a9.js +0 -1
- package/dist/post-components/p-681b751d.entry.js +0 -1
- package/dist/post-components/p-6b6a1e82.entry.js +0 -1
- package/dist/post-components/p-752e6a98.entry.js +0 -1
- package/dist/post-components/p-9d211a45.js +0 -1
- package/dist/post-components/p-cdfcc758.entry.js +0 -1
- package/dist/post-components/p-d50d4ec1.entry.js +0 -1
- package/dist/post-components/p-deb4131c.js +0 -1
- package/dist/post-components/p-e18f3639.js +0 -1
- package/dist/post-components/p-f1b7797f.entry.js +0 -1
- package/dist/post-components/p-f6efc76b.entry.js +0 -1
- package/dist/post-components/p-f825d681.js +0 -1
- package/dist/post-components/p-fff1c2ee.entry.js +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import { throttle } from "throttle-debounce";
|
|
3
|
+
import { version } from "../../../../package";
|
|
4
|
+
export class PostHeader {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.scrollParent = null;
|
|
7
|
+
this.throttledScroll = () => this.handleScrollEvent();
|
|
8
|
+
this.throttledResize = throttle(50, () => this.handleResize());
|
|
9
|
+
this.device = null;
|
|
10
|
+
this.mobileMenuExtended = false;
|
|
11
|
+
}
|
|
12
|
+
componentWillRender() {
|
|
13
|
+
this.scrollParent = this.getScrollParent(this.host);
|
|
14
|
+
this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
15
|
+
window.addEventListener('resize', this.throttledResize, { passive: true });
|
|
16
|
+
this.handleResize();
|
|
17
|
+
this.handleScrollEvent();
|
|
18
|
+
}
|
|
19
|
+
handlePostMainNavigationClosed() {
|
|
20
|
+
this.mobileMenuExtended = false;
|
|
21
|
+
}
|
|
22
|
+
handleScrollEvent() {
|
|
23
|
+
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
24
|
+
const st = Math.max(0, this.scrollParent instanceof Document
|
|
25
|
+
? this.scrollParent.documentElement.scrollTop
|
|
26
|
+
: this.scrollParent.scrollTop);
|
|
27
|
+
this.host.style.setProperty('--header-scroll-top', `${st}px`);
|
|
28
|
+
}
|
|
29
|
+
getScrollParent(node) {
|
|
30
|
+
let currentParent = node.parentElement;
|
|
31
|
+
while (currentParent) {
|
|
32
|
+
if (currentParent.nodeName === 'BODY') {
|
|
33
|
+
return document;
|
|
34
|
+
}
|
|
35
|
+
if (this.isScrollable(currentParent)) {
|
|
36
|
+
return currentParent;
|
|
37
|
+
}
|
|
38
|
+
currentParent = currentParent.parentElement;
|
|
39
|
+
}
|
|
40
|
+
return document;
|
|
41
|
+
}
|
|
42
|
+
isScrollable(node) {
|
|
43
|
+
if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const style = getComputedStyle(node);
|
|
47
|
+
return ['overflow', 'overflow-x', 'overflow-y'].some(propertyName => {
|
|
48
|
+
const value = style.getPropertyValue(propertyName);
|
|
49
|
+
return value === 'auto' || value === 'scroll';
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
handleResize() {
|
|
53
|
+
const width = window === null || window === void 0 ? void 0 : window.innerWidth;
|
|
54
|
+
if (width >= 1024) {
|
|
55
|
+
this.device = 'desktop';
|
|
56
|
+
this.mobileMenuExtended = false; // Close any open mobile menu
|
|
57
|
+
}
|
|
58
|
+
else if (width >= 600) {
|
|
59
|
+
this.device = 'tablet';
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.device = 'mobile';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
handleMobileMenuToggle() {
|
|
66
|
+
this.mobileMenuExtended = !this.mobileMenuExtended;
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
const mainNavClasses = ['main-navigation'];
|
|
70
|
+
if (this.mobileMenuExtended) {
|
|
71
|
+
mainNavClasses.push('extended');
|
|
72
|
+
}
|
|
73
|
+
return (h(Host, { key: '5a05f890e66ec97d54fd17ca26436392a4e78e9b', version: version }, h("div", { key: '8f9b79cb289d0c613f6d000cf969ce5bf0b3d62a', class: "global-header" }, h("div", { key: '0a482fc3153e29917ed2df1fcbf39492a18918ef', class: "global-sub" }, h("div", { key: '3d25cc42a1fac21906cb2c487d90de84a9f1d029', class: "logo" }, h("slot", { key: '5a14eb7b8f9927083a56e37d53bc4aed3311b6c8', name: "post-logo" })), this.device === 'desktop' && h("slot", { key: '21bc41d4a09536a33ee3d7a98424a00d3969718f', name: "audience-navigation" })), h("div", { key: '6c8fdc5acc99c165bda366e872ceb32d6918b515', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '88f681de4d63517d73decd436b7084fca410f021', name: "meta-navigation" }), h("slot", { key: 'b6e5c1143fb89e2940f464bac95277bc2741a5c8', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: '2edb30a148ffaae9f864e9babc03228c63a46314', name: "post-language-switch" }), h("div", { key: 'cc0633f19bd9b948fb2456fdc44431984e3a10eb', onClick: () => this.handleMobileMenuToggle(), class: "mobile-toggle" }, h("slot", { key: '26fa9aa29cab7e4048c387ee6c49216dc911f209', name: "post-togglebutton" })))), h("div", { key: '772afbe63ac2f0ae0527e25c6feac75b02365689', class: "title-header d-flex space-between align-center" }, h("slot", { key: '32bf212b1e16df0a2fd7cec6b21a7649458e7660', name: "title" }), h("div", { key: '13bf9f2443fa9c48c6f25a0159896995e170b4dc', class: "global-sub" }, h("slot", { key: 'a20c9414619c9508600c25ef31d5c14f6178f520', name: "local-controls" }), h("slot", { key: 'a87beb7500f4e07396bf4a91ee299a4bebd751bd' }))), h("div", { key: '008c9d1a0acf59a9b54facec5e6aec2f483f8ed7', class: mainNavClasses.join(' ') }, (this.device === 'mobile' || this.device === 'tablet') && (h("slot", { key: 'e8013ae7c0fe3883a4be405409fd3b35e236cf8c', name: "audience-navigation" })), h("slot", { key: '90412d08f0a835714de0a6c635f82aae90abeac2', name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("slot", { key: '31fb4b34ddabda5f87f65a6c841b64f4a9802d50', name: "meta-navigation" })), (this.device === 'mobile' || this.device === 'tablet') && (h("slot", { key: 'cfd212a052d0b736d049084f492c614131ae7a32', name: "post-language-switch" })))));
|
|
74
|
+
}
|
|
75
|
+
static get is() { return "post-header"; }
|
|
76
|
+
static get encapsulation() { return "shadow"; }
|
|
77
|
+
static get originalStyleUrls() {
|
|
78
|
+
return {
|
|
79
|
+
"$": ["./post-header.scss"]
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
static get styleUrls() {
|
|
83
|
+
return {
|
|
84
|
+
"$": ["post-header.css"]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
static get states() {
|
|
88
|
+
return {
|
|
89
|
+
"device": {},
|
|
90
|
+
"mobileMenuExtended": {}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
static get elementRef() { return "host"; }
|
|
94
|
+
static get listeners() {
|
|
95
|
+
return [{
|
|
96
|
+
"name": "postMainNavigationClosed",
|
|
97
|
+
"method": "handlePostMainNavigationClosed",
|
|
98
|
+
"target": undefined,
|
|
99
|
+
"capture": false,
|
|
100
|
+
"passive": false
|
|
101
|
+
}];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -81,7 +81,7 @@ export class PostIcon {
|
|
|
81
81
|
})
|
|
82
82
|
.filter(([_key, value]) => value !== null)
|
|
83
83
|
.reduce((styles, [key, value]) => Object.assign(styles, { [key]: value }), {});
|
|
84
|
-
return (h(Host, { key: '
|
|
84
|
+
return (h(Host, { key: '86c61ac92270e1b46ef63e2bb0ff4683a16ca794', "data-version": version }, h("span", { key: 'ad856363b96d303912c9085d9d45cb911cbedfc6', style: svgStyles })));
|
|
85
85
|
}
|
|
86
86
|
static get is() { return "post-icon"; }
|
|
87
87
|
static get encapsulation() { return "shadow"; }
|
|
@@ -47,7 +47,7 @@ export class PostLanguageOption {
|
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
49
|
const lang = this.code.toLowerCase();
|
|
50
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: '98b5a47cb7544c23512f1a56bb62d286cbde90ff', "data-version": version, role: "listitem" }, this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange() }, h("slot", null))) : (h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange() }, h("slot", null)))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "post-language-option"; }
|
|
53
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 by Swiss Post, Information Technology
|
|
3
|
+
*/post-list{display:flex;gap:var(--post-list-title-gap);flex-direction:column;align-items:flex-start}post-list>div[role=list]{flex-direction:column;display:flex;gap:var(--post-list-item-gap)}post-list[horizontal]:not([horizontal=false]){flex-direction:row;align-items:baseline}post-list[horizontal]:not([horizontal=false])>div[role=list]{flex-direction:row;align-items:center}post-list>.list-title.visually-hidden{width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important}post-list>.list-title.visually-hidden:not(caption){position:absolute !important}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { version } from "../../../../package";
|
|
3
|
+
/**
|
|
4
|
+
* @slot default - Slot for placing the list title.
|
|
5
|
+
* @slot post-list-item - Slot for placing post-list-item components.
|
|
6
|
+
*/
|
|
7
|
+
export class PostList {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.titleId = undefined;
|
|
10
|
+
this.titleHidden = false;
|
|
11
|
+
this.horizontal = false;
|
|
12
|
+
}
|
|
13
|
+
componentWillLoad() {
|
|
14
|
+
/**
|
|
15
|
+
* Get the id set on the host element or use a random id by default
|
|
16
|
+
*/
|
|
17
|
+
this.titleId = `list-${crypto.randomUUID()}`;
|
|
18
|
+
}
|
|
19
|
+
componentDidLoad() {
|
|
20
|
+
this.checkTitle();
|
|
21
|
+
}
|
|
22
|
+
checkTitle() {
|
|
23
|
+
if (!this.titleEl.innerText) {
|
|
24
|
+
throw new Error('Please provide a title to the list component. Title is mandatory for accessibility purposes.');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return (h(Host, { key: '23875f577fa2cbdeac88596616ddd1d5b924f983', "data-version": version }, h("div", { key: '3fe8da70bc5c0e7b72c5e8b76a37762deb55fffd', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: '536bec8ddbed178108a921f0b643d6eeb7b58edc' })), h("div", { key: 'c6b560206740105afc494050fa4b8608ccf4bd15', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: '06272c2a9cc18d2f5440ff1fc0b966929b3ab6a0', name: "post-list-item" }))));
|
|
29
|
+
}
|
|
30
|
+
static get is() { return "post-list"; }
|
|
31
|
+
static get originalStyleUrls() {
|
|
32
|
+
return {
|
|
33
|
+
"$": ["post-list.scss"]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
static get styleUrls() {
|
|
37
|
+
return {
|
|
38
|
+
"$": ["post-list.css"]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
static get properties() {
|
|
42
|
+
return {
|
|
43
|
+
"titleHidden": {
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"mutable": false,
|
|
46
|
+
"complexType": {
|
|
47
|
+
"original": "boolean",
|
|
48
|
+
"resolved": "boolean",
|
|
49
|
+
"references": {}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": false,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": "If `true`, the list title will be hidden. Otherwise, it will be displayed.`"
|
|
56
|
+
},
|
|
57
|
+
"attribute": "title-hidden",
|
|
58
|
+
"reflect": false,
|
|
59
|
+
"defaultValue": "false"
|
|
60
|
+
},
|
|
61
|
+
"horizontal": {
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"mutable": false,
|
|
64
|
+
"complexType": {
|
|
65
|
+
"original": "boolean",
|
|
66
|
+
"resolved": "boolean",
|
|
67
|
+
"references": {}
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"optional": false,
|
|
71
|
+
"docs": {
|
|
72
|
+
"tags": [],
|
|
73
|
+
"text": "The list can become horizontal by setting `horizontal=\"true\"` or just `horizontal`"
|
|
74
|
+
},
|
|
75
|
+
"attribute": "horizontal",
|
|
76
|
+
"reflect": false,
|
|
77
|
+
"defaultValue": "false"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
static get states() {
|
|
82
|
+
return {
|
|
83
|
+
"titleId": {}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
static get elementRef() { return "host"; }
|
|
87
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:host{display:flex}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* @slot default- Slot for placing the content of the list item.
|
|
4
|
+
*/
|
|
5
|
+
export class PostListItem {
|
|
6
|
+
connectedCallback() {
|
|
7
|
+
this.host.setAttribute('slot', 'post-list-item');
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h(Host, { key: '8336f46e5c7d9b6b921582498e1d7e62086b3d4b', role: "listitem" }, h("slot", { key: '36ca0d6632ca775793f1db91d747894e0037dca2' })));
|
|
11
|
+
}
|
|
12
|
+
static get is() { return "post-list-item"; }
|
|
13
|
+
static get encapsulation() { return "shadow"; }
|
|
14
|
+
static get originalStyleUrls() {
|
|
15
|
+
return {
|
|
16
|
+
"$": ["post-list-item.scss"]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
static get styleUrls() {
|
|
20
|
+
return {
|
|
21
|
+
"$": ["post-list-item.css"]
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static get elementRef() { return "host"; }
|
|
25
|
+
}
|
|
@@ -23,7 +23,7 @@ export class PostLogo {
|
|
|
23
23
|
render() {
|
|
24
24
|
const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
|
|
25
25
|
const LogoTag = logoLink ? 'a' : 'span';
|
|
26
|
-
return (h(Host, { key: '
|
|
26
|
+
return (h(Host, { key: '9f23dca4f568ecbcf3d90387b2a9cb4fa1e85a98', "data-version": version, slot: "post-logo" }, h(LogoTag, Object.assign({ key: '1b303363d3a4a829d4ab4b38bc40cbd3107b55e9', class: "logo" }, (logoLink ? { href: logoLink } : {})), h("span", { key: 'de29d53c4bb663053092b905d32f6597bd9a00d5', class: "description" }, h("slot", { key: 'bdfc96e3d9cb9384a61fa8af91c12a4b119f2f3b', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'f2d1e0803c7f2f3a7c425dd5ebd57346c8d967e6', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: '554a2d4edb796b01969555eccb3f0f34e74f0121', id: "Logo" }, h("rect", { key: '7596d8684037b02d015e48539bddda3f44dfcadf', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: 'f79c5e941f7d87de1484a934565cf363b49914d5', 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: '7c5babc1703e4f74c08b78916a86c553f8cc6edf', 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" }))))));
|
|
27
27
|
}
|
|
28
28
|
static get is() { return "post-logo"; }
|
|
29
29
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,::before,::after{box-sizing:border-box}@media screen and (min-width: 1024px){slot[name=back-button],[slot=back-button]{display:none}}@media screen and (min-width: 1024px){h2{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}}post-mainnavigation{height:100%}:host{height:100%;display:block}.main-navigation{margin-block:0;list-style:none;display:flex;padding-left:0;gap:1rem}@media screen and (max-width: 1023.99px){.main-navigation{flex-direction:column}}.main-navigation>post-list{display:flex;align-items:stretch;gap:1rem;height:100%}@media screen and (max-width: 1023.99px){.main-navigation>post-list{flex-direction:column}}.main-navigation a,.main-navigation post-megadropdown-toggle{height:100%;display:flex;align-items:center}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class PostMainnavigation {
|
|
3
|
+
handleMegadropdownToggled(event) {
|
|
4
|
+
// Find next element sibling
|
|
5
|
+
let megalodon;
|
|
6
|
+
let target = event.target;
|
|
7
|
+
while (target !== null) {
|
|
8
|
+
if (target.tagName === 'POST-MEGADROPDOWN') {
|
|
9
|
+
megalodon = target;
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
target = target.nextElementSibling;
|
|
13
|
+
}
|
|
14
|
+
if (megalodon)
|
|
15
|
+
megalodon.toggle(event.target);
|
|
16
|
+
}
|
|
17
|
+
handleBackButtonClick() {
|
|
18
|
+
this.postToggle.emit();
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (h(Host, { key: '1c1d1d1c2781f39acc0fd02d3f93f922d801d98f', slot: "post-mainnavigation" }, h("div", { key: '1bc1129c65fc03ec72609438bbf28afe5bc5974b', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '6b1bcc25306f1f959a25b18a6319eb696b0cbc2c', name: "back-button" })), h("nav", { key: '0002b55cb82fbf88a69a886c5ec1ba24168c9979', class: "main-navigation" }, h("slot", { key: '15e4558c1202f8f83e09dad76441d6bf7e3e16ea' }))));
|
|
22
|
+
}
|
|
23
|
+
static get is() { return "post-mainnavigation"; }
|
|
24
|
+
static get originalStyleUrls() {
|
|
25
|
+
return {
|
|
26
|
+
"$": ["./post-mainnavigation.scss"]
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static get styleUrls() {
|
|
30
|
+
return {
|
|
31
|
+
"$": ["post-mainnavigation.css"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static get events() {
|
|
35
|
+
return [{
|
|
36
|
+
"method": "postToggle",
|
|
37
|
+
"name": "postToggle",
|
|
38
|
+
"bubbles": true,
|
|
39
|
+
"cancelable": true,
|
|
40
|
+
"composed": true,
|
|
41
|
+
"docs": {
|
|
42
|
+
"tags": [],
|
|
43
|
+
"text": "Gets emitted when a user closes the main navigation on mobile"
|
|
44
|
+
},
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "any",
|
|
47
|
+
"resolved": "any",
|
|
48
|
+
"references": {}
|
|
49
|
+
}
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
static get listeners() {
|
|
53
|
+
return [{
|
|
54
|
+
"name": "postToggle",
|
|
55
|
+
"method": "handleMegadropdownToggled",
|
|
56
|
+
"target": undefined,
|
|
57
|
+
"capture": false,
|
|
58
|
+
"passive": false
|
|
59
|
+
}];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,::before,::after{box-sizing:border-box}post-popovercontainer{background-color:#fafafa;width:100%;border-bottom:1px solid #000}@media screen and (max-width: 1023.99px){post-popovercontainer{position:absolute;top:var(--header-height) !important;bottom:0;left:0;width:100%;height:auto}}.megadropdown{display:flex;gap:1rem;padding:1.5rem;border-radius:0 0 3px 3px}@media screen and (max-width: 1023.99px){.megadropdown{flex-direction:column}}.megadropdown post-list{display:flex;flex-direction:column;gap:.5rem}.megadropdown post-list-item{border-bottom:1px solid gray}.megadropdown post-list-item>a{padding-block:.25rem;display:block;text-decoration:none}.back-button{display:none}@media screen and (max-width: 1023.99px){.back-button{display:block}}post-closebutton{margin-left:auto}@media screen and (max-width: 1023.99px){post-closebutton{display:none}}h3{font-size:20px}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class PostMegadropdown {
|
|
3
|
+
/**
|
|
4
|
+
* Show megadropdown
|
|
5
|
+
* @param element HTMLElement
|
|
6
|
+
* @returns boolean
|
|
7
|
+
*/
|
|
8
|
+
async show(element) {
|
|
9
|
+
return this.popoverRef.show(element);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hide megadropdown
|
|
13
|
+
* @returns boolean
|
|
14
|
+
*/
|
|
15
|
+
async hide() {
|
|
16
|
+
return this.popoverRef.hide();
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Toggle megadropdown
|
|
20
|
+
* @param element HTMLElement
|
|
21
|
+
* @param force boolean
|
|
22
|
+
* @returns boolean
|
|
23
|
+
*/
|
|
24
|
+
async toggle(element, force) {
|
|
25
|
+
return this.popoverRef.toggle(element, force !== null && force !== void 0 ? force : undefined);
|
|
26
|
+
}
|
|
27
|
+
handleBackButtonClick() {
|
|
28
|
+
this.hide();
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
return (h(Host, { key: '6b30399852561a911c04a79c7c785bb5cf8e68ff', slot: "post-mainnavigation" }, h("post-popovercontainer", { key: 'caa196c59c0177948a73c43033f7399344068d77', placement: "bottom", "edge-gap": "0", ref: el => (this.popoverRef = el) }, h("div", { key: '7c88bd1ca7fac00b9ab0cb1d73252c6990484fb2', class: "megadropdown" }, h("div", { key: '25073177e9c9a05fca93b3b0abbed18f6b2a075b', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '06a153e974f60476f2796e03afea3ad86c7560ca', name: "back-button" })), h("slot", { key: 'ea95044efbd609894dd96b3aa8662756e14711af' })))));
|
|
32
|
+
}
|
|
33
|
+
static get is() { return "post-megadropdown"; }
|
|
34
|
+
static get originalStyleUrls() {
|
|
35
|
+
return {
|
|
36
|
+
"$": ["./post-megadropdown.scss"]
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
static get styleUrls() {
|
|
40
|
+
return {
|
|
41
|
+
"$": ["post-megadropdown.css"]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static get methods() {
|
|
45
|
+
return {
|
|
46
|
+
"show": {
|
|
47
|
+
"complexType": {
|
|
48
|
+
"signature": "(element: HTMLElement) => Promise<void>",
|
|
49
|
+
"parameters": [{
|
|
50
|
+
"name": "element",
|
|
51
|
+
"type": "HTMLElement",
|
|
52
|
+
"docs": "HTMLElement"
|
|
53
|
+
}],
|
|
54
|
+
"references": {
|
|
55
|
+
"Promise": {
|
|
56
|
+
"location": "global",
|
|
57
|
+
"id": "global::Promise"
|
|
58
|
+
},
|
|
59
|
+
"HTMLElement": {
|
|
60
|
+
"location": "global",
|
|
61
|
+
"id": "global::HTMLElement"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"return": "Promise<void>"
|
|
65
|
+
},
|
|
66
|
+
"docs": {
|
|
67
|
+
"text": "Show megadropdown",
|
|
68
|
+
"tags": [{
|
|
69
|
+
"name": "param",
|
|
70
|
+
"text": "element HTMLElement"
|
|
71
|
+
}, {
|
|
72
|
+
"name": "returns",
|
|
73
|
+
"text": "boolean"
|
|
74
|
+
}]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"hide": {
|
|
78
|
+
"complexType": {
|
|
79
|
+
"signature": "() => Promise<void>",
|
|
80
|
+
"parameters": [],
|
|
81
|
+
"references": {
|
|
82
|
+
"Promise": {
|
|
83
|
+
"location": "global",
|
|
84
|
+
"id": "global::Promise"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"return": "Promise<void>"
|
|
88
|
+
},
|
|
89
|
+
"docs": {
|
|
90
|
+
"text": "Hide megadropdown",
|
|
91
|
+
"tags": [{
|
|
92
|
+
"name": "returns",
|
|
93
|
+
"text": "boolean"
|
|
94
|
+
}]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"toggle": {
|
|
98
|
+
"complexType": {
|
|
99
|
+
"signature": "(element: HTMLElement, force?: boolean) => Promise<boolean>",
|
|
100
|
+
"parameters": [{
|
|
101
|
+
"name": "element",
|
|
102
|
+
"type": "HTMLElement",
|
|
103
|
+
"docs": "HTMLElement"
|
|
104
|
+
}, {
|
|
105
|
+
"name": "force",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"docs": "boolean"
|
|
108
|
+
}],
|
|
109
|
+
"references": {
|
|
110
|
+
"Promise": {
|
|
111
|
+
"location": "global",
|
|
112
|
+
"id": "global::Promise"
|
|
113
|
+
},
|
|
114
|
+
"HTMLElement": {
|
|
115
|
+
"location": "global",
|
|
116
|
+
"id": "global::HTMLElement"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"return": "Promise<boolean>"
|
|
120
|
+
},
|
|
121
|
+
"docs": {
|
|
122
|
+
"text": "Toggle megadropdown",
|
|
123
|
+
"tags": [{
|
|
124
|
+
"name": "param",
|
|
125
|
+
"text": "element HTMLElement"
|
|
126
|
+
}, {
|
|
127
|
+
"name": "param",
|
|
128
|
+
"text": "force boolean"
|
|
129
|
+
}, {
|
|
130
|
+
"name": "returns",
|
|
131
|
+
"text": "boolean"
|
|
132
|
+
}]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:host{display:inline-block}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class PostMegadropdownTrigger {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.toggled = false;
|
|
5
|
+
}
|
|
6
|
+
handleClick() {
|
|
7
|
+
this.toggled = !this.toggled;
|
|
8
|
+
this.postToggle.emit();
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return (h(Host, { key: 'af6dbf6cb97c5f98242e2d3fc31f193d00444b26', slot: "post-megadropdown-trigger" }, h("button", { key: '8160075f3dcb5afdd88a375698a61edfdbe8b7a1', "aria-expanded": this.toggled, onClick: () => this.handleClick() }, h("slot", { key: 'f5be082b15802582540d9a3320d4bf19ca3d98c3' }))));
|
|
12
|
+
}
|
|
13
|
+
static get is() { return "post-megadropdown-trigger"; }
|
|
14
|
+
static get encapsulation() { return "shadow"; }
|
|
15
|
+
static get originalStyleUrls() {
|
|
16
|
+
return {
|
|
17
|
+
"$": ["./post-megadropdown-trigger.scss"]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static get styleUrls() {
|
|
21
|
+
return {
|
|
22
|
+
"$": ["post-megadropdown-trigger.css"]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
static get states() {
|
|
26
|
+
return {
|
|
27
|
+
"toggled": {}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static get events() {
|
|
31
|
+
return [{
|
|
32
|
+
"method": "postToggle",
|
|
33
|
+
"name": "postToggle",
|
|
34
|
+
"bubbles": true,
|
|
35
|
+
"cancelable": true,
|
|
36
|
+
"composed": true,
|
|
37
|
+
"docs": {
|
|
38
|
+
"tags": [],
|
|
39
|
+
"text": "Emits after each toggle"
|
|
40
|
+
},
|
|
41
|
+
"complexType": {
|
|
42
|
+
"original": "any",
|
|
43
|
+
"resolved": "any",
|
|
44
|
+
"references": {}
|
|
45
|
+
}
|
|
46
|
+
}];
|
|
47
|
+
}
|
|
48
|
+
}
|