@ppg_pl/pallete 2.0.18 → 2.0.20
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 +111 -45
- package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -1
- package/dist/cjs/pallete.cjs.js +1 -1
- package/dist/collection/components/api/index.js +2 -2
- package/dist/collection/components/api/index.js.map +1 -1
- package/dist/collection/components/api/services.js +17 -0
- package/dist/collection/components/api/services.js.map +1 -1
- package/dist/collection/components/my-component/my-component.js +19 -1
- package/dist/collection/components/my-component/my-component.js.map +1 -1
- package/dist/collection/components/my-modal/my-modal.css +58 -14
- package/dist/collection/components/my-modal/my-modal.js +106 -35
- package/dist/collection/components/my-modal/my-modal.js.map +1 -1
- package/dist/collection/components/my-search/my-search.css +3 -3
- package/dist/collection/components/my-search/my-search.js +1 -1
- package/dist/collection/components/my-search/my-search.js.map +1 -1
- package/dist/collection/utils/index.js +12 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/components/index2.js +2 -2
- package/dist/components/index2.js.map +1 -1
- package/dist/components/my-component.js +3 -1
- package/dist/components/my-component.js.map +1 -1
- package/dist/components/my-modal2.js +107 -40
- package/dist/components/my-modal2.js.map +1 -1
- package/dist/components/my-search2.js +2 -2
- package/dist/components/my-search2.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/my-backdrop_8.entry.js +111 -45
- package/dist/esm/my-backdrop_8.entry.js.map +1 -1
- package/dist/esm/pallete.js +1 -1
- package/dist/pallete/p-821312c7.entry.js +2 -0
- package/dist/pallete/p-821312c7.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/api/services.d.ts +1 -0
- package/dist/types/components/my-component/my-component.d.ts +1 -0
- package/dist/types/components/my-modal/my-modal.d.ts +8 -2
- package/dist/types/components.d.ts +4 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/www/build/p-821312c7.entry.js +2 -0
- package/www/build/p-821312c7.entry.js.map +1 -0
- package/www/build/pallete.esm.js +1 -1
- package/www/build/pallete.esm.js.map +1 -1
- package/www/index.html +3 -1
- package/dist/pallete/p-64135b01.entry.js +0 -2
- package/dist/pallete/p-64135b01.entry.js.map +0 -1
- package/www/build/p-64135b01.entry.js +0 -2
- package/www/build/p-64135b01.entry.js.map +0 -1
|
@@ -35,7 +35,7 @@ export class MySearch {
|
|
|
35
35
|
this.searchText = null;
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
return (h("div", { class: 'search' }, h("input", { placeholder: this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie
|
|
38
|
+
return (h("div", { class: 'search' }, h("input", { placeholder: this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie', value: this.searchText || '', type: "text", onInput: this.onInputChangeValue.bind(this) }), h("button", { onClick: () => {
|
|
39
39
|
this.searchText && this.fetchColorsByName(this.searchText);
|
|
40
40
|
this.searchText = '';
|
|
41
41
|
} }, h("img", { src: getAssetPath(`./assets/${this.searchIcon}`), alt: "arrow_down" }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my-search.js","sourceRoot":"","sources":["../../../src/components/my-search/my-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE5G,SAAS,QAAQ,CAAC,IAAc,EAAE,IAAY;EAC5C,IAAI,OAAsC,CAAC;EAC3C,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAW;IAC7C,MAAM,KAAK,GAAG,GAAG,EAAE;MACjB,YAAY,CAAC,OAAO,CAAC,CAAC;MACtB,IAAI,CAAC,GAAG,IA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C,GAAI;MAE5K,cACE,OAAO,EAAE,GAAG,EAAE;UACZ,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;UAE3D,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACvB,CAAC;QAED,WAAK,GAAG,EAAE,YAAY,CAAC,YAAY,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,GAAG,EAAC,YAAY,GAAG,CACnE,CACL,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, State, Listen, getAssetPath, EventEmitter, Event, Watch } from '@stencil/core';\n\nfunction debounce(func: Function, wait: number) {\n let timeout: ReturnType<typeof setTimeout>;\n return function executedFunction(...args: any[]) {\n const later = () => {\n clearTimeout(timeout);\n func(...args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n\n@Component({\n tag: 'my-search',\n styleUrl: 'my-search.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MySearch {\n @Prop() productId: number;\n @Prop() isMobile: boolean;\n @Prop() searchIcon = 'search.svg';\n @State() searchText: string | null = null;\n @Event() searchColors: EventEmitter;\n\n fetchColorsByName = (text: string) => {\n this.searchColors.emit(text);\n };\n\n private debouncedInputChangeValue = debounce((value: string) => {\n this.fetchColorsByName(value);\n this.searchText = value;\n }, 300);\n\n private onInputChangeValue(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n this.debouncedInputChangeValue(value);\n }\n\n @Watch('searchText')\n fetchColorsByNameHandle(newValue: string) {\n this.fetchColorsByName(newValue);\n }\n\n @Listen('clearSearchText', { target: 'document' })\n clearSearchTextHandler() {\n this.searchText = null;\n }\n\n render() {\n return (\n <div class={'search'}>\n <input placeholder={this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie'} value={this.searchText || ''} type=\"text\" onInput={this.onInputChangeValue.bind(this)} />\n\n <button\n onClick={() => {\n this.searchText && this.fetchColorsByName(this.searchText);\n\n this.searchText = '';\n }}\n >\n <img src={getAssetPath(`./assets/${this.searchIcon}`)} alt=\"arrow_down\" />\n </button>\n </div>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function debounce(func, wait) {
|
|
2
|
+
let timeout;
|
|
3
|
+
return function executedFunction(...args) {
|
|
4
|
+
const later = () => {
|
|
5
|
+
clearTimeout(timeout);
|
|
6
|
+
func(...args);
|
|
7
|
+
};
|
|
8
|
+
clearTimeout(timeout);
|
|
9
|
+
timeout = setTimeout(later, wait);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,IAA8B,EAAE,IAAY;EACnE,IAAI,OAAsC,CAAC;EAE3C,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAW;IAC7C,MAAM,KAAK,GAAG,GAAG,EAAE;MACjB,YAAY,CAAC,OAAO,CAAC,CAAC;MACtB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC;IAEF,YAAY,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;EACpC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["export function debounce(func: (...args: any[]) => void, wait: number) {\n let timeout: ReturnType<typeof setTimeout>;\n\n return function executedFunction(...args: any[]) {\n const later = () => {\n clearTimeout(timeout);\n func(...args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n"]}
|
|
@@ -3,8 +3,8 @@ const setDataLayer = (obj) => {
|
|
|
3
3
|
};
|
|
4
4
|
|
|
5
5
|
// DEV/
|
|
6
|
-
// export const APIURL = 'http://
|
|
7
|
-
// export const accessToken = '
|
|
6
|
+
// export const APIURL = 'http://localhost:8055';
|
|
7
|
+
// export const accessToken = 'iGAWx696CkipbZDOESC8CBn3BF7xPaei';
|
|
8
8
|
// PROD
|
|
9
9
|
const APIURL = 'https://color-selector.pl'; //'https://pallete-colors-backend.herokuapp.com';
|
|
10
10
|
const accessToken = '8uZQSXi0wCxiY0UR8wp_Pe2gY86wVErp'; //'_baZ127gfvFIFmZ5umrrTBUUm6D7ve6p'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index2.js","mappings":"MAAa,YAAY,GAAG,CAAC,GAA2B;EACtD,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC;;ACFA;AACA;AACA;AAEA;MAEa,MAAM,GAAG,4BAA4B;MACrC,WAAW,GAAG,mCAAmC;AAE9D,MAAM,GAAG;EACP,MAAM,OAAO,CAAC,EAAU;IACtB,IAAI;MACF,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,IAAI,EAAE,EAAE,EAAE;QAC7C,MAAM,EAAE,KAAK;QAEb,OAAO,EAAE;UACP,eAAe,EAAE,UAAU,WAAW,EAAE;UACxC,cAAc,EAAE,kBAAkB;SACnC;;OAEF,CAAC,CAAC;MAEH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;MAEtC,OAAO,QAAQ,CAAC;KACjB;IAAC,OAAO,KAAK,EAAE;MACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACtB;GACF;CACF;MAEY,UAAU,GAAG,IAAI,GAAG;;;;","names":[],"sources":["./src/gtmUtils.ts","./src/components/api/index.ts"],"sourcesContent":["export const setDataLayer = (obj: Record<string, string>) => {\n return window.dataLayer.push(obj);\n};\n","// DEV/\n// export const APIURL = 'http://
|
|
1
|
+
{"file":"index2.js","mappings":"MAAa,YAAY,GAAG,CAAC,GAA2B;EACtD,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC;;ACFA;AACA;AACA;AAEA;MAEa,MAAM,GAAG,4BAA4B;MACrC,WAAW,GAAG,mCAAmC;AAE9D,MAAM,GAAG;EACP,MAAM,OAAO,CAAC,EAAU;IACtB,IAAI;MACF,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,IAAI,EAAE,EAAE,EAAE;QAC7C,MAAM,EAAE,KAAK;QAEb,OAAO,EAAE;UACP,eAAe,EAAE,UAAU,WAAW,EAAE;UACxC,cAAc,EAAE,kBAAkB;SACnC;;OAEF,CAAC,CAAC;MAEH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;MAEtC,OAAO,QAAQ,CAAC;KACjB;IAAC,OAAO,KAAK,EAAE;MACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;KACtB;GACF;CACF;MAEY,UAAU,GAAG,IAAI,GAAG;;;;","names":[],"sources":["./src/gtmUtils.ts","./src/components/api/index.ts"],"sourcesContent":["export const setDataLayer = (obj: Record<string, string>) => {\n return window.dataLayer.push(obj);\n};\n","// DEV/\n// export const APIURL = 'http://localhost:8055';\n// export const accessToken = 'iGAWx696CkipbZDOESC8CBn3BF7xPaei';\n\n// PROD\n\nexport const APIURL = 'https://color-selector.pl'; //'https://pallete-colors-backend.herokuapp.com';\nexport const accessToken = '8uZQSXi0wCxiY0UR8wp_Pe2gY86wVErp'; //'_baZ127gfvFIFmZ5umrrTBUUm6D7ve6p'\n\nclass API {\n async getData(ep: string) {\n try {\n const request = await fetch(`${APIURL}/${ep}`, {\n method: 'GET',\n\n headers: {\n 'Authorization': `Bearer ${accessToken}`,\n 'Content-Type': 'application/json',\n },\n // mode: 'no-cors',\n });\n\n const response = await request.json();\n\n return response;\n } catch (error) {\n console.error(error);\n }\n }\n}\n\nexport const ApiService = new API();\n"],"version":3}
|
|
@@ -132,6 +132,7 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
132
132
|
this.shop = undefined;
|
|
133
133
|
this.product = undefined;
|
|
134
134
|
this.baselink = undefined;
|
|
135
|
+
this.colorname = undefined;
|
|
135
136
|
this.show = false;
|
|
136
137
|
this.readyToClose = false;
|
|
137
138
|
}
|
|
@@ -151,7 +152,7 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
151
152
|
render() {
|
|
152
153
|
let content = null;
|
|
153
154
|
if (this.show) {
|
|
154
|
-
content = [h("my-backdrop", null), h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink })];
|
|
155
|
+
content = [h("my-backdrop", null), h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname })];
|
|
155
156
|
}
|
|
156
157
|
return (h("div", { onClick: () => {
|
|
157
158
|
if (this.readyToClose) {
|
|
@@ -174,6 +175,7 @@ const MyModalBundle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
174
175
|
"shop": [1],
|
|
175
176
|
"product": [1],
|
|
176
177
|
"baselink": [1],
|
|
178
|
+
"colorname": [1],
|
|
177
179
|
"show": [32],
|
|
178
180
|
"readyToClose": [32],
|
|
179
181
|
"open": [64],
|
|
@@ -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,CA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AAE,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}
|
|
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,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK;AAC5E,IAAI,IAAI,KAAK,IAAI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AQ,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 @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 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-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}
|
|
@@ -2345,24 +2345,37 @@ const fetchCategoryColorsQuery = (id, page) => lib.stringify({
|
|
|
2345
2345
|
}, {
|
|
2346
2346
|
encodeValuesOnly: true,
|
|
2347
2347
|
});
|
|
2348
|
-
const
|
|
2349
|
-
fields: ['*'
|
|
2348
|
+
const fetchColorByName = (id, colorName) => lib.stringify({
|
|
2349
|
+
fields: ['*'].join(','),
|
|
2350
2350
|
filter: {
|
|
2351
|
-
|
|
2352
|
-
|
|
2351
|
+
products: {
|
|
2352
|
+
Product_id: {
|
|
2353
2353
|
_eq: id,
|
|
2354
2354
|
},
|
|
2355
2355
|
},
|
|
2356
|
-
|
|
2357
|
-
|
|
2356
|
+
name: {
|
|
2357
|
+
_icontains: colorName,
|
|
2358
2358
|
},
|
|
2359
2359
|
},
|
|
2360
2360
|
meta: '*',
|
|
2361
|
+
limit: 100,
|
|
2361
2362
|
}, {
|
|
2362
2363
|
encodeValuesOnly: true,
|
|
2363
2364
|
});
|
|
2364
2365
|
|
|
2365
|
-
|
|
2366
|
+
function debounce(func, wait) {
|
|
2367
|
+
let timeout;
|
|
2368
|
+
return function executedFunction(...args) {
|
|
2369
|
+
const later = () => {
|
|
2370
|
+
clearTimeout(timeout);
|
|
2371
|
+
func(...args);
|
|
2372
|
+
};
|
|
2373
|
+
clearTimeout(timeout);
|
|
2374
|
+
timeout = setTimeout(later, wait);
|
|
2375
|
+
};
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
const myModalCss = ".pallete-wrapper *{font-family:\"Galatea\", sans-serif}.my-modal{box-shadow:1px 1px 1px #ccc;background-color:#fff;position:fixed;top:20px;left:50%;transform:translateX(-50%);max-width:1555px;width:90%;z-index:1000;text-align:center;padding:35px 40px;max-height:calc(100vh - 100px);overflow-y:auto;min-height:50vh}@media (max-width: 1024px){.my-modal{padding:40px 20px 20px}}.my-modal::-webkit-scrollbar{display:none}.my-modal .loader{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px}.my-modal__header{display:flex;align-items:center;justify-content:space-between;align-items:flex-end;margin-bottom:16px}@media (max-width: 1024px){.my-modal__header{flex-direction:column;margin-bottom:12px;align-items:center;display:block}}@media (max-width: 768px){.my-modal__header .image-wrapper{margin-bottom:12px}}.my-modal__header .image-wrapper>img{max-width:300px;object-fit:cover}@media (max-width: 768px){.my-modal__header .image-wrapper>img{max-width:200px}}.my-modal__header .search-wrapper{display:flex;gap:55px;align-items:flex-start}@media (max-width: 1024px){.my-modal__header .search-wrapper{justify-content:center;width:92%}}@media (max-width: 1024px){.my-modal__header .search-wrapper .sc-my-search-h{width:100%;margin:0 auto}}.my-modal__header .search-wrapper .my-modal__close{background:transparent;border:none;margin-top:-20px}.my-modal__header .search-wrapper .my-modal__close>img{width:45px;height:45px;object-fit:cover;cursor:pointer}@media (max-width: 1024px){.my-modal__header .search-wrapper .my-modal__close{margin-top:0px;position:absolute;right:10px;top:10px}}.my-modal__see-more{font-size:16px;display:flex;justify-content:center;align-items:center;font-weight:300;color:#575757;margin-top:12px;margin-bottom:0px}@media (max-width: 1024px){.my-modal__see-more{font-size:18px}}.my-modal__see-more img{width:45px;height:45px}@media (max-width: 1024px){.my-modal__see-more img{display:none}}.my-modal__wrapper{display:flex;flex-direction:column;position:relative}.my-modal__wrapper .boxes{display:flex;flex-direction:column;flex-wrap:wrap}.my-modal__wrapper .boxes__list{display:flex;flex-wrap:wrap;gap:5px 5px}@media (max-width: 1024px){.my-modal__wrapper .boxes__list{justify-content:center}}.my-modal__wrapper .boxes__box-content{width:100%;margin-bottom:5px;height:500px;text-align:left;display:flex;flex-direction:row;justify-content:space-between;position:relative}.my-modal__wrapper .boxes__box-content .closebtn{position:absolute;right:10px;top:10px;width:53px;height:53px;cursor:pointer;object-fit:cover;z-index:9999}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content{flex-direction:column-reverse;height:auto}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content{margin:0 auto}}.my-modal__wrapper .boxes__box-content__info{width:40%;padding:50px 40px;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info{width:100%;padding:15px;min-height:100px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info{min-height:auto}}.my-modal__wrapper .boxes__box-content__info h2{font-size:35px;font-weight:normal;margin-bottom:30px;color:#232323}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info h2{font-size:16px;text-align:center;margin-bottom:15px;margin-top:5px}}.my-modal__wrapper .boxes__box-content__info h4{margin-top:0px;margin-bottom:15px;font-size:16px;color:#4c4c4c}.my-modal__wrapper .boxes__box-content__info .divider{border:1px solid #4c4c4c;opacity:0.2;margin-bottom:20px}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info .divider{margin:10px 0px;display:none}}.my-modal__wrapper .boxes__box-content__info__value{display:flex;flex-direction:row;justify-content:flex-start}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value{justify-content:flex-start}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value{flex-direction:column}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-image{margin:0 auto;margin-bottom:10px}}.my-modal__wrapper .boxes__box-content__info__value-image img{width:114px;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-image img{width:75px}}.my-modal__wrapper .boxes__box-content__info__value-product{color:#232323;margin-left:10px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:26px;margin:0;margin-right:10px}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product h2{font-size:16px}}.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:20px;margin-top:0px;margin-bottom:0px}.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:20px}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product p:last-of-type{margin-bottom:0}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product p{font-size:10px}}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__info__value-product>div{display:flex;justify-content:flex-start;align-items:center}}@media (max-width: 768px){.my-modal__wrapper .boxes__box-content__info__value-product>div{flex-direction:column}}.my-modal__wrapper .boxes__box-content__slider{width:60%;min-width:60%;max-width:60%;position:relative}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider{width:100%;display:block;min-width:100%;max-width:100%}}.my-modal__wrapper .boxes__box-content__slider .color-big-image{width:100%;height:100%;object-fit:cover}@media (max-width: 1024px){.my-modal__wrapper .boxes__box-content__slider .color-big-image{height:300px}}.my-modal__wrapper .boxes__box-content__white *{color:#fff}.my-modal__wrapper .boxes__box-content__white h2{color:#fff}.my-modal__wrapper .pagination{margin:10px 0px;font-size:16px;display:flex;flex-direction:row;align-items:center;justify-content:center}.my-modal__wrapper .pagination>span{margin:0 3px;cursor:pointer;min-width:20px;padding:5px;box-shadow:1px 1px 1px #ccc}.my-modal__wrapper .pagination .current{background-color:wheat}.my-modal .categories{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;align-items:flex-start}.my-modal .categories__container{display:flex;flex-wrap:nowrap;gap:5px 5px;overflow-x:auto;width:100%}@media (max-width: 1024px){.my-modal .categories__container{padding-bottom:5px}}.my-modal .categories__slide-information{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.my-modal .categories__slide-information span{color:#4c4c4c;font-size:16px;font-weight:normal}.my-modal .categories__slide-information span:first-of-type{margin-left:7px}.my-modal .categories__slide-information span:last-of-type{margin-right:7px}.my-modal .button,.my-modal a{background-color:#fff;font-size:16px;box-shadow:0px 10px 20px rgba(0, 0, 0, 0.1);border-radius:22px;padding:10px 35px;color:#232323;text-decoration:none;display:block;text-align:center;transition:all 0.7s ease-in-out;border:none;cursor:pointer}.my-modal .button:hover,.my-modal a:hover{color:#fff;background-color:#232323}.my-modal .button.brown,.my-modal a.brown{background-color:#3c2114;color:#fff}.my-modal .button.brown:hover,.my-modal a.brown:hover{color:#fff;background-color:#232323}.my-modal .button.inverse,.my-modal a.inverse{background-color:#232323;color:#fff}.my-modal .button.inverse:hover,.my-modal a.inverse:hover{color:#232323;background-color:#fff}@media (max-width: 1024px){.my-modal .button,.my-modal a{max-width:150px;font-size:13px;padding:12px 25px}}@media (max-width: 768px){.my-modal .button,.my-modal a{margin:0 auto}}.my-modal>.button{margin:10px auto}";
|
|
2366
2379
|
|
|
2367
2380
|
const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
2368
2381
|
constructor() {
|
|
@@ -2486,6 +2499,48 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2486
2499
|
this.loading = false;
|
|
2487
2500
|
}
|
|
2488
2501
|
};
|
|
2502
|
+
this.handleCategoryClick = (color) => {
|
|
2503
|
+
if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
|
|
2504
|
+
this.data && this.fetchProductColors(String(this.data.id));
|
|
2505
|
+
this.selectedCategory = null;
|
|
2506
|
+
}
|
|
2507
|
+
else {
|
|
2508
|
+
color && this.fetchCategoryColors(color);
|
|
2509
|
+
this.selectedCategory = color;
|
|
2510
|
+
}
|
|
2511
|
+
this.currentColor = null;
|
|
2512
|
+
this.clearSearchText.emit();
|
|
2513
|
+
};
|
|
2514
|
+
// async searchColorsHandler(event: CustomEvent) {
|
|
2515
|
+
// this.loading = true;
|
|
2516
|
+
// this.currentColor = null;
|
|
2517
|
+
// // if search is empty set to first category to not showing whole product colors
|
|
2518
|
+
// if (event.detail === '') {
|
|
2519
|
+
// this.handleCategoryClick(this.selectedCategory);
|
|
2520
|
+
// this.loading = true;
|
|
2521
|
+
// }
|
|
2522
|
+
// try {
|
|
2523
|
+
// if (this.data && this.data.id && event.detail !== '') {
|
|
2524
|
+
// const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);
|
|
2525
|
+
// if (response) {
|
|
2526
|
+
// this.colors = {
|
|
2527
|
+
// list:
|
|
2528
|
+
// (response &&
|
|
2529
|
+
// response.data &&
|
|
2530
|
+
// response.data.map((item: Color) => ({
|
|
2531
|
+
// ...item,
|
|
2532
|
+
// }))) ||
|
|
2533
|
+
// [],
|
|
2534
|
+
// pagination: response.meta,
|
|
2535
|
+
// };
|
|
2536
|
+
// }
|
|
2537
|
+
// }
|
|
2538
|
+
// } catch (error) {
|
|
2539
|
+
// console.error(error);
|
|
2540
|
+
// } finally {
|
|
2541
|
+
// this.loading = false;
|
|
2542
|
+
// }
|
|
2543
|
+
// }
|
|
2489
2544
|
this.onPage = (page) => {
|
|
2490
2545
|
if (this.data) {
|
|
2491
2546
|
if (this.selectedCategory) {
|
|
@@ -2499,21 +2554,10 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2499
2554
|
this.currentColor = null;
|
|
2500
2555
|
this.currentIndex = null;
|
|
2501
2556
|
};
|
|
2502
|
-
this.handleCategoryClick = (color) => {
|
|
2503
|
-
if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
|
|
2504
|
-
this.data && this.fetchProductColors(String(this.data.id));
|
|
2505
|
-
this.selectedCategory = null;
|
|
2506
|
-
}
|
|
2507
|
-
else {
|
|
2508
|
-
color && this.fetchCategoryColors(color);
|
|
2509
|
-
this.selectedCategory = color;
|
|
2510
|
-
}
|
|
2511
|
-
this.currentColor = null;
|
|
2512
|
-
this.clearSearchText.emit();
|
|
2513
|
-
};
|
|
2514
2557
|
this.shop = undefined;
|
|
2515
2558
|
this.product = undefined;
|
|
2516
2559
|
this.baselink = undefined;
|
|
2560
|
+
this.selectedcolor = undefined;
|
|
2517
2561
|
this.closeImage = 'close.png';
|
|
2518
2562
|
this.arrowDown = 'arrow_down.png';
|
|
2519
2563
|
this.chunksNum = 12;
|
|
@@ -2531,6 +2575,8 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2531
2575
|
this.colorCategories = null;
|
|
2532
2576
|
this.selectedCategory = null;
|
|
2533
2577
|
this.page = 1;
|
|
2578
|
+
this.colorIsSelected = false;
|
|
2579
|
+
this.debouncedSearchColorsHandler = debounce(this.searchColor.bind(this), 300);
|
|
2534
2580
|
}
|
|
2535
2581
|
setInfoBoxWidth(newValue) {
|
|
2536
2582
|
this.infoBoxWidth = newValue * this.boxWidth;
|
|
@@ -2561,33 +2607,54 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2561
2607
|
this.calculateBoxCount();
|
|
2562
2608
|
this.displayForMobile();
|
|
2563
2609
|
}
|
|
2564
|
-
async
|
|
2565
|
-
|
|
2566
|
-
this.currentColor = null;
|
|
2567
|
-
// if search is empty set to first category to not showing whole product colors
|
|
2610
|
+
async searchColor(event) {
|
|
2611
|
+
var _a, _b;
|
|
2568
2612
|
if (event.detail === '') {
|
|
2569
|
-
this.
|
|
2613
|
+
this.fetchProductData();
|
|
2570
2614
|
this.loading = true;
|
|
2571
2615
|
}
|
|
2572
|
-
|
|
2573
|
-
if (
|
|
2574
|
-
|
|
2616
|
+
else {
|
|
2617
|
+
if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
2618
|
+
return;
|
|
2619
|
+
}
|
|
2620
|
+
try {
|
|
2621
|
+
const response = await ApiService.getData(`items/Color?${fetchColorByName((_b = this.data) === null || _b === void 0 ? void 0 : _b.id, event.detail)}`);
|
|
2575
2622
|
if (response) {
|
|
2576
2623
|
this.colors = {
|
|
2577
|
-
list:
|
|
2624
|
+
list: response &&
|
|
2578
2625
|
response.data &&
|
|
2579
|
-
response.data.map((item) => (Object.assign({}, item)))
|
|
2580
|
-
[],
|
|
2626
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2581
2627
|
pagination: response.meta,
|
|
2582
2628
|
};
|
|
2583
2629
|
}
|
|
2584
2630
|
}
|
|
2631
|
+
catch (error) {
|
|
2632
|
+
console.error(error);
|
|
2633
|
+
}
|
|
2634
|
+
finally {
|
|
2635
|
+
this.loading = false;
|
|
2636
|
+
}
|
|
2585
2637
|
}
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2638
|
+
}
|
|
2639
|
+
searchColorsHandler(event) {
|
|
2640
|
+
this.loading = true;
|
|
2641
|
+
this.currentColor = null;
|
|
2642
|
+
this.debouncedSearchColorsHandler(event);
|
|
2643
|
+
}
|
|
2644
|
+
openSeletedColor() {
|
|
2645
|
+
var _a, _b, _c;
|
|
2646
|
+
if (!((_a = this.colors) === null || _a === void 0 ? void 0 : _a.list) || !this.selectedcolor)
|
|
2647
|
+
return;
|
|
2648
|
+
if (!this.colorIsSelected) {
|
|
2649
|
+
const result = this.chunks(this.colors.list)
|
|
2650
|
+
.map((innerArray, arrayIndex) => {
|
|
2651
|
+
const foundColor = innerArray.find(color => { var _a, _b; return color.name.trim() === ((_b = (_a = this.selectedcolor) === null || _a === void 0 ? void 0 : _a.trim()) === null || _b === void 0 ? void 0 : _b.toUpperCase()); });
|
|
2652
|
+
return foundColor ? { color: foundColor, index: arrayIndex } : null;
|
|
2653
|
+
})
|
|
2654
|
+
.filter(item => item !== null);
|
|
2655
|
+
this.currentColor = (_b = result[0]) === null || _b === void 0 ? void 0 : _b.color;
|
|
2656
|
+
this.currentIndex = (_c = result[0]) === null || _c === void 0 ? void 0 : _c.index;
|
|
2657
|
+
this.colorIsSelected = true;
|
|
2591
2658
|
}
|
|
2592
2659
|
}
|
|
2593
2660
|
componentWillLoad() {
|
|
@@ -2598,13 +2665,11 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2598
2665
|
this.displayForMobile();
|
|
2599
2666
|
this.calculateBoxCount();
|
|
2600
2667
|
this.colorTimer();
|
|
2668
|
+
this.openSeletedColor();
|
|
2601
2669
|
}
|
|
2602
2670
|
render() {
|
|
2603
|
-
var _a, _b, _c
|
|
2604
|
-
return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && (h("
|
|
2605
|
-
isImageInsteadHex: (c === null || c === void 0 ? void 0 : c.imageInsteadHex) || false,
|
|
2606
|
-
bigImage: (c === null || c === void 0 ? void 0 : c.bigImage) || '',
|
|
2607
|
-
} })))), this.isMobile && (h("div", { class: 'categories__slide-information', style: { width: `${this.infoBoxWidth}px` } }, h("span", null, "Przewi\u0144 w lewo"), h("span", null, "Przewi\u0144 w prawo"))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2671
|
+
var _a, _b, _c;
|
|
2672
|
+
return (h("div", { class: `my-modal`, onMouseEnter: () => this.handleReadyToClose(false), onMouseLeave: () => this.handleReadyToClose(true) }, this.preloader && (h("div", { class: 'loader' }, h("my-loader", null))), !this.preloader && this.data && (h("div", { class: `my-modal__header` }, h("div", { class: "image-wrapper" }, h("img", { src: `${APIURL}/assets/${(_a = this.data) === null || _a === void 0 ? void 0 : _a.modalLogo}?access_token=${accessToken}`, alt: "modal-logo" }), !this.preloader && this.data && (h("p", { class: "my-modal__see-more" }, (_b = this.data) === null || _b === void 0 ? void 0 : _b.modalDescription))), h("div", { class: "search-wrapper" }, !this.preloader && h("my-search", { productId: Number((_c = this.data) === null || _c === void 0 ? void 0 : _c.id), isMobile: this.isMobile }), !this.preloader && (h("button", { class: "my-modal__close", onClick: () => this.closeModalHandler() }, h("img", { src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" })))))), h("div", { class: 'my-modal__wrapper' }, this.loading && h("my-loader", null), !this.loading && this.colors && (h("div", { class: 'container_boxes' }, this.colors.list.length > 0 ? (this.chunks(this.colors.list).map((color, index) => {
|
|
2608
2673
|
var _a;
|
|
2609
2674
|
return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
|
|
2610
2675
|
var _a;
|
|
@@ -2642,6 +2707,7 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2642
2707
|
"shop": [1],
|
|
2643
2708
|
"product": [1],
|
|
2644
2709
|
"baselink": [1],
|
|
2710
|
+
"selectedcolor": [1],
|
|
2645
2711
|
"closeImage": [1, "close-image"],
|
|
2646
2712
|
"arrowDown": [1, "arrow-down"],
|
|
2647
2713
|
"chunksNum": [32],
|
|
@@ -2659,6 +2725,7 @@ const MyModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
|
|
|
2659
2725
|
"colorCategories": [32],
|
|
2660
2726
|
"selectedCategory": [32],
|
|
2661
2727
|
"page": [32],
|
|
2728
|
+
"colorIsSelected": [32],
|
|
2662
2729
|
"open": [64]
|
|
2663
2730
|
}, [[0, "closeInfoBox", "closeInfoBoxHandler"], [9, "resize", "handleResize"], [0, "searchColors", "searchColorsHandler"]]]);
|
|
2664
2731
|
function defineCustomElement() {
|