@ppg_pl/tinting 0.0.4 → 0.0.7

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.
Files changed (60) hide show
  1. package/dist/cjs/{index-0a139db0.js → index-b6962659.js} +51 -4
  2. package/dist/cjs/index-b6962659.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/modal-header_9.cjs.entry.js +198 -60
  5. package/dist/cjs/modal-header_9.cjs.entry.js.map +1 -1
  6. package/dist/cjs/tinting.cjs.js +2 -2
  7. package/dist/collection/components/colorinfo/index.js +135 -1
  8. package/dist/collection/components/colorinfo/index.js.map +1 -1
  9. package/dist/collection/components/component/index.js +64 -1
  10. package/dist/collection/components/component/index.js.map +1 -1
  11. package/dist/collection/components/modal/index.css +176 -1
  12. package/dist/collection/components/modal/index.js +120 -33
  13. package/dist/collection/components/modal/index.js.map +1 -1
  14. package/dist/collection/components/slider/index.css +24 -6
  15. package/dist/collection/components/slider/index.js +32 -21
  16. package/dist/collection/components/slider/index.js.map +1 -1
  17. package/dist/collection/types.js.map +1 -1
  18. package/dist/components/index10.js +82 -36
  19. package/dist/components/index10.js.map +1 -1
  20. package/dist/components/index8.js +80 -2
  21. package/dist/components/index8.js.map +1 -1
  22. package/dist/components/index9.js +34 -23
  23. package/dist/components/index9.js.map +1 -1
  24. package/dist/components/my-component.js +13 -2
  25. package/dist/components/my-component.js.map +1 -1
  26. package/dist/esm/{index-f3be6531.js → index-cb79645d.js} +51 -4
  27. package/dist/esm/index-cb79645d.js.map +1 -0
  28. package/dist/esm/loader.js +3 -3
  29. package/dist/esm/modal-header_9.entry.js +198 -60
  30. package/dist/esm/modal-header_9.entry.js.map +1 -1
  31. package/dist/esm/tinting.js +3 -3
  32. package/dist/tinting/p-4ec5261b.entry.js +15 -0
  33. package/dist/tinting/p-4ec5261b.entry.js.map +1 -0
  34. package/dist/tinting/p-5b9dc044.js +3 -0
  35. package/dist/tinting/p-5b9dc044.js.map +1 -0
  36. package/dist/tinting/tinting.esm.js +1 -1
  37. package/dist/tinting/tinting.esm.js.map +1 -1
  38. package/dist/types/components/colorinfo/index.d.ts +17 -1
  39. package/dist/types/components/component/index.d.ts +8 -0
  40. package/dist/types/components/modal/index.d.ts +6 -1
  41. package/dist/types/components.d.ts +16 -2
  42. package/dist/types/types.d.ts +4 -0
  43. package/package.json +3 -2
  44. package/www/build/p-4ec5261b.entry.js +15 -0
  45. package/www/build/p-4ec5261b.entry.js.map +1 -0
  46. package/www/build/p-5b9dc044.js +3 -0
  47. package/www/build/p-5b9dc044.js.map +1 -0
  48. package/www/build/tinting.esm.js +1 -1
  49. package/www/build/tinting.esm.js.map +1 -1
  50. package/www/index.html +76 -12
  51. package/dist/cjs/index-0a139db0.js.map +0 -1
  52. package/dist/esm/index-f3be6531.js.map +0 -1
  53. package/dist/tinting/p-b135c76f.js +0 -3
  54. package/dist/tinting/p-b135c76f.js.map +0 -1
  55. package/dist/tinting/p-d9e19fea.entry.js +0 -15
  56. package/dist/tinting/p-d9e19fea.entry.js.map +0 -1
  57. package/www/build/p-b135c76f.js +0 -3
  58. package/www/build/p-b135c76f.js.map +0 -1
  59. package/www/build/p-d9e19fea.entry.js +0 -15
  60. package/www/build/p-d9e19fea.entry.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-0a139db0.js');
