@swisspost/internet-header 1.5.2 → 1.5.4
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/{index-5751975e.js → index-aff25ac1.js} +8 -1
- package/dist/cjs/index-aff25ac1.js.map +1 -0
- package/dist/cjs/{language.service-41b458b1.js → language.service-167d5a9c.js} +2 -2
- package/dist/cjs/{language.service-41b458b1.js.map → language.service-167d5a9c.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/post-klp-login-widget.cjs.entry.js +4 -4
- package/dist/cjs/post-klp-login-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/post-language-switch.cjs.entry.js +5 -5
- package/dist/cjs/post-logo.cjs.entry.js +2 -2
- package/dist/cjs/post-main-navigation.cjs.entry.js +5 -5
- package/dist/cjs/post-main-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/post-meta-navigation.cjs.entry.js +2 -2
- package/dist/cjs/post-search.cjs.entry.js +24 -2219
- package/dist/cjs/post-search.cjs.entry.js.map +1 -1
- package/dist/cjs/post-skiplinks.cjs.entry.js +4 -4
- package/dist/cjs/{store-d0d514fc.js → store-b0284e36.js} +2 -2
- package/dist/cjs/{store-d0d514fc.js.map → store-b0284e36.js.map} +1 -1
- package/dist/cjs/{svg-icon.component-be93f876.js → svg-icon.component-715db679.js} +2 -2
- package/dist/cjs/{svg-icon.component-be93f876.js.map → svg-icon.component-715db679.js.map} +1 -1
- package/dist/cjs/{svg-sprite.component-1bd7a058.js → svg-sprite.component-22680222.js} +2 -2
- package/dist/cjs/{svg-sprite.component-1bd7a058.js.map → svg-sprite.component-22680222.js.map} +1 -1
- package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js +178 -94
- package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js +4 -4
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +52 -34
- package/dist/cjs/swisspost-internet-header.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.js +2 -2
- package/dist/cjs/swisspost-internet-header.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.css +53 -24
- package/dist/collection/components/post-internet-footer/post-internet-footer.css +37 -16
- package/dist/collection/components/post-internet-header/post-internet-header.js +1 -1
- package/dist/collection/components/post-klp-login-widget/post-klp-login-widget.css +33 -14
- package/dist/collection/components/post-main-navigation/post-main-navigation.js +1 -1
- package/dist/collection/components/post-main-navigation/post-main-navigation.js.map +1 -1
- package/dist/collection/components/post-search/post-search.css +102 -73
- package/dist/collection/models/general.model.js.map +1 -1
- package/dist/collection/services/config.service.js +3 -3
- package/dist/collection/services/config.service.js.map +1 -1
- package/dist/collection/services/search/coveo.settings.js +16 -0
- package/dist/collection/services/search/coveo.settings.js.map +1 -1
- package/dist/collection/services/search/places.service.js +4 -4
- package/dist/collection/services/search/places.service.js.map +1 -1
- package/dist/collection/services/search/search-utilities.js +0 -13
- package/dist/collection/services/search/search-utilities.js.map +1 -1
- package/dist/components/post-klp-login-widget2.js +1 -1
- package/dist/components/post-klp-login-widget2.js.map +1 -1
- package/dist/components/post-main-navigation2.js +1 -1
- package/dist/components/post-main-navigation2.js.map +1 -1
- package/dist/components/post-search2.js +20 -2215
- package/dist/components/post-search2.js.map +1 -1
- package/dist/components/store.js.map +1 -1
- package/dist/components/swisspost-internet-breadcrumbs.js +173 -89
- package/dist/components/swisspost-internet-breadcrumbs.js.map +1 -1
- package/dist/components/swisspost-internet-footer.js +1 -1
- package/dist/components/swisspost-internet-footer.js.map +1 -1
- package/dist/components/swisspost-internet-header.js +47 -29
- package/dist/components/swisspost-internet-header.js.map +1 -1
- package/dist/esm/{index-066666f4.js → index-9351b1b6.js} +8 -1
- package/dist/esm/index-9351b1b6.js.map +1 -0
- package/dist/esm/{language.service-85d8689e.js → language.service-7aefe1c5.js} +2 -2
- package/dist/esm/{language.service-85d8689e.js.map → language.service-7aefe1c5.js.map} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/post-klp-login-widget.entry.js +4 -4
- package/dist/esm/post-klp-login-widget.entry.js.map +1 -1
- package/dist/esm/post-language-switch.entry.js +5 -5
- package/dist/esm/post-logo.entry.js +2 -2
- package/dist/esm/post-main-navigation.entry.js +5 -5
- package/dist/esm/post-main-navigation.entry.js.map +1 -1
- package/dist/esm/post-meta-navigation.entry.js +2 -2
- package/dist/esm/post-search.entry.js +24 -2219
- package/dist/esm/post-search.entry.js.map +1 -1
- package/dist/esm/post-skiplinks.entry.js +4 -4
- package/dist/esm/{store-837c3490.js → store-f9ce3c4f.js} +2 -2
- package/dist/esm/{store-837c3490.js.map → store-f9ce3c4f.js.map} +1 -1
- package/dist/esm/{svg-icon.component-e09b4bf9.js → svg-icon.component-cd0942cc.js} +2 -2
- package/dist/esm/{svg-icon.component-e09b4bf9.js.map → svg-icon.component-cd0942cc.js.map} +1 -1
- package/dist/esm/{svg-sprite.component-cf60303f.js → svg-sprite.component-5ed9c3b8.js} +2 -2
- package/dist/esm/{svg-sprite.component-cf60303f.js.map → svg-sprite.component-5ed9c3b8.js.map} +1 -1
- package/dist/esm/swisspost-internet-breadcrumbs.entry.js +178 -94
- package/dist/esm/swisspost-internet-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-footer.entry.js +4 -4
- package/dist/esm/swisspost-internet-footer.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-header.entry.js +52 -34
- package/dist/esm/swisspost-internet-header.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-header.js +3 -3
- package/dist/esm/swisspost-internet-header.js.map +1 -1
- package/dist/esm-es5/{index-066666f4.js → index-9351b1b6.js} +1 -1
- package/dist/esm-es5/index-9351b1b6.js.map +1 -0
- package/dist/esm-es5/{language.service-85d8689e.js → language.service-7aefe1c5.js} +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- 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-logo.entry.js +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-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/{store-837c3490.js → store-f9ce3c4f.js} +2 -2
- package/dist/esm-es5/{store-837c3490.js.map → store-f9ce3c4f.js.map} +1 -1
- package/dist/esm-es5/{svg-icon.component-e09b4bf9.js → svg-icon.component-cd0942cc.js} +2 -2
- package/dist/esm-es5/{svg-sprite.component-cf60303f.js → svg-sprite.component-5ed9c3b8.js} +2 -2
- package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js +4 -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/swisspost-internet-header.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.js.map +1 -1
- package/dist/swisspost-internet-header/{p-1f13dad6.system.entry.js → p-01b80755.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/{p-7fcba2e7.system.js → p-0342245a.system.js} +2 -2
- package/dist/swisspost-internet-header/{p-7fcba2e7.system.js.map → p-0342245a.system.js.map} +1 -1
- package/dist/swisspost-internet-header/{p-324563ab.system.js → p-0739e499.system.js} +2 -2
- package/dist/swisspost-internet-header/p-2bae3827.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-77d5e07f.entry.js.map → p-2bae3827.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-3563d113.js +2 -0
- package/dist/swisspost-internet-header/p-3b42300f.system.entry.js +2 -0
- package/dist/swisspost-internet-header/p-3b42300f.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-28e6362f.system.entry.js → p-3b6966e6.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-469f6f17.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-64cb215a.entry.js.map → p-469f6f17.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/{p-84d73529.system.entry.js → p-5c0b352c.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-60f3d251.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-e2990968.system.entry.js.map → p-60f3d251.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/{p-5032057e.js → p-61b09b9b.js} +1 -1
- package/dist/swisspost-internet-header/p-61b09b9b.js.map +1 -0
- package/dist/swisspost-internet-header/{p-812b69b4.entry.js → p-633cde46.entry.js} +2 -2
- package/dist/swisspost-internet-header/{p-06649b46.js → p-698793da.js} +2 -2
- package/dist/swisspost-internet-header/{p-06649b46.js.map → p-698793da.js.map} +1 -1
- package/dist/swisspost-internet-header/p-6ecd7c1e.system.entry.js +2 -0
- package/dist/swisspost-internet-header/p-6ecd7c1e.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-6f72a327.entry.js +7 -0
- package/dist/swisspost-internet-header/p-6f72a327.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-7db83602.entry.js +2 -0
- package/dist/swisspost-internet-header/p-7db83602.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-2df9df9c.system.entry.js → p-8927c282.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/{p-ffc59851.system.js → p-89618eab.system.js} +2 -2
- package/dist/swisspost-internet-header/{p-5b22e42c.entry.js → p-91195287.entry.js} +2 -2
- package/dist/swisspost-internet-header/{p-26879023.entry.js → p-99f181e3.entry.js} +2 -2
- package/dist/swisspost-internet-header/p-9a5c147e.system.entry.js +7 -0
- package/dist/swisspost-internet-header/p-9a5c147e.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/{p-f7c0cf7b.js → p-9cf200bd.js} +2 -2
- package/dist/swisspost-internet-header/{p-c565414e.entry.js → p-ab97ab9d.entry.js} +2 -2
- package/dist/swisspost-internet-header/{p-ee119d2e.system.js → p-af58c52f.system.js} +2 -2
- package/dist/swisspost-internet-header/{p-2fd9a085.entry.js → p-b52015b1.entry.js} +2 -2
- package/dist/swisspost-internet-header/{p-2fd9a085.entry.js.map → p-b52015b1.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/{p-17a47667.system.js → p-b9569693.system.js} +2 -2
- package/dist/swisspost-internet-header/{p-17a47667.system.js.map → p-b9569693.system.js.map} +1 -1
- package/dist/swisspost-internet-header/{p-1b8f9bc8.system.js → p-bd9d660b.system.js} +1 -1
- package/dist/swisspost-internet-header/p-bd9d660b.system.js.map +1 -0
- package/dist/swisspost-internet-header/{p-c5f85f6e.system.entry.js → p-c08318d1.system.entry.js} +2 -2
- package/dist/swisspost-internet-header/{p-c5f85f6e.system.entry.js.map → p-c08318d1.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/{p-a6001d1e.js → p-c90a1412.js} +2 -2
- package/dist/swisspost-internet-header/p-d17dc723.entry.js +2 -0
- package/dist/swisspost-internet-header/p-d17dc723.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-d4d917ae.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-66144e99.system.entry.js.map → p-d4d917ae.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.css +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js.map +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.js +1 -1
- package/dist/types/models/general.model.d.ts +1 -1
- package/dist/types/services/search/search-utilities.d.ts +0 -6
- package/package.json +40 -26
- package/dist/cjs/index-5751975e.js.map +0 -1
- package/dist/esm/index-066666f4.js.map +0 -1
- package/dist/esm-es5/index-066666f4.js.map +0 -1
- package/dist/swisspost-internet-header/p-1b8f9bc8.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-33ff32c6.entry.js +0 -2
- package/dist/swisspost-internet-header/p-33ff32c6.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-38f55161.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-38f55161.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-4f39b3a4.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-4f39b3a4.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-5032057e.js.map +0 -1
- package/dist/swisspost-internet-header/p-5adcac2a.entry.js +0 -6
- package/dist/swisspost-internet-header/p-5adcac2a.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-64cb215a.entry.js +0 -2
- package/dist/swisspost-internet-header/p-66144e99.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-733756a9.system.entry.js +0 -7
- package/dist/swisspost-internet-header/p-733756a9.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-77d5e07f.entry.js +0 -2
- package/dist/swisspost-internet-header/p-908c0350.entry.js +0 -2
- package/dist/swisspost-internet-header/p-908c0350.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-ab1dd269.js +0 -2
- package/dist/swisspost-internet-header/p-e2990968.system.entry.js +0 -2
- /package/dist/esm-es5/{language.service-85d8689e.js.map → language.service-7aefe1c5.js.map} +0 -0
- /package/dist/esm-es5/{svg-icon.component-e09b4bf9.js.map → svg-icon.component-cd0942cc.js.map} +0 -0
- /package/dist/esm-es5/{svg-sprite.component-cf60303f.js.map → svg-sprite.component-5ed9c3b8.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-1f13dad6.system.entry.js.map → p-01b80755.system.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-324563ab.system.js.map → p-0739e499.system.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-ab1dd269.js.map → p-3563d113.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-28e6362f.system.entry.js.map → p-3b6966e6.system.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-84d73529.system.entry.js.map → p-5c0b352c.system.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-812b69b4.entry.js.map → p-633cde46.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-2df9df9c.system.entry.js.map → p-8927c282.system.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-ffc59851.system.js.map → p-89618eab.system.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-5b22e42c.entry.js.map → p-91195287.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-26879023.entry.js.map → p-99f181e3.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-f7c0cf7b.js.map → p-9cf200bd.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-c565414e.entry.js.map → p-ab97ab9d.entry.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-ee119d2e.system.js.map → p-af58c52f.system.js.map} +0 -0
- /package/dist/swisspost-internet-header/{p-a6001d1e.js.map → p-c90a1412.js.map} +0 -0
|
@@ -123,7 +123,8 @@
|
|
|
123
123
|
color: #666666;
|
|
124
124
|
opacity: 1;
|
|
125
125
|
}
|
|
126
|
-
.form-control:disabled
|
|
126
|
+
.form-control:disabled {
|
|
127
|
+
color: #666666;
|
|
127
128
|
background-color: rgba(var(--post-contrast-color-inverted-rgb), 0.6);
|
|
128
129
|
border-color: #cccccc;
|
|
129
130
|
opacity: 1;
|
|
@@ -150,28 +151,6 @@
|
|
|
150
151
|
.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
|
|
151
152
|
background-color: #fff;
|
|
152
153
|
}
|
|
153
|
-
.form-control::-webkit-file-upload-button {
|
|
154
|
-
padding: 0.875rem 1.125rem;
|
|
155
|
-
margin: -0.875rem -1.125rem;
|
|
156
|
-
margin-inline-end: 1.125rem;
|
|
157
|
-
color: #000;
|
|
158
|
-
background-color: rgba(var(--post-contrast-color-inverted-rgb), 0.6);
|
|
159
|
-
pointer-events: none;
|
|
160
|
-
border-color: inherit;
|
|
161
|
-
border-style: solid;
|
|
162
|
-
border-width: 0;
|
|
163
|
-
border-inline-end-width: 2px;
|
|
164
|
-
border-radius: 0;
|
|
165
|
-
transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
166
|
-
}
|
|
167
|
-
@media (prefers-reduced-motion: reduce) {
|
|
168
|
-
.form-control::-webkit-file-upload-button {
|
|
169
|
-
transition: none;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
.form-control:hover:not(:disabled):not([readonly])::-webkit-file-upload-button {
|
|
173
|
-
background-color: #fff;
|
|
174
|
-
}
|
|
175
154
|
|
|
176
155
|
.form-control-plaintext {
|
|
177
156
|
display: block;
|
|
@@ -184,6 +163,9 @@
|
|
|
184
163
|
border: solid transparent;
|
|
185
164
|
border-width: 2px 0;
|
|
186
165
|
}
|
|
166
|
+
.form-control-plaintext:focus {
|
|
167
|
+
outline: 0;
|
|
168
|
+
}
|
|
187
169
|
.form-control-plaintext.form-control-sm, .form-control-plaintext.form-control-lg, .form-floating > .form-control-plaintext.form-control, .form-floating > .form-control-plaintext.form-select {
|
|
188
170
|
padding-right: 0;
|
|
189
171
|
padding-left: 0;
|
|
@@ -200,11 +182,6 @@
|
|
|
200
182
|
margin: -0.375rem -0.875rem;
|
|
201
183
|
margin-inline-end: 0.875rem;
|
|
202
184
|
}
|
|
203
|
-
.form-control-sm::-webkit-file-upload-button {
|
|
204
|
-
padding: 0.375rem 0.875rem;
|
|
205
|
-
margin: -0.375rem -0.875rem;
|
|
206
|
-
margin-inline-end: 0.875rem;
|
|
207
|
-
}
|
|
208
185
|
|
|
209
186
|
.form-control-lg, .form-floating > .form-control, .form-floating > .form-select {
|
|
210
187
|
min-height: calc(4.25rem + 4px);
|
|
@@ -217,11 +194,6 @@
|
|
|
217
194
|
margin: -1.25rem -1.375rem;
|
|
218
195
|
margin-inline-end: 1.375rem;
|
|
219
196
|
}
|
|
220
|
-
.form-control-lg::-webkit-file-upload-button, .form-floating > .form-control::-webkit-file-upload-button, .form-floating > .form-select::-webkit-file-upload-button {
|
|
221
|
-
padding: 1.25rem 1.375rem;
|
|
222
|
-
margin: -1.25rem -1.375rem;
|
|
223
|
-
margin-inline-end: 1.375rem;
|
|
224
|
-
}
|
|
225
197
|
|
|
226
198
|
textarea.form-control {
|
|
227
199
|
min-height: calc(3.15rem + 4px);
|
|
@@ -235,20 +207,25 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
235
207
|
|
|
236
208
|
.form-control-color {
|
|
237
209
|
width: 3rem;
|
|
238
|
-
height:
|
|
210
|
+
height: calc(3.15rem + 4px);
|
|
239
211
|
padding: 0.875rem;
|
|
240
212
|
}
|
|
241
213
|
.form-control-color:not(:disabled):not([readonly]) {
|
|
242
214
|
cursor: pointer;
|
|
243
215
|
}
|
|
244
216
|
.form-control-color::-moz-color-swatch {
|
|
245
|
-
|
|
217
|
+
border: 0 !important;
|
|
246
218
|
border-radius: 0;
|
|
247
219
|
}
|
|
248
220
|
.form-control-color::-webkit-color-swatch {
|
|
249
|
-
height: 1.4em;
|
|
250
221
|
border-radius: 0;
|
|
251
222
|
}
|
|
223
|
+
.form-control-color.form-control-sm {
|
|
224
|
+
height: calc(1.8875rem + 4px);
|
|
225
|
+
}
|
|
226
|
+
.form-control-color.form-control-lg, .form-floating > .form-control-color.form-control, .form-floating > .form-control-color.form-select {
|
|
227
|
+
height: calc(4.25rem + 4px);
|
|
228
|
+
}
|
|
252
229
|
|
|
253
230
|
.form-select {
|
|
254
231
|
display: block;
|
|
@@ -320,6 +297,17 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
320
297
|
margin-left: 0;
|
|
321
298
|
}
|
|
322
299
|
|
|
300
|
+
.form-check-reverse {
|
|
301
|
+
padding-right: 0;
|
|
302
|
+
padding-left: 0;
|
|
303
|
+
text-align: right;
|
|
304
|
+
}
|
|
305
|
+
.form-check-reverse .form-check-input {
|
|
306
|
+
float: right;
|
|
307
|
+
margin-right: 0;
|
|
308
|
+
margin-left: 0;
|
|
309
|
+
}
|
|
310
|
+
|
|
323
311
|
.form-check-input {
|
|
324
312
|
width: 1.5rem;
|
|
325
313
|
height: 1.5rem;
|
|
@@ -331,7 +319,7 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
331
319
|
background-size: contain;
|
|
332
320
|
border: 2px solid #666666;
|
|
333
321
|
appearance: none;
|
|
334
|
-
color-adjust: exact;
|
|
322
|
+
print-color-adjust: exact;
|
|
335
323
|
}
|
|
336
324
|
.form-check-input[type=checkbox] {
|
|
337
325
|
border-radius: 0;
|
|
@@ -368,6 +356,7 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
368
356
|
opacity: 0.5;
|
|
369
357
|
}
|
|
370
358
|
.form-check-input[disabled] ~ .form-check-label, .form-check-input:disabled ~ .form-check-label {
|
|
359
|
+
cursor: default;
|
|
371
360
|
opacity: 0.5;
|
|
372
361
|
}
|
|
373
362
|
|
|
@@ -399,6 +388,14 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
399
388
|
background-position: right center;
|
|
400
389
|
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-16 -16 32 32'%3e%3ccircle r='15' stroke='%23000' stroke-width='2' fill='%23fff'/%3e%3c/svg%3e");
|
|
401
390
|
}
|
|
391
|
+
.form-switch.form-check-reverse {
|
|
392
|
+
padding-right: 0;
|
|
393
|
+
padding-left: 0;
|
|
394
|
+
}
|
|
395
|
+
.form-switch.form-check-reverse .form-check-input {
|
|
396
|
+
margin-right: 0;
|
|
397
|
+
margin-left: 0;
|
|
398
|
+
}
|
|
402
399
|
|
|
403
400
|
.form-check-inline {
|
|
404
401
|
display: inline-block;
|
|
@@ -502,6 +499,7 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
502
499
|
position: relative;
|
|
503
500
|
}
|
|
504
501
|
.form-floating > .form-control,
|
|
502
|
+
.form-floating > .form-control-plaintext,
|
|
505
503
|
.form-floating > .form-select {
|
|
506
504
|
height: calc(4.25rem + 4px);
|
|
507
505
|
line-height: 1.4;
|
|
@@ -510,8 +508,13 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
510
508
|
position: absolute;
|
|
511
509
|
top: 0;
|
|
512
510
|
left: 0;
|
|
511
|
+
width: 100%;
|
|
513
512
|
height: 100%;
|
|
514
513
|
padding: 1.25rem 1.375rem;
|
|
514
|
+
overflow: hidden;
|
|
515
|
+
text-align: start;
|
|
516
|
+
text-overflow: ellipsis;
|
|
517
|
+
white-space: nowrap;
|
|
515
518
|
pointer-events: none;
|
|
516
519
|
border: 2px solid transparent;
|
|
517
520
|
transform-origin: 0 0;
|
|
@@ -522,17 +525,22 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
522
525
|
transition: none;
|
|
523
526
|
}
|
|
524
527
|
}
|
|
525
|
-
.form-floating > .form-control
|
|
528
|
+
.form-floating > .form-control,
|
|
529
|
+
.form-floating > .form-control-plaintext {
|
|
526
530
|
padding: 1.25rem 1.375rem;
|
|
527
531
|
}
|
|
528
|
-
.form-floating > .form-control::placeholder
|
|
532
|
+
.form-floating > .form-control::placeholder,
|
|
533
|
+
.form-floating > .form-control-plaintext::placeholder {
|
|
529
534
|
color: transparent;
|
|
530
535
|
}
|
|
531
|
-
.form-floating > .form-control:focus, .form-floating > .form-control:not(:placeholder-shown)
|
|
536
|
+
.form-floating > .form-control:focus, .form-floating > .form-control:not(:placeholder-shown),
|
|
537
|
+
.form-floating > .form-control-plaintext:focus,
|
|
538
|
+
.form-floating > .form-control-plaintext:not(:placeholder-shown) {
|
|
532
539
|
padding-top: 1.5rem;
|
|
533
540
|
padding-bottom: 0;
|
|
534
541
|
}
|
|
535
|
-
.form-floating > .form-control:-webkit-autofill
|
|
542
|
+
.form-floating > .form-control:-webkit-autofill,
|
|
543
|
+
.form-floating > .form-control-plaintext:-webkit-autofill {
|
|
536
544
|
padding-top: 1.5rem;
|
|
537
545
|
padding-bottom: 0;
|
|
538
546
|
}
|
|
@@ -542,6 +550,7 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
542
550
|
}
|
|
543
551
|
.form-floating > .form-control:focus ~ label,
|
|
544
552
|
.form-floating > .form-control:not(:placeholder-shown) ~ label,
|
|
553
|
+
.form-floating > .form-control-plaintext ~ label,
|
|
545
554
|
.form-floating > .form-select ~ label {
|
|
546
555
|
opacity: 1;
|
|
547
556
|
transform: scale(0.7647058824);
|
|
@@ -550,6 +559,9 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
550
559
|
opacity: 1;
|
|
551
560
|
transform: scale(0.7647058824);
|
|
552
561
|
}
|
|
562
|
+
.form-floating > .form-control-plaintext ~ label {
|
|
563
|
+
border-width: 2px 0;
|
|
564
|
+
}
|
|
553
565
|
|
|
554
566
|
.input-group {
|
|
555
567
|
position: relative;
|
|
@@ -559,22 +571,24 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
559
571
|
width: 100%;
|
|
560
572
|
}
|
|
561
573
|
.input-group > .form-control,
|
|
562
|
-
.input-group > .form-select
|
|
574
|
+
.input-group > .form-select,
|
|
575
|
+
.input-group > .form-floating {
|
|
563
576
|
position: relative;
|
|
564
577
|
flex: 1 1 auto;
|
|
565
578
|
width: 1%;
|
|
566
579
|
min-width: 0;
|
|
567
580
|
}
|
|
568
581
|
.input-group > .form-control:focus,
|
|
569
|
-
.input-group > .form-select:focus
|
|
570
|
-
|
|
582
|
+
.input-group > .form-select:focus,
|
|
583
|
+
.input-group > .form-floating:focus-within {
|
|
584
|
+
z-index: 5;
|
|
571
585
|
}
|
|
572
586
|
.input-group .btn {
|
|
573
587
|
position: relative;
|
|
574
588
|
z-index: 2;
|
|
575
589
|
}
|
|
576
590
|
.input-group .btn:focus {
|
|
577
|
-
z-index:
|
|
591
|
+
z-index: 5;
|
|
578
592
|
}
|
|
579
593
|
|
|
580
594
|
.input-group-text {
|
|
@@ -615,13 +629,17 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
615
629
|
padding-right: 4.5rem;
|
|
616
630
|
}
|
|
617
631
|
|
|
618
|
-
.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu),
|
|
619
|
-
.input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n+3)
|
|
632
|
+
.input-group:not(.has-validation) > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),
|
|
633
|
+
.input-group:not(.has-validation) > .dropdown-toggle:nth-last-child(n+3),
|
|
634
|
+
.input-group:not(.has-validation) > .form-floating:not(:last-child) > .form-control,
|
|
635
|
+
.input-group:not(.has-validation) > .form-floating:not(:last-child) > .form-select {
|
|
620
636
|
border-top-right-radius: 0;
|
|
621
637
|
border-bottom-right-radius: 0;
|
|
622
638
|
}
|
|
623
|
-
.input-group.has-validation > :nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu),
|
|
624
|
-
.input-group.has-validation > .dropdown-toggle:nth-last-child(n+4)
|
|
639
|
+
.input-group.has-validation > :nth-last-child(n+3):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating),
|
|
640
|
+
.input-group.has-validation > .dropdown-toggle:nth-last-child(n+4),
|
|
641
|
+
.input-group.has-validation > .form-floating:nth-last-child(n+3) > .form-control,
|
|
642
|
+
.input-group.has-validation > .form-floating:nth-last-child(n+3) > .form-select {
|
|
625
643
|
border-top-right-radius: 0;
|
|
626
644
|
border-bottom-right-radius: 0;
|
|
627
645
|
}
|
|
@@ -630,6 +648,11 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
630
648
|
border-top-left-radius: 0;
|
|
631
649
|
border-bottom-left-radius: 0;
|
|
632
650
|
}
|
|
651
|
+
.input-group > .form-floating:not(:first-child) > .form-control,
|
|
652
|
+
.input-group > .form-floating:not(:first-child) > .form-select {
|
|
653
|
+
border-top-left-radius: 0;
|
|
654
|
+
border-bottom-left-radius: 0;
|
|
655
|
+
}
|
|
633
656
|
|
|
634
657
|
.valid-feedback {
|
|
635
658
|
display: none;
|
|
@@ -692,6 +715,10 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
692
715
|
box-shadow: 0 0 0 0.125rem rgba(102, 102, 102, 0.25);
|
|
693
716
|
}
|
|
694
717
|
|
|
718
|
+
.was-validated .form-control-color:valid, .form-control-color.is-valid {
|
|
719
|
+
width: 6.15rem;
|
|
720
|
+
}
|
|
721
|
+
|
|
695
722
|
.was-validated .form-check-input:valid, .form-check-input.is-valid {
|
|
696
723
|
border-color: #666666;
|
|
697
724
|
}
|
|
@@ -709,14 +736,11 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
709
736
|
margin-left: 0.5em;
|
|
710
737
|
}
|
|
711
738
|
|
|
712
|
-
.was-validated .input-group .form-control:valid, .input-group .form-control.is-valid,
|
|
713
|
-
.was-validated .input-group .form-select:valid,
|
|
714
|
-
.input-group .form-select.is-valid
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
.was-validated .input-group .form-control:valid:focus, .input-group .form-control.is-valid:focus,
|
|
718
|
-
.was-validated .input-group .form-select:valid:focus,
|
|
719
|
-
.input-group .form-select.is-valid:focus {
|
|
739
|
+
.was-validated .input-group > .form-control:not(:focus):valid, .input-group > .form-control:not(:focus).is-valid,
|
|
740
|
+
.was-validated .input-group > .form-select:not(:focus):valid,
|
|
741
|
+
.input-group > .form-select:not(:focus).is-valid,
|
|
742
|
+
.was-validated .input-group > .form-floating:not(:focus-within):valid,
|
|
743
|
+
.input-group > .form-floating:not(:focus-within).is-valid {
|
|
720
744
|
z-index: 3;
|
|
721
745
|
}
|
|
722
746
|
|
|
@@ -781,6 +805,10 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
781
805
|
box-shadow: 0 0 0 0.125rem rgba(165, 23, 40, 0.25);
|
|
782
806
|
}
|
|
783
807
|
|
|
808
|
+
.was-validated .form-control-color:invalid, .form-control-color.is-invalid {
|
|
809
|
+
width: 6.15rem;
|
|
810
|
+
}
|
|
811
|
+
|
|
784
812
|
.was-validated .form-check-input:invalid, .form-check-input.is-invalid {
|
|
785
813
|
border-color: #a51728;
|
|
786
814
|
}
|
|
@@ -798,15 +826,12 @@ textarea.form-control-lg, .form-floating > textarea.form-control, .form-floating
|
|
|
798
826
|
margin-left: 0.5em;
|
|
799
827
|
}
|
|
800
828
|
|
|
801
|
-
.was-validated .input-group .form-control:invalid, .input-group .form-control.is-invalid,
|
|
802
|
-
.was-validated .input-group .form-select:invalid,
|
|
803
|
-
.input-group .form-select.is-invalid
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
.was-validated .input-group .form-select:invalid:focus,
|
|
808
|
-
.input-group .form-select.is-invalid:focus {
|
|
809
|
-
z-index: 3;
|
|
829
|
+
.was-validated .input-group > .form-control:not(:focus):invalid, .input-group > .form-control:not(:focus).is-invalid,
|
|
830
|
+
.was-validated .input-group > .form-select:not(:focus):invalid,
|
|
831
|
+
.input-group > .form-select:not(:focus).is-invalid,
|
|
832
|
+
.was-validated .input-group > .form-floating:not(:focus-within):invalid,
|
|
833
|
+
.input-group > .form-floating:not(:focus-within).is-invalid {
|
|
834
|
+
z-index: 4;
|
|
810
835
|
}
|
|
811
836
|
|
|
812
837
|
.form-control-rg {
|
|
@@ -884,12 +909,14 @@ select.form-control-rg:not([size]):not([multiple]) {
|
|
|
884
909
|
}
|
|
885
910
|
|
|
886
911
|
.form-floating > label {
|
|
887
|
-
display:
|
|
888
|
-
align-items: center;
|
|
912
|
+
display: block;
|
|
889
913
|
top: 2px;
|
|
890
914
|
left: 2px;
|
|
891
915
|
margin: 0;
|
|
892
|
-
padding: 1.
|
|
916
|
+
padding-inline: 1.375rem;
|
|
917
|
+
padding-block: calc(
|
|
918
|
+
2px + 2.125rem - 0.74375rem
|
|
919
|
+
);
|
|
893
920
|
height: 4.25rem;
|
|
894
921
|
border: 0;
|
|
895
922
|
color: #666666;
|
|
@@ -915,7 +942,7 @@ select.form-control-rg:not([size]):not([multiple]) {
|
|
|
915
942
|
padding-top: 1.7rem;
|
|
916
943
|
}
|
|
917
944
|
.form-floating > .form-control:focus ~ label, .form-floating > .form-control:not(:placeholder-shown) ~ label {
|
|
918
|
-
padding-top: 0;
|
|
945
|
+
padding-top: 0.7rem;
|
|
919
946
|
max-width: calc(130.7692307692% - 0.8461538462rem - 5.2307692308px);
|
|
920
947
|
transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1), width 0ms 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
921
948
|
}
|
|
@@ -925,7 +952,7 @@ select.form-control-rg:not([size]):not([multiple]) {
|
|
|
925
952
|
padding-bottom: 0;
|
|
926
953
|
}
|
|
927
954
|
.form-floating > .form-select ~ label {
|
|
928
|
-
padding-top: 0;
|
|
955
|
+
padding-top: 0.7rem;
|
|
929
956
|
max-width: calc(130.7692307692% - 0.8461538462rem - 5.2307692308px);
|
|
930
957
|
transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1), width 0ms 250ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
931
958
|
}
|
|
@@ -2509,9 +2536,11 @@ select.form-control-rg:not([size]):not([multiple]) {
|
|
|
2509
2536
|
.container,
|
|
2510
2537
|
.container-fluid,
|
|
2511
2538
|
.container-xs {
|
|
2539
|
+
--bs-gutter-x: 30px;
|
|
2540
|
+
--bs-gutter-y: 0;
|
|
2512
2541
|
width: 100%;
|
|
2513
|
-
padding-right: var(--bs-gutter-x
|
|
2514
|
-
padding-left: var(--bs-gutter-x
|
|
2542
|
+
padding-right: calc(var(--bs-gutter-x) * 0.5);
|
|
2543
|
+
padding-left: calc(var(--bs-gutter-x) * 0.5);
|
|
2515
2544
|
margin-right: auto;
|
|
2516
2545
|
margin-left: auto;
|
|
2517
2546
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.model.js","sourceRoot":"","sources":["../../../src/models/general.model.ts"],"names":[],"mappings":"","sourcesContent":["import { IHeaderConfig, ICustomHeaderConfig, NavMainEntity } from './header.model';\nimport { IBreadcrumbConfig } from './breadcrumbs.model';\nimport { IFooterConfig, ICustomFooterConfig } from './footer.model';\n\ndeclare global {\n interface Window {\n OPPklpWidget: any;\n klpWidgetDev: any;\n jQuery: any;\n $: any;\n SockJS: any;\n }\n}\nexport interface IPortalConfig {\n de?: ILocalizedConfig;\n fr?: ILocalizedConfig;\n it?: ILocalizedConfig;\n en?: ILocalizedConfig;\n}\n\nexport interface ILocalizedConfig {\n header: IHeaderConfig;\n breadcrumb: IBreadcrumbConfig;\n footer?: IFooterConfig;\n}\n\nexport interface ICustomConfig {\n de?: ILocalizedCustomConfig;\n fr?: ILocalizedCustomConfig;\n it?: ILocalizedCustomConfig;\n en?: ILocalizedCustomConfig;\n}\n\nexport interface ILocalizedCustomConfig {\n header?: ICustomHeaderConfig;\n footer?: ICustomFooterConfig;\n}\n\nexport type Environment = 'int01' | 'int02' | 'prod';\n\nexport type ActiveRouteProp = 'auto' | 'exact' | false | string;\n\nexport type LocalizedConfigParameters = {\n projectId: string;\n environment: Environment;\n language?: string;\n mapMyPost?: boolean;\n cookieKey?: string;\n localStorageKey?: string;\n activeRouteProp?: ActiveRouteProp;\n localizedCustomConfig?: ILocalizedCustomConfig;\n osFlyoutOverrides?: NavMainEntity;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"general.model.js","sourceRoot":"","sources":["../../../src/models/general.model.ts"],"names":[],"mappings":"","sourcesContent":["import { IHeaderConfig, ICustomHeaderConfig, NavMainEntity } from './header.model';\nimport { IBreadcrumbConfig } from './breadcrumbs.model';\nimport { IFooterConfig, ICustomFooterConfig } from './footer.model';\n\ndeclare global {\n interface Window {\n OPPklpWidget: any;\n klpWidgetDev: any;\n jQuery: any;\n $: any;\n SockJS: any;\n }\n}\nexport interface IPortalConfig {\n de?: ILocalizedConfig;\n fr?: ILocalizedConfig;\n it?: ILocalizedConfig;\n en?: ILocalizedConfig;\n}\n\nexport interface ILocalizedConfig {\n header: IHeaderConfig;\n breadcrumb: IBreadcrumbConfig;\n footer?: IFooterConfig;\n}\n\nexport interface ICustomConfig {\n de?: ILocalizedCustomConfig;\n fr?: ILocalizedCustomConfig;\n it?: ILocalizedCustomConfig;\n en?: ILocalizedCustomConfig;\n}\n\nexport interface ILocalizedCustomConfig {\n header?: ICustomHeaderConfig;\n footer?: ICustomFooterConfig;\n}\n\nexport type Environment = 'dev01' | 'dev02' | 'devs1' | 'test' | 'int01' | 'int02' | 'prod';\n\nexport type ActiveRouteProp = 'auto' | 'exact' | false | string;\n\nexport type LocalizedConfigParameters = {\n projectId: string;\n environment: Environment;\n language?: string;\n mapMyPost?: boolean;\n cookieKey?: string;\n localStorageKey?: string;\n activeRouteProp?: ActiveRouteProp;\n localizedCustomConfig?: ILocalizedCustomConfig;\n osFlyoutOverrides?: NavMainEntity;\n};\n"]}
|
|
@@ -115,11 +115,11 @@ export const generateConfigUrl = (projectId, environment) => {
|
|
|
115
115
|
if (projectId === 'test')
|
|
116
116
|
return 'assets/config/test-configuration.json';
|
|
117
117
|
const parsedEnvironment = environment.toLowerCase();
|
|
118
|
-
const
|
|
119
|
-
const host = `https://${
|
|
118
|
+
const isProd = parsedEnvironment === 'prod';
|
|
119
|
+
const host = `https://${isProd ? 'www' : 'int'}.post.ch`;
|
|
120
120
|
try {
|
|
121
121
|
// Use URL to validate the generated URL
|
|
122
|
-
return new URL(`${host}/api/headerjs/Json?serviceid=${encodeURIComponent(projectId)}${
|
|
122
|
+
return new URL(`${host}/api/headerjs/Json?serviceid=${encodeURIComponent(projectId)}${!isProd ? '&environment=' + parsedEnvironment : ''}`).toString();
|
|
123
123
|
}
|
|
124
124
|
catch (error) {
|
|
125
125
|
throw new Error(`Internet Header: Config URL is invalid.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.service.js","sourceRoot":"","sources":["../../../src/services/config.service.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,0BAA0B;AAC1B,IAAI,OAAO,GAAkC,IAAI,CAAC;AAElD,qDAAqD;AACrD,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACvC,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,iBAAiB,GACS,EAA6B,EAAE;;EACzD,IAAI,CAAC,OAAO,EAAE;IACZ,OAAO,GAAG,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;GAC/C;EAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;EAC7B,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;EAEpF,IAAI,IAAI,KAAK,SAAS,EAAE;IACtB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;GAC1E;EAED,kDAAkD;EAClD,IAAI,eAAe,qBAA0B,MAAM,CAAC,IAAI,CAAC,CAAE,CA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a,CAAC,EAAE,KAAK,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;EACjG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import {\n Environment,\n IPortalConfig,\n ILocalizedConfig,\n ICustomConfig,\n ILocalizedCustomConfig,\n LocalizedConfigParameters,\n} from '../models/general.model';\nimport { NavMainEntity } from '../models/header.model';\nimport { getUserLang, persistLanguageChoice } from './language.service';\nimport { uniqueId } from '../utils/utils';\nimport { markActiveRoute } from './route.service';\n\n// Prevent double requests\nlet request: Promise<IPortalConfig> | null = null;\n\n// Cache the original os flyout to use it for updates\nlet osFlyoutCache: NavMainEntity | null = null;\n\n/**\n * Get a localized config object\n *\n * @param projectId String identifying the project\n * @param language [optional] Preferred language\n * @returns Localized config object\n */\nexport const getLocalizedConfig = async ({\n projectId,\n environment,\n language,\n cookieKey,\n localStorageKey,\n activeRouteProp,\n localizedCustomConfig,\n osFlyoutOverrides,\n}: LocalizedConfigParameters): Promise<ILocalizedConfig> => {\n if (!request) {\n request = fetchConfig(projectId, environment);\n }\n\n const config = await request;\n const lang = getUserLang(Object.keys(config), language, localStorageKey, cookieKey);\n\n if (lang === undefined) {\n throw new Error('Internet Header: unable to determine current language');\n }\n\n // Clone config for more predictable state updates\n let localizedConfig: ILocalizedConfig = { ...config[lang] };\n\n // Merge custom config with portal config\n if (localizedCustomConfig) {\n const header = localizedCustomConfig?.header?.navMain\n ? {\n ...localizedConfig.header,\n navMain: [...localizedConfig.header.navMain, ...localizedCustomConfig.header.navMain],\n }\n : localizedConfig.header;\n localizedConfig = {\n ...localizedConfig,\n header,\n };\n }\n\n // Add entries to flyout_os\n if (osFlyoutOverrides)\n localizedConfig.header.navMain = mergeOsFlyoutOverrides(localizedConfig, osFlyoutOverrides);\n\n // Mark active route\n if (activeRouteProp)\n localizedConfig.header.navMain = markActiveRoute(\n localizedConfig.header.navMain,\n activeRouteProp,\n );\n\n setMainNavigationIds(localizedConfig?.header?.navMain);\n\n // Set the new language choice\n persistLanguageChoice(lang, cookieKey, localStorageKey);\n\n return localizedConfig;\n};\n\n/**\n * Merge portal config with custom os flyout overrides\n * @param config Localized config\n * @param osFlyoutOverrides Overrides for the flyout\n * @returns Merged localized config\n */\nexport const mergeOsFlyoutOverrides = (\n config: ILocalizedConfig,\n osFlyoutOverrides: NavMainEntity,\n): NavMainEntity[] => {\n if (!osFlyoutOverrides) return config.header.navMain;\n\n return config.header.navMain.map(mainNav => {\n if (mainNav.id !== 'flyout_os') return mainNav;\n\n if (osFlyoutCache === null) {\n osFlyoutCache = JSON.parse(JSON.stringify(mainNav)) as NavMainEntity;\n }\n\n const mainNavText = osFlyoutOverrides.text ?? osFlyoutCache.text;\n const mainNavTitle = osFlyoutOverrides.title ?? osFlyoutCache.title;\n\n if (\n !osFlyoutCache.flyout ||\n osFlyoutCache.flyout.length === 0 ||\n !osFlyoutOverrides.flyout ||\n osFlyoutOverrides.flyout.length === 0\n )\n return {\n ...mainNav,\n title: mainNavTitle,\n text: mainNavText,\n };\n\n // Add entries for os flyout columns without overriding existing config\n const mainNavFlyout = [\n ...osFlyoutCache.flyout.map((col, index) => {\n const overrides = osFlyoutOverrides.flyout[index];\n const title = overrides.title ?? col.title;\n\n const linkList = overrides.linkList ? osFlyoutOverrides.flyout[index].linkList : [];\n\n return {\n title,\n linkList: [...col.linkList, ...linkList],\n };\n }),\n ...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),\n ];\n\n return {\n ...mainNav,\n text: mainNavText,\n title: mainNavTitle,\n flyout: mainNavFlyout,\n } as NavMainEntity;\n });\n};\n\n/**\n * Fetch the general config based on project id\n *\n * @returns Promise for Post Portal general config\n */\nexport const fetchConfig = async (\n projectId: string,\n environment: Environment,\n): Promise<IPortalConfig> => {\n // Check if project id is sanitized\n if (!isValidProjectId(projectId)) {\n throw new Error(`Internet Header: invalid project id \"${projectId}\"`);\n }\n\n if (projectId === 'test') {\n environment = 'int01';\n }\n\n let url = generateConfigUrl(projectId, environment);\n\n // Get the config if cache is invalid\n try {\n const res = await fetch(url);\n return (await res.json()) as IPortalConfig;\n } catch (error) {\n throw new Error(`Internet Header: fetching config failed. ${error.message}`);\n }\n};\n\n/**\n * Generate an URL with all necessary query params to get the configuration.\n * Project id \"test\" will return a test configuration\n * @param projectId string\n * @param environment int01, int02 or prod\n * @returns URL pointing to the project config\n */\nexport const generateConfigUrl = (projectId: string, environment: Environment): string => {\n if (projectId === 'test') return 'assets/config/test-configuration.json';\n\n const parsedEnvironment = environment.toLowerCase();\n const isInt = parsedEnvironment.startsWith('int');\n const host = `https://${isInt ? 'int' : 'www'}.post.ch`;\n try {\n // Use URL to validate the generated URL\n return new URL(\n `${host}/api/headerjs/Json?serviceid=${encodeURIComponent(projectId)}${\n isInt ? '&environment=' + parsedEnvironment : ''\n }`,\n ).toString();\n } catch (error) {\n throw new Error(`Internet Header: Config URL is invalid.`);\n }\n};\n\n/**\n * Check if project id contains only URL safe characters\n *\n * @param projectId Project Id string\n * @returns The valid project id\n */\nexport const isValidProjectId = (projectId: string): boolean => {\n return projectId !== '' && projectId.length > 0 && /^[a-zA-Z][\\w-]*[a-zA-Z0-9]$/.test(projectId);\n};\n\n/**\n * Get the localized config object from a custom config\n *\n * @param config String or json object of the custom config\n * @param language Specific language\n * @returns Localized custom config object\n */\nexport const getLocalizedCustomConfig = (\n config: string | ICustomConfig,\n language: string,\n): ILocalizedCustomConfig | undefined => {\n let customConfig: ICustomConfig;\n try {\n customConfig = typeof config === 'string' ? JSON.parse(config) : config;\n } catch (error) {\n throw new Error(\n `Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. `,\n );\n }\n let localizedCustomConfig: ILocalizedCustomConfig | undefined = customConfig[language];\n if (localizedCustomConfig?.header?.navMain)\n setMainNavigationIds(localizedCustomConfig.header.navMain);\n return localizedCustomConfig;\n};\n\n/**\n * Check if mobile header styles are applied or not\n * @returns True if browser is smaller than 1024px\n */\nexport const isMobile = () => window.innerWidth < 1024;\n\n/**\n * Set unique ID's on main navigation entities but conserve flyout_os to be able to\n * identify the online-service flyout, which can be configured by osFlyoutOverrides\n */\nexport const setMainNavigationIds = (navMainEntities: NavMainEntity[]): void => {\n navMainEntities.forEach(navMainEntity => {\n navMainEntity.id = navMainEntity.id === 'flyout_os' ? navMainEntity.id : uniqueId('main-nav-');\n });\n};\n"]}
|
|
1
|
+
{"version":3,"file":"config.service.js","sourceRoot":"","sources":["../../../src/services/config.service.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,0BAA0B;AAC1B,IAAI,OAAO,GAAkC,IAAI,CAAC;AAElD,qDAAqD;AACrD,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACvC,SAAS,EACT,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,iBAAiB,GACS,EAA6B,EAAE;;EACzD,IAAI,CAAC,OAAO,EAAE;IACZ,OAAO,GAAG,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;GAC/C;EAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;EAC7B,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;EAEpF,IAAI,IAAI,KAAK,SAAS,EAAE;IACtB,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;GAC1E;EAED,kDAAkD;EAClD,IAAI,eAAe,qBAA0B,MAAM,CAAC,IAAI,CAAC,CAAE,CA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AE,KAAK,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;EACjG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import {\n Environment,\n IPortalConfig,\n ILocalizedConfig,\n ICustomConfig,\n ILocalizedCustomConfig,\n LocalizedConfigParameters,\n} from '../models/general.model';\nimport { NavMainEntity } from '../models/header.model';\nimport { getUserLang, persistLanguageChoice } from './language.service';\nimport { uniqueId } from '../utils/utils';\nimport { markActiveRoute } from './route.service';\n\n// Prevent double requests\nlet request: Promise<IPortalConfig> | null = null;\n\n// Cache the original os flyout to use it for updates\nlet osFlyoutCache: NavMainEntity | null = null;\n\n/**\n * Get a localized config object\n *\n * @param projectId String identifying the project\n * @param language [optional] Preferred language\n * @returns Localized config object\n */\nexport const getLocalizedConfig = async ({\n projectId,\n environment,\n language,\n cookieKey,\n localStorageKey,\n activeRouteProp,\n localizedCustomConfig,\n osFlyoutOverrides,\n}: LocalizedConfigParameters): Promise<ILocalizedConfig> => {\n if (!request) {\n request = fetchConfig(projectId, environment);\n }\n\n const config = await request;\n const lang = getUserLang(Object.keys(config), language, localStorageKey, cookieKey);\n\n if (lang === undefined) {\n throw new Error('Internet Header: unable to determine current language');\n }\n\n // Clone config for more predictable state updates\n let localizedConfig: ILocalizedConfig = { ...config[lang] };\n\n // Merge custom config with portal config\n if (localizedCustomConfig) {\n const header = localizedCustomConfig?.header?.navMain\n ? {\n ...localizedConfig.header,\n navMain: [...localizedConfig.header.navMain, ...localizedCustomConfig.header.navMain],\n }\n : localizedConfig.header;\n localizedConfig = {\n ...localizedConfig,\n header,\n };\n }\n\n // Add entries to flyout_os\n if (osFlyoutOverrides)\n localizedConfig.header.navMain = mergeOsFlyoutOverrides(localizedConfig, osFlyoutOverrides);\n\n // Mark active route\n if (activeRouteProp)\n localizedConfig.header.navMain = markActiveRoute(\n localizedConfig.header.navMain,\n activeRouteProp,\n );\n\n setMainNavigationIds(localizedConfig?.header?.navMain);\n\n // Set the new language choice\n persistLanguageChoice(lang, cookieKey, localStorageKey);\n\n return localizedConfig;\n};\n\n/**\n * Merge portal config with custom os flyout overrides\n * @param config Localized config\n * @param osFlyoutOverrides Overrides for the flyout\n * @returns Merged localized config\n */\nexport const mergeOsFlyoutOverrides = (\n config: ILocalizedConfig,\n osFlyoutOverrides: NavMainEntity,\n): NavMainEntity[] => {\n if (!osFlyoutOverrides) return config.header.navMain;\n\n return config.header.navMain.map(mainNav => {\n if (mainNav.id !== 'flyout_os') return mainNav;\n\n if (osFlyoutCache === null) {\n osFlyoutCache = JSON.parse(JSON.stringify(mainNav)) as NavMainEntity;\n }\n\n const mainNavText = osFlyoutOverrides.text ?? osFlyoutCache.text;\n const mainNavTitle = osFlyoutOverrides.title ?? osFlyoutCache.title;\n\n if (\n !osFlyoutCache.flyout ||\n osFlyoutCache.flyout.length === 0 ||\n !osFlyoutOverrides.flyout ||\n osFlyoutOverrides.flyout.length === 0\n )\n return {\n ...mainNav,\n title: mainNavTitle,\n text: mainNavText,\n };\n\n // Add entries for os flyout columns without overriding existing config\n const mainNavFlyout = [\n ...osFlyoutCache.flyout.map((col, index) => {\n const overrides = osFlyoutOverrides.flyout[index];\n const title = overrides.title ?? col.title;\n\n const linkList = overrides.linkList ? osFlyoutOverrides.flyout[index].linkList : [];\n\n return {\n title,\n linkList: [...col.linkList, ...linkList],\n };\n }),\n ...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),\n ];\n\n return {\n ...mainNav,\n text: mainNavText,\n title: mainNavTitle,\n flyout: mainNavFlyout,\n } as NavMainEntity;\n });\n};\n\n/**\n * Fetch the general config based on project id\n *\n * @returns Promise for Post Portal general config\n */\nexport const fetchConfig = async (\n projectId: string,\n environment: Environment,\n): Promise<IPortalConfig> => {\n // Check if project id is sanitized\n if (!isValidProjectId(projectId)) {\n throw new Error(`Internet Header: invalid project id \"${projectId}\"`);\n }\n\n if (projectId === 'test') {\n environment = 'int01';\n }\n\n let url = generateConfigUrl(projectId, environment);\n\n // Get the config if cache is invalid\n try {\n const res = await fetch(url);\n return (await res.json()) as IPortalConfig;\n } catch (error) {\n throw new Error(`Internet Header: fetching config failed. ${error.message}`);\n }\n};\n\n/**\n * Generate an URL with all necessary query params to get the configuration.\n * Project id \"test\" will return a test configuration\n * @param projectId string\n * @param environment int01, int02 or prod\n * @returns URL pointing to the project config\n */\nexport const generateConfigUrl = (projectId: string, environment: Environment): string => {\n if (projectId === 'test') return 'assets/config/test-configuration.json';\n\n const parsedEnvironment = environment.toLowerCase();\n const isProd = parsedEnvironment === 'prod';\n const host = `https://${isProd ? 'www' : 'int'}.post.ch`;\n try {\n // Use URL to validate the generated URL\n return new URL(\n `${host}/api/headerjs/Json?serviceid=${encodeURIComponent(projectId)}${\n !isProd ? '&environment=' + parsedEnvironment : ''\n }`,\n ).toString();\n } catch (error) {\n throw new Error(`Internet Header: Config URL is invalid.`);\n }\n};\n\n/**\n * Check if project id contains only URL safe characters\n *\n * @param projectId Project Id string\n * @returns The valid project id\n */\nexport const isValidProjectId = (projectId: string): boolean => {\n return projectId !== '' && projectId.length > 0 && /^[a-zA-Z][\\w-]*[a-zA-Z0-9]$/.test(projectId);\n};\n\n/**\n * Get the localized config object from a custom config\n *\n * @param config String or json object of the custom config\n * @param language Specific language\n * @returns Localized custom config object\n */\nexport const getLocalizedCustomConfig = (\n config: string | ICustomConfig,\n language: string,\n): ILocalizedCustomConfig | undefined => {\n let customConfig: ICustomConfig;\n try {\n customConfig = typeof config === 'string' ? JSON.parse(config) : config;\n } catch (error) {\n throw new Error(\n `Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. `,\n );\n }\n let localizedCustomConfig: ILocalizedCustomConfig | undefined = customConfig[language];\n if (localizedCustomConfig?.header?.navMain)\n setMainNavigationIds(localizedCustomConfig.header.navMain);\n return localizedCustomConfig;\n};\n\n/**\n * Check if mobile header styles are applied or not\n * @returns True if browser is smaller than 1024px\n */\nexport const isMobile = () => window.innerWidth < 1024;\n\n/**\n * Set unique ID's on main navigation entities but conserve flyout_os to be able to\n * identify the online-service flyout, which can be configured by osFlyoutOverrides\n */\nexport const setMainNavigationIds = (navMainEntities: NavMainEntity[]): void => {\n navMainEntities.forEach(navMainEntity => {\n navMainEntity.id = navMainEntity.id === 'flyout_os' ? navMainEntity.id : uniqueId('main-nav-');\n });\n};\n"]}
|
|
@@ -14,6 +14,22 @@ export const coveo = {
|
|
|
14
14
|
organisation: 'postchagnonprods5sq57qt',
|
|
15
15
|
token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',
|
|
16
16
|
},
|
|
17
|
+
dev01: {
|
|
18
|
+
organisation: 'postchagnonprods5sq57qt',
|
|
19
|
+
token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',
|
|
20
|
+
},
|
|
21
|
+
dev02: {
|
|
22
|
+
organisation: 'postchagnonprods5sq57qt',
|
|
23
|
+
token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',
|
|
24
|
+
},
|
|
25
|
+
devs1: {
|
|
26
|
+
organisation: 'postchagnonprods5sq57qt',
|
|
27
|
+
token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',
|
|
28
|
+
},
|
|
29
|
+
test: {
|
|
30
|
+
organisation: 'postchagnonprods5sq57qt',
|
|
31
|
+
token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',
|
|
32
|
+
},
|
|
17
33
|
},
|
|
18
34
|
};
|
|
19
35
|
//# sourceMappingURL=coveo.settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coveo.settings.js","sourceRoot":"","sources":["../../../../src/services/search/coveo.settings.ts"],"names":[],"mappings":"AAEA,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAiB;EACjC,GAAG,EAAE,iEAAiE;EACtE,WAAW,EAAE;IACX,IAAI,EAAE;MACJ,YAAY,EAAE,sBAAsB;MACpC,KAAK,EAAE,wCAAwC;KAChD;IACD,KAAK,EAAE;MACL,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;IACD,KAAK,EAAE;MACL,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;GACF;CACF,CAAC","sourcesContent":["import { CoveoOptions } from '../../models/coveo.model';\n\n// Coveo constants\nexport const coveo: CoveoOptions = {\n url: 'https://platform-eu.cloud.coveo.com/rest/search/v2/querySuggest',\n environment: {\n prod: {\n organisation: 'postchagprod6ef4sbet',\n token: 'xx5b629890-23b9-4fbe-b601-0e8719186969',\n },\n int01: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n int02: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"coveo.settings.js","sourceRoot":"","sources":["../../../../src/services/search/coveo.settings.ts"],"names":[],"mappings":"AAEA,kBAAkB;AAClB,MAAM,CAAC,MAAM,KAAK,GAAiB;EACjC,GAAG,EAAE,iEAAiE;EACtE,WAAW,EAAE;IACX,IAAI,EAAE;MACJ,YAAY,EAAE,sBAAsB;MACpC,KAAK,EAAE,wCAAwC;KAChD;IACD,KAAK,EAAE;MACL,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;IACD,KAAK,EAAE;MACL,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;IACD,KAAK,EAAE;MACL,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;IACD,KAAK,EAAE;MACL,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;IACD,KAAK,EAAE;MACL,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;IACD,IAAI,EAAE;MACJ,YAAY,EAAE,yBAAyB;MACvC,KAAK,EAAE,wCAAwC;KAChD;GACF;CACF,CAAC","sourcesContent":["import { CoveoOptions } from '../../models/coveo.model';\n\n// Coveo constants\nexport const coveo: CoveoOptions = {\n url: 'https://platform-eu.cloud.coveo.com/rest/search/v2/querySuggest',\n environment: {\n prod: {\n organisation: 'postchagprod6ef4sbet',\n token: 'xx5b629890-23b9-4fbe-b601-0e8719186969',\n },\n int01: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n int02: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n dev01: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n dev02: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n devs1: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n test: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n },\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { state } from '../../data/store';
|
|
2
2
|
import { gisAPIUrl, pois, placesUrl } from './places.settings';
|
|
3
|
-
import { hardNormalize
|
|
3
|
+
import { hardNormalize } from './search-utilities';
|
|
4
4
|
// Never load types twice
|
|
5
5
|
let typesCache = null;
|
|
6
6
|
/**
|
|
@@ -40,7 +40,7 @@ export const queryPlaces = async (query) => {
|
|
|
40
40
|
const limit = 8;
|
|
41
41
|
const excludeTypes = ['address', 'locality', 'region'];
|
|
42
42
|
const types = await convertTypes();
|
|
43
|
-
const geocoderUrl = `${gisAPIUrl}/Geocode?query=${encodeURIComponent(query)}&lang=${state.currentLanguage}&pois=${types}&limit=
|
|
43
|
+
const geocoderUrl = `${gisAPIUrl}/Geocode?query=${encodeURIComponent(query)}&lang=${state.currentLanguage}&pois=${types}&limit=33`;
|
|
44
44
|
try {
|
|
45
45
|
const geocodeResponse = await fetch(geocoderUrl);
|
|
46
46
|
const geocodeJSON = (await geocodeResponse.json());
|
|
@@ -84,8 +84,8 @@ export const highlightPlacesString = (query, place) => {
|
|
|
84
84
|
*/
|
|
85
85
|
export const getPlacesUrl = (location) => {
|
|
86
86
|
let url;
|
|
87
|
-
if (location.id
|
|
88
|
-
url = `${placesUrl}/${state.currentLanguage}/${location.id}
|
|
87
|
+
if (location.id) {
|
|
88
|
+
url = `${placesUrl}/${state.currentLanguage}/${location.id}/detail`;
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
91
|
url = `${placesUrl}?preselecttext=${encodeURIComponent(location.name)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"places.service.js","sourceRoot":"","sources":["../../../../src/services/search/places.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"places.service.js","sourceRoot":"","sources":["../../../../src/services/search/places.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,yBAAyB;AACzB,IAAI,UAAU,GAAkB,IAAI,CAAC;AAErC;;;GAGG;AACH,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE;EAC9B,IAAI,UAAU,KAAK,IAAI,EAAE;IACvB,IAAI;MACF,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C;EAEhB,IAAI,QAAQ,CAAC,EAAE,EAAE;IACf,GAAG,GAAG,GAAG,SAAS,IAAI,KAAK,CAAC,eAAe,IAAI,QAAQ,CAAC,EAAE,SAAS,CAAC;GACrE;OAAM;IACL,GAAG,GAAG,GAAG,SAAS,kBAAkB,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;GACzE;EAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","sourcesContent":["import { state } from '../../data/store';\nimport { GeocodeLocation, GeocodeResponse, ServiceTypesResponse } from '../../models/geocode.model';\nimport { gisAPIUrl, pois, placesUrl } from './places.settings';\nimport { hardNormalize } from './search-utilities';\n\n// Never load types twice\nlet typesCache: string | null = null;\n\n/**\n * Convert Post POI ids to stao cache ids\n * @returns\n */\nconst convertTypes = async () => {\n if (typesCache === null) {\n try {\n const typesResponse = await fetch(`${gisAPIUrl}/Types?lang=${state.currentLanguage}`);\n const typesJSON = (await typesResponse.json()) as ServiceTypesResponse;\n typesCache = encodeURIComponent(\n pois\n .map(poi => {\n const foundType = typesJSON.types.find(type => type.id === poi);\n return foundType?.tag;\n })\n .filter(poi => poi !== undefined)\n .join(','),\n );\n } catch (error) {\n console.error(\n 'Fetching places failed. Did you add \"places.post.ch\" to your connect-src content security policy?',\n );\n throw error;\n }\n }\n\n return typesCache;\n};\n\n/**\n * Query the Gis API for locations and localities (pois)\n *\n * @param query User input string\n * @returns\n */\nexport const queryPlaces = async (query: string): Promise<GeocodeLocation[]> => {\n if (query.length === 0) {\n return [];\n }\n\n const limit = 8;\n const excludeTypes = ['address', 'locality', 'region'];\n const types = await convertTypes();\n const geocoderUrl = `${gisAPIUrl}/Geocode?query=${encodeURIComponent(query)}&lang=${\n state.currentLanguage\n }&pois=${types}&limit=33`;\n\n try {\n const geocodeResponse = await fetch(geocoderUrl);\n const geocodeJSON = (await geocodeResponse.json()) as GeocodeResponse;\n if (!geocodeJSON.ok) {\n throw new Error(geocodeJSON.info);\n }\n return geocodeJSON.locations\n .filter(location => !excludeTypes.includes(location.type))\n .slice(0, limit);\n } catch (error) {\n console.error(\n 'Fetching places failed. Did you add \"places.post.ch\" to your connect-src content security policy?',\n );\n throw error;\n }\n};\n\n/**\n * Try to highlight place suggestions\n * Limitation: accented chars are not handled by this basic function\n *\n * @param query Search term\n * @param place Name of the suggested place\n * @returns\n */\nexport const highlightPlacesString = (query: string | undefined, place: string) => {\n if (query === undefined) return place;\n\n // Strip accents from the string\n const reference = hardNormalize(place);\n const q = hardNormalize(query);\n const indexOfQuery = reference.indexOf(q);\n\n if (indexOfQuery < 0) {\n return place;\n }\n\n return `${place.substring(0, indexOfQuery)}{${place.substring(\n indexOfQuery,\n indexOfQuery + query.length,\n )}}${place.substring(indexOfQuery + query.length, place.length)}`;\n};\n\n/**\n * Get the deeplink to any location found via geocoder\n *\n * @param location A location from the Gis API Geocode endpoint\n * @returns\n */\nexport const getPlacesUrl = (location: GeocodeLocation): string => {\n let url: string;\n\n if (location.id) {\n url = `${placesUrl}/${state.currentLanguage}/${location.id}/detail`;\n } else {\n url = `${placesUrl}?preselecttext=${encodeURIComponent(location.name)}`;\n }\n\n return url;\n};\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import slugify from '@sindresorhus/slugify';
|
|
2
1
|
/**
|
|
3
2
|
* Transform to lowercase, extract accents to separate unicode chars,
|
|
4
3
|
* replace all accent unicode chars so only standard latin chars remain
|
|
@@ -11,16 +10,4 @@ export const hardNormalize = (str) => str
|
|
|
11
10
|
.toLowerCase()
|
|
12
11
|
.normalize('NFD')
|
|
13
12
|
.replace(/[\u0300-\u036f]/g, '');
|
|
14
|
-
/**
|
|
15
|
-
* Convert a poi name to a URL compatible slug, logic copied from TOPOS
|
|
16
|
-
* @param fragment A poi name
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
export const createSlug = (fragment) => slugify(fragment
|
|
20
|
-
.replace(/ \/ /g, '-')
|
|
21
|
-
.replace(/ /g, '-')
|
|
22
|
-
.replace(/\//g, '')
|
|
23
|
-
.replace(/\./g, '')
|
|
24
|
-
.replace(/\,/g, '')
|
|
25
|
-
.replace(/\'/g, ''));
|
|
26
13
|
//# sourceMappingURL=search-utilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-utilities.js","sourceRoot":"","sources":["../../../../src/services/search/search-utilities.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"search-utilities.js","sourceRoot":"","sources":["../../../../src/services/search/search-utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAW,EAAU,EAAE,CACnD,GAAG;GACA,WAAW,EAAE;GACb,SAAS,CAAC,KAAK,CAAC;GAChB,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC","sourcesContent":["/**\n * Transform to lowercase, extract accents to separate unicode chars,\n * replace all accent unicode chars so only standard latin chars remain\n * https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463#37511463\n *\n * @param str Input string\n * @returns\n */\nexport const hardNormalize = (str: string): string =>\n str\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n"]}
|