@swisspost/internet-header 1.5.0-beta.2 → 1.5.0
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/LICENSE +202 -202
- package/dist/cjs/{if.component-313f59b8.js → if.component-51d000af.js} +6 -6
- package/dist/cjs/if.component-51d000af.js.map +1 -0
- package/dist/cjs/{klp-widget.controller-84642428.js → klp-widget.controller-d8941c4e.js} +4811 -4811
- package/dist/cjs/{klp-widget.controller-84642428.js.map → klp-widget.controller-d8941c4e.js.map} +1 -1
- package/dist/cjs/{language.service-a80ae01d.js → language.service-7dbf739d.js} +141 -141
- package/dist/cjs/language.service-7dbf739d.js.map +1 -0
- package/dist/cjs/post-klp-login-widget.cjs.entry.js +33 -33
- package/dist/cjs/post-klp-login-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/post-language-switch.cjs.entry.js +88 -88
- package/dist/cjs/post-language-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/post-logo.cjs.entry.js +51 -51
- package/dist/cjs/post-logo.cjs.entry.js.map +1 -1
- package/dist/cjs/post-main-navigation.cjs.entry.js +226 -226
- package/dist/cjs/post-main-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/post-meta-navigation.cjs.entry.js +15 -15
- package/dist/cjs/post-meta-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/post-search.cjs.entry.js +556 -534
- package/dist/cjs/post-search.cjs.entry.js.map +1 -1
- package/dist/cjs/post-skiplinks.cjs.entry.js +41 -41
- package/dist/cjs/post-skiplinks.cjs.entry.js.map +1 -1
- package/dist/cjs/{store-47e14589.js → store-d0d514fc.js} +20 -13
- package/dist/cjs/store-d0d514fc.js.map +1 -0
- package/dist/cjs/{svg-icon.component-10fbda11.js → svg-icon.component-be93f876.js} +2 -2
- package/dist/cjs/svg-icon.component-be93f876.js.map +1 -0
- package/dist/cjs/{svg-sprite.component-c3b454b3.js → svg-sprite.component-1bd7a058.js} +40 -40
- package/dist/cjs/svg-sprite.component-1bd7a058.js.map +1 -0
- package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js +370 -392
- package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js +125 -125
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +608 -608
- package/dist/cjs/swisspost-internet-header.cjs.entry.js.map +1 -1
- package/dist/cjs/{ui.service-db4a8252.js → ui.service-e1ebb6d4.js} +28 -28
- package/dist/cjs/ui.service-e1ebb6d4.js.map +1 -0
- package/dist/cjs/{utils-b6014257.js → utils-60853c5d.js} +15 -15
- package/dist/cjs/utils-60853c5d.js.map +1 -0
- package/dist/collection/assets/config/test-configuration.json +4067 -4067
- package/dist/collection/assets/i18n/translations.js +38 -38
- package/dist/collection/assets/i18n/translations.js.map +1 -1
- package/dist/collection/assets/js/sockjs-client.js +5134 -5134
- package/dist/collection/components/post-internet-breadcrumbs/components/breadcrumb-list.component.js +11 -11
- package/dist/collection/components/post-internet-breadcrumbs/components/breadcrumb-list.component.js.map +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/components/focus-trap.component.js +42 -42
- package/dist/collection/components/post-internet-breadcrumbs/components/focus-trap.component.js.map +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/components/middle-dropdown.component.js +8 -8
- package/dist/collection/components/post-internet-breadcrumbs/components/middle-dropdown.component.js.map +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/components/middle-links.component.js +6 -6
- package/dist/collection/components/post-internet-breadcrumbs/components/middle-links.component.js.map +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/components/overlay.component.js +12 -12
- package/dist/collection/components/post-internet-breadcrumbs/components/overlay.component.js.map +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.js +253 -253
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.js.map +1 -1
- package/dist/collection/components/post-internet-footer/components/post-footer-block-address.component.js +12 -12
- package/dist/collection/components/post-internet-footer/components/post-footer-block-address.component.js.map +1 -1
- package/dist/collection/components/post-internet-footer/components/post-footer-block-contact.component.js +24 -24
- package/dist/collection/components/post-internet-footer/components/post-footer-block-contact.component.js.map +1 -1
- package/dist/collection/components/post-internet-footer/components/post-footer-block-custom.component.js +6 -6
- package/dist/collection/components/post-internet-footer/components/post-footer-block-custom.component.js.map +1 -1
- package/dist/collection/components/post-internet-footer/components/post-footer-block-list.component.js +6 -6
- package/dist/collection/components/post-internet-footer/components/post-footer-block-list.component.js.map +1 -1
- package/dist/collection/components/post-internet-footer/components/post-footer-block-socials.component.js +5 -5
- package/dist/collection/components/post-internet-footer/components/post-footer-block-socials.component.js.map +1 -1
- package/dist/collection/components/post-internet-footer/post-internet-footer.js +86 -86
- package/dist/collection/components/post-internet-footer/post-internet-footer.js.map +1 -1
- package/dist/collection/components/post-internet-header/post-internet-header.js +676 -676
- package/dist/collection/components/post-internet-header/post-internet-header.js.map +1 -1
- package/dist/collection/components/post-klp-login-widget/klp-widget.controller.js +14 -14
- package/dist/collection/components/post-klp-login-widget/klp-widget.controller.js.map +1 -1
- package/dist/collection/components/post-klp-login-widget/post-klp-login-widget.js +67 -67
- package/dist/collection/components/post-klp-login-widget/post-klp-login-widget.js.map +1 -1
- package/dist/collection/components/post-language-switch/components/post-language-switch-list.js +9 -9
- package/dist/collection/components/post-language-switch/components/post-language-switch-list.js.map +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.js +186 -186
- package/dist/collection/components/post-language-switch/post-language-switch.js.map +1 -1
- package/dist/collection/components/post-logo/logo-sprite.component.js +4 -4
- package/dist/collection/components/post-logo/logo-sprite.component.js.map +1 -1
- package/dist/collection/components/post-logo/post-logo.js +60 -60
- package/dist/collection/components/post-logo/post-logo.js.map +1 -1
- package/dist/collection/components/post-main-navigation/components/level-one-action.component.js +13 -13
- package/dist/collection/components/post-main-navigation/components/level-one-action.component.js.map +1 -1
- package/dist/collection/components/post-main-navigation/post-main-navigation.js +347 -347
- package/dist/collection/components/post-main-navigation/post-main-navigation.js.map +1 -1
- package/dist/collection/components/post-meta-navigation/post-meta-navigation.js +67 -67
- package/dist/collection/components/post-meta-navigation/post-meta-navigation.js.map +1 -1
- package/dist/collection/components/post-search/post-search.js +362 -362
- package/dist/collection/components/post-search/post-search.js.map +1 -1
- package/dist/collection/components/post-skiplinks/post-skiplinks.js +51 -51
- package/dist/collection/components/post-skiplinks/post-skiplinks.js.map +1 -1
- package/dist/collection/data/store.js +11 -11
- package/dist/collection/data/store.js.map +1 -1
- package/dist/collection/index.js +2 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/models/breadcrumbs.model.js +2 -2
- package/dist/collection/models/breadcrumbs.model.js.map +1 -1
- package/dist/collection/models/coveo.model.js +2 -2
- package/dist/collection/models/coveo.model.js.map +1 -1
- package/dist/collection/models/footer.model.js +2 -2
- package/dist/collection/models/footer.model.js.map +1 -1
- package/dist/collection/models/general.model.js +2 -2
- package/dist/collection/models/general.model.js.map +1 -1
- package/dist/collection/models/geocode.model.js +10 -10
- package/dist/collection/models/geocode.model.js.map +1 -1
- package/dist/collection/models/header.model.js +2 -2
- package/dist/collection/models/header.model.js.map +1 -1
- package/dist/collection/models/implementor.model.js +2 -2
- package/dist/collection/models/implementor.model.js.map +1 -1
- package/dist/collection/models/language.model.js +2 -2
- package/dist/collection/models/language.model.js.map +1 -1
- package/dist/collection/models/track-and-trace.model.js +2 -2
- package/dist/collection/models/track-and-trace.model.js.map +1 -1
- package/dist/collection/services/config.service.js +170 -170
- package/dist/collection/services/config.service.js.map +1 -1
- package/dist/collection/services/language.service.js +107 -107
- package/dist/collection/services/language.service.js.map +1 -1
- package/dist/collection/services/route.service.js +163 -163
- package/dist/collection/services/route.service.js.map +1 -1
- package/dist/collection/services/search/coveo.service.js +34 -34
- package/dist/collection/services/search/coveo.service.js.map +1 -1
- package/dist/collection/services/search/coveo.settings.js +19 -19
- package/dist/collection/services/search/coveo.settings.js.map +1 -1
- package/dist/collection/services/search/parcel.service.js +54 -54
- package/dist/collection/services/search/parcel.service.js.map +1 -1
- package/dist/collection/services/search/places.service.js +95 -95
- package/dist/collection/services/search/places.service.js.map +1 -1
- package/dist/collection/services/search/places.settings.js +16 -16
- package/dist/collection/services/search/places.settings.js.map +1 -1
- package/dist/collection/services/search/search-utilities.js +26 -26
- package/dist/collection/services/search/search-utilities.js.map +1 -1
- package/dist/collection/services/search/search.service.js +42 -42
- package/dist/collection/services/search/search.service.js.map +1 -1
- package/dist/collection/services/ui.service.js +30 -30
- package/dist/collection/services/ui.service.js.map +1 -1
- package/dist/collection/tests/setup-tests.js +14 -14
- package/dist/collection/tests/setup-tests.js.map +1 -1
- package/dist/collection/utils/highlighted.component.js +11 -11
- package/dist/collection/utils/highlighted.component.js.map +1 -1
- package/dist/collection/utils/if.component.js +7 -7
- package/dist/collection/utils/if.component.js.map +1 -1
- package/dist/collection/utils/svg-icon.component.js +3 -3
- package/dist/collection/utils/svg-icon.component.js.map +1 -1
- package/dist/collection/utils/svg-sprite.component.js +3 -3
- package/dist/collection/utils/svg-sprite.component.js.map +1 -1
- package/dist/collection/utils/utils.js +16 -16
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/klp-widget.controller.js +4810 -4810
- package/dist/components/klp-widget.controller.js.map +1 -1
- package/dist/components/language.service.js +139 -139
- package/dist/components/language.service.js.map +1 -1
- package/dist/components/post-klp-login-widget2.js +48 -48
- package/dist/components/post-klp-login-widget2.js.map +1 -1
- package/dist/components/post-language-switch2.js +102 -102
- package/dist/components/post-language-switch2.js.map +1 -1
- package/dist/components/post-logo2.js +67 -67
- package/dist/components/post-logo2.js.map +1 -1
- package/dist/components/post-main-navigation2.js +243 -243
- package/dist/components/post-main-navigation2.js.map +1 -1
- package/dist/components/post-meta-navigation2.js +32 -32
- package/dist/components/post-meta-navigation2.js.map +1 -1
- package/dist/components/post-search2.js +577 -555
- package/dist/components/post-search2.js.map +1 -1
- package/dist/components/post-skiplinks2.js +52 -52
- package/dist/components/post-skiplinks2.js.map +1 -1
- package/dist/components/store.js +19 -12
- package/dist/components/store.js.map +1 -1
- package/dist/components/svg-icon.component.js +1 -1
- package/dist/components/svg-icon.component.js.map +1 -1
- package/dist/components/svg-sprite.component.js +39 -39
- package/dist/components/svg-sprite.component.js.map +1 -1
- package/dist/components/swisspost-internet-breadcrumbs.js +387 -409
- package/dist/components/swisspost-internet-breadcrumbs.js.map +1 -1
- package/dist/components/swisspost-internet-footer.js +140 -140
- package/dist/components/swisspost-internet-footer.js.map +1 -1
- package/dist/components/swisspost-internet-header.js +672 -672
- package/dist/components/swisspost-internet-header.js.map +1 -1
- package/dist/components/ui.service.js +27 -27
- package/dist/components/ui.service.js.map +1 -1
- package/dist/components/utils.js +14 -14
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/{if.component-542fb8c3.js → if.component-0fe54385.js} +6 -6
- package/dist/esm/if.component-0fe54385.js.map +1 -0
- package/dist/esm/{klp-widget.controller-903e0422.js → klp-widget.controller-55366e6a.js} +4811 -4811
- package/dist/esm/{klp-widget.controller-903e0422.js.map → klp-widget.controller-55366e6a.js.map} +1 -1
- package/dist/esm/{language.service-e49858e0.js → language.service-023d2711.js} +141 -141
- package/dist/esm/language.service-023d2711.js.map +1 -0
- package/dist/esm/post-klp-login-widget.entry.js +33 -33
- package/dist/esm/post-klp-login-widget.entry.js.map +1 -1
- package/dist/esm/post-language-switch.entry.js +88 -88
- package/dist/esm/post-language-switch.entry.js.map +1 -1
- package/dist/esm/post-logo.entry.js +51 -51
- package/dist/esm/post-logo.entry.js.map +1 -1
- package/dist/esm/post-main-navigation.entry.js +226 -226
- package/dist/esm/post-main-navigation.entry.js.map +1 -1
- package/dist/esm/post-meta-navigation.entry.js +15 -15
- package/dist/esm/post-meta-navigation.entry.js.map +1 -1
- package/dist/esm/post-search.entry.js +556 -534
- package/dist/esm/post-search.entry.js.map +1 -1
- package/dist/esm/post-skiplinks.entry.js +41 -41
- package/dist/esm/post-skiplinks.entry.js.map +1 -1
- package/dist/esm/{store-d495dc07.js → store-837c3490.js} +20 -13
- package/dist/esm/store-837c3490.js.map +1 -0
- package/dist/esm/{svg-icon.component-1b1b27a2.js → svg-icon.component-e09b4bf9.js} +2 -2
- package/dist/esm/svg-icon.component-e09b4bf9.js.map +1 -0
- package/dist/esm/{svg-sprite.component-ec0ac38c.js → svg-sprite.component-cf60303f.js} +40 -40
- package/dist/esm/svg-sprite.component-cf60303f.js.map +1 -0
- package/dist/esm/swisspost-internet-breadcrumbs.entry.js +370 -392
- package/dist/esm/swisspost-internet-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-footer.entry.js +125 -125
- package/dist/esm/swisspost-internet-footer.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-header.entry.js +608 -608
- package/dist/esm/swisspost-internet-header.entry.js.map +1 -1
- package/dist/esm/{ui.service-1d9b0f51.js → ui.service-2fbc9c45.js} +28 -28
- package/dist/esm/ui.service-2fbc9c45.js.map +1 -0
- package/dist/esm/{utils-5bf107ff.js → utils-ee79122f.js} +15 -15
- package/dist/esm/utils-ee79122f.js.map +1 -0
- package/dist/esm-es5/{if.component-542fb8c3.js → if.component-0fe54385.js} +1 -1
- package/dist/esm-es5/if.component-0fe54385.js.map +1 -0
- package/dist/esm-es5/{klp-widget.controller-903e0422.js → klp-widget.controller-55366e6a.js} +1 -1
- package/dist/{swisspost-internet-header/p-83f6cd1e.js.map → esm-es5/klp-widget.controller-55366e6a.js.map} +1 -1
- package/dist/esm-es5/{language.service-e49858e0.js → language.service-023d2711.js} +2 -2
- package/dist/esm-es5/language.service-023d2711.js.map +1 -0
- package/dist/esm-es5/post-klp-login-widget.entry.js +1 -1
- package/dist/esm-es5/post-klp-login-widget.entry.js.map +1 -1
- package/dist/esm-es5/post-language-switch.entry.js +1 -1
- package/dist/esm-es5/post-language-switch.entry.js.map +1 -1
- package/dist/esm-es5/post-logo.entry.js +1 -1
- package/dist/esm-es5/post-logo.entry.js.map +1 -1
- package/dist/esm-es5/post-main-navigation.entry.js +1 -1
- package/dist/esm-es5/post-main-navigation.entry.js.map +1 -1
- package/dist/esm-es5/post-meta-navigation.entry.js +1 -1
- package/dist/esm-es5/post-meta-navigation.entry.js.map +1 -1
- package/dist/esm-es5/post-search.entry.js +1 -1
- package/dist/esm-es5/post-search.entry.js.map +1 -1
- package/dist/esm-es5/post-skiplinks.entry.js +1 -1
- package/dist/esm-es5/post-skiplinks.entry.js.map +1 -1
- package/dist/esm-es5/store-837c3490.js +2 -0
- package/dist/esm-es5/store-837c3490.js.map +1 -0
- package/dist/esm-es5/{svg-icon.component-1b1b27a2.js → svg-icon.component-e09b4bf9.js} +1 -1
- package/dist/esm-es5/svg-icon.component-e09b4bf9.js.map +1 -0
- package/dist/esm-es5/{svg-sprite.component-ec0ac38c.js → svg-sprite.component-cf60303f.js} +1 -1
- package/dist/esm-es5/svg-sprite.component-cf60303f.js.map +1 -0
- package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js +3 -3
- package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js.map +1 -1
- package/dist/esm-es5/swisspost-internet-footer.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-footer.entry.js.map +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js.map +1 -1
- package/dist/esm-es5/{ui.service-1d9b0f51.js → ui.service-2fbc9c45.js} +1 -1
- package/dist/esm-es5/ui.service-2fbc9c45.js.map +1 -0
- package/dist/esm-es5/{utils-5bf107ff.js → utils-ee79122f.js} +1 -1
- package/dist/esm-es5/utils-ee79122f.js.map +1 -0
- package/dist/swisspost-internet-header/assets/config/test-configuration.json +4067 -4067
- package/dist/swisspost-internet-header/p-06649b46.js +2 -0
- package/dist/swisspost-internet-header/p-06649b46.js.map +1 -0
- package/dist/swisspost-internet-header/{p-ec80c8fc.js → p-0942595f.js} +2 -2
- package/dist/swisspost-internet-header/p-0942595f.js.map +1 -0
- package/dist/swisspost-internet-header/{p-c29ec122.system.js → p-0c5624c0.system.js} +1 -1
- package/dist/swisspost-internet-header/p-0c5624c0.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-2eb04045.entry.js → p-0cba8ab4.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-0cba8ab4.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-17a47667.system.js +1 -1
- package/dist/swisspost-internet-header/{p-ddcb8258.entry.js → p-26879023.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-26879023.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-cb3de015.system.entry.js → p-28e6362f.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-28e6362f.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-00fd320e.entry.js → p-322526ef.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-322526ef.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-f4ff1e9e.system.js → p-3753a678.system.js} +2 -2
- package/dist/swisspost-internet-header/p-3753a678.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-a9c4b2d0.system.entry.js → p-38d645ba.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-38d645ba.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-872a76a4.system.js → p-42695801.system.js} +1 -1
- package/dist/swisspost-internet-header/p-42695801.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-bdabd6ac.js → p-45db66a6.js} +1 -1
- package/dist/swisspost-internet-header/p-45db66a6.js.map +1 -0
- package/dist/swisspost-internet-header/p-493337e1.system.entry.js +2 -0
- package/dist/swisspost-internet-header/p-493337e1.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-78f653be.system.entry.js → p-5d2fac3b.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-5d2fac3b.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-62c5cf26.entry.js +2 -0
- package/dist/swisspost-internet-header/p-62c5cf26.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-9d0a7039.entry.js → p-64cb215a.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-64cb215a.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-a51ad207.system.entry.js → p-66144e99.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-66144e99.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-715ebef7.system.entry.js +7 -0
- package/dist/swisspost-internet-header/p-715ebef7.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-12baacf0.entry.js → p-77d5e07f.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-77d5e07f.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-7ea26ee9.entry.js +2 -0
- package/dist/swisspost-internet-header/p-7ea26ee9.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-7fcba2e7.system.js +2 -0
- package/dist/swisspost-internet-header/p-7fcba2e7.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-549b62ba.system.js → p-88aac12c.system.js} +1 -1
- package/dist/swisspost-internet-header/p-88aac12c.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-0e2ec555.js → p-8bf099a8.js} +1 -1
- package/dist/swisspost-internet-header/p-8bf099a8.js.map +1 -0
- package/dist/swisspost-internet-header/{p-8717445f.entry.js → p-95b81c4d.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-95b81c4d.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-3eb881c3.js → p-a2f9d462.js} +1 -1
- package/dist/swisspost-internet-header/p-a2f9d462.js.map +1 -0
- package/dist/swisspost-internet-header/{p-eeff8b03.js → p-ab1dd269.js} +1 -1
- package/dist/swisspost-internet-header/p-ab1dd269.js.map +1 -0
- package/dist/swisspost-internet-header/p-b228fe49.system.entry.js +2 -0
- package/dist/swisspost-internet-header/p-b228fe49.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-a4160d23.entry.js → p-ccb522ba.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-ccb522ba.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-cfa787d7.entry.js +6 -0
- package/dist/swisspost-internet-header/p-cfa787d7.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-c946c5b8.system.entry.js → p-d6539597.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-d6539597.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-b406315a.system.entry.js → p-e2990968.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-e2990968.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-83f6cd1e.js → p-ed24b372.js} +1 -1
- package/dist/swisspost-internet-header/p-ed24b372.js.map +1 -0
- package/dist/swisspost-internet-header/{p-9509f6c7.system.js → p-edb2802d.system.js} +1 -1
- package/dist/swisspost-internet-header/p-edb2802d.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-ee915bbe.system.js → p-ee119d2e.system.js} +1 -1
- package/dist/swisspost-internet-header/p-ee119d2e.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-883f9547.system.entry.js → p-f38f38f4.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-f38f38f4.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-3ba40afe.js → p-f7c0cf7b.js} +1 -1
- package/dist/swisspost-internet-header/p-f7c0cf7b.js.map +1 -0
- package/dist/swisspost-internet-header/{p-4654b2af.system.js → p-ffc59851.system.js} +1 -1
- package/dist/swisspost-internet-header/p-ffc59851.system.js.map +1 -0
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/types/assets/i18n/translations.d.ts +37 -37
- package/dist/types/components/post-internet-breadcrumbs/components/breadcrumb-list.component.d.ts +9 -9
- package/dist/types/components/post-internet-breadcrumbs/components/focus-trap.component.d.ts +12 -12
- package/dist/types/components/post-internet-breadcrumbs/components/middle-dropdown.component.d.ts +7 -7
- package/dist/types/components/post-internet-breadcrumbs/components/middle-links.component.d.ts +6 -6
- package/dist/types/components/post-internet-breadcrumbs/components/overlay.component.d.ts +16 -16
- package/dist/types/components/post-internet-breadcrumbs/post-internet-breadcrumbs.d.ts +45 -45
- package/dist/types/components/post-internet-footer/components/post-footer-block-address.component.d.ts +5 -5
- package/dist/types/components/post-internet-footer/components/post-footer-block-contact.component.d.ts +6 -6
- package/dist/types/components/post-internet-footer/components/post-footer-block-custom.component.d.ts +4 -4
- package/dist/types/components/post-internet-footer/components/post-footer-block-list.component.d.ts +5 -5
- package/dist/types/components/post-internet-footer/components/post-footer-block-socials.component.d.ts +5 -5
- package/dist/types/components/post-internet-footer/post-internet-footer.d.ts +10 -10
- package/dist/types/components/post-internet-header/post-internet-header.d.ts +124 -124
- package/dist/types/components/post-klp-login-widget/klp-widget.controller.d.ts +3 -3
- package/dist/types/components/post-klp-login-widget/post-klp-login-widget.d.ts +10 -10
- package/dist/types/components/post-language-switch/components/post-language-switch-list.d.ts +6 -6
- package/dist/types/components/post-language-switch/post-language-switch.d.ts +27 -27
- package/dist/types/components/post-logo/logo-sprite.component.d.ts +4 -4
- package/dist/types/components/post-logo/post-logo.d.ts +11 -11
- package/dist/types/components/post-main-navigation/components/level-one-action.component.d.ts +8 -8
- package/dist/types/components/post-main-navigation/post-main-navigation.d.ts +48 -48
- package/dist/types/components/post-meta-navigation/post-meta-navigation.d.ts +5 -5
- package/dist/types/components/post-search/post-search.d.ts +61 -61
- package/dist/types/components/post-skiplinks/post-skiplinks.d.ts +9 -9
- package/dist/types/data/store.d.ts +16 -16
- package/dist/types/index.d.ts +1 -1
- package/dist/types/models/breadcrumbs.model.d.ts +36 -36
- package/dist/types/models/coveo.model.d.ts +22 -22
- package/dist/types/models/footer.model.d.ts +48 -48
- package/dist/types/models/general.model.d.ts +46 -46
- package/dist/types/models/geocode.model.d.ts +52 -52
- package/dist/types/models/header.model.d.ts +163 -163
- package/dist/types/models/implementor.model.d.ts +22 -22
- package/dist/types/models/language.model.d.ts +6 -6
- package/dist/types/models/track-and-trace.model.d.ts +25 -25
- package/dist/types/services/config.service.d.ts +56 -56
- package/dist/types/services/language.service.d.ts +65 -65
- package/dist/types/services/route.service.d.ts +39 -39
- package/dist/types/services/search/coveo.service.d.ts +9 -9
- package/dist/types/services/search/coveo.settings.d.ts +2 -2
- package/dist/types/services/search/parcel.service.d.ts +28 -28
- package/dist/types/services/search/places.service.d.ts +24 -24
- package/dist/types/services/search/places.settings.d.ts +3 -3
- package/dist/types/services/search/search-utilities.d.ts +15 -15
- package/dist/types/services/search/search.service.d.ts +24 -24
- package/dist/types/services/ui.service.d.ts +23 -23
- package/dist/types/utils/highlighted.component.d.ts +4 -4
- package/dist/types/utils/if.component.d.ts +4 -4
- package/dist/types/utils/svg-icon.component.d.ts +4 -4
- package/dist/types/utils/svg-sprite.component.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +8 -8
- package/package.json +7 -7
- package/readme.md +57 -15
- package/dist/cjs/if.component-313f59b8.js.map +0 -1
- package/dist/cjs/language.service-a80ae01d.js.map +0 -1
- package/dist/cjs/store-47e14589.js.map +0 -1
- package/dist/cjs/svg-icon.component-10fbda11.js.map +0 -1
- package/dist/cjs/svg-sprite.component-c3b454b3.js.map +0 -1
- package/dist/cjs/ui.service-db4a8252.js.map +0 -1
- package/dist/cjs/utils-b6014257.js.map +0 -1
- package/dist/esm/if.component-542fb8c3.js.map +0 -1
- package/dist/esm/language.service-e49858e0.js.map +0 -1
- package/dist/esm/store-d495dc07.js.map +0 -1
- package/dist/esm/svg-icon.component-1b1b27a2.js.map +0 -1
- package/dist/esm/svg-sprite.component-ec0ac38c.js.map +0 -1
- package/dist/esm/ui.service-1d9b0f51.js.map +0 -1
- package/dist/esm/utils-5bf107ff.js.map +0 -1
- package/dist/esm-es5/if.component-542fb8c3.js.map +0 -1
- package/dist/esm-es5/klp-widget.controller-903e0422.js.map +0 -1
- package/dist/esm-es5/language.service-e49858e0.js.map +0 -1
- package/dist/esm-es5/store-d495dc07.js +0 -2
- package/dist/esm-es5/store-d495dc07.js.map +0 -1
- package/dist/esm-es5/svg-icon.component-1b1b27a2.js.map +0 -1
- package/dist/esm-es5/svg-sprite.component-ec0ac38c.js.map +0 -1
- package/dist/esm-es5/ui.service-1d9b0f51.js.map +0 -1
- package/dist/esm-es5/utils-5bf107ff.js.map +0 -1
- package/dist/swisspost-internet-header/p-00fd320e.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-0e2ec555.js.map +0 -1
- package/dist/swisspost-internet-header/p-12baacf0.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-2eb04045.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-3ba40afe.js.map +0 -1
- package/dist/swisspost-internet-header/p-3eb881c3.js.map +0 -1
- package/dist/swisspost-internet-header/p-458c9862.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-458c9862.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-4654b2af.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-549b62ba.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-5e43c5e0.js +0 -2
- package/dist/swisspost-internet-header/p-5e43c5e0.js.map +0 -1
- package/dist/swisspost-internet-header/p-74932c29.entry.js +0 -6
- package/dist/swisspost-internet-header/p-74932c29.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-76ce4acc.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-76ce4acc.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-78f653be.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-7f16a46b.entry.js +0 -2
- package/dist/swisspost-internet-header/p-7f16a46b.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-8717445f.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-872a76a4.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-883f9547.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-9509f6c7.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-9d0a7039.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-a4160d23.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-a51ad207.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-a9c4b2d0.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-b406315a.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-bdabd6ac.js.map +0 -1
- package/dist/swisspost-internet-header/p-c29ec122.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-c69923cd.system.js +0 -2
- package/dist/swisspost-internet-header/p-c69923cd.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-c946c5b8.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-cb3de015.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-d713a3b3.system.entry.js +0 -7
- package/dist/swisspost-internet-header/p-d713a3b3.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-ddcb8258.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-ec80c8fc.js.map +0 -1
- package/dist/swisspost-internet-header/p-ee915bbe.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-eeff8b03.js.map +0 -1
- package/dist/swisspost-internet-header/p-f4ff1e9e.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-fa0c66c7.entry.js +0 -2
- package/dist/swisspost-internet-header/p-fa0c66c7.entry.js.map +0 -1
|
@@ -1,676 +1,676 @@
|
|
|
1
|
-
import { Host, h, } from '@stencil/core';
|
|
2
|
-
import { debounce, throttle } from 'throttle-debounce';
|
|
3
|
-
import { getLocalizedConfig, getLocalizedCustomConfig, isValidProjectId, } from '../../services/config.service';
|
|
4
|
-
import { state, dispose } from '../../data/store';
|
|
5
|
-
import { SvgSprite } from '../../utils/svg-sprite.component';
|
|
6
|
-
import { SvgIcon } from '../../utils/svg-icon.component';
|
|
7
|
-
import { If } from '../../utils/if.component';
|
|
8
|
-
import packageJson from '../../../package.json';
|
|
9
|
-
export class PostInternetHeader {
|
|
10
|
-
/**
|
|
11
|
-
* Get the currently set language as a two letter string ("de", "fr" "it" or "en")
|
|
12
|
-
* @returns string
|
|
13
|
-
*/
|
|
14
|
-
async getCurrentLanguage() {
|
|
15
|
-
var _a;
|
|
16
|
-
return (_a = state.currentLanguage) !== null && _a !== void 0 ? _a : 'de';
|
|
17
|
-
}
|
|
18
|
-
constructor() {
|
|
19
|
-
this.lastScrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
20
|
-
this.lastWindowWidth = window.innerWidth;
|
|
21
|
-
this.handleClickOutsideBound = this.handleClickOutside.bind(this);
|
|
22
|
-
this.project = undefined;
|
|
23
|
-
this.stickyness = 'minimal';
|
|
24
|
-
this.language = undefined;
|
|
25
|
-
this.meta = true;
|
|
26
|
-
this.login = true;
|
|
27
|
-
this.search = true;
|
|
28
|
-
this.skiplinks = true;
|
|
29
|
-
this.configProxy = undefined;
|
|
30
|
-
this.environment = 'prod';
|
|
31
|
-
this.languageSwitchOverrides = undefined;
|
|
32
|
-
this.customConfig = undefined;
|
|
33
|
-
this.languageCookieKey = undefined;
|
|
34
|
-
this.languageLocalStorageKey = 'swisspost-internet-header-language';
|
|
35
|
-
this.activeRoute = 'auto';
|
|
36
|
-
this.osFlyoutOverrides = undefined;
|
|
37
|
-
this.fullWidth = false;
|
|
38
|
-
this.activeFlyout = null;
|
|
39
|
-
this.activeDropdownElement = null;
|
|
40
|
-
if (this.project === undefined || this.project === '' || !isValidProjectId(this.project)) {
|
|
41
|
-
throw new Error(`Internet Header project key is "${this.project}". Please provide a valid project key.`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
connectedCallback() {
|
|
45
|
-
this.throttledScroll = throttle(300, () => this.handleScrollEvent());
|
|
46
|
-
this.debouncedResize = debounce(200, () => this.handleResize());
|
|
47
|
-
window.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
48
|
-
window.addEventListener('resize', this.debouncedResize, { passive: true });
|
|
49
|
-
}
|
|
50
|
-
disconnectedCallback() {
|
|
51
|
-
window.removeEventListener('scroll', this.throttledScroll);
|
|
52
|
-
window.removeEventListener('resize', this.debouncedResize);
|
|
53
|
-
// Reset the store to its original state
|
|
54
|
-
dispose();
|
|
55
|
-
}
|
|
56
|
-
async componentWillLoad() {
|
|
57
|
-
// Wait for the config to arrive, then render the header
|
|
58
|
-
try {
|
|
59
|
-
state.projectId = this.project;
|
|
60
|
-
state.environment = this.environment;
|
|
61
|
-
if (this.language !== undefined)
|
|
62
|
-
state.currentLanguage = this.language;
|
|
63
|
-
state.languageSwitchOverrides =
|
|
64
|
-
typeof this.languageSwitchOverrides === 'string'
|
|
65
|
-
? JSON.parse(this.languageSwitchOverrides)
|
|
66
|
-
: this.languageSwitchOverrides;
|
|
67
|
-
state.osFlyoutOverrides =
|
|
68
|
-
typeof this.osFlyoutOverrides === 'string'
|
|
69
|
-
? JSON.parse(this.osFlyoutOverrides)
|
|
70
|
-
: this.osFlyoutOverrides;
|
|
71
|
-
if (this.customConfig !== undefined && state.currentLanguage !== null) {
|
|
72
|
-
state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, state.currentLanguage);
|
|
73
|
-
}
|
|
74
|
-
state.localizedConfig = await getLocalizedConfig({
|
|
75
|
-
projectId: this.project,
|
|
76
|
-
environment: this.environment,
|
|
77
|
-
language: this.language,
|
|
78
|
-
cookieKey: this.languageCookieKey,
|
|
79
|
-
localStorageKey: this.languageLocalStorageKey,
|
|
80
|
-
activeRouteProp: this.activeRoute,
|
|
81
|
-
localizedCustomConfig: state.localizedCustomConfig,
|
|
82
|
-
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
console.error(error);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
componentDidLoad() {
|
|
90
|
-
window.requestAnimationFrame(() => {
|
|
91
|
-
this.handleResize();
|
|
92
|
-
this.headerLoaded.emit();
|
|
93
|
-
this.host.classList.add('header-loaded');
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
async handleLanguageChange(newValue) {
|
|
97
|
-
state.currentLanguage = newValue;
|
|
98
|
-
state.localizedConfig = await getLocalizedConfig({
|
|
99
|
-
projectId: this.project,
|
|
100
|
-
environment: this.environment,
|
|
101
|
-
language: newValue,
|
|
102
|
-
cookieKey: this.languageCookieKey,
|
|
103
|
-
localStorageKey: this.languageLocalStorageKey,
|
|
104
|
-
activeRouteProp: this.activeRoute,
|
|
105
|
-
localizedCustomConfig: state.localizedCustomConfig,
|
|
106
|
-
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
107
|
-
});
|
|
108
|
-
if (this.customConfig)
|
|
109
|
-
state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, newValue);
|
|
110
|
-
}
|
|
111
|
-
handleAvailableLanguagesChage(newValue) {
|
|
112
|
-
state.languageSwitchOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
|
|
113
|
-
}
|
|
114
|
-
async handleOsFlyoutOverrides(newValue) {
|
|
115
|
-
state.osFlyoutOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
|
|
116
|
-
state.localizedConfig = await getLocalizedConfig({
|
|
117
|
-
projectId: this.project,
|
|
118
|
-
environment: this.environment,
|
|
119
|
-
language: this.language,
|
|
120
|
-
cookieKey: this.languageCookieKey,
|
|
121
|
-
localStorageKey: this.languageLocalStorageKey,
|
|
122
|
-
activeRouteProp: this.activeRoute,
|
|
123
|
-
localizedCustomConfig: state.localizedCustomConfig,
|
|
124
|
-
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
async handleActiveRouteChange(newValue) {
|
|
128
|
-
state.localizedConfig = await getLocalizedConfig({
|
|
129
|
-
projectId: this.project,
|
|
130
|
-
environment: this.environment,
|
|
131
|
-
language: this.language,
|
|
132
|
-
cookieKey: this.languageCookieKey,
|
|
133
|
-
localStorageKey: this.languageLocalStorageKey,
|
|
134
|
-
activeRouteProp: newValue,
|
|
135
|
-
localizedCustomConfig: state.localizedCustomConfig,
|
|
136
|
-
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
async handleCustomConfigChange(newValue) {
|
|
140
|
-
if (this.language === undefined)
|
|
141
|
-
return;
|
|
142
|
-
const localizedCustomConfig = getLocalizedCustomConfig(newValue, this.language);
|
|
143
|
-
state.localizedCustomConfig = localizedCustomConfig;
|
|
144
|
-
state.localizedConfig = await getLocalizedConfig({
|
|
145
|
-
projectId: this.project,
|
|
146
|
-
environment: this.environment,
|
|
147
|
-
language: this.language,
|
|
148
|
-
cookieKey: this.languageCookieKey,
|
|
149
|
-
localStorageKey: this.languageLocalStorageKey,
|
|
150
|
-
activeRouteProp: this.activeRoute,
|
|
151
|
-
localizedCustomConfig: localizedCustomConfig,
|
|
152
|
-
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
handleSearchChange(newValue) {
|
|
156
|
-
state.search = newValue;
|
|
157
|
-
}
|
|
158
|
-
handleLoginChange(newValue) {
|
|
159
|
-
state.login = newValue;
|
|
160
|
-
}
|
|
161
|
-
handleMetaChange(newValue) {
|
|
162
|
-
state.meta = newValue;
|
|
163
|
-
}
|
|
164
|
-
handleLanguageChangeEvent(event) {
|
|
165
|
-
this.handleLanguageChange(event.detail);
|
|
166
|
-
}
|
|
167
|
-
handleClickOutside(event) {
|
|
168
|
-
// Close active dropdown element on click outside of it
|
|
169
|
-
if (this.activeDropdownElement && !event.composedPath().includes(this.activeDropdownElement)) {
|
|
170
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
handleKeyUp(event) {
|
|
174
|
-
if (event.key === 'Escape') {
|
|
175
|
-
if (this.activeDropdownElement) {
|
|
176
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
177
|
-
}
|
|
178
|
-
if (this.activeFlyout !== null && this.mainNav) {
|
|
179
|
-
this.mainNav.toggleDropdown(false);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
handleScrollEvent() {
|
|
184
|
-
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
185
|
-
const st = window.scrollY || document.documentElement.scrollTop;
|
|
186
|
-
// Toggle class without re-rendering the component if stickyness is minimal
|
|
187
|
-
// the other stickyness modes do not need the class
|
|
188
|
-
if (this.stickyness === 'minimal') {
|
|
189
|
-
this.host.classList.toggle('scrolling-up', st <= this.lastScrollTop);
|
|
190
|
-
}
|
|
191
|
-
// For Mobile or negative scrolling
|
|
192
|
-
this.lastScrollTop = st <= 0 ? 0 : st;
|
|
193
|
-
}
|
|
194
|
-
handleResize() {
|
|
195
|
-
var _a;
|
|
196
|
-
// Close main navigation dropdown if size changed to bigger than 1024px (search dropdown will be kept open)
|
|
197
|
-
if (this.isMainNavOpen() && this.lastWindowWidth < 1024 && window.innerWidth >= 1024) {
|
|
198
|
-
(_a = this.activeDropdownElement) === null || _a === void 0 ? void 0 : _a.toggleDropdown(false);
|
|
199
|
-
}
|
|
200
|
-
this.lastWindowWidth = window.innerWidth;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Close open dropdown menus if another is being opened
|
|
204
|
-
*
|
|
205
|
-
* @param event Dropdown toggled event
|
|
206
|
-
* @returns void
|
|
207
|
-
*/
|
|
208
|
-
handleDropdownToggled(event) {
|
|
209
|
-
if (!event.detail.open && this.activeDropdownElement !== event.detail.element) {
|
|
210
|
-
// Some dropdown got closed programmatically (possibly by this function). To prevent
|
|
211
|
-
// a circle or an outdated state, we'll not handle this event
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
if (event.detail.open === true) {
|
|
215
|
-
if (this.activeDropdownElement) {
|
|
216
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
217
|
-
}
|
|
218
|
-
this.activeDropdownElement = event.detail.element;
|
|
219
|
-
if (window.innerWidth >= 1024) {
|
|
220
|
-
// Add event listener to close active dropdown element on click outsite of it
|
|
221
|
-
// Also adds 10ms delay in case of an external interaction:
|
|
222
|
-
// Some button on the page calls toggleDropdown() -> dropdown opens
|
|
223
|
-
// Click event bubbles to the window, this.handleClickOutsideBound closes dropdown again
|
|
224
|
-
window.setTimeout(() => {
|
|
225
|
-
window.addEventListener('click', this.handleClickOutsideBound);
|
|
226
|
-
}, 10);
|
|
227
|
-
}
|
|
228
|
-
if (this.activeFlyout !== null && this.mainNav) {
|
|
229
|
-
this.mainNav.setActiveFlyout(null);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
this.activeDropdownElement = null;
|
|
234
|
-
// Remove event listener as it is not needed if no dropdown element is active
|
|
235
|
-
window.removeEventListener('click', this.handleClickOutsideBound);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Close open dropdowns if the flyout is being opened
|
|
240
|
-
* @param event Flyout toggle event
|
|
241
|
-
*/
|
|
242
|
-
handleFlyoutToggled(event) {
|
|
243
|
-
this.activeFlyout = event.detail;
|
|
244
|
-
if (this.activeDropdownElement && event.detail && !this.isMainNavOpen()) {
|
|
245
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
toggleMobileDropdown() {
|
|
249
|
-
var _a;
|
|
250
|
-
(_a = this.mainNav) === null || _a === void 0 ? void 0 : _a.toggleDropdown();
|
|
251
|
-
}
|
|
252
|
-
isMainNavOpen() {
|
|
253
|
-
return (this.activeDropdownElement && this.activeDropdownElement.tagName === 'POST-MAIN-NAVIGATION');
|
|
254
|
-
}
|
|
255
|
-
render() {
|
|
256
|
-
var _a, _b, _c;
|
|
257
|
-
if (!((_a = state.localizedConfig) === null || _a === void 0 ? void 0 : _a.header)) {
|
|
258
|
-
console.error(new Error('Internet Header: Config cannot be loaded'));
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
const config = state.localizedConfig;
|
|
262
|
-
const renderMetaNavigation = this.meta &&
|
|
263
|
-
config.header.navMeta !== undefined &&
|
|
264
|
-
((_b = config.header.navMeta) === null || _b === void 0 ? void 0 : _b.filter(meta => !meta.isHomeLink).length) > 0;
|
|
265
|
-
const renderLogin = ((_c = this.login) !== null && _c !== void 0 ? _c : !config.header.isLoginWidgetHidden) && config.header.loginWidgetOptions;
|
|
266
|
-
const renderLanguageSwitch = config.header.navLang.length > 1;
|
|
267
|
-
return (h(Host, { class: `stickyness-${this.stickyness} ${this.activeDropdownElement || this.activeFlyout ? 'dropdown-open' : ''}`, "data-version": packageJson.version, onKeyup: (e) => this.handleKeyUp(e) }, h("header", { class: `post-internet-header${this.fullWidth ? ' full-width' : ''}` }, h(SvgSprite, null), h(If, { condition: this.skiplinks === true }, h("post-skiplinks", null)), h(If, { condition: renderMetaNavigation === true }, h("post-meta-navigation", { orientation: "horizontal", class: "hidden-lg", "full-width": this.fullWidth }, h(If, { condition: renderLanguageSwitch === true }, h("post-language-switch", { id: "post-language-switch-desktop", mode: "dropdown", onDropdownToggled: e => this.handleDropdownToggled(e) })))), h("div", { class: "main-navigation-container wide-container" }, h("post-logo", null), h("button", { class: "menu-button nav-link", onClick: () => this.toggleMobileDropdown() }, h("span", { class: "menu-button-text visually-hidden" }, config.header.mobileMenu.text), h(SvgIcon, { name: this.isMainNavOpen() ? 'pi-close' : 'pi-menu' })), h("post-main-navigation", { onDropdownToggled: e => this.handleDropdownToggled(e), onFlyoutToggled: e => this.handleFlyoutToggled(e), ref: el => (this.mainNav = el) }, h(If, { condition: renderMetaNavigation === true }, h("post-meta-navigation", { orientation: "vertical" }, h(If, { condition: renderLanguageSwitch === true }, h("post-language-switch", { id: "post-language-switch-mobile", mode: "list" }))))), h("div", { class: "main-navigation-controls" }, h(If, { condition: this.search !== false }, h("post-search", { onDropdownToggled: e => this.handleDropdownToggled(e) })), h(If, { condition: !!renderLogin }, h("post-klp-login-widget", null, h("slot", { name: "login-widget" }))), h(If, { condition: renderMetaNavigation === false && renderLanguageSwitch === true }, h("post-language-switch", { id: "post-language-switch-no-meta", onDropdownToggled: e => this.handleDropdownToggled(e), mode: "dropdown" })), h("slot", { name: "main" }))))));
|
|
268
|
-
}
|
|
269
|
-
static get is() { return "swisspost-internet-header"; }
|
|
270
|
-
static get encapsulation() { return "shadow"; }
|
|
271
|
-
static get originalStyleUrls() {
|
|
272
|
-
return {
|
|
273
|
-
"$": ["post-internet-header.scss"]
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
static get styleUrls() {
|
|
277
|
-
return {
|
|
278
|
-
"$": ["post-internet-header.css"]
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
static get properties() {
|
|
282
|
-
return {
|
|
283
|
-
"project": {
|
|
284
|
-
"type": "string",
|
|
285
|
-
"mutable": false,
|
|
286
|
-
"complexType": {
|
|
287
|
-
"original": "string",
|
|
288
|
-
"resolved": "string",
|
|
289
|
-
"references": {}
|
|
290
|
-
},
|
|
291
|
-
"required": false,
|
|
292
|
-
"optional": false,
|
|
293
|
-
"docs": {
|
|
294
|
-
"tags": [],
|
|
295
|
-
"text": "Your project id, previously passed as query string parameter serviceId."
|
|
296
|
-
},
|
|
297
|
-
"attribute": "project",
|
|
298
|
-
"reflect": false
|
|
299
|
-
},
|
|
300
|
-
"stickyness": {
|
|
301
|
-
"type": "string",
|
|
302
|
-
"mutable": false,
|
|
303
|
-
"complexType": {
|
|
304
|
-
"original": "StickynessOptions",
|
|
305
|
-
"resolved": "\"full\" | \"main\" | \"minimal\" | \"none\"",
|
|
306
|
-
"references": {
|
|
307
|
-
"StickynessOptions": {
|
|
308
|
-
"location": "import",
|
|
309
|
-
"path": "../../models/implementor.model"
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
"required": false,
|
|
314
|
-
"optional": false,
|
|
315
|
-
"docs": {
|
|
316
|
-
"tags": [],
|
|
317
|
-
"text": "Sticky behaviour of the header."
|
|
318
|
-
},
|
|
319
|
-
"attribute": "stickyness",
|
|
320
|
-
"reflect": false,
|
|
321
|
-
"defaultValue": "'minimal'"
|
|
322
|
-
},
|
|
323
|
-
"language": {
|
|
324
|
-
"type": "string",
|
|
325
|
-
"mutable": false,
|
|
326
|
-
"complexType": {
|
|
327
|
-
"original": "string",
|
|
328
|
-
"resolved": "string | undefined",
|
|
329
|
-
"references": {}
|
|
330
|
-
},
|
|
331
|
-
"required": false,
|
|
332
|
-
"optional": true,
|
|
333
|
-
"docs": {
|
|
334
|
-
"tags": [],
|
|
335
|
-
"text": "Initial language to be used. Overrides automatic language detection."
|
|
336
|
-
},
|
|
337
|
-
"attribute": "language",
|
|
338
|
-
"reflect": false
|
|
339
|
-
},
|
|
340
|
-
"meta": {
|
|
341
|
-
"type": "boolean",
|
|
342
|
-
"mutable": false,
|
|
343
|
-
"complexType": {
|
|
344
|
-
"original": "boolean",
|
|
345
|
-
"resolved": "boolean",
|
|
346
|
-
"references": {}
|
|
347
|
-
},
|
|
348
|
-
"required": false,
|
|
349
|
-
"optional": false,
|
|
350
|
-
"docs": {
|
|
351
|
-
"tags": [],
|
|
352
|
-
"text": "Toggle the meta navigation."
|
|
353
|
-
},
|
|
354
|
-
"attribute": "meta",
|
|
355
|
-
"reflect": false,
|
|
356
|
-
"defaultValue": "true"
|
|
357
|
-
},
|
|
358
|
-
"login": {
|
|
359
|
-
"type": "boolean",
|
|
360
|
-
"mutable": false,
|
|
361
|
-
"complexType": {
|
|
362
|
-
"original": "boolean",
|
|
363
|
-
"resolved": "boolean",
|
|
364
|
-
"references": {}
|
|
365
|
-
},
|
|
366
|
-
"required": false,
|
|
367
|
-
"optional": false,
|
|
368
|
-
"docs": {
|
|
369
|
-
"tags": [],
|
|
370
|
-
"text": "Toggle the login link (when logged out) or the user widget (when logged in)."
|
|
371
|
-
},
|
|
372
|
-
"attribute": "login",
|
|
373
|
-
"reflect": false,
|
|
374
|
-
"defaultValue": "true"
|
|
375
|
-
},
|
|
376
|
-
"search": {
|
|
377
|
-
"type": "boolean",
|
|
378
|
-
"mutable": false,
|
|
379
|
-
"complexType": {
|
|
380
|
-
"original": "boolean",
|
|
381
|
-
"resolved": "boolean",
|
|
382
|
-
"references": {}
|
|
383
|
-
},
|
|
384
|
-
"required": false,
|
|
385
|
-
"optional": false,
|
|
386
|
-
"docs": {
|
|
387
|
-
"tags": [],
|
|
388
|
-
"text": "Toggle the search button."
|
|
389
|
-
},
|
|
390
|
-
"attribute": "search",
|
|
391
|
-
"reflect": false,
|
|
392
|
-
"defaultValue": "true"
|
|
393
|
-
},
|
|
394
|
-
"skiplinks": {
|
|
395
|
-
"type": "boolean",
|
|
396
|
-
"mutable": false,
|
|
397
|
-
"complexType": {
|
|
398
|
-
"original": "boolean",
|
|
399
|
-
"resolved": "boolean",
|
|
400
|
-
"references": {}
|
|
401
|
-
},
|
|
402
|
-
"required": false,
|
|
403
|
-
"optional": false,
|
|
404
|
-
"docs": {
|
|
405
|
-
"tags": [],
|
|
406
|
-
"text": "Toggle skiplinks. They help keyboard users to quickly jump to important sections of the page."
|
|
407
|
-
},
|
|
408
|
-
"attribute": "skiplinks",
|
|
409
|
-
"reflect": false,
|
|
410
|
-
"defaultValue": "true"
|
|
411
|
-
},
|
|
412
|
-
"configProxy": {
|
|
413
|
-
"type": "string",
|
|
414
|
-
"mutable": false,
|
|
415
|
-
"complexType": {
|
|
416
|
-
"original": "string",
|
|
417
|
-
"resolved": "string | undefined",
|
|
418
|
-
"references": {}
|
|
419
|
-
},
|
|
420
|
-
"required": false,
|
|
421
|
-
"optional": true,
|
|
422
|
-
"docs": {
|
|
423
|
-
"tags": [],
|
|
424
|
-
"text": "DEPRECATED!: Define a proxy URL for the config fetch request. Will be removed in the next major version"
|
|
425
|
-
},
|
|
426
|
-
"attribute": "config-proxy",
|
|
427
|
-
"reflect": false
|
|
428
|
-
},
|
|
429
|
-
"environment": {
|
|
430
|
-
"type": "string",
|
|
431
|
-
"mutable": false,
|
|
432
|
-
"complexType": {
|
|
433
|
-
"original": "Environment",
|
|
434
|
-
"resolved": "\"int01\" | \"int02\" | \"prod\"",
|
|
435
|
-
"references": {
|
|
436
|
-
"Environment": {
|
|
437
|
-
"location": "import",
|
|
438
|
-
"path": "../../models/general.model"
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
},
|
|
442
|
-
"required": false,
|
|
443
|
-
"optional": false,
|
|
444
|
-
"docs": {
|
|
445
|
-
"tags": [],
|
|
446
|
-
"text": "Target environment. Choose 'int01' for local testing."
|
|
447
|
-
},
|
|
448
|
-
"attribute": "environment",
|
|
449
|
-
"reflect": false,
|
|
450
|
-
"defaultValue": "'prod'"
|
|
451
|
-
},
|
|
452
|
-
"languageSwitchOverrides": {
|
|
453
|
-
"type": "string",
|
|
454
|
-
"mutable": false,
|
|
455
|
-
"complexType": {
|
|
456
|
-
"original": "string | IAvailableLanguage[]",
|
|
457
|
-
"resolved": "IAvailableLanguage[] | string | undefined",
|
|
458
|
-
"references": {
|
|
459
|
-
"IAvailableLanguage": {
|
|
460
|
-
"location": "import",
|
|
461
|
-
"path": "../../models/language.model"
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
},
|
|
465
|
-
"required": false,
|
|
466
|
-
"optional": true,
|
|
467
|
-
"docs": {
|
|
468
|
-
"tags": [],
|
|
469
|
-
"text": "Override the language switch links with custom URLs. Helpful when your application contains sub-pages and you\
|
|
470
|
-
},
|
|
471
|
-
"attribute": "language-switch-overrides",
|
|
472
|
-
"reflect": false
|
|
473
|
-
},
|
|
474
|
-
"customConfig": {
|
|
475
|
-
"type": "string",
|
|
476
|
-
"mutable": false,
|
|
477
|
-
"complexType": {
|
|
478
|
-
"original": "string | ICustomConfig",
|
|
479
|
-
"resolved": "ICustomConfig | string | undefined",
|
|
480
|
-
"references": {
|
|
481
|
-
"ICustomConfig": {
|
|
482
|
-
"location": "import",
|
|
483
|
-
"path": "../../models/general.model"
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
},
|
|
487
|
-
"required": false,
|
|
488
|
-
"optional": true,
|
|
489
|
-
"docs": {
|
|
490
|
-
"tags": [],
|
|
491
|
-
"text": "Customize the header config loaded from the post portal."
|
|
492
|
-
},
|
|
493
|
-
"attribute": "custom-config",
|
|
494
|
-
"reflect": false
|
|
495
|
-
},
|
|
496
|
-
"languageCookieKey": {
|
|
497
|
-
"type": "string",
|
|
498
|
-
"mutable": false,
|
|
499
|
-
"complexType": {
|
|
500
|
-
"original": "string",
|
|
501
|
-
"resolved": "string | undefined",
|
|
502
|
-
"references": {}
|
|
503
|
-
},
|
|
504
|
-
"required": false,
|
|
505
|
-
"optional": true,
|
|
506
|
-
"docs": {
|
|
507
|
-
"tags": [],
|
|
508
|
-
"text": "The header uses this cookie to set the language. Disables automatic language detection."
|
|
509
|
-
},
|
|
510
|
-
"attribute": "language-cookie-key",
|
|
511
|
-
"reflect": false
|
|
512
|
-
},
|
|
513
|
-
"languageLocalStorageKey": {
|
|
514
|
-
"type": "string",
|
|
515
|
-
"mutable": false,
|
|
516
|
-
"complexType": {
|
|
517
|
-
"original": "string",
|
|
518
|
-
"resolved": "string | undefined",
|
|
519
|
-
"references": {}
|
|
520
|
-
},
|
|
521
|
-
"required": false,
|
|
522
|
-
"optional": true,
|
|
523
|
-
"docs": {
|
|
524
|
-
"tags": [],
|
|
525
|
-
"text": "The header uses this local storage key to set the language. Disables automatic language selection."
|
|
526
|
-
},
|
|
527
|
-
"attribute": "language-local-storage-key",
|
|
528
|
-
"reflect": false,
|
|
529
|
-
"defaultValue": "'swisspost-internet-header-language'"
|
|
530
|
-
},
|
|
531
|
-
"activeRoute": {
|
|
532
|
-
"type": "any",
|
|
533
|
-
"mutable": false,
|
|
534
|
-
"complexType": {
|
|
535
|
-
"original": "'auto' | false | string",
|
|
536
|
-
"resolved": "boolean | string | undefined",
|
|
537
|
-
"references": {}
|
|
538
|
-
},
|
|
539
|
-
"required": false,
|
|
540
|
-
"optional": true,
|
|
541
|
-
"docs": {
|
|
542
|
-
"tags": [],
|
|
543
|
-
"text": "Set the currently activated route. If there is a link matching this URL in the header, it will be highlighted.\
|
|
544
|
-
},
|
|
545
|
-
"attribute": "active-route",
|
|
546
|
-
"reflect": false,
|
|
547
|
-
"defaultValue": "'auto'"
|
|
548
|
-
},
|
|
549
|
-
"osFlyoutOverrides": {
|
|
550
|
-
"type": "string",
|
|
551
|
-
"mutable": false,
|
|
552
|
-
"complexType": {
|
|
553
|
-
"original": "string | NavMainEntity",
|
|
554
|
-
"resolved": "NavMainEntity | string | undefined",
|
|
555
|
-
"references": {
|
|
556
|
-
"NavMainEntity": {
|
|
557
|
-
"location": "import",
|
|
558
|
-
"path": "../../models/header.model"
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
},
|
|
562
|
-
"required": false,
|
|
563
|
-
"optional": true,
|
|
564
|
-
"docs": {
|
|
565
|
-
"tags": [],
|
|
566
|
-
"text": "Online Services only: Add custom links to the special online service navigation entry"
|
|
567
|
-
},
|
|
568
|
-
"attribute": "os-flyout-overrides",
|
|
569
|
-
"reflect": false
|
|
570
|
-
},
|
|
571
|
-
"fullWidth": {
|
|
572
|
-
"type": "boolean",
|
|
573
|
-
"mutable": false,
|
|
574
|
-
"complexType": {
|
|
575
|
-
"original": "boolean",
|
|
576
|
-
"resolved": "boolean | undefined",
|
|
577
|
-
"references": {}
|
|
578
|
-
},
|
|
579
|
-
"required": false,
|
|
580
|
-
"optional": true,
|
|
581
|
-
"docs": {
|
|
582
|
-
"tags": [],
|
|
583
|
-
"text": "Displays the header at full width for full-screen applications"
|
|
584
|
-
},
|
|
585
|
-
"attribute": "full-width",
|
|
586
|
-
"reflect": false,
|
|
587
|
-
"defaultValue": "false"
|
|
588
|
-
}
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
static get states() {
|
|
592
|
-
return {
|
|
593
|
-
"activeFlyout": {},
|
|
594
|
-
"activeDropdownElement": {}
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
static get events() {
|
|
598
|
-
return [{
|
|
599
|
-
"method": "headerLoaded",
|
|
600
|
-
"name": "headerLoaded",
|
|
601
|
-
"bubbles": true,
|
|
602
|
-
"cancelable": true,
|
|
603
|
-
"composed": true,
|
|
604
|
-
"docs": {
|
|
605
|
-
"tags": [],
|
|
606
|
-
"text": "Fires when the header has been rendered to the page."
|
|
607
|
-
},
|
|
608
|
-
"complexType": {
|
|
609
|
-
"original": "void",
|
|
610
|
-
"resolved": "void",
|
|
611
|
-
"references": {}
|
|
612
|
-
}
|
|
613
|
-
}];
|
|
614
|
-
}
|
|
615
|
-
static get methods() {
|
|
616
|
-
return {
|
|
617
|
-
"getCurrentLanguage": {
|
|
618
|
-
"complexType": {
|
|
619
|
-
"signature": "() => Promise<'de' | 'fr' | 'it' | 'en' | string>",
|
|
620
|
-
"parameters": [],
|
|
621
|
-
"references": {
|
|
622
|
-
"Promise": {
|
|
623
|
-
"location": "global"
|
|
624
|
-
}
|
|
625
|
-
},
|
|
626
|
-
"return": "Promise<string>"
|
|
627
|
-
},
|
|
628
|
-
"docs": {
|
|
629
|
-
"text": "Get the currently set language as a two letter string (\"de\", \"fr\" \"it\" or \"en\")",
|
|
630
|
-
"tags": [{
|
|
631
|
-
"name": "returns",
|
|
632
|
-
"text": "string"
|
|
633
|
-
}]
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
static get elementRef() { return "host"; }
|
|
639
|
-
static get watchers() {
|
|
640
|
-
return [{
|
|
641
|
-
"propName": "language",
|
|
642
|
-
"methodName": "handleLanguageChange"
|
|
643
|
-
}, {
|
|
644
|
-
"propName": "languageSwitchOverrides",
|
|
645
|
-
"methodName": "handleAvailableLanguagesChage"
|
|
646
|
-
}, {
|
|
647
|
-
"propName": "osFlyoutOverrides",
|
|
648
|
-
"methodName": "handleOsFlyoutOverrides"
|
|
649
|
-
}, {
|
|
650
|
-
"propName": "activeRoute",
|
|
651
|
-
"methodName": "handleActiveRouteChange"
|
|
652
|
-
}, {
|
|
653
|
-
"propName": "customConfig",
|
|
654
|
-
"methodName": "handleCustomConfigChange"
|
|
655
|
-
}, {
|
|
656
|
-
"propName": "search",
|
|
657
|
-
"methodName": "handleSearchChange"
|
|
658
|
-
}, {
|
|
659
|
-
"propName": "login",
|
|
660
|
-
"methodName": "handleLoginChange"
|
|
661
|
-
}, {
|
|
662
|
-
"propName": "meta",
|
|
663
|
-
"methodName": "handleMetaChange"
|
|
664
|
-
}];
|
|
665
|
-
}
|
|
666
|
-
static get listeners() {
|
|
667
|
-
return [{
|
|
668
|
-
"name": "languageChanged",
|
|
669
|
-
"method": "handleLanguageChangeEvent",
|
|
670
|
-
"target": undefined,
|
|
671
|
-
"capture": false,
|
|
672
|
-
"passive": false
|
|
673
|
-
}];
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
//# sourceMappingURL=post-internet-header.js.map
|
|
1
|
+
import { Host, h, } from '@stencil/core';
|
|
2
|
+
import { debounce, throttle } from 'throttle-debounce';
|
|
3
|
+
import { getLocalizedConfig, getLocalizedCustomConfig, isValidProjectId, } from '../../services/config.service';
|
|
4
|
+
import { state, dispose } from '../../data/store';
|
|
5
|
+
import { SvgSprite } from '../../utils/svg-sprite.component';
|
|
6
|
+
import { SvgIcon } from '../../utils/svg-icon.component';
|
|
7
|
+
import { If } from '../../utils/if.component';
|
|
8
|
+
import packageJson from '../../../package.json';
|
|
9
|
+
export class PostInternetHeader {
|
|
10
|
+
/**
|
|
11
|
+
* Get the currently set language as a two letter string ("de", "fr" "it" or "en")
|
|
12
|
+
* @returns string
|
|
13
|
+
*/
|
|
14
|
+
async getCurrentLanguage() {
|
|
15
|
+
var _a;
|
|
16
|
+
return (_a = state.currentLanguage) !== null && _a !== void 0 ? _a : 'de';
|
|
17
|
+
}
|
|
18
|
+
constructor() {
|
|
19
|
+
this.lastScrollTop = window.scrollY || document.documentElement.scrollTop;
|
|
20
|
+
this.lastWindowWidth = window.innerWidth;
|
|
21
|
+
this.handleClickOutsideBound = this.handleClickOutside.bind(this);
|
|
22
|
+
this.project = undefined;
|
|
23
|
+
this.stickyness = 'minimal';
|
|
24
|
+
this.language = undefined;
|
|
25
|
+
this.meta = true;
|
|
26
|
+
this.login = true;
|
|
27
|
+
this.search = true;
|
|
28
|
+
this.skiplinks = true;
|
|
29
|
+
this.configProxy = undefined;
|
|
30
|
+
this.environment = 'prod';
|
|
31
|
+
this.languageSwitchOverrides = undefined;
|
|
32
|
+
this.customConfig = undefined;
|
|
33
|
+
this.languageCookieKey = undefined;
|
|
34
|
+
this.languageLocalStorageKey = 'swisspost-internet-header-language';
|
|
35
|
+
this.activeRoute = 'auto';
|
|
36
|
+
this.osFlyoutOverrides = undefined;
|
|
37
|
+
this.fullWidth = false;
|
|
38
|
+
this.activeFlyout = null;
|
|
39
|
+
this.activeDropdownElement = null;
|
|
40
|
+
if (this.project === undefined || this.project === '' || !isValidProjectId(this.project)) {
|
|
41
|
+
throw new Error(`Internet Header project key is "${this.project}". Please provide a valid project key.`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
connectedCallback() {
|
|
45
|
+
this.throttledScroll = throttle(300, () => this.handleScrollEvent());
|
|
46
|
+
this.debouncedResize = debounce(200, () => this.handleResize());
|
|
47
|
+
window.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
48
|
+
window.addEventListener('resize', this.debouncedResize, { passive: true });
|
|
49
|
+
}
|
|
50
|
+
disconnectedCallback() {
|
|
51
|
+
window.removeEventListener('scroll', this.throttledScroll);
|
|
52
|
+
window.removeEventListener('resize', this.debouncedResize);
|
|
53
|
+
// Reset the store to its original state
|
|
54
|
+
dispose();
|
|
55
|
+
}
|
|
56
|
+
async componentWillLoad() {
|
|
57
|
+
// Wait for the config to arrive, then render the header
|
|
58
|
+
try {
|
|
59
|
+
state.projectId = this.project;
|
|
60
|
+
state.environment = this.environment;
|
|
61
|
+
if (this.language !== undefined)
|
|
62
|
+
state.currentLanguage = this.language;
|
|
63
|
+
state.languageSwitchOverrides =
|
|
64
|
+
typeof this.languageSwitchOverrides === 'string'
|
|
65
|
+
? JSON.parse(this.languageSwitchOverrides)
|
|
66
|
+
: this.languageSwitchOverrides;
|
|
67
|
+
state.osFlyoutOverrides =
|
|
68
|
+
typeof this.osFlyoutOverrides === 'string'
|
|
69
|
+
? JSON.parse(this.osFlyoutOverrides)
|
|
70
|
+
: this.osFlyoutOverrides;
|
|
71
|
+
if (this.customConfig !== undefined && state.currentLanguage !== null) {
|
|
72
|
+
state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, state.currentLanguage);
|
|
73
|
+
}
|
|
74
|
+
state.localizedConfig = await getLocalizedConfig({
|
|
75
|
+
projectId: this.project,
|
|
76
|
+
environment: this.environment,
|
|
77
|
+
language: this.language,
|
|
78
|
+
cookieKey: this.languageCookieKey,
|
|
79
|
+
localStorageKey: this.languageLocalStorageKey,
|
|
80
|
+
activeRouteProp: this.activeRoute,
|
|
81
|
+
localizedCustomConfig: state.localizedCustomConfig,
|
|
82
|
+
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error(error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
componentDidLoad() {
|
|
90
|
+
window.requestAnimationFrame(() => {
|
|
91
|
+
this.handleResize();
|
|
92
|
+
this.headerLoaded.emit();
|
|
93
|
+
this.host.classList.add('header-loaded');
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
async handleLanguageChange(newValue) {
|
|
97
|
+
state.currentLanguage = newValue;
|
|
98
|
+
state.localizedConfig = await getLocalizedConfig({
|
|
99
|
+
projectId: this.project,
|
|
100
|
+
environment: this.environment,
|
|
101
|
+
language: newValue,
|
|
102
|
+
cookieKey: this.languageCookieKey,
|
|
103
|
+
localStorageKey: this.languageLocalStorageKey,
|
|
104
|
+
activeRouteProp: this.activeRoute,
|
|
105
|
+
localizedCustomConfig: state.localizedCustomConfig,
|
|
106
|
+
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
107
|
+
});
|
|
108
|
+
if (this.customConfig)
|
|
109
|
+
state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, newValue);
|
|
110
|
+
}
|
|
111
|
+
handleAvailableLanguagesChage(newValue) {
|
|
112
|
+
state.languageSwitchOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
|
|
113
|
+
}
|
|
114
|
+
async handleOsFlyoutOverrides(newValue) {
|
|
115
|
+
state.osFlyoutOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
|
|
116
|
+
state.localizedConfig = await getLocalizedConfig({
|
|
117
|
+
projectId: this.project,
|
|
118
|
+
environment: this.environment,
|
|
119
|
+
language: this.language,
|
|
120
|
+
cookieKey: this.languageCookieKey,
|
|
121
|
+
localStorageKey: this.languageLocalStorageKey,
|
|
122
|
+
activeRouteProp: this.activeRoute,
|
|
123
|
+
localizedCustomConfig: state.localizedCustomConfig,
|
|
124
|
+
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
async handleActiveRouteChange(newValue) {
|
|
128
|
+
state.localizedConfig = await getLocalizedConfig({
|
|
129
|
+
projectId: this.project,
|
|
130
|
+
environment: this.environment,
|
|
131
|
+
language: this.language,
|
|
132
|
+
cookieKey: this.languageCookieKey,
|
|
133
|
+
localStorageKey: this.languageLocalStorageKey,
|
|
134
|
+
activeRouteProp: newValue,
|
|
135
|
+
localizedCustomConfig: state.localizedCustomConfig,
|
|
136
|
+
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
async handleCustomConfigChange(newValue) {
|
|
140
|
+
if (this.language === undefined)
|
|
141
|
+
return;
|
|
142
|
+
const localizedCustomConfig = getLocalizedCustomConfig(newValue, this.language);
|
|
143
|
+
state.localizedCustomConfig = localizedCustomConfig;
|
|
144
|
+
state.localizedConfig = await getLocalizedConfig({
|
|
145
|
+
projectId: this.project,
|
|
146
|
+
environment: this.environment,
|
|
147
|
+
language: this.language,
|
|
148
|
+
cookieKey: this.languageCookieKey,
|
|
149
|
+
localStorageKey: this.languageLocalStorageKey,
|
|
150
|
+
activeRouteProp: this.activeRoute,
|
|
151
|
+
localizedCustomConfig: localizedCustomConfig,
|
|
152
|
+
osFlyoutOverrides: state.osFlyoutOverrides,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
handleSearchChange(newValue) {
|
|
156
|
+
state.search = newValue;
|
|
157
|
+
}
|
|
158
|
+
handleLoginChange(newValue) {
|
|
159
|
+
state.login = newValue;
|
|
160
|
+
}
|
|
161
|
+
handleMetaChange(newValue) {
|
|
162
|
+
state.meta = newValue;
|
|
163
|
+
}
|
|
164
|
+
handleLanguageChangeEvent(event) {
|
|
165
|
+
this.handleLanguageChange(event.detail);
|
|
166
|
+
}
|
|
167
|
+
handleClickOutside(event) {
|
|
168
|
+
// Close active dropdown element on click outside of it
|
|
169
|
+
if (this.activeDropdownElement && !event.composedPath().includes(this.activeDropdownElement)) {
|
|
170
|
+
this.activeDropdownElement.toggleDropdown(false);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
handleKeyUp(event) {
|
|
174
|
+
if (event.key === 'Escape') {
|
|
175
|
+
if (this.activeDropdownElement) {
|
|
176
|
+
this.activeDropdownElement.toggleDropdown(false);
|
|
177
|
+
}
|
|
178
|
+
if (this.activeFlyout !== null && this.mainNav) {
|
|
179
|
+
this.mainNav.toggleDropdown(false);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
handleScrollEvent() {
|
|
184
|
+
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
185
|
+
const st = window.scrollY || document.documentElement.scrollTop;
|
|
186
|
+
// Toggle class without re-rendering the component if stickyness is minimal
|
|
187
|
+
// the other stickyness modes do not need the class
|
|
188
|
+
if (this.stickyness === 'minimal') {
|
|
189
|
+
this.host.classList.toggle('scrolling-up', st <= this.lastScrollTop);
|
|
190
|
+
}
|
|
191
|
+
// For Mobile or negative scrolling
|
|
192
|
+
this.lastScrollTop = st <= 0 ? 0 : st;
|
|
193
|
+
}
|
|
194
|
+
handleResize() {
|
|
195
|
+
var _a;
|
|
196
|
+
// Close main navigation dropdown if size changed to bigger than 1024px (search dropdown will be kept open)
|
|
197
|
+
if (this.isMainNavOpen() && this.lastWindowWidth < 1024 && window.innerWidth >= 1024) {
|
|
198
|
+
(_a = this.activeDropdownElement) === null || _a === void 0 ? void 0 : _a.toggleDropdown(false);
|
|
199
|
+
}
|
|
200
|
+
this.lastWindowWidth = window.innerWidth;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Close open dropdown menus if another is being opened
|
|
204
|
+
*
|
|
205
|
+
* @param event Dropdown toggled event
|
|
206
|
+
* @returns void
|
|
207
|
+
*/
|
|
208
|
+
handleDropdownToggled(event) {
|
|
209
|
+
if (!event.detail.open && this.activeDropdownElement !== event.detail.element) {
|
|
210
|
+
// Some dropdown got closed programmatically (possibly by this function). To prevent
|
|
211
|
+
// a circle or an outdated state, we'll not handle this event
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (event.detail.open === true) {
|
|
215
|
+
if (this.activeDropdownElement) {
|
|
216
|
+
this.activeDropdownElement.toggleDropdown(false);
|
|
217
|
+
}
|
|
218
|
+
this.activeDropdownElement = event.detail.element;
|
|
219
|
+
if (window.innerWidth >= 1024) {
|
|
220
|
+
// Add event listener to close active dropdown element on click outsite of it
|
|
221
|
+
// Also adds 10ms delay in case of an external interaction:
|
|
222
|
+
// Some button on the page calls toggleDropdown() -> dropdown opens
|
|
223
|
+
// Click event bubbles to the window, this.handleClickOutsideBound closes dropdown again
|
|
224
|
+
window.setTimeout(() => {
|
|
225
|
+
window.addEventListener('click', this.handleClickOutsideBound);
|
|
226
|
+
}, 10);
|
|
227
|
+
}
|
|
228
|
+
if (this.activeFlyout !== null && this.mainNav) {
|
|
229
|
+
this.mainNav.setActiveFlyout(null);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
this.activeDropdownElement = null;
|
|
234
|
+
// Remove event listener as it is not needed if no dropdown element is active
|
|
235
|
+
window.removeEventListener('click', this.handleClickOutsideBound);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Close open dropdowns if the flyout is being opened
|
|
240
|
+
* @param event Flyout toggle event
|
|
241
|
+
*/
|
|
242
|
+
handleFlyoutToggled(event) {
|
|
243
|
+
this.activeFlyout = event.detail;
|
|
244
|
+
if (this.activeDropdownElement && event.detail && !this.isMainNavOpen()) {
|
|
245
|
+
this.activeDropdownElement.toggleDropdown(false);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
toggleMobileDropdown() {
|
|
249
|
+
var _a;
|
|
250
|
+
(_a = this.mainNav) === null || _a === void 0 ? void 0 : _a.toggleDropdown();
|
|
251
|
+
}
|
|
252
|
+
isMainNavOpen() {
|
|
253
|
+
return (this.activeDropdownElement && this.activeDropdownElement.tagName === 'POST-MAIN-NAVIGATION');
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
var _a, _b, _c;
|
|
257
|
+
if (!((_a = state.localizedConfig) === null || _a === void 0 ? void 0 : _a.header)) {
|
|
258
|
+
console.error(new Error('Internet Header: Config cannot be loaded'));
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const config = state.localizedConfig;
|
|
262
|
+
const renderMetaNavigation = this.meta &&
|
|
263
|
+
config.header.navMeta !== undefined &&
|
|
264
|
+
((_b = config.header.navMeta) === null || _b === void 0 ? void 0 : _b.filter(meta => !meta.isHomeLink).length) > 0;
|
|
265
|
+
const renderLogin = ((_c = this.login) !== null && _c !== void 0 ? _c : !config.header.isLoginWidgetHidden) && config.header.loginWidgetOptions;
|
|
266
|
+
const renderLanguageSwitch = config.header.navLang.length > 1;
|
|
267
|
+
return (h(Host, { class: `stickyness-${this.stickyness} ${this.activeDropdownElement || this.activeFlyout ? 'dropdown-open' : ''}`, "data-version": packageJson.version, onKeyup: (e) => this.handleKeyUp(e) }, h("header", { class: `post-internet-header${this.fullWidth ? ' full-width' : ''}` }, h(SvgSprite, null), h(If, { condition: this.skiplinks === true }, h("post-skiplinks", null)), h(If, { condition: renderMetaNavigation === true }, h("post-meta-navigation", { orientation: "horizontal", class: "hidden-lg", "full-width": this.fullWidth }, h(If, { condition: renderLanguageSwitch === true }, h("post-language-switch", { id: "post-language-switch-desktop", mode: "dropdown", onDropdownToggled: e => this.handleDropdownToggled(e) })))), h("div", { class: "main-navigation-container wide-container" }, h("post-logo", null), h("button", { class: "menu-button nav-link", onClick: () => this.toggleMobileDropdown() }, h("span", { class: "menu-button-text visually-hidden" }, config.header.mobileMenu.text), h(SvgIcon, { name: this.isMainNavOpen() ? 'pi-close' : 'pi-menu' })), h("post-main-navigation", { onDropdownToggled: e => this.handleDropdownToggled(e), onFlyoutToggled: e => this.handleFlyoutToggled(e), ref: el => (this.mainNav = el) }, h(If, { condition: renderMetaNavigation === true }, h("post-meta-navigation", { orientation: "vertical" }, h(If, { condition: renderLanguageSwitch === true }, h("post-language-switch", { id: "post-language-switch-mobile", mode: "list" }))))), h("div", { class: "main-navigation-controls" }, h(If, { condition: this.search !== false }, h("post-search", { onDropdownToggled: e => this.handleDropdownToggled(e) })), h(If, { condition: !!renderLogin }, h("post-klp-login-widget", null, h("slot", { name: "login-widget" }))), h(If, { condition: renderMetaNavigation === false && renderLanguageSwitch === true }, h("post-language-switch", { id: "post-language-switch-no-meta", onDropdownToggled: e => this.handleDropdownToggled(e), mode: "dropdown" })), h("slot", { name: "main" }))))));
|
|
268
|
+
}
|
|
269
|
+
static get is() { return "swisspost-internet-header"; }
|
|
270
|
+
static get encapsulation() { return "shadow"; }
|
|
271
|
+
static get originalStyleUrls() {
|
|
272
|
+
return {
|
|
273
|
+
"$": ["post-internet-header.scss"]
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
static get styleUrls() {
|
|
277
|
+
return {
|
|
278
|
+
"$": ["post-internet-header.css"]
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
static get properties() {
|
|
282
|
+
return {
|
|
283
|
+
"project": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"mutable": false,
|
|
286
|
+
"complexType": {
|
|
287
|
+
"original": "string",
|
|
288
|
+
"resolved": "string",
|
|
289
|
+
"references": {}
|
|
290
|
+
},
|
|
291
|
+
"required": false,
|
|
292
|
+
"optional": false,
|
|
293
|
+
"docs": {
|
|
294
|
+
"tags": [],
|
|
295
|
+
"text": "Your project id, previously passed as query string parameter serviceId."
|
|
296
|
+
},
|
|
297
|
+
"attribute": "project",
|
|
298
|
+
"reflect": false
|
|
299
|
+
},
|
|
300
|
+
"stickyness": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "StickynessOptions",
|
|
305
|
+
"resolved": "\"full\" | \"main\" | \"minimal\" | \"none\"",
|
|
306
|
+
"references": {
|
|
307
|
+
"StickynessOptions": {
|
|
308
|
+
"location": "import",
|
|
309
|
+
"path": "../../models/implementor.model"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"required": false,
|
|
314
|
+
"optional": false,
|
|
315
|
+
"docs": {
|
|
316
|
+
"tags": [],
|
|
317
|
+
"text": "Sticky behaviour of the header."
|
|
318
|
+
},
|
|
319
|
+
"attribute": "stickyness",
|
|
320
|
+
"reflect": false,
|
|
321
|
+
"defaultValue": "'minimal'"
|
|
322
|
+
},
|
|
323
|
+
"language": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"mutable": false,
|
|
326
|
+
"complexType": {
|
|
327
|
+
"original": "string",
|
|
328
|
+
"resolved": "string | undefined",
|
|
329
|
+
"references": {}
|
|
330
|
+
},
|
|
331
|
+
"required": false,
|
|
332
|
+
"optional": true,
|
|
333
|
+
"docs": {
|
|
334
|
+
"tags": [],
|
|
335
|
+
"text": "Initial language to be used. Overrides automatic language detection."
|
|
336
|
+
},
|
|
337
|
+
"attribute": "language",
|
|
338
|
+
"reflect": false
|
|
339
|
+
},
|
|
340
|
+
"meta": {
|
|
341
|
+
"type": "boolean",
|
|
342
|
+
"mutable": false,
|
|
343
|
+
"complexType": {
|
|
344
|
+
"original": "boolean",
|
|
345
|
+
"resolved": "boolean",
|
|
346
|
+
"references": {}
|
|
347
|
+
},
|
|
348
|
+
"required": false,
|
|
349
|
+
"optional": false,
|
|
350
|
+
"docs": {
|
|
351
|
+
"tags": [],
|
|
352
|
+
"text": "Toggle the meta navigation."
|
|
353
|
+
},
|
|
354
|
+
"attribute": "meta",
|
|
355
|
+
"reflect": false,
|
|
356
|
+
"defaultValue": "true"
|
|
357
|
+
},
|
|
358
|
+
"login": {
|
|
359
|
+
"type": "boolean",
|
|
360
|
+
"mutable": false,
|
|
361
|
+
"complexType": {
|
|
362
|
+
"original": "boolean",
|
|
363
|
+
"resolved": "boolean",
|
|
364
|
+
"references": {}
|
|
365
|
+
},
|
|
366
|
+
"required": false,
|
|
367
|
+
"optional": false,
|
|
368
|
+
"docs": {
|
|
369
|
+
"tags": [],
|
|
370
|
+
"text": "Toggle the login link (when logged out) or the user widget (when logged in)."
|
|
371
|
+
},
|
|
372
|
+
"attribute": "login",
|
|
373
|
+
"reflect": false,
|
|
374
|
+
"defaultValue": "true"
|
|
375
|
+
},
|
|
376
|
+
"search": {
|
|
377
|
+
"type": "boolean",
|
|
378
|
+
"mutable": false,
|
|
379
|
+
"complexType": {
|
|
380
|
+
"original": "boolean",
|
|
381
|
+
"resolved": "boolean",
|
|
382
|
+
"references": {}
|
|
383
|
+
},
|
|
384
|
+
"required": false,
|
|
385
|
+
"optional": false,
|
|
386
|
+
"docs": {
|
|
387
|
+
"tags": [],
|
|
388
|
+
"text": "Toggle the search button."
|
|
389
|
+
},
|
|
390
|
+
"attribute": "search",
|
|
391
|
+
"reflect": false,
|
|
392
|
+
"defaultValue": "true"
|
|
393
|
+
},
|
|
394
|
+
"skiplinks": {
|
|
395
|
+
"type": "boolean",
|
|
396
|
+
"mutable": false,
|
|
397
|
+
"complexType": {
|
|
398
|
+
"original": "boolean",
|
|
399
|
+
"resolved": "boolean",
|
|
400
|
+
"references": {}
|
|
401
|
+
},
|
|
402
|
+
"required": false,
|
|
403
|
+
"optional": false,
|
|
404
|
+
"docs": {
|
|
405
|
+
"tags": [],
|
|
406
|
+
"text": "Toggle skiplinks. They help keyboard users to quickly jump to important sections of the page."
|
|
407
|
+
},
|
|
408
|
+
"attribute": "skiplinks",
|
|
409
|
+
"reflect": false,
|
|
410
|
+
"defaultValue": "true"
|
|
411
|
+
},
|
|
412
|
+
"configProxy": {
|
|
413
|
+
"type": "string",
|
|
414
|
+
"mutable": false,
|
|
415
|
+
"complexType": {
|
|
416
|
+
"original": "string",
|
|
417
|
+
"resolved": "string | undefined",
|
|
418
|
+
"references": {}
|
|
419
|
+
},
|
|
420
|
+
"required": false,
|
|
421
|
+
"optional": true,
|
|
422
|
+
"docs": {
|
|
423
|
+
"tags": [],
|
|
424
|
+
"text": "DEPRECATED!: Define a proxy URL for the config fetch request. Will be removed in the next major version"
|
|
425
|
+
},
|
|
426
|
+
"attribute": "config-proxy",
|
|
427
|
+
"reflect": false
|
|
428
|
+
},
|
|
429
|
+
"environment": {
|
|
430
|
+
"type": "string",
|
|
431
|
+
"mutable": false,
|
|
432
|
+
"complexType": {
|
|
433
|
+
"original": "Environment",
|
|
434
|
+
"resolved": "\"int01\" | \"int02\" | \"prod\"",
|
|
435
|
+
"references": {
|
|
436
|
+
"Environment": {
|
|
437
|
+
"location": "import",
|
|
438
|
+
"path": "../../models/general.model"
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
"required": false,
|
|
443
|
+
"optional": false,
|
|
444
|
+
"docs": {
|
|
445
|
+
"tags": [],
|
|
446
|
+
"text": "Target environment. Choose 'int01' for local testing."
|
|
447
|
+
},
|
|
448
|
+
"attribute": "environment",
|
|
449
|
+
"reflect": false,
|
|
450
|
+
"defaultValue": "'prod'"
|
|
451
|
+
},
|
|
452
|
+
"languageSwitchOverrides": {
|
|
453
|
+
"type": "string",
|
|
454
|
+
"mutable": false,
|
|
455
|
+
"complexType": {
|
|
456
|
+
"original": "string | IAvailableLanguage[]",
|
|
457
|
+
"resolved": "IAvailableLanguage[] | string | undefined",
|
|
458
|
+
"references": {
|
|
459
|
+
"IAvailableLanguage": {
|
|
460
|
+
"location": "import",
|
|
461
|
+
"path": "../../models/language.model"
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
"required": false,
|
|
466
|
+
"optional": true,
|
|
467
|
+
"docs": {
|
|
468
|
+
"tags": [],
|
|
469
|
+
"text": "Override the language switch links with custom URLs. Helpful when your application contains sub-pages and you\nwould like to stay on subpages when the user changes language."
|
|
470
|
+
},
|
|
471
|
+
"attribute": "language-switch-overrides",
|
|
472
|
+
"reflect": false
|
|
473
|
+
},
|
|
474
|
+
"customConfig": {
|
|
475
|
+
"type": "string",
|
|
476
|
+
"mutable": false,
|
|
477
|
+
"complexType": {
|
|
478
|
+
"original": "string | ICustomConfig",
|
|
479
|
+
"resolved": "ICustomConfig | string | undefined",
|
|
480
|
+
"references": {
|
|
481
|
+
"ICustomConfig": {
|
|
482
|
+
"location": "import",
|
|
483
|
+
"path": "../../models/general.model"
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"required": false,
|
|
488
|
+
"optional": true,
|
|
489
|
+
"docs": {
|
|
490
|
+
"tags": [],
|
|
491
|
+
"text": "Customize the header config loaded from the post portal."
|
|
492
|
+
},
|
|
493
|
+
"attribute": "custom-config",
|
|
494
|
+
"reflect": false
|
|
495
|
+
},
|
|
496
|
+
"languageCookieKey": {
|
|
497
|
+
"type": "string",
|
|
498
|
+
"mutable": false,
|
|
499
|
+
"complexType": {
|
|
500
|
+
"original": "string",
|
|
501
|
+
"resolved": "string | undefined",
|
|
502
|
+
"references": {}
|
|
503
|
+
},
|
|
504
|
+
"required": false,
|
|
505
|
+
"optional": true,
|
|
506
|
+
"docs": {
|
|
507
|
+
"tags": [],
|
|
508
|
+
"text": "The header uses this cookie to set the language. Disables automatic language detection."
|
|
509
|
+
},
|
|
510
|
+
"attribute": "language-cookie-key",
|
|
511
|
+
"reflect": false
|
|
512
|
+
},
|
|
513
|
+
"languageLocalStorageKey": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"mutable": false,
|
|
516
|
+
"complexType": {
|
|
517
|
+
"original": "string",
|
|
518
|
+
"resolved": "string | undefined",
|
|
519
|
+
"references": {}
|
|
520
|
+
},
|
|
521
|
+
"required": false,
|
|
522
|
+
"optional": true,
|
|
523
|
+
"docs": {
|
|
524
|
+
"tags": [],
|
|
525
|
+
"text": "The header uses this local storage key to set the language. Disables automatic language selection."
|
|
526
|
+
},
|
|
527
|
+
"attribute": "language-local-storage-key",
|
|
528
|
+
"reflect": false,
|
|
529
|
+
"defaultValue": "'swisspost-internet-header-language'"
|
|
530
|
+
},
|
|
531
|
+
"activeRoute": {
|
|
532
|
+
"type": "any",
|
|
533
|
+
"mutable": false,
|
|
534
|
+
"complexType": {
|
|
535
|
+
"original": "'auto' | false | string",
|
|
536
|
+
"resolved": "boolean | string | undefined",
|
|
537
|
+
"references": {}
|
|
538
|
+
},
|
|
539
|
+
"required": false,
|
|
540
|
+
"optional": true,
|
|
541
|
+
"docs": {
|
|
542
|
+
"tags": [],
|
|
543
|
+
"text": "Set the currently activated route. If there is a link matching this URL in the header, it will be highlighted.\nWill also highlight partly matching URLs. When set to auto, will use current location.href for comparison."
|
|
544
|
+
},
|
|
545
|
+
"attribute": "active-route",
|
|
546
|
+
"reflect": false,
|
|
547
|
+
"defaultValue": "'auto'"
|
|
548
|
+
},
|
|
549
|
+
"osFlyoutOverrides": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"mutable": false,
|
|
552
|
+
"complexType": {
|
|
553
|
+
"original": "string | NavMainEntity",
|
|
554
|
+
"resolved": "NavMainEntity | string | undefined",
|
|
555
|
+
"references": {
|
|
556
|
+
"NavMainEntity": {
|
|
557
|
+
"location": "import",
|
|
558
|
+
"path": "../../models/header.model"
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
"required": false,
|
|
563
|
+
"optional": true,
|
|
564
|
+
"docs": {
|
|
565
|
+
"tags": [],
|
|
566
|
+
"text": "Online Services only: Add custom links to the special online service navigation entry"
|
|
567
|
+
},
|
|
568
|
+
"attribute": "os-flyout-overrides",
|
|
569
|
+
"reflect": false
|
|
570
|
+
},
|
|
571
|
+
"fullWidth": {
|
|
572
|
+
"type": "boolean",
|
|
573
|
+
"mutable": false,
|
|
574
|
+
"complexType": {
|
|
575
|
+
"original": "boolean",
|
|
576
|
+
"resolved": "boolean | undefined",
|
|
577
|
+
"references": {}
|
|
578
|
+
},
|
|
579
|
+
"required": false,
|
|
580
|
+
"optional": true,
|
|
581
|
+
"docs": {
|
|
582
|
+
"tags": [],
|
|
583
|
+
"text": "Displays the header at full width for full-screen applications"
|
|
584
|
+
},
|
|
585
|
+
"attribute": "full-width",
|
|
586
|
+
"reflect": false,
|
|
587
|
+
"defaultValue": "false"
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
static get states() {
|
|
592
|
+
return {
|
|
593
|
+
"activeFlyout": {},
|
|
594
|
+
"activeDropdownElement": {}
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
static get events() {
|
|
598
|
+
return [{
|
|
599
|
+
"method": "headerLoaded",
|
|
600
|
+
"name": "headerLoaded",
|
|
601
|
+
"bubbles": true,
|
|
602
|
+
"cancelable": true,
|
|
603
|
+
"composed": true,
|
|
604
|
+
"docs": {
|
|
605
|
+
"tags": [],
|
|
606
|
+
"text": "Fires when the header has been rendered to the page."
|
|
607
|
+
},
|
|
608
|
+
"complexType": {
|
|
609
|
+
"original": "void",
|
|
610
|
+
"resolved": "void",
|
|
611
|
+
"references": {}
|
|
612
|
+
}
|
|
613
|
+
}];
|
|
614
|
+
}
|
|
615
|
+
static get methods() {
|
|
616
|
+
return {
|
|
617
|
+
"getCurrentLanguage": {
|
|
618
|
+
"complexType": {
|
|
619
|
+
"signature": "() => Promise<'de' | 'fr' | 'it' | 'en' | string>",
|
|
620
|
+
"parameters": [],
|
|
621
|
+
"references": {
|
|
622
|
+
"Promise": {
|
|
623
|
+
"location": "global"
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
"return": "Promise<string>"
|
|
627
|
+
},
|
|
628
|
+
"docs": {
|
|
629
|
+
"text": "Get the currently set language as a two letter string (\"de\", \"fr\" \"it\" or \"en\")",
|
|
630
|
+
"tags": [{
|
|
631
|
+
"name": "returns",
|
|
632
|
+
"text": "string"
|
|
633
|
+
}]
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
static get elementRef() { return "host"; }
|
|
639
|
+
static get watchers() {
|
|
640
|
+
return [{
|
|
641
|
+
"propName": "language",
|
|
642
|
+
"methodName": "handleLanguageChange"
|
|
643
|
+
}, {
|
|
644
|
+
"propName": "languageSwitchOverrides",
|
|
645
|
+
"methodName": "handleAvailableLanguagesChage"
|
|
646
|
+
}, {
|
|
647
|
+
"propName": "osFlyoutOverrides",
|
|
648
|
+
"methodName": "handleOsFlyoutOverrides"
|
|
649
|
+
}, {
|
|
650
|
+
"propName": "activeRoute",
|
|
651
|
+
"methodName": "handleActiveRouteChange"
|
|
652
|
+
}, {
|
|
653
|
+
"propName": "customConfig",
|
|
654
|
+
"methodName": "handleCustomConfigChange"
|
|
655
|
+
}, {
|
|
656
|
+
"propName": "search",
|
|
657
|
+
"methodName": "handleSearchChange"
|
|
658
|
+
}, {
|
|
659
|
+
"propName": "login",
|
|
660
|
+
"methodName": "handleLoginChange"
|
|
661
|
+
}, {
|
|
662
|
+
"propName": "meta",
|
|
663
|
+
"methodName": "handleMetaChange"
|
|
664
|
+
}];
|
|
665
|
+
}
|
|
666
|
+
static get listeners() {
|
|
667
|
+
return [{
|
|
668
|
+
"name": "languageChanged",
|
|
669
|
+
"method": "handleLanguageChangeEvent",
|
|
670
|
+
"target": undefined,
|
|
671
|
+
"capture": false,
|
|
672
|
+
"passive": false
|
|
673
|
+
}];
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
//# sourceMappingURL=post-internet-header.js.map
|