@ppg_pl/pallete 2.0.18 → 2.0.19
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 +2 -2
- 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-a3b655d5.entry.js +2 -0
- package/dist/pallete/p-a3b655d5.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-a3b655d5.entry.js +2 -0
- package/www/build/p-a3b655d5.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, getAssetPath } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const mySearchCss = ".pallete-wrapper.sc-my-search *.sc-my-search{font-family:\"Galatea\", sans-serif}.search.sc-my-search{position:relative;width:400px}@media (max-width: 768px){.search.sc-my-search{width:100%}}.search.sc-my-search input.sc-my-search{
|
|
3
|
+
const mySearchCss = ".pallete-wrapper.sc-my-search *.sc-my-search{font-family:\"Galatea\", sans-serif}.search.sc-my-search{position:relative;width:400px}@media (max-width: 768px){.search.sc-my-search{width:100%}}.search.sc-my-search input.sc-my-search{font-size:16px;padding:19px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%;color:#4c4c4c}.search.sc-my-search button.sc-my-search{position:absolute;border:none;background-color:transparent;right:-20px;top:0;width:50px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}";
|
|
4
4
|
|
|
5
5
|
function debounce(func, wait) {
|
|
6
6
|
let timeout;
|
|
@@ -41,7 +41,7 @@ const MySearch = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
41
41
|
this.searchText = null;
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h("div", { class: 'search' }, h("input", { placeholder: this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie
|
|
44
|
+
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: () => {
|
|
45
45
|
this.searchText && this.fetchColorsByName(this.searchText);
|
|
46
46
|
this.searchText = '';
|
|
47
47
|
} }, h("img", { src: getAssetPath(`./assets/${this.searchIcon}`), alt: "arrow_down" }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"my-search2.js","mappings":";;AAAA,MAAM,WAAW,GAAG,
|
|
1
|
+
{"file":"my-search2.js","mappings":";;AAAA,MAAM,WAAW,GAAG,sjBAAsjB;;ACE1kB,SAAS,QAAQ,CAAC,IAAc,EAAE,IAAY;EAC5C,IAAI,OAAsC,CAAC;EAC3C,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAW;IAC7C,MAAM,KAAK,GAAG;MACZ,YAAY,CAAC,OAAO,CAAC,CAAC;MACtB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;KACf,CAAC;IACF,YAAY,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;GACnC,CAAC;AACJ,CAAC;MAQY,QAAQ;;;;;IAOnB,sBAAiB,GAAG,CAAC,IAAY;MAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC9B,CAAC;IAEM,8BAAyB,GAAG,QAAQ,CAAC,CAAC,KAAa;MACzD,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;MAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;KACzB,EAAE,GAAG,CAAC,CAAC;;;sBAXa,YAAY;sBACI,IAAI;;EAYjC,kBAAkB,CAAC,KAAY;IACrC,MAAM,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAC;IACvD,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC;GACvC;EAGD,uBAAuB,CAAC,QAAgB;IACtC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;GAClC;EAGD,sBAAsB;IACpB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;GACxB;EAED,MAAM;IACJ,QACE,WAAK,KAAK,EAAE,QAAQ,IAClB,aAAO,WAAW,EAAE,IAAI,CAAC,QAAQ,GAAG,gBAAgB,GAAG,0BAA0B,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAI,EAE5K,cACE,OAAO,EAAE;QACP,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE3D,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;OACtB,IAED,WAAK,GAAG,EAAE,YAAY,CAAC,YAAY,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,GAAG,EAAC,YAAY,GAAG,CACnE,CACL,EACN;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["./src/components/my-search/my-search.scss?tag=my-search&encapsulation=scoped","./src/components/my-search/my-search.tsx"],"sourcesContent":["@import '../../global/app.scss';\n\n.search {\n position: relative;\n width: 400px;\n @media (max-width: $small) {\n width: 100%;\n }\n input {\n font-size: 16px;\n padding: 19px;\n border-radius: 27.35px;\n border: 1px solid #dfdfdf;\n width: 100%;\n color: #4c4c4c;\n }\n\n button {\n position: absolute;\n border: none;\n background-color: transparent;\n right: -20px;\n top: 0;\n width: 50px;\n height: calc(100%);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n }\n}\n","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"],"version":3}
|
package/dist/esm/loader.js
CHANGED
|
@@ -11,7 +11,7 @@ const patchEsm = () => {
|
|
|
11
11
|
const defineCustomElements = (win, options) => {
|
|
12
12
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
13
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["my-backdrop_8",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"show":[32],"readyToClose":[32],"open":[64],"close":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"closeImage":[1,"close-image"],"arrowDown":[1,"arrow-down"],"chunksNum":[32],"data":[32],"preloader":[32],"loading":[32],"colors":[32],"currentColor":[32],"currentIndex":[32],"infoBoxWidth":[32],"boxWidth":[32],"padding":[32],"isMobile":[32],"showRange":[32],"colorCategories":[32],"selectedCategory":[32],"page":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[0,"my-colorinfo",{"currentColor":[16],"shop":[1],"product":[1],"baselink":[1],"data":[16],"isMobile":[4,"is-mobile"],"infoBoxWidth":[2,"info-box-width"],"closeImage":[1,"close-image"]}],[0,"my-colorbox",{"color":[1],"name":[1],"shop":[1],"product":[1],"isActive":[4,"is-active"],"isCategoryActive":[4,"is-category-active"],"isImageInsteadHex":[16]}],[2,"my-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
|
|
14
|
+
return bootstrapLazy([["my-backdrop_8",[[2,"my-component",{"shop":[1],"product":[1],"baselink":[1],"colorname":[1],"show":[32],"readyToClose":[32],"open":[64],"close":[64]},[[0,"readyToCLose","setReadyToCloseHandler"],[0,"close","closeModalHandler"]]],[0,"my-modal",{"shop":[1],"product":[1],"baselink":[1],"selectedcolor":[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],"colorIsSelected":[32],"open":[64]},[[0,"closeInfoBox","closeInfoBoxHandler"],[9,"resize","handleResize"],[0,"searchColors","searchColorsHandler"]]],[0,"my-backdrop"],[0,"my-colorinfo",{"currentColor":[16],"shop":[1],"product":[1],"baselink":[1],"data":[16],"isMobile":[4,"is-mobile"],"infoBoxWidth":[2,"info-box-width"],"closeImage":[1,"close-image"]}],[0,"my-colorbox",{"color":[1],"name":[1],"shop":[1],"product":[1],"isActive":[4,"is-active"],"isCategoryActive":[4,"is-category-active"],"isImageInsteadHex":[16]}],[2,"my-loader"],[2,"my-search",{"productId":[2,"product-id"],"isMobile":[4,"is-mobile"],"searchIcon":[1,"search-icon"],"searchText":[32]},[[4,"clearSearchText","clearSearchTextHandler"]]],[0,"my-slider",{"slides":[16],"shop":[1],"product":[1],"color":[1]}]]]], options);
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -17,8 +17,8 @@ const setDataLayer = (obj) => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
// DEV/
|
|
20
|
-
// export const APIURL = 'http://
|
|
21
|
-
// export const accessToken = '
|
|
20
|
+
// export const APIURL = 'http://localhost:8055';
|
|
21
|
+
// export const accessToken = 'iGAWx696CkipbZDOESC8CBn3BF7xPaei';
|
|
22
22
|
// PROD
|
|
23
23
|
const APIURL = 'https://color-selector.pl'; //'https://pallete-colors-backend.herokuapp.com';
|
|
24
24
|
const accessToken = '8uZQSXi0wCxiY0UR8wp_Pe2gY86wVErp'; //'_baZ127gfvFIFmZ5umrrTBUUm6D7ve6p'
|
|
@@ -272,6 +272,7 @@ const MyModalBundle = class {
|
|
|
272
272
|
this.shop = undefined;
|
|
273
273
|
this.product = undefined;
|
|
274
274
|
this.baselink = undefined;
|
|
275
|
+
this.colorname = undefined;
|
|
275
276
|
this.show = false;
|
|
276
277
|
this.readyToClose = false;
|
|
277
278
|
}
|
|
@@ -291,7 +292,7 @@ const MyModalBundle = class {
|
|
|
291
292
|
render() {
|
|
292
293
|
let content = null;
|
|
293
294
|
if (this.show) {
|
|
294
|
-
content = [h("my-backdrop", null), h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink })];
|
|
295
|
+
content = [h("my-backdrop", null), h("my-modal", { shop: this.shop, product: this.product, baselink: this.baselink, selectedcolor: this.colorname })];
|
|
295
296
|
}
|
|
296
297
|
return (h("div", { onClick: () => {
|
|
297
298
|
if (this.readyToClose) {
|
|
@@ -2663,24 +2664,37 @@ const fetchCategoryColorsQuery = (id, page) => lib.stringify({
|
|
|
2663
2664
|
}, {
|
|
2664
2665
|
encodeValuesOnly: true,
|
|
2665
2666
|
});
|
|
2666
|
-
const
|
|
2667
|
-
fields: ['*'
|
|
2667
|
+
const fetchColorByName = (id, colorName) => lib.stringify({
|
|
2668
|
+
fields: ['*'].join(','),
|
|
2668
2669
|
filter: {
|
|
2669
|
-
|
|
2670
|
-
|
|
2670
|
+
products: {
|
|
2671
|
+
Product_id: {
|
|
2671
2672
|
_eq: id,
|
|
2672
2673
|
},
|
|
2673
2674
|
},
|
|
2674
|
-
|
|
2675
|
-
|
|
2675
|
+
name: {
|
|
2676
|
+
_icontains: colorName,
|
|
2676
2677
|
},
|
|
2677
2678
|
},
|
|
2678
2679
|
meta: '*',
|
|
2680
|
+
limit: 100,
|
|
2679
2681
|
}, {
|
|
2680
2682
|
encodeValuesOnly: true,
|
|
2681
2683
|
});
|
|
2682
2684
|
|
|
2683
|
-
|
|
2685
|
+
function debounce$1(func, wait) {
|
|
2686
|
+
let timeout;
|
|
2687
|
+
return function executedFunction(...args) {
|
|
2688
|
+
const later = () => {
|
|
2689
|
+
clearTimeout(timeout);
|
|
2690
|
+
func(...args);
|
|
2691
|
+
};
|
|
2692
|
+
clearTimeout(timeout);
|
|
2693
|
+
timeout = setTimeout(later, wait);
|
|
2694
|
+
};
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
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}";
|
|
2684
2698
|
|
|
2685
2699
|
const MyModal = class {
|
|
2686
2700
|
constructor(hostRef) {
|
|
@@ -2803,6 +2817,48 @@ const MyModal = class {
|
|
|
2803
2817
|
this.loading = false;
|
|
2804
2818
|
}
|
|
2805
2819
|
};
|
|
2820
|
+
this.handleCategoryClick = (color) => {
|
|
2821
|
+
if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
|
|
2822
|
+
this.data && this.fetchProductColors(String(this.data.id));
|
|
2823
|
+
this.selectedCategory = null;
|
|
2824
|
+
}
|
|
2825
|
+
else {
|
|
2826
|
+
color && this.fetchCategoryColors(color);
|
|
2827
|
+
this.selectedCategory = color;
|
|
2828
|
+
}
|
|
2829
|
+
this.currentColor = null;
|
|
2830
|
+
this.clearSearchText.emit();
|
|
2831
|
+
};
|
|
2832
|
+
// async searchColorsHandler(event: CustomEvent) {
|
|
2833
|
+
// this.loading = true;
|
|
2834
|
+
// this.currentColor = null;
|
|
2835
|
+
// // if search is empty set to first category to not showing whole product colors
|
|
2836
|
+
// if (event.detail === '') {
|
|
2837
|
+
// this.handleCategoryClick(this.selectedCategory);
|
|
2838
|
+
// this.loading = true;
|
|
2839
|
+
// }
|
|
2840
|
+
// try {
|
|
2841
|
+
// if (this.data && this.data.id && event.detail !== '') {
|
|
2842
|
+
// const response = await ApiService.getData(`items/Color?${fetchColorByNumber(Number(this.selectedCategory), event.detail)}`);
|
|
2843
|
+
// if (response) {
|
|
2844
|
+
// this.colors = {
|
|
2845
|
+
// list:
|
|
2846
|
+
// (response &&
|
|
2847
|
+
// response.data &&
|
|
2848
|
+
// response.data.map((item: Color) => ({
|
|
2849
|
+
// ...item,
|
|
2850
|
+
// }))) ||
|
|
2851
|
+
// [],
|
|
2852
|
+
// pagination: response.meta,
|
|
2853
|
+
// };
|
|
2854
|
+
// }
|
|
2855
|
+
// }
|
|
2856
|
+
// } catch (error) {
|
|
2857
|
+
// console.error(error);
|
|
2858
|
+
// } finally {
|
|
2859
|
+
// this.loading = false;
|
|
2860
|
+
// }
|
|
2861
|
+
// }
|
|
2806
2862
|
this.onPage = (page) => {
|
|
2807
2863
|
if (this.data) {
|
|
2808
2864
|
if (this.selectedCategory) {
|
|
@@ -2816,21 +2872,10 @@ const MyModal = class {
|
|
|
2816
2872
|
this.currentColor = null;
|
|
2817
2873
|
this.currentIndex = null;
|
|
2818
2874
|
};
|
|
2819
|
-
this.handleCategoryClick = (color) => {
|
|
2820
|
-
if (this.selectedCategory && color && this.selectedCategory === color && !this.showRange) {
|
|
2821
|
-
this.data && this.fetchProductColors(String(this.data.id));
|
|
2822
|
-
this.selectedCategory = null;
|
|
2823
|
-
}
|
|
2824
|
-
else {
|
|
2825
|
-
color && this.fetchCategoryColors(color);
|
|
2826
|
-
this.selectedCategory = color;
|
|
2827
|
-
}
|
|
2828
|
-
this.currentColor = null;
|
|
2829
|
-
this.clearSearchText.emit();
|
|
2830
|
-
};
|
|
2831
2875
|
this.shop = undefined;
|
|
2832
2876
|
this.product = undefined;
|
|
2833
2877
|
this.baselink = undefined;
|
|
2878
|
+
this.selectedcolor = undefined;
|
|
2834
2879
|
this.closeImage = 'close.png';
|
|
2835
2880
|
this.arrowDown = 'arrow_down.png';
|
|
2836
2881
|
this.chunksNum = 12;
|
|
@@ -2848,6 +2893,8 @@ const MyModal = class {
|
|
|
2848
2893
|
this.colorCategories = null;
|
|
2849
2894
|
this.selectedCategory = null;
|
|
2850
2895
|
this.page = 1;
|
|
2896
|
+
this.colorIsSelected = false;
|
|
2897
|
+
this.debouncedSearchColorsHandler = debounce$1(this.searchColor.bind(this), 300);
|
|
2851
2898
|
}
|
|
2852
2899
|
setInfoBoxWidth(newValue) {
|
|
2853
2900
|
this.infoBoxWidth = newValue * this.boxWidth;
|
|
@@ -2878,33 +2925,54 @@ const MyModal = class {
|
|
|
2878
2925
|
this.calculateBoxCount();
|
|
2879
2926
|
this.displayForMobile();
|
|
2880
2927
|
}
|
|
2881
|
-
async
|
|
2882
|
-
|
|
2883
|
-
this.currentColor = null;
|
|
2884
|
-
// if search is empty set to first category to not showing whole product colors
|
|
2928
|
+
async searchColor(event) {
|
|
2929
|
+
var _a, _b;
|
|
2885
2930
|
if (event.detail === '') {
|
|
2886
|
-
this.
|
|
2931
|
+
this.fetchProductData();
|
|
2887
2932
|
this.loading = true;
|
|
2888
2933
|
}
|
|
2889
|
-
|
|
2890
|
-
if (
|
|
2891
|
-
|
|
2934
|
+
else {
|
|
2935
|
+
if (!((_a = this.data) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
try {
|
|
2939
|
+
const response = await ApiService.getData(`items/Color?${fetchColorByName((_b = this.data) === null || _b === void 0 ? void 0 : _b.id, event.detail)}`);
|
|
2892
2940
|
if (response) {
|
|
2893
2941
|
this.colors = {
|
|
2894
|
-
list:
|
|
2942
|
+
list: response &&
|
|
2895
2943
|
response.data &&
|
|
2896
|
-
response.data.map((item) => (Object.assign({}, item)))
|
|
2897
|
-
[],
|
|
2944
|
+
response.data.map((item) => (Object.assign({}, item))),
|
|
2898
2945
|
pagination: response.meta,
|
|
2899
2946
|
};
|
|
2900
2947
|
}
|
|
2901
2948
|
}
|
|
2949
|
+
catch (error) {
|
|
2950
|
+
console.error(error);
|
|
2951
|
+
}
|
|
2952
|
+
finally {
|
|
2953
|
+
this.loading = false;
|
|
2954
|
+
}
|
|
2902
2955
|
}
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2956
|
+
}
|
|
2957
|
+
searchColorsHandler(event) {
|
|
2958
|
+
this.loading = true;
|
|
2959
|
+
this.currentColor = null;
|
|
2960
|
+
this.debouncedSearchColorsHandler(event);
|
|
2961
|
+
}
|
|
2962
|
+
openSeletedColor() {
|
|
2963
|
+
var _a, _b, _c;
|
|
2964
|
+
if (!((_a = this.colors) === null || _a === void 0 ? void 0 : _a.list) || !this.selectedcolor)
|
|
2965
|
+
return;
|
|
2966
|
+
if (!this.colorIsSelected) {
|
|
2967
|
+
const result = this.chunks(this.colors.list)
|
|
2968
|
+
.map((innerArray, arrayIndex) => {
|
|
2969
|
+
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()); });
|
|
2970
|
+
return foundColor ? { color: foundColor, index: arrayIndex } : null;
|
|
2971
|
+
})
|
|
2972
|
+
.filter(item => item !== null);
|
|
2973
|
+
this.currentColor = (_b = result[0]) === null || _b === void 0 ? void 0 : _b.color;
|
|
2974
|
+
this.currentIndex = (_c = result[0]) === null || _c === void 0 ? void 0 : _c.index;
|
|
2975
|
+
this.colorIsSelected = true;
|
|
2908
2976
|
}
|
|
2909
2977
|
}
|
|
2910
2978
|
componentWillLoad() {
|
|
@@ -2915,13 +2983,11 @@ const MyModal = class {
|
|
|
2915
2983
|
this.displayForMobile();
|
|
2916
2984
|
this.calculateBoxCount();
|
|
2917
2985
|
this.colorTimer();
|
|
2986
|
+
this.openSeletedColor();
|
|
2918
2987
|
}
|
|
2919
2988
|
render() {
|
|
2920
|
-
var _a, _b, _c
|
|
2921
|
-
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("
|
|
2922
|
-
isImageInsteadHex: (c === null || c === void 0 ? void 0 : c.imageInsteadHex) || false,
|
|
2923
|
-
bigImage: (c === null || c === void 0 ? void 0 : c.bigImage) || '',
|
|
2924
|
-
} })))), 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) => {
|
|
2989
|
+
var _a, _b, _c;
|
|
2990
|
+
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) => {
|
|
2925
2991
|
var _a;
|
|
2926
2992
|
return (h("div", { key: index, class: "boxes" }, h("div", { class: "boxes__list" }, color.map((c) => {
|
|
2927
2993
|
var _a;
|
|
@@ -2957,7 +3023,7 @@ const MyModal = class {
|
|
|
2957
3023
|
};
|
|
2958
3024
|
MyModal.style = myModalCss;
|
|
2959
3025
|
|
|
2960
|
-
const mySearchCss = ".pallete-wrapper.sc-my-search *.sc-my-search{font-family:\"Galatea\", sans-serif}.search.sc-my-search{position:relative;width:400px}@media (max-width: 768px){.search.sc-my-search{width:100%}}.search.sc-my-search input.sc-my-search{
|
|
3026
|
+
const mySearchCss = ".pallete-wrapper.sc-my-search *.sc-my-search{font-family:\"Galatea\", sans-serif}.search.sc-my-search{position:relative;width:400px}@media (max-width: 768px){.search.sc-my-search{width:100%}}.search.sc-my-search input.sc-my-search{font-size:16px;padding:19px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%;color:#4c4c4c}.search.sc-my-search button.sc-my-search{position:absolute;border:none;background-color:transparent;right:-20px;top:0;width:50px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer}";
|
|
2961
3027
|
|
|
2962
3028
|
function debounce(func, wait) {
|
|
2963
3029
|
let timeout;
|
|
@@ -2997,7 +3063,7 @@ const MySearch = class {
|
|
|
2997
3063
|
this.searchText = null;
|
|
2998
3064
|
}
|
|
2999
3065
|
render() {
|
|
3000
|
-
return (h("div", { class: 'search' }, h("input", { placeholder: this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie
|
|
3066
|
+
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: () => {
|
|
3001
3067
|
this.searchText && this.fetchColorsByName(this.searchText);
|
|
3002
3068
|
this.searchText = '';
|
|
3003
3069
|
} }, h("img", { src: getAssetPath(`./assets/${this.searchIcon}`), alt: "arrow_down" }))));
|