@tet/tet-components 1.4.16-testing → 1.4.17-testing
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/loader.cjs.js +1 -1
- package/dist/cjs/tet-b2b-check-out-form_5.cjs.entry.js +32 -11
- package/dist/cjs/tet-components.cjs.js +1 -1
- package/dist/cjs/tet-dynamic-card.cjs.entry.js +42 -62
- package/dist/collection/components/advanced/cards/tet-dynamic-card/tet-dynamic-card.css +0 -1
- package/dist/collection/components/advanced/cards/tet-dynamic-card/tet-dynamic-card.js +41 -61
- package/dist/collection/components/simple/menu/tet-business-navigation/tet-business-navigation.js +33 -12
- package/dist/components/{p-57c05c8d.js → p-92c98bea.js} +33 -12
- package/dist/components/tet-b2b-configurator.js +1 -1
- package/dist/components/tet-business-navigation.js +1 -1
- package/dist/components/tet-dynamic-card.js +42 -62
- package/dist/esm/loader.js +1 -1
- package/dist/esm/tet-b2b-check-out-form_5.entry.js +32 -11
- package/dist/esm/tet-components.js +1 -1
- package/dist/esm/tet-dynamic-card.entry.js +42 -62
- package/dist/tet-components/{p-79d1e8db.entry.js → p-0246b34b.entry.js} +1 -1
- package/dist/tet-components/p-e05e8cad.entry.js +1 -0
- package/dist/tet-components/tet-components.esm.js +1 -1
- package/dist/types/components/advanced/cards/tet-dynamic-card/tet-dynamic-card.d.ts +1 -1
- package/dist/types/components/simple/menu/tet-business-navigation/tet-business-navigation.d.ts +4 -2
- package/package.json +1 -1
- package/dist/tet-components/p-1935d974.entry.js +0 -1
|
@@ -58,14 +58,15 @@ export class TetDynamicCard {
|
|
|
58
58
|
rootElementRef = null;
|
|
59
59
|
BREAKPOINTS = {
|
|
60
60
|
MOBILE: 768,
|
|
61
|
+
TABLET_SMALL: 1024,
|
|
61
62
|
TABLET: 1440,
|
|
62
63
|
DESKTOP: 1920
|
|
63
64
|
};
|
|
64
65
|
CARD_SIZES = {
|
|
65
66
|
standard: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
S: 'fit-content',
|
|
68
|
+
M: 'calc(50% - 0.75rem)',
|
|
69
|
+
XL: '100%'
|
|
69
70
|
},
|
|
70
71
|
responsive: {
|
|
71
72
|
mobile: '100%',
|
|
@@ -74,27 +75,13 @@ export class TetDynamicCard {
|
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
getCardSize(width) {
|
|
77
|
-
if (this.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
else {
|
|
85
|
-
return this.originalSize;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else if (this.originalSize === 'M') {
|
|
89
|
-
if (width < this.BREAKPOINTS.MOBILE) {
|
|
90
|
-
return (this.sizeChangeBreakpoint === 'Mob' || this.sizeChangeBreakpoint === 'Tab') ? 'S' : 'XL';
|
|
91
|
-
}
|
|
92
|
-
else if (width < this.BREAKPOINTS.TABLET) {
|
|
93
|
-
return this.sizeChangeBreakpoint === 'Tab' ? 'S' : this.originalSize;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
return this.originalSize;
|
|
97
|
-
}
|
|
78
|
+
if (width < this.BREAKPOINTS.MOBILE)
|
|
79
|
+
return 'XL';
|
|
80
|
+
if (width < this.BREAKPOINTS.TABLET_SMALL)
|
|
81
|
+
return 'M';
|
|
82
|
+
const isAdaptiveSize = this.originalSize === 'L' || this.originalSize === 'M';
|
|
83
|
+
if (isAdaptiveSize && width < this.BREAKPOINTS.TABLET) {
|
|
84
|
+
return this.sizeChangeBreakpoint === 'Tab' ? 'S' : this.originalSize;
|
|
98
85
|
}
|
|
99
86
|
return this.originalSize;
|
|
100
87
|
}
|
|
@@ -113,36 +100,21 @@ export class TetDynamicCard {
|
|
|
113
100
|
}
|
|
114
101
|
}
|
|
115
102
|
getCardWidth(size, width) {
|
|
116
|
-
if (this.isInCarousel)
|
|
103
|
+
if (this.isInCarousel)
|
|
117
104
|
return 'fit-content';
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
// Special handling
|
|
125
|
-
if (size === 'L' || size === 'M') {
|
|
126
|
-
return this.CARD_SIZES.responsive.mobile;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else if (width < this.BREAKPOINTS.TABLET) {
|
|
130
|
-
if (adaptiveSize && this.sizeChangeBreakpoint === 'Tab') {
|
|
105
|
+
if (width < this.BREAKPOINTS.MOBILE)
|
|
106
|
+
return this.CARD_SIZES.responsive.mobile;
|
|
107
|
+
const isAdaptiveSize = this.originalSize === 'L' || this.originalSize === 'M';
|
|
108
|
+
if (width < this.BREAKPOINTS.TABLET) {
|
|
109
|
+
if (isAdaptiveSize && this.sizeChangeBreakpoint === 'Tab')
|
|
131
110
|
return 'fit-content';
|
|
132
|
-
|
|
133
|
-
|
|
111
|
+
if (size === 'M')
|
|
112
|
+
return this.CARD_SIZES.standard.M;
|
|
113
|
+
if (size === 'L')
|
|
134
114
|
return this.CARD_SIZES.responsive.tablet;
|
|
135
|
-
}
|
|
136
115
|
}
|
|
137
|
-
else if (
|
|
138
|
-
|
|
139
|
-
return this.CARD_SIZES.responsive.tablet;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
if (size === 'L') {
|
|
144
|
-
return this.CARD_SIZES.responsive.desktop;
|
|
145
|
-
}
|
|
116
|
+
else if (size === 'L') {
|
|
117
|
+
return width < this.BREAKPOINTS.DESKTOP ? this.CARD_SIZES.responsive.tablet : this.CARD_SIZES.responsive.desktop;
|
|
146
118
|
}
|
|
147
119
|
return this.CARD_SIZES.standard[size] || 'fit-content';
|
|
148
120
|
}
|
|
@@ -177,7 +149,7 @@ export class TetDynamicCard {
|
|
|
177
149
|
}
|
|
178
150
|
handleClick = (event) => {
|
|
179
151
|
const path = event.composedPath();
|
|
180
|
-
const isButtonClick = path.some(el => el instanceof HTMLElement && el.classList?.contains('button'));
|
|
152
|
+
const isButtonClick = path.some((el) => el instanceof HTMLElement && el.classList?.contains('button'));
|
|
181
153
|
if (!isButtonClick) {
|
|
182
154
|
if (this.buttonRef && this.linkHref) {
|
|
183
155
|
const button = this.buttonRef.shadowRoot?.querySelector('button');
|
|
@@ -192,31 +164,39 @@ export class TetDynamicCard {
|
|
|
192
164
|
};
|
|
193
165
|
renderTags() {
|
|
194
166
|
const dateTagColor = this.theme === 'dark' ? this.dateTagColorDark : this.dateTagColorLight;
|
|
195
|
-
return (h("div", { class: "tags-container", part: "tags" }, this.tags?.length > 0 && (h("div", { class: "tags" }, this.tags.map(tag => (h("span", { class: "tag" }, tag))))), this.dateTag && (h("div", { class: "tags" }, h("div", { class: `tag colored colored--${dateTagColor}`, ref: (elm) => {
|
|
167
|
+
return (h("div", { class: "tags-container", part: "tags" }, this.tags?.length > 0 && (h("div", { class: "tags" }, this.tags.map((tag) => (h("span", { class: "tag" }, tag))))), this.dateTag && (h("div", { class: "tags" }, h("div", { class: `tag colored colored--${dateTagColor}`, ref: (elm) => {
|
|
168
|
+
this.dateTagColorRef = elm;
|
|
169
|
+
} }, h("span", { class: "date-tag-text" }, this.dateTag))))));
|
|
196
170
|
}
|
|
197
171
|
renderPrice() {
|
|
198
172
|
if (!this.priceTagOptions?.show)
|
|
199
173
|
return null;
|
|
200
|
-
return (h("div", { class: "price", part: "price" }, h("tet-price-view", { ref: elm => {
|
|
174
|
+
return (h("div", { class: "price", part: "price" }, h("tet-price-view", { ref: (elm) => {
|
|
175
|
+
this.priceViewRef = elm;
|
|
176
|
+
}, font: this.priceTagOptions.font || 'Gilroy, Arial, sans-serif', background: this.priceTagOptions.background, staticColors: this.priceTagOptions.isStatic, theme: this.theme, size: "S", "heading-text": this.priceTagOptions.headingText, "price-type": this.priceTagOptions.priceType, "euro-price": this.priceTagOptions.euroPrice?.toString(), "cents-price": this.priceTagOptions.centsPrice?.toString(), "footer-text": this.priceTagOptions.footerText, "footer-text-type": this.priceTagOptions.footerTextType })));
|
|
201
177
|
}
|
|
202
178
|
renderButton() {
|
|
203
179
|
if (!this.linkText)
|
|
204
180
|
return null;
|
|
205
181
|
const buttonProps = {
|
|
206
|
-
type: 'primary',
|
|
207
|
-
size: 'small',
|
|
208
|
-
theme: this.theme,
|
|
209
|
-
url: this.linkHref,
|
|
182
|
+
'type': 'primary',
|
|
183
|
+
'size': 'small',
|
|
184
|
+
'theme': this.theme,
|
|
185
|
+
'url': this.linkHref,
|
|
210
186
|
'url-target': this.linkNewTab ? '_blank' : '_self',
|
|
211
187
|
'accessibility-label': this.linkText
|
|
212
188
|
};
|
|
213
|
-
return (h("div", { class: "button", part: "button" }, h("tet-button", { ...buttonProps, ref: elm => {
|
|
189
|
+
return (h("div", { class: "button", part: "button" }, h("tet-button", { ...buttonProps, ref: (elm) => {
|
|
190
|
+
this.buttonRef = elm;
|
|
191
|
+
} }, this.linkText)));
|
|
214
192
|
}
|
|
215
193
|
render() {
|
|
216
|
-
return (h(Host, { key: '
|
|
194
|
+
return (h(Host, { key: 'e835560322a1509753b6391ff1148137f2669395', class: {
|
|
217
195
|
'dynamic-card': true,
|
|
218
196
|
'is-focused': this.isFocused
|
|
219
|
-
}, "data-index": this.index, ref: (elm) => {
|
|
197
|
+
}, "data-index": this.index, ref: (elm) => {
|
|
198
|
+
this.rootElementRef = elm;
|
|
199
|
+
} }, h("div", { key: '9155b5ea0293ef39c54f8d66c0df6c2931cf3d52', class: `card
|
|
220
200
|
theme-${this.theme}
|
|
221
201
|
size-${this.currentSize}
|
|
222
202
|
position-${this.pictureLayoutShiftPosition}
|
|
@@ -224,7 +204,7 @@ export class TetDynamicCard {
|
|
|
224
204
|
`, onClick: this.handleClick, onKeyUp: (event) => {
|
|
225
205
|
if (event.key === 'Enter')
|
|
226
206
|
this.handleClick(event);
|
|
227
|
-
}, tabindex: 0, part: "card", "aria-labelledby": this.cardTitle }, h("div", { key: '
|
|
207
|
+
}, tabindex: 0, part: "card", "aria-labelledby": this.cardTitle }, h("div", { key: '6923cd94ffceae462b08d99e82a9c3f0dae21f84', class: "image", part: "image" }, h("slot", { key: '4fe4f5e2c4edffb8229073f6cf59a0c4cac6fc43', name: "image" }), this.renderPrice(), this.renderTags()), h("div", { key: '2fda1db6c8b3828caf41e20aab7e09033581e007', class: "content-container" }, h("div", { key: '5b5c81bd36839cd84ea23f2872007026e24b957e', class: "content", part: "content" }, this.cardTitle && (h("h3", { key: '6b52cd192997cd9bbbab8ff4d9c19e31ead757c9', class: "title", part: "title" }, this.cardTitle)), this.subtitle && (h("p", { key: '2dd27ca9c13653ef5542950307fdd4583dd67fb9', class: "subtitle", part: "subtitle" }, this.subtitle))), this.renderButton()))));
|
|
228
208
|
}
|
|
229
209
|
static get is() { return "tet-dynamic-card"; }
|
|
230
210
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/simple/menu/tet-business-navigation/tet-business-navigation.js
CHANGED
|
@@ -11,7 +11,7 @@ export class TetBusinessNavigation {
|
|
|
11
11
|
this.mainMenuItemId = undefined;
|
|
12
12
|
this.positions = { scrollLeft: 0, mouseX: 0 };
|
|
13
13
|
this.expanded = true;
|
|
14
|
-
this.
|
|
14
|
+
this.openedMenuIds = new Set();
|
|
15
15
|
}
|
|
16
16
|
navigationContainer;
|
|
17
17
|
isPointerDown;
|
|
@@ -21,8 +21,7 @@ export class TetBusinessNavigation {
|
|
|
21
21
|
if (!this.menuItems || this.menuItems.length === 0) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
this.
|
|
25
|
-
this.mainMenuItemId = this.selectedItemId;
|
|
24
|
+
this.handleNavInitialState();
|
|
26
25
|
processTranslations('tet-components', this.language || 'lv').then(() => forceUpdate(this));
|
|
27
26
|
}
|
|
28
27
|
/** Method to run on menu item selection */
|
|
@@ -35,6 +34,27 @@ export class TetBusinessNavigation {
|
|
|
35
34
|
localStorage.setItem('selectedSublevelId', JSON.stringify(mainMenuId ? id : ''));
|
|
36
35
|
this.menuClickEvent.emit({ id });
|
|
37
36
|
}
|
|
37
|
+
/** Sets the initial selected and open state for the navigation menu based on selected main or sublevel items. */
|
|
38
|
+
handleNavInitialState() {
|
|
39
|
+
this.mainMenuItemId = this.menuItems[0].id;
|
|
40
|
+
this.selectedItemId = this.menuItems[0].id;
|
|
41
|
+
const selectedMainItem = this.menuItems.find((item) => item.selected)?.id;
|
|
42
|
+
if (selectedMainItem) {
|
|
43
|
+
this.mainMenuItemId = selectedMainItem;
|
|
44
|
+
this.selectedItemId = selectedMainItem;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
for (const item of this.menuItems) {
|
|
48
|
+
const selectedSub = (item.sublevels || []).find((sub) => sub.selected);
|
|
49
|
+
if (selectedSub) {
|
|
50
|
+
this.selectedItemId = selectedSub.id;
|
|
51
|
+
this.mainMenuItemId = item.id;
|
|
52
|
+
this.openedMenuIds = new Set([item.id]);
|
|
53
|
+
localStorage.setItem('selectedSublevelId', JSON.stringify(selectedSub.id));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
38
58
|
/**
|
|
39
59
|
* Initialises the mouse drag.
|
|
40
60
|
* @param {MouseEvent} event Current mouse event.
|
|
@@ -77,12 +97,11 @@ export class TetBusinessNavigation {
|
|
|
77
97
|
toggleMenu = (e) => {
|
|
78
98
|
e.preventDefault();
|
|
79
99
|
if (this.expanded) {
|
|
80
|
-
this.selectedItemId = this.mainMenuItemId
|
|
100
|
+
this.selectedItemId = this.mainMenuItemId;
|
|
81
101
|
}
|
|
82
102
|
else {
|
|
83
103
|
const sublevelId = Number(localStorage.getItem('selectedSublevelId'));
|
|
84
|
-
this.selectedItemId = sublevelId
|
|
85
|
-
this.sublevelsOpened = sublevelId > 0;
|
|
104
|
+
this.selectedItemId = sublevelId || this.mainMenuItemId;
|
|
86
105
|
}
|
|
87
106
|
this.expanded = !this.expanded;
|
|
88
107
|
};
|
|
@@ -91,12 +110,14 @@ export class TetBusinessNavigation {
|
|
|
91
110
|
if (this.selectedItemId !== id) {
|
|
92
111
|
this.selectedItemId = id;
|
|
93
112
|
}
|
|
94
|
-
|
|
113
|
+
const newSet = new Set(this.openedMenuIds);
|
|
114
|
+
newSet.has(id) ? newSet.delete(id) : newSet.add(id);
|
|
115
|
+
this.openedMenuIds = newSet;
|
|
95
116
|
localStorage.setItem('selectedSublevelId', JSON.stringify(''));
|
|
96
117
|
};
|
|
97
118
|
/** Render second menu level */
|
|
98
119
|
renderSublevelItems = (sublevels, id) => {
|
|
99
|
-
if (!this.
|
|
120
|
+
if (!this.openedMenuIds.has(id)) {
|
|
100
121
|
return null;
|
|
101
122
|
}
|
|
102
123
|
const renderSublevelItem = sublevels.map((item) => (h("button", { class: { 'business-navigation-item': true, 'sublevel': true, 'selected': this.selectedItemId === item.id }, key: item.id, onClick: () => this.selectMenuItem(item.id, id) }, h("span", { class: { 'business-navigation-item__title': true, 'sublevel': true } }, item.name))));
|
|
@@ -105,9 +126,9 @@ export class TetBusinessNavigation {
|
|
|
105
126
|
/** Render menu item */
|
|
106
127
|
renderMenuItem = (menuItem) => {
|
|
107
128
|
const { id, icon, name, sublevels } = menuItem;
|
|
108
|
-
const { expanded,
|
|
129
|
+
const { expanded, openedMenuIds } = this;
|
|
109
130
|
const withSublevels = expanded && sublevels && sublevels.length > 0;
|
|
110
|
-
return (h("div", { class: "business-navigation-item__wrapper" }, h("button", { key: id, class: { 'business-navigation-item': true, 'selected': this.selectedItemId === id }, onClick: () => (withSublevels ? this.toggleSublevels(id) : this.selectMenuItem(id)), "aria-label": name }, icon && h("tet-icon", { class: "business-navigation-item__icon", name: icon }), !this.expandable || expanded ? (h("span", { class: "business-navigation-item__title" }, name)) : (h("tet-tooltip", { class: "business-navigation-item__tooltip", position: TooltipPosition.RIGHT, theme: this.theme }, name)), withSublevels && (h("tet-icon", { class: { 'business-navigation-item__chevron': true, 'sublevelOpened':
|
|
131
|
+
return (h("div", { class: "business-navigation-item__wrapper" }, h("button", { key: id, class: { 'business-navigation-item': true, 'selected': this.selectedItemId === id }, onClick: () => (withSublevels ? this.toggleSublevels(id) : this.selectMenuItem(id)), "aria-label": name }, icon && h("tet-icon", { class: "business-navigation-item__icon", name: icon }), !this.expandable || expanded ? (h("span", { class: "business-navigation-item__title" }, name)) : (h("tet-tooltip", { class: "business-navigation-item__tooltip", position: TooltipPosition.RIGHT, theme: this.theme }, name)), withSublevels && (h("tet-icon", { class: { 'business-navigation-item__chevron': true, 'sublevelOpened': openedMenuIds.has(id) }, name: openedMenuIds.has(id) ? 'chevron-up' : 'chevron-down' }))), withSublevels && this.renderSublevelItems(sublevels, id)));
|
|
111
132
|
};
|
|
112
133
|
/** Render button to expand and minimize the menu container. */
|
|
113
134
|
renderExpandButton = () => {
|
|
@@ -119,7 +140,7 @@ export class TetBusinessNavigation {
|
|
|
119
140
|
/** Render Functional Component*/
|
|
120
141
|
render() {
|
|
121
142
|
const { menuItems, theme, expandable } = this;
|
|
122
|
-
return (h("div", { key: '
|
|
143
|
+
return (h("div", { key: '7d9c836c1d13e3b7d010946a9ba7e772a1f41987', class: { 'business-navigation': true, [`${theme}`]: true, 'expandable': expandable, 'closed': !this.expanded }, role: "group", onMouseDown: this.onContainerMouseDown, ref: (ref) => (this.navigationContainer = ref) }, this.renderExpandButton(), expandable && h("hr", { key: 'e1dfb7594222452bd8cd2cad8bbfe5e80cefff0e', class: "business-navigation-divider" }), menuItems && menuItems.map(this.renderMenuItem)));
|
|
123
144
|
}
|
|
124
145
|
static get is() { return "tet-business-navigation"; }
|
|
125
146
|
static get encapsulation() { return "shadow"; }
|
|
@@ -228,7 +249,7 @@ export class TetBusinessNavigation {
|
|
|
228
249
|
"mainMenuItemId": {},
|
|
229
250
|
"positions": {},
|
|
230
251
|
"expanded": {},
|
|
231
|
-
"
|
|
252
|
+
"openedMenuIds": {}
|
|
232
253
|
};
|
|
233
254
|
}
|
|
234
255
|
static get events() {
|
|
@@ -20,7 +20,7 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
20
20
|
this.mainMenuItemId = undefined;
|
|
21
21
|
this.positions = { scrollLeft: 0, mouseX: 0 };
|
|
22
22
|
this.expanded = true;
|
|
23
|
-
this.
|
|
23
|
+
this.openedMenuIds = new Set();
|
|
24
24
|
}
|
|
25
25
|
navigationContainer;
|
|
26
26
|
isPointerDown;
|
|
@@ -30,8 +30,7 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
30
30
|
if (!this.menuItems || this.menuItems.length === 0) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
this.
|
|
34
|
-
this.mainMenuItemId = this.selectedItemId;
|
|
33
|
+
this.handleNavInitialState();
|
|
35
34
|
processTranslations('tet-components', this.language || 'lv').then(() => forceUpdate(this));
|
|
36
35
|
}
|
|
37
36
|
/** Method to run on menu item selection */
|
|
@@ -44,6 +43,27 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
44
43
|
localStorage.setItem('selectedSublevelId', JSON.stringify(mainMenuId ? id : ''));
|
|
45
44
|
this.menuClickEvent.emit({ id });
|
|
46
45
|
}
|
|
46
|
+
/** Sets the initial selected and open state for the navigation menu based on selected main or sublevel items. */
|
|
47
|
+
handleNavInitialState() {
|
|
48
|
+
this.mainMenuItemId = this.menuItems[0].id;
|
|
49
|
+
this.selectedItemId = this.menuItems[0].id;
|
|
50
|
+
const selectedMainItem = this.menuItems.find((item) => item.selected)?.id;
|
|
51
|
+
if (selectedMainItem) {
|
|
52
|
+
this.mainMenuItemId = selectedMainItem;
|
|
53
|
+
this.selectedItemId = selectedMainItem;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
for (const item of this.menuItems) {
|
|
57
|
+
const selectedSub = (item.sublevels || []).find((sub) => sub.selected);
|
|
58
|
+
if (selectedSub) {
|
|
59
|
+
this.selectedItemId = selectedSub.id;
|
|
60
|
+
this.mainMenuItemId = item.id;
|
|
61
|
+
this.openedMenuIds = new Set([item.id]);
|
|
62
|
+
localStorage.setItem('selectedSublevelId', JSON.stringify(selectedSub.id));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
47
67
|
/**
|
|
48
68
|
* Initialises the mouse drag.
|
|
49
69
|
* @param {MouseEvent} event Current mouse event.
|
|
@@ -86,12 +106,11 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
86
106
|
toggleMenu = (e) => {
|
|
87
107
|
e.preventDefault();
|
|
88
108
|
if (this.expanded) {
|
|
89
|
-
this.selectedItemId = this.mainMenuItemId
|
|
109
|
+
this.selectedItemId = this.mainMenuItemId;
|
|
90
110
|
}
|
|
91
111
|
else {
|
|
92
112
|
const sublevelId = Number(localStorage.getItem('selectedSublevelId'));
|
|
93
|
-
this.selectedItemId = sublevelId
|
|
94
|
-
this.sublevelsOpened = sublevelId > 0;
|
|
113
|
+
this.selectedItemId = sublevelId || this.mainMenuItemId;
|
|
95
114
|
}
|
|
96
115
|
this.expanded = !this.expanded;
|
|
97
116
|
};
|
|
@@ -100,12 +119,14 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
100
119
|
if (this.selectedItemId !== id) {
|
|
101
120
|
this.selectedItemId = id;
|
|
102
121
|
}
|
|
103
|
-
|
|
122
|
+
const newSet = new Set(this.openedMenuIds);
|
|
123
|
+
newSet.has(id) ? newSet.delete(id) : newSet.add(id);
|
|
124
|
+
this.openedMenuIds = newSet;
|
|
104
125
|
localStorage.setItem('selectedSublevelId', JSON.stringify(''));
|
|
105
126
|
};
|
|
106
127
|
/** Render second menu level */
|
|
107
128
|
renderSublevelItems = (sublevels, id) => {
|
|
108
|
-
if (!this.
|
|
129
|
+
if (!this.openedMenuIds.has(id)) {
|
|
109
130
|
return null;
|
|
110
131
|
}
|
|
111
132
|
const renderSublevelItem = sublevels.map((item) => (h("button", { class: { 'business-navigation-item': true, 'sublevel': true, 'selected': this.selectedItemId === item.id }, key: item.id, onClick: () => this.selectMenuItem(item.id, id) }, h("span", { class: { 'business-navigation-item__title': true, 'sublevel': true } }, item.name))));
|
|
@@ -114,9 +135,9 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
114
135
|
/** Render menu item */
|
|
115
136
|
renderMenuItem = (menuItem) => {
|
|
116
137
|
const { id, icon, name, sublevels } = menuItem;
|
|
117
|
-
const { expanded,
|
|
138
|
+
const { expanded, openedMenuIds } = this;
|
|
118
139
|
const withSublevels = expanded && sublevels && sublevels.length > 0;
|
|
119
|
-
return (h("div", { class: "business-navigation-item__wrapper" }, h("button", { key: id, class: { 'business-navigation-item': true, 'selected': this.selectedItemId === id }, onClick: () => (withSublevels ? this.toggleSublevels(id) : this.selectMenuItem(id)), "aria-label": name }, icon && h("tet-icon", { class: "business-navigation-item__icon", name: icon }), !this.expandable || expanded ? (h("span", { class: "business-navigation-item__title" }, name)) : (h("tet-tooltip", { class: "business-navigation-item__tooltip", position: TooltipPosition.RIGHT, theme: this.theme }, name)), withSublevels && (h("tet-icon", { class: { 'business-navigation-item__chevron': true, 'sublevelOpened':
|
|
140
|
+
return (h("div", { class: "business-navigation-item__wrapper" }, h("button", { key: id, class: { 'business-navigation-item': true, 'selected': this.selectedItemId === id }, onClick: () => (withSublevels ? this.toggleSublevels(id) : this.selectMenuItem(id)), "aria-label": name }, icon && h("tet-icon", { class: "business-navigation-item__icon", name: icon }), !this.expandable || expanded ? (h("span", { class: "business-navigation-item__title" }, name)) : (h("tet-tooltip", { class: "business-navigation-item__tooltip", position: TooltipPosition.RIGHT, theme: this.theme }, name)), withSublevels && (h("tet-icon", { class: { 'business-navigation-item__chevron': true, 'sublevelOpened': openedMenuIds.has(id) }, name: openedMenuIds.has(id) ? 'chevron-up' : 'chevron-down' }))), withSublevels && this.renderSublevelItems(sublevels, id)));
|
|
120
141
|
};
|
|
121
142
|
/** Render button to expand and minimize the menu container. */
|
|
122
143
|
renderExpandButton = () => {
|
|
@@ -128,7 +149,7 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
128
149
|
/** Render Functional Component*/
|
|
129
150
|
render() {
|
|
130
151
|
const { menuItems, theme, expandable } = this;
|
|
131
|
-
return (h("div", { key: '
|
|
152
|
+
return (h("div", { key: '7d9c836c1d13e3b7d010946a9ba7e772a1f41987', class: { 'business-navigation': true, [`${theme}`]: true, 'expandable': expandable, 'closed': !this.expanded }, role: "group", onMouseDown: this.onContainerMouseDown, ref: (ref) => (this.navigationContainer = ref) }, this.renderExpandButton(), expandable && h("hr", { key: 'e1dfb7594222452bd8cd2cad8bbfe5e80cefff0e', class: "business-navigation-divider" }), menuItems && menuItems.map(this.renderMenuItem)));
|
|
132
153
|
}
|
|
133
154
|
static get style() { return TetBusinessNavigationStyle0; }
|
|
134
155
|
}, [1, "tet-business-navigation", {
|
|
@@ -140,7 +161,7 @@ const TetBusinessNavigation = /*@__PURE__*/ proxyCustomElement(class TetBusiness
|
|
|
140
161
|
"mainMenuItemId": [32],
|
|
141
162
|
"positions": [32],
|
|
142
163
|
"expanded": [32],
|
|
143
|
-
"
|
|
164
|
+
"openedMenuIds": [32],
|
|
144
165
|
"selectMenuItem": [64]
|
|
145
166
|
}]);
|
|
146
167
|
function defineCustomElement() {
|
|
@@ -7,7 +7,7 @@ import { d as defineCustomElement$i } from './p-9c5b6894.js';
|
|
|
7
7
|
import { d as defineCustomElement$h } from './p-48f61462.js';
|
|
8
8
|
import { d as defineCustomElement$g } from './p-a41cd76b.js';
|
|
9
9
|
import { d as defineCustomElement$f } from './p-29ac3413.js';
|
|
10
|
-
import { d as defineCustomElement$e } from './p-
|
|
10
|
+
import { d as defineCustomElement$e } from './p-92c98bea.js';
|
|
11
11
|
import { d as defineCustomElement$d } from './p-0aa896e1.js';
|
|
12
12
|
import { d as defineCustomElement$c } from './p-48cff30b.js';
|
|
13
13
|
import { d as defineCustomElement$b } from './p-58e92936.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TetBusinessNavigation$1, d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { T as TetBusinessNavigation$1, d as defineCustomElement$1 } from './p-92c98bea.js';
|
|
2
2
|
|
|
3
3
|
const TetBusinessNavigation = TetBusinessNavigation$1;
|
|
4
4
|
const defineCustomElement = defineCustomElement$1;
|
|
@@ -3,7 +3,7 @@ import { d as defineCustomElement$4 } from './p-48cff30b.js';
|
|
|
3
3
|
import { d as defineCustomElement$3 } from './p-f035c2cb.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './p-41a7c21a.js';
|
|
5
5
|
|
|
6
|
-
const tetDynamicCardCss = ":host{--image-type:cover;--image-background-color:var(--tc-background-white-black);--card-width-mobile:17.5rem;--card-height-mobile:27.75rem;--card-width-tablet:21.375rem;--card-height-tablet:33.875rem;--card-width-desktop:25.625rem;--card-height-desktop:39.5rem;--option-card-bg:var(--tc-background-white-black);--option-card-text:var(--tc-text-primary);--option-card-border:var(--tc-border-quaternary);display:block;font-family:var(--tet-font-family-primary)}.card{-webkit-user-drag:none;user-select:none;cursor:pointer;background:var(--tc-background-white-black);border-radius:1rem;border:0.0625rem solid var(--tc-border-quaternary);overflow:hidden;position:relative;display:flex;flex-direction:column;align-items:center;gap:1rem;margin:0 auto;min-width:var(--card-width-mobile);width:var(--card-width-mobile);height:var(--card-height-mobile);transition:box-shadow 0.15s ease}.card.size-S{width:var(--card-width-mobile);height:var(--card-height-mobile)}.card.size-XL,.card.size-L,.card.size-M{width:100%}.card:focus-visible{outline:0.125rem solid var(--tc-blue-40);outline-offset:0.125rem}.card:hover{box-shadow:0 4px 24px 0 rgba(0, 0, 0, 0.1), 0 1.5px 6px 0 rgba(0, 0, 0, 0.08)}.card:hover ::slotted(img){transform:scale(1.06)}.card:active{box-shadow:0 0 1px 0 rgba(12, 12, 14, 0.08), 0 1px 3px 0 rgba(12, 12, 14, 0.12)}.card:active ::slotted(img){transform:scale(1.01)}.content-container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.image{-webkit-user-drag:none;user-select:none;flex-shrink:0;width:100%;height:16.125rem;overflow:hidden;position:relative;background-color:var(--image-background-color)}.image ::slotted(img){transition:transform 0.3s ease;width:100%;height:100%;object-fit:var(--image-type);display:block}.price{position:absolute;bottom:0.75rem;right:0.75rem;z-index:1}.tags-container{position:absolute;top:0.75rem;left:0.75rem;display:flex;flex-direction:column;gap:0.25rem;z-index:1}.content{height:auto;padding:0 1rem;text-align:center}.title{margin:0;font-family:var(--font-family-fallback);font-size:1.25rem;font-weight:600;margin-bottom:0.5rem;color:var(--tc-text-primary);line-height:1.5rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;word-break:break-word;max-height:3rem}.subtitle{color:var(--tc-text-primary);text-align:center;font-family:var(--font-family-content);font-size:0.875rem;font-style:normal;font-weight:400;line-height:1.25rem;letter-spacing:-0.003125rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;word-break:break-word;max-height:2.5rem}.button{margin-top:auto;margin-bottom:1.5rem;width:fit-content;text-wrap:nowrap}.tags-container{position:absolute;top:0.75rem;left:0.75rem;display:flex;flex-direction:column;gap:0.25rem}.tags{display:flex;flex-wrap:wrap;gap:0.25rem}.tag{border:0.0625px solid var(--tc-border-tertiary);padding:0.1875rem 0.3125rem;border-radius:0.375rem;background:var(--tc-layer-primary);color:var(--tc-text-primary);font-family:var(--font-family-content);font-size:0.75rem;font-style:normal;font-weight:500;line-height:1rem}.tag.colored--white{background:var(--tc-layer-primary);color:var(--tc-text-primary);border:0.0625px solid var(--tc-border-tertiary)}.tag.colored--black{color:var(--tc-text-primary-dark);background:var(--tc-layer-primary-dark);border:0.0625px solid var(--tc-border-primary)}.tag.colored--yellow{background:var(--tc-yellow-20);color:var(--tc-text-primary);border:0.0625px solid var(--tc-border-tertiary)}.theme-dark{background:var(--tc-layer-primary-dark);border:0.0625rem solid var(--tc-border-quaternary-dark)}.theme-dark .title{color:var(--tc-text-primary-dark)}.theme-dark .subtitle{color:var(--tc-text-primary-dark)}.theme-dark .tag:not(.colored){color:var(--tc-text-primary-dark);background:var(--tc-layer-primary-dark);border:0.0625px solid var(--tc-border-primary)}@media all and (min-width: 48rem){.card{width:var(--card-width-tablet);height:var(--card-height-tablet)}.card.size-S{width:var(--card-width-tablet);height:var(--card-height-tablet)}.card.size-M{width:100%}.card.size-M .image{width:100
|
|
6
|
+
const tetDynamicCardCss = ":host{--image-type:cover;--image-background-color:var(--tc-background-white-black);--card-width-mobile:17.5rem;--card-height-mobile:27.75rem;--card-width-tablet:21.375rem;--card-height-tablet:33.875rem;--card-width-desktop:25.625rem;--card-height-desktop:39.5rem;--option-card-bg:var(--tc-background-white-black);--option-card-text:var(--tc-text-primary);--option-card-border:var(--tc-border-quaternary);display:block;font-family:var(--tet-font-family-primary)}.card{-webkit-user-drag:none;user-select:none;cursor:pointer;background:var(--tc-background-white-black);border-radius:1rem;border:0.0625rem solid var(--tc-border-quaternary);overflow:hidden;position:relative;display:flex;flex-direction:column;align-items:center;gap:1rem;margin:0 auto;min-width:var(--card-width-mobile);width:var(--card-width-mobile);height:var(--card-height-mobile);transition:box-shadow 0.15s ease}.card.size-S{width:var(--card-width-mobile);height:var(--card-height-mobile)}.card.size-XL,.card.size-L,.card.size-M{width:100%}.card:focus-visible{outline:0.125rem solid var(--tc-blue-40);outline-offset:0.125rem}.card:hover{box-shadow:0 4px 24px 0 rgba(0, 0, 0, 0.1), 0 1.5px 6px 0 rgba(0, 0, 0, 0.08)}.card:hover ::slotted(img){transform:scale(1.06)}.card:active{box-shadow:0 0 1px 0 rgba(12, 12, 14, 0.08), 0 1px 3px 0 rgba(12, 12, 14, 0.12)}.card:active ::slotted(img){transform:scale(1.01)}.content-container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.image{-webkit-user-drag:none;user-select:none;flex-shrink:0;width:100%;height:16.125rem;overflow:hidden;position:relative;background-color:var(--image-background-color)}.image ::slotted(img){transition:transform 0.3s ease;width:100%;height:100%;object-fit:var(--image-type);display:block}.price{position:absolute;bottom:0.75rem;right:0.75rem;z-index:1}.tags-container{position:absolute;top:0.75rem;left:0.75rem;display:flex;flex-direction:column;gap:0.25rem;z-index:1}.content{height:auto;padding:0 1rem;text-align:center}.title{margin:0;font-family:var(--font-family-fallback);font-size:1.25rem;font-weight:600;margin-bottom:0.5rem;color:var(--tc-text-primary);line-height:1.5rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;word-break:break-word;max-height:3rem}.subtitle{color:var(--tc-text-primary);text-align:center;font-family:var(--font-family-content);font-size:0.875rem;font-style:normal;font-weight:400;line-height:1.25rem;letter-spacing:-0.003125rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;word-break:break-word;max-height:2.5rem}.button{margin-top:auto;margin-bottom:1.5rem;width:fit-content;text-wrap:nowrap}.tags-container{position:absolute;top:0.75rem;left:0.75rem;display:flex;flex-direction:column;gap:0.25rem}.tags{display:flex;flex-wrap:wrap;gap:0.25rem}.tag{border:0.0625px solid var(--tc-border-tertiary);padding:0.1875rem 0.3125rem;border-radius:0.375rem;background:var(--tc-layer-primary);color:var(--tc-text-primary);font-family:var(--font-family-content);font-size:0.75rem;font-style:normal;font-weight:500;line-height:1rem}.tag.colored--white{background:var(--tc-layer-primary);color:var(--tc-text-primary);border:0.0625px solid var(--tc-border-tertiary)}.tag.colored--black{color:var(--tc-text-primary-dark);background:var(--tc-layer-primary-dark);border:0.0625px solid var(--tc-border-primary)}.tag.colored--yellow{background:var(--tc-yellow-20);color:var(--tc-text-primary);border:0.0625px solid var(--tc-border-tertiary)}.theme-dark{background:var(--tc-layer-primary-dark);border:0.0625rem solid var(--tc-border-quaternary-dark)}.theme-dark .title{color:var(--tc-text-primary-dark)}.theme-dark .subtitle{color:var(--tc-text-primary-dark)}.theme-dark .tag:not(.colored){color:var(--tc-text-primary-dark);background:var(--tc-layer-primary-dark);border:0.0625px solid var(--tc-border-primary)}@media all and (min-width: 48rem){.card{width:var(--card-width-tablet);height:var(--card-height-tablet)}.card.size-S{width:var(--card-width-tablet);height:var(--card-height-tablet)}.card.size-M{width:100%}.card.size-M .image{width:100%}.card.size-M.carousel-true{width:44rem}.card.size-XL,.card.size-L{width:100%;flex-direction:row;gap:0}.card.size-XL .image,.card.size-L .image{width:60%;height:100%}.card.size-XL .button,.card.size-L .button{margin-top:0}.card.size-XL.position-right,.card.size-L.position-right{flex-direction:row-reverse}.card.size-XL.carousel-true,.card.size-L.carousel-true{width:44rem}.image{width:var(--card-width-tablet);height:var(--card-width-tablet)}.title{font-size:1.5rem;line-height:1.75rem;max-height:3.5rem}.tag{font-size:0.875rem;line-height:1.25rem;letter-spacing:-0.003125rem}}@media all and (min-width: 90rem){.card.size-M{width:100%}.card.size-M.carousel-true{width:39.375rem}.card.size-L{width:100%;flex-direction:row;gap:0}.card.size-L .image{width:62%;height:100%}.card.size-L .button{margin-top:0}.card.size-L.position-right{flex-direction:row-reverse}.card.size-L.carousel-true{width:57.25rem}.card.size-XL .image{width:64%}.card.size-XL.carousel-true{width:80.25rem}}@media all and (min-width: 120rem){.card{width:var(--card-width-desktop);height:var(--card-height-desktop)}.card.size-S{width:var(--card-width-desktop);height:var(--card-height-desktop)}.card.size-L.carousel-true{width:83.125rem}.card.size-XL .image{width:72%}.card.size-XL.carousel-true{width:110.25rem}.image{width:var(--card-width-desktop);height:var(--card-width-desktop)}.title{font-size:1.75rem;line-height:2rem;max-height:4rem}.subtitle{font-size:1rem;line-height:1.5rem;letter-spacing:-0.00625rem;max-height:3rem}}";
|
|
7
7
|
const TetDynamicCardStyle0 = tetDynamicCardCss;
|
|
8
8
|
|
|
9
9
|
const TetDynamicCard$1 = /*@__PURE__*/ proxyCustomElement(class TetDynamicCard extends H {
|
|
@@ -57,14 +57,15 @@ const TetDynamicCard$1 = /*@__PURE__*/ proxyCustomElement(class TetDynamicCard e
|
|
|
57
57
|
rootElementRef = null;
|
|
58
58
|
BREAKPOINTS = {
|
|
59
59
|
MOBILE: 768,
|
|
60
|
+
TABLET_SMALL: 1024,
|
|
60
61
|
TABLET: 1440,
|
|
61
62
|
DESKTOP: 1920
|
|
62
63
|
};
|
|
63
64
|
CARD_SIZES = {
|
|
64
65
|
standard: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
S: 'fit-content',
|
|
67
|
+
M: 'calc(50% - 0.75rem)',
|
|
68
|
+
XL: '100%'
|
|
68
69
|
},
|
|
69
70
|
responsive: {
|
|
70
71
|
mobile: '100%',
|
|
@@ -73,27 +74,13 @@ const TetDynamicCard$1 = /*@__PURE__*/ proxyCustomElement(class TetDynamicCard e
|
|
|
73
74
|
}
|
|
74
75
|
};
|
|
75
76
|
getCardSize(width) {
|
|
76
|
-
if (this.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
else {
|
|
84
|
-
return this.originalSize;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else if (this.originalSize === 'M') {
|
|
88
|
-
if (width < this.BREAKPOINTS.MOBILE) {
|
|
89
|
-
return (this.sizeChangeBreakpoint === 'Mob' || this.sizeChangeBreakpoint === 'Tab') ? 'S' : 'XL';
|
|
90
|
-
}
|
|
91
|
-
else if (width < this.BREAKPOINTS.TABLET) {
|
|
92
|
-
return this.sizeChangeBreakpoint === 'Tab' ? 'S' : this.originalSize;
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
return this.originalSize;
|
|
96
|
-
}
|
|
77
|
+
if (width < this.BREAKPOINTS.MOBILE)
|
|
78
|
+
return 'XL';
|
|
79
|
+
if (width < this.BREAKPOINTS.TABLET_SMALL)
|
|
80
|
+
return 'M';
|
|
81
|
+
const isAdaptiveSize = this.originalSize === 'L' || this.originalSize === 'M';
|
|
82
|
+
if (isAdaptiveSize && width < this.BREAKPOINTS.TABLET) {
|
|
83
|
+
return this.sizeChangeBreakpoint === 'Tab' ? 'S' : this.originalSize;
|
|
97
84
|
}
|
|
98
85
|
return this.originalSize;
|
|
99
86
|
}
|
|
@@ -112,36 +99,21 @@ const TetDynamicCard$1 = /*@__PURE__*/ proxyCustomElement(class TetDynamicCard e
|
|
|
112
99
|
}
|
|
113
100
|
}
|
|
114
101
|
getCardWidth(size, width) {
|
|
115
|
-
if (this.isInCarousel)
|
|
102
|
+
if (this.isInCarousel)
|
|
116
103
|
return 'fit-content';
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
// Special handling
|
|
124
|
-
if (size === 'L' || size === 'M') {
|
|
125
|
-
return this.CARD_SIZES.responsive.mobile;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
else if (width < this.BREAKPOINTS.TABLET) {
|
|
129
|
-
if (adaptiveSize && this.sizeChangeBreakpoint === 'Tab') {
|
|
104
|
+
if (width < this.BREAKPOINTS.MOBILE)
|
|
105
|
+
return this.CARD_SIZES.responsive.mobile;
|
|
106
|
+
const isAdaptiveSize = this.originalSize === 'L' || this.originalSize === 'M';
|
|
107
|
+
if (width < this.BREAKPOINTS.TABLET) {
|
|
108
|
+
if (isAdaptiveSize && this.sizeChangeBreakpoint === 'Tab')
|
|
130
109
|
return 'fit-content';
|
|
131
|
-
|
|
132
|
-
|
|
110
|
+
if (size === 'M')
|
|
111
|
+
return this.CARD_SIZES.standard.M;
|
|
112
|
+
if (size === 'L')
|
|
133
113
|
return this.CARD_SIZES.responsive.tablet;
|
|
134
|
-
}
|
|
135
114
|
}
|
|
136
|
-
else if (
|
|
137
|
-
|
|
138
|
-
return this.CARD_SIZES.responsive.tablet;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
if (size === 'L') {
|
|
143
|
-
return this.CARD_SIZES.responsive.desktop;
|
|
144
|
-
}
|
|
115
|
+
else if (size === 'L') {
|
|
116
|
+
return width < this.BREAKPOINTS.DESKTOP ? this.CARD_SIZES.responsive.tablet : this.CARD_SIZES.responsive.desktop;
|
|
145
117
|
}
|
|
146
118
|
return this.CARD_SIZES.standard[size] || 'fit-content';
|
|
147
119
|
}
|
|
@@ -176,7 +148,7 @@ const TetDynamicCard$1 = /*@__PURE__*/ proxyCustomElement(class TetDynamicCard e
|
|
|
176
148
|
}
|
|
177
149
|
handleClick = (event) => {
|
|
178
150
|
const path = event.composedPath();
|
|
179
|
-
const isButtonClick = path.some(el => el instanceof H && el.classList?.contains('button'));
|
|
151
|
+
const isButtonClick = path.some((el) => el instanceof H && el.classList?.contains('button'));
|
|
180
152
|
if (!isButtonClick) {
|
|
181
153
|
if (this.buttonRef && this.linkHref) {
|
|
182
154
|
const button = this.buttonRef.shadowRoot?.querySelector('button');
|
|
@@ -191,31 +163,39 @@ const TetDynamicCard$1 = /*@__PURE__*/ proxyCustomElement(class TetDynamicCard e
|
|
|
191
163
|
};
|
|
192
164
|
renderTags() {
|
|
193
165
|
const dateTagColor = this.theme === 'dark' ? this.dateTagColorDark : this.dateTagColorLight;
|
|
194
|
-
return (h("div", { class: "tags-container", part: "tags" }, this.tags?.length > 0 && (h("div", { class: "tags" }, this.tags.map(tag => (h("span", { class: "tag" }, tag))))), this.dateTag && (h("div", { class: "tags" }, h("div", { class: `tag colored colored--${dateTagColor}`, ref: (elm) => {
|
|
166
|
+
return (h("div", { class: "tags-container", part: "tags" }, this.tags?.length > 0 && (h("div", { class: "tags" }, this.tags.map((tag) => (h("span", { class: "tag" }, tag))))), this.dateTag && (h("div", { class: "tags" }, h("div", { class: `tag colored colored--${dateTagColor}`, ref: (elm) => {
|
|
167
|
+
this.dateTagColorRef = elm;
|
|
168
|
+
} }, h("span", { class: "date-tag-text" }, this.dateTag))))));
|
|
195
169
|
}
|
|
196
170
|
renderPrice() {
|
|
197
171
|
if (!this.priceTagOptions?.show)
|
|
198
172
|
return null;
|
|
199
|
-
return (h("div", { class: "price", part: "price" }, h("tet-price-view", { ref: elm => {
|
|
173
|
+
return (h("div", { class: "price", part: "price" }, h("tet-price-view", { ref: (elm) => {
|
|
174
|
+
this.priceViewRef = elm;
|
|
175
|
+
}, font: this.priceTagOptions.font || 'Gilroy, Arial, sans-serif', background: this.priceTagOptions.background, staticColors: this.priceTagOptions.isStatic, theme: this.theme, size: "S", "heading-text": this.priceTagOptions.headingText, "price-type": this.priceTagOptions.priceType, "euro-price": this.priceTagOptions.euroPrice?.toString(), "cents-price": this.priceTagOptions.centsPrice?.toString(), "footer-text": this.priceTagOptions.footerText, "footer-text-type": this.priceTagOptions.footerTextType })));
|
|
200
176
|
}
|
|
201
177
|
renderButton() {
|
|
202
178
|
if (!this.linkText)
|
|
203
179
|
return null;
|
|
204
180
|
const buttonProps = {
|
|
205
|
-
type: 'primary',
|
|
206
|
-
size: 'small',
|
|
207
|
-
theme: this.theme,
|
|
208
|
-
url: this.linkHref,
|
|
181
|
+
'type': 'primary',
|
|
182
|
+
'size': 'small',
|
|
183
|
+
'theme': this.theme,
|
|
184
|
+
'url': this.linkHref,
|
|
209
185
|
'url-target': this.linkNewTab ? '_blank' : '_self',
|
|
210
186
|
'accessibility-label': this.linkText
|
|
211
187
|
};
|
|
212
|
-
return (h("div", { class: "button", part: "button" }, h("tet-button", { ...buttonProps, ref: elm => {
|
|
188
|
+
return (h("div", { class: "button", part: "button" }, h("tet-button", { ...buttonProps, ref: (elm) => {
|
|
189
|
+
this.buttonRef = elm;
|
|
190
|
+
} }, this.linkText)));
|
|
213
191
|
}
|
|
214
192
|
render() {
|
|
215
|
-
return (h(Host, { key: '
|
|
193
|
+
return (h(Host, { key: 'e835560322a1509753b6391ff1148137f2669395', class: {
|
|
216
194
|
'dynamic-card': true,
|
|
217
195
|
'is-focused': this.isFocused
|
|
218
|
-
}, "data-index": this.index, ref: (elm) => {
|
|
196
|
+
}, "data-index": this.index, ref: (elm) => {
|
|
197
|
+
this.rootElementRef = elm;
|
|
198
|
+
} }, h("div", { key: '9155b5ea0293ef39c54f8d66c0df6c2931cf3d52', class: `card
|
|
219
199
|
theme-${this.theme}
|
|
220
200
|
size-${this.currentSize}
|
|
221
201
|
position-${this.pictureLayoutShiftPosition}
|
|
@@ -223,7 +203,7 @@ const TetDynamicCard$1 = /*@__PURE__*/ proxyCustomElement(class TetDynamicCard e
|
|
|
223
203
|
`, onClick: this.handleClick, onKeyUp: (event) => {
|
|
224
204
|
if (event.key === 'Enter')
|
|
225
205
|
this.handleClick(event);
|
|
226
|
-
}, tabindex: 0, part: "card", "aria-labelledby": this.cardTitle }, h("div", { key: '
|
|
206
|
+
}, tabindex: 0, part: "card", "aria-labelledby": this.cardTitle }, h("div", { key: '6923cd94ffceae462b08d99e82a9c3f0dae21f84', class: "image", part: "image" }, h("slot", { key: '4fe4f5e2c4edffb8229073f6cf59a0c4cac6fc43', name: "image" }), this.renderPrice(), this.renderTags()), h("div", { key: '2fda1db6c8b3828caf41e20aab7e09033581e007', class: "content-container" }, h("div", { key: '5b5c81bd36839cd84ea23f2872007026e24b957e', class: "content", part: "content" }, this.cardTitle && (h("h3", { key: '6b52cd192997cd9bbbab8ff4d9c19e31ead757c9', class: "title", part: "title" }, this.cardTitle)), this.subtitle && (h("p", { key: '2dd27ca9c13653ef5542950307fdd4583dd67fb9', class: "subtitle", part: "subtitle" }, this.subtitle))), this.renderButton()))));
|
|
227
207
|
}
|
|
228
208
|
static get watchers() { return {
|
|
229
209
|
"theme": ["onThemeChanged"],
|