@ppg_pl/pallete 0.0.1
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/LICENSE +21 -0
- package/README.md +51 -0
- package/dist/cjs/index-f418fc60.js +1340 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/my-backdrop_8.cjs.entry.js +8109 -0
- package/dist/cjs/pallete.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/api/index.js +19 -0
- package/dist/collection/components/api/services.js +81 -0
- package/dist/collection/components/my-backdrop/my-backdrop.css +21 -0
- package/dist/collection/components/my-backdrop/my-backdrop.js +13 -0
- package/dist/collection/components/my-colorbox/my-colorbox.css +60 -0
- package/dist/collection/components/my-colorbox/my-colorbox.js +145 -0
- package/dist/collection/components/my-colorinfo/my-colorinfo.js +197 -0
- package/dist/collection/components/my-component/my-component.css +18 -0
- package/dist/collection/components/my-component/my-component.js +106 -0
- package/dist/collection/components/my-loader/my-loader.css +85 -0
- package/dist/collection/components/my-loader/my-loader.js +18 -0
- package/dist/collection/components/my-modal/assets/arrow_down.png +0 -0
- package/dist/collection/components/my-modal/assets/close.png +0 -0
- package/dist/collection/components/my-modal/my-modal.css +323 -0
- package/dist/collection/components/my-modal/my-modal.js +430 -0
- package/dist/collection/components/my-search/assets/search.svg +15 -0
- package/dist/collection/components/my-search/my-search.css +43 -0
- package/dist/collection/components/my-search/my-search.js +112 -0
- package/dist/collection/components/my-slider/index.js +145 -0
- package/dist/collection/components/my-slider/my-slider.css +96 -0
- package/dist/collection/gtmUtils.js +3 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/types.js +1 -0
- package/dist/components/gtmUtils.js +5 -0
- package/dist/components/index.d.ts +29 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index2.js +5458 -0
- package/dist/components/my-backdrop.d.ts +11 -0
- package/dist/components/my-backdrop.js +6 -0
- package/dist/components/my-backdrop2.js +29 -0
- package/dist/components/my-colorbox.d.ts +11 -0
- package/dist/components/my-colorbox.js +6 -0
- package/dist/components/my-colorbox2.js +61 -0
- package/dist/components/my-colorinfo.d.ts +11 -0
- package/dist/components/my-colorinfo.js +6 -0
- package/dist/components/my-colorinfo2.js +64 -0
- package/dist/components/my-component.d.ts +11 -0
- package/dist/components/my-component.js +216 -0
- package/dist/components/my-loader.d.ts +11 -0
- package/dist/components/my-loader.js +6 -0
- package/dist/components/my-loader2.js +29 -0
- package/dist/components/my-modal.d.ts +11 -0
- package/dist/components/my-modal.js +6 -0
- package/dist/components/my-modal2.js +2451 -0
- package/dist/components/my-search.d.ts +11 -0
- package/dist/components/my-search.js +6 -0
- package/dist/components/my-search2.js +55 -0
- package/dist/components/my-slider.d.ts +11 -0
- package/dist/components/my-slider.js +6 -0
- package/dist/esm/index-367ea408.js +1312 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/my-backdrop_8.entry.js +8098 -0
- package/dist/esm/pallete.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/pallete/assets/arrow_down.png +0 -0
- package/dist/pallete/assets/close.png +0 -0
- package/dist/pallete/assets/search.svg +15 -0
- package/dist/pallete/index.esm.js +0 -0
- package/dist/pallete/p-02fc334c.js +2 -0
- package/dist/pallete/p-9f47a4e8.entry.js +1 -0
- package/dist/pallete/pallete.css +1 -0
- package/dist/pallete/pallete.esm.js +1 -0
- package/dist/types/components/api/index.d.ts +6 -0
- package/dist/types/components/api/services.d.ts +4 -0
- package/dist/types/components/my-backdrop/my-backdrop.d.ts +3 -0
- package/dist/types/components/my-colorbox/my-colorbox.d.ts +13 -0
- package/dist/types/components/my-colorinfo/my-colorinfo.d.ts +15 -0
- package/dist/types/components/my-component/my-component.d.ts +9 -0
- package/dist/types/components/my-loader/my-loader.d.ts +3 -0
- package/dist/types/components/my-modal/my-modal.d.ts +56 -0
- package/dist/types/components/my-search/my-search.d.ts +12 -0
- package/dist/types/components/my-slider/index.d.ts +15 -0
- package/dist/types/components.d.ts +198 -0
- package/dist/types/gtmUtils.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/types.d.ts +56 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +49 -0
- package/www/build/assets/arrow_down.png +0 -0
- package/www/build/assets/close.png +0 -0
- package/www/build/assets/fonts/Galatea-Regular.eot +0 -0
- package/www/build/assets/fonts/Galatea-Regular.ttf +0 -0
- package/www/build/assets/fonts/Galatea-Regular.woff +0 -0
- package/www/build/assets/fonts/Galatea-Regular.woff2 +0 -0
- package/www/build/assets/search.svg +15 -0
- package/www/build/index.esm.js +0 -0
- package/www/build/p-02fc334c.js +2 -0
- package/www/build/p-95e95ceb.css +1 -0
- package/www/build/p-9f47a4e8.entry.js +1 -0
- package/www/build/p-b0b8b976.js +1 -0
- package/www/build/pallete.css +1 -0
- package/www/build/pallete.esm.js +1 -0
- package/www/build/pallete.js +33 -0
- package/www/host.config.json +15 -0
- package/www/index.html +22 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-f418fc60.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.17.0 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('pallete.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["my-backdrop_8.cjs",[[0,"my-component",{"shop":[1],"product":[1],"show":[32],"open":[64]},[[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[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],"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"]}],[0,"my-loader"],[0,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]}],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"./components/my-backdrop/my-backdrop.js",
|
|
4
|
+
"./components/my-colorbox/my-colorbox.js",
|
|
5
|
+
"./components/my-colorinfo/my-colorinfo.js",
|
|
6
|
+
"./components/my-component/my-component.js",
|
|
7
|
+
"./components/my-loader/my-loader.js",
|
|
8
|
+
"./components/my-modal/my-modal.js",
|
|
9
|
+
"./components/my-search/my-search.js",
|
|
10
|
+
"./components/my-slider/index.js"
|
|
11
|
+
],
|
|
12
|
+
"compiler": {
|
|
13
|
+
"name": "@stencil/core",
|
|
14
|
+
"version": "2.17.0",
|
|
15
|
+
"typescriptVersion": "4.5.4"
|
|
16
|
+
},
|
|
17
|
+
"collections": [],
|
|
18
|
+
"bundles": []
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const APIURL = 'https://pallete-colors-backend.herokuapp.com';
|
|
2
|
+
class API {
|
|
3
|
+
async getData(ep) {
|
|
4
|
+
try {
|
|
5
|
+
const request = await fetch(`${APIURL}/api/${ep}`, {
|
|
6
|
+
method: 'GET',
|
|
7
|
+
headers: {
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const response = await request.json();
|
|
12
|
+
return response;
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error(error);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const ApiService = new API();
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import qs from 'qs';
|
|
2
|
+
export const fetchProductColorsQuery = (id, page) => qs.stringify({
|
|
3
|
+
filters: {
|
|
4
|
+
products: {
|
|
5
|
+
id: {
|
|
6
|
+
$eq: id,
|
|
7
|
+
},
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
sort: ['position:asc'],
|
|
11
|
+
populate: ['image', 'category', 'links', 'links.shop'],
|
|
12
|
+
pagination: {
|
|
13
|
+
page: page || 1,
|
|
14
|
+
pageSize: 100,
|
|
15
|
+
},
|
|
16
|
+
}, {
|
|
17
|
+
encodeValuesOnly: true, // prettify url
|
|
18
|
+
});
|
|
19
|
+
export const fetchCategoryColorsQuery = (color) => qs.stringify({
|
|
20
|
+
filters: {
|
|
21
|
+
category: {
|
|
22
|
+
id: {
|
|
23
|
+
$eq: color.id,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
sort: ['position:asc'],
|
|
28
|
+
populate: ['image', 'category', 'links', 'links.shop'],
|
|
29
|
+
pagination: {
|
|
30
|
+
page: 1,
|
|
31
|
+
pageSize: 100,
|
|
32
|
+
},
|
|
33
|
+
}, {
|
|
34
|
+
encodeValuesOnly: true, // prettify url
|
|
35
|
+
});
|
|
36
|
+
export const fetchColorByNumber = (productId, colorNumber) => qs.stringify({
|
|
37
|
+
filters: {
|
|
38
|
+
$or: [
|
|
39
|
+
{
|
|
40
|
+
$and: [
|
|
41
|
+
{
|
|
42
|
+
number: {
|
|
43
|
+
$contains: colorNumber,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
products: {
|
|
48
|
+
id: {
|
|
49
|
+
$eq: productId,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
$and: [
|
|
57
|
+
{
|
|
58
|
+
name: {
|
|
59
|
+
$contains: colorNumber,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
products: {
|
|
64
|
+
id: {
|
|
65
|
+
$eq: productId,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
sort: ['position:asc'],
|
|
74
|
+
populate: ['image', 'category', 'product', 'links', 'links.shop'],
|
|
75
|
+
pagination: {
|
|
76
|
+
page: 1,
|
|
77
|
+
pageSize: 100,
|
|
78
|
+
},
|
|
79
|
+
}, {
|
|
80
|
+
encodeValuesOnly: true, // prettify url
|
|
81
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
html {
|
|
2
|
+
font-size: 62.5%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
font-size: 1.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
* {
|
|
10
|
+
font-family: "Galatea", sans-serif;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
my-backdrop {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
17
|
+
position: fixed;
|
|
18
|
+
z-index: 100;
|
|
19
|
+
left: 0;
|
|
20
|
+
top: 0;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Component } from '@stencil/core';
|
|
2
|
+
export class MyBackdrop {
|
|
3
|
+
render() {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
static get is() { return "my-backdrop"; }
|
|
7
|
+
static get originalStyleUrls() { return {
|
|
8
|
+
"$": ["my-backdrop.scss"]
|
|
9
|
+
}; }
|
|
10
|
+
static get styleUrls() { return {
|
|
11
|
+
"$": ["my-backdrop.css"]
|
|
12
|
+
}; }
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
html {
|
|
2
|
+
font-size: 62.5%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
font-size: 1.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
* {
|
|
10
|
+
font-family: "Galatea", sans-serif;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.my-color-box {
|
|
14
|
+
width: 125px;
|
|
15
|
+
height: 125px;
|
|
16
|
+
display: block;
|
|
17
|
+
margin-bottom: 5px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
justify-content: flex-end;
|
|
22
|
+
position: relative;
|
|
23
|
+
}
|
|
24
|
+
@media (max-width: 1024px) {
|
|
25
|
+
.my-color-box {
|
|
26
|
+
width: 80px;
|
|
27
|
+
height: 80px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
.my-color-box .color-name {
|
|
31
|
+
width: 100%;
|
|
32
|
+
background-color: #fff;
|
|
33
|
+
padding: 15px 0px 10px;
|
|
34
|
+
border-top-left-radius: 15px;
|
|
35
|
+
border-top-right-radius: 15px;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transition: 0.3s opacity ease-in-out;
|
|
38
|
+
font-size: 1rem;
|
|
39
|
+
color: #232323;
|
|
40
|
+
text-transform: lowercase;
|
|
41
|
+
}
|
|
42
|
+
.my-color-box.active .color-name {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
}
|
|
45
|
+
.my-color-box.categoryactive {
|
|
46
|
+
width: 120px;
|
|
47
|
+
height: 115px;
|
|
48
|
+
}
|
|
49
|
+
.my-color-box.categoryactive .color-name {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
}
|
|
52
|
+
@media (max-width: 1024px) {
|
|
53
|
+
.my-color-box.categoryactive {
|
|
54
|
+
width: 72px;
|
|
55
|
+
height: 72px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.my-color-box:hover .color-name {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Component, Prop, h } from '@stencil/core';
|
|
2
|
+
import { setDataLayer } from '../../gtmUtils';
|
|
3
|
+
export class MyColorBox {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.colorCheck = () => {
|
|
6
|
+
this.checkTimeout = setTimeout(() => {
|
|
7
|
+
setDataLayer({
|
|
8
|
+
event: 'ColorCheck',
|
|
9
|
+
shop: this.shop,
|
|
10
|
+
product: this.product,
|
|
11
|
+
color: this.name,
|
|
12
|
+
});
|
|
13
|
+
}, 2000);
|
|
14
|
+
};
|
|
15
|
+
this.colorUnCheck = () => {
|
|
16
|
+
if (this.checkTimeout)
|
|
17
|
+
clearTimeout(this.checkTimeout);
|
|
18
|
+
this.checkTimeout = undefined;
|
|
19
|
+
};
|
|
20
|
+
this.darkenColor = (color) => {
|
|
21
|
+
const red = parseInt(color[1] + color[2], 16) - 20;
|
|
22
|
+
const green = parseInt(color[3] + color[4], 16) - 20;
|
|
23
|
+
const blue = parseInt(color[5] + color[6], 16) - 20;
|
|
24
|
+
return `rgb(${red},${green},${blue})`;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return (h("div", { onMouseEnter: () => this.colorCheck(), onMouseLeave: () => this.colorUnCheck(), class: `my-color-box ${this.isActive ? 'active' : ''} ${this.isCategoryActive ? 'categoryactive' : ''}`, style: {
|
|
29
|
+
background: this.color,
|
|
30
|
+
border: this.isCategoryActive ? `5px solid ${this.darkenColor(this.color)}` : '',
|
|
31
|
+
} },
|
|
32
|
+
h("div", { class: "color-name" }, this.name)));
|
|
33
|
+
}
|
|
34
|
+
static get is() { return "my-colorbox"; }
|
|
35
|
+
static get originalStyleUrls() { return {
|
|
36
|
+
"$": ["my-colorbox.scss"]
|
|
37
|
+
}; }
|
|
38
|
+
static get styleUrls() { return {
|
|
39
|
+
"$": ["my-colorbox.css"]
|
|
40
|
+
}; }
|
|
41
|
+
static get properties() { return {
|
|
42
|
+
"color": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"mutable": false,
|
|
45
|
+
"complexType": {
|
|
46
|
+
"original": "string",
|
|
47
|
+
"resolved": "string",
|
|
48
|
+
"references": {}
|
|
49
|
+
},
|
|
50
|
+
"required": false,
|
|
51
|
+
"optional": false,
|
|
52
|
+
"docs": {
|
|
53
|
+
"tags": [],
|
|
54
|
+
"text": ""
|
|
55
|
+
},
|
|
56
|
+
"attribute": "color",
|
|
57
|
+
"reflect": false
|
|
58
|
+
},
|
|
59
|
+
"name": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "string",
|
|
64
|
+
"resolved": "string",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": false,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": ""
|
|
72
|
+
},
|
|
73
|
+
"attribute": "name",
|
|
74
|
+
"reflect": false
|
|
75
|
+
},
|
|
76
|
+
"shop": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"mutable": false,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "string",
|
|
81
|
+
"resolved": "string",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": ""
|
|
89
|
+
},
|
|
90
|
+
"attribute": "shop",
|
|
91
|
+
"reflect": false
|
|
92
|
+
},
|
|
93
|
+
"product": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "string",
|
|
98
|
+
"resolved": "string",
|
|
99
|
+
"references": {}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": ""
|
|
106
|
+
},
|
|
107
|
+
"attribute": "product",
|
|
108
|
+
"reflect": false
|
|
109
|
+
},
|
|
110
|
+
"isActive": {
|
|
111
|
+
"type": "boolean",
|
|
112
|
+
"mutable": false,
|
|
113
|
+
"complexType": {
|
|
114
|
+
"original": "boolean",
|
|
115
|
+
"resolved": "boolean | undefined",
|
|
116
|
+
"references": {}
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"optional": true,
|
|
120
|
+
"docs": {
|
|
121
|
+
"tags": [],
|
|
122
|
+
"text": ""
|
|
123
|
+
},
|
|
124
|
+
"attribute": "is-active",
|
|
125
|
+
"reflect": false
|
|
126
|
+
},
|
|
127
|
+
"isCategoryActive": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "boolean",
|
|
132
|
+
"resolved": "boolean | undefined",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": true,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": ""
|
|
140
|
+
},
|
|
141
|
+
"attribute": "is-category-active",
|
|
142
|
+
"reflect": false
|
|
143
|
+
}
|
|
144
|
+
}; }
|
|
145
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Component, Prop, h, getAssetPath, Event } from '@stencil/core';
|
|
2
|
+
import { setDataLayer } from '../../gtmUtils';
|
|
3
|
+
export class MyColorInfo {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.data = null;
|
|
6
|
+
this.isMobile = false;
|
|
7
|
+
this.closeImage = 'close.png';
|
|
8
|
+
this.goToProduct = () => {
|
|
9
|
+
var _a;
|
|
10
|
+
this.currentColor &&
|
|
11
|
+
setDataLayer({
|
|
12
|
+
event: 'GoToProduct',
|
|
13
|
+
shop: this.shop,
|
|
14
|
+
product: this.product,
|
|
15
|
+
color: (_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.name,
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
this.onCloseButtonClick = () => {
|
|
19
|
+
this.closeInfoBox.emit();
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
24
|
+
return (h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
|
|
25
|
+
background: this.currentColor.hex,
|
|
26
|
+
maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
|
|
27
|
+
} },
|
|
28
|
+
this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }),
|
|
29
|
+
h("div", { class: "boxes__box-content__info", style: {
|
|
30
|
+
maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
|
|
31
|
+
} },
|
|
32
|
+
!this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }),
|
|
33
|
+
!this.isMobile && h("h2", null, this.currentColor.name),
|
|
34
|
+
!this.isMobile && h("h4", null, this.currentColor.number),
|
|
35
|
+
!this.isMobile && h("div", { class: "divider" }),
|
|
36
|
+
h("div", { class: "boxes__box-content__info__value" },
|
|
37
|
+
h("div", { class: "boxes__box-content__info__value-image" }, ((_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.image.data) && h("img", { src: `${(_e = (_d = (_c = (_b = this.currentColor) === null || _b === void 0 ? void 0 : _b.image) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.attributes) === null || _e === void 0 ? void 0 : _e.formats.thumbnail.url}`, alt: "color-image" })),
|
|
38
|
+
h("div", { class: "boxes__box-content__info__value-product" },
|
|
39
|
+
h("div", null,
|
|
40
|
+
!this.isMobile && h("p", null, "Produkt:"),
|
|
41
|
+
this.isMobile && h("h2", null, this.currentColor.name),
|
|
42
|
+
" ",
|
|
43
|
+
h("p", null, this.product)),
|
|
44
|
+
this.isMobile && h("div", { class: 'divider' }),
|
|
45
|
+
this.currentColor && this.currentColor.links.find((link) => { var _a, _b, _c; return ((_c = (_b = (_a = link === null || link === void 0 ? void 0 : link.shop) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.attributes) === null || _c === void 0 ? void 0 : _c.name) === this.shop; }) && (h("a", { onClick: this.goToProduct, class: `${this.currentColor.buttonInverse ? 'inverse' : ''}`, target: "_blank", href: (_f = this === null || this === void 0 ? void 0 : this.currentColor.links.find((link) => { var _a, _b, _c; return ((_c = (_b = (_a = link === null || link === void 0 ? void 0 : link.shop) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.attributes) === null || _c === void 0 ? void 0 : _c.name) === this.shop; })) === null || _f === void 0 ? void 0 : _f.path }, "przejd\u017A do produktu"))))),
|
|
46
|
+
h("div", { class: "boxes__box-content__slider" },
|
|
47
|
+
h("my-slider", { color: this.currentColor.name, shop: this.shop, product: this.product, slides: (_g = this.data) === null || _g === void 0 ? void 0 : _g.images.data }),
|
|
48
|
+
' ')));
|
|
49
|
+
}
|
|
50
|
+
static get is() { return "my-colorinfo"; }
|
|
51
|
+
static get properties() { return {
|
|
52
|
+
"currentColor": {
|
|
53
|
+
"type": "unknown",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "Color",
|
|
57
|
+
"resolved": "{ hex: string; image: Record<string, Data<Image>>; links: Link[]; name: string; position: number; buttonInverse: boolean; textWhite: boolean; id?: number | undefined; category?: Data<Partial<Color>> | undefined; number?: string | undefined; }",
|
|
58
|
+
"references": {
|
|
59
|
+
"Color": {
|
|
60
|
+
"location": "import",
|
|
61
|
+
"path": "../../types"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": false,
|
|
66
|
+
"optional": false,
|
|
67
|
+
"docs": {
|
|
68
|
+
"tags": [],
|
|
69
|
+
"text": ""
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"shop": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "string",
|
|
77
|
+
"resolved": "string",
|
|
78
|
+
"references": {}
|
|
79
|
+
},
|
|
80
|
+
"required": false,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": ""
|
|
85
|
+
},
|
|
86
|
+
"attribute": "shop",
|
|
87
|
+
"reflect": false
|
|
88
|
+
},
|
|
89
|
+
"product": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "string",
|
|
94
|
+
"resolved": "string",
|
|
95
|
+
"references": {}
|
|
96
|
+
},
|
|
97
|
+
"required": false,
|
|
98
|
+
"optional": false,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": ""
|
|
102
|
+
},
|
|
103
|
+
"attribute": "product",
|
|
104
|
+
"reflect": false
|
|
105
|
+
},
|
|
106
|
+
"data": {
|
|
107
|
+
"type": "unknown",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "Product | null",
|
|
111
|
+
"resolved": "null | { colors?: Color[] | undefined; modalDescription: string; modalLogo: Record<string, Data<Image>>; modalName: string; name: string; createdAt: string; locale: string; publishedAt: string; shops: Data<Shop>[]; images: Record<string, Data<Image>[]>; id?: string | undefined; categories?: any; }",
|
|
112
|
+
"references": {
|
|
113
|
+
"Product": {
|
|
114
|
+
"location": "import",
|
|
115
|
+
"path": "../../types"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": ""
|
|
124
|
+
},
|
|
125
|
+
"defaultValue": "null"
|
|
126
|
+
},
|
|
127
|
+
"isMobile": {
|
|
128
|
+
"type": "boolean",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "boolean",
|
|
132
|
+
"resolved": "boolean",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": ""
|
|
140
|
+
},
|
|
141
|
+
"attribute": "is-mobile",
|
|
142
|
+
"reflect": false,
|
|
143
|
+
"defaultValue": "false"
|
|
144
|
+
},
|
|
145
|
+
"infoBoxWidth": {
|
|
146
|
+
"type": "number",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "number | null",
|
|
150
|
+
"resolved": "null | number",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": false,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": ""
|
|
158
|
+
},
|
|
159
|
+
"attribute": "info-box-width",
|
|
160
|
+
"reflect": false
|
|
161
|
+
},
|
|
162
|
+
"closeImage": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"mutable": false,
|
|
165
|
+
"complexType": {
|
|
166
|
+
"original": "string",
|
|
167
|
+
"resolved": "string",
|
|
168
|
+
"references": {}
|
|
169
|
+
},
|
|
170
|
+
"required": false,
|
|
171
|
+
"optional": false,
|
|
172
|
+
"docs": {
|
|
173
|
+
"tags": [],
|
|
174
|
+
"text": ""
|
|
175
|
+
},
|
|
176
|
+
"attribute": "close-image",
|
|
177
|
+
"reflect": false,
|
|
178
|
+
"defaultValue": "'close.png'"
|
|
179
|
+
}
|
|
180
|
+
}; }
|
|
181
|
+
static get events() { return [{
|
|
182
|
+
"method": "closeInfoBox",
|
|
183
|
+
"name": "closeInfoBox",
|
|
184
|
+
"bubbles": true,
|
|
185
|
+
"cancelable": true,
|
|
186
|
+
"composed": true,
|
|
187
|
+
"docs": {
|
|
188
|
+
"tags": [],
|
|
189
|
+
"text": ""
|
|
190
|
+
},
|
|
191
|
+
"complexType": {
|
|
192
|
+
"original": "any",
|
|
193
|
+
"resolved": "any",
|
|
194
|
+
"references": {}
|
|
195
|
+
}
|
|
196
|
+
}]; }
|
|
197
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
html {
|
|
2
|
+
font-size: 62.5%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
font-size: 1.5rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
* {
|
|
10
|
+
font-family: "Galatea", sans-serif;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.pallete-wrapper {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
}
|