@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
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"components/simple/text-blocks/tet-tooltip/tet-tooltip.js",
|
|
85
85
|
"components/views/tet-address-offers-view/tet-address-offers-view.js",
|
|
86
86
|
"components/views/tet-b2b-configurator/partials/tet-b2b-configurator-cart/tet-b2b-configurator-cart.js",
|
|
87
|
+
"components/views/tet-b2b-configurator/tet-b2b-configurator.js",
|
|
87
88
|
"components/views/tet-b2b-service-calculator/tet-b2b-service-calculator.js",
|
|
88
89
|
"components/views/tet-business-lines/tet-business-lines.js",
|
|
89
90
|
"components/views/tet-cloud-configurator/tet-cloud-configurator.js",
|
|
@@ -35,7 +35,6 @@ describe('tet-b2b-compare-card', () => {
|
|
|
35
35
|
components-b2b-configurator-best-choice
|
|
36
36
|
</div>
|
|
37
37
|
<div
|
|
38
|
-
aria-controls="details-BUSINESS_M365_PACKAGE_BASIC"
|
|
39
38
|
aria-labelledby="title-BUSINESS_M365_PACKAGE_BASIC"
|
|
40
39
|
class="card light" role="button"
|
|
41
40
|
tabindex="0"
|
package/dist/collection/components/advanced/cards/tet-b2b-compare-card/tet-b2b-compare-card.js
CHANGED
|
@@ -11,8 +11,8 @@ export class TetB2bCompareCard {
|
|
|
11
11
|
* @private Initializes localCount based on options.counterOptions.defaultValue or defaults to 1.
|
|
12
12
|
*/
|
|
13
13
|
this.initCount = () => {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
this.localCount = (
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
this.localCount = (_c = (_a = this.count) !== null && _a !== void 0 ? _a : (_b = this.options.counterOptions) === null || _b === void 0 ? void 0 : _b.defaultValue) !== null && _c !== void 0 ? _c : 1;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* @private Updates localCount and emits the countChange event.
|
|
@@ -127,15 +127,15 @@ export class TetB2bCompareCard {
|
|
|
127
127
|
const oldTotal = (localCount * price).toFixed(2);
|
|
128
128
|
const detailsId = `details-${options.id}`;
|
|
129
129
|
const titleId = `title-${options.id}`;
|
|
130
|
-
return (h(Host, { key: '
|
|
131
|
-
h("hr", { key: '
|
|
132
|
-
h("section", { key: '
|
|
133
|
-
h("span", { key: '
|
|
134
|
-
h("tet-stepper-input", { key: '
|
|
130
|
+
return (h(Host, { key: 'fb55819189417025a6ff7b17d927e82c0884bdab' }, h("div", { key: '01f724dcd984957286c3f4bbcd648c5a6cf5ac2d', class: { card__wrapper: isBestChoice } }, isBestChoice && (h("div", { key: 'bbfe753f9cda625a3722f92037dcfed2f71d69fd', class: { 'card__badge': true, 'card__badge--is-tablet': this.isTablet } }, t('components-b2b-configurator-best-choice'))), h("div", Object.assign({ key: 'aa3ccc968da6e0c1c4d02dc707fa1fbb812f900a', class: { 'card': true, [`${this.theme}`]: true, 'card--selected': !!this.count || localIsSelected }, onClick: this.handleSelect, onKeyDown: a11yBtnClick, tabindex: 0, role: "button", "aria-expanded": localIsSelected }, (localIsSelected ? { 'aria-controls': detailsId } : {}), { "aria-labelledby": titleId }), h("section", { key: '7476d69d4f4420e2e7b7cefcdcf6bebac2f25a4b', class: { 'offer': true, 'offer--is-tablet': this.isTablet } }, h("div", { key: '5f87e22fad55417f0e24146452ee8f32c97c0bc7', class: "offer__header" }, h("div", { key: 'e43787318e1614bc0e77e3a0ef2623a9cf719763', class: { 'offer__top-info': true, 'offer__top-info--is-tablet': this.isTablet } }, h("h3", { key: '4e2b8e30f85bc06d7a6d5b3e4daec545371b78d2', id: titleId, class: { 'offer__title': true, 'offer__title--is-tablet': this.isTablet } }, title), h("p", { key: '5e0c24d0241c18265d8da5749e898593129a4704', class: { 'offer__price': true, 'offer__price--is-tablet': this.isTablet } }, currentPrice.toFixed(2), h("span", { key: '15bc9de1a1901e014f5a12a85459b73f563074e5', class: { 'offer__price-suffix': true, 'offer__price-suffix--is-tablet': this.isTablet } }, ' ', priceSuffix))), h("p", { key: '1041721fb0184c6aaaaed79b4342cd5cbf4e0017', class: { 'offer__subtitle': true, 'offer__subtitle--is-tablet': this.isTablet } }, subtitle)), h("hr", { key: '06f9409be9d38b1ad78fcc53955b7d2442bca705', class: "divider divider--slim" }), h("tet-text-list", { key: '62e1134e4c2b81b9fe7fa63ee9e1b8361bc02bba', class: "offer__benefits", withIcon: true, listIcon: "tc-check", theme: this.theme }, benefits.map((benefit) => (h("span", null, benefit)))), contract && (h("div", { key: '198033d65a045b5f86a7cf19af61c561878e75c4', class: "offer__contract-link" }, h("a", { key: 'fdadb062000c966fb74448598a64168e74f9ef3c', class: { 'tet-link': true, [`${this.theme}`]: true }, href: contract, target: "_blank", rel: "noopener noreferrer" }, t('components-b2b-configurator-contract-link-label'), h("span", { key: '4fe62cfffacffb72ae643c178467d68377ede1e8', class: "sr-only" }, t('components-a11y-open-link-in-new-window')))))), localIsSelected && [
|
|
131
|
+
h("hr", { key: 'a64e7735051ebaf4d71615424c27efa9e1522d09', class: "divider" }),
|
|
132
|
+
h("section", { key: 'bd9b08db0cedb3b7db817a2e47f22e0f9db2cefd', id: detailsId, role: "region", "aria-labelledby": titleId, class: { 'details': true, 'details--is-tablet': this.isTablet } }, h("div", { key: '071fbab6effb78d29ff61085bf186a56cc8c36d8', class: { 'details__price-block': true, 'details__price-block--is-tablet': this.isTablet } }, h("span", { key: 'fa3ad81e00ee95f40e5b4911c4e6ad5cd9f3018d' }, t('components-b2b-configurator-monthly-payment')), h("div", { key: 'a4df44748dfb186c8856a86a6c7f94717cd4ca8f', class: "details__total", "aria-live": "polite" }, h("span", { key: '708ba62b224b9bb6ea8b9694d2323d62b4eb1c88', class: "details__total--current" }, currentTotal, " ", priceSuffix), discountPrice != null && discountPrice < price && (h("span", { key: '96eff36c03696428121d24dc15425abf2df4bd63', class: "details__total--original" }, oldTotal, " ", priceSuffix)))), h("hr", { key: 'dbaa718231ffe98e0d682d80d6219c5e9766c69c', class: "divider" }), h("div", { key: 'e0f6274142eda6333e2f4d73bc27a163c60da851', class: { 'details__actions': true, 'details__actions--is-tablet': this.isTablet } }, h("div", { key: '352a4b8dfd2e9e21bc8cbe715cae8ed323000517', class: "details__quantity-control" }, options.counterOptions && [
|
|
133
|
+
h("span", { key: 'd76ffb6018acad5bb3ad809a578bb0a7870e0eb9', id: `qty-label-${options.id}`, class: "details__quantity-label" }, t(options.counterOptions.label)),
|
|
134
|
+
h("tet-stepper-input", { key: '8cd79acb5ccae250696a99322b4889d0859ec990', class: {
|
|
135
135
|
'details__quantity-counter': true,
|
|
136
136
|
'details__quantity-counter--is-tablet': this.isTablet
|
|
137
137
|
}, onInputValueChanged: this.handleCounterValueChange, value: localCount, min: options.counterOptions.minValue, max: options.counterOptions.maxValue, step: 1, theme: this.theme, accessibilityLabel: t(options.counterOptions.label), "aria-labelledby": `qty-label-${options.id}` })
|
|
138
|
-
]), h("tet-button", { key: '
|
|
138
|
+
]), h("tet-button", { key: 'b489683309f7d85209216d267a086d05e3e89832', class: "details__submit-button", onClick: this.added ? this.handleRemove : this.handleAdd, size: "medium", type: this.added ? 'secondary' : 'primary', theme: this.theme, iconName: this.added ? 'tc-trash' : 'tc-cart-outline', iconPosition: "left" }, this.added
|
|
139
139
|
? t('components-b2b-configurator-remove-from-basket')
|
|
140
140
|
: t('components-b2b-configurator-add-to-basket'))))
|
|
141
141
|
]))));
|
|
@@ -359,6 +359,7 @@
|
|
|
359
359
|
display: flex;
|
|
360
360
|
flex-direction: column;
|
|
361
361
|
padding: 1rem 1rem 0 1rem;
|
|
362
|
+
background-color: var(--tet-business-summary-card-background-color);
|
|
362
363
|
border: 0.03125rem solid var(--tet-business-summary-card-border-color);
|
|
363
364
|
border-radius: 0.375rem;
|
|
364
365
|
width: 100%;
|
|
@@ -468,6 +469,11 @@
|
|
|
468
469
|
font: 500 0.875rem/1.25rem "Inter", "Gilroy, Arial, sans-serif";
|
|
469
470
|
padding: 0 0.25rem 0.25rem 0.25rem;
|
|
470
471
|
}
|
|
472
|
+
@media screen and (min-width: 64rem) {
|
|
473
|
+
.stepper-label {
|
|
474
|
+
display: none;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
471
477
|
|
|
472
478
|
.content-wrapper {
|
|
473
479
|
display: flex;
|
|
@@ -480,6 +486,7 @@
|
|
|
480
486
|
font: 400 0.875rem/1.25rem "Inter", "Gilroy, Arial, sans-serif";
|
|
481
487
|
}
|
|
482
488
|
.content-wrapper .description.price {
|
|
489
|
+
align-self: end;
|
|
483
490
|
text-decoration-line: line-through;
|
|
484
491
|
}
|
|
485
492
|
@media only screen and (max-width: 22.5rem) {
|
|
@@ -24,7 +24,7 @@ export class TetBusinessSummaryCardComponent {
|
|
|
24
24
|
}
|
|
25
25
|
return (h("div", { class: "stepper-wrapper" }, this.renderLabel(false), h("tet-stepper-input", { class: "business-summary-card__stepper", theme: theme, value: value, step: 1, min: minValue, max: maxValue, onInputValueChanged: (e) => {
|
|
26
26
|
this.value = e.detail;
|
|
27
|
-
this.amountChange.emit(e);
|
|
27
|
+
this.amountChange.emit(e.detail);
|
|
28
28
|
} })));
|
|
29
29
|
};
|
|
30
30
|
/** Render Edit or Delete Icon Button */
|
|
@@ -47,6 +47,7 @@ export class TetBusinessSummaryCardComponent {
|
|
|
47
47
|
this.minValue = undefined;
|
|
48
48
|
this.maxValue = undefined;
|
|
49
49
|
this.stepperLabel = undefined;
|
|
50
|
+
this.context = 'edit';
|
|
50
51
|
this.language = 'lv';
|
|
51
52
|
}
|
|
52
53
|
async componentWillLoad() {
|
|
@@ -55,7 +56,12 @@ export class TetBusinessSummaryCardComponent {
|
|
|
55
56
|
/** Return functional Component */
|
|
56
57
|
render() {
|
|
57
58
|
const { productName, price, productDescription, discountPrice, currency, contractTerm, theme } = this;
|
|
58
|
-
|
|
59
|
+
const termWithUnit = !contractTerm
|
|
60
|
+
? t('components-term-month-indefinite')
|
|
61
|
+
: t(`components-term-month-${contractTerm % 10 === 1 && contractTerm !== 11 ? 'single' : 'plural'}`, {
|
|
62
|
+
term: contractTerm
|
|
63
|
+
});
|
|
64
|
+
return (h("div", { key: 'c25cd7e9a6eed0575af9f283f21c830b47ce7b57', class: { 'business-summary-card': true, [`theme-${theme}`]: true } }, h("div", { key: '84c17b2a4c7b7e7840d3815f5da5292a9692a49a', class: "business-summary-card-content" }, h("div", { key: '4d34ada146d7d347ee2db00e2b7d6e332205648e', class: "business-summary-card-content__left" }, h("div", { key: '17629a70af7e6751433a012860bff790c5f1e4ff', class: "content-wrapper" }, h("span", { key: 'c1408450f109a9f4f289389966af717f01d1aa59', class: "title" }, productName), h("span", { key: '4b160e0f59d16c4572eb0a71ae72d6d1f425530c', class: "description" }, productDescription))), h("div", { key: '9cee63b30c134afebbb3867b3a890db0844b24cf', class: "business-summary-card-content__right" }, h("div", { key: 'e17c4fa7fa6ddd93078d979a5d640400c696dbfa', class: "content-wrapper" }, h("span", { key: '078d0399a8823d004e2bf0d208510b9e4fe58cf2', class: "title" }, `${(discountPrice || price).toFixed(2)} ${currency}`), !!discountPrice && (h("span", { key: '5fc63b4bfc65a7889bf7507c92859c92ebc84040', class: { description: true, price: !!discountPrice } }, `${price.toFixed(2)} ${currency}`))))), h("div", { key: 'ad03d094cdbe03aecf29ade0cd91622aaa443011', class: "business-summary-card-content" }, h("span", { key: 'c49611607496937724dab73e8d2545559d5b102b', class: "contract-term" }, t('components-offers-contract-terms-label'), ": ", termWithUnit), this.context === 'checkout' && this.renderLabel(true)), this.context === 'edit' && h("div", { key: 'd7c3805517997241b883fcd664d2241d547e2404', class: "business-summary-card-content" }, h("div", { key: '10fa4c0dc453e1d9bf19203792cc5e1e0e0470cb', class: "business-summary-card-content__left" }, this.renderStepper()), h("div", { key: '43f737f7999def37d6c868d0bd276ba2a34fc9f9', class: "business-summary-card-content__right" }, h("div", { key: 'b6dd8432822b3c74b4a3a3c2b7558f4d723c89da', class: "button-wrapper" }, this.renderIconButton('tc-edit-box'), this.renderIconButton('tc-trash-can'))))));
|
|
59
65
|
}
|
|
60
66
|
static get is() { return "tet-business-summary-card"; }
|
|
61
67
|
static get encapsulation() { return "shadow"; }
|
|
@@ -157,11 +163,11 @@ export class TetBusinessSummaryCardComponent {
|
|
|
157
163
|
"reflect": false
|
|
158
164
|
},
|
|
159
165
|
"contractTerm": {
|
|
160
|
-
"type": "
|
|
166
|
+
"type": "number",
|
|
161
167
|
"mutable": false,
|
|
162
168
|
"complexType": {
|
|
163
|
-
"original": "
|
|
164
|
-
"resolved": "
|
|
169
|
+
"original": "number",
|
|
170
|
+
"resolved": "number",
|
|
165
171
|
"references": {}
|
|
166
172
|
},
|
|
167
173
|
"required": false,
|
|
@@ -277,6 +283,24 @@ export class TetBusinessSummaryCardComponent {
|
|
|
277
283
|
"attribute": "stepper-label",
|
|
278
284
|
"reflect": false
|
|
279
285
|
},
|
|
286
|
+
"context": {
|
|
287
|
+
"type": "string",
|
|
288
|
+
"mutable": false,
|
|
289
|
+
"complexType": {
|
|
290
|
+
"original": "'edit' | 'checkout'",
|
|
291
|
+
"resolved": "\"checkout\" | \"edit\"",
|
|
292
|
+
"references": {}
|
|
293
|
+
},
|
|
294
|
+
"required": false,
|
|
295
|
+
"optional": false,
|
|
296
|
+
"docs": {
|
|
297
|
+
"tags": [],
|
|
298
|
+
"text": "Context in which cart is renderd. `edit` will result in more details"
|
|
299
|
+
},
|
|
300
|
+
"attribute": "context",
|
|
301
|
+
"reflect": false,
|
|
302
|
+
"defaultValue": "'edit'"
|
|
303
|
+
},
|
|
280
304
|
"language": {
|
|
281
305
|
"type": "string",
|
|
282
306
|
"mutable": false,
|
|
@@ -345,8 +369,8 @@ export class TetBusinessSummaryCardComponent {
|
|
|
345
369
|
"text": "Emit event when amount of products changed"
|
|
346
370
|
},
|
|
347
371
|
"complexType": {
|
|
348
|
-
"original": "
|
|
349
|
-
"resolved": "
|
|
372
|
+
"original": "number",
|
|
373
|
+
"resolved": "number",
|
|
350
374
|
"references": {}
|
|
351
375
|
}
|
|
352
376
|
}];
|
|
@@ -7112,6 +7112,7 @@
|
|
|
7112
7112
|
--tc-text-black-permanent-dark: var(--tc-grey-minus-10-dark);
|
|
7113
7113
|
--tc-text-blue-grey-dark: var(--tc-grey-50-dark);
|
|
7114
7114
|
--tc-text-link-dark: var(--tc-blue-40-dark);
|
|
7115
|
+
--tc-text-inverse-primary-dark: var(--tc-grey-minus-10-dark);
|
|
7115
7116
|
--tc-background-primary-dark: var(--tc-grey-00-dark);
|
|
7116
7117
|
--tc-background-secondary-dark: var(--tc-grey-10-dark);
|
|
7117
7118
|
--tc-background-tertiary-dark: var(--tc-grey-20-dark);
|
package/dist/collection/components/advanced/cards/tet-compare-card-v2/tet-compare-card-v2.css
CHANGED
|
@@ -7112,6 +7112,7 @@
|
|
|
7112
7112
|
--tc-text-black-permanent-dark: var(--tc-grey-minus-10-dark);
|
|
7113
7113
|
--tc-text-blue-grey-dark: var(--tc-grey-50-dark);
|
|
7114
7114
|
--tc-text-link-dark: var(--tc-blue-40-dark);
|
|
7115
|
+
--tc-text-inverse-primary-dark: var(--tc-grey-minus-10-dark);
|
|
7115
7116
|
--tc-background-primary-dark: var(--tc-grey-00-dark);
|
|
7116
7117
|
--tc-background-secondary-dark: var(--tc-grey-10-dark);
|
|
7117
7118
|
--tc-background-tertiary-dark: var(--tc-grey-20-dark);
|
package/dist/collection/components/advanced/forms/tet-b2b-check-out-form/tet-b2b-check-out-form.css
CHANGED
|
@@ -414,8 +414,6 @@
|
|
|
414
414
|
.modal-form-card-content-accordion-wrapper {
|
|
415
415
|
border: 1px solid var(--b2b-check-out-form-accordion-border-color);
|
|
416
416
|
border-radius: 1rem;
|
|
417
|
-
background-color: var(--b2b-check-out-form-accordion-background-color);
|
|
418
|
-
padding: 1.5rem;
|
|
419
417
|
}
|
|
420
418
|
.modal-form-card-content-checkbox {
|
|
421
419
|
--tet-link-color: var(--b2b-check-out-form-text-color);
|
package/dist/collection/components/advanced/forms/tet-b2b-check-out-form/tet-b2b-check-out-form.js
CHANGED
|
@@ -17,10 +17,13 @@ export class TetAvailabilityContactForm {
|
|
|
17
17
|
processTranslations('tet-components', language).then(() => forceUpdate(this));
|
|
18
18
|
}
|
|
19
19
|
/** Method to open check out form */
|
|
20
|
-
/** Method to open check out form */
|
|
21
20
|
async open() {
|
|
22
21
|
await this.dialogElement.open();
|
|
23
22
|
}
|
|
23
|
+
/** Method to close check out form */
|
|
24
|
+
async close() {
|
|
25
|
+
await this.dialogElement.close();
|
|
26
|
+
}
|
|
24
27
|
/**
|
|
25
28
|
* Lifecycle method.
|
|
26
29
|
*/
|
|
@@ -106,11 +109,11 @@ export class TetAvailabilityContactForm {
|
|
|
106
109
|
}
|
|
107
110
|
render() {
|
|
108
111
|
const { theme } = this;
|
|
109
|
-
return (h("tet-dialog", { key: '
|
|
112
|
+
return (h("tet-dialog", { key: 'afc8685139afa64194e3d2cb25b18d84ff3ad67a', class: "modal-form-card", headerTitle: t('components-b2b-check-out-form-header'), theme: theme, closeOnOverlayClick: false, footerDisplay: "right", ref: (el) => {
|
|
110
113
|
this.dialogElement = el;
|
|
111
|
-
} }, h("div", { key: '
|
|
114
|
+
} }, h("div", { key: 'eff2cd2ed86e20aef326bc30d38895bb277bd5e6', class: { 'modal-form-card-content': true, [`${theme}`]: true } }, h("div", { key: 'f5c323d4ad25b2b69fa63397b01e774f73c5f7e3', class: "modal-form-card-content-header" }, h("div", { key: '70a9baeec70a1ec1412765678fe82973c6728616', class: "icon-wrapper" }, h("tet-icon", { key: 'ba3c5485e259fc0fe399e462cef72aae4ae4b3ea', class: "icon", name: "tc-company-1" })), h("span", { key: '1be3f61365e4619725aa3c2673a2ac724c69dff5', class: "modal-form-card-content-header__title" }, t('components-b2b-check-out-form-title')), h("span", { key: '689ad9e4124e6974f60f9502fca4f1976f54fa7d', class: "modal-form-card-content-header__description" }, t('components-b2b-check-out-form-description'))), h("div", { key: 'bc9acd6b8d3ed737e772c33f261f66b533cef3a0', class: "modal-form-card-content-accordion-wrapper" }, h("slot", { key: '2512b5fdc525049a96e1f8de62408248df261c9f', name: 'cart' })), h("form", { key: '42c51bb0f454b6510f1dba1e82aef3ea1535b4c2', id: "checkOutForm", class: "modal-form-card-form", ref: (ref) => (this.checkOutForm = ref) }, h("div", { key: '4cfcdf10b7e5eba5af9b753373c146f94418944b', class: "modal-form-card-input__row" }, this.renderInput('companyRegNr', t('components-b2b-check-out-form-company-registration-number-input-label'), '40000000001'), this.renderInput('companyName', t('components-b2b-check-out-form-company-name-input-label'))), this.renderInput('address', t('components-b2b-check-out-form-address-input-label'), t('components-b2b-check-out-form-address-input-placeholder')), this.renderInput('nameSurname', t('components-b2b-check-out-form-name-input-label')), h("div", { key: '60788e463001f8f8721b1e72e286808857a20ea8', class: "modal-form-card-input__row" }, this.renderInput('email', t('components-b2b-check-out-form-email-input-label'), 'contact@company.com'), this.renderInput('phoneNr', t('components-b2b-check-out-form-phone-number-input-label'), '123456789', true)), h("tet-checkbox", { key: 'c1d00090ed1e971e91b957467fd543678b3074d8', class: "modal-form-card-content-checkbox", label: t('components-check-out-form-privacy-policy'), theme: theme }))), h("div", { key: '42dce382d71a25e5588b5b0c3caab5d6f9087c03', slot: "footer", class: "modal-form-card-footer" }, h("tet-button", { key: '93f57658be0b1b0a034cb5fb7321954babe72fbb', type: "secondary", size: "medium", theme: theme, onClick: () => {
|
|
112
115
|
this.dialogElement.close();
|
|
113
|
-
} }, t('components-b2b-check-out-form-close-button-label')), h("tet-button", { key: '
|
|
116
|
+
} }, t('components-b2b-check-out-form-close-button-label')), h("tet-button", { key: '6a09fbae279bfcc1b5aa9417bd7497e16ff25358', type: "primary", size: "medium", theme: theme, onClick: () => this.handleSubmit() }, t('components-b2b-check-out-form-submit-button-label')))));
|
|
114
117
|
}
|
|
115
118
|
static get is() { return "tet-b2b-check-out-form"; }
|
|
116
119
|
static get encapsulation() { return "shadow"; }
|
|
@@ -199,6 +202,23 @@ export class TetAvailabilityContactForm {
|
|
|
199
202
|
"text": "Method to open check out form",
|
|
200
203
|
"tags": []
|
|
201
204
|
}
|
|
205
|
+
},
|
|
206
|
+
"close": {
|
|
207
|
+
"complexType": {
|
|
208
|
+
"signature": "() => Promise<void>",
|
|
209
|
+
"parameters": [],
|
|
210
|
+
"references": {
|
|
211
|
+
"Promise": {
|
|
212
|
+
"location": "global",
|
|
213
|
+
"id": "global::Promise"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"return": "Promise<void>"
|
|
217
|
+
},
|
|
218
|
+
"docs": {
|
|
219
|
+
"text": "Method to close check out form",
|
|
220
|
+
"tags": []
|
|
221
|
+
}
|
|
202
222
|
}
|
|
203
223
|
};
|
|
204
224
|
}
|
|
@@ -7113,6 +7113,7 @@
|
|
|
7113
7113
|
--tc-text-black-permanent-dark: var(--tc-grey-minus-10-dark);
|
|
7114
7114
|
--tc-text-blue-grey-dark: var(--tc-grey-50-dark);
|
|
7115
7115
|
--tc-text-link-dark: var(--tc-blue-40-dark);
|
|
7116
|
+
--tc-text-inverse-primary-dark: var(--tc-grey-minus-10-dark);
|
|
7116
7117
|
--tc-background-primary-dark: var(--tc-grey-00-dark);
|
|
7117
7118
|
--tc-background-secondary-dark: var(--tc-grey-10-dark);
|
|
7118
7119
|
--tc-background-tertiary-dark: var(--tc-grey-20-dark);
|
package/dist/collection/components/simple/menu/tet-business-navigation/tet-business-navigation.css
CHANGED
|
@@ -111,9 +111,9 @@
|
|
|
111
111
|
display: flex;
|
|
112
112
|
flex-direction: column;
|
|
113
113
|
max-width: 20.5rem;
|
|
114
|
-
width:
|
|
114
|
+
width: 100%;
|
|
115
115
|
}
|
|
116
|
-
@media screen and (max-width:
|
|
116
|
+
@media screen and (max-width: 63.9375rem) {
|
|
117
117
|
.business-navigation {
|
|
118
118
|
flex-direction: row;
|
|
119
119
|
gap: 0.5rem;
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
--tet-business-navigation-item-hover-background-color: var(--tc-menu-item-hover-dark);
|
|
146
146
|
--tet-business-navigation-item-active-background-color: var(--tc-menu-item-pressed-dark);
|
|
147
147
|
--tet-business-navigation-item-selected-background-color: var(--tc-layer-inverse-primary-dark);
|
|
148
|
-
--tet-business-navigation-item-selected-item-color: var(--tc-text-inverse-primary-);
|
|
148
|
+
--tet-business-navigation-item-selected-item-color: var(--tc-text-inverse-primary-dark);
|
|
149
149
|
--tet-business-navigation-item-selected-icon-color: var(--tc-layer-primary-dark);
|
|
150
150
|
--tet-business-navigation-label-color: var(--tc-text-primary-dark);
|
|
151
151
|
}
|
|
@@ -167,7 +167,17 @@
|
|
|
167
167
|
background-color: var(--tet-business-navigation-item-background-color);
|
|
168
168
|
cursor: pointer;
|
|
169
169
|
}
|
|
170
|
-
@media screen and (max-width:
|
|
170
|
+
@media screen and (max-width: 63.9375rem) {
|
|
171
|
+
.business-navigation-item:first-child {
|
|
172
|
+
margin-left: 1.5rem;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
@media screen and (max-width: 63.9375rem) {
|
|
176
|
+
.business-navigation-item:last-child {
|
|
177
|
+
margin-right: 1.5rem;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
@media screen and (max-width: 63.9375rem) {
|
|
171
181
|
.business-navigation-item {
|
|
172
182
|
display: inline-flex;
|
|
173
183
|
padding: 0.375rem 0.75rem;
|
|
@@ -187,7 +197,7 @@
|
|
|
187
197
|
--icon-size: 1.5rem;
|
|
188
198
|
--icon-color: var(--tet-business-navigation-label-color);
|
|
189
199
|
}
|
|
190
|
-
@media screen and (max-width:
|
|
200
|
+
@media screen and (max-width: 63.9375rem) {
|
|
191
201
|
.business-navigation-item__icon {
|
|
192
202
|
--icon-size: 1.25rem;
|
|
193
203
|
}
|
|
@@ -359,6 +359,8 @@
|
|
|
359
359
|
* @prop --accordion-text-color: The color of the text.
|
|
360
360
|
* @prop --accordion-border-bottom-width: The width of the bottom border of the accordion.
|
|
361
361
|
* @prop --accordion-border-color: The color of the bottom border.
|
|
362
|
+
* @prop --accordion-header-font: Font of accordion header in tablet and larger resolutions
|
|
363
|
+
* @prop --accordion-header-mobile-font: Font of accordion header in mobile resolution
|
|
362
364
|
*/
|
|
363
365
|
--accordion-animation-duration: 0.2s;
|
|
364
366
|
--accordion-header-padding: 1.5rem 0;
|
|
@@ -371,6 +373,7 @@
|
|
|
371
373
|
--accordion-break-point: 64rem;
|
|
372
374
|
--accordion-outer-border: none;
|
|
373
375
|
--accordion-header-font: 500 1.5rem/1.75rem Gilroy, Gilroy, Arial, sans-serif;
|
|
376
|
+
--accordion-header-mobile-font: 500 1rem/1.5rem Inter, Gilroy, Arial, sans-serif;
|
|
374
377
|
--accordion-header-display: flex;
|
|
375
378
|
}
|
|
376
379
|
|
|
@@ -403,11 +406,10 @@
|
|
|
403
406
|
padding-bottom: var(--accordion-border-bottom-width);
|
|
404
407
|
}
|
|
405
408
|
.tet-accordion__header {
|
|
406
|
-
font:
|
|
409
|
+
font: var(--accordion-header-mobile-font);
|
|
407
410
|
padding: var(--accordion-header-mobile-padding);
|
|
408
411
|
cursor: pointer;
|
|
409
412
|
display: var(--accordion-header-display);
|
|
410
|
-
line-height: 1.5rem;
|
|
411
413
|
width: 100%;
|
|
412
414
|
border-radius: 0.125rem;
|
|
413
415
|
}
|
|
@@ -31,6 +31,7 @@ export class TetAccordion {
|
|
|
31
31
|
this.header = '';
|
|
32
32
|
this.headerImageSrc = '';
|
|
33
33
|
this.headerImageAlt = '';
|
|
34
|
+
this.indicatorDirection = 'down';
|
|
34
35
|
this.withBorder = false;
|
|
35
36
|
this.withAutoScroll = false;
|
|
36
37
|
this.breakpoint = 'tablet';
|
|
@@ -108,21 +109,21 @@ export class TetAccordion {
|
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
111
|
render() {
|
|
111
|
-
return (h(Host, { key: '
|
|
112
|
+
return (h(Host, { key: 'ae49c29cf618a2c6fb2f639120ba55265e8777b3' }, h("div", { key: '1cbb0732250f9c0c66d43470092e43544ab021d3', class: {
|
|
112
113
|
'tet-accordion': true,
|
|
113
114
|
'tet-accordion--border': this.withBorder,
|
|
114
115
|
[`${this.theme}-theme`]: true,
|
|
115
116
|
[`tet-accordion--breakpoint-${this.breakpoint}`]: true,
|
|
116
117
|
'transparent-bg': this.transparentBackground,
|
|
117
|
-
} }, h("div", { key: '
|
|
118
|
+
} }, h("div", { key: '26c3058f903024a807a81c28ccd19c5ec20b6417', class: { "tet-accordion__header": true, [this.theme]: true }, onClick: this.toggleOpenState, onKeyDown: this.toggleAccessibilityOpenState, tabIndex: 0 }, h("slot", { key: 'f2a50389bbdde83c7a35222ac2354ac4d83c2371', name: "header" }, this.headerImageSrc && this.headerImageSrc !== '' && (h("img", { key: 'e91c42af9b23dc4d274a1748a1289ec3658f551b', src: this.headerImageSrc, alt: this.headerImageAlt ? this.headerImageAlt : undefined, class: "tet-accordion__header-image" })), this.renderHeading(), h("tet-icon", { key: 'ab1041abee91e902f3c878b9b26330d49adf30cb', name: `chevron-${this.indicatorDirection}`, class: {
|
|
118
119
|
'tet-accordion__icon': true,
|
|
119
120
|
'open': this.isOpen
|
|
120
|
-
} }))), h("div", { key: '
|
|
121
|
+
} }))), h("div", { key: '3add22727ab604975ef74d9b6277357664c651ad', ref: (element) => (this.contentWrapperElement = element), class: {
|
|
121
122
|
'tet-accordion__content-wrapper': true,
|
|
122
123
|
'visible': this.isOpen
|
|
123
|
-
}, inert: !this.isOpen }, h("div", { key: '
|
|
124
|
+
}, inert: !this.isOpen }, h("div", { key: 'fd54ea034bd15207b58d7f67f07c58bc30b1bcbe', ref: (element) => (this.contentElement = element), class: {
|
|
124
125
|
'tet-accordion__content': true
|
|
125
|
-
} }, h("slot", { key: '
|
|
126
|
+
} }, h("slot", { key: 'a8d9afde6505201a8f223c09fbbfdadb233d36ed' }))))));
|
|
126
127
|
}
|
|
127
128
|
static get is() { return "tet-accordion"; }
|
|
128
129
|
static get encapsulation() { return "shadow"; }
|
|
@@ -228,6 +229,27 @@ export class TetAccordion {
|
|
|
228
229
|
"reflect": false,
|
|
229
230
|
"defaultValue": "''"
|
|
230
231
|
},
|
|
232
|
+
"indicatorDirection": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"mutable": false,
|
|
235
|
+
"complexType": {
|
|
236
|
+
"original": "'up' | 'down'",
|
|
237
|
+
"resolved": "\"down\" | \"up\"",
|
|
238
|
+
"references": {}
|
|
239
|
+
},
|
|
240
|
+
"required": false,
|
|
241
|
+
"optional": false,
|
|
242
|
+
"docs": {
|
|
243
|
+
"tags": [{
|
|
244
|
+
"name": "default",
|
|
245
|
+
"text": "'down'"
|
|
246
|
+
}],
|
|
247
|
+
"text": "The direction of indicator icon"
|
|
248
|
+
},
|
|
249
|
+
"attribute": "indicator-direction",
|
|
250
|
+
"reflect": false,
|
|
251
|
+
"defaultValue": "'down'"
|
|
252
|
+
},
|
|
231
253
|
"withBorder": {
|
|
232
254
|
"type": "boolean",
|
|
233
255
|
"mutable": false,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createStore } from "@stencil/store";
|
|
2
|
+
const { state, set, get } = createStore({
|
|
3
|
+
data: [],
|
|
4
|
+
cart: new Map(),
|
|
5
|
+
productDetails: new Map()
|
|
6
|
+
});
|
|
7
|
+
const initData = (data) => {
|
|
8
|
+
set('data', data);
|
|
9
|
+
const productDetails = new Map();
|
|
10
|
+
for (const category of data) {
|
|
11
|
+
for (const product of category.products) {
|
|
12
|
+
const { type: categoryType, name: categoryName, id: categoryId } = category;
|
|
13
|
+
const { name: { lv: name }, description: { lv: description }, amount, b2bConfiguratorProduct } = product;
|
|
14
|
+
productDetails.set(product.productCode, {
|
|
15
|
+
name,
|
|
16
|
+
description,
|
|
17
|
+
amount,
|
|
18
|
+
discountAmount: b2bConfiguratorProduct.discountAmount,
|
|
19
|
+
categoryType,
|
|
20
|
+
categoryName,
|
|
21
|
+
categoryId,
|
|
22
|
+
b2bConfiguratorProduct
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
set('productDetails', productDetails);
|
|
27
|
+
};
|
|
28
|
+
const addToCart = (product, count) => {
|
|
29
|
+
if (count < 0) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const newCart = new Map(state.cart);
|
|
33
|
+
newCart.set(product, count);
|
|
34
|
+
set('cart', newCart);
|
|
35
|
+
};
|
|
36
|
+
const removeFromCart = (product) => {
|
|
37
|
+
const newCart = new Map(state.cart);
|
|
38
|
+
newCart.delete(product);
|
|
39
|
+
set('cart', newCart);
|
|
40
|
+
};
|
|
41
|
+
const resetCart = () => {
|
|
42
|
+
set('cart', new Map());
|
|
43
|
+
};
|
|
44
|
+
const getCart = () => {
|
|
45
|
+
return Object.fromEntries(get('cart'));
|
|
46
|
+
};
|
|
47
|
+
export { state as b2bState, initData, addToCart, removeFromCart, resetCart, getCart };
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { newSpecPage } from "@stencil/core/testing";
|
|
2
2
|
import { TetB2bConfiguratorCart } from "../tet-b2b-configurator-cart";
|
|
3
3
|
describe('tet-b2b-configurator-cart', () => {
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
const mockIntersectionObserver = jest.fn();
|
|
6
|
+
mockIntersectionObserver.mockReturnValue({
|
|
7
|
+
observe: () => null,
|
|
8
|
+
unobserve: () => null,
|
|
9
|
+
disconnect: () => null
|
|
10
|
+
});
|
|
11
|
+
global.IntersectionObserver = mockIntersectionObserver;
|
|
12
|
+
});
|
|
4
13
|
it('renders', async () => {
|
|
5
14
|
const page = await newSpecPage({
|
|
6
15
|
components: [TetB2bConfiguratorCart],
|
|
@@ -16,7 +25,7 @@ describe('tet-b2b-configurator-cart', () => {
|
|
|
16
25
|
isopen=""
|
|
17
26
|
theme="light"
|
|
18
27
|
transparentbackground=""
|
|
19
|
-
|
|
28
|
+
indicatordirection="down"
|
|
20
29
|
>
|
|
21
30
|
<div class="cart__title--edit">
|
|
22
31
|
components-b2b-cart-title
|