@tet/tet-components 1.3.146-testing → 1.3.147-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/index-f559cb2e.js +24 -36
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{tet-notification.cjs.entry.js → tet-accordion_2.cjs.entry.js} +131 -0
- package/dist/cjs/tet-address-offers-filters-products_2.cjs.entry.js +1 -1
- package/dist/cjs/{tet-autocomplete_2.cjs.entry.js → tet-autocomplete.cjs.entry.js} +0 -65
- package/dist/cjs/tet-b2b-check-out-form_5.cjs.entry.js +647 -0
- package/dist/cjs/tet-b2b-configurator.cjs.entry.js +536 -0
- package/dist/cjs/tet-b2b-service-calculator.cjs.entry.js +1 -1
- package/dist/cjs/tet-border-radius.cjs.entry.js +1 -1
- package/dist/cjs/tet-business-lines.cjs.entry.js +1 -1
- package/dist/cjs/tet-colors.cjs.entry.js +4 -4
- package/dist/cjs/tet-compare-card-v2.cjs.entry.js +1 -1
- package/dist/cjs/tet-components.cjs.js +1 -1
- package/dist/cjs/tet-font-weight.cjs.entry.js +1 -1
- package/dist/cjs/tet-fonts.cjs.entry.js +1 -1
- package/dist/cjs/tet-grid.cjs.entry.js +1 -1
- package/dist/cjs/tet-layout.cjs.entry.js +1 -1
- package/dist/cjs/tet-link.cjs.entry.js +1 -1
- package/dist/cjs/tet-spacing.cjs.entry.js +1 -1
- package/dist/cjs/tet-spinner.cjs.entry.js +71 -0
- package/dist/cjs/tet-text-list.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/advanced/cards/tet-b2b-compare-card/test/tet-b2b-compare-card.spec.js +0 -1
- package/dist/collection/components/advanced/cards/tet-b2b-compare-card/tet-b2b-compare-card.js +8 -8
- package/dist/collection/components/advanced/cards/tet-business-summary-card/tet-business-summary-card.css +7 -0
- package/dist/collection/components/advanced/cards/tet-business-summary-card/tet-business-summary-card.js +31 -7
- package/dist/collection/components/advanced/cards/tet-compare-card/tet-compare-card.css +1 -0
- package/dist/collection/components/advanced/cards/tet-compare-card-v2/tet-compare-card-v2.css +1 -0
- package/dist/collection/components/advanced/forms/tet-b2b-check-out-form/tet-b2b-check-out-form.css +0 -2
- package/dist/collection/components/advanced/forms/tet-b2b-check-out-form/tet-b2b-check-out-form.js +24 -4
- package/dist/collection/components/simple/lists/tet-text-list/tet-text-list.css +1 -0
- package/dist/collection/components/simple/menu/tet-business-navigation/tet-business-navigation.css +15 -5
- package/dist/collection/components/simple/structural/tet-accordion/tet-accordion.css +4 -2
- package/dist/collection/components/simple/structural/tet-accordion/tet-accordion.js +27 -5
- package/dist/collection/components/views/tet-b2b-configurator/b2b-configurator.store.js +47 -0
- package/dist/collection/components/views/tet-b2b-configurator/partials/tet-b2b-configurator-cart/test/tet-b2b-configurator-cart.spec.js +10 -1
- package/dist/collection/components/views/tet-b2b-configurator/partials/tet-b2b-configurator-cart/tet-b2b-configurator-cart.css +54 -9
- package/dist/collection/components/views/tet-b2b-configurator/partials/tet-b2b-configurator-cart/tet-b2b-configurator-cart.js +106 -8
- package/dist/collection/components/views/tet-b2b-configurator/tet-b2b-configurator.css +472 -0
- package/dist/collection/components/views/tet-b2b-configurator/tet-b2b-configurator.js +612 -0
- package/dist/collection/components/views/tet-b2b-service-calculator/tet-b2b-service-calculator.js +1 -1
- package/dist/collection/components/views/tet-business-lines/tet-business-lines.js +1 -1
- package/dist/collection/docs/styling/border-radius/tet-border-radius.js +1 -1
- package/dist/collection/docs/styling/colors/tet-colors.js +4 -4
- package/dist/collection/docs/styling/font-weight/tet-font-weight.js +1 -1
- package/dist/collection/docs/styling/fonts/tet-fonts.js +1 -1
- package/dist/collection/docs/styling/layout/tet-layout.js +1 -1
- package/dist/collection/docs/styling/link/tet-link.js +1 -1
- package/dist/collection/docs/styling/spacing/tet-spacing.js +1 -1
- package/dist/collection/docs/styling/tet-grid/tet-grid.js +1 -1
- package/dist/collection/services/utils/minimum-duration-time.js +14 -0
- package/dist/components/index.js +2 -0
- package/dist/components/{p-08cb8e8b.js → p-401be6d8.js} +8 -6
- package/dist/components/{p-b3266df2.js → p-42c3311c.js} +1 -1
- package/dist/components/{p-c15aec6f.js → p-4a4c9b2c.js} +1 -1
- package/dist/{esm/tet-business-navigation.entry.js → components/p-5541195e.js} +35 -8
- package/dist/components/{p-e735af9c.js → p-8dd212bd.js} +1 -1
- package/dist/{esm/tet-b2b-compare-card.entry.js → components/p-922171da.js} +68 -20
- package/dist/{esm/tet-b2b-check-out-form.entry.js → components/p-b74f5470.js} +69 -16
- package/dist/components/p-cbf2c238.js +227 -0
- package/dist/components/{p-18778346.js → p-e72ea31d.js} +1 -1
- package/dist/{esm/tet-business-summary-card.entry.js → components/p-f68a8deb.js} +66 -14
- package/dist/components/tet-accordion.js +1 -1
- package/dist/components/tet-address-offers-view.js +2 -2
- package/dist/components/tet-address-offers.js +1 -1
- package/dist/components/tet-b2b-check-out-form.js +1 -207
- package/dist/components/tet-b2b-compare-card.js +1 -206
- package/dist/components/tet-b2b-configurator-cart.js +1 -167
- package/dist/components/tet-b2b-configurator.d.ts +11 -0
- package/dist/components/tet-b2b-configurator.js +661 -0
- package/dist/components/tet-b2b-service-calculator.js +1 -1
- package/dist/components/tet-border-radius.js +1 -1
- package/dist/components/tet-business-compare-card.js +1 -1
- package/dist/components/tet-business-lines.js +1 -1
- package/dist/components/tet-business-navigation.js +1 -103
- package/dist/components/tet-business-summary-card.js +1 -116
- package/dist/components/tet-colors.js +4 -4
- package/dist/components/tet-compare-card-v2.js +1 -1
- package/dist/components/tet-compare-card.js +1 -1
- package/dist/components/tet-compare-cards-tab.js +2 -2
- package/dist/components/tet-compare-cards.js +1 -1
- package/dist/components/tet-font-weight.js +1 -1
- package/dist/components/tet-fonts.js +1 -1
- package/dist/components/tet-grid.js +1 -1
- package/dist/components/tet-layout.js +1 -1
- package/dist/components/tet-link.js +1 -1
- package/dist/components/tet-spacing.js +1 -1
- package/dist/components/tet-text-list.js +1 -1
- package/dist/esm/index-7f1e2a22.js +24 -36
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{tet-notification.entry.js → tet-accordion_2.entry.js} +132 -2
- package/dist/esm/tet-address-offers-filters-products_2.entry.js +1 -1
- package/dist/esm/{tet-autocomplete_2.entry.js → tet-autocomplete.entry.js} +1 -65
- package/dist/esm/tet-b2b-check-out-form_5.entry.js +639 -0
- package/dist/esm/tet-b2b-configurator.entry.js +532 -0
- package/dist/esm/tet-b2b-service-calculator.entry.js +1 -1
- package/dist/esm/tet-border-radius.entry.js +1 -1
- package/dist/esm/tet-business-lines.entry.js +1 -1
- package/dist/esm/tet-colors.entry.js +4 -4
- package/dist/esm/tet-compare-card-v2.entry.js +1 -1
- package/dist/esm/tet-components.js +1 -1
- package/dist/esm/tet-font-weight.entry.js +1 -1
- package/dist/esm/tet-fonts.entry.js +1 -1
- package/dist/esm/tet-grid.entry.js +1 -1
- package/dist/esm/tet-layout.entry.js +1 -1
- package/dist/esm/tet-link.entry.js +1 -1
- package/dist/esm/tet-spacing.entry.js +1 -1
- package/dist/esm/tet-spinner.entry.js +67 -0
- package/dist/esm/tet-text-list.entry.js +1 -1
- package/dist/tet-components/{p-0121cef5.entry.js → p-067c2f1b.entry.js} +1 -1
- package/dist/tet-components/{p-bb6387c6.entry.js → p-0738afc0.entry.js} +1 -1
- package/dist/tet-components/{p-f476f61c.entry.js → p-07aee8d0.entry.js} +1 -1
- package/dist/tet-components/p-0d818b7e.entry.js +1 -0
- package/dist/tet-components/{p-56460d2d.entry.js → p-4c9e742f.entry.js} +1 -1
- package/dist/tet-components/{p-9c274191.entry.js → p-4e0a24ba.entry.js} +1 -1
- package/dist/tet-components/p-4ea127f4.entry.js +1 -0
- package/dist/tet-components/{p-9bfcf2cc.entry.js → p-62eb4fe0.entry.js} +1 -1
- package/dist/tet-components/{p-38c3b247.entry.js → p-662d9457.entry.js} +1 -1
- package/dist/tet-components/{p-1ddb9e3c.entry.js → p-677b8bf7.entry.js} +1 -1
- package/dist/tet-components/{p-7f00f463.entry.js → p-6a4a979c.entry.js} +1 -1
- package/dist/tet-components/p-6d2c4b16.entry.js +1 -0
- package/dist/tet-components/{p-6782340f.entry.js → p-9513c8f6.entry.js} +1 -1
- package/dist/tet-components/p-af917a8f.entry.js +1 -0
- package/dist/tet-components/{p-597e234a.entry.js → p-dcb66405.entry.js} +1 -1
- package/dist/tet-components/{p-4838a00a.entry.js → p-e311eb7d.entry.js} +1 -1
- package/dist/tet-components/p-ed67bd52.entry.js +1 -0
- package/dist/tet-components/{p-bd8a0449.entry.js → p-eed6163a.entry.js} +1 -1
- package/dist/tet-components/tet-components.css +1 -1
- package/dist/tet-components/tet-components.esm.js +1 -1
- package/dist/types/components/advanced/cards/tet-business-summary-card/tet-business-summary-card.d.ts +4 -2
- package/dist/types/components/advanced/forms/tet-b2b-check-out-form/tet-b2b-check-out-form.d.ts +2 -1
- package/dist/types/components/simple/structural/tet-accordion/tet-accordion.d.ts +5 -0
- package/dist/types/components/views/tet-b2b-configurator/b2b-configurator.store.d.ts +22 -0
- package/dist/types/components.d.ts +100 -4
- package/dist/types/services/api/interfaces/property.interface.d.ts +2 -2
- package/dist/types/services/api/services/b2b-configurator/b2b-configurator.d.ts +4 -4
- package/dist/types/services/utils/minimum-duration-time.d.ts +9 -0
- package/package.json +1 -1
- package/dist/cjs/tet-accordion.cjs.entry.js +0 -136
- package/dist/cjs/tet-b2b-check-out-form.cjs.entry.js +0 -164
- package/dist/cjs/tet-b2b-compare-card.cjs.entry.js +0 -164
- package/dist/cjs/tet-b2b-configurator-cart.cjs.entry.js +0 -129
- package/dist/cjs/tet-business-navigation.cjs.entry.js +0 -82
- package/dist/cjs/tet-business-summary-card.cjs.entry.js +0 -77
- package/dist/esm/tet-accordion.entry.js +0 -132
- package/dist/esm/tet-b2b-configurator-cart.entry.js +0 -125
- package/dist/tet-components/p-05fc6443.entry.js +0 -1
- package/dist/tet-components/p-319c29e9.entry.js +0 -1
- package/dist/tet-components/p-47618056.entry.js +0 -1
- package/dist/tet-components/p-4eb386f5.entry.js +0 -1
- package/dist/tet-components/p-62419a1f.entry.js +0 -1
- package/dist/tet-components/p-a9499bbb.entry.js +0 -1
- package/dist/tet-components/p-d0d39e88.entry.js +0 -1
- package/dist/tet-components/p-ff5dba0e.entry.js +0 -1
- package/dist/types/components/views/tet-b2b-configurator/partials/tet-b2b-configurator-cart/tet-b2b-configurator-cart.d.ts +0 -67
|
@@ -117,11 +117,13 @@
|
|
|
117
117
|
--b2b-cart-block-details-color: var(--tc-layer-tertiary);
|
|
118
118
|
--b2b-cart-summary-accent-color: var(--tc-yellow-20);
|
|
119
119
|
--elevation-six-layer-1-color: rgba(12, 12, 14, 0.06);
|
|
120
|
+
--b2b-cart-sticky-box-shadow: 0 0 4px 0 rgba(12, 12, 14, 0.04), 0 -10px 15px 0 rgba(12, 12, 14, 0.12);
|
|
120
121
|
}
|
|
121
122
|
.light.checkout {
|
|
122
123
|
--b2b-cart-background-color: var(--tc-layer-secondary);
|
|
123
124
|
--b2b-cart-block-color: var(--tc-layer-tertiary);
|
|
124
125
|
--b2b-cart-block-details-color: var(--tc-layer-quaternary);
|
|
126
|
+
--b2b-cart-box-shadow: none;
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
.dark {
|
|
@@ -134,11 +136,13 @@
|
|
|
134
136
|
--b2b-cart-block-details-color: var(--tc-layer-tertiary-dark);
|
|
135
137
|
--b2b-cart-summary-accent-color: var(--tc-grey-20-dark);
|
|
136
138
|
--elevation-six-layer-1-color: rgba(12, 12, 14, 0.20);
|
|
139
|
+
--b2b-cart-sticky-box-shadow: 0 0 4px 0 rgba(12, 12, 14, 0.2), 0 -10px 15px 0 rgba(12, 12, 14, 0.33);
|
|
137
140
|
}
|
|
138
141
|
.dark.checkout {
|
|
139
142
|
--b2b-cart-background-color: var(--tc-layer-secondary-dark);
|
|
140
143
|
--b2b-cart-block-color: var(--tc-layer-tertiary-dark);
|
|
141
144
|
--b2b-cart-block-details-color: var(--tc-layer-quaternary-dark);
|
|
145
|
+
--b2b-cart-box-shadow: none;
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
.cart {
|
|
@@ -151,17 +155,39 @@
|
|
|
151
155
|
background: var(--b2b-cart-background-color);
|
|
152
156
|
box-shadow: var(--b2b-cart-box-shadow);
|
|
153
157
|
}
|
|
158
|
+
.cart--sticky {
|
|
159
|
+
--b2b-cart-box-shadow: var(--b2b-cart-sticky-box-shadow);
|
|
160
|
+
border-radius: 1rem 1rem 0 0;
|
|
161
|
+
}
|
|
154
162
|
.cart__accordion {
|
|
155
163
|
--accordion-border-radius: 1rem 1rem 0 0;
|
|
156
|
-
--accordion-header-padding: 1rem;
|
|
164
|
+
--accordion-header-padding: 1rem 1.5rem;
|
|
157
165
|
--accordion-header-mobile-padding: 1rem;
|
|
158
166
|
--accordion-header-font: 600 1rem/1.5rem Inter, Gilroy, Arial, sans-serif;
|
|
159
167
|
}
|
|
160
|
-
@media
|
|
168
|
+
@media screen and (min-width: 48rem) {
|
|
169
|
+
.cart__accordion--closed {
|
|
170
|
+
--accordion-header-padding: 1rem 1.5rem 0.5rem 1.5rem;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
@media screen and (min-width: 64rem) {
|
|
161
174
|
.cart__accordion--edit {
|
|
162
175
|
--accordion-header-display: none;
|
|
163
176
|
}
|
|
164
177
|
}
|
|
178
|
+
.cart__accordion--checkout {
|
|
179
|
+
--accordion-header-padding: 1rem;
|
|
180
|
+
}
|
|
181
|
+
@media screen and (min-width: 48rem) {
|
|
182
|
+
.cart__accordion--checkout {
|
|
183
|
+
--accordion-header-padding: 1rem 1.5rem;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
@media screen and (min-width: 64rem) {
|
|
187
|
+
.cart__accordion--checkout {
|
|
188
|
+
--accordion-header-padding: 1.5rem;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
165
191
|
.cart__accordion--rounded {
|
|
166
192
|
--accordion-border-radius: 1rem;
|
|
167
193
|
}
|
|
@@ -171,7 +197,7 @@
|
|
|
171
197
|
.cart__title--edit {
|
|
172
198
|
display: none;
|
|
173
199
|
}
|
|
174
|
-
@media
|
|
200
|
+
@media screen and (min-width: 64rem) {
|
|
175
201
|
.cart__title--edit {
|
|
176
202
|
display: block;
|
|
177
203
|
padding: 1.5rem 1.5rem 1rem 1.5rem;
|
|
@@ -205,7 +231,7 @@
|
|
|
205
231
|
border: 0.0625rem solid var(--b2b-cart-border-color);
|
|
206
232
|
background-color: var(--b2b-cart-block-color);
|
|
207
233
|
}
|
|
208
|
-
@media
|
|
234
|
+
@media screen and (min-width: 48rem) {
|
|
209
235
|
.block {
|
|
210
236
|
--accordion-header-padding: 1rem;
|
|
211
237
|
--accordion-header-mobile-padding: 1rem;
|
|
@@ -232,15 +258,19 @@
|
|
|
232
258
|
border-radius: 1.375rem;
|
|
233
259
|
}
|
|
234
260
|
.block__header-indicator {
|
|
261
|
+
display: flex;
|
|
262
|
+
gap: 0.25rem;
|
|
263
|
+
align-items: center;
|
|
235
264
|
font: 400 0.875rem/1.25rem "Inter", "Gilroy, Arial, sans-serif";
|
|
236
265
|
}
|
|
237
|
-
@media
|
|
266
|
+
@media screen and (min-width: 48rem) {
|
|
238
267
|
.block__header-indicator {
|
|
239
268
|
font: 400 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";
|
|
240
269
|
}
|
|
241
270
|
}
|
|
242
271
|
.block__header-icon {
|
|
243
272
|
--icon-size: 1.25rem;
|
|
273
|
+
--icon-container-display: flex;
|
|
244
274
|
}
|
|
245
275
|
|
|
246
276
|
.empty-cart {
|
|
@@ -254,6 +284,7 @@
|
|
|
254
284
|
}
|
|
255
285
|
.empty-cart__title {
|
|
256
286
|
font: 500 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";
|
|
287
|
+
text-align: center;
|
|
257
288
|
}
|
|
258
289
|
.empty-cart__description {
|
|
259
290
|
color: var(--b2b-cart-text-color-secondary);
|
|
@@ -267,13 +298,24 @@
|
|
|
267
298
|
border-color: var(--b2b-cart-border-color);
|
|
268
299
|
border-top-style: solid;
|
|
269
300
|
border-top-width: 0.0625rem;
|
|
270
|
-
box-shadow: 0 -6px 12px 0 var(--elevation-six-layer-1-color);
|
|
271
301
|
}
|
|
272
|
-
@media
|
|
302
|
+
@media screen and (min-width: 48rem) {
|
|
273
303
|
.summary {
|
|
274
304
|
padding: 1rem 1.5rem 1.5rem;
|
|
275
305
|
}
|
|
276
306
|
}
|
|
307
|
+
@media screen and (min-width: 64rem) {
|
|
308
|
+
.summary {
|
|
309
|
+
box-shadow: 0 -6px 12px 0 var(--elevation-six-layer-1-color);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
@media screen and (min-width: 48rem) {
|
|
313
|
+
.summary--closed {
|
|
314
|
+
padding: 0 1.5rem 1rem 1.5rem;
|
|
315
|
+
border: none;
|
|
316
|
+
box-shadow: none;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
277
319
|
.summary__notification {
|
|
278
320
|
margin-bottom: 1rem;
|
|
279
321
|
}
|
|
@@ -297,17 +339,20 @@
|
|
|
297
339
|
gap: 0.5rem;
|
|
298
340
|
font: 500 1.125rem/1.75rem "Inter", "Gilroy, Arial, sans-serif";
|
|
299
341
|
}
|
|
300
|
-
@media
|
|
342
|
+
@media screen and (min-width: 48rem) {
|
|
301
343
|
.summary__monthly-payment {
|
|
302
344
|
margin-bottom: 1.5rem;
|
|
303
345
|
}
|
|
304
346
|
}
|
|
305
|
-
@media
|
|
347
|
+
@media screen and (min-width: 64rem) {
|
|
306
348
|
.summary__monthly-payment {
|
|
307
349
|
margin-bottom: 1rem;
|
|
308
350
|
font: 500 1.25rem/1.5rem "Gilroy", "Gilroy, Arial, sans-serif";
|
|
309
351
|
}
|
|
310
352
|
}
|
|
353
|
+
.summary__monthly-payment:last-child {
|
|
354
|
+
margin-bottom: 0;
|
|
355
|
+
}
|
|
311
356
|
.summary__monthly-price {
|
|
312
357
|
display: flex;
|
|
313
358
|
flex-direction: column;
|
|
@@ -4,6 +4,21 @@ export class TetB2bConfiguratorCart {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
/** @private The suffix for the price displayed - "€/mēn."). */
|
|
6
6
|
this.priceSuffix = '€/mēn.';
|
|
7
|
+
this.addStickyClassConditionally = () => {
|
|
8
|
+
if (this.context === 'checkout') {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const rect = this.hostElement.getBoundingClientRect();
|
|
12
|
+
const { bottom, top } = rect;
|
|
13
|
+
const isTopVisible = top < window.innerHeight && top;
|
|
14
|
+
const isBottomVisible = bottom < window.innerHeight && bottom;
|
|
15
|
+
if (isTopVisible && !isBottomVisible && !this.isDesktopResolution) {
|
|
16
|
+
this.cartEl.classList.add('cart--sticky');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
this.cartEl.classList.remove('cart--sticky');
|
|
20
|
+
}
|
|
21
|
+
};
|
|
7
22
|
/**
|
|
8
23
|
* Updates `primarySlotFilled` or `secondarySlotFilled` based on assigned slot elements.
|
|
9
24
|
* @param e The slotchange event.
|
|
@@ -66,48 +81,87 @@ export class TetB2bConfiguratorCart {
|
|
|
66
81
|
this.secondaryBlockEl = el;
|
|
67
82
|
}
|
|
68
83
|
};
|
|
69
|
-
return (h("div", { hidden: !slotFilled, class: "block__wrapper" }, h("tet-accordion", { ref: refCallback, key: block.type, class: "block", isOpen:
|
|
84
|
+
return (h("div", { hidden: !slotFilled, class: "block__wrapper" }, h("tet-accordion", { ref: refCallback, key: block.type, class: "block", isOpen: blockOpen, header: block.name, theme: this.theme, transparentBackground: true }, h("div", { slot: "header", class: "block__header" }, h("div", { class: "block__header-row" }, block.name, " ", h("span", { class: "block__header-amount" }, `${amount} ${this.priceSuffix}`)), h("div", { class: "block__header-row" }, h("div", { class: "block__header-details" }, `${count} ${countValue}`), h("div", { class: "block__header-indicator" }, blockOpen ? t('components-b2b-cart-accordion-less') : t('components-b2b-cart-accordion-more'), h("tet-icon", { class: "block__header-icon", name: `chevron-${blockOpen ? 'up' : 'down'}`, theme: this.theme })))), h("slot", { onSlotchange: this.handleSlotChanged, name: block.type }))));
|
|
70
85
|
});
|
|
71
86
|
return content;
|
|
72
87
|
};
|
|
73
88
|
/** Renders the cart summary, including notifications and financial details. */
|
|
74
89
|
this.renderSummary = () => {
|
|
75
90
|
const { summarySavings, summaryAmount, hasPrimaryNotification, hasSecondaryNotification } = this.data;
|
|
76
|
-
return (h("div", { class:
|
|
91
|
+
return (h("div", { class: { 'summary': true, 'summary--closed': !this.isAccordionOpen } }, hasPrimaryNotification && (h("tet-notification", { class: "summary__notification", type: "warning", headerTitle: t('components-b2b-cart-primary-notification-title'), content: t('components-b2b-cart-primary-notification-description'), allowClose: false, theme: this.theme, icon: null })), hasSecondaryNotification && (h("tet-notification", { class: "summary__notification", type: "neutral", headerTitle: t('components-b2b-cart-secondary-notification-title'), content: t('components-b2b-cart-secondary-notification-description'), allowClose: false, theme: this.theme })), this.isAccordionOpen && (h("div", { class: "summary__savings" }, t('components-b2b-cart-savings-title'), h("span", { class: "summary__savings-amount" }, " ", `${summarySavings} ${this.priceSuffix}`))), h("div", { class: "summary__monthly-payment" }, t('components-b2b-cart-monthly-payment-title'), h("div", { class: "summary__monthly-price" }, `${summaryAmount} ${this.priceSuffix}`, h("span", { class: "summary__monthly-price-disclosure" }, ' ', t('components-b2b-cart-monthly-payment-disclosure'), ' '))), this.isAccordionOpen && h("slot", { name: "cta" })));
|
|
77
92
|
};
|
|
78
93
|
this.theme = 'light';
|
|
79
94
|
this.data = undefined;
|
|
80
95
|
this.isCartEmpty = true;
|
|
81
96
|
this.context = 'edit';
|
|
82
97
|
this.isDesktopResolution = true;
|
|
83
|
-
this.isAccordionOpen = this.context === 'edit';
|
|
84
|
-
this.isPrimaryBlockOpen =
|
|
85
|
-
this.isSecondaryBlockOpen =
|
|
98
|
+
this.isAccordionOpen = this.isDesktopResolution && this.context === 'edit';
|
|
99
|
+
this.isPrimaryBlockOpen = this.isDesktopResolution;
|
|
100
|
+
this.isSecondaryBlockOpen = this.isDesktopResolution;
|
|
86
101
|
this.primarySlotFilled = false;
|
|
87
102
|
this.secondarySlotFilled = false;
|
|
88
103
|
}
|
|
89
104
|
/**
|
|
90
105
|
* Imperatively opens the main accordion when transitioning to desktop in 'edit' context.
|
|
106
|
+
* Adds/removes sticky class on `isDesktopResolution` prop change
|
|
91
107
|
* @param isDesktop The new resolution state.
|
|
92
108
|
*/
|
|
93
109
|
openAccordionOnResolutionChange(isDesktop) {
|
|
94
110
|
if (isDesktop && this.accordionEl && this.context === 'edit') {
|
|
95
111
|
this.accordionEl.open();
|
|
96
112
|
}
|
|
113
|
+
this.addStickyClassConditionally();
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Adds/removes sticky class on `isCartEmpty` prop change
|
|
117
|
+
*/
|
|
118
|
+
checkStickyClassOnCartEmptyChange() {
|
|
119
|
+
this.addStickyClassConditionally();
|
|
97
120
|
}
|
|
98
121
|
componentWillLoad() {
|
|
99
122
|
processTranslations('tet-components', 'lv').then(() => forceUpdate(this));
|
|
100
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Initiates observer to check when cart sticks to bottom
|
|
126
|
+
*/
|
|
127
|
+
async componentDidLoad() {
|
|
128
|
+
this.cartObserver = new IntersectionObserver(this.addStickyClassConditionally, {
|
|
129
|
+
rootMargin: `0px 0px 0px 0px`,
|
|
130
|
+
root: document,
|
|
131
|
+
threshold: 1
|
|
132
|
+
});
|
|
133
|
+
this.cartObserver.observe(this.hostElement);
|
|
134
|
+
}
|
|
135
|
+
/** Clean up listeners/observers */
|
|
136
|
+
disconnectedCallback() {
|
|
137
|
+
if (this.cartObserver) {
|
|
138
|
+
this.cartObserver.disconnect();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Changes block accordion state to open|close
|
|
143
|
+
* @param category
|
|
144
|
+
* @param state
|
|
145
|
+
*/
|
|
146
|
+
async changeBlockState(category, state) {
|
|
147
|
+
if (category === 'primary' && this.primaryBlockEl) {
|
|
148
|
+
state == 'open' ? this.primaryBlockEl.open() : this.primaryBlockEl.close();
|
|
149
|
+
}
|
|
150
|
+
else if (category === 'secondary' && this.secondaryBlockEl) {
|
|
151
|
+
state == 'open' ? this.secondaryBlockEl.open() : this.secondaryBlockEl.close();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
101
154
|
render() {
|
|
102
155
|
const cartTitle = t('components-b2b-cart-title');
|
|
103
156
|
const isEditMode = this.context === 'edit';
|
|
104
157
|
const isCheckoutMode = this.context === 'checkout';
|
|
105
158
|
const showSummary = !this.isCartEmpty && (isEditMode || (isCheckoutMode && this.isAccordionOpen));
|
|
106
|
-
return (h(Host, { key: '
|
|
159
|
+
return (h(Host, { key: 'a333bbd252bd1a19b305719b1a3492e8784f9dfa' }, h("div", { key: '590c1d0f2cb7b087157d9c2b6062ad8b6cfec802', ref: (el) => (this.cartEl = el), class: { cart: true, [`${this.theme}`]: true, [`${this.context}`]: true } }, h("tet-accordion", { key: 'b05385da27e63518ace873ebcfb33b30ca2a68d4', ref: (el) => (this.accordionEl = el), class: {
|
|
107
160
|
'cart__accordion': true,
|
|
108
161
|
[`cart__accordion--${this.context}`]: true,
|
|
109
|
-
'cart__accordion--rounded': this.isCartEmpty || (isCheckoutMode && !this.isAccordionOpen)
|
|
110
|
-
|
|
162
|
+
'cart__accordion--rounded': this.isCartEmpty || (isCheckoutMode && !this.isAccordionOpen),
|
|
163
|
+
'cart__accordion--closed': !this.isAccordionOpen
|
|
164
|
+
}, isOpen: this.isAccordionOpen, onOpenChanged: this.handleAccordionChanged, header: cartTitle, theme: this.theme, transparentBackground: true, indicatorDirection: this.isDesktopResolution || isCheckoutMode ? 'down' : 'up' }, h("div", { key: 'a11c1ad7cd5b45f66af099d63378a50015733861', class: `cart__title--${this.context}` }, cartTitle), h("div", { key: '1155f8d5386e55e82e1c46e4179266c6f7e28c3e', class: "cart__content" }, this.isCartEmpty ? this.renderEmptyContent() : [this.renderContent()])), showSummary && this.renderSummary())));
|
|
111
165
|
}
|
|
112
166
|
static get is() { return "tet-b2b-configurator-cart"; }
|
|
113
167
|
static get encapsulation() { return "shadow"; }
|
|
@@ -230,10 +284,54 @@ export class TetB2bConfiguratorCart {
|
|
|
230
284
|
"secondarySlotFilled": {}
|
|
231
285
|
};
|
|
232
286
|
}
|
|
287
|
+
static get methods() {
|
|
288
|
+
return {
|
|
289
|
+
"changeBlockState": {
|
|
290
|
+
"complexType": {
|
|
291
|
+
"signature": "(category: CategoryType, state: 'open' | 'close') => Promise<void>",
|
|
292
|
+
"parameters": [{
|
|
293
|
+
"name": "category",
|
|
294
|
+
"type": "\"primary\" | \"secondary\"",
|
|
295
|
+
"docs": ""
|
|
296
|
+
}, {
|
|
297
|
+
"name": "state",
|
|
298
|
+
"type": "\"open\" | \"close\"",
|
|
299
|
+
"docs": ""
|
|
300
|
+
}],
|
|
301
|
+
"references": {
|
|
302
|
+
"Promise": {
|
|
303
|
+
"location": "global",
|
|
304
|
+
"id": "global::Promise"
|
|
305
|
+
},
|
|
306
|
+
"CategoryType": {
|
|
307
|
+
"location": "import",
|
|
308
|
+
"path": "@services/api/services/b2b-configurator/b2b-configurator",
|
|
309
|
+
"id": "src/services/api/services/b2b-configurator/b2b-configurator.ts::CategoryType"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"return": "Promise<void>"
|
|
313
|
+
},
|
|
314
|
+
"docs": {
|
|
315
|
+
"text": "Changes block accordion state to open|close",
|
|
316
|
+
"tags": [{
|
|
317
|
+
"name": "param",
|
|
318
|
+
"text": "category"
|
|
319
|
+
}, {
|
|
320
|
+
"name": "param",
|
|
321
|
+
"text": "state"
|
|
322
|
+
}]
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
static get elementRef() { return "hostElement"; }
|
|
233
328
|
static get watchers() {
|
|
234
329
|
return [{
|
|
235
330
|
"propName": "isDesktopResolution",
|
|
236
331
|
"methodName": "openAccordionOnResolutionChange"
|
|
332
|
+
}, {
|
|
333
|
+
"propName": "isCartEmpty",
|
|
334
|
+
"methodName": "checkStickyClassOnCartEmptyChange"
|
|
237
335
|
}];
|
|
238
336
|
}
|
|
239
337
|
}
|