@everymatrix/general-footer-template 1.77.15 → 1.77.17
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/general-footer-template.cjs.entry.js +6 -222
- package/dist/cjs/general-footer-template.cjs.js +1 -1
- package/dist/cjs/link-section-list.cjs.entry.js +17 -11
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/utils-9b9a9d42.js +230 -0
- package/dist/collection/components/general-footer-template/general-footer-template.js +4 -4
- package/dist/collection/components/link-section-list/link-section-list.js +19 -13
- package/dist/esm/general-footer-template.entry.js +3 -219
- package/dist/esm/general-footer-template.js +1 -1
- package/dist/esm/link-section-list.entry.js +17 -11
- package/dist/esm/loader.js +1 -1
- package/dist/esm/utils-904e2462.js +225 -0
- package/dist/general-footer-template/general-footer-template.entry.js +1 -1
- package/dist/general-footer-template/general-footer-template.esm.js +1 -1
- package/dist/general-footer-template/link-section-list.entry.js +1 -1
- package/dist/general-footer-template/utils-904e2462.js +1 -0
- package/dist/types/components/general-footer-template/general-footer-template.d.ts +1 -1
- package/dist/types/components/link-section-list/link-section-list.d.ts +4 -2
- package/dist/types/components.d.ts +16 -16
- package/package.json +1 -1
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import { isMobile } from "../../utils/utils";
|
|
2
3
|
import "../../../../../ui-image/dist/types/index";
|
|
3
4
|
export class LinkSectionList {
|
|
4
5
|
constructor() {
|
|
6
|
+
this.isMobile = isMobile();
|
|
5
7
|
this.repeaterContent = undefined;
|
|
6
8
|
this.baseUrl = undefined;
|
|
7
9
|
this.language = undefined;
|
|
8
10
|
this.navigateViaEvent = false;
|
|
9
11
|
this.postMessageEvent = '';
|
|
10
|
-
this.
|
|
12
|
+
this.accordionLinks = false;
|
|
11
13
|
this.openCategory = null;
|
|
12
14
|
}
|
|
13
15
|
navigateLink(link) {
|
|
14
16
|
window.postMessage({ type: this.postMessageEvent, path: link.linkUrl, url: link.linkUrl, target: link.target, externalLink: link.externalLink }, window.location.href);
|
|
15
17
|
}
|
|
16
|
-
toggleCategory(
|
|
17
|
-
|
|
18
|
+
toggleCategory(category) {
|
|
19
|
+
if (!this.isMobile)
|
|
20
|
+
return;
|
|
21
|
+
this.openCategory = this.openCategory === category ? null : category;
|
|
22
|
+
}
|
|
23
|
+
isCategoryOpen(category) {
|
|
24
|
+
if (this.isMobile) {
|
|
25
|
+
return this.openCategory === category;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
18
28
|
}
|
|
19
29
|
createHrefLink(link) {
|
|
20
30
|
return link.externalLink ? link.linkUrl : `${this.baseUrl}/${this.language}${link.linkUrl}`;
|
|
@@ -48,19 +58,15 @@ export class LinkSectionList {
|
|
|
48
58
|
}
|
|
49
59
|
return obj;
|
|
50
60
|
}, []);
|
|
51
|
-
|
|
52
|
-
link.linkName ?
|
|
53
|
-
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("span", null, link.linkName, " "))
|
|
54
|
-
:
|
|
55
|
-
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" }))))) : (h("a", { class: "LinkSectionListLink", href: this.createHrefLink(link), target: link.target || '_blank' }, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", null, link.linkName))) :
|
|
56
|
-
link.linkName ? (h("span", { class: "LinkSectionListLinkText" }, h("span", null, link.linkName))) :
|
|
57
|
-
h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })))))))))) : (h("ul", null, category.categoryTitle && h("p", null, category.categoryTitle), category.links.map(link => h("li", { class: "LinkSectionListLink", key: link.linkName }, this.navigateViaEvent === true ? (h("span", null, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", { class: '' }, link.linkName, " "))) :
|
|
61
|
+
const renderLinkItems = (category) => category.links.map(link => h("li", { class: "LinkSectionListLink", key: link.linkName }, this.navigateViaEvent === true ? (h("span", null, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", { class: '' }, link.linkName, " "))) :
|
|
58
62
|
link.linkName ?
|
|
59
63
|
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("span", null, link.linkName, " "))
|
|
60
64
|
:
|
|
61
65
|
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" }))))) : (h("a", { class: "LinkSectionListLink", href: this.createHrefLink(link), target: link.target || '_blank' }, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", null, link.linkName))) :
|
|
62
66
|
link.linkName ? (h("span", { class: "LinkSectionListLinkText" }, h("span", null, link.linkName))) :
|
|
63
|
-
h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })))))))
|
|
67
|
+
h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })))))));
|
|
68
|
+
return h("div", { class: "LinkSectionListContainer" }, h("div", { class: `LinkSectionListWrapper ${this.accordionLinks ? (this.isMobile ? "is-mobile" : "is-desktop") : ""}` }, this.repeaterContent.categoryTitle && h("h2", { class: "LinkSectionListTitle" }, this.repeaterContent.categoryTitle), linkSections.map(category => this.accordionLinks ?
|
|
69
|
+
(h("div", { class: "LinkSectionListDropdown" }, h("button", { type: 'button', class: `LinkSectionListDropdownHeader ${this.openCategory === category.categoryTitle ? 'IsOpen' : ''}`, onClick: () => this.toggleCategory(category.categoryTitle) }, category.categoryTitle, h("span", { class: this.isCategoryOpen(category.categoryTitle) ? 'TriangleActive' : 'TriangleInactive' }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "6.835", viewBox: "0 0 14 6.835" }, h("path", { id: "arrow", d: "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z", transform: "translate(-274.511 -441.088)" })))), h("ul", { class: { 'LinkSectionListDropdownList': true, open: this.isCategoryOpen(category.categoryTitle) } }, renderLinkItems(category)))) : (h("ul", null, category.categoryTitle && h("p", null, category.categoryTitle), renderLinkItems(category))))));
|
|
64
70
|
}
|
|
65
71
|
static get is() { return "link-section-list"; }
|
|
66
72
|
static get originalStyleUrls() {
|
|
@@ -162,7 +168,7 @@ export class LinkSectionList {
|
|
|
162
168
|
"reflect": true,
|
|
163
169
|
"defaultValue": "''"
|
|
164
170
|
},
|
|
165
|
-
"
|
|
171
|
+
"accordionLinks": {
|
|
166
172
|
"type": "boolean",
|
|
167
173
|
"mutable": false,
|
|
168
174
|
"complexType": {
|
|
@@ -176,7 +182,7 @@ export class LinkSectionList {
|
|
|
176
182
|
"tags": [],
|
|
177
183
|
"text": "If is true then this component will look like a dropdown"
|
|
178
184
|
},
|
|
179
|
-
"attribute": "
|
|
185
|
+
"attribute": "accordion-links",
|
|
180
186
|
"reflect": true,
|
|
181
187
|
"defaultValue": "false"
|
|
182
188
|
}
|
|
@@ -1,221 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-4b819858.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* custom rules for component types
|
|
5
|
-
*/
|
|
6
|
-
const getDevice = () => {
|
|
7
|
-
let userAgent = window.navigator.userAgent;
|
|
8
|
-
if (userAgent.toLowerCase().match(/android/i)) {
|
|
9
|
-
return 'Android';
|
|
10
|
-
}
|
|
11
|
-
if (userAgent.toLowerCase().match(/iphone/i)) {
|
|
12
|
-
return 'iPhone';
|
|
13
|
-
}
|
|
14
|
-
if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
|
|
15
|
-
return 'iPad';
|
|
16
|
-
}
|
|
17
|
-
return 'PC';
|
|
18
|
-
};
|
|
19
|
-
const getDevicePlatform = () => {
|
|
20
|
-
const device = getDevice();
|
|
21
|
-
if (device) {
|
|
22
|
-
if (device === 'PC') {
|
|
23
|
-
return 'dk';
|
|
24
|
-
}
|
|
25
|
-
else if (device === 'iPad' || device === 'iPhone') {
|
|
26
|
-
return 'ios';
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return 'mtWeb';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const componentRules = {
|
|
34
|
-
"downloadApp": {
|
|
35
|
-
component: 'custom-content-section'
|
|
36
|
-
},
|
|
37
|
-
"link-section": {
|
|
38
|
-
component: 'link-section-list'
|
|
39
|
-
},
|
|
40
|
-
"copyright": {
|
|
41
|
-
component: 'custom-content-section'
|
|
42
|
-
},
|
|
43
|
-
"download": {
|
|
44
|
-
component: 'custom-content-section'
|
|
45
|
-
},
|
|
46
|
-
"helpLinks": {
|
|
47
|
-
component: 'image-list'
|
|
48
|
-
},
|
|
49
|
-
"license-description": {
|
|
50
|
-
component: 'custom-content-section'
|
|
51
|
-
},
|
|
52
|
-
"licenses": {
|
|
53
|
-
component: 'image-list',
|
|
54
|
-
},
|
|
55
|
-
"payment": {
|
|
56
|
-
component: 'image-list',
|
|
57
|
-
},
|
|
58
|
-
"social": {
|
|
59
|
-
component: 'image-list',
|
|
60
|
-
},
|
|
61
|
-
"sponsors": {
|
|
62
|
-
component: 'image-list',
|
|
63
|
-
},
|
|
64
|
-
"vendors": {
|
|
65
|
-
component: 'image-list',
|
|
66
|
-
},
|
|
67
|
-
"clock": {
|
|
68
|
-
component: 'custom-clock',
|
|
69
|
-
},
|
|
70
|
-
"logo": {
|
|
71
|
-
component: 'footer-logo'
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
// This method takes repeater content and changes it to fit an uniform standard for property names in order to be treated in a general case by the footer
|
|
75
|
-
// ex. if helpLinks repeaters use "helpImage" and socialLinks repeaters use "socialImage", both will use "image" after the normalization
|
|
76
|
-
const normalizeRepeaterContent = (data) => {
|
|
77
|
-
const repeaterResponse = {
|
|
78
|
-
repeaters: {
|
|
79
|
-
vendors: {
|
|
80
|
-
categoryTitle: data.gameVendorsLinksTitle,
|
|
81
|
-
content: []
|
|
82
|
-
},
|
|
83
|
-
"link-section": {
|
|
84
|
-
categoryTitle: data.helpLinksTitle,
|
|
85
|
-
content: []
|
|
86
|
-
},
|
|
87
|
-
helpLinks: {
|
|
88
|
-
categoryTitle: data.helpLinksTitle,
|
|
89
|
-
content: []
|
|
90
|
-
},
|
|
91
|
-
licenses: {
|
|
92
|
-
categoryTitle: data.licensesLinksTitle,
|
|
93
|
-
content: []
|
|
94
|
-
},
|
|
95
|
-
sponsors: {
|
|
96
|
-
categoryTitle: data.sponsorsLinksTitle,
|
|
97
|
-
content: []
|
|
98
|
-
},
|
|
99
|
-
payment: {
|
|
100
|
-
categoryTitle: data.paymentLinksTitle,
|
|
101
|
-
content: []
|
|
102
|
-
},
|
|
103
|
-
social: {
|
|
104
|
-
categoryTitle: data.socialLinksTitle,
|
|
105
|
-
content: []
|
|
106
|
-
},
|
|
107
|
-
downloadApp: {
|
|
108
|
-
categoryTitle: data.downloadAppLinksTitle,
|
|
109
|
-
content: []
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
wysiwyg: {
|
|
113
|
-
copyright: {
|
|
114
|
-
categoryTitle: 'test',
|
|
115
|
-
content: 'test'
|
|
116
|
-
},
|
|
117
|
-
customCSS: {
|
|
118
|
-
categoryTitle: 'test',
|
|
119
|
-
content: 'test'
|
|
120
|
-
},
|
|
121
|
-
download: {
|
|
122
|
-
categoryTitle: 'test',
|
|
123
|
-
content: 'test'
|
|
124
|
-
},
|
|
125
|
-
downloadApp: {
|
|
126
|
-
categoryTitle: 'test',
|
|
127
|
-
content: 'test'
|
|
128
|
-
},
|
|
129
|
-
"license-description": {
|
|
130
|
-
categoryTitle: 'test',
|
|
131
|
-
content: 'test'
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const propertyNamesMap = {
|
|
136
|
-
helpLinks: {
|
|
137
|
-
repeaterName: 'helpLinksRepeater',
|
|
138
|
-
isExternalLink: 'helpLinkType',
|
|
139
|
-
image: 'helpLinkImage',
|
|
140
|
-
title: 'helpLinkTitle',
|
|
141
|
-
url: 'helpLinkUrl',
|
|
142
|
-
target: 'target'
|
|
143
|
-
},
|
|
144
|
-
"link-section": {
|
|
145
|
-
repeaterName: 'helpLinksRepeater',
|
|
146
|
-
isExternalLink: 'helpLinkType',
|
|
147
|
-
linkCategory: 'helpLinkCategory',
|
|
148
|
-
image: 'helpLinkImage',
|
|
149
|
-
title: 'helpLinkTitle',
|
|
150
|
-
url: 'helpLinkUrl',
|
|
151
|
-
target: 'target'
|
|
152
|
-
},
|
|
153
|
-
social: {
|
|
154
|
-
repeaterName: 'socialLinksRepeater',
|
|
155
|
-
isExternalLink: 'isExternalLink',
|
|
156
|
-
image: 'socialLinkImage',
|
|
157
|
-
title: 'socialLinkTitle',
|
|
158
|
-
url: 'socialLinkUrl',
|
|
159
|
-
target: 'target'
|
|
160
|
-
},
|
|
161
|
-
vendors: {
|
|
162
|
-
repeaterName: 'gameVendorsRepeater',
|
|
163
|
-
isExternalLink: 'isExternalLink',
|
|
164
|
-
image: 'gameVendorImage',
|
|
165
|
-
title: 'gameVendorTitle',
|
|
166
|
-
url: 'gameVendorUrl',
|
|
167
|
-
target: 'target'
|
|
168
|
-
},
|
|
169
|
-
licenses: {
|
|
170
|
-
repeaterName: 'licensesRepeater',
|
|
171
|
-
isExternalLink: 'isExternalLink',
|
|
172
|
-
image: 'licenseImage',
|
|
173
|
-
title: 'licenseTitle',
|
|
174
|
-
url: 'licenseUrl',
|
|
175
|
-
target: 'target'
|
|
176
|
-
},
|
|
177
|
-
payment: {
|
|
178
|
-
repeaterName: 'paymentMethodsRepeater',
|
|
179
|
-
isExternalLink: 'isExternalLink',
|
|
180
|
-
image: 'paymentMethodImage',
|
|
181
|
-
title: 'paymentTitle',
|
|
182
|
-
url: 'paymentMethodUrl',
|
|
183
|
-
target: 'target'
|
|
184
|
-
},
|
|
185
|
-
sponsors: {
|
|
186
|
-
repeaterName: 'sponsorsRepeater',
|
|
187
|
-
isExternalLink: 'isExternalLink',
|
|
188
|
-
image: 'sponsorImage',
|
|
189
|
-
title: 'sponsorTitle',
|
|
190
|
-
url: 'sponsorUrl',
|
|
191
|
-
target: 'target'
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
// this goes through all of the repeater content sections and uniformize their property names so that the footer can treat them generally instead of case-by-case
|
|
195
|
-
Object.entries(repeaterResponse.repeaters).forEach(repeater => {
|
|
196
|
-
var _a, _b, _c;
|
|
197
|
-
if (propertyNamesMap[repeater[0]] && data[(_a = propertyNamesMap[repeater[0]]) === null || _a === void 0 ? void 0 : _a.repeaterName]) {
|
|
198
|
-
repeater[1].content = (_c = data[(_b = propertyNamesMap[repeater[0]]) === null || _b === void 0 ? void 0 : _b.repeaterName]) === null || _c === void 0 ? void 0 : _c.map(content => {
|
|
199
|
-
var _a, _b, _c, _d, _e, _f;
|
|
200
|
-
return {
|
|
201
|
-
// all properties have a null fallback - avoid undefined propagation
|
|
202
|
-
isExternalLink: (_a = content[propertyNamesMap[repeater[0]].isExternalLink]) !== null && _a !== void 0 ? _a : null,
|
|
203
|
-
linkCategory: (_b = content[propertyNamesMap[repeater[0]].linkCategory]) !== null && _b !== void 0 ? _b : null,
|
|
204
|
-
image: (_c = content[propertyNamesMap[repeater[0]].image]) !== null && _c !== void 0 ? _c : null,
|
|
205
|
-
title: (_d = content[propertyNamesMap[repeater[0]].title]) !== null && _d !== void 0 ? _d : null,
|
|
206
|
-
url: (_e = content[propertyNamesMap[repeater[0]].url]) !== null && _e !== void 0 ? _e : null,
|
|
207
|
-
target: (_f = content[propertyNamesMap[repeater[0]].target]) !== null && _f !== void 0 ? _f : null,
|
|
208
|
-
};
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
repeaterResponse.repeaters.downloadApp.content = data.downloadInfos.imageArea || [];
|
|
213
|
-
repeaterResponse.wysiwyg.downloadApp.content = data.downloadInfos.downloadDescription || '';
|
|
214
|
-
repeaterResponse.wysiwyg.copyright.content = data.copyright;
|
|
215
|
-
repeaterResponse.wysiwyg.customCSS.content = data.customCSS;
|
|
216
|
-
repeaterResponse.wysiwyg["license-description"].content = data.licenseDesc;
|
|
217
|
-
return repeaterResponse;
|
|
218
|
-
};
|
|
2
|
+
import { g as getDevicePlatform, n as normalizeRepeaterContent, c as componentRules } from './utils-904e2462.js';
|
|
219
3
|
|
|
220
4
|
/**
|
|
221
5
|
* @name setClientStyling
|
|
@@ -302,7 +86,7 @@ const GeneralFooterTemplate = class {
|
|
|
302
86
|
this.clockFormat = 'HH:MM:ss';
|
|
303
87
|
this.timeZone = '';
|
|
304
88
|
this.mbSource = undefined;
|
|
305
|
-
this.
|
|
89
|
+
this.accordionLinks = false;
|
|
306
90
|
this.hasErrors = false;
|
|
307
91
|
this.footerContent = undefined;
|
|
308
92
|
}
|
|
@@ -366,7 +150,7 @@ const GeneralFooterTemplate = class {
|
|
|
366
150
|
const FooterElement = componentRules[section].component;
|
|
367
151
|
const elementIsRepeater = this.footerContent.repeaters.hasOwnProperty(section);
|
|
368
152
|
const elementIsCustom = this.footerContent.wysiwyg.hasOwnProperty(section);
|
|
369
|
-
return h(FooterElement, { class: `${section} FooterSectionContainer FooterSectionContainer${i + 1}`, userid: this.userid, session: this.session, "base-url": this.baseUrl, endpoint: this.endpoint, language: this.language, "navigate-via-event": this.navigateViaEvent, "post-message-event": this.postMessageEvent, ruleset: componentRules[section], repeaterContent: elementIsRepeater ? this.footerContent.repeaters[section] : null, customContent: elementIsCustom ? this.footerContent.wysiwyg[section].content : null, "translation-url": this.translationUrl, "clock-format": this.clockFormat, "time-zone": this.timeZone, "
|
|
153
|
+
return h(FooterElement, { class: `${section} FooterSectionContainer FooterSectionContainer${i + 1}`, userid: this.userid, session: this.session, "base-url": this.baseUrl, endpoint: this.endpoint, language: this.language, "navigate-via-event": this.navigateViaEvent, "post-message-event": this.postMessageEvent, ruleset: componentRules[section], repeaterContent: elementIsRepeater ? this.footerContent.repeaters[section] : null, customContent: elementIsCustom ? this.footerContent.wysiwyg[section].content : null, "translation-url": this.translationUrl, "clock-format": this.clockFormat, "time-zone": this.timeZone, "accordion-links": this.accordionLinks });
|
|
370
154
|
});
|
|
371
155
|
return (h("footer", { class: "FooterContainer", ref: el => this.stylingContainer = el }, h("div", { class: "FooterGrid customStyle" }, footerSections)));
|
|
372
156
|
}
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["custom-content-section",[[2,"custom-content-section",{"customContent":[1,"custom-content"],"repeaterContent":[8,"repeater-content"],"navigateViaEvent":[516,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"]}]]],["link-section-list",[[0,"link-section-list",{"repeaterContent":[8,"repeater-content"],"baseUrl":[513,"base-url"],"language":[513],"navigateViaEvent":[4,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"],"
|
|
19
|
+
return bootstrapLazy([["custom-content-section",[[2,"custom-content-section",{"customContent":[1,"custom-content"],"repeaterContent":[8,"repeater-content"],"navigateViaEvent":[516,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"]}]]],["link-section-list",[[0,"link-section-list",{"repeaterContent":[8,"repeater-content"],"baseUrl":[513,"base-url"],"language":[513],"navigateViaEvent":[4,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"],"accordionLinks":[516,"accordion-links"],"openCategory":[32]}]]],["custom-clock",[[2,"custom-clock",{"clockFormat":[513,"clock-format"],"timeZone":[513,"time-zone"],"translationUrl":[513,"translation-url"],"language":[513],"timeString":[32]},null,{"translationUrl":["handleNewTranslations"]}]]],["footer-logo",[[2,"footer-logo",{"endpoint":[513],"language":[513],"logoContent":[32]},null,{"endpoint":["onConfigChange"],"language":["onConfigChange"]}]]],["general-footer-template",[[1,"general-footer-template",{"language":[513],"sections":[513],"endpoint":[513],"env":[513],"userRoles":[513,"user-roles"],"userid":[513],"session":[513],"baseUrl":[513,"base-url"],"navigateViaEvent":[513,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"customCss":[513,"custom-css"],"translationUrl":[513,"translation-url"],"clockFormat":[513,"clock-format"],"timeZone":[513,"time-zone"],"mbSource":[513,"mb-source"],"accordionLinks":[516,"accordion-links"],"hasErrors":[32],"footerContent":[32]},null,{"language":["watchLanguage"]}]]],["ui-image_2",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]],["image-list",[[2,"image-list",{"repeaterContent":[8,"repeater-content"],"navigateViaEvent":[4,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h } from './index-4b819858.js';
|
|
2
|
+
import { i as isMobile } from './utils-904e2462.js';
|
|
2
3
|
|
|
3
4
|
const linkSectionListCss = ":host {\n display: block;\n margin: 0;\n padding: 0;\n}\n\n.SkeletonWrapper {\n width: 25px;\n height: 25px;\n}\n\n.LinkSectionListContainer {\n display: block;\n container-type: inline-size;\n}\n.LinkSectionListWrapper {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n grid-template-columns: 1fr;\n}\n.LinkSectionListTitle {\n font-weight: var(--emw--font-weight-semibold, 500);\n text-transform: uppercase;\n}\n.LinkSectionListDropdownHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n background: var(--emw--color-primary, #184026);\n color: var(--emw--color-typography, #FFFFFF);\n text-align: left;\n padding: 10px;\n border: none;\n border-radius: var(--emw--button-border-radius, 4px);\n margin-bottom: 3px;\n cursor: pointer;\n font-size: 1rem;\n}\n.LinkSectionListDropdownHeader:hover {\n color: var(--emw--color-secondary, #52d004);\n}\n.LinkSectionListDropdownHeader:hover svg {\n fill: var(--emw--color-secondary, #52d004);\n}\n.LinkSectionListDropdownHeader.IsOpen {\n color: var(--emw--color-secondary, #52d004);\n}\n.LinkSectionListDropdownHeader.IsOpen svg {\n fill: var(--emw--color-secondary, #52d004);\n}\n.LinkSectionListDropdownHeader .TriangleActive {\n transform: rotate(90deg);\n -webkit-transform: rotate(90deg);\n}\n.LinkSectionListDropdownHeader svg {\n fill: var(--emw--color-typography, #FFFFFF);\n margin-left: 8px;\n width: 16px;\n transform: rotate(-90deg);\n -webkit-transform: rotate(-90deg);\n}\n.LinkSectionListDropdownList {\n list-style: none;\n display: none;\n}\n.LinkSectionListDropdownList.open {\n display: flex;\n margin: 5px 0;\n}\n.LinkSectionListLink {\n font-weight: var(--emw--font-weight-light, 300);\n}\n\nul {\n width: fit-content;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: var(--emw--spacing-medium, 16px);\n padding-left: var(--emw--spacing-small-minus, 10px);\n font-size: var(--emw--font-size-small, 16px);\n text-transform: uppercase;\n}\nul li {\n list-style: disc;\n display: flex;\n align-items: center;\n position: relative;\n}\nul li .LinkSectionListLinkText {\n display: flex;\n gap: 5px;\n flex-direction: row;\n align-items: center;\n}\nul li .LinkSectionListLinkText span {\n text-align: center;\n cursor: pointer;\n}\n\na {\n color: inherit;\n}\n\n@container (min-width: 280px) {\n .LinkSectionListWrapper {\n grid-template-columns: repeat(2, 1fr);\n }\n}\n@container (min-width: 650px) {\n .LinkSectionListWrapper {\n grid-gap: 2rem;\n grid-template-columns: repeat(4, 1fr);\n grid-template-rows: 1fr;\n }\n}";
|
|
4
5
|
const LinkSectionListStyle0 = linkSectionListCss;
|
|
@@ -6,19 +7,28 @@ const LinkSectionListStyle0 = linkSectionListCss;
|
|
|
6
7
|
const LinkSectionList = class {
|
|
7
8
|
constructor(hostRef) {
|
|
8
9
|
registerInstance(this, hostRef);
|
|
10
|
+
this.isMobile = isMobile();
|
|
9
11
|
this.repeaterContent = undefined;
|
|
10
12
|
this.baseUrl = undefined;
|
|
11
13
|
this.language = undefined;
|
|
12
14
|
this.navigateViaEvent = false;
|
|
13
15
|
this.postMessageEvent = '';
|
|
14
|
-
this.
|
|
16
|
+
this.accordionLinks = false;
|
|
15
17
|
this.openCategory = null;
|
|
16
18
|
}
|
|
17
19
|
navigateLink(link) {
|
|
18
20
|
window.postMessage({ type: this.postMessageEvent, path: link.linkUrl, url: link.linkUrl, target: link.target, externalLink: link.externalLink }, window.location.href);
|
|
19
21
|
}
|
|
20
|
-
toggleCategory(
|
|
21
|
-
|
|
22
|
+
toggleCategory(category) {
|
|
23
|
+
if (!this.isMobile)
|
|
24
|
+
return;
|
|
25
|
+
this.openCategory = this.openCategory === category ? null : category;
|
|
26
|
+
}
|
|
27
|
+
isCategoryOpen(category) {
|
|
28
|
+
if (this.isMobile) {
|
|
29
|
+
return this.openCategory === category;
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
22
32
|
}
|
|
23
33
|
createHrefLink(link) {
|
|
24
34
|
return link.externalLink ? link.linkUrl : `${this.baseUrl}/${this.language}${link.linkUrl}`;
|
|
@@ -52,19 +62,15 @@ const LinkSectionList = class {
|
|
|
52
62
|
}
|
|
53
63
|
return obj;
|
|
54
64
|
}, []);
|
|
55
|
-
|
|
56
|
-
link.linkName ?
|
|
57
|
-
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("span", null, link.linkName, " "))
|
|
58
|
-
:
|
|
59
|
-
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" }))))) : (h("a", { class: "LinkSectionListLink", href: this.createHrefLink(link), target: link.target || '_blank' }, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", null, link.linkName))) :
|
|
60
|
-
link.linkName ? (h("span", { class: "LinkSectionListLinkText" }, h("span", null, link.linkName))) :
|
|
61
|
-
h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })))))))))) : (h("ul", null, category.categoryTitle && h("p", null, category.categoryTitle), category.links.map(link => h("li", { class: "LinkSectionListLink", key: link.linkName }, this.navigateViaEvent === true ? (h("span", null, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", { class: '' }, link.linkName, " "))) :
|
|
65
|
+
const renderLinkItems = (category) => category.links.map(link => h("li", { class: "LinkSectionListLink", key: link.linkName }, this.navigateViaEvent === true ? (h("span", null, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", { class: '' }, link.linkName, " "))) :
|
|
62
66
|
link.linkName ?
|
|
63
67
|
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("span", null, link.linkName, " "))
|
|
64
68
|
:
|
|
65
69
|
h("span", { class: "LinkSectionListLinkText", onClick: () => this.navigateLink(link) }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" }))))) : (h("a", { class: "LinkSectionListLink", href: this.createHrefLink(link), target: link.target || '_blank' }, link.linkName && link.icon ? (h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })), h("span", null, link.linkName))) :
|
|
66
70
|
link.linkName ? (h("span", { class: "LinkSectionListLinkText" }, h("span", null, link.linkName))) :
|
|
67
|
-
h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })))))))
|
|
71
|
+
h("span", { class: "LinkSectionListLinkText" }, h("div", { class: "ContainerImage" }, h("ui-image", { class: "LinkSectionIcon", src: link.icon, alt: "icon" })))))));
|
|
72
|
+
return h("div", { class: "LinkSectionListContainer" }, h("div", { class: `LinkSectionListWrapper ${this.accordionLinks ? (this.isMobile ? "is-mobile" : "is-desktop") : ""}` }, this.repeaterContent.categoryTitle && h("h2", { class: "LinkSectionListTitle" }, this.repeaterContent.categoryTitle), linkSections.map(category => this.accordionLinks ?
|
|
73
|
+
(h("div", { class: "LinkSectionListDropdown" }, h("button", { type: 'button', class: `LinkSectionListDropdownHeader ${this.openCategory === category.categoryTitle ? 'IsOpen' : ''}`, onClick: () => this.toggleCategory(category.categoryTitle) }, category.categoryTitle, h("span", { class: this.isCategoryOpen(category.categoryTitle) ? 'TriangleActive' : 'TriangleInactive' }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "6.835", viewBox: "0 0 14 6.835" }, h("path", { id: "arrow", d: "M281.541,447.921a.488.488,0,0,0,.295-.122l6.5-5.851a.488.488,0,1,0-.65-.726l-6.176,5.556-6.176-5.556h0a.488.488,0,1,0-.65.726l6.5,5.851a.488.488,0,0,0,.355.122Z", transform: "translate(-274.511 -441.088)" })))), h("ul", { class: { 'LinkSectionListDropdownList': true, open: this.isCategoryOpen(category.categoryTitle) } }, renderLinkItems(category)))) : (h("ul", null, category.categoryTitle && h("p", null, category.categoryTitle), renderLinkItems(category))))));
|
|
68
74
|
}
|
|
69
75
|
};
|
|
70
76
|
LinkSectionList.style = LinkSectionListStyle0;
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["custom-content-section",[[2,"custom-content-section",{"customContent":[1,"custom-content"],"repeaterContent":[8,"repeater-content"],"navigateViaEvent":[516,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"]}]]],["link-section-list",[[0,"link-section-list",{"repeaterContent":[8,"repeater-content"],"baseUrl":[513,"base-url"],"language":[513],"navigateViaEvent":[4,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"],"
|
|
8
|
+
return bootstrapLazy([["custom-content-section",[[2,"custom-content-section",{"customContent":[1,"custom-content"],"repeaterContent":[8,"repeater-content"],"navigateViaEvent":[516,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"]}]]],["link-section-list",[[0,"link-section-list",{"repeaterContent":[8,"repeater-content"],"baseUrl":[513,"base-url"],"language":[513],"navigateViaEvent":[4,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"],"accordionLinks":[516,"accordion-links"],"openCategory":[32]}]]],["custom-clock",[[2,"custom-clock",{"clockFormat":[513,"clock-format"],"timeZone":[513,"time-zone"],"translationUrl":[513,"translation-url"],"language":[513],"timeString":[32]},null,{"translationUrl":["handleNewTranslations"]}]]],["footer-logo",[[2,"footer-logo",{"endpoint":[513],"language":[513],"logoContent":[32]},null,{"endpoint":["onConfigChange"],"language":["onConfigChange"]}]]],["general-footer-template",[[1,"general-footer-template",{"language":[513],"sections":[513],"endpoint":[513],"env":[513],"userRoles":[513,"user-roles"],"userid":[513],"session":[513],"baseUrl":[513,"base-url"],"navigateViaEvent":[513,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"customCss":[513,"custom-css"],"translationUrl":[513,"translation-url"],"clockFormat":[513,"clock-format"],"timeZone":[513,"time-zone"],"mbSource":[513,"mb-source"],"accordionLinks":[516,"accordion-links"],"hasErrors":[32],"footerContent":[32]},null,{"language":["watchLanguage"]}]]],["ui-image_2",[[0,"ui-image",{"src":[1],"width":[1],"height":[1],"alt":[1],"styles":[8],"detectDistance":[1,"detect-distance"],"imgLoaded":[32],"shouldLoad":[32]},null,{"src":["handleSrc"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]],["image-list",[[2,"image-list",{"repeaterContent":[8,"repeater-content"],"navigateViaEvent":[4,"navigate-via-event"],"postMessageEvent":[513,"post-message-event"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|