@ppg_pl/pallete 2.0.10 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/my-backdrop_8.cjs.entry.js +9 -9
- package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
- package/dist/cjs/pallete.cjs.js +1 -1
- package/dist/collection/components/my-colorinfo/my-colorinfo.js +6 -23
- package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -1
- package/dist/collection/components/my-component/my-component.js +19 -0
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/components/my-colorinfo2.js +6 -9
- package/dist/components/my-colorinfo2.js.map +1 -1
- package/dist/components/my-component.js +5 -1
- package/dist/components/my-component.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/my-backdrop_8.entry.js +9 -9
- package/dist/esm/my-backdrop_8.entry.js.map +1 -1
- package/dist/esm/pallete.js +1 -1
- package/dist/pallete/p-d7466235.entry.js +2 -0
- package/dist/pallete/p-d7466235.entry.js.map +1 -0
- package/dist/pallete/pallete.esm.js +1 -1
- package/dist/pallete/pallete.esm.js.map +1 -1
- package/dist/types/components/my-colorinfo/my-colorinfo.d.ts +1 -3
- package/dist/types/components/my-component/my-component.d.ts +1 -0
- package/dist/types/components.d.ts +1 -1
- package/package.json +1 -1
- package/www/build/p-d7466235.entry.js +2 -0
- package/www/build/p-d7466235.entry.js.map +1 -0
- package/www/build/pallete.esm.js +1 -1
- package/www/build/pallete.esm.js.map +1 -1
- package/dist/pallete/p-a7ce8105.entry.js +0 -2
- package/dist/pallete/p-a7ce8105.entry.js.map +0 -1
- package/www/build/p-a7ce8105.entry.js +0 -2
- package/www/build/p-a7ce8105.entry.js.map +0 -1
package/dist/cjs/pallete.cjs.js
CHANGED
|
@@ -20,7 +20,7 @@ const patchBrowser = () => {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
patchBrowser().then(options => {
|
|
23
|
-
return index.bootstrapLazy([["my-backdrop_8.cjs",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"show":[32],"readyToClose":[32],"open":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"closeImage":[1,"close-image"],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"colors":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[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-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
|
|
23
|
+
return index.bootstrapLazy([["my-backdrop_8.cjs",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"show":[32],"readyToClose":[32],"open":[64],"close":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"closeImage":[1,"close-image"],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"colors":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[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-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
exports.setNonce = index.setNonce;
|
|
@@ -3,10 +3,8 @@ import { setDataLayer } from '../../gtmUtils';
|
|
|
3
3
|
import { APIURL, accessToken } from '../api';
|
|
4
4
|
export class MyColorInfo {
|
|
5
5
|
constructor() {
|
|
6
|
-
this.goToProduct = (
|
|
6
|
+
this.goToProduct = () => {
|
|
7
7
|
var _a;
|
|
8
|
-
e.preventDefault();
|
|
9
|
-
this.closeModalHandler();
|
|
10
8
|
this.currentColor &&
|
|
11
9
|
setDataLayer({
|
|
12
10
|
event: 'GoToProduct',
|
|
@@ -14,6 +12,7 @@ export class MyColorInfo {
|
|
|
14
12
|
product: this.product,
|
|
15
13
|
color: (_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.name,
|
|
16
14
|
});
|
|
15
|
+
this.closeInfoBox.emit();
|
|
17
16
|
};
|
|
18
17
|
this.onCloseButtonClick = () => {
|
|
19
18
|
this.closeInfoBox.emit();
|
|
@@ -32,7 +31,9 @@ export class MyColorInfo {
|
|
|
32
31
|
if (this.baselink) {
|
|
33
32
|
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}`;
|
|
34
33
|
}
|
|
35
|
-
|
|
34
|
+
else {
|
|
35
|
+
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;
|
|
36
|
+
}
|
|
36
37
|
};
|
|
37
38
|
this.capitalizeFirstLetter = (string) => {
|
|
38
39
|
return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();
|
|
@@ -46,9 +47,6 @@ export class MyColorInfo {
|
|
|
46
47
|
this.infoBoxWidth = undefined;
|
|
47
48
|
this.closeImage = 'close.png';
|
|
48
49
|
}
|
|
49
|
-
closeModalHandler() {
|
|
50
|
-
this.close.emit();
|
|
51
|
-
}
|
|
52
50
|
render() {
|
|
53
51
|
var _a;
|
|
54
52
|
return (h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
|
|
@@ -56,7 +54,7 @@ export class MyColorInfo {
|
|
|
56
54
|
maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
|
|
57
55
|
} }, this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("div", { class: "boxes__box-content__info", style: {
|
|
58
56
|
maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
|
|
59
|
-
} }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && h("h2", null, this.capitalizeFirstLetter(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 && ((_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, class:
|
|
57
|
+
} }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && h("h2", null, this.capitalizeFirstLetter(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 && ((_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.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}` }, "wybierz kolor"))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
|
|
60
58
|
}
|
|
61
59
|
static get is() { return "my-colorinfo"; }
|
|
62
60
|
static get properties() {
|
|
@@ -224,21 +222,6 @@ export class MyColorInfo {
|
|
|
224
222
|
"resolved": "any",
|
|
225
223
|
"references": {}
|
|
226
224
|
}
|
|
227
|
-
}, {
|
|
228
|
-
"method": "close",
|
|
229
|
-
"name": "close",
|
|
230
|
-
"bubbles": true,
|
|
231
|
-
"cancelable": true,
|
|
232
|
-
"composed": true,
|
|
233
|
-
"docs": {
|
|
234
|
-
"tags": [],
|
|
235
|
-
"text": ""
|
|
236
|
-
},
|
|
237
|
-
"complexType": {
|
|
238
|
-
"original": "any",
|
|
239
|
-
"resolved": "any",
|
|
240
|
-
"references": {}
|
|
241
|
-
}
|
|
242
225
|
}];
|
|
243
226
|
}
|
|
244
227
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my-colorinfo.js","sourceRoot":"","sources":["../../../src/components/my-colorinfo/my-colorinfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"my-colorinfo.js","sourceRoot":"","sources":["../../../src/components/my-colorinfo/my-colorinfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAAY,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAK7C,MAAM,OAAO,WAAW;;IAYtB,gBAAW,GAAG,GAAG,EAAE;;MACjB,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;MACL,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,wBAAmB,GAAG,GAAG,EAAE;;MACzB,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE;QACrC,OAAO,WAAK,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG,MAAM,WAAW,IA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C9C,IAAI,CAAC,YAAY,KAAI,MAAA,IAAI,CAAC,YAAY,CAAC,KAAK,0CAAE,IAAI,CAAC,CAAC,IAAU,EAAE,EAAE,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,MAAK,IAAI,CAAC,IAAI,CAAC,CAAA,IAAI,CAC/F,SACE,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,EACpB,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,oBAG/G,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, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { 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() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n\n @Event() closeInfoBox: EventEmitter;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\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 getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\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 {!this.isMobile && <h2>{this.capitalizeFirstLetter(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 && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a\n onClick={this.goToProduct}\n href={this.getHref()}\n class={`button ${this.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}`}\n >\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"]}
|
|
@@ -11,6 +11,9 @@ export class MyModalBundle {
|
|
|
11
11
|
async open() {
|
|
12
12
|
this.show = true;
|
|
13
13
|
}
|
|
14
|
+
async close() {
|
|
15
|
+
this.show = false;
|
|
16
|
+
}
|
|
14
17
|
setReadyToCloseHandler(value) {
|
|
15
18
|
this.readyToClose = value.detail.observable;
|
|
16
19
|
}
|
|
@@ -128,6 +131,22 @@ export class MyModalBundle {
|
|
|
128
131
|
"text": "",
|
|
129
132
|
"tags": []
|
|
130
133
|
}
|
|
134
|
+
},
|
|
135
|
+
"close": {
|
|
136
|
+
"complexType": {
|
|
137
|
+
"signature": "() => Promise<void>",
|
|
138
|
+
"parameters": [],
|
|
139
|
+
"references": {
|
|
140
|
+
"Promise": {
|
|
141
|
+
"location": "global"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"return": "Promise<void>"
|
|
145
|
+
},
|
|
146
|
+
"docs": {
|
|
147
|
+
"text": "",
|
|
148
|
+
"tags": []
|
|
149
|
+
}
|
|
131
150
|
}
|
|
132
151
|
};
|
|
133
152
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my-component.js","sourceRoot":"","sources":["../../../src/components/my-component/my-component.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,MAAM,eAAe,CAAC;AAOnF,MAAM,OAAO,aAAa;;;;;gBAOR,KAAK;wBACG,KAAK;;EAG7B,KAAK,CAAC,IAAI;IACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;EACnB,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;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,GAAa,CAAC,CAAC;KACjI;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;;;;;;;;;kEASqD,CAC/C,CACF;MACT,WAAK,KAAK,EAAC,iBAAiB,IAAE,OAAO,CAAO;MAC5C;QACE,cAAQ,GAAG,EAAC,yDAAyD,EAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAW,CAC7I,CACP,CACP,CAAC;EACJ,CAAC
|
|
1
|
+
{"version":3,"file":"my-component.js","sourceRoot":"","sources":["../../../src/components/my-component/my-component.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,M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AW,CAC7I,CACP,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, h } from '@stencil/core';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\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 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}></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-PMTKHDX');`}\n </script>\n </Helmet>\n <div class=\"pallete-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-PMTKHDX\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"]}
|
|
@@ -7,11 +7,8 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
9
9
|
this.closeInfoBox = createEvent(this, "closeInfoBox", 7);
|
|
10
|
-
this.
|
|
11
|
-
this.goToProduct = (e) => {
|
|
10
|
+
this.goToProduct = () => {
|
|
12
11
|
var _a;
|
|
13
|
-
e.preventDefault();
|
|
14
|
-
this.closeModalHandler();
|
|
15
12
|
this.currentColor &&
|
|
16
13
|
setDataLayer({
|
|
17
14
|
event: 'GoToProduct',
|
|
@@ -19,6 +16,7 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
19
16
|
product: this.product,
|
|
20
17
|
color: (_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.name,
|
|
21
18
|
});
|
|
19
|
+
this.closeInfoBox.emit();
|
|
22
20
|
};
|
|
23
21
|
this.onCloseButtonClick = () => {
|
|
24
22
|
this.closeInfoBox.emit();
|
|
@@ -37,7 +35,9 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
37
35
|
if (this.baselink) {
|
|
38
36
|
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}`;
|
|
39
37
|
}
|
|
40
|
-
|
|
38
|
+
else {
|
|
39
|
+
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;
|
|
40
|
+
}
|
|
41
41
|
};
|
|
42
42
|
this.capitalizeFirstLetter = (string) => {
|
|
43
43
|
return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();
|
|
@@ -51,9 +51,6 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
51
51
|
this.infoBoxWidth = undefined;
|
|
52
52
|
this.closeImage = 'close.png';
|
|
53
53
|
}
|
|
54
|
-
closeModalHandler() {
|
|
55
|
-
this.close.emit();
|
|
56
|
-
}
|
|
57
54
|
render() {
|
|
58
55
|
var _a;
|
|
59
56
|
return (h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
|
|
@@ -61,7 +58,7 @@ const MyColorInfo = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
61
58
|
maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
|
|
62
59
|
} }, this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("div", { class: "boxes__box-content__info", style: {
|
|
63
60
|
maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
|
|
64
|
-
} }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && h("h2", null, this.capitalizeFirstLetter(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 && ((_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, class:
|
|
61
|
+
} }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && h("h2", null, this.capitalizeFirstLetter(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 && ((_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.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}` }, "wybierz kolor"))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
|
|
65
62
|
}
|
|
66
63
|
}, [0, "my-colorinfo", {
|
|
67
64
|
"currentColor": [16],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"my-colorinfo2.js","mappings":";;;;
|
|
1
|
+
{"file":"my-colorinfo2.js","mappings":";;;;MAQa,WAAW;;;;;IAYtB,gBAAW,GAAG;;MACZ,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;MACL,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,uBAAkB,GAAG;MACnB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,wBAAmB,GAAG;;MACpB,IAAI,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE;QACrC,OAAO,WAAK,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG,MAAM,WAAW,IAAI,CAAC,YAAY,CAAC,QAAQ,iBAAiB,WAAW,EAAE,EAAE,GAAG,EAAC,aAAa,GAAG,CAAC;OAC/I;WAAM;QACL,OAAO,iBAAW,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CA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AAC,aAAa,GAAG,SAAS,GAAG,EAAE,EAAE,oBAG/G,CACL,CACG,CACF,CACF,EACN,WAAK,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,mBAAmB,EAAE,CAAO,CACtE,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-colorinfo/my-colorinfo.tsx"],"sourcesContent":["import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { 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() data: Product | null = null;\n @Prop() isMobile: boolean = false;\n @Prop() infoBoxWidth: number | null;\n @Prop() closeImage = 'close.png';\n\n @Event() closeInfoBox: EventEmitter;\n\n goToProduct = () => {\n this.currentColor &&\n setDataLayer({\n event: 'GoToProduct',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\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 getHref = () => {\n if (this.baselink) {\n return `${this.baselink}/${this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path}`;\n } else {\n return this?.currentColor.links?.find((link: Link) => link?.shop === this.shop)?.path;\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 {!this.isMobile && <h2>{this.capitalizeFirstLetter(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 && this.currentColor.links?.find((link: Link) => link?.shop === this.shop) && (\n <a\n onClick={this.goToProduct}\n href={this.getHref()}\n class={`button ${this.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}`}\n >\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"],"version":3}
|
|
@@ -138,6 +138,9 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
138
138
|
async open() {
|
|
139
139
|
this.show = true;
|
|
140
140
|
}
|
|
141
|
+
async close() {
|
|
142
|
+
this.show = false;
|
|
143
|
+
}
|
|
141
144
|
setReadyToCloseHandler(value) {
|
|
142
145
|
this.readyToClose = value.detail.observable;
|
|
143
146
|
}
|
|
@@ -173,7 +176,8 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
173
176
|
"baselink": [1],
|
|
174
177
|
"show": [32],
|
|
175
178
|
"readyToClose": [32],
|
|
176
|
-
"open": [64]
|
|
179
|
+
"open": [64],
|
|
180
|
+
"close": [64]
|
|
177
181
|
}, [[0, "readyToCLose", "setReadyToCloseHandler"], [0, "close", "closeModalHandler"]]]);
|
|
178
182
|
function defineCustomElement$1() {
|
|
179
183
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"my-component.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC;AAClF,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AACtI,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnE;AACO,MAAM,SAAS,GAAG,CAAC,GAAG,KAAK,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,QAAQ,KAAK,CAAC,IAAI,OAAO,GAAG,CAAC,aAAa,KAAK,QAAQ,CAAC;AAClH,MAAM,cAAc,GAAG,CAAC,GAAG,KAAK,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;;ACJ1E,MAAM,aAAa,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,E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ACP,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["RenderTypes"],"sources":["./node_modules/@stencil/helmet/dist/util.js","./node_modules/@stencil/helmet/dist/dom.js","./node_modules/@stencil/helmet/dist/render.js","./node_modules/@stencil/helmet/dist/stencil-helmet.js","./src/components/my-component/my-component.scss?tag=my-component&encapsulation=scoped","./src/components/my-component/my-component.tsx"],"sourcesContent":["const isObject = (val) => !Array.isArray(val) && val !== null && typeof val === 'object';\nexport const hasAttributes = ({ vattrs }, requiredAttrs = []) => isObject(vattrs) && requiredAttrs.every(vattrs.hasOwnProperty.bind(vattrs));\nexport const isTextNode = ({ vtext }) => typeof vtext === 'string';\n// Can't use instanceof HTMLElement because MockHTMLElement during pre-rendering isn't\nexport const isElement = (val) => typeof val === 'object' && val.nodeType === 1 && typeof val.ownerDocument === 'object';\nexport const isElementArray = (val) => Array.isArray(val) && val.every(isElement);\n","import { isElement, isElementArray } from './util';\nexport const createElement = ({ vtag, vattrs, vchildren, vtext }, utils) => {\n if (vtext != null) {\n return document.createTextNode(vtext);\n }\n const element = document.createElement(vtag);\n if (vattrs != null) {\n for (const key in vattrs) {\n element.setAttribute(key, vattrs[key]);\n }\n }\n if (vchildren != null) {\n utils.forEach(vchildren, (child) => {\n element.appendChild(createElement(child, utils));\n });\n }\n return element;\n};\nexport const shouldApplyToHead = (val) => isElement(val) || (isElementArray(val) && val.length === 2);\nexport const applyToHead = (element) => {\n if (Array.isArray(element)) {\n return document.head.replaceChild(element[0], element[1]);\n }\n return document.head.appendChild(element);\n};\n","import { hasAttributes, isTextNode } from './util';\nimport { createElement } from './dom';\nconst hasChildren = (node) => Array.isArray(node.vchildren);\nconst getFirstChild = (vchildren, utils) => {\n let firstChild = null;\n utils.forEach(vchildren || [], (c, i) => {\n if (i === 0) {\n firstChild = c;\n return;\n }\n });\n return firstChild;\n};\nfunction title(node, head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return [createElement(node, utils), head.querySelector('title')];\n }\n}\nfunction meta(node, head, utils) {\n var _a, _b, _c;\n const namePropKey = ((_a = node.vattrs) === null || _a === void 0 ? void 0 : _a.property) ? 'property' : 'name';\n const namePropValue = ((_b = node.vattrs) === null || _b === void 0 ? void 0 : _b.property) || ((_c = node.vattrs) === null || _c === void 0 ? void 0 : _c.name);\n const existingElement = head.querySelector(`meta[${namePropKey}=\"${namePropValue}\"]`);\n if (existingElement !== null) {\n return [createElement(node, utils), existingElement];\n }\n else {\n return createElement(node, utils);\n }\n}\nfunction link(node, _head, utils) {\n if (!hasChildren(node)) {\n return createElement(node, utils);\n }\n}\nfunction style(node, _head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return createElement(node, utils);\n }\n}\nfunction script(node, _head, utils) {\n if (hasChildren(node) || hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nfunction base(node, _head, utils) {\n if (!hasChildren(node) && hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nconst template = createElement;\nconst noscript = createElement; // SSR only\nconst types = {\n title,\n meta,\n link,\n style,\n script,\n base,\n template,\n noscript,\n};\nexport default types;\n","import RenderTypes from './render';\nimport { shouldApplyToHead, applyToHead } from './dom';\nconst headExists = document && document.head;\nconst validTagNames = Object.keys(RenderTypes);\nconst isValidNode = (node) => validTagNames.indexOf(node.vtag) > -1;\nconst renderNode = (node, utils) => RenderTypes[node.vtag](node, document.head, utils);\nexport const Helmet = (_props, children, utils) => {\n if (!headExists) {\n return null;\n }\n const rendered = [];\n const validChildren = [];\n utils.forEach(children, (n) => {\n if (isValidNode(n)) {\n validChildren.push(n);\n rendered.push(renderNode(n, utils));\n }\n });\n // Build an HTMLElement for each provided virtual child\n rendered\n .filter(shouldApplyToHead)\n .forEach(applyToHead);\n return null;\n};\nexport default Helmet;\n",".pallete-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n","import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, h } from '@stencil/core';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n\n @State() show = false;\n @State() readyToClose = false;\n\n @Method()\n async open() {\n this.show = true;\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 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}></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-PMTKHDX');`}\n </script>\n </Helmet>\n <div class=\"pallete-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-PMTKHDX\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"my-component.js","mappings":";;;;;;;;;AAAA,MAAM,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK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B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;GAC3B;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,GAAa,CAAC,CAAC;KACjI;IACD,QACE,WACE,OAAO,EAAE;QACP,IAAI,IAAI,CAAC,YAAY,EAAE;UACrB,IAAI,CAAC,iBAAiB,EAAE,CAAC;SAC1B;OACF,IAED,EAAC,MAAM,QACL,kBACG;;;;;;;;;kEASqD,CAC/C,CACF,EACT,WAAK,KAAK,EAAC,iBAAiB,IAAE,OAAO,CAAO,EAC5C,oBACE,cAAQ,GAAG,EAAC,yDAAyD,EAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAW,CAC7I,CACP,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["RenderTypes"],"sources":["./node_modules/@stencil/helmet/dist/util.js","./node_modules/@stencil/helmet/dist/dom.js","./node_modules/@stencil/helmet/dist/render.js","./node_modules/@stencil/helmet/dist/stencil-helmet.js","./src/components/my-component/my-component.scss?tag=my-component&encapsulation=scoped","./src/components/my-component/my-component.tsx"],"sourcesContent":["const isObject = (val) => !Array.isArray(val) && val !== null && typeof val === 'object';\nexport const hasAttributes = ({ vattrs }, requiredAttrs = []) => isObject(vattrs) && requiredAttrs.every(vattrs.hasOwnProperty.bind(vattrs));\nexport const isTextNode = ({ vtext }) => typeof vtext === 'string';\n// Can't use instanceof HTMLElement because MockHTMLElement during pre-rendering isn't\nexport const isElement = (val) => typeof val === 'object' && val.nodeType === 1 && typeof val.ownerDocument === 'object';\nexport const isElementArray = (val) => Array.isArray(val) && val.every(isElement);\n","import { isElement, isElementArray } from './util';\nexport const createElement = ({ vtag, vattrs, vchildren, vtext }, utils) => {\n if (vtext != null) {\n return document.createTextNode(vtext);\n }\n const element = document.createElement(vtag);\n if (vattrs != null) {\n for (const key in vattrs) {\n element.setAttribute(key, vattrs[key]);\n }\n }\n if (vchildren != null) {\n utils.forEach(vchildren, (child) => {\n element.appendChild(createElement(child, utils));\n });\n }\n return element;\n};\nexport const shouldApplyToHead = (val) => isElement(val) || (isElementArray(val) && val.length === 2);\nexport const applyToHead = (element) => {\n if (Array.isArray(element)) {\n return document.head.replaceChild(element[0], element[1]);\n }\n return document.head.appendChild(element);\n};\n","import { hasAttributes, isTextNode } from './util';\nimport { createElement } from './dom';\nconst hasChildren = (node) => Array.isArray(node.vchildren);\nconst getFirstChild = (vchildren, utils) => {\n let firstChild = null;\n utils.forEach(vchildren || [], (c, i) => {\n if (i === 0) {\n firstChild = c;\n return;\n }\n });\n return firstChild;\n};\nfunction title(node, head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return [createElement(node, utils), head.querySelector('title')];\n }\n}\nfunction meta(node, head, utils) {\n var _a, _b, _c;\n const namePropKey = ((_a = node.vattrs) === null || _a === void 0 ? void 0 : _a.property) ? 'property' : 'name';\n const namePropValue = ((_b = node.vattrs) === null || _b === void 0 ? void 0 : _b.property) || ((_c = node.vattrs) === null || _c === void 0 ? void 0 : _c.name);\n const existingElement = head.querySelector(`meta[${namePropKey}=\"${namePropValue}\"]`);\n if (existingElement !== null) {\n return [createElement(node, utils), existingElement];\n }\n else {\n return createElement(node, utils);\n }\n}\nfunction link(node, _head, utils) {\n if (!hasChildren(node)) {\n return createElement(node, utils);\n }\n}\nfunction style(node, _head, utils) {\n const firstChild = getFirstChild(node.vchildren || [], utils);\n if (firstChild && isTextNode(firstChild)) {\n return createElement(node, utils);\n }\n}\nfunction script(node, _head, utils) {\n if (hasChildren(node) || hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nfunction base(node, _head, utils) {\n if (!hasChildren(node) && hasAttributes(node)) {\n return createElement(node, utils);\n }\n}\nconst template = createElement;\nconst noscript = createElement; // SSR only\nconst types = {\n title,\n meta,\n link,\n style,\n script,\n base,\n template,\n noscript,\n};\nexport default types;\n","import RenderTypes from './render';\nimport { shouldApplyToHead, applyToHead } from './dom';\nconst headExists = document && document.head;\nconst validTagNames = Object.keys(RenderTypes);\nconst isValidNode = (node) => validTagNames.indexOf(node.vtag) > -1;\nconst renderNode = (node, utils) => RenderTypes[node.vtag](node, document.head, utils);\nexport const Helmet = (_props, children, utils) => {\n if (!headExists) {\n return null;\n }\n const rendered = [];\n const validChildren = [];\n utils.forEach(children, (n) => {\n if (isValidNode(n)) {\n validChildren.push(n);\n rendered.push(renderNode(n, utils));\n }\n });\n // Build an HTMLElement for each provided virtual child\n rendered\n .filter(shouldApplyToHead)\n .forEach(applyToHead);\n return null;\n};\nexport default Helmet;\n",".pallete-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n","import Helmet from '@stencil/helmet';\nimport { Component, Prop, Method, Element, State, Listen, h } from '@stencil/core';\n\n@Component({\n tag: 'my-component',\n styleUrl: 'my-component.scss',\n scoped: true,\n})\nexport class MyModalBundle {\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\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 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}></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-PMTKHDX');`}\n </script>\n </Helmet>\n <div class=\"pallete-wrapper\">{content}</div>\n <noscript>\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=GTM-PMTKHDX\" height=\"0\" width=\"0\" style={{ display: 'none', visibility: 'hidden' }}></iframe>\n </noscript>\n </div>\n );\n }\n}\n"],"version":3}
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["my-backdrop_8",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"show":[32],"readyToClose":[32],"open":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"closeImage":[1,"close-image"],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"colors":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[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-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
|
|
14
|
+
return bootstrapLazy([["my-backdrop_8",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"show":[32],"readyToClose":[32],"open":[64],"close":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"closeImage":[1,"close-image"],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"colors":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[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-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -92,11 +92,8 @@ const MyColorInfo = class {
|
|
|
92
92
|
constructor(hostRef) {
|
|
93
93
|
registerInstance(this, hostRef);
|
|
94
94
|
this.closeInfoBox = createEvent(this, "closeInfoBox", 7);
|
|
95
|
-
this.
|
|
96
|
-
this.goToProduct = (e) => {
|
|
95
|
+
this.goToProduct = () => {
|
|
97
96
|
var _a;
|
|
98
|
-
e.preventDefault();
|
|
99
|
-
this.closeModalHandler();
|
|
100
97
|
this.currentColor &&
|
|
101
98
|
setDataLayer({
|
|
102
99
|
event: 'GoToProduct',
|
|
@@ -104,6 +101,7 @@ const MyColorInfo = class {
|
|
|
104
101
|
product: this.product,
|
|
105
102
|
color: (_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.name,
|
|
106
103
|
});
|
|
104
|
+
this.closeInfoBox.emit();
|
|
107
105
|
};
|
|
108
106
|
this.onCloseButtonClick = () => {
|
|
109
107
|
this.closeInfoBox.emit();
|
|
@@ -122,7 +120,9 @@ const MyColorInfo = class {
|
|
|
122
120
|
if (this.baselink) {
|
|
123
121
|
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}`;
|
|
124
122
|
}
|
|
125
|
-
|
|
123
|
+
else {
|
|
124
|
+
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;
|
|
125
|
+
}
|
|
126
126
|
};
|
|
127
127
|
this.capitalizeFirstLetter = (string) => {
|
|
128
128
|
return string.charAt(0).toUpperCase() + string.slice(1).toLocaleLowerCase();
|
|
@@ -136,9 +136,6 @@ const MyColorInfo = class {
|
|
|
136
136
|
this.infoBoxWidth = undefined;
|
|
137
137
|
this.closeImage = 'close.png';
|
|
138
138
|
}
|
|
139
|
-
closeModalHandler() {
|
|
140
|
-
this.close.emit();
|
|
141
|
-
}
|
|
142
139
|
render() {
|
|
143
140
|
var _a;
|
|
144
141
|
return (h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
|
|
@@ -146,7 +143,7 @@ const MyColorInfo = class {
|
|
|
146
143
|
maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
|
|
147
144
|
} }, this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("div", { class: "boxes__box-content__info", style: {
|
|
148
145
|
maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
|
|
149
|
-
} }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && h("h2", null, this.capitalizeFirstLetter(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 && ((_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, class:
|
|
146
|
+
} }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && h("h2", null, this.capitalizeFirstLetter(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 && ((_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.currentColor.imageInsteadHex ? 'brown' : this.currentColor.buttonInverse ? 'inverse' : ''}` }, "wybierz kolor"))))), h("div", { class: "boxes__box-content__slider" }, this.renderSliderOrImage())));
|
|
150
147
|
}
|
|
151
148
|
};
|
|
152
149
|
|
|
@@ -280,6 +277,9 @@ const MyModalBundle = class {
|
|
|
280
277
|
async open() {
|
|
281
278
|
this.show = true;
|
|
282
279
|
}
|
|
280
|
+
async close() {
|
|
281
|
+
this.show = false;
|
|
282
|
+
}
|
|
283
283
|
setReadyToCloseHandler(value) {
|
|
284
284
|
this.readyToClose = value.detail.observable;
|
|
285
285
|
}
|