5
+ const index = require('./index-b6962659.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Browser v3.1.0 | MIT Licensed | https://stenciljs.com
@@ -20,7 +20,7 @@ const patchBrowser = () => {
20
20
  };
21
21
 
22
22
  patchBrowser().then(options => {
23
- return index.bootstrapLazy([["modal-header_9.cjs",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"colorname":[1],"show":[32],"readyToClose":[32],"open":[64],"close":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"],[0,"onSelectedColorEmit","handleSelectedColor"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"selectedcolor":[1],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"colorIsSelected":[32],"colorsList":[32],"hasMore":[32],"filters":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[0,"onCurrentColor","handleEmitColor"],[9,"resize","handleResize"],[0,"colorFamilySelected","handleColorFamilySelected"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[0,"modal-header",{"modalName":[1,"modal-name"],"modalLogo":[1,"modal-logo"],"modalDescription":[1,"modal-description"],"selectedColorFamily":[1,"selected-color-family"],"shop":[1],"productName":[1,"product-name"],"isMobile":[4,"is-mobile"],"closeImage":[1,"close-image"],"productSamples":[16],"colorFamilies":[32]}],[0,"my-colorinfo",{"currentColor":[16],"shop":[1],"product":[1],"baselink":[1],"data":[16],"isMobile":[4,"is-mobile"],"infoBoxWidth":[2,"info-box-width"],"closeImage":[1,"close-image"]}],[0,"my-colorbox",{"color":[1],"name":[1],"shop":[1],"product":[1],"isActive":[4,"is-active"],"isCategoryActive":[4,"is-category-active"],"isImageInsteadHex":[16]}],[2,"my-search",{"productname":[1],"shopname":[1],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[2,"my-select",{"options":[16],"placeholder":[1],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32],"filteredOptions":[32],"showDropdown":[32],"selectedValue":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
23
+ return index.bootstrapLazy([["modal-header_9.cjs",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"colorname":[1],"available_testers":[1],"price":[2],"show":[32],"readyToClose":[32],"open":[64],"close":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"],[0,"onSelectedColorEmit","handleSelectedColor"],[0,"addToBasket","addToBasketHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"available_testers":[16],"price":[2],"selectedcolor":[1],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"colorIsSelected":[32],"colorsList":[32],"hasMore":[32],"filters":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[0,"onCurrentColor","handleEmitColor"],[0,"addToBasket","addToBasketHandler"],[9,"resize","handleResize"],[0,"colorFamilySelected","handleColorFamilySelected"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[0,"modal-header",{"modalName":[1,"modal-name"],"modalLogo":[1,"modal-logo"],"modalDescription":[1,"modal-description"],"selectedColorFamily":[1,"selected-color-family"],"shop":[1],"productName":[1,"product-name"],"isMobile":[4,"is-mobile"],"closeImage":[1,"close-image"],"productSamples":[16],"colorFamilies":[32]}],[0,"my-colorinfo",{"currentColor":[16],"shop":[1],"product":[1],"baselink":[1],"availableTesters":[16],"price":[2],"data":[16],"isMobile":[4,"is-mobile"],"infoBoxWidth":[2,"info-box-width"],"closeImage":[1,"close-image"],"basketStatus":[32]}],[0,"my-colorbox",{"color":[1],"name":[1],"shop":[1],"product":[1],"isActive":[4,"is-active"],"isCategoryActive":[4,"is-category-active"],"isImageInsteadHex":[16]}],[2,"my-search",{"productname":[1],"shopname":[1],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[2,"my-select",{"options":[16],"placeholder":[1],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32],"filteredOptions":[32],"showDropdown":[32],"selectedValue":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[1,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
24
24
  });
25
25
 
26
26
  exports.setNonce = index.setNonce;
@@ -3,6 +3,8 @@ import { setDataLayer } from '../../gtmUtils';
3
3
  import { APIURL, accessToken } from '../api';
4
4
  export class MyColorInfo {
5
5
  constructor() {
6
+ this.loadingTimeout = null;
7
+ this.successTimeout = null;
6
8
  this.goToProduct = () => {
7
9
  var _a;
8
10
  this.onCurrentColor.emit(this.currentColor);
@@ -18,6 +20,13 @@ export class MyColorInfo {
18
20
  this.onCloseButtonClick = () => {
19
21
  this.closeInfoBox.emit();
20
22
  };
23
+ this.getHref = () => {
24
+ var _a, _b, _c, _d;
25
+ if (this.baselink) {
26
+ return `${this.baselink}/${(_b = (_a = this === null || this === void 0 ? void 0 : this.currentColor.links) === null || _a === void 0 ? void 0 : _a.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) === null || _b === void 0 ? void 0 : _b.path}`;
27
+ }
28
+ return (_d = (_c = this === null || this === void 0 ? void 0 : this.currentColor.links) === null || _c === void 0 ? void 0 : _c.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) === null || _d === void 0 ? void 0 : _d.path;
29
+ };
21
30
  this.renderSliderOrImage = () => {
22
31
  var _a;
23
32
  if (this.currentColor.imageInsteadHex) {
@@ -30,22 +39,84 @@ export class MyColorInfo {
30
39
  this.capitalizeFirstLetter = (string) => {
31
40
  return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();
32
41
  };
42
+ this.isVeryLightBackground = () => {
43
+ var _a, _b;
44
+ if (this.currentColor.imageInsteadHex)
45
+ return true;
46
+ const hex = (_b = (_a = this.currentColor.hex) === null || _a === void 0 ? void 0 : _a.replace('#', '')) !== null && _b !== void 0 ? _b : '';
47
+ if (hex.length !== 6 && hex.length !== 3)
48
+ return false;
49
+ const r = parseInt(hex.length === 3 ? hex[0] + hex[0] : hex.slice(0, 2), 16) / 255;
50
+ const g = parseInt(hex.length === 3 ? hex[1] + hex[1] : hex.slice(2, 4), 16) / 255;
51
+ const b = parseInt(hex.length === 3 ? hex[2] + hex[2] : hex.slice(4, 6), 16) / 255;
52
+ const luminance = 0.299 * r + 0.587 * g + 0.114 * b;
53
+ return luminance > 0.96;
54
+ };
55
+ this.getButtonClass = () => {
56
+ if (this.currentColor.imageInsteadHex)
57
+ return 'brown';
58
+ return this.isVeryLightBackground() ? 'inverse' : '';
59
+ };
60
+ this.handleAddToBasket = () => {
61
+ var _a;
62
+ if (!((_a = this.availableTesters) === null || _a === void 0 ? void 0 : _a.id_product_attribute))
63
+ return;
64
+ if (this.basketStatus !== 'idle')
65
+ return;
66
+ this.clearBasketTimeouts();
67
+ this.basketStatus = 'loading';
68
+ this.addToBasket.emit({
69
+ id: this.availableTesters.id_product_attribute,
70
+ });
71
+ this.loadingTimeout = setTimeout(() => {
72
+ this.basketStatus = 'success';
73
+ this.successTimeout = setTimeout(() => {
74
+ this.basketStatus = 'idle';
75
+ }, 2500);
76
+ }, 900);
77
+ };
33
78
  this.currentColor = undefined;
34
79
  this.shop = undefined;
35
80
  this.product = undefined;
36
81
  this.baselink = undefined;
82
+ this.availableTesters = undefined;
83
+ this.price = undefined;
37
84
  this.data = null;
38
85
  this.isMobile = false;
39
86
  this.infoBoxWidth = undefined;
40
87
  this.closeImage = 'close.png';
88
+ this.basketStatus = 'idle';
89
+ }
90
+ onColorChange(newColor, oldColor) {
91
+ if ((newColor === null || newColor === void 0 ? void 0 : newColor.name) === (oldColor === null || oldColor === void 0 ? void 0 : oldColor.name))
92
+ return;
93
+ this.resetBasketStatus();
94
+ }
95
+ disconnectedCallback() {
96
+ this.clearBasketTimeouts();
97
+ }
98
+ clearBasketTimeouts() {
99
+ if (this.loadingTimeout) {
100
+ clearTimeout(this.loadingTimeout);
101
+ this.loadingTimeout = null;
102
+ }
103
+ if (this.successTimeout) {
104
+ clearTimeout(this.successTimeout);
105
+ this.successTimeout = null;
106
+ }
107
+ }
108
+ resetBasketStatus() {
109
+ this.clearBasketTimeouts();
110
+ this.basketStatus = 'idle';
41
111
  }
42
112
  render() {
113
+ var _a;
43
114
  return (h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
44
115
  background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,
45
116
  maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
46
117
  } }, this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("div", { class: "boxes__box-content__info", style: {
47
118
  maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
48
- } }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("h2", null, this.currentColor.name), !this.isMobile && h("h4", null, this.currentColor.number), h("div", { class: "boxes__box-content__info__value" }, h("div", { class: "boxes__box-content__info__value-product" }, this.isMobile && h("div", { class: 'divider' }), this.currentColor && (h("button", { onClick: this.goToProduct, class: `button ${this.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}` }, "wybierz kolor"))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
119
+ } }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("h2", null, this.currentColor.name), !this.isMobile && h("h4", null, this.currentColor.number), h("div", { class: "boxes__box-content__info__value" }, h("div", { class: "divider" }), h("div", { class: "boxes__box-content__info__tester" }, h("div", { class: "divider" }), h("div", { class: "tester-text" }, h("h2", null, "Zamow tester"), h("p", null, "Sprawdz go na swojej scianie.")), h("div", { class: "tester-buy" }, h("div", { class: "price" }, this.price ? `${this.price} zl` : ''), this.isMobile && h("div", { class: 'divider' }), this.basketStatus !== 'success' && (h("button", { class: `button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''} ${this.basketStatus === 'loading' ? 'is-loading' : ''}`, onClick: this.handleAddToBasket, disabled: !this.availableTesters || this.basketStatus === 'loading' }, h("span", { class: "button-content" }, h("span", { class: "shape-icon", "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "16", viewBox: "0 0 15 16" }, h("path", { class: "shape-icon__path", transform: "translate(0.0867462 0)", d: "M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z" }))), !this.availableTesters ? 'Tester obecnie niedostepny' : 'Dodaj do koszyka'), this.basketStatus === 'loading' && (h("span", { class: "spinner", "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24" }, h("path", { d: "M12 2 A10 10 0 1 1 2 12", fill: "none", stroke: "currentColor", "stroke-width": "2.5", "stroke-linecap": "round" })))))), this.basketStatus === 'success' && (h("div", { class: `basket-status basket-status--success ${this.getButtonClass()}`, role: "status", "aria-live": "polite" }, h("span", { class: "check-icon", "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24" }, h("path", { d: "M5 12.5l4.5 4.5L19 7.5", fill: "none", stroke: "currentColor", "stroke-width": "2.5", "stroke-linecap": "round", "stroke-linejoin": "round" }))), h("span", null, h("strong", null, "Dodano"), " do koszyka"))))), h("div", { class: "boxes__box-content__info__value-product" }, this.currentColor && ((_a = this.currentColor.links) === null || _a === void 0 ? void 0 : _a.find((link) => (link === null || link === void 0 ? void 0 : link.shop) === this.shop)) && (h("a", { onClick: this.goToProduct, href: this.getHref(), class: `button ${this.getButtonClass()}` }, "wybierz kolor"))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
49
120
  }
50
121
  static get is() { return "my-colorinfo"; }
51
122
  static get properties() {
@@ -121,6 +192,43 @@ export class MyColorInfo {
121
192
  "attribute": "baselink",
122
193
  "reflect": false
123
194
  },
195
+ "availableTesters": {
196
+ "type": "unknown",
197
+ "mutable": false,
198
+ "complexType": {
199
+ "original": "AvailableTester | null",
200
+ "resolved": "null | { id_product_attribute: number; color_name: string; }",
201
+ "references": {
202
+ "AvailableTester": {
203
+ "location": "import",
204
+ "path": "../../types"
205
+ }
206
+ }
207
+ },
208
+ "required": false,
209
+ "optional": false,
210
+ "docs": {
211
+ "tags": [],
212
+ "text": ""
213
+ }
214
+ },
215
+ "price": {
216
+ "type": "number",
217
+ "mutable": false,
218
+ "complexType": {
219
+ "original": "number | null",
220
+ "resolved": "null | number",
221
+ "references": {}
222
+ },
223
+ "required": false,
224
+ "optional": false,
225
+ "docs": {
226
+ "tags": [],
227
+ "text": ""
228
+ },
229
+ "attribute": "price",
230
+ "reflect": false
231
+ },
124
232
  "data": {
125
233
  "type": "unknown",
126
234
  "mutable": false,
@@ -197,6 +305,11 @@ export class MyColorInfo {
197
305
  }
198
306
  };
199
307
  }
308
+ static get states() {
309
+ return {
310
+ "basketStatus": {}
311
+ };
312
+ }
200
313
  static get events() {
201
314
  return [{
202
315
  "method": "onCurrentColor",
@@ -218,6 +331,21 @@ export class MyColorInfo {
218
331
  }
219
332
  }
220
333
  }
334
+ }, {
335
+ "method": "addToBasket",
336
+ "name": "addToBasket",
337
+ "bubbles": true,
338
+ "cancelable": true,
339
+ "composed": true,
340
+ "docs": {
341
+ "tags": [],
342
+ "text": ""
343
+ },
344
+ "complexType": {
345
+ "original": "{ id: number }",
346
+ "resolved": "{ id: number; }",
347
+ "references": {}
348
+ }
221
349
  }, {
222
350
  "method": "closeInfoBox",
223
351
  "name": "closeInfoBox",
@@ -235,5 +363,11 @@ export class MyColorInfo {
235
363
  }
236
364
  }];
237
365
  }
366
+ static get watchers() {
367
+ return [{
368
+ "propName": "currentColor",
369
+ "methodName": "onColorChange"
370
+ }];
371
+ }
238
372
  }
239
373
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/colorinfo/index.tsx"],"names":[],"mapp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AChC,CAAC,IAAI,CAAC,QAAQ,IAAI,cAAK,IAAI,CAAC,YAAY,CAAC,MAAM,CAAM;QAEtD,WAAK,KAAK,EAAC,iCAAiC;UAI1C,WAAK,KAAK,EAAC,yCAAyC;YAMjD,IAAI,CAAC,QAAQ,IAAI,WAAK,KAAK,EAAE,SAAS,GAAQ;YAC9C,IAAI,CAAC,YAAY,IAAI,CACpB,cAAQ,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,oBAE3I,CACV,CACG,CACF,CACF;MACN,WAAK,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,mBAAmB,EAAE,CAAO,CACtE,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { Color, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n @Event({ bubbles: true, composed: true }) onCurrentColor: EventEmitter<Color>;\n\n @Event() closeInfoBox: EventEmitter;\n\n goToProduct = () => {\n this.onCurrentColor.emit(this.currentColor);\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.currentColor.name}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n\n <div class=\"boxes__box-content__info__value\">\n {/* <div class=\"boxes__box-content__info__value-image\">\n {this.currentColor?.image! && <img src={`${APIURL}/assets/${this.currentColor.image}?access_token=${accessToken}`} alt=\"color-image\" />}\n </div> */}\n <div class=\"boxes__box-content__info__value-product\">\n {/* <div>\n {!this.isMobile && <p>Produkt:</p>}\n {this.isMobile && <h2>{this.currentColor?.name}</h2>} <p>{this.product}</p>\n </div> */}\n\n {this.isMobile && <div class={'divider'}></div>}\n {this.currentColor && (\n <button onClick={this.goToProduct} class={`button ${this.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}`}>\n wybierz kolor\n </button>\n )}\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/colorinfo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAK7C,MAAM,OAAO,WAAW;;IAYd,mBAAc,GAAyC,IAAI,CAAC;IAC5D,mBAAc,GAAyC,IAAI,CAAC;IAiCpE,gBAAW,GAAG,GAAG,EAAE;;MACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;MAC5C,IAAI,CAAC,YAAY;QACf,YAAY,CAAC;UACX,KAAK,EAAE,aAAa;UACpB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI;SAC/B,CAAC,CAAC;MAEL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC,CAAC;IAEF,uBAAkB,GAAG,GAAG,EAAE;MACxB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC,CAAC;IAEF,YAAO,GAAG,GAAG,EAAE;;MACb,IAAI,IAAI,CAAC,QAAQ,EAAE;QACjB,OAAO,GAAG,IAAI,CAAC,QAAQ,IAAI,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I,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,UAAU,IAAI,CAAC,cAAc,EAAE,EAAE,oBAExF,CACL,CACG,CACF,CACF;MACN,WAAK,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,mBAAmB,EAAE,CAAO,CACtE,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, Watch, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { AvailableTester, Color, Link, Product } from '../../types';\nimport { APIURL, accessToken } from '../api';\n\n@Component({\n tag: 'my-colorinfo',\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() availableTesters: AvailableTester | null;\n @Prop() price: number | null;\n @Prop() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n @State() basketStatus: 'idle' | 'loading' | 'success' = 'idle';\n private loadingTimeout: ReturnType<typeof setTimeout> | null = null;\n private successTimeout: ReturnType<typeof setTimeout> | null = null;\n @Event({ bubbles: true, composed: true }) onCurrentColor: EventEmitter<Color>;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n\n @Event() closeInfoBox: EventEmitter;\n\n @Watch('currentColor')\n onColorChange(newColor: Color, oldColor: Color) {\n if (newColor?.name === oldColor?.name) return;\n this.resetBasketStatus();\n }\n\n disconnectedCallback() {\n this.clearBasketTimeouts();\n }\n\n private clearBasketTimeouts() {\n if (this.loadingTimeout) {\n clearTimeout(this.loadingTimeout);\n this.loadingTimeout = null;\n }\n\n if (this.successTimeout) {\n clearTimeout(this.successTimeout);\n this.successTimeout = null;\n }\n }\n\n private resetBasketStatus() {\n this.clearBasketTimeouts();\n this.basketStatus = 'idle';\n }\n\n goToProduct = () => {\n this.onCurrentColor.emit(this.currentColor);\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n });\n\n this.closeInfoBox.emit();\n };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\n };\n\n getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n }\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\n };\n\n renderSliderOrImage = () => {\n if (this.currentColor.imageInsteadHex) {\n return <img class={'color-big-image'} src={`${APIURL}/assets/${this.currentColor.bigImage}?access_token=${accessToken}`} alt=\"color-image\" />;\n } else {\n return <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images}></my-slider>;\n }\n };\n\n capitalizeFirstLetter = (string: string) => {\n return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();\n };\n\n isVeryLightBackground = (): boolean => {\n if (this.currentColor.imageInsteadHex) return true;\n const hex = this.currentColor.hex?.replace('#', '') ?? '';\n if (hex.length !== 6 && hex.length !== 3) return false;\n const r = parseInt(hex.length === 3 ? hex[0] + hex[0] : hex.slice(0, 2), 16) / 255;\n const g = parseInt(hex.length === 3 ? hex[1] + hex[1] : hex.slice(2, 4), 16) / 255;\n const b = parseInt(hex.length === 3 ? hex[2] + hex[2] : hex.slice(4, 6), 16) / 255;\n const luminance = 0.299 * r + 0.587 * g + 0.114 * b;\n return luminance > 0.96;\n };\n\n getButtonClass = () => {\n if (this.currentColor.imageInsteadHex) return 'brown';\n return this.isVeryLightBackground() ? 'inverse' : '';\n };\n\n handleAddToBasket = () => {\n if (!this.availableTesters?.id_product_attribute) return;\n if (this.basketStatus !== 'idle') return;\n\n this.clearBasketTimeouts();\n this.basketStatus = 'loading';\n this.addToBasket.emit({\n id: this.availableTesters.id_product_attribute,\n });\n\n this.loadingTimeout = setTimeout(() => {\n this.basketStatus = 'success';\n this.successTimeout = setTimeout(() => {\n this.basketStatus = 'idle';\n }, 2500);\n }, 900);\n };\n\n render() {\n return (\n <div\n class={`boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`}\n style={{\n background: this.currentColor.imageInsteadHex ? 'white' : this.currentColor.hex,\n maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,\n }}\n >\n {this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <div\n class=\"boxes__box-content__info\"\n style={{\n maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,\n }}\n >\n {!this.isMobile && <img class={'closebtn'} onClick={this.onCloseButtonClick} src={getAssetPath(`./assets/${this.closeImage}`)} alt=\"closebtn\" />}\n <h2>{this.currentColor.name}</h2>\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n\n <div class=\"boxes__box-content__info__value\">\n <div class=\"divider\"></div>\n <div class=\"boxes__box-content__info__tester\">\n <div class=\"divider\"></div>\n <div class=\"tester-text\">\n <h2>Zamow tester</h2>\n <p>Sprawdz go na swojej scianie.</p>\n </div>\n <div class=\"tester-buy\">\n <div class=\"price\">{this.price ? `${this.price} zl` : ''}</div>\n {this.isMobile && <div class={'divider'}></div>}\n {this.basketStatus !== 'success' && (\n <button\n class={`button fit ${this.getButtonClass()} ${!this.availableTesters ? 'disabled' : ''} ${\n this.basketStatus === 'loading' ? 'is-loading' : ''\n }`}\n onClick={this.handleAddToBasket}\n disabled={!this.availableTesters || this.basketStatus === 'loading'}\n >\n <span class=\"button-content\">\n <span class=\"shape-icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"16\" viewBox=\"0 0 15 16\">\n <path\n class=\"shape-icon__path\"\n transform=\"translate(0.0867462 0)\"\n d=\"M13.246571 12.763281L11.931726 4.961875C11.801879 4.1936703 11.13567 3.6319427 10.35657 3.63375L9.7429771 3.63375L9.7429771 3.1025C9.7429771 1.3890365 8.35394 0 6.6404767 0C4.9270134 0 3.537977 1.3890365 3.537977 3.1025L3.537977 3.63375L2.9217269 3.63375C2.1426277 3.6319427 1.4764187 4.1936703 1.3465706 4.961875L0.034383144 12.763281C-0.086738147 13.483807 0.11555123 14.221112 0.58740741 14.778946C1.0592636 15.336781 1.7528107 15.658594 2.4834456 15.658594L10.797508 15.658594C11.528143 15.658594 12.22169 15.336781 12.693546 14.778946C13.165402 14.221112 13.367692 13.483807 13.246571 12.763281L13.246571 12.763281ZM4.3348517 3.0892186C4.3348517 1.8158572 5.3671155 0.78359371 6.6404767 0.78359371C7.9138384 0.78359371 8.9461021 1.8158572 8.9461021 3.0892186L8.9461021 3.6204686L4.3348517 3.6204686L4.3348517 3.0892186ZM12.08579 14.264063C11.765244 14.643165 11.293964 14.86172 10.797508 14.86172L2.4834456 14.86172C1.9871488 14.862442 1.5158025 14.644215 1.195269 14.265309C0.87473541 13.886404 0.73765546 13.385406 0.82063317 12.896093L2.1248519 5.092031C2.1891608 4.703371 2.5278175 4.4200282 2.9217269 4.4252396L3.5353208 4.4252396L3.5353208 5.5834374C3.5353208 5.8034883 3.7137072 5.9818749 3.9337583 5.9818749C4.1538091 5.9818749 4.3321958 5.8034883 4.3321958 5.5834374L4.3321958 4.4252396L8.9461021 4.4252396L8.9461021 5.5834374C8.9461021 5.8034883 9.1244888 5.9818749 9.3445396 5.9818749C9.5645905 5.9818749 9.7429771 5.8034883 9.7429771 5.5834374L9.7429771 4.4252396L10.359227 4.4252396C10.753137 4.4200282 11.091793 4.703371 11.156102 5.092031L12.46032 12.896093C12.542204 13.384947 12.40527 13.885097 12.08579 14.264063L12.08579 14.264063Z\"\n />\n </svg>\n </span>\n {!this.availableTesters ? 'Tester obecnie niedostepny' : 'Dodaj do koszyka'}\n </span>\n {this.basketStatus === 'loading' && (\n <span class=\"spinner\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\">\n <path d=\"M12 2 A10 10 0 1 1 2 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" />\n </svg>\n </span>\n )}\n </button>\n )}\n {this.basketStatus === 'success' && (\n <div class={`basket-status basket-status--success ${this.getButtonClass()}`} role=\"status\" aria-live=\"polite\">\n <span class=\"check-icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\">\n <path d=\"M5 12.5l4.5 4.5L19 7.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </span>\n <span>\n <strong>Dodano</strong> do koszyka\n </span>\n </div>\n )}\n </div>\n </div>\n <div class=\"boxes__box-content__info__value-product\">\n {this.currentColor && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a onClick={this.goToProduct} href={this.getHref()} class={`button ${this.getButtonClass()}`}>\n wybierz kolor\n </a>\n )}\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">{this.renderSliderOrImage()}</div>\n </div>\n );\n }\n}\n"]}
@@ -6,6 +6,8 @@ export class MyModalBundle {
6
6
  this.product = undefined;
7
7
  this.baselink = undefined;
8
8
  this.colorname = undefined;
9
+ this.available_testers = undefined;
10
+ this.price = undefined;
9
11
  this.show = false;
10
12
  this.readyToClose = false;
11
13
  }
@@ -25,10 +27,16 @@ export class MyModalBundle {
25
27
  handleSelectedColor(event) {
26
28
  this.onSelectedColor.emit(event.detail);
27
29
  }
30
+ addToBasketHandler(event) {
31
+ this.addToBasket.emit(event.detail);
32
+ }
28
33
  render() {
29
34
  let content = null;
30
35
  if (this.show) {
31
- content = [h("my-backdrop", null), h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname })];
36
+ content = [
37
+ h("my-backdrop", null),
38
+ h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname, available_testers: this.available_testers ? JSON.parse(this.available_testers) : null, price: this.price }),
39
+ ];
32
40
  }
33
41
  return (h("div", { onClick: () => {
34
42
  if (this.readyToClose) {
@@ -126,6 +134,40 @@ export class MyModalBundle {
126
134
  },
127
135
  "attribute": "colorname",
128
136
  "reflect": false
137
+ },
138
+ "available_testers": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "string | null",
143
+ "resolved": "null | string",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": ""
151
+ },
152
+ "attribute": "available_testers",
153
+ "reflect": false
154
+ },
155
+ "price": {
156
+ "type": "number",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "number | null",
160
+ "resolved": "null | number",
161
+ "references": {}
162
+ },
163
+ "required": false,
164
+ "optional": false,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": ""
168
+ },
169
+ "attribute": "price",
170
+ "reflect": false
129
171
  }
130
172
  };
131
173
  }
@@ -156,6 +198,21 @@ export class MyModalBundle {
156
198
  }
157
199
  }
158
200
  }
201
+ }, {
202
+ "method": "addToBasket",
203
+ "name": "addToBasket",
204
+ "bubbles": true,
205
+ "cancelable": true,
206
+ "composed": true,
207
+ "docs": {
208
+ "tags": [],
209
+ "text": ""
210
+ },
211
+ "complexType": {
212
+ "original": "{ id: number }",
213
+ "resolved": "{ id: number; }",
214
+ "references": {}
215
+ }
159
216
  }];
160
217
  }
161
218
  static get methods() {
@@ -214,6 +271,12 @@ export class MyModalBundle {
214
271
  "target": undefined,
215
272
  "capture": false,
216
273
  "passive": false
274
+ }, {
275
+ "name": "addToBasket",
276
+ "method": "addToBasketHandler",
277
+ "target": undefined,
278
+ "capture": false,
279
+ "passive": false
217
280
  }];
218
281
  }
219
282
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/component/index.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAQxG,MAAM,OAAO,aAAa;;;;;;gBAQR,KAAK;wBACG,KAAK;;EAG7B,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;EACnB,CAAC;EAGD,KAAK,CAAC,KAAK;IACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;EACpB,CAAC;EAGD,sBAAsB,CAAC,KAAkB;IACvC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;EAC9C,CAAC;EAGD,iBAAiB;IACf,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IAClB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;EAC5B,CAAC;EAGD,mBAAmB,CAAC,KAAyB;IAC3C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;EAC1C,CAAC;EAED,MAAM;IACJ,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,IAAI,CAAC,IAAI,EAAE;MACb,OAAO,GAAG,CAAC,sBAA2B,EAAE,gBAAU,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,GAAa,CAAC,CAAC;KAChK;IACD,OAAO,CACL,WACE,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,IAAI,CAAC,YAAY,EAAE;UACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;MACH,CAAC;MAED,EAAC,MAAM;QACL,kBACG;;;;;;;;;mEASsD,CAChD,CACF;MACT,WAAK,KAAK,EAAC,iBAAiB,IAAE,OAAO,CAAO;MAC5C;QACE,cAAQ,GAAG,EAAC,0DAA0D,EAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAW,CAC9I,CACP,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, h, Event, EventEmitter } from '@stencil/core';\nimport { Color } from '../../types';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'index.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n @Event({ bubbles: true, composed: true }) onSelectedColor: EventEmitter<Color>;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() colorname: string | null;\n\n @State() show = false;\n @State() readyToClose = false;\n\n @Method()\n async open() {\n this.show = true;\n }\n\n @Method()\n async close() {\n this.show = false;\n }\n\n @Listen('readyToCLose')\n setReadyToCloseHandler(value: CustomEvent) {\n this.readyToClose = value.detail.observable;\n }\n\n @Listen('close')\n closeModalHandler() {\n this.show = false;\n this.readyToClose = false;\n }\n\n @Listen('onSelectedColorEmit')\n handleSelectedColor(event: CustomEvent<Color>) {\n this.onSelectedColor.emit(event.detail);\n }\n\n render() {\n let content = null;\n if (this.show) {\n content = [<my-backdrop></my-backdrop>, <my-modal shop={this.shop} product={this.product} baselink={this.baselink} selectedcolor={this.colorname}></my-modal>];\n }\n return (\n <div\n onClick={() => {\n if (this.readyToClose) {\n this.closeModalHandler();\n }\n }}\n >\n <Helmet>\n <script>\n {`(function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ 'gtm.start': new Date().getTime(), 'event': 'gtm.js' });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', 'GTM-537BV9VT');`}\n </script>\n </Helmet>\n <div class=\"tinting-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-537BV9VT\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/component/index.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAQxG,MAAM,OAAO,aAAa;;;;;;;;gBAWR,KAAK;wBACG,KAAK;;EAG7B,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;EACnB,CAAC;EAGD,KAAK,CAAC,KAAK;IACT,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;EACpB,CAAC;EAGD,sBAAsB,CAAC,KAAkB;IACvC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;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,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, h, Event, EventEmitter } from '@stencil/core';\nimport { Color } from '../../types';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'index.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n @Event({ bubbles: true, composed: true }) onSelectedColor: EventEmitter<Color>;\n @Event({ bubbles: true, composed: true }) addToBasket: EventEmitter<{ id: number }>;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() colorname: string | null;\n @Prop() available_testers: string | null;\n @Prop() price: number | null;\n\n @State() show = false;\n @State() readyToClose = false;\n\n @Method()\n async open() {\n this.show = true;\n }\n\n @Method()\n async close() {\n this.show = false;\n }\n\n @Listen('readyToCLose')\n setReadyToCloseHandler(value: CustomEvent) {\n this.readyToClose = value.detail.observable;\n }\n\n @Listen('close')\n closeModalHandler() {\n this.show = false;\n this.readyToClose = false;\n }\n\n @Listen('onSelectedColorEmit')\n handleSelectedColor(event: CustomEvent<Color>) {\n this.onSelectedColor.emit(event.detail);\n }\n\n @Listen('addToBasket')\n addToBasketHandler(event: CustomEvent<{ id: number }>) {\n this.addToBasket.emit(event.detail);\n }\n\n render() {\n let content = null;\n if (this.show) {\n content = [\n <my-backdrop></my-backdrop>,\n <my-modal\n shop={this.shop}\n product={this.product}\n baselink={this.baselink}\n selectedcolor={this.colorname}\n available_testers={this.available_testers ? JSON.parse(this.available_testers) : null}\n price={this.price}\n ></my-modal>,\n ];\n }\n return (\n <div\n onClick={() => {\n if (this.readyToClose) {\n this.closeModalHandler();\n }\n }}\n >\n <Helmet>\n <script>\n {`(function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ 'gtm.start': new Date().getTime(), 'event': 'gtm.js' });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', 'GTM-537BV9VT');`}\n </script>\n </Helmet>\n <div class=\"tinting-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-537BV9VT\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"]}
@@ -168,12 +168,15 @@
168
168
  }
169
169
  .my-modal__wrapper .boxes__box-content__info__value {
170
170
  display: flex;
171
- flex-direction: row;
171
+ flex-direction: column;
172
172
  justify-content: flex-start;
173
+ align-items: flex-start;
174
+ gap: 20px;
173
175
  }
174
176
  @media (max-width: 1024px) {
175
177
  .my-modal__wrapper .boxes__box-content__info__value {
176
178
  justify-content: flex-start;
179
+ margin-top: 30px;
177
180
  }
178
181
  }
179
182
  @media (max-width: 768px) {
@@ -242,6 +245,39 @@
242
245
  flex-direction: column;
243
246
  }
244
247
  }
248
+ .my-modal__wrapper .boxes__box-content__info__tester {
249
+ display: flex;
250
+ flex-direction: column;
251
+ gap: 15px;
252
+ width: 100%;
253
+ }
254
+ .my-modal__wrapper .boxes__box-content__info__tester .tester-text h2 {
255
+ margin: 0 0 10px;
256
+ font-size: 18px;
257
+ font-weight: 700;
258
+ }
259
+ .my-modal__wrapper .boxes__box-content__info__tester .tester-text p {
260
+ margin: 0;
261
+ font-size: 14px;
262
+ }
263
+ .my-modal__wrapper .boxes__box-content__info__tester .tester-buy {
264
+ display: flex;
265
+ align-items: center;
266
+ gap: 15px;
267
+ width: 100%;
268
+ flex-wrap: nowrap;
269
+ min-width: 0;
270
+ }
271
+ @media (max-width: 1024px) {
272
+ .my-modal__wrapper .boxes__box-content__info__tester .tester-buy {
273
+ flex-direction: column;
274
+ align-items: flex-start;
275
+ }
276
+ }
277
+ .my-modal__wrapper .boxes__box-content__info .price {
278
+ font-size: 20px;
279
+ font-weight: 600;
280
+ }
245
281
  .my-modal__wrapper .boxes__box-content__slider {
246
282
  width: 60%;
247
283
  min-width: 60%;
@@ -341,6 +377,28 @@
341
377
  transition: all 0.7s ease-in-out;
342
378
  border: none;
343
379
  cursor: pointer;
380
+ display: flex;
381
+ align-items: center;
382
+ gap: 5px;
383
+ }
384
+ .my-modal .button .shape-icon,
385
+ .my-modal a .shape-icon {
386
+ display: inline-flex;
387
+ }
388
+ .my-modal .button .shape-icon svg,
389
+ .my-modal a .shape-icon svg {
390
+ display: block;
391
+ }
392
+ .my-modal .button .shape-icon path,
393
+ .my-modal .button .shape-icon .shape-icon__path,
394
+ .my-modal a .shape-icon path,
395
+ .my-modal a .shape-icon .shape-icon__path {
396
+ fill: currentColor;
397
+ transition: fill 0.7s ease-in-out;
398
+ }
399
+ .my-modal .button.fit,
400
+ .my-modal a.fit {
401
+ padding: 10px 15px;
344
402
  }
345
403
  .my-modal .button:hover,
346
404
  .my-modal a:hover {
@@ -367,6 +425,50 @@
367
425
  color: #232323;
368
426
  background-color: #fff;
369
427
  }
428
+ .my-modal .button.inverse svg path,
429
+ .my-modal a.inverse svg path {
430
+ fill: #fff;
431
+ }
432
+ .my-modal .button:disabled, .my-modal .button.disabled,
433
+ .my-modal a:disabled,
434
+ .my-modal a.disabled {
435
+ cursor: not-allowed;
436
+ opacity: 0.5;
437
+ }
438
+ .my-modal .button.is-loading,
439
+ .my-modal a.is-loading {
440
+ position: relative;
441
+ cursor: wait;
442
+ }
443
+ .my-modal .button.is-loading:hover,
444
+ .my-modal a.is-loading:hover {
445
+ background-color: inherit;
446
+ color: inherit;
447
+ }
448
+ .my-modal .button.is-loading .button-content,
449
+ .my-modal a.is-loading .button-content {
450
+ visibility: hidden;
451
+ }
452
+ .my-modal .button.is-loading .spinner,
453
+ .my-modal a.is-loading .spinner {
454
+ position: absolute;
455
+ inset: 0;
456
+ display: flex;
457
+ align-items: center;
458
+ justify-content: center;
459
+ animation: basket-spin 0.9s linear infinite;
460
+ color: currentColor;
461
+ }
462
+ .my-modal .button.is-loading .spinner svg,
463
+ .my-modal a.is-loading .spinner svg {
464
+ display: block;
465
+ }
466
+ .my-modal .button .button-content,
467
+ .my-modal a .button-content {
468
+ display: inline-flex;
469
+ align-items: center;
470
+ gap: 5px;
471
+ }
370
472
  @media (max-width: 1024px) {
371
473
  .my-modal .button,
372
474
  .my-modal a {
@@ -383,4 +485,77 @@
383
485
  }
384
486
  .my-modal > .button {
385
487
  margin: 10px auto;
488
+ }
489
+ .my-modal .basket-status {
490
+ cursor: default;
491
+ pointer-events: none;
492
+ max-width: 100%;
493
+ min-width: 0;
494
+ }
495
+ .my-modal .basket-status--success {
496
+ display: inline-flex;
497
+ align-items: center;
498
+ gap: 10px;
499
+ padding: 12px 18px;
500
+ background-color: #fff;
501
+ color: #232323;
502
+ border-radius: 28px 28px 28px 0;
503
+ box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.1);
504
+ font-size: 14px;
505
+ white-space: nowrap;
506
+ animation: basket-success-in 0.25s ease-out;
507
+ max-width: 100%;
508
+ min-width: 0;
509
+ flex: 1 1 auto;
510
+ }
511
+ .my-modal .basket-status--success > span:last-child {
512
+ min-width: 0;
513
+ overflow: hidden;
514
+ text-overflow: ellipsis;
515
+ }
516
+ .my-modal .basket-status--success .check-icon {
517
+ display: inline-flex;
518
+ color: #2bb673;
519
+ }
520
+ .my-modal .basket-status--success .check-icon svg {
521
+ display: block;
522
+ width: 20px;
523
+ height: 20px;
524
+ }
525
+ .my-modal .basket-status--success strong {
526
+ font-weight: 700;
527
+ }
528
+ .my-modal .basket-status--success.inverse {
529
+ background-color: #232323;
530
+ color: #fff;
531
+ }
532
+ .my-modal .basket-status--success.brown {
533
+ background-color: #3c2114;
534
+ color: #fff;
535
+ }
536
+ @media (max-width: 1024px) {
537
+ .my-modal .basket-status--success {
538
+ font-size: 13px;
539
+ padding: 12px 22px;
540
+ border-radius: 22px 22px 22px 0;
541
+ white-space: normal;
542
+ width: 100%;
543
+ justify-content: center;
544
+ }
545
+ }
546
+
547
+ @keyframes basket-spin {
548
+ to {
549
+ transform: rotate(360deg);
550
+ }
551
+ }
552
+ @keyframes basket-success-in {
553
+ from {
554
+ opacity: 0;
555
+ transform: translateX(-8px);
556
+ }
557
+ to {
558
+ opacity: 1;
559
+ transform: translateX(0);
560
+ }
386
561
  }