@everymatrix/casino-filter 1.7.2 → 1.7.3
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/casino-filter.js
CHANGED
|
@@ -655,5 +655,5 @@ T[d]&&(T={[d]:[]});const P=()=>{r(4,g=!g)},C=e=>{let t=localStorage.getItem("ven
|
|
|
655
655
|
// update filters value
|
|
656
656
|
r(7,A=_.length===E.length||0==_.length),r(8,B=_.length)},O=()=>{const e=new URL(`${a}/casino/vendors`);e.searchParams.append("fields","id,name,logo,subVendors"),e.searchParams.append("language",u),e.searchParams.append("datasource",l),e.searchParams.append("platform",(e=>e.toLowerCase().match(/android/i)?"Android":e.toLowerCase().match(/iphone/i)?"iPhone":e.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC")(v)),(d.match(/\$/g)||[]).length>1?(e.searchParams.append("filter",`games(subGroups=${d})`),e.searchParams.append("subVendors",`games(subGroups=${d})`)):e.searchParams.append("filter",`games(groups=${d})`),(e=>{r(9,S=!0),new Promise(((t,n)=>{fetch(e).then((e=>e.json())).then((e=>{e=e.items,t(e.items),r(6,_=[]);let n=JSON.parse(localStorage.getItem("vendorFiltersByCategory"));e.forEach((e=>{var t;n||(n={currentCategoryId:[]}),(null===(t=n[d])||void 0===t?void 0:t.indexOf(e.id))>=0?(e.isFilterSelected=!0,_.push(e)):e.isFilterSelected=!1})),r(5,E=e),
|
|
657
657
|
// needed to force the update of the filters value
|
|
658
|
-
L()})).catch((e=>{console.error(e),r(10,H=!0),n(e)})).finally((()=>{r(9,S=!1)}))}))})(e)},I=()=>{r(9,S=!0),r(6,_=[]),localStorage.setItem("vendorFiltersByCategory",JSON.stringify(T={[d]:_.map((e=>e.id))})),E.forEach((e=>e.isFilterSelected=!1)),setTimeout((()=>{r(9,S=!1)}),50),window.postMessage({type:"ApplyFilters"},window.location.href),r(7,A=!0),r(4,g=!1)};return e.$$set=e=>{"endpoint"in e&&r(15,a=e.endpoint),"datasource"in e&&r(16,l=e.datasource),"lang"in e&&r(17,u=e.lang),"translationurl"in e&&r(18,h=e.translationurl),"clientstyling"in e&&r(19,f=e.clientstyling),"clientstylingurl"in e&&r(20,p=e.clientstylingurl),"categoryid"in e&&r(21,d=e.categoryid),"addfilterselector"in e&&r(0,m=e.addfilterselector),"addsortingselector"in e&&r(1,y=e.addsortingselector),"filterbylogo"in e&&r(2,b=e.filterbylogo)},e.$$.update=()=>{/*endpoint, datasource, categoryid, filterbylogo*/2195460&e.$$.dirty[0]&&a&&l&&d&&b&&O(),/*clientstyling, customStylingContainer*/524296&e.$$.dirty[0]&&f&&s&&(()=>{let e=document.createElement("style");e.innerHTML=f,s.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/1048584&e.$$.dirty[0]&&p&&s&&(()=>{let e=document.createElement("style");fetch(new URL(p)).then((e=>e.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{s.appendChild(e)}),1)}))})(),/*translationurl*/262144&e.$$.dirty[0]&&h&&fetch(h).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{fn(t,e[t])}))})).catch((e=>{console.log(e)}))},[m,y,b,s,g,E,_,A,B,S,H,n,P,C,I,a,l,u,h,f,p,d,()=>P(),function(e,t){e[t].isFilterSelected=this.checked,r(5,E)},e=>C(e),()=>I(),function(e){w[e?"unshift":"push"]((()=>{s=e,r(3,s)}))}]}class An extends R{constructor(e){super(),this.shadowRoot.innerHTML='<style>.FilterContainer{color:#fff;position:relative;z-index:16}.FilterSelector{background-color:#58586B;display:flex;position:relative;padding:10px 16px;border-radius:5px;justify-content:space-between;align-items:center;max-width:fit-content;cursor:pointer}.FilterSelector.FilterSelectorOpen{border-radius:5px 5px 0 0}.FilterMainArea{display:flex;align-items:center}.FilterMainArea svg{margin-right:16px}.FilterName{font-size:11px;line-height:12px;color:#D1D1D1;text-transform:uppercase}.FilterTextContainer{display:flex;flex-direction:column}.FilterValueContainer{font-size:14px;line-height:16px;font-weight:300}.TriangleInactive{display:block;color:currentColor;margin:0 0 0 15px;transition:all
|
|
658
|
+
L()})).catch((e=>{console.error(e),r(10,H=!0),n(e)})).finally((()=>{r(9,S=!1)}))}))})(e)},I=()=>{r(9,S=!0),r(6,_=[]),localStorage.setItem("vendorFiltersByCategory",JSON.stringify(T={[d]:_.map((e=>e.id))})),E.forEach((e=>e.isFilterSelected=!1)),setTimeout((()=>{r(9,S=!1)}),50),window.postMessage({type:"ApplyFilters"},window.location.href),r(7,A=!0),r(4,g=!1)};return e.$$set=e=>{"endpoint"in e&&r(15,a=e.endpoint),"datasource"in e&&r(16,l=e.datasource),"lang"in e&&r(17,u=e.lang),"translationurl"in e&&r(18,h=e.translationurl),"clientstyling"in e&&r(19,f=e.clientstyling),"clientstylingurl"in e&&r(20,p=e.clientstylingurl),"categoryid"in e&&r(21,d=e.categoryid),"addfilterselector"in e&&r(0,m=e.addfilterselector),"addsortingselector"in e&&r(1,y=e.addsortingselector),"filterbylogo"in e&&r(2,b=e.filterbylogo)},e.$$.update=()=>{/*endpoint, datasource, categoryid, filterbylogo*/2195460&e.$$.dirty[0]&&a&&l&&d&&b&&O(),/*clientstyling, customStylingContainer*/524296&e.$$.dirty[0]&&f&&s&&(()=>{let e=document.createElement("style");e.innerHTML=f,s.appendChild(e)})(),/*clientstylingurl, customStylingContainer*/1048584&e.$$.dirty[0]&&p&&s&&(()=>{let e=document.createElement("style");fetch(new URL(p)).then((e=>e.text())).then((t=>{e.innerHTML=t,setTimeout((()=>{s.appendChild(e)}),1)}))})(),/*translationurl*/262144&e.$$.dirty[0]&&h&&fetch(h).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{fn(t,e[t])}))})).catch((e=>{console.log(e)}))},[m,y,b,s,g,E,_,A,B,S,H,n,P,C,I,a,l,u,h,f,p,d,()=>P(),function(e,t){e[t].isFilterSelected=this.checked,r(5,E)},e=>C(e),()=>I(),function(e){w[e?"unshift":"push"]((()=>{s=e,r(3,s)}))}]}class An extends R{constructor(e){super(),this.shadowRoot.innerHTML='<style>.FilterContainer{color:#fff;position:relative;z-index:16}.FilterSelector{background-color:#58586B;display:flex;position:relative;padding:10px 16px;border-radius:5px;justify-content:space-between;align-items:center;max-width:fit-content;cursor:pointer}.FilterSelector.FilterSelectorOpen{border-radius:5px 5px 0 0}.FilterMainArea{display:flex;align-items:center}.FilterMainArea svg{margin-right:16px}.FilterName{font-size:11px;line-height:12px;color:#D1D1D1;text-transform:uppercase}.FilterTextContainer{display:flex;flex-direction:column}.FilterValueContainer{font-size:14px;line-height:16px;font-weight:300}.TriangleInactive{display:block;color:currentColor;margin:0 0 0 15px;transition:all .5s}.TriangleActive{transform:rotate(180deg);position:relative;top:2px}.FilterDropdownContainer{padding:0;background:#58586b;background:linear-gradient(180deg, rgba(88, 88, 107, 0.9) 0%, rgba(7, 7, 42, 0.9) 95%);display:flex;flex-direction:column;align-items:center;transition:max-height 0.15s ease-out;max-height:0;border-radius:0 0 5px 5px;position:absolute;top:48px;margin-bottom:40px;overflow:hidden;margin:0}.FilterDropdownContainer.FilterOpen{width:100%;max-height:fit-content;transition:max-height 0.25s ease-in;padding-top:20px}.FilterDropdown{width:100%;max-height:300px;display:grid;gap:10px;margin:0;padding-inline-start:0;overflow:scroll;list-style:none;-ms-overflow-style:none;scrollbar-width:none}.FilterDropdown::-webkit-scrollbar{display:none}.FilterItem{position:relative}.FilterItem label{font-size:14px;font-weight:300;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;-webkit-user-select:none;-ms-user-select:none;user-select:none}.FilterItem input{cursor:pointer;margin-right:10px}.FilterItem:hover input~.FiltersCheckmark{background-color:transparent;border:1px solid #D0046C}.FilterItem input:checked~.FiltersCheckmark{background-color:#D0046C;border:1px solid #D0046C}.FilterItem .FiltersCheckmark{transition:all 0.05s ease-in;margin:0 15px}.FilterItem .FiltersCheckmark:after{content:"";position:absolute;left:9px;display:none}.FilterItem input:checked~.FiltersCheckmark:after{display:block}.FilterItem .FiltersCheckmark:after{left:8px;top:4px;width:5px;height:10px;border:1px solid white;border-width:0 2px 2px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.FilerContainerSplit .FilterItemWithLogos .FiltersCheckmark{margin:0}.FilterLabel input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.FilterLabel .FiltersCheckmark{border-radius:8px;position:relative;height:22px;width:22px;min-width:22px;background-color:transparent;border:1px solid #fff}.FilterItemWithLogos label{height:70px;display:flex;justify-content:space-evenly;align-items:center}.FilterItemWithLogos label img{width:70px}.FilterLabel input:checked+span{font-weight:600}.FilterCounter{display:inline-flex;margin-left:10px;min-width:17px}.ClearFilters{margin:20px auto;border:0;color:#fff;background-color:var(--emfe-w-color-primary, #D0046C);border:1px solid var(--emfe-w-color-primary, #D0046C);font-size:18px;padding:10px 50px;border-radius:5px;cursor:pointer;transition:all 0.1s ease-in;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ClearFilters:disabled{background:var(--emfe-w-color-gray-100, #E6E6E6);border:1px solid var(--emfe-w-color-gray-150, #828282);pointer-events:none;cursor:not-allowed}@media only screen and (max-width: 768px){.FilterSelector{max-width:initial}.FilterDropdownContainer{width:100%;margin-bottom:20px}.FilterDropdown{display:grid;grid-template-columns:minmax(150px, 150px) minmax(150px, 150px);gap:30px;margin-block-start:0}.FilterItemWithLogos label{justify-content:center}.FilerContainerSplit .FilterSelector{padding:7px}.FilerContainerSplit .FilterSelector .FilterCounter{margin-left:0}.FilerContainerSplit .FilterMainArea svg{margin:0 10px}.FilerContainerSplit .FilterDropdown{grid-template-columns:1fr}.FilerContainerSplit .FilterDropdownContainer{top:42px}.FilerContainerSplit .ClearFilters{padding:10px 25px}.FilterLabel .FiltersCheckmark{margin-right:15px}.FilterItem.FilterItemWithLogos{display:flex;align-items:center;justify-content:center}.FilerContainerSplit .FilterItemWithLogos .FiltersCheckmark{margin:0 20px 0 0}}</style>',N(this,{target:this.shadowRoot,props:E(this.attributes),customElement:!0},wn,Tn,o,{endpoint:15,datasource:16,lang:17,translationurl:18,clientstyling:19,clientstylingurl:20,categoryid:21,addfilterselector:0,addsortingselector:1,filterbylogo:2},null,[-1,-1]),e&&(e.target&&h(e.target,this,e.anchor),e.props&&(this.$set(e.props),O()))}static get observedAttributes(){return["endpoint","datasource","lang","translationurl","clientstyling","clientstylingurl","categoryid","addfilterselector","addsortingselector","filterbylogo"]}get endpoint(){return this.$$.ctx[15]}set endpoint(e){this.$$set({endpoint:e}),O()}get datasource(){return this.$$.ctx[16]}set datasource(e){this.$$set({datasource:e}),O()}get lang(){return this.$$.ctx[17]}set lang(e){this.$$set({lang:e}),O()}get translationurl(){return this.$$.ctx[18]}set translationurl(e){this.$$set({translationurl:e}),O()}get clientstyling(){return this.$$.ctx[19]}set clientstyling(e){this.$$set({clientstyling:e}),O()}get clientstylingurl(){return this.$$.ctx[20]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),O()}get categoryid(){return this.$$.ctx[21]}set categoryid(e){this.$$set({categoryid:e}),O()}get addfilterselector(){return this.$$.ctx[0]}set addfilterselector(e){this.$$set({addfilterselector:e}),O()}get addsortingselector(){return this.$$.ctx[1]}set addsortingselector(e){this.$$set({addsortingselector:e}),O()}get filterbylogo(){return this.$$.ctx[2]}set filterbylogo(e){this.$$set({filterbylogo:e}),O()}}return!customElements.get("casino-filter")&&customElements.define("casino-filter",An),An}));
|
|
659
659
|
//# sourceMappingURL=casino-filter.js.map
|