@swisspost/internet-header 1.14.9 → 1.15.1
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.cjs.js +2 -2
- package/dist/cjs/{post-internet-header-e3c70a48.js → post-internet-header-0bc6191d.js} +22 -12
- package/dist/cjs/{post-main-navigation-8e804e67.js → post-main-navigation-f1c72969.js} +7 -3
- package/dist/cjs/post-main-navigation.cjs.entry.js +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +1 -1
- package/dist/collection/components/post-main-navigation/post-main-navigation.js +7 -3
- package/dist/collection/services/config.service.js +7 -6
- package/dist/collection/services/route.service.js +13 -4
- package/dist/components/post-main-navigation2.js +7 -3
- package/dist/components/swisspost-internet-header.js +22 -12
- package/dist/docs.json +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/{post-internet-header-d95694f6.js → post-internet-header-0b3def5c.js} +22 -12
- package/dist/esm/{post-main-navigation-3f8bd754.js → post-main-navigation-1105de2a.js} +7 -3
- package/dist/esm/post-main-navigation.entry.js +1 -1
- package/dist/esm/swisspost-internet-header.entry.js +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/post-internet-header-0b3def5c.js +1 -0
- package/dist/esm-es5/{post-main-navigation-3f8bd754.js → post-main-navigation-1105de2a.js} +1 -1
- package/dist/esm-es5/post-main-navigation.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
- package/dist/swisspost-internet-header/index.esm.js +1 -1
- package/dist/swisspost-internet-header/p-02f75eb0.js +1 -0
- package/dist/swisspost-internet-header/{p-22a39458.system.entry.js → p-08083b29.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-eb6c1605.entry.js → p-22328fea.entry.js} +1 -1
- package/dist/swisspost-internet-header/p-2a6f40b8.system.js +1 -0
- package/dist/swisspost-internet-header/{p-68812967.system.entry.js → p-325b363d.system.entry.js} +1 -1
- package/dist/swisspost-internet-header/{p-3ba404aa.system.js → p-468fb80a.system.js} +1 -1
- package/dist/swisspost-internet-header/p-695fe962.system.js +1 -1
- package/dist/swisspost-internet-header/{p-dd441f54.system.js → p-9af11364.system.js} +1 -1
- package/dist/swisspost-internet-header/p-a38fcaca.js +1 -0
- package/dist/swisspost-internet-header/{p-b2159d69.entry.js → p-bb181ae4.entry.js} +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/types/models/header.model.d.ts +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/post-internet-header-d95694f6.js +0 -1
- package/dist/swisspost-internet-header/p-1555a1e1.js +0 -1
- package/dist/swisspost-internet-header/p-e280dc6d.system.js +0 -1
- package/dist/swisspost-internet-header/p-e6cd9832.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postInternetHeader = require('./post-internet-header-
|
|
5
|
+
const postInternetHeader = require('./post-internet-header-0bc6191d.js');
|
|
6
6
|
const postInternetBreadcrumbs = require('./post-internet-breadcrumbs-1a8bd582.js');
|
|
7
7
|
const postInternetFooter = require('./post-internet-footer-ca621ca9.js');
|
|
8
8
|
const postSkiplinks = require('./post-skiplinks-894eb1ca.js');
|
|
9
9
|
const postMetaNavigation = require('./post-meta-navigation-f66b734d.js');
|
|
10
10
|
const postLanguageSwitch = require('./post-language-switch-768195ef.js');
|
|
11
11
|
const postLogo = require('./post-logo-c7b8f044.js');
|
|
12
|
-
const postMainNavigation = require('./post-main-navigation-
|
|
12
|
+
const postMainNavigation = require('./post-main-navigation-f1c72969.js');
|
|
13
13
|
const postSearch = require('./post-search-5e173700.js');
|
|
14
14
|
const postKlpLoginWidget = require('./post-klp-login-widget-8946e37f.js');
|
|
15
15
|
require('./index-ecd8c9bb.js');
|
|
@@ -59,10 +59,18 @@ const hasActivePortalRoute = (config) => {
|
|
|
59
59
|
return config.filter(nav => nav.isActive).length > 0;
|
|
60
60
|
};
|
|
61
61
|
const resetActiveStateToPortalConfig = (config) => {
|
|
62
|
-
return config.map(nav =>
|
|
62
|
+
return config.map(nav => {
|
|
63
|
+
var _a;
|
|
64
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: nav.isActive, flyout: (_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: link.isActive }))) }))) }));
|
|
65
|
+
});
|
|
63
66
|
};
|
|
64
67
|
const resetOverrideConfig = (config) => {
|
|
65
|
-
return config.map(nav =>
|
|
68
|
+
return config.map(nav => {
|
|
69
|
+
var _a;
|
|
70
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: false,
|
|
71
|
+
// Initialize flyout as an empty array if it's undefined
|
|
72
|
+
flyout: ((_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: false }))) })))) || [] }));
|
|
73
|
+
});
|
|
66
74
|
};
|
|
67
75
|
/**
|
|
68
76
|
* Compile a list of scores based on the map mode, sorted in descending order
|
|
@@ -78,15 +86,16 @@ const compileScoreList = (config, compareUrl, activeRouteProp) => {
|
|
|
78
86
|
config
|
|
79
87
|
.filter(mainNav => !hadAnyActiveLink && mainNav)
|
|
80
88
|
.forEach(mainNav => {
|
|
89
|
+
var _a;
|
|
81
90
|
try {
|
|
82
91
|
const score = compareRoutes(compareUrl, new URL(mainNav.url), activeRouteProp);
|
|
83
92
|
hadAnyActiveLink = updateScoreList(scoreList, score, { main: mainNav, score }, hadAnyActiveLink);
|
|
84
93
|
}
|
|
85
|
-
catch (
|
|
94
|
+
catch (_b) {
|
|
86
95
|
// Not a valid url, continue
|
|
87
96
|
}
|
|
88
97
|
// Loop through flyout links 2nd level
|
|
89
|
-
mainNav.flyout.forEach(flyout => {
|
|
98
|
+
(_a = mainNav.flyout) === null || _a === void 0 ? void 0 : _a.forEach(flyout => {
|
|
90
99
|
var _a;
|
|
91
100
|
(_a = flyout.linkList) === null || _a === void 0 ? void 0 : _a.forEach(linklist => {
|
|
92
101
|
// Don't override if any link is already active
|
|
@@ -243,7 +252,7 @@ const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
243
252
|
if (osFlyoutOverrides == null)
|
|
244
253
|
return config.header.navMain;
|
|
245
254
|
return config.header.navMain.map(mainNav => {
|
|
246
|
-
var _a, _b;
|
|
255
|
+
var _a, _b, _c;
|
|
247
256
|
if (mainNav.id !== 'flyout_os')
|
|
248
257
|
return mainNav;
|
|
249
258
|
if (osFlyoutCache === null) {
|
|
@@ -259,16 +268,17 @@ const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
259
268
|
// Add entries for os flyout columns without overriding existing config
|
|
260
269
|
const mainNavFlyout = [
|
|
261
270
|
...osFlyoutCache.flyout.map((col, index) => {
|
|
262
|
-
var _a;
|
|
263
|
-
const overrides = osFlyoutOverrides.flyout[index];
|
|
264
|
-
const title = (
|
|
265
|
-
|
|
271
|
+
var _a, _b;
|
|
272
|
+
const overrides = (_a = osFlyoutOverrides.flyout) === null || _a === void 0 ? void 0 : _a[index]; // Check if overrides exist
|
|
273
|
+
const title = (_b = overrides === null || overrides === void 0 ? void 0 : overrides.title) !== null && _b !== void 0 ? _b : col.title;
|
|
274
|
+
// Check if the linkList exists in the overrides and then use it
|
|
275
|
+
const linkList = (overrides === null || overrides === void 0 ? void 0 : overrides.linkList) != null ? overrides.linkList : [];
|
|
266
276
|
return {
|
|
267
277
|
title,
|
|
268
278
|
linkList: [...col.linkList, ...linkList],
|
|
269
279
|
};
|
|
270
280
|
}),
|
|
271
|
-
...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),
|
|
281
|
+
...(((_c = osFlyoutOverrides.flyout) === null || _c === void 0 ? void 0 : _c.slice(osFlyoutCache.flyout.length)) || []),
|
|
272
282
|
];
|
|
273
283
|
return Object.assign(Object.assign({}, mainNav), { text: mainNavText, title: mainNavTitle, flyout: mainNavFlyout });
|
|
274
284
|
});
|
|
@@ -358,7 +368,7 @@ const setMainNavigationIds = (navMainEntities) => {
|
|
|
358
368
|
};
|
|
359
369
|
|
|
360
370
|
const name = "@swisspost/internet-header";
|
|
361
|
-
const version = "1.
|
|
371
|
+
const version = "1.15.1";
|
|
362
372
|
const description = "The header for client facing applications.";
|
|
363
373
|
const author = "Swiss Post <design-system@post.ch>";
|
|
364
374
|
const license = "Apache-2.0";
|
|
@@ -399,7 +409,7 @@ const scripts = {
|
|
|
399
409
|
generate: "stencil generate"
|
|
400
410
|
};
|
|
401
411
|
const dependencies = {
|
|
402
|
-
"@swisspost/design-system-styles": "workspace:8.
|
|
412
|
+
"@swisspost/design-system-styles": "workspace:8.6.0",
|
|
403
413
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
404
414
|
"iframe-resizer": "4.4.5",
|
|
405
415
|
jquery: "3.7.1",
|
|
@@ -133,7 +133,10 @@ const PostMainNavigation = class {
|
|
|
133
133
|
window.clearTimeout(this.mouseLeaveTimer);
|
|
134
134
|
this.mouseLeaveTimer = null;
|
|
135
135
|
}
|
|
136
|
-
if (window.innerWidth >= 1024 &&
|
|
136
|
+
if (window.innerWidth >= 1024 &&
|
|
137
|
+
level.flyout &&
|
|
138
|
+
level.flyout.length > 0 &&
|
|
139
|
+
this.activeFlyout !== level.id) {
|
|
137
140
|
// Delay opening the flyout for a moment to give users a chance to move the mouse over the navigation without triggering the flyout
|
|
138
141
|
this.mouseEnterTimer = window.setTimeout(() => {
|
|
139
142
|
this.mouseEnterTimer = null;
|
|
@@ -151,7 +154,7 @@ const PostMainNavigation = class {
|
|
|
151
154
|
if (this.activeFlyout !== undefined && this.activeFlyout !== level.id) {
|
|
152
155
|
return;
|
|
153
156
|
}
|
|
154
|
-
if (window.innerWidth >= 1024 && level.flyout.length > 0) {
|
|
157
|
+
if (window.innerWidth >= 1024 && level.flyout && level.flyout.length > 0) {
|
|
155
158
|
// Allow the pointer to shortly leave the flyout without closing it. This
|
|
156
159
|
// allows for user mistakes and makes the experience less nervous
|
|
157
160
|
this.mouseLeaveTimer = window.setTimeout(() => {
|
|
@@ -225,7 +228,8 @@ const PostMainNavigation = class {
|
|
|
225
228
|
const headerConfig = store.state.localizedConfig.header;
|
|
226
229
|
return (index.h(index.Host, null, index.h(svgSprite_component.SvgSprite, null), index.h("nav", { "aria-label": headerConfig.translations.navMainAriaLabel, id: "post-internet-header-main-navigation", class: { 'main-navigation': true, 'open': this.mobileMenuOpen } }, index.h("ul", { class: "main-container container" }, headerConfig.navMain.map(levelOne => (index.h("li", { key: levelOne.text, onMouseLeave: () => this.handleMouseLeave(levelOne), onMouseEnter: () => this.handleMouseEnter(levelOne) }, index.h(LevelOneAction, { level: levelOne, isOpen: this.isActiveFlyout(levelOne.id), onTouchEnd: e => this.handleTouchEnd(e, levelOne), onKeyDown: e => this.handleKeyPress(e, levelOne), onClick: e => this.handleClick(e, levelOne) }), !levelOne.noFlyout ? renderLevelOneFlyout.bind(this)(levelOne) : null)))), index.h("slot", null))));
|
|
227
230
|
function renderLevelOneFlyout(levelOne) {
|
|
228
|
-
|
|
231
|
+
var _a;
|
|
232
|
+
return (index.h("div", { id: levelOne.id, class: { flyout: true, open: this.isActiveFlyout(levelOne.id) } }, index.h("div", { class: "wide-container" }, index.h("div", { class: "flyout-nav" }, index.h("button", { class: "nav-link flyout-back-button", onClick: () => this.closeFlyout(levelOne.id) }, index.h(svgIcon_component.SvgIcon, { name: "pi-pointy-arrow-right", classNames: "mirrored" }), index.h("span", null, headerConfig.translations.backButtonText)), index.h("button", { class: "flyout-close-button", onClick: () => this.closeFlyout(levelOne.id) }, index.h("span", { class: "visually-hidden" }, levelOne.text, ", ", headerConfig.translations.mobileNavToggleClose), index.h(svgIcon_component.SvgIcon, { name: "pi-close" }))), index.h("h2", { class: "flyout-title container" }, index.h("a", { href: levelOne.url, class: "nav-link" }, levelOne.text)), index.h("div", { class: "flyout-row container" }, (_a = levelOne.flyout) === null || _a === void 0 ? void 0 : _a.map((flyout, i) => (index.h("div", { key: flyout.title, class: "flyout-column" }, flyout.title !== undefined ? (index.h("h3", { id: `${levelOne.id}-column-${i}` }, flyout.title)) : null, index.h("ul", { class: "flyout-linklist", "aria-labelledby": flyout.title !== undefined ? `${levelOne.id}-column-${i}` : undefined }, flyout.linkList.map(link => (index.h("li", { key: link.url }, index.h("a", { class: {
|
|
229
233
|
'flyout-link': true,
|
|
230
234
|
'active': !!(link === null || link === void 0 ? void 0 : link.isActiveOverride),
|
|
231
235
|
}, href: link.url, target: link.target }, link.title, (link === null || link === void 0 ? void 0 : link.isActiveOverride) ? (index.h("span", { class: "visually-hidden" }, ", ", language_service.translate('Active navigation element'))) : null))))))))))));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postMainNavigation = require('./post-main-navigation-
|
|
5
|
+
const postMainNavigation = require('./post-main-navigation-f1c72969.js');
|
|
6
6
|
require('./index-ecd8c9bb.js');
|
|
7
7
|
require('./index-fbcc9ff3.js');
|
|
8
8
|
require('./store-eabc7f7a.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const postInternetHeader = require('./post-internet-header-
|
|
5
|
+
const postInternetHeader = require('./post-internet-header-0bc6191d.js');
|
|
6
6
|
require('./index-ecd8c9bb.js');
|
|
7
7
|
require('./index-fbcc9ff3.js');
|
|
8
8
|
require('./language.service-2a3c77d1.js');
|
|
@@ -109,7 +109,10 @@ export class PostMainNavigation {
|
|
|
109
109
|
window.clearTimeout(this.mouseLeaveTimer);
|
|
110
110
|
this.mouseLeaveTimer = null;
|
|
111
111
|
}
|
|
112
|
-
if (window.innerWidth >= 1024 &&
|
|
112
|
+
if (window.innerWidth >= 1024 &&
|
|
113
|
+
level.flyout &&
|
|
114
|
+
level.flyout.length > 0 &&
|
|
115
|
+
this.activeFlyout !== level.id) {
|
|
113
116
|
// Delay opening the flyout for a moment to give users a chance to move the mouse over the navigation without triggering the flyout
|
|
114
117
|
this.mouseEnterTimer = window.setTimeout(() => {
|
|
115
118
|
this.mouseEnterTimer = null;
|
|
@@ -127,7 +130,7 @@ export class PostMainNavigation {
|
|
|
127
130
|
if (this.activeFlyout !== undefined && this.activeFlyout !== level.id) {
|
|
128
131
|
return;
|
|
129
132
|
}
|
|
130
|
-
if (window.innerWidth >= 1024 && level.flyout.length > 0) {
|
|
133
|
+
if (window.innerWidth >= 1024 && level.flyout && level.flyout.length > 0) {
|
|
131
134
|
// Allow the pointer to shortly leave the flyout without closing it. This
|
|
132
135
|
// allows for user mistakes and makes the experience less nervous
|
|
133
136
|
this.mouseLeaveTimer = window.setTimeout(() => {
|
|
@@ -201,7 +204,8 @@ export class PostMainNavigation {
|
|
|
201
204
|
const headerConfig = state.localizedConfig.header;
|
|
202
205
|
return (h(Host, null, h(SvgSprite, null), h("nav", { "aria-label": headerConfig.translations.navMainAriaLabel, id: "post-internet-header-main-navigation", class: { 'main-navigation': true, 'open': this.mobileMenuOpen } }, h("ul", { class: "main-container container" }, headerConfig.navMain.map(levelOne => (h("li", { key: levelOne.text, onMouseLeave: () => this.handleMouseLeave(levelOne), onMouseEnter: () => this.handleMouseEnter(levelOne) }, h(LevelOneAction, { level: levelOne, isOpen: this.isActiveFlyout(levelOne.id), onTouchEnd: e => this.handleTouchEnd(e, levelOne), onKeyDown: e => this.handleKeyPress(e, levelOne), onClick: e => this.handleClick(e, levelOne) }), !levelOne.noFlyout ? renderLevelOneFlyout.bind(this)(levelOne) : null)))), h("slot", null))));
|
|
203
206
|
function renderLevelOneFlyout(levelOne) {
|
|
204
|
-
|
|
207
|
+
var _a;
|
|
208
|
+
return (h("div", { id: levelOne.id, class: { flyout: true, open: this.isActiveFlyout(levelOne.id) } }, h("div", { class: "wide-container" }, h("div", { class: "flyout-nav" }, h("button", { class: "nav-link flyout-back-button", onClick: () => this.closeFlyout(levelOne.id) }, h(SvgIcon, { name: "pi-pointy-arrow-right", classNames: "mirrored" }), h("span", null, headerConfig.translations.backButtonText)), h("button", { class: "flyout-close-button", onClick: () => this.closeFlyout(levelOne.id) }, h("span", { class: "visually-hidden" }, levelOne.text, ", ", headerConfig.translations.mobileNavToggleClose), h(SvgIcon, { name: "pi-close" }))), h("h2", { class: "flyout-title container" }, h("a", { href: levelOne.url, class: "nav-link" }, levelOne.text)), h("div", { class: "flyout-row container" }, (_a = levelOne.flyout) === null || _a === void 0 ? void 0 : _a.map((flyout, i) => (h("div", { key: flyout.title, class: "flyout-column" }, flyout.title !== undefined ? (h("h3", { id: `${levelOne.id}-column-${i}` }, flyout.title)) : null, h("ul", { class: "flyout-linklist", "aria-labelledby": flyout.title !== undefined ? `${levelOne.id}-column-${i}` : undefined }, flyout.linkList.map(link => (h("li", { key: link.url }, h("a", { class: {
|
|
205
209
|
'flyout-link': true,
|
|
206
210
|
'active': !!(link === null || link === void 0 ? void 0 : link.isActiveOverride),
|
|
207
211
|
}, href: link.url, target: link.target }, link.title, (link === null || link === void 0 ? void 0 : link.isActiveOverride) ? (h("span", { class: "visually-hidden" }, ", ", translate('Active navigation element'))) : null))))))))))));
|
|
@@ -68,7 +68,7 @@ export const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
68
68
|
if (osFlyoutOverrides == null)
|
|
69
69
|
return config.header.navMain;
|
|
70
70
|
return config.header.navMain.map(mainNav => {
|
|
71
|
-
var _a, _b;
|
|
71
|
+
var _a, _b, _c;
|
|
72
72
|
if (mainNav.id !== 'flyout_os')
|
|
73
73
|
return mainNav;
|
|
74
74
|
if (osFlyoutCache === null) {
|
|
@@ -84,16 +84,17 @@ export const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
84
84
|
// Add entries for os flyout columns without overriding existing config
|
|
85
85
|
const mainNavFlyout = [
|
|
86
86
|
...osFlyoutCache.flyout.map((col, index) => {
|
|
87
|
-
var _a;
|
|
88
|
-
const overrides = osFlyoutOverrides.flyout[index];
|
|
89
|
-
const title = (
|
|
90
|
-
|
|
87
|
+
var _a, _b;
|
|
88
|
+
const overrides = (_a = osFlyoutOverrides.flyout) === null || _a === void 0 ? void 0 : _a[index]; // Check if overrides exist
|
|
89
|
+
const title = (_b = overrides === null || overrides === void 0 ? void 0 : overrides.title) !== null && _b !== void 0 ? _b : col.title;
|
|
90
|
+
// Check if the linkList exists in the overrides and then use it
|
|
91
|
+
const linkList = (overrides === null || overrides === void 0 ? void 0 : overrides.linkList) != null ? overrides.linkList : [];
|
|
91
92
|
return {
|
|
92
93
|
title,
|
|
93
94
|
linkList: [...col.linkList, ...linkList],
|
|
94
95
|
};
|
|
95
96
|
}),
|
|
96
|
-
...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),
|
|
97
|
+
...(((_c = osFlyoutOverrides.flyout) === null || _c === void 0 ? void 0 : _c.slice(osFlyoutCache.flyout.length)) || []),
|
|
97
98
|
];
|
|
98
99
|
return Object.assign(Object.assign({}, mainNav), { text: mainNavText, title: mainNavTitle, flyout: mainNavFlyout });
|
|
99
100
|
});
|
|
@@ -48,10 +48,18 @@ export const hasActivePortalRoute = (config) => {
|
|
|
48
48
|
return config.filter(nav => nav.isActive).length > 0;
|
|
49
49
|
};
|
|
50
50
|
export const resetActiveStateToPortalConfig = (config) => {
|
|
51
|
-
return config.map(nav =>
|
|
51
|
+
return config.map(nav => {
|
|
52
|
+
var _a;
|
|
53
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: nav.isActive, flyout: (_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: link.isActive }))) }))) }));
|
|
54
|
+
});
|
|
52
55
|
};
|
|
53
56
|
const resetOverrideConfig = (config) => {
|
|
54
|
-
return config.map(nav =>
|
|
57
|
+
return config.map(nav => {
|
|
58
|
+
var _a;
|
|
59
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: false,
|
|
60
|
+
// Initialize flyout as an empty array if it's undefined
|
|
61
|
+
flyout: ((_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: false }))) })))) || [] }));
|
|
62
|
+
});
|
|
55
63
|
};
|
|
56
64
|
/**
|
|
57
65
|
* Compile a list of scores based on the map mode, sorted in descending order
|
|
@@ -67,15 +75,16 @@ export const compileScoreList = (config, compareUrl, activeRouteProp) => {
|
|
|
67
75
|
config
|
|
68
76
|
.filter(mainNav => !hadAnyActiveLink && mainNav)
|
|
69
77
|
.forEach(mainNav => {
|
|
78
|
+
var _a;
|
|
70
79
|
try {
|
|
71
80
|
const score = compareRoutes(compareUrl, new URL(mainNav.url), activeRouteProp);
|
|
72
81
|
hadAnyActiveLink = updateScoreList(scoreList, score, { main: mainNav, score }, hadAnyActiveLink);
|
|
73
82
|
}
|
|
74
|
-
catch (
|
|
83
|
+
catch (_b) {
|
|
75
84
|
// Not a valid url, continue
|
|
76
85
|
}
|
|
77
86
|
// Loop through flyout links 2nd level
|
|
78
|
-
mainNav.flyout.forEach(flyout => {
|
|
87
|
+
(_a = mainNav.flyout) === null || _a === void 0 ? void 0 : _a.forEach(flyout => {
|
|
79
88
|
var _a;
|
|
80
89
|
(_a = flyout.linkList) === null || _a === void 0 ? void 0 : _a.forEach(linklist => {
|
|
81
90
|
// Don't override if any link is already active
|
|
@@ -133,7 +133,10 @@ const PostMainNavigation = /*@__PURE__*/ proxyCustomElement(class PostMainNaviga
|
|
|
133
133
|
window.clearTimeout(this.mouseLeaveTimer);
|
|
134
134
|
this.mouseLeaveTimer = null;
|
|
135
135
|
}
|
|
136
|
-
if (window.innerWidth >= 1024 &&
|
|
136
|
+
if (window.innerWidth >= 1024 &&
|
|
137
|
+
level.flyout &&
|
|
138
|
+
level.flyout.length > 0 &&
|
|
139
|
+
this.activeFlyout !== level.id) {
|
|
137
140
|
// Delay opening the flyout for a moment to give users a chance to move the mouse over the navigation without triggering the flyout
|
|
138
141
|
this.mouseEnterTimer = window.setTimeout(() => {
|
|
139
142
|
this.mouseEnterTimer = null;
|
|
@@ -151,7 +154,7 @@ const PostMainNavigation = /*@__PURE__*/ proxyCustomElement(class PostMainNaviga
|
|
|
151
154
|
if (this.activeFlyout !== undefined && this.activeFlyout !== level.id) {
|
|
152
155
|
return;
|
|
153
156
|
}
|
|
154
|
-
if (window.innerWidth >= 1024 && level.flyout.length > 0) {
|
|
157
|
+
if (window.innerWidth >= 1024 && level.flyout && level.flyout.length > 0) {
|
|
155
158
|
// Allow the pointer to shortly leave the flyout without closing it. This
|
|
156
159
|
// allows for user mistakes and makes the experience less nervous
|
|
157
160
|
this.mouseLeaveTimer = window.setTimeout(() => {
|
|
@@ -225,7 +228,8 @@ const PostMainNavigation = /*@__PURE__*/ proxyCustomElement(class PostMainNaviga
|
|
|
225
228
|
const headerConfig = state.localizedConfig.header;
|
|
226
229
|
return (h(Host, null, h(SvgSprite, null), h("nav", { "aria-label": headerConfig.translations.navMainAriaLabel, id: "post-internet-header-main-navigation", class: { 'main-navigation': true, 'open': this.mobileMenuOpen } }, h("ul", { class: "main-container container" }, headerConfig.navMain.map(levelOne => (h("li", { key: levelOne.text, onMouseLeave: () => this.handleMouseLeave(levelOne), onMouseEnter: () => this.handleMouseEnter(levelOne) }, h(LevelOneAction, { level: levelOne, isOpen: this.isActiveFlyout(levelOne.id), onTouchEnd: e => this.handleTouchEnd(e, levelOne), onKeyDown: e => this.handleKeyPress(e, levelOne), onClick: e => this.handleClick(e, levelOne) }), !levelOne.noFlyout ? renderLevelOneFlyout.bind(this)(levelOne) : null)))), h("slot", null))));
|
|
227
230
|
function renderLevelOneFlyout(levelOne) {
|
|
228
|
-
|
|
231
|
+
var _a;
|
|
232
|
+
return (h("div", { id: levelOne.id, class: { flyout: true, open: this.isActiveFlyout(levelOne.id) } }, h("div", { class: "wide-container" }, h("div", { class: "flyout-nav" }, h("button", { class: "nav-link flyout-back-button", onClick: () => this.closeFlyout(levelOne.id) }, h(SvgIcon, { name: "pi-pointy-arrow-right", classNames: "mirrored" }), h("span", null, headerConfig.translations.backButtonText)), h("button", { class: "flyout-close-button", onClick: () => this.closeFlyout(levelOne.id) }, h("span", { class: "visually-hidden" }, levelOne.text, ", ", headerConfig.translations.mobileNavToggleClose), h(SvgIcon, { name: "pi-close" }))), h("h2", { class: "flyout-title container" }, h("a", { href: levelOne.url, class: "nav-link" }, levelOne.text)), h("div", { class: "flyout-row container" }, (_a = levelOne.flyout) === null || _a === void 0 ? void 0 : _a.map((flyout, i) => (h("div", { key: flyout.title, class: "flyout-column" }, flyout.title !== undefined ? (h("h3", { id: `${levelOne.id}-column-${i}` }, flyout.title)) : null, h("ul", { class: "flyout-linklist", "aria-labelledby": flyout.title !== undefined ? `${levelOne.id}-column-${i}` : undefined }, flyout.linkList.map(link => (h("li", { key: link.url }, h("a", { class: {
|
|
229
233
|
'flyout-link': true,
|
|
230
234
|
'active': !!(link === null || link === void 0 ? void 0 : link.isActiveOverride),
|
|
231
235
|
}, href: link.url, target: link.target }, link.title, (link === null || link === void 0 ? void 0 : link.isActiveOverride) ? (h("span", { class: "visually-hidden" }, ", ", translate('Active navigation element'))) : null))))))))))));
|
|
@@ -64,10 +64,18 @@ const hasActivePortalRoute = (config) => {
|
|
|
64
64
|
return config.filter(nav => nav.isActive).length > 0;
|
|
65
65
|
};
|
|
66
66
|
const resetActiveStateToPortalConfig = (config) => {
|
|
67
|
-
return config.map(nav =>
|
|
67
|
+
return config.map(nav => {
|
|
68
|
+
var _a;
|
|
69
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: nav.isActive, flyout: (_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: link.isActive }))) }))) }));
|
|
70
|
+
});
|
|
68
71
|
};
|
|
69
72
|
const resetOverrideConfig = (config) => {
|
|
70
|
-
return config.map(nav =>
|
|
73
|
+
return config.map(nav => {
|
|
74
|
+
var _a;
|
|
75
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: false,
|
|
76
|
+
// Initialize flyout as an empty array if it's undefined
|
|
77
|
+
flyout: ((_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: false }))) })))) || [] }));
|
|
78
|
+
});
|
|
71
79
|
};
|
|
72
80
|
/**
|
|
73
81
|
* Compile a list of scores based on the map mode, sorted in descending order
|
|
@@ -83,15 +91,16 @@ const compileScoreList = (config, compareUrl, activeRouteProp) => {
|
|
|
83
91
|
config
|
|
84
92
|
.filter(mainNav => !hadAnyActiveLink && mainNav)
|
|
85
93
|
.forEach(mainNav => {
|
|
94
|
+
var _a;
|
|
86
95
|
try {
|
|
87
96
|
const score = compareRoutes(compareUrl, new URL(mainNav.url), activeRouteProp);
|
|
88
97
|
hadAnyActiveLink = updateScoreList(scoreList, score, { main: mainNav, score }, hadAnyActiveLink);
|
|
89
98
|
}
|
|
90
|
-
catch (
|
|
99
|
+
catch (_b) {
|
|
91
100
|
// Not a valid url, continue
|
|
92
101
|
}
|
|
93
102
|
// Loop through flyout links 2nd level
|
|
94
|
-
mainNav.flyout.forEach(flyout => {
|
|
103
|
+
(_a = mainNav.flyout) === null || _a === void 0 ? void 0 : _a.forEach(flyout => {
|
|
95
104
|
var _a;
|
|
96
105
|
(_a = flyout.linkList) === null || _a === void 0 ? void 0 : _a.forEach(linklist => {
|
|
97
106
|
// Don't override if any link is already active
|
|
@@ -248,7 +257,7 @@ const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
248
257
|
if (osFlyoutOverrides == null)
|
|
249
258
|
return config.header.navMain;
|
|
250
259
|
return config.header.navMain.map(mainNav => {
|
|
251
|
-
var _a, _b;
|
|
260
|
+
var _a, _b, _c;
|
|
252
261
|
if (mainNav.id !== 'flyout_os')
|
|
253
262
|
return mainNav;
|
|
254
263
|
if (osFlyoutCache === null) {
|
|
@@ -264,16 +273,17 @@ const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
264
273
|
// Add entries for os flyout columns without overriding existing config
|
|
265
274
|
const mainNavFlyout = [
|
|
266
275
|
...osFlyoutCache.flyout.map((col, index) => {
|
|
267
|
-
var _a;
|
|
268
|
-
const overrides = osFlyoutOverrides.flyout[index];
|
|
269
|
-
const title = (
|
|
270
|
-
|
|
276
|
+
var _a, _b;
|
|
277
|
+
const overrides = (_a = osFlyoutOverrides.flyout) === null || _a === void 0 ? void 0 : _a[index]; // Check if overrides exist
|
|
278
|
+
const title = (_b = overrides === null || overrides === void 0 ? void 0 : overrides.title) !== null && _b !== void 0 ? _b : col.title;
|
|
279
|
+
// Check if the linkList exists in the overrides and then use it
|
|
280
|
+
const linkList = (overrides === null || overrides === void 0 ? void 0 : overrides.linkList) != null ? overrides.linkList : [];
|
|
271
281
|
return {
|
|
272
282
|
title,
|
|
273
283
|
linkList: [...col.linkList, ...linkList],
|
|
274
284
|
};
|
|
275
285
|
}),
|
|
276
|
-
...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),
|
|
286
|
+
...(((_c = osFlyoutOverrides.flyout) === null || _c === void 0 ? void 0 : _c.slice(osFlyoutCache.flyout.length)) || []),
|
|
277
287
|
];
|
|
278
288
|
return Object.assign(Object.assign({}, mainNav), { text: mainNavText, title: mainNavTitle, flyout: mainNavFlyout });
|
|
279
289
|
});
|
|
@@ -363,7 +373,7 @@ const setMainNavigationIds = (navMainEntities) => {
|
|
|
363
373
|
};
|
|
364
374
|
|
|
365
375
|
const name = "@swisspost/internet-header";
|
|
366
|
-
const version = "1.
|
|
376
|
+
const version = "1.15.1";
|
|
367
377
|
const description = "The header for client facing applications.";
|
|
368
378
|
const author = "Swiss Post <design-system@post.ch>";
|
|
369
379
|
const license = "Apache-2.0";
|
|
@@ -404,7 +414,7 @@ const scripts = {
|
|
|
404
414
|
generate: "stencil generate"
|
|
405
415
|
};
|
|
406
416
|
const dependencies = {
|
|
407
|
-
"@swisspost/design-system-styles": "workspace:8.
|
|
417
|
+
"@swisspost/design-system-styles": "workspace:8.6.0",
|
|
408
418
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
409
419
|
"iframe-resizer": "4.4.5",
|
|
410
420
|
jquery: "3.7.1",
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2024-
|
|
2
|
+
"timestamp": "2024-11-18T17:05:28",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.19.2",
|
|
@@ -1446,7 +1446,7 @@
|
|
|
1446
1446
|
"path": "src/models/general.model.ts"
|
|
1447
1447
|
},
|
|
1448
1448
|
"src/models/header.model.ts::NavMainEntity": {
|
|
1449
|
-
"declaration": "export interface NavMainEntity {\n id?: string;\n text: string;\n title: string;\n url: string;\n isActive?: boolean;\n isActiveOverride?: boolean;\n noFlyout?: boolean;\n flyout
|
|
1449
|
+
"declaration": "export interface NavMainEntity {\n id?: string;\n text: string;\n title: string;\n url: string;\n isActive?: boolean;\n isActiveOverride?: boolean;\n noFlyout?: boolean;\n flyout?: FlyoutEntity[];\n}",
|
|
1450
1450
|
"docstring": "",
|
|
1451
1451
|
"path": "src/models/header.model.ts"
|
|
1452
1452
|
},
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { P as PostInternetHeader } from './post-internet-header-
|
|
1
|
+
export { P as PostInternetHeader } from './post-internet-header-0b3def5c.js';
|
|
2
2
|
export { P as PostInternetBreadcrumbs } from './post-internet-breadcrumbs-2370e12d.js';
|
|
3
3
|
export { P as PostInternetFooter } from './post-internet-footer-e6980e19.js';
|
|
4
4
|
export { P as PostSkiplinks } from './post-skiplinks-8c64cda3.js';
|
|
5
5
|
export { P as PostMetaNavigation } from './post-meta-navigation-c90e0eab.js';
|
|
6
6
|
export { P as PostLanguageSwitch } from './post-language-switch-05672675.js';
|
|
7
7
|
export { P as PostLogo } from './post-logo-a10a7614.js';
|
|
8
|
-
export { P as PostMainNavigation } from './post-main-navigation-
|
|
8
|
+
export { P as PostMainNavigation } from './post-main-navigation-1105de2a.js';
|
|
9
9
|
export { P as PostSearch } from './post-search-4314142a.js';
|
|
10
10
|
export { P as PostKlpLoginWidget } from './post-klp-login-widget-d0cb76d7.js';
|
|
11
11
|
import './index-bb0e68fd.js';
|
|
@@ -57,10 +57,18 @@ const hasActivePortalRoute = (config) => {
|
|
|
57
57
|
return config.filter(nav => nav.isActive).length > 0;
|
|
58
58
|
};
|
|
59
59
|
const resetActiveStateToPortalConfig = (config) => {
|
|
60
|
-
return config.map(nav =>
|
|
60
|
+
return config.map(nav => {
|
|
61
|
+
var _a;
|
|
62
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: nav.isActive, flyout: (_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: link.isActive }))) }))) }));
|
|
63
|
+
});
|
|
61
64
|
};
|
|
62
65
|
const resetOverrideConfig = (config) => {
|
|
63
|
-
return config.map(nav =>
|
|
66
|
+
return config.map(nav => {
|
|
67
|
+
var _a;
|
|
68
|
+
return (Object.assign(Object.assign({}, nav), { isActiveOverride: false,
|
|
69
|
+
// Initialize flyout as an empty array if it's undefined
|
|
70
|
+
flyout: ((_a = nav.flyout) === null || _a === void 0 ? void 0 : _a.map(flyout => (Object.assign(Object.assign({}, flyout), { linkList: flyout.linkList.map(link => (Object.assign(Object.assign({}, link), { isActiveOverride: false }))) })))) || [] }));
|
|
71
|
+
});
|
|
64
72
|
};
|
|
65
73
|
/**
|
|
66
74
|
* Compile a list of scores based on the map mode, sorted in descending order
|
|
@@ -76,15 +84,16 @@ const compileScoreList = (config, compareUrl, activeRouteProp) => {
|
|
|
76
84
|
config
|
|
77
85
|
.filter(mainNav => !hadAnyActiveLink && mainNav)
|
|
78
86
|
.forEach(mainNav => {
|
|
87
|
+
var _a;
|
|
79
88
|
try {
|
|
80
89
|
const score = compareRoutes(compareUrl, new URL(mainNav.url), activeRouteProp);
|
|
81
90
|
hadAnyActiveLink = updateScoreList(scoreList, score, { main: mainNav, score }, hadAnyActiveLink);
|
|
82
91
|
}
|
|
83
|
-
catch (
|
|
92
|
+
catch (_b) {
|
|
84
93
|
// Not a valid url, continue
|
|
85
94
|
}
|
|
86
95
|
// Loop through flyout links 2nd level
|
|
87
|
-
mainNav.flyout.forEach(flyout => {
|
|
96
|
+
(_a = mainNav.flyout) === null || _a === void 0 ? void 0 : _a.forEach(flyout => {
|
|
88
97
|
var _a;
|
|
89
98
|
(_a = flyout.linkList) === null || _a === void 0 ? void 0 : _a.forEach(linklist => {
|
|
90
99
|
// Don't override if any link is already active
|
|
@@ -241,7 +250,7 @@ const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
241
250
|
if (osFlyoutOverrides == null)
|
|
242
251
|
return config.header.navMain;
|
|
243
252
|
return config.header.navMain.map(mainNav => {
|
|
244
|
-
var _a, _b;
|
|
253
|
+
var _a, _b, _c;
|
|
245
254
|
if (mainNav.id !== 'flyout_os')
|
|
246
255
|
return mainNav;
|
|
247
256
|
if (osFlyoutCache === null) {
|
|
@@ -257,16 +266,17 @@ const mergeOsFlyoutOverrides = (config, osFlyoutOverrides) => {
|
|
|
257
266
|
// Add entries for os flyout columns without overriding existing config
|
|
258
267
|
const mainNavFlyout = [
|
|
259
268
|
...osFlyoutCache.flyout.map((col, index) => {
|
|
260
|
-
var _a;
|
|
261
|
-
const overrides = osFlyoutOverrides.flyout[index];
|
|
262
|
-
const title = (
|
|
263
|
-
|
|
269
|
+
var _a, _b;
|
|
270
|
+
const overrides = (_a = osFlyoutOverrides.flyout) === null || _a === void 0 ? void 0 : _a[index]; // Check if overrides exist
|
|
271
|
+
const title = (_b = overrides === null || overrides === void 0 ? void 0 : overrides.title) !== null && _b !== void 0 ? _b : col.title;
|
|
272
|
+
// Check if the linkList exists in the overrides and then use it
|
|
273
|
+
const linkList = (overrides === null || overrides === void 0 ? void 0 : overrides.linkList) != null ? overrides.linkList : [];
|
|
264
274
|
return {
|
|
265
275
|
title,
|
|
266
276
|
linkList: [...col.linkList, ...linkList],
|
|
267
277
|
};
|
|
268
278
|
}),
|
|
269
|
-
...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),
|
|
279
|
+
...(((_c = osFlyoutOverrides.flyout) === null || _c === void 0 ? void 0 : _c.slice(osFlyoutCache.flyout.length)) || []),
|
|
270
280
|
];
|
|
271
281
|
return Object.assign(Object.assign({}, mainNav), { text: mainNavText, title: mainNavTitle, flyout: mainNavFlyout });
|
|
272
282
|
});
|
|
@@ -356,7 +366,7 @@ const setMainNavigationIds = (navMainEntities) => {
|
|
|
356
366
|
};
|
|
357
367
|
|
|
358
368
|
const name = "@swisspost/internet-header";
|
|
359
|
-
const version = "1.
|
|
369
|
+
const version = "1.15.1";
|
|
360
370
|
const description = "The header for client facing applications.";
|
|
361
371
|
const author = "Swiss Post <design-system@post.ch>";
|
|
362
372
|
const license = "Apache-2.0";
|
|
@@ -397,7 +407,7 @@ const scripts = {
|
|
|
397
407
|
generate: "stencil generate"
|
|
398
408
|
};
|
|
399
409
|
const dependencies = {
|
|
400
|
-
"@swisspost/design-system-styles": "workspace:8.
|
|
410
|
+
"@swisspost/design-system-styles": "workspace:8.6.0",
|
|
401
411
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
402
412
|
"iframe-resizer": "4.4.5",
|
|
403
413
|
jquery: "3.7.1",
|
|
@@ -131,7 +131,10 @@ const PostMainNavigation = class {
|
|
|
131
131
|
window.clearTimeout(this.mouseLeaveTimer);
|
|
132
132
|
this.mouseLeaveTimer = null;
|
|
133
133
|
}
|
|
134
|
-
if (window.innerWidth >= 1024 &&
|
|
134
|
+
if (window.innerWidth >= 1024 &&
|
|
135
|
+
level.flyout &&
|
|
136
|
+
level.flyout.length > 0 &&
|
|
137
|
+
this.activeFlyout !== level.id) {
|
|
135
138
|
// Delay opening the flyout for a moment to give users a chance to move the mouse over the navigation without triggering the flyout
|
|
136
139
|
this.mouseEnterTimer = window.setTimeout(() => {
|
|
137
140
|
this.mouseEnterTimer = null;
|
|
@@ -149,7 +152,7 @@ const PostMainNavigation = class {
|
|
|
149
152
|
if (this.activeFlyout !== undefined && this.activeFlyout !== level.id) {
|
|
150
153
|
return;
|
|
151
154
|
}
|
|
152
|
-
if (window.innerWidth >= 1024 && level.flyout.length > 0) {
|
|
155
|
+
if (window.innerWidth >= 1024 && level.flyout && level.flyout.length > 0) {
|
|
153
156
|
// Allow the pointer to shortly leave the flyout without closing it. This
|
|
154
157
|
// allows for user mistakes and makes the experience less nervous
|
|
155
158
|
this.mouseLeaveTimer = window.setTimeout(() => {
|
|
@@ -223,7 +226,8 @@ const PostMainNavigation = class {
|
|
|
223
226
|
const headerConfig = state.localizedConfig.header;
|
|
224
227
|
return (h(Host, null, h(SvgSprite, null), h("nav", { "aria-label": headerConfig.translations.navMainAriaLabel, id: "post-internet-header-main-navigation", class: { 'main-navigation': true, 'open': this.mobileMenuOpen } }, h("ul", { class: "main-container container" }, headerConfig.navMain.map(levelOne => (h("li", { key: levelOne.text, onMouseLeave: () => this.handleMouseLeave(levelOne), onMouseEnter: () => this.handleMouseEnter(levelOne) }, h(LevelOneAction, { level: levelOne, isOpen: this.isActiveFlyout(levelOne.id), onTouchEnd: e => this.handleTouchEnd(e, levelOne), onKeyDown: e => this.handleKeyPress(e, levelOne), onClick: e => this.handleClick(e, levelOne) }), !levelOne.noFlyout ? renderLevelOneFlyout.bind(this)(levelOne) : null)))), h("slot", null))));
|
|
225
228
|
function renderLevelOneFlyout(levelOne) {
|
|
226
|
-
|
|
229
|
+
var _a;
|
|
230
|
+
return (h("div", { id: levelOne.id, class: { flyout: true, open: this.isActiveFlyout(levelOne.id) } }, h("div", { class: "wide-container" }, h("div", { class: "flyout-nav" }, h("button", { class: "nav-link flyout-back-button", onClick: () => this.closeFlyout(levelOne.id) }, h(SvgIcon, { name: "pi-pointy-arrow-right", classNames: "mirrored" }), h("span", null, headerConfig.translations.backButtonText)), h("button", { class: "flyout-close-button", onClick: () => this.closeFlyout(levelOne.id) }, h("span", { class: "visually-hidden" }, levelOne.text, ", ", headerConfig.translations.mobileNavToggleClose), h(SvgIcon, { name: "pi-close" }))), h("h2", { class: "flyout-title container" }, h("a", { href: levelOne.url, class: "nav-link" }, levelOne.text)), h("div", { class: "flyout-row container" }, (_a = levelOne.flyout) === null || _a === void 0 ? void 0 : _a.map((flyout, i) => (h("div", { key: flyout.title, class: "flyout-column" }, flyout.title !== undefined ? (h("h3", { id: `${levelOne.id}-column-${i}` }, flyout.title)) : null, h("ul", { class: "flyout-linklist", "aria-labelledby": flyout.title !== undefined ? `${levelOne.id}-column-${i}` : undefined }, flyout.linkList.map(link => (h("li", { key: link.url }, h("a", { class: {
|
|
227
231
|
'flyout-link': true,
|
|
228
232
|
'active': !!(link === null || link === void 0 ? void 0 : link.isActiveOverride),
|
|
229
233
|
}, href: link.url, target: link.target }, link.title, (link === null || link === void 0 ? void 0 : link.isActiveOverride) ? (h("span", { class: "visually-hidden" }, ", ", translate('Active navigation element'))) : null))))))))))));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as swisspost_internet_header } from './post-internet-header-
|
|
1
|
+
export { P as swisspost_internet_header } from './post-internet-header-0b3def5c.js';
|
|
2
2
|
import './index-bb0e68fd.js';
|
|
3
3
|
import './index-d3f1363d.js';
|
|
4
4
|
import './language.service-490983de.js';
|
package/dist/esm-es5/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as PostInternetHeader}from"./post-internet-header-
|
|
1
|
+
export{P as PostInternetHeader}from"./post-internet-header-0b3def5c.js";export{P as PostInternetBreadcrumbs}from"./post-internet-breadcrumbs-2370e12d.js";export{P as PostInternetFooter}from"./post-internet-footer-e6980e19.js";export{P as PostSkiplinks}from"./post-skiplinks-8c64cda3.js";export{P as PostMetaNavigation}from"./post-meta-navigation-c90e0eab.js";export{P as PostLanguageSwitch}from"./post-language-switch-05672675.js";export{P as PostLogo}from"./post-logo-a10a7614.js";export{P as PostMainNavigation}from"./post-main-navigation-1105de2a.js";export{P as PostSearch}from"./post-search-4314142a.js";export{P as PostKlpLoginWidget}from"./post-klp-login-widget-d0cb76d7.js";import"./index-bb0e68fd.js";import"./index-d3f1363d.js";import"./language.service-490983de.js";import"./store-b1332c1e.js";import"./utils-c8805f81.js";import"./svg-sprite.component-d3726867.js";import"./svg-icon.component-70692acc.js";import"./if.component-d88d9e48.js";import"./bodyScrollLock.esm-afcc00e3.js";import"./ui.service-22f2c593.js";
|