@ppg_pl/pallete 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-160fcb6c.js +1661 -0
- package/dist/cjs/index-160fcb6c.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +24 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/my-backdrop_8.cjs.entry.js +7985 -0
- package/dist/cjs/my-backdrop_8.cjs.entry.js.map +1 -0
- package/dist/cjs/pallete.cjs.js +28 -0
- package/dist/cjs/pallete.cjs.js.map +1 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/api/index.js +20 -0
- package/dist/collection/components/api/index.js.map +1 -0
- package/dist/collection/components/api/services.js +82 -0
- package/dist/collection/components/api/services.js.map +1 -0
- package/dist/collection/components/my-backdrop/my-backdrop.css +13 -0
- package/dist/collection/components/my-backdrop/my-backdrop.js +17 -0
- package/dist/collection/components/my-backdrop/my-backdrop.js.map +1 -0
- package/dist/collection/components/my-colorbox/my-colorbox.css +52 -0
- package/dist/collection/components/my-colorbox/my-colorbox.js +157 -0
- package/dist/collection/components/my-colorbox/my-colorbox.js.map +1 -0
- package/dist/collection/components/my-colorinfo/my-colorinfo.js +187 -0
- package/dist/collection/components/my-colorinfo/my-colorinfo.js.map +1 -0
- package/dist/collection/components/my-component/my-component.css +6 -0
- package/dist/collection/components/my-component/my-component.js +133 -0
- package/dist/collection/components/my-component/my-component.js.map +1 -0
- package/dist/collection/components/my-loader/my-loader.css +85 -0
- package/dist/collection/components/my-loader/my-loader.js +19 -0
- package/dist/collection/components/my-loader/my-loader.js.map +1 -0
- package/dist/collection/components/my-modal/__mocks__/index.js +759 -0
- package/dist/collection/components/my-modal/__mocks__/index.js.map +1 -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 +367 -0
- package/dist/collection/components/my-modal/my-modal.js +448 -0
- package/dist/collection/components/my-modal/my-modal.js.map +1 -0
- package/dist/collection/components/my-search/assets/search.svg +15 -0
- package/dist/collection/components/my-search/my-search.css +35 -0
- package/dist/collection/components/my-search/my-search.js +125 -0
- package/dist/collection/components/my-search/my-search.js.map +1 -0
- package/dist/collection/components/my-slider/index.js +148 -0
- package/dist/collection/components/my-slider/index.js.map +1 -0
- package/dist/collection/components/my-slider/my-slider.css +88 -0
- package/dist/collection/gtmUtils.js +4 -0
- package/dist/collection/gtmUtils.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/types.js +2 -0
- package/dist/collection/types.js.map +1 -0
- package/{www/build/gtmUtils-dcdac4ce.js → dist/components/gtmUtils.js} +2 -0
- package/dist/components/gtmUtils.js.map +1 -0
- package/dist/components/index.d.ts +9 -11
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index2.js +5305 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/components/my-backdrop.js +8 -0
- package/dist/components/my-backdrop.js.map +1 -0
- package/dist/components/my-backdrop2.js +31 -0
- package/dist/components/my-backdrop2.js.map +1 -0
- package/dist/components/my-colorbox.js +8 -0
- package/dist/components/my-colorbox.js.map +1 -0
- package/dist/{pallete/my-colorbox.entry.js → components/my-colorbox2.js} +37 -8
- package/dist/components/my-colorbox2.js.map +1 -0
- package/dist/components/my-colorinfo.js +8 -0
- package/dist/components/my-colorinfo.js.map +1 -0
- package/dist/{pallete/my-colorinfo.entry.js → components/my-colorinfo2.js} +44 -10
- package/dist/components/my-colorinfo2.js.map +1 -0
- package/dist/{pallete/my-component.entry.js → components/my-component.js} +87 -11
- package/dist/components/my-component.js.map +1 -0
- package/dist/components/my-loader.js +8 -0
- package/dist/components/my-loader.js.map +1 -0
- package/{www/build/my-loader.entry.js → dist/components/my-loader2.js} +23 -7
- package/dist/components/my-loader2.js.map +1 -0
- package/dist/components/my-modal.js +8 -0
- package/dist/components/my-modal.js.map +1 -0
- package/dist/{pallete/my-modal.entry.js → components/my-modal2.js} +120 -120
- package/dist/components/my-modal2.js.map +1 -0
- package/dist/components/my-search.js +8 -0
- package/dist/components/my-search.js.map +1 -0
- package/{www/build/my-search.entry.js → dist/components/my-search2.js} +32 -9
- package/dist/components/my-search2.js.map +1 -0
- package/dist/components/my-slider.js +8 -0
- package/dist/components/my-slider.js.map +1 -0
- package/dist/esm/index-943c259f.js +1632 -0
- package/dist/esm/index-943c259f.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +20 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/my-backdrop_8.entry.js +7974 -0
- package/dist/esm/my-backdrop_8.entry.js.map +1 -0
- package/dist/esm/pallete.js +23 -0
- package/dist/esm/pallete.js.map +1 -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/index.esm.js +1 -0
- package/dist/pallete/index.esm.js.map +1 -0
- package/dist/pallete/p-9a7eff4f.entry.js +2 -0
- package/dist/pallete/p-9a7eff4f.entry.js.map +1 -0
- package/dist/pallete/p-c77aaa54.js +3 -0
- package/dist/pallete/p-c77aaa54.js.map +1 -0
- package/dist/pallete/pallete.css +1 -3
- package/dist/pallete/pallete.esm.js +2 -129
- package/dist/pallete/pallete.esm.js.map +1 -0
- package/dist/types/components/api/services.d.ts +1 -1
- package/dist/types/components/my-component/my-component.d.ts +2 -0
- package/dist/types/components/my-modal/__mocks__/index.d.ts +415 -0
- package/dist/types/components/my-modal/my-modal.d.ts +3 -1
- package/dist/types/components.d.ts +2 -0
- package/dist/types/stencil-public-runtime.d.ts +91 -19
- package/dist/types/types.d.ts +8 -8
- package/loader/index.d.ts +9 -0
- package/loader/package.json +1 -0
- package/package.json +21 -5
- package/www/build/index.esm.js +1 -0
- package/www/build/index.esm.js.map +1 -0
- package/www/build/p-825a7d1d.js +163 -0
- package/www/build/p-9a7eff4f.entry.js +2 -0
- package/www/build/p-9a7eff4f.entry.js.map +1 -0
- package/www/build/p-c77aaa54.js +3 -0
- package/www/build/p-c77aaa54.js.map +1 -0
- package/www/build/p-fd390eef.css +3 -0
- package/www/build/pallete.css +1 -3
- package/www/build/pallete.esm.js +2 -129
- package/www/build/pallete.esm.js.map +1 -0
- package/www/index.html +2 -40
- package/dist/pallete/app-globals-0f993ce5.js +0 -3
- package/dist/pallete/css-shim-60f618b9.js +0 -4
- package/dist/pallete/dom-4eeb3fee.js +0 -73
- package/dist/pallete/gtmUtils-dcdac4ce.js +0 -5
- package/dist/pallete/index-1ac7471e.js +0 -3059
- package/dist/pallete/my-backdrop.entry.js +0 -15
- package/dist/pallete/my-loader.entry.js +0 -15
- package/dist/pallete/my-search.entry.js +0 -36
- package/dist/pallete/my-slider.entry.js +0 -11333
- package/dist/pallete/shadow-css-02866686.js +0 -387
- package/www/build/app-globals-0f993ce5.js +0 -3
- package/www/build/css-shim-60f618b9.js +0 -4
- package/www/build/dom-4eeb3fee.js +0 -73
- package/www/build/index-1ac7471e.js +0 -3059
- package/www/build/my-backdrop.entry.js +0 -15
- package/www/build/my-colorbox.entry.js +0 -40
- package/www/build/my-colorinfo.entry.js +0 -36
- package/www/build/my-component.entry.js +0 -154
- package/www/build/my-modal.entry.js +0 -2459
- package/www/build/my-slider.entry.js +0 -11333
- package/www/build/shadow-css-02866686.js +0 -387
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-160fcb6c.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Browser v3.1.0 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchBrowser = () => {
|
|
11
|
+
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));
|
|
12
|
+
const opts = {};
|
|
13
|
+
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
|
14
|
+
if (importMeta !== '') {
|
|
15
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
16
|
+
// TODO(STENCIL-661): Remove code related to the dynamic import shim
|
|
17
|
+
// TODO(STENCIL-663): Remove code related to deprecated `safari10` field.
|
|
18
|
+
}
|
|
19
|
+
return index.promiseResolve(opts);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
patchBrowser().then(options => {
|
|
23
|
+
return index.bootstrapLazy([["my-backdrop_8.cjs",[[2,"my-component",{"shop":[1],"product":[1],"show":[32],"readyToClose":[32],"open":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[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"]}],[2,"my-loader"],[2,"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);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
exports.setNonce = index.setNonce;
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=pallete.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"pallete.cjs.js","mappings":";;;;;;AAAA;AACA;AACA;AAiBA,MAAM,YAAY,GAAG,MAAM;AAkC3B,IAAI,MAAM,UAAU,GAAG,yMAAe,CAAC;AACvC,IAAI,MAAM,IAAI,GAAiE,EAAE,CAAC;AAgBlF;AACA,IAAI,IAAuB,UAAU,KAAK,EAAE,EAAE;AAC9C,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC;AAC1D;AACA;AACA,KAaK;AACL,IAAI,OAAOA,oBAAc,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;;ACtFD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI;AAE/B,EAAE,OAAOC,mBAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC,CAAC;;;;","names":["promiseResolve","bootstrapLazy"],"sources":["./node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v3.1.0 | MIT Licensed | https://stenciljs.com\n */\nimport { BUILD, NAMESPACE } from '@stencil/core/internal/app-data';\nimport { consoleDevInfo, plt, win, doc, promiseResolve, H } from '@stencil/core';\n/**\n * Helper method for querying a `meta` tag that contains a nonce value\n * out of a DOM's head.\n *\n * @param doc The DOM containing the `head` to query against\n * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag\n * exists or the tag has no content.\n */\nfunction queryNonceMetaTagContent(doc) {\n var _a, _b, _c;\n return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name=\"csp-nonce\"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;\n}\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\\s|-/g, '_')}`;\nconst patchBrowser = () => {\n // NOTE!! This fn cannot use async/await!\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo('Running in development mode.');\n }\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n if (BUILD.cssVarShim) {\n // shim css vars\n // TODO(STENCIL-659): Remove code implementing the CSS variable shim\n plt.$cssShim$ = win.__cssshim;\n }\n if (BUILD.cloneNodeFix) {\n // opted-in to polyfill cloneNode() for slot polyfilled components\n patchCloneNodeFix(H.prototype);\n }\n if (BUILD.profile && !performance.mark) {\n // not all browsers support performance.mark/measure (Safari 10)\n // because the mark/measure APIs are designed to write entries to a buffer in the browser that does not exist,\n // simply stub the implementations out.\n // TODO(STENCIL-323): Remove this patch when support for older browsers is removed (breaking)\n // @ts-ignore\n performance.mark = performance.measure = () => {\n /*noop*/\n };\n performance.getEntriesByName = () => [];\n }\n // @ts-ignore\n const scriptElm = \n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim\n ? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\\/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) ||\n s.getAttribute('data-stencil-namespace') === NAMESPACE)\n : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})['data-opts'] || {} : {};\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {\n // Safari < v11 support: This IF is true if it's Safari below v11.\n // This fn cannot use async/await since Safari didn't support it until v11,\n // however, Safari 10 did support modules. Safari 10 also didn't support \"nomodule\",\n // so both the ESM file and nomodule file would get downloaded. Only Safari\n // has 'onbeforeload' in the script, and \"history.scrollRestoration\" was added\n // to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.\n // IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.\n return {\n then() {\n /* promise noop */\n },\n };\n }\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n if (!BUILD.safari10 && importMeta !== '') {\n opts.resourcesUrl = new URL('.', importMeta).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n // TODO(STENCIL-663): Remove code related to deprecated `safari10` field.\n }\n else if (BUILD.dynamicImportShim || BUILD.safari10) {\n opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim) {\n patchDynamicImport(opts.resourcesUrl, scriptElm);\n }\n // TODO(STENCIL-661): Remove code related to the dynamic import shim\n if (BUILD.dynamicImportShim && !win.customElements) {\n // module support, but no custom elements support (Old Edge)\n // @ts-ignore\n return import(/* webpackChunkName: \"polyfills-dom\" */ './dom.js').then(() => opts);\n }\n }\n return promiseResolve(opts);\n};\n// TODO(STENCIL-661): Remove code related to the dynamic import shim\nconst patchDynamicImport = (base, orgScriptElm) => {\n const importFunctionName = getDynamicImportFunction(NAMESPACE);\n try {\n // test if this browser supports dynamic imports\n // There is a caching issue in V8, that breaks using import() in Function\n // By generating a random string, we can workaround it\n // Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info\n win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);\n }\n catch (e) {\n // this shim is specifically for browsers that do support \"esm\" imports\n // however, they do NOT support \"dynamic\" imports\n // basically this code is for old Edge, v18 and below\n const moduleMap = new Map();\n win[importFunctionName] = (src) => {\n var _a;\n const url = new URL(src, base).href;\n let mod = moduleMap.get(url);\n if (!mod) {\n const script = doc.createElement('script');\n script.type = 'module';\n script.crossOrigin = orgScriptElm.crossOrigin;\n script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {\n type: 'application/javascript',\n }));\n // Apply CSP nonce to the script tag if it exists\n const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);\n if (nonce != null) {\n script.setAttribute('nonce', nonce);\n }\n mod = new Promise((resolve) => {\n script.onload = () => {\n resolve(win[importFunctionName].m);\n script.remove();\n };\n });\n moduleMap.set(url, mod);\n doc.head.appendChild(script);\n }\n return mod;\n };\n }\n};\nconst patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function (deep) {\n if (this.nodeName === 'TEMPLATE') {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n // Node.ATTRIBUTE_NODE === 2, and checking because IE11\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport { patchBrowser };\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(options => {\n globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"version":3}
|
|
@@ -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": "3.1.0",
|
|
15
|
+
"typescriptVersion": "4.9.5"
|
|
16
|
+
},
|
|
17
|
+
"collections": [],
|
|
18
|
+
"bundles": []
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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();
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/api/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG,8CAA8C,CAAC;AAErE,MAAM,GAAG;EACP,KAAK,CAAC,OAAO,CAAC,EAAU;IACtB,IAAI;MACF,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,QAAQ,EAAE,EAAE,EAAE;QACjD,MAAM,EAAE,KAAK;QAEb,OAAO,EAAE;UACP,cAAc,EAAE,kBAAkB;SACnC;OACF,CAAC,CAAC;MACH,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;EACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC","sourcesContent":["export const APIURL = 'https://pallete-colors-backend.herokuapp.com';\n\nclass API {\n async getData(ep: string) {\n try {\n const request = await fetch(`${APIURL}/api/${ep}`, {\n method: 'GET',\n\n headers: {\n 'Content-Type': 'application/json',\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"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
});
|
|
82
|
+
//# sourceMappingURL=services.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/components/api/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EAAU,EAAE,IAAa,EAAE,EAAE,CACnE,EAAE,CAAC,SAAS,CACV;EACE,OAAO,EAAE;IACP,QAAQ,EAAE;MACR,EAAE,EAAE;QACF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AAc,CAAC;EACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC;EACjE,UAAU,EAAE;IACV,IAAI,EAAE,CAAC;IACP,QAAQ,EAAE,GAAG;GACd;CACF,EACD;EACE,gBAAgB,EAAE,IAAI,EAAE,eAAe;CACxC,CACF,CAAC","sourcesContent":["import qs from 'qs';\nimport { Color } from '../../types';\n\nexport const fetchProductColorsQuery = (id: string, page?: number) =>\n qs.stringify(\n {\n filters: {\n products: {\n id: {\n $eq: id,\n },\n },\n },\n sort: ['position:asc'],\n populate: ['image', 'category', 'links', 'links.shop'],\n pagination: {\n page: page || 1,\n pageSize: 100,\n },\n },\n {\n encodeValuesOnly: true, // prettify url\n },\n );\n\nexport const fetchCategoryColorsQuery = (color: Color) =>\n qs.stringify(\n {\n filters: {\n category: {\n id: {\n $eq: color.id,\n },\n },\n },\n sort: ['position:asc'],\n populate: ['image', 'category', 'links', 'links.shop'],\n pagination: {\n page: 1,\n pageSize: 100,\n },\n },\n {\n encodeValuesOnly: true, // prettify url\n },\n );\n\nexport const fetchColorByNumber = (productId: number, colorNumber: string) =>\n qs.stringify(\n {\n filters: {\n $or: [\n {\n $and: [\n {\n number: {\n $contains: colorNumber,\n },\n },\n {\n products: {\n id: {\n $eq: productId,\n },\n },\n },\n ],\n },\n {\n $and: [\n {\n name: {\n $contains: colorNumber,\n },\n },\n {\n products: {\n id: {\n $eq: productId,\n },\n },\n },\n ],\n },\n ],\n },\n sort: ['position:asc'],\n populate: ['image', 'category', 'product', 'links', 'links.shop'],\n pagination: {\n page: 1,\n pageSize: 100,\n },\n },\n {\n encodeValuesOnly: true, // prettify url\n },\n );\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class MyBackdrop {
|
|
2
|
+
render() {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
static get is() { return "my-backdrop"; }
|
|
6
|
+
static get originalStyleUrls() {
|
|
7
|
+
return {
|
|
8
|
+
"$": ["my-backdrop.scss"]
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
static get styleUrls() {
|
|
12
|
+
return {
|
|
13
|
+
"$": ["my-backdrop.css"]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=my-backdrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-backdrop.js","sourceRoot":"","sources":["../../../src/components/my-backdrop/my-backdrop.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM1C,MAAM,OAAO,UAAU;EACrB,MAAM;IACJ,OAAO,IAAI,CAAC;EACd,CAAC;;;;;;;;CACF","sourcesContent":["import { Component } from '@stencil/core';\n\n@Component({\n tag: 'my-backdrop',\n styleUrl: 'my-backdrop.scss',\n})\nexport class MyBackdrop {\n render() {\n return null;\n }\n}\n"]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.pallete-wrapper * {
|
|
2
|
+
font-family: "Galatea", sans-serif;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.my-color-box {
|
|
6
|
+
width: 125px;
|
|
7
|
+
height: 125px;
|
|
8
|
+
display: block;
|
|
9
|
+
margin-bottom: 5px;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
@media (max-width: 1024px) {
|
|
17
|
+
.my-color-box {
|
|
18
|
+
width: 80px;
|
|
19
|
+
height: 80px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
.my-color-box .color-name {
|
|
23
|
+
width: 100%;
|
|
24
|
+
background-color: #fff;
|
|
25
|
+
padding: 15px 0px 10px;
|
|
26
|
+
border-top-left-radius: 15px;
|
|
27
|
+
border-top-right-radius: 15px;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
transition: 0.3s opacity ease-in-out;
|
|
30
|
+
font-size: 10px;
|
|
31
|
+
color: #232323;
|
|
32
|
+
text-transform: lowercase;
|
|
33
|
+
}
|
|
34
|
+
.my-color-box.active .color-name {
|
|
35
|
+
opacity: 1;
|
|
36
|
+
}
|
|
37
|
+
.my-color-box.categoryactive {
|
|
38
|
+
width: 120px;
|
|
39
|
+
height: 115px;
|
|
40
|
+
}
|
|
41
|
+
.my-color-box.categoryactive .color-name {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
@media (max-width: 1024px) {
|
|
45
|
+
.my-color-box.categoryactive {
|
|
46
|
+
width: 72px;
|
|
47
|
+
height: 72px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
.my-color-box:hover .color-name {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { 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
|
+
this.color = undefined;
|
|
27
|
+
this.name = undefined;
|
|
28
|
+
this.shop = undefined;
|
|
29
|
+
this.product = undefined;
|
|
30
|
+
this.isActive = undefined;
|
|
31
|
+
this.isCategoryActive = undefined;
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (h("div", { onMouseEnter: () => this.colorCheck(), onMouseLeave: () => this.colorUnCheck(), class: `my-color-box ${this.isActive ? 'active' : ''} ${this.isCategoryActive ? 'categoryactive' : ''}`, style: {
|
|
35
|
+
background: this.color,
|
|
36
|
+
border: this.isCategoryActive ? `5px solid ${this.darkenColor(this.color)}` : '',
|
|
37
|
+
} }, h("div", { class: "color-name" }, this.name)));
|
|
38
|
+
}
|
|
39
|
+
static get is() { return "my-colorbox"; }
|
|
40
|
+
static get originalStyleUrls() {
|
|
41
|
+
return {
|
|
42
|
+
"$": ["my-colorbox.scss"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get styleUrls() {
|
|
46
|
+
return {
|
|
47
|
+
"$": ["my-colorbox.css"]
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
static get properties() {
|
|
51
|
+
return {
|
|
52
|
+
"color": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"mutable": false,
|
|
55
|
+
"complexType": {
|
|
56
|
+
"original": "string",
|
|
57
|
+
"resolved": "string",
|
|
58
|
+
"references": {}
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"optional": false,
|
|
62
|
+
"docs": {
|
|
63
|
+
"tags": [],
|
|
64
|
+
"text": ""
|
|
65
|
+
},
|
|
66
|
+
"attribute": "color",
|
|
67
|
+
"reflect": false
|
|
68
|
+
},
|
|
69
|
+
"name": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"mutable": false,
|
|
72
|
+
"complexType": {
|
|
73
|
+
"original": "string",
|
|
74
|
+
"resolved": "string",
|
|
75
|
+
"references": {}
|
|
76
|
+
},
|
|
77
|
+
"required": false,
|
|
78
|
+
"optional": false,
|
|
79
|
+
"docs": {
|
|
80
|
+
"tags": [],
|
|
81
|
+
"text": ""
|
|
82
|
+
},
|
|
83
|
+
"attribute": "name",
|
|
84
|
+
"reflect": false
|
|
85
|
+
},
|
|
86
|
+
"shop": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"mutable": false,
|
|
89
|
+
"complexType": {
|
|
90
|
+
"original": "string",
|
|
91
|
+
"resolved": "string",
|
|
92
|
+
"references": {}
|
|
93
|
+
},
|
|
94
|
+
"required": false,
|
|
95
|
+
"optional": false,
|
|
96
|
+
"docs": {
|
|
97
|
+
"tags": [],
|
|
98
|
+
"text": ""
|
|
99
|
+
},
|
|
100
|
+
"attribute": "shop",
|
|
101
|
+
"reflect": false
|
|
102
|
+
},
|
|
103
|
+
"product": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"mutable": false,
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "string",
|
|
108
|
+
"resolved": "string",
|
|
109
|
+
"references": {}
|
|
110
|
+
},
|
|
111
|
+
"required": false,
|
|
112
|
+
"optional": false,
|
|
113
|
+
"docs": {
|
|
114
|
+
"tags": [],
|
|
115
|
+
"text": ""
|
|
116
|
+
},
|
|
117
|
+
"attribute": "product",
|
|
118
|
+
"reflect": false
|
|
119
|
+
},
|
|
120
|
+
"isActive": {
|
|
121
|
+
"type": "boolean",
|
|
122
|
+
"mutable": false,
|
|
123
|
+
"complexType": {
|
|
124
|
+
"original": "boolean",
|
|
125
|
+
"resolved": "boolean | undefined",
|
|
126
|
+
"references": {}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": true,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": ""
|
|
133
|
+
},
|
|
134
|
+
"attribute": "is-active",
|
|
135
|
+
"reflect": false
|
|
136
|
+
},
|
|
137
|
+
"isCategoryActive": {
|
|
138
|
+
"type": "boolean",
|
|
139
|
+
"mutable": false,
|
|
140
|
+
"complexType": {
|
|
141
|
+
"original": "boolean",
|
|
142
|
+
"resolved": "boolean | undefined",
|
|
143
|
+
"references": {}
|
|
144
|
+
},
|
|
145
|
+
"required": false,
|
|
146
|
+
"optional": true,
|
|
147
|
+
"docs": {
|
|
148
|
+
"tags": [],
|
|
149
|
+
"text": ""
|
|
150
|
+
},
|
|
151
|
+
"attribute": "is-category-active",
|
|
152
|
+
"reflect": false
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=my-colorbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"my-colorbox.js","sourceRoot":"","sources":["../../../src/components/my-colorbox/my-colorbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAM9C,MAAM,OAAO,UAAU;;IAUrB,eAAU,GAAG,GAAG,EAAE;MAChB,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,GAAG,EAAE;QAClC,YAAY,CAAC;UACX,KAAK,EAAE,YAAY;UACnB,IAAI,EAAE,IAAI,CAAC,IAAI;UACf,OAAO,EAAE,IAAI,CAAC,OAAO;UACrB,KAAK,EAAE,IAAI,CAAC,IAAI;SACjB,CAAC,CAAC;MACL,CAAC,EAAE,IAAI,CAAC,CAAC;IACX,CAAC,CAAC;IAEF,iBAAY,GAAG,GAAG,EAAE;MAClB,IAAI,IAAI,CAAC,YAAY;QAAE,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;MACvD,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAChC,CAAC,CAAC;IAEF,gBAAW,GAAG,CAAC,KAAa,EAAE,EAAE;MAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;MACnD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;MACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;MACpD,OAAO,OAAO,GAAG,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC;IACxC,CAAC,CAAC;;;;;;;;EAEF,MAAM;IACJ,OAAO,CACL,WACE,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EACrC,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EACvC,KAAK,EAAE,gBAAgB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,EACvG,KAAK,EAAE;QACL,UAAU,EAAE,IAAI,CAAC,KAAK;QACtB,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;OACjF;MAED,WAAK,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,IAAI,CAAO,CACrC,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\n\n@Component({\n tag: 'my-colorbox',\n styleUrl: 'my-colorbox.scss',\n})\nexport class MyColorBox {\n private checkTimeout: ReturnType<typeof setTimeout> | undefined;\n\n @Prop() color: string;\n @Prop() name: string;\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() isActive?: boolean;\n @Prop() isCategoryActive?: boolean;\n\n colorCheck = () => {\n this.checkTimeout = setTimeout(() => {\n setDataLayer({\n event: 'ColorCheck',\n shop: this.shop,\n product: this.product,\n color: this.name,\n });\n }, 2000);\n };\n\n colorUnCheck = () => {\n if (this.checkTimeout) clearTimeout(this.checkTimeout);\n this.checkTimeout = undefined;\n };\n\n darkenColor = (color: string) => {\n const red = parseInt(color[1] + color[2], 16) - 20;\n const green = parseInt(color[3] + color[4], 16) - 20;\n const blue = parseInt(color[5] + color[6], 16) - 20;\n return `rgb(${red},${green},${blue})`;\n };\n\n render() {\n return (\n <div\n onMouseEnter={() => this.colorCheck()}\n onMouseLeave={() => this.colorUnCheck()}\n class={`my-color-box ${this.isActive ? 'active' : ''} ${this.isCategoryActive ? 'categoryactive' : ''}`}\n style={{\n background: this.color,\n border: this.isCategoryActive ? `5px solid ${this.darkenColor(this.color)}` : '',\n }}\n >\n <div class=\"color-name\">{this.name}</div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { h, getAssetPath } from '@stencil/core';
|
|
2
|
+
import { setDataLayer } from '../../gtmUtils';
|
|
3
|
+
export class MyColorInfo {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.goToProduct = () => {
|
|
6
|
+
var _a;
|
|
7
|
+
this.currentColor &&
|
|
8
|
+
setDataLayer({
|
|
9
|
+
event: 'GoToProduct',
|
|
10
|
+
shop: this.shop,
|
|
11
|
+
product: this.product,
|
|
12
|
+
color: (_a = this.currentColor) === null || _a === void 0 ? void 0 : _a.name,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
this.onCloseButtonClick = () => {
|
|
16
|
+
this.closeInfoBox.emit();
|
|
17
|
+
};
|
|
18
|
+
this.currentColor = undefined;
|
|
19
|
+
this.shop = undefined;
|
|
20
|
+
this.product = undefined;
|
|
21
|
+
this.data = null;
|
|
22
|
+
this.isMobile = false;
|
|
23
|
+
this.infoBoxWidth = undefined;
|
|
24
|
+
this.closeImage = 'close.png';
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
28
|
+
return (h("div", { class: `boxes__box-content ${this.currentColor.textWhite ? 'boxes__box-content__white' : ''}`, style: {
|
|
29
|
+
background: this.currentColor.hex,
|
|
30
|
+
maxWidth: `${this.infoBoxWidth && this.infoBoxWidth - 4}px`,
|
|
31
|
+
} }, this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), h("div", { class: "boxes__box-content__info", style: {
|
|
32
|
+
maxWidth: this.isMobile ? `${this.infoBoxWidth && this.infoBoxWidth - 35}px` : ``,
|
|
33
|
+
} }, !this.isMobile && h("img", { class: 'closebtn', onClick: this.onCloseButtonClick, src: getAssetPath(`./assets/${this.closeImage}`), alt: "closebtn" }), !this.isMobile && h("h2", null, this.currentColor.name), !this.isMobile && h("h4", null, this.currentColor.number), !this.isMobile && h("div", { class: "divider" }), h("div", { class: "boxes__box-content__info__value" }, 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" })), h("div", { class: "boxes__box-content__info__value-product" }, h("div", null, !this.isMobile && h("p", null, "Produkt:"), this.isMobile && h("h2", null, this.currentColor.name), " ", h("p", null, this.product)), this.isMobile && h("div", { class: 'divider' }), 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"))))), h("div", { class: "boxes__box-content__slider" }, 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 }), ' ')));
|
|
34
|
+
}
|
|
35
|
+
static get is() { return "my-colorinfo"; }
|
|
36
|
+
static get properties() {
|
|
37
|
+
return {
|
|
38
|
+
"currentColor": {
|
|
39
|
+
"type": "unknown",
|
|
40
|
+
"mutable": false,
|
|
41
|
+
"complexType": {
|
|
42
|
+
"original": "Color",
|
|
43
|
+
"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; }",
|
|
44
|
+
"references": {
|
|
45
|
+
"Color": {
|
|
46
|
+
"location": "import",
|
|
47
|
+
"path": "../../types"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": false,
|
|
52
|
+
"optional": false,
|
|
53
|
+
"docs": {
|
|
54
|
+
"tags": [],
|
|
55
|
+
"text": ""
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"shop": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"mutable": false,
|
|
61
|
+
"complexType": {
|
|
62
|
+
"original": "string",
|
|
63
|
+
"resolved": "string",
|
|
64
|
+
"references": {}
|
|
65
|
+
},
|
|
66
|
+
"required": false,
|
|
67
|
+
"optional": false,
|
|
68
|
+
"docs": {
|
|
69
|
+
"tags": [],
|
|
70
|
+
"text": ""
|
|
71
|
+
},
|
|
72
|
+
"attribute": "shop",
|
|
73
|
+
"reflect": false
|
|
74
|
+
},
|
|
75
|
+
"product": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"mutable": false,
|
|
78
|
+
"complexType": {
|
|
79
|
+
"original": "string",
|
|
80
|
+
"resolved": "string",
|
|
81
|
+
"references": {}
|
|
82
|
+
},
|
|
83
|
+
"required": false,
|
|
84
|
+
"optional": false,
|
|
85
|
+
"docs": {
|
|
86
|
+
"tags": [],
|
|
87
|
+
"text": ""
|
|
88
|
+
},
|
|
89
|
+
"attribute": "product",
|
|
90
|
+
"reflect": false
|
|
91
|
+
},
|
|
92
|
+
"data": {
|
|
93
|
+
"type": "unknown",
|
|
94
|
+
"mutable": false,
|
|
95
|
+
"complexType": {
|
|
96
|
+
"original": "Product | null",
|
|
97
|
+
"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; }",
|
|
98
|
+
"references": {
|
|
99
|
+
"Product": {
|
|
100
|
+
"location": "import",
|
|
101
|
+
"path": "../../types"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": ""
|
|
110
|
+
},
|
|
111
|
+
"defaultValue": "null"
|
|
112
|
+
},
|
|
113
|
+
"isMobile": {
|
|
114
|
+
"type": "boolean",
|
|
115
|
+
"mutable": false,
|
|
116
|
+
"complexType": {
|
|
117
|
+
"original": "boolean",
|
|
118
|
+
"resolved": "boolean",
|
|
119
|
+
"references": {}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": ""
|
|
126
|
+
},
|
|
127
|
+
"attribute": "is-mobile",
|
|
128
|
+
"reflect": false,
|
|
129
|
+
"defaultValue": "false"
|
|
130
|
+
},
|
|
131
|
+
"infoBoxWidth": {
|
|
132
|
+
"type": "number",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "number | null",
|
|
136
|
+
"resolved": "null | number",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": ""
|
|
144
|
+
},
|
|
145
|
+
"attribute": "info-box-width",
|
|
146
|
+
"reflect": false
|
|
147
|
+
},
|
|
148
|
+
"closeImage": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"mutable": false,
|
|
151
|
+
"complexType": {
|
|
152
|
+
"original": "string",
|
|
153
|
+
"resolved": "string",
|
|
154
|
+
"references": {}
|
|
155
|
+
},
|
|
156
|
+
"required": false,
|
|
157
|
+
"optional": false,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": ""
|
|
161
|
+
},
|
|
162
|
+
"attribute": "close-image",
|
|
163
|
+
"reflect": false,
|
|
164
|
+
"defaultValue": "'close.png'"
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
static get events() {
|
|
169
|
+
return [{
|
|
170
|
+
"method": "closeInfoBox",
|
|
171
|
+
"name": "closeInfoBox",
|
|
172
|
+
"bubbles": true,
|
|
173
|
+
"cancelable": true,
|
|
174
|
+
"composed": true,
|
|
175
|
+
"docs": {
|
|
176
|
+
"tags": [],
|
|
177
|
+
"text": ""
|
|
178
|
+
},
|
|
179
|
+
"complexType": {
|
|
180
|
+
"original": "any",
|
|
181
|
+
"resolved": "any",
|
|
182
|
+
"references": {}
|
|
183
|
+
}
|
|
184
|
+
}];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=my-colorinfo.js.map
|
|
@@ -0,0 +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;AAK9C,MAAM,OAAO,WAAW;;IAWtB,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;IACP,CAAC,CAAC;IAEF,uBAAkB,GAAG,GAAG,EAAE;MACxB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC,CAAC;;;;gBAnB6B,IAAI;oBACP,KAAK;;sBAEZ,WAAW;;EAkBhC,MAAM;;IACJ,OAAO,CACL,WACE,KAAK,EAAE,sBAAsB,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,EAAE,EAC7F,KAAK,EAAE;QACL,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG;QACjC,QAAQ,EAAE,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI;OAC5D;MAEA,IAAI,CAAC,QAAQ,IAAI,WAAK,KAAK,EAAE,UAAU,EAAE,O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, getAssetPath, Event, EventEmitter } from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\nimport { Color, Link, Product } from '../../types';\n@Component({\n tag: 'my-colorinfo',\n})\nexport class MyColorInfo {\n @Prop() currentColor: Color;\n @Prop() shop: string;\n @Prop() product: 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 };\n\n onCloseButtonClick = () => {\n this.closeInfoBox.emit();\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.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.currentColor.name}</h2>}\n {!this.isMobile && <h4>{this.currentColor.number}</h4>}\n {!this.isMobile && <div class=\"divider\"></div>}\n <div class=\"boxes__box-content__info__value\">\n <div class=\"boxes__box-content__info__value-image\">\n {this.currentColor?.image.data! && <img src={`${this.currentColor?.image?.data?.attributes?.formats.thumbnail.url}`} 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?.data?.attributes?.name === this.shop) && (\n <a\n onClick={this.goToProduct}\n class={`${this.currentColor.buttonInverse ? 'inverse' : ''}`}\n target=\"_blank\"\n href={this?.currentColor.links.find((link: Link) => link?.shop?.data?.attributes?.name === this.shop)?.path}\n >\n przejdź do produktu\n </a>\n )}\n </div>\n </div>\n </div>\n <div class=\"boxes__box-content__slider\">\n <my-slider color={this.currentColor.name} shop={this.shop} product={this.product} slides={this.data?.images.data}></my-slider>{' '}\n </div>\n </div>\n );\n }\n}\n"]}
|