@perevorot/shop 1.1.16 → 1.1.18

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.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=e.defineComponent({name:"catalog",setup:function(){var t=e.ref(null),n=[],o=function(){document.querySelectorAll("#subcategory > div").forEach((function(e){e.remove()}))},a=function(){window.scrollTo({top:0,left:0,behavior:"smooth"}),window.lazyImages&&window.lazyImages.update(),window.catalogFilterCallback&&window.catalogFilterCallback(),document.documentElement.classList.remove("is-catalog-loading"),i()},c=function(c,i){var r=function(e){var t=e.hash?e.hash.substring(1):"",n=t?-1!==e.pathname.indexOf(":")?e.pathname+";"+t:e.pathname+"/"+t:e.pathname;return e.origin+n+(e.search?e.search+"&filter":"?filter")}(c),l=function(e){return e.replace(/[^a-z0-9]/g,"")}(r);-1===n.indexOf(l)?(document.documentElement.classList.add("is-catalog-loading"),$http.get(r).then((function(r){var u=document.createElement("html");u.innerHTML=r.data.page,window.app.component(l,{template:u.querySelector("#subcategory").innerHTML}),o(),n.push(l),t.value=l,i||history.pushState({urlPath:c.href},document.title,c.href),e.nextTick(a)})).catch((function(e){console.error(e)})).finally((function(){document.documentElement.classList.remove("is-catalog-loading")}))):(o(),t.value=l,i||history.pushState({urlPath:c.href},document.title,c.href),e.nextTick(a))},i=function(){document.querySelectorAll("[shop-filter-content] a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),c(e)}))}))},r=function(){var e=document.createElement("a");e.href=window.location.href,c(e,!0)};return window.onpageshow=function(e){e.persisted&&window.location.reload()},e.onMounted((function(){i(),window.addEventListener("popstate",(function(){r()})),window.location.hash&&r()})),{page:t}}});t.render=function(t,n,o,a,c,i){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.page))},module.exports=t;
1
+ "use strict";var e=require("vue"),t=e.defineComponent({name:"catalog",setup:function(){var t=e.ref(null),n=[],o=[],a=function(){document.querySelectorAll("#subcategory > div").forEach((function(e){e.remove()}))},c=function(e){window.scrollTo({top:0,left:0,behavior:"smooth"}),window.lazyImages&&window.lazyImages.update(),window.catalogFilterCallback&&window.catalogFilterCallback(e),document.documentElement.classList.remove("is-catalog-loading"),r()},i=function(i,r){var l=function(e){var t=e.hash?e.hash.substring(1):"",n=t?-1!==e.pathname.indexOf(":")?e.pathname+";"+t:e.pathname+"/"+t:e.pathname;return e.origin+n+(e.search?e.search+"&filter":"?filter")}(i),u=function(e){return e.replace(/[^a-z0-9]/g,"")}(l);-1===n.indexOf(u)?(document.documentElement.classList.add("is-catalog-loading"),$http.get(l).then((function(l){var d=document.createElement("html");d.innerHTML=l.data.page,window.app.component(u,{template:d.querySelector("#subcategory").innerHTML}),a(),n.push(u),o[u]={faq:l.data.faq},t.value=u,r||history.pushState({urlPath:i.href},document.title,i.href),e.nextTick((function(){c(o[u])}))})).catch((function(e){console.error(e)})).finally((function(){document.documentElement.classList.remove("is-catalog-loading")}))):(a(),t.value=u,r||history.pushState({urlPath:i.href},document.title,i.href),e.nextTick((function(){c(o[u])})))},r=function(){document.querySelectorAll("[shop-filter-content] a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),i(e)}))}))},l=function(){var e=document.createElement("a");e.href=window.location.href,i(e,!0)};return window.onpageshow=function(e){e.persisted&&window.location.reload()},e.onMounted((function(){r(),window.addEventListener("popstate",(function(){l()})),window.location.hash&&l()})),{page:t}}});t.render=function(t,n,o,a,c,i){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.page))},module.exports=t;
2
2
  //# sourceMappingURL=Catalog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Catalog.js","sources":["../../../../src/js/components/shop/Catalog.vue","../../../../src/js/components/shop/Catalog.vue?vue&type=template&id=6c42df55&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick, onMounted } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n if (window.catalogFilterCallback) {\n window.catalogFilterCallback();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n const pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter-content] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.onpageshow = function (event) {\n if (event.persisted) {\n window.location.reload();\n }\n };\n\n onMounted(() => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>","<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick, onMounted } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n if (window.catalogFilterCallback) {\n window.catalogFilterCallback();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n const pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter-content] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.onpageshow = function (event) {\n if (event.persisted) {\n window.location.reload();\n }\n };\n\n onMounted(() => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>"],"names":["script","defineComponent","name","setup","page","ref","pages","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","catalogFilterCallback","documentElement","classList","init","get","a","ignoreHistory","href","hash","substring","pathname","indexOf","origin","search","parseFilterHref","componentName","replace","getPageName","add","$http","then","response","html","createElement","innerHTML","data","app","component","template","querySelector","push","value","history","pushState","urlPath","title","nextTick","catch","error","console","finally","addEventListener","e","preventDefault","refresh","location","onpageshow","event","persisted","reload","onMounted","_openBlock","_createBlock","createBlock","_resolveDynamicComponent","_ctx"],"mappings":"kCAMAA,EAAeC,kBAAgB,CAC3BC,KAAM,UACNC,MAAK,WACD,IAAMC,EAAOC,MAAI,MACXC,EAAQ,GAMRC,EAAiB,WACnBC,SAASC,iBAAiB,sBAAsBC,SAAQ,SAACC,GACrDA,EAAQC,aAIVC,EAAQ,WACVC,OAAOC,SAAS,CACZC,IAAK,EACLC,KAAM,EACNC,SAAU,WAGVJ,OAAOK,YACPL,OAAOK,WAAWC,SAGlBN,OAAOO,uBACPP,OAAOO,wBAGXb,SAASc,gBAAgBC,UAAUX,OAAO,sBAE1CY,KAUEC,EAAM,SAACC,EAAGC,GACZ,IAAMC,EARc,SAACF,GACrB,IAAMG,EAAOH,EAAEG,KAAOH,EAAEG,KAAKC,UAAU,GAAK,GACtCC,EAAWF,GAAqC,IAA7BH,EAAEK,SAASC,QAAQ,KAAcN,EAAEK,SAAW,IAAMF,EAAOH,EAAEK,SAAW,IAAMF,EAAQH,EAA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,KAAAA,qCCtIR,OAAAoE,EAAAA,YAAAC,EAAAC,YAAiCC,0BAAjBC,EAAIxE"}
1
+ {"version":3,"file":"Catalog.js","sources":["../../../../src/js/components/shop/Catalog.vue","../../../../src/js/components/shop/Catalog.vue?vue&type=template&id=37981ad7&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick, onMounted } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n const extra = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = (extra) => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n if (window.catalogFilterCallback) {\n window.catalogFilterCallback(extra);\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n const pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n extra[componentName] = {\n faq: response.data.faq\n };\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(() => {\n after(extra[componentName]);\n });\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(() => {\n after(extra[componentName]);\n });\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter-content] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.onpageshow = function (event) {\n if (event.persisted) {\n window.location.reload();\n }\n };\n\n onMounted(() => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>","<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick, onMounted } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n const extra = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = (extra) => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n if (window.catalogFilterCallback) {\n window.catalogFilterCallback(extra);\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n const pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n extra[componentName] = {\n faq: response.data.faq\n };\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(() => {\n after(extra[componentName]);\n });\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(() => {\n after(extra[componentName]);\n });\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter-content] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.onpageshow = function (event) {\n if (event.persisted) {\n window.location.reload();\n }\n };\n\n onMounted(() => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>"],"names":["script","defineComponent","name","setup","page","ref","pages","extra","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","catalogFilterCallback","documentElement","classList","init","get","a","ignoreHistory","href","hash","substring","pathname","indexOf","origin","search","parseFilterHref","componentName","replace","getPageName","add","$http","then","response","html","createElement","innerHTML","data","app","component","template","querySelector","push","faq","value","history","pushState","urlPath","title","nextTick","catch","error","console","finally","addEventListener","e","preventDefault","refresh","location","onpageshow","event","persisted","reload","onMounted","_openBlock","_createBlock","createBlock","_resolveDynamicComponent","_ctx"],"mappings":"kCAMAA,EAAeC,kBAAgB,CAC3BC,KAAM,UACNC,MAAK,WACD,IAAMC,EAAOC,MAAI,M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AAQ,WACLtD,SAASc,gBAAgBC,UAAUX,OAAO,2BAGlDL,IAEAJ,EAAKkD,MAAQjB,EAERT,GACD2B,QAAQC,UAAU,CAAEC,QAAS9B,EAAEE,MAAQpB,SAASiD,MAAO/B,EAAEE,MAG7D8B,EAAAA,UAAS,WACL7C,EAAMP,EAAM8B,SAKlBZ,EAAO,WACThB,SAASC,iBAAiB,2BAA2BC,SAAQ,SAACgB,GAC1DA,EAAEqC,iBAAiB,SAAS,SAACC,GACzBA,EAAEC,iBAEFxC,EAAIC,UAKVwC,EAAU,WACZ,IAAMxC,EAAIlB,SAASoC,cAAc,KACjClB,EAAEE,KAAOd,OAAOqD,SAASvC,KAEzBH,EAAIC,GAAG,IAqBX,OAlBAZ,OAAOsD,WAAa,SAAUC,GACtBA,EAAMC,WACNxD,OAAOqD,SAASI,UAIxBC,EAAAA,WAAU,WACNhD,IAEAV,OAAOiD,iBAAiB,YAAY,WAChCG,OAGApD,OAAOqD,SAAStC,MAChBqC,OAID,CACH/D,KAAAA,qCC/IR,OAAAsE,EAAAA,YAAAC,EAAAC,YAAiCC,0BAAjBC,EAAI1E"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),r=require("@perevorot/shop/dist/api"),o=require("simplebar"),n=require("secure-ls");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(o),c=a(n);var i=e.defineComponent({name:"search",props:{q:{type:String,default:""},placeholder:{type:String,default:""},parameter:{type:String,default:"/q{separator}"}},setup:function(o){var n=new c.default({isCompression:!1}),a=o.q;if(a){var i=document.createElement("textarea");i.innerHTML=a,a=i.value}var s=e.ref(!1),u=e.ref(a),d=e.ref([]),p=e.ref([]),m=e.ref(0),v=e.ref(-1),h=e.ref(!1),f=e.ref(),y=e.ref(""),g=e.ref(),k=e.ref(n.get("search")),E=e.ref([]),w=t.useStore(),V=e.computed((function(){return w.getters["auth/me"]})),N=[],B=function(){clearTimeout(void 0),v.value=-1,u.value.trim()?(s.value=!0,u.value.trim()&&r.shop.search(u.value).then((function(e){e.data&&(C(),d.value=e.data.products,m.value=e.data.total,y.value=e.data.separator,p.value=e.data.byCategory,new l.default(g.value))})).finally((function(){s.value=!1}))):(d.value=[],s.value=!1)},C=function(){if(u.value.length>1){var e=n.get("search")?n.get("search"):[];-1!==e.indexOf(u.value)&&(e=e.filter((function(e){return e!==u.value}))),e.length>4&&(e=e.slice(0,4)),e.unshift(u.value),n.set("search",e),k.value=e}};e.onBeforeUpdate((function(){N=[]})),e.watch((function(){return u.value}),(function(){h.value=!0,v.value=-1,B()}));var _=e.computed((function(){return u.value?$env.locale.url+"/search"+S.value:$env.locale.url+"/search"})),S=e.computed((function(){return o.parameter.replace("{separator}",y.value)+u.value.toLowerCase()})),D=function(e){e.target.closest(".cart")||(h.value=!1,v.value=-1)};window.addEventListener("click",D);var L,q=e.computed((function(){return u.value.length>3?E.value.filter((function(e){return-1!==e.search.indexOf(u.value)})):[]})),x=(L=function(){var e,t,r,n=document.getElementById("menu");return n&&n.querySelectorAll("[data-search]").forEach((function(e){var t=e.textContent.trim(),r=e.dataset.search;E.value.push({name:(r?r+" / ":"")+t,search:t.toLowerCase(),href:e.closest("a").href})})),o.q&&B(),r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(L.apply(this,e))}catch(e){return Promise.reject(e)}});return document.addEventListener("DOMContentLoaded",x,!1),{isLoading:s,term:u,results:d,next:function(){v.value<d.value.length-1&&v.value++},prev:function(){v.value>=0&&v.value--},current:v,add:function(e){v.value>=0&&(e.preventDefault(),N[v.value].add())},cartRefs:function(e){e&&N.push(e)},isDropdown:h,preventCaret:function(e){(38==e.which||40==e.which||32==e.which&&v.value>=0)&&e.preventDefault()},esc:function(e){f.value.blur(),D(e)},input:f,dropdown:function(){h.value=!0,v.value=-1},total:m,searchUrl:_,searchHrefWithParameter:S,open:function(){v.value>=0?window.location.href=d.value[v.value].href:window.location.href=_.value},categories:q,byCategory:p,dropdownContent:g,history:k,clearSearchHistory:function(e){n.remove("search"),k.value=[],f.value.focus()},setSearchHistory:function(e){e.value=e},user:V}}}),s={class:"dropdown-trigger"},u=["placeholder"],d={class:"icon is-small is-right"},p=[e.createElementVNode("i",{class:"fas fa-search"},null,-1)],m={key:0,class:"dropdown-menu"},v={class:"dropdown-content"},h={class:"history-list"},f={class:"dropdown-item history-list-title"},y=["onClick"],g={class:"dropdown-item history-list-clear"},k={class:"dropdown-menu"},E={class:"dropdown-content",style:{"max-height":"600px",overflow:"auto"},ref:"dropdownContent"},w={key:0,class:"results-list"},V=["href"],N={key:0,class:"dropdown-divider"},B={key:1,class:"results-list-category"},C={class:"dropdown-item categories-list-title"},_=["href"],S={key:2,class:"results-list-total"},D={class:"dropdown-item mb-3 mt-2"},L=e.createElementVNode("br",null,null,-1),q=["href"],x={key:3,class:"products-list"},b={class:"dropdown-item products-list-title"},H=["data-code"],T={class:"column"},K={class:"title"},M=["href"],P=["innerHTML"],F={key:0,class:"price_old"},R=["innerHTML"],U={class:"code"},$={key:1,class:"quantity"},z={key:2,class:"no-quantity"},O={key:0,class:"column is-narrow"},j={key:1,class:"column is-eol"},W={key:0,class:"dropdown-content"},A={class:"dropdown-item"},I={class:"no-results"};i.render=function(t,r,o,n,a,l){var c=e.resolveComponent("cart-add");return e.openBlock(),e.createElementBlock("div",{class:"shop-search",onClick:r[10]||(r[10]=function(e){return e.stopPropagation()})},[e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isDropdown,"is-dropdown-visible":t.isDropdown&&(t.history.length&&!t.term||t.results.length||t.categories.length||t.term&&!t.isLoading&&!t.results.length&&!t.categories.length)}])},[e.createElementVNode("div",{class:"overlay search-overlay",onClick:r[0]||(r[0]=function(e){return t.esc(e)})}),e.createElementVNode("div",s,[e.createElementVNode("div",{class:e.normalizeClass(["control has-icons-right",{"is-loading":t.isLoading}])},[e.withDirectives(e.createElementVNode("input",{class:"input",type:"text","onUpdate:modelValue":r[1]||(r[1]=function(e){return t.term=e}),ref:"input",placeholder:t.placeholder,onKeyup:[r[2]||(r[2]=e.withKeys((function(){return t.next&&t.next.apply(t,arguments)}),["arrow-down"])),r[3]||(r[3]=e.withKeys((function(){return t.prev&&t.prev.apply(t,arguments)}),["arrow-up"])),r[4]||(r[4]=e.withKeys((function(e){return t.add(e)}),["space"])),r[5]||(r[5]=e.withKeys((function(){return t.open&&t.open.apply(t,arguments)}),["enter"])),r[6]||(r[6]=e.withKeys((function(e){return t.esc(e)}),["esc"]))],onClick:r[7]||(r[7]=function(){return t.dropdown&&t.dropdown.apply(t,arguments)}),onKeydown:r[8]||(r[8]=function(e){return t.preventCaret(e)})},null,40,u),[[e.vModelText,t.term]]),e.renderSlot(t.$slots,"icon",{isLoading:t.isLoading},(function(){return[e.withDirectives(e.createElementVNode("span",d,p,512),[[e.vShow,!t.isLoading]])]}))],2)]),t.isDropdown&&t.history.length&&!t.term?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",v,[e.createElementVNode("div",h,[e.createElementVNode("div",f,[e.createElementVNode("p",null,e.toDisplayString(t.__("shop.search.history")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.history,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.createElementVNode("a",{onClick:function(e){return t.term=r}},e.toDisplayString(r),9,y)])})),128)),e.createElementVNode("div",g,[e.createElementVNode("a",{onClick:r[9]||(r[9]=function(e){return t.clearSearchHistory(e)})},e.toDisplayString(t.__("shop.search.history_clear")),1)])])])])):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("div",k,[e.withDirectives(e.createElementVNode("div",E,[t.categories.length?(e.openBlock(),e.createElementBlock("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,(function(t,r){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:r},[e.createElementVNode("div",null,[e.createElementVNode("a",{href:t.href},e.toDisplayString(t.name),9,V)])])})),128)),t.byCategory.length?(e.openBlock(),e.createElementBlock("hr",N)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.byCategory.length?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",C,e.toDisplayString(t.__("shop.search.categories")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.byCategory,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.createElementVNode("div",null,[e.createElementVNode("a",{href:r.href+t.searchHrefWithParameter},e.toDisplayString(r.name),9,_)]),e.createElementVNode("div",null,e.toDisplayString(t.__("shop.search.category_found",{count:r.count})),1)])})),128))])):e.createCommentVNode("v-if",!0),t.total?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("p",D,[e.createTextVNode(e.toDisplayString(t.__("shop.search.total_found",{total:t.total}))+" ",1),L,e.createElementVNode("a",{href:t.searchUrl},e.toDisplayString(t.__("shop.search.open_results")),9,q)])])):e.createCommentVNode("v-if",!0),t.results.length?(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("div",b,e.toDisplayString(t.__("shop.search.products")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.results,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dropdown-item",{"is-active":t.current==o}]),key:r.id},[e.renderSlot(t.$slots,"item",{user:t.user,item:r,cartRefs:t.cartRefs},(function(){return[e.createElementVNode("div",{class:"columns","data-code":r.code,"shop-product":""},[e.createElementVNode("div",T,[e.createElementVNode("div",K,[e.createElementVNode("a",{href:r.href,"shop-product-name":""},e.toDisplayString(r.name),9,M)]),e.createElementVNode("div",{class:"price",innerHTML:r.price,"shop-product-price":""},null,8,P),r.price_old?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("span",{innerHTML:r.price_old},null,8,R)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",U,e.toDisplayString(r.code),1),r.quantity?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(t.__("shop.search.in_stock")),1)):(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(t.__("shop.search.out_stock")),1))]),r.is_eol?(e.openBlock(),e.createElementBlock("div",j,e.toDisplayString(t.__("shop.search.eol")),1)):(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(c,{id:r.id,"is-change-quantity":!1,"is-already-in-cart":!1,product:r,ref:t.cartRefs},null,8,["id","product"])]))],8,H)]}))],2)})),128))])):e.createCommentVNode("v-if",!0)],512),[[e.vShow,t.results.length||t.categories.length]]),t.isLoading||t.results.length||t.categories.length?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",A,[e.createElementVNode("div",I,e.toDisplayString(t.__("shop.search.no_results")),1)])]))],512),[[e.vShow,t.results.length||t.term]])],2)])},module.exports=i;
1
+ "use strict";var e=require("vue"),t=require("vuex"),r=require("@perevorot/shop/dist/api"),o=require("simplebar"),n=require("secure-ls");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(o),c=a(n);var i=e.defineComponent({name:"search",props:{q:{type:String,default:""},placeholder:{type:String,default:""},parameter:{type:String,default:"/q{separator}"}},setup:function(o){var n=new c.default({isCompression:!1}),a=o.q;if(a){var i=document.createElement("textarea");i.innerHTML=a,a=i.value}var s=e.ref(!1),u=e.ref(a),d=e.ref([]),p=e.ref([]),m=e.ref(0),v=e.ref(-1),h=e.ref(!1),f=e.ref(),y=e.ref(""),g=e.ref(),k=e.ref(n.get("search")),E=e.ref([]),w=t.useStore(),V=e.computed((function(){return w.getters["auth/me"]})),N=[],B=function(){clearTimeout(void 0),v.value=-1,u.value.trim()?(s.value=!0,u.value.trim()&&r.shop.search(u.value).then((function(e){e.data&&(C(),d.value=e.data.products,m.value=e.data.total,y.value=e.data.separator,p.value=e.data.byCategory,new l.default(g.value))})).finally((function(){s.value=!1}))):(d.value=[],s.value=!1)},C=function(){if(u.value.length>1){var e=n.get("search")?n.get("search"):[];-1!==e.indexOf(u.value)&&(e=e.filter((function(e){return e!==u.value}))),e.length>4&&(e=e.slice(0,4)),e.unshift(u.value),n.set("search",e),k.value=e}};e.onBeforeUpdate((function(){N=[]})),e.watch((function(){return u.value}),(function(){h.value=!0,v.value=-1,B()}));var _=e.computed((function(){return u.value?$env.locale.url+"/search"+S.value:$env.locale.url+"/search"})),S=e.computed((function(){return o.parameter.replace("{separator}",y.value)+u.value.toLowerCase()})),D=function(e){e.target.closest(".cart")||(h.value=!1,v.value=-1)};window.addEventListener("click",D);var L,q=e.computed((function(){return u.value.length>3?E.value.filter((function(e){return-1!==e.search.indexOf(u.value)})):[]})),x=(L=function(){var e,t,r,n=document.getElementById("menu");return n&&n.querySelectorAll("[data-search]").forEach((function(e){var t=e.textContent.trim(),r=e.dataset.search;E.value.push({name:(r?r+" / ":"")+t,search:t.toLowerCase(),href:e.closest("a").href})})),o.q&&B(),r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(L.apply(this,e))}catch(e){return Promise.reject(e)}});return document.addEventListener("DOMContentLoaded",x,!1),{isLoading:s,term:u,results:d,next:function(){v.value<d.value.length-1&&v.value++},prev:function(){v.value>=0&&v.value--},current:v,add:function(e){v.value>=0&&(e.preventDefault(),N[v.value].add())},cartRefs:function(e){e&&N.push(e)},isDropdown:h,preventCaret:function(e){(38==e.which||40==e.which||32==e.which&&v.value>=0)&&e.preventDefault()},esc:function(e){f.value.blur(),D(e)},input:f,dropdown:function(){h.value=!0,v.value=-1},total:m,searchUrl:_,searchHrefWithParameter:S,open:function(){v.value>=0?window.location.href=d.value[v.value].href:window.location.href=_.value},categories:q,byCategory:p,dropdownContent:g,history:k,clearSearchHistory:function(e){n.remove("search"),k.value=[],f.value.focus()},setSearchHistory:function(e){e.value=e},user:V}}}),s={class:"dropdown-trigger"},u=["placeholder"],d={class:"icon is-small is-right"},p=[e.createElementVNode("i",{class:"fas fa-search"},null,-1)],m={key:0,class:"dropdown-menu"},v={class:"dropdown-content"},h={class:"history-list"},f={class:"dropdown-item history-list-title"},y=["onClick"],g={class:"dropdown-item history-list-clear"},k={class:"dropdown-menu"},E={class:"dropdown-content",style:{"max-height":"600px",overflow:"auto"},ref:"dropdownContent"},w={key:0,class:"results-list"},V=["href"],N={key:0,class:"dropdown-divider"},B={key:1,class:"results-list-category"},C={class:"dropdown-item categories-list-title"},_=["href"],S={key:2,class:"results-list-total"},D={class:"dropdown-item mb-3 mt-2"},L=e.createElementVNode("br",null,null,-1),q=["href"],x={key:3,class:"products-list"},b={class:"dropdown-item products-list-title"},H=["data-code"],T={class:"column"},K={class:"title"},M=["href"],P=["innerHTML"],F={key:0,class:"price_old"},R=["innerHTML"],U={class:"code"},$={key:1,class:"quantity"},z={key:2,class:"no-quantity"},O={key:0,class:"column is-narrow"},j={key:1,class:"column is-eol"},W={key:0,class:"dropdown-content"},A={class:"dropdown-item"},I={class:"no-results"};i.render=function(t,r,o,n,a,l){var c=e.resolveComponent("cart-add");return e.openBlock(),e.createElementBlock("div",{class:"shop-search",onClick:r[10]||(r[10]=function(e){return e.stopPropagation()})},[e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isDropdown,"is-dropdown-visible":t.isDropdown&&(t.history.length&&!t.term||t.results.length||t.categories.length||t.term&&!t.isLoading&&!t.results.length&&!t.categories.length)}])},[e.createElementVNode("div",{class:"overlay search-overlay",onClick:r[0]||(r[0]=function(e){return t.esc(e)})}),e.createElementVNode("div",s,[e.createElementVNode("div",{class:e.normalizeClass(["control has-icons-right",{"is-loading":t.isLoading}])},[e.withDirectives(e.createElementVNode("input",{class:"input",type:"text","onUpdate:modelValue":r[1]||(r[1]=function(e){return t.term=e}),ref:"input",placeholder:t.placeholder,onKeyup:[r[2]||(r[2]=e.withKeys((function(){return t.next&&t.next.apply(t,arguments)}),["arrow-down"])),r[3]||(r[3]=e.withKeys((function(){return t.prev&&t.prev.apply(t,arguments)}),["arrow-up"])),r[4]||(r[4]=e.withKeys((function(e){return t.add(e)}),["space"])),r[5]||(r[5]=e.withKeys((function(){return t.open&&t.open.apply(t,arguments)}),["enter"])),r[6]||(r[6]=e.withKeys((function(e){return t.esc(e)}),["esc"]))],onClick:r[7]||(r[7]=function(){return t.dropdown&&t.dropdown.apply(t,arguments)}),onKeydown:r[8]||(r[8]=function(e){return t.preventCaret(e)})},null,40,u),[[e.vModelText,t.term]]),e.renderSlot(t.$slots,"icon",{isLoading:t.isLoading},(function(){return[e.withDirectives(e.createElementVNode("span",d,p,512),[[e.vShow,!t.isLoading]])]}))],2)]),t.isDropdown&&t.history.length&&!t.term?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",v,[e.createElementVNode("div",h,[e.createElementVNode("div",f,[e.createElementVNode("p",null,e.toDisplayString(t.__("shop.search.history")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.history,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.createElementVNode("a",{onClick:function(e){return t.term=r}},e.toDisplayString(r),9,y)])})),128)),e.createElementVNode("div",g,[e.createElementVNode("a",{onClick:r[9]||(r[9]=function(e){return t.clearSearchHistory(e)})},e.toDisplayString(t.__("shop.search.history_clear")),1)])])])])):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("div",k,[e.withDirectives(e.createElementVNode("div",E,[t.categories.length?(e.openBlock(),e.createElementBlock("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.categories,(function(t,r){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:r},[e.createElementVNode("div",null,[e.createElementVNode("a",{href:t.href},e.toDisplayString(t.name),9,V)])])})),128)),t.byCategory.length?(e.openBlock(),e.createElementBlock("hr",N)):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0),t.byCategory.length?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",C,e.toDisplayString(t.__("shop.search.categories")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.byCategory,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:o},[e.createElementVNode("div",null,[e.createElementVNode("a",{href:r.href+t.searchHrefWithParameter},e.toDisplayString(r.name),9,_)]),e.createElementVNode("div",null,e.toDisplayString(t.__("shop.search.category_found",{count:r.count})),1)])})),128))])):e.createCommentVNode("v-if",!0),t.total?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("p",D,[e.createTextVNode(e.toDisplayString(t.__("shop.search.total_found",{total:t.total}))+" ",1),L,e.createElementVNode("a",{href:t.searchUrl},e.toDisplayString(t.__("shop.search.open_results")),9,q)])])):e.createCommentVNode("v-if",!0),t.results.length?(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("div",b,e.toDisplayString(t.__("shop.search.products")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.results,(function(r,o){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dropdown-item",{"is-active":t.current==o}]),key:r.id},[e.renderSlot(t.$slots,"item",{user:t.user,item:r,cartRefs:t.cartRefs},(function(){return[e.createElementVNode("div",{class:"columns","data-code":r.code,"shop-product":""},[e.createElementVNode("div",T,[e.createElementVNode("div",K,[e.createElementVNode("a",{href:r.href,"shop-product-name":""},e.toDisplayString(r.name),9,M)]),e.createElementVNode("div",{class:"price",innerHTML:r.price,"shop-product-price":""},null,8,P),r.price_old?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("span",{innerHTML:r.price_old},null,8,R)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",U,e.toDisplayString(r.code),1),r.quantity?(e.openBlock(),e.createElementBlock("div",$,e.toDisplayString(t.__("shop.search.in_stock")),1)):(e.openBlock(),e.createElementBlock("span",z,e.toDisplayString(t.__("shop.search.out_stock")),1))]),r.is_eol?(e.openBlock(),e.createElementBlock("div",j,e.toDisplayString(t.__("shop.search.eol")),1)):(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(c,{id:r.id,"is-change-quantity":!1,"is-already-in-cart":!1,product:r,ref:t.cartRefs},null,8,["id","product"])]))],8,H)]}))],2)})),128))])):e.createCommentVNode("v-if",!0)],512),[[e.vShow,t.results.length||t.categories.length||t.byCategory.length]]),t.isLoading||t.results.length||t.categories.length?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",A,[e.createElementVNode("div",I,e.toDisplayString(t.__("shop.search.no_results")),1)])]))],512),[[e.vShow,t.results.length||t.term]])],2)])},module.exports=i;
2
2
  //# sourceMappingURL=Search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Search.js","sources":["../../../../src/js/components/shop/Search.vue","../../../../src/js/components/shop/Search.vue?vue&type=template&id=2edb6b6a&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholder\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{\n __('shop.search.category_found', {\n count: item.count\n })\n }}\n </div>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\" :data-code=\"item.code\" shop-product>\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\" shop-product-name>\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\" shop-product-price></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :product=\"item\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\">\n {{ __('shop.search.no_results') }}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n isDropdown.value = false;\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user\n };\n }\n});\n</script>","<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholder\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{\n __('shop.search.category_found', {\n count: item.count\n })\n }}\n </div>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\" :data-code=\"item.code\" shop-product>\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\" shop-product-name>\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\" shop-product-price></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :product=\"item\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\">\n {{ __('shop.search.no_results') }}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n isDropdown.value = false;\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user\n };\n }\n});\n</script>"],"names":["script","defineComponent","name","props","q","type","String","default","placeholder","parameter","setup","ls","SecureLS","isCompression","encoder","document","createElement","innerHTML","value","isLoading","ref","term","results","byCategory","total","current","isDropdown","input","separator","dropdownContent","history","get","menu","store","useStore","user","computed","getters","refs","search","clearTimeout","timeout","trim","api","shop","then","response","data","saveSearch","products","SimpleBar","finally","length","indexOf","filter","item","slice","unshift","set","onBeforeUpdate","watch","searchUrl","$env","locale","url","searchHrefWithParameter","replace","toLowerCase","close","event","target","closest","window","addEventListener","categories","load","direct","menuElement","getElementById","querySelectorAll","forEach","element","textContent","dataset","push","href","resolve","args","i","arguments","Promise","reject","e","next","prev","add","preventDefault","cartRefs","el","preventCaret","which","esc","blur","dropdown","open","location","clearSearchHistory","remove","focus","setSearchHistory","_hoisted_1","class","_hoisted_3","_createElementVNode","createElementVNode","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_11","_hoisted_12","style","max-height","overflow","_hoisted_18","_hoisted_21","_hoisted_25","_hoisted_27","_hoisted_28","_hoisted_33","_hoisted_39","_hoisted_40","_createElementBlock","createElementBlock","onClick","_cache","$event","stopPropagation","_ctx","_normalizeClass","onKeyup","apply","_withKeys","withKeys","onKeydown","_renderSlot","$slots","_withDirectives","_hoisted_5","_openBlock","_hoisted_6","__","_Fragment","_renderList","renderList","index","key","_hoisted_10","withDirectives","_hoisted_13","openBlock","_hoisted_14","Fragment","_toDisplayString","toDisplayString","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_19","count","_hoisted_20","_hoisted_22","_hoisted_23","_hoisted_24","is-active","id","renderSlot","data-code","code","shop-product","shop-product-name","_hoisted_29","price","shop-product-price","price_old","_hoisted_31","quantity","_hoisted_34","_hoisted_35","is_eol","_hoisted_37","_hoisted_36","_createVNode","_component_cart_add","is-change-quantity","is-already-in-cart","product","_vShow","vShow","_hoisted_38"],"mappings":"kOA4HA,IAAeA,EAAcC,kBAAgB,CACzCC,KAAM,SACNC,MAAO,CACHC,EAAG,CACCC,KAAMC,OACNC,QAAS,IAEbC,YAAa,CACTH,KAAMC,OACNC,QAAS,IAEbE,UAAW,CACPJ,KAAMC,OACNC,QAAS,kBAGjBG,MAAK,SAACP,GACF,IAAMQ,EAAK,IAAIC,UAAS,CACpBC,eAAe,IAGfT,EAAID,EAAMC,EAEd,GAAIA,EAAG,CACH,IAAIU,EAAUC,SAASC,cAAc,YACrCF,EAAQG,UAAYb,EACpBA,EAAIU,EAAQI,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AM8F,oBAAA,IACdjB,EAAAC,gBAAA5G,EAAKrD,MAAG,EAAAkL,KAGnBnE,EAA+DC,mBAAA,MAAA,CAA1DH,MAAM,QAAQ9F,UAAQsC,EAAK8H,MAAOC,qBAAA,cACV/H,EAAKgI,WAAlCnC,cAAAjB,EAAAC,mBAEK,MAFLoD,EAEK,CADDvE,EAAAA,mBAAoC,OAAA,CAA9BhG,UAAQsC,EAAKgI,wDAEvBtE,qBAAsC,MAAtCe,EAAqBkC,EAAAA,gBAAA3G,EAAK0H,MAAG,GACD1H,EAAKkI,wBAAjCtD,EAEKC,mBAAA,MAFLsD,EAEKxB,EAAAA,gBADEzB,EAAEa,GAAA,yBAAA,mBAETnB,EAEMC,mBAAA,OAFNuD,EAEMzB,EAAAC,gBADC1B,EAAEa,GAAA,0BAAA,MAGwB/F,EAAKqI,sBAG1CzD,EAAAA,mBAEK,MAFL0D,EAEK3B,EAAAA,gBADEzB,EAAEa,GAAA,oBAAA,KAJTF,EAAAA,YAAAjB,EAAAA,mBAEK,MAFL2D,EAEK,CADDC,EAAAA,YAA0HC,EAAA,CAA/GlB,GAAIvH,EAAKuH,GAAKmB,sBAAoB,EAAQC,sBAAoB,EAAQC,QAAS5I,EAAOnC,IAAKqH,EAAQxC,uGA/DhG,CAAAmG,EAAAC,MAAA5D,EAAAnH,QAAQ8B,QAAUqF,EAAA/D,WAAWtB,UAyE9BqF,EAAAtH,WAAcsH,EAAOnH,QAAC8B,QAAWqF,EAAA/D,WAAWtB,wCAAjFgG,EAAAA,YAAAjB,EAAAC,mBAMK,MANLkE,EAMK,CALDrF,EAAAC,mBAIK,MAJLe,EAIK,CAHDhB,EAAAA,mBAEK,MAFLiB,EAEKgC,EAAAA,gBADEzB,EAAEa,GAAA,2BAAA,wBA7Ecb,EAAOnH,QAAC8B,QAAUqF,EAAIpH"}
1
+ {"version":3,"file":"Search.js","sources":["../../../../src/js/components/shop/Search.vue","../../../../src/js/components/shop/Search.vue?vue&type=template&id=0d616788&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholder\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length || byCategory.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{\n __('shop.search.category_found', {\n count: item.count\n })\n }}\n </div>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\" :data-code=\"item.code\" shop-product>\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\" shop-product-name>\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\" shop-product-price></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :product=\"item\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\">\n {{ __('shop.search.no_results') }}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n isDropdown.value = false;\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user\n };\n }\n});\n</script>","<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div class=\"dropdown\" v-bind:class=\"{\n 'is-active': isDropdown,\n 'is-dropdown-visible': isDropdown && ((history.length && !term) || results.length || categories.length || (term && !isLoading && !results.length && !categories.length))\n }\">\n <div class=\"overlay search-overlay\" @click=\"esc($event)\"></div>\n <div class=\"dropdown-trigger\">\n <div class=\"control has-icons-right\" v-bind:class=\"{ 'is-loading': isLoading }\">\n <input class=\"input\" type=\"text\" v-model=\"term\" ref=\"input\" :placeholder=\"placeholder\" @keyup.arrow-down=\"next\" @keyup.arrow-up=\"prev\" @keyup.space=\"add($event)\" @keyup.enter=\"open\" @keyup.esc=\"esc($event)\" @click=\"dropdown\" @keydown=\"preventCaret($event)\" />\n <slot name=\"icon\" :isLoading=\"isLoading\">\n <span class=\"icon is-small is-right\" v-show=\"!isLoading\">\n <i class=\"fas fa-search\"></i>\n </span>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-if=\"isDropdown && history.length && !term\">\n <div class=\"dropdown-content\">\n <div class=\"history-list\">\n <div class=\"dropdown-item history-list-title\">\n <p>{{ __('shop.search.history') }}</p>\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in history\" v-bind:key=\"index\">\n <a @click=\"term = item\">{{ item }}</a>\n </div>\n <div class=\"dropdown-item history-list-clear\">\n <a @click=\"clearSearchHistory($event)\">{{ __('shop.search.history_clear') }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"dropdown-menu\" v-show=\"results.length || term\">\n <div class=\"dropdown-content\" v-show=\"results.length || categories.length || byCategory.length\" style=\"max-height: 600px; overflow: auto\" ref=\"dropdownContent\">\n <div class=\"results-list\" v-if=\"categories.length\">\n <div class=\"dropdown-item\" v-for=\"(item, index) in categories\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href\">{{ item.name }}</a>\n </div>\n </div>\n <hr class=\"dropdown-divider\" v-if=\"byCategory.length\" />\n </div>\n <div class=\"results-list-category\" v-if=\"byCategory.length\">\n <div class=\"dropdown-item categories-list-title\">\n {{ __('shop.search.categories') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in byCategory\" v-bind:key=\"index\">\n <div>\n <a :href=\"item.href + searchHrefWithParameter\">{{ item.name }}</a>\n </div>\n <div>\n {{\n __('shop.search.category_found', {\n count: item.count\n })\n }}\n </div>\n </div>\n </div>\n <div class=\"results-list-total\" v-if=\"total\">\n <p class=\"dropdown-item mb-3 mt-2\">\n {{\n __('shop.search.total_found', {\n total: total\n })\n }}\n <br />\n <a :href=\"searchUrl\">{{ __('shop.search.open_results') }}</a>\n </p>\n </div>\n <div class=\"products-list\" v-if=\"results.length\">\n <div class=\"dropdown-item products-list-title\">\n {{ __('shop.search.products') }}\n </div>\n <div class=\"dropdown-item\" v-for=\"(item, index) in results\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-active': current == index }\">\n <slot name=\"item\" :user=\"user\" :item=\"item\" :cart-refs=\"cartRefs\">\n <div class=\"columns\" :data-code=\"item.code\" shop-product>\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\" shop-product-name>\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.price\" shop-product-price></div>\n <div class=\"price_old\" v-if=\"item.price_old\">\n <span v-html=\"item.price_old\"></span>\n </div>\n <div class=\"code\">{{ item.code }}</div>\n <div class=\"quantity\" v-if=\"item.quantity\">\n {{ __('shop.search.in_stock') }}\n </div>\n <span class=\"no-quantity\" v-else>\n {{ __('shop.search.out_stock') }}\n </span>\n </div>\n <div class=\"column is-narrow\" v-if=\"!item.is_eol\">\n <cart-add :id=\"item.id\" :is-change-quantity=\"false\" :is-already-in-cart=\"false\" :product=\"item\" :ref=\"cartRefs\"></cart-add>\n </div>\n <div v-else class=\"column is-eol\">\n {{ __('shop.search.eol') }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"dropdown-content\" v-if=\"!isLoading && !results.length && !categories.length\">\n <div class=\"dropdown-item\">\n <div class=\"no-results\">\n {{ __('shop.search.no_results') }}\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, watch, onBeforeUpdate, defineComponent, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { shop as api } from '@perevorot/shop/dist/api';\nimport SimpleBar from 'simplebar';\nimport SecureLS from 'secure-ls';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'search',\n props: {\n q: {\n type: String,\n default: ''\n },\n placeholder: {\n type: String,\n default: ''\n },\n parameter: {\n type: String,\n default: '/q{separator}'\n }\n },\n setup(props) {\n const ls = new SecureLS({\n isCompression: false\n });\n\n let q = props.q;\n\n if (q) {\n let encoder = document.createElement('textarea');\n encoder.innerHTML = q;\n q = encoder.value;\n }\n\n const isLoading = ref(false);\n const term = ref(q);\n const results = ref([]);\n const byCategory = ref([]);\n const total = ref(0);\n const current = ref(-1);\n const isDropdown = ref(false);\n const input = ref();\n const separator = ref('');\n const dropdownContent = ref();\n const history = ref(ls.get('search'));\n const menu = ref([]);\n const store = useStore();\n const user = computed(() => store.getters['auth/me']);\n\n let refs = [];\n let timeout;\n\n const search = () => {\n clearTimeout(timeout);\n\n current.value = -1;\n\n if (!term.value.trim()) {\n results.value = [];\n isLoading.value = false;\n } else {\n isLoading.value = true;\n\n //timeout = setTimeout(() => {\n if (term.value.trim()) {\n api.search(term.value)\n .then((response) => {\n if (response.data) {\n saveSearch();\n\n results.value = response.data.products;\n total.value = response.data.total;\n separator.value = response.data.separator;\n byCategory.value = response.data.byCategory;\n\n const scrollBar = new SimpleBar(dropdownContent.value);\n }\n })\n .finally(() => {\n isLoading.value = false;\n });\n }\n //}, 500);\n }\n };\n\n const saveSearch = () => {\n if (term.value.length > 1) {\n let search = ls.get('search') ? ls.get('search') : [];\n\n if (search.indexOf(term.value) !== -1) {\n search = search.filter((item) => item !== term.value);\n }\n\n if (search.length > 4) {\n search = search.slice(0, 4);\n }\n\n search.unshift(term.value);\n\n ls.set('search', search);\n\n history.value = search;\n }\n };\n\n const setSearchHistory = (term) => {\n term.value = term;\n };\n\n const clearSearchHistory = (event) => {\n ls.remove('search');\n\n history.value = [];\n\n input.value.focus();\n };\n\n onBeforeUpdate(() => {\n refs = [];\n });\n\n watch(\n () => term.value,\n () => {\n isDropdown.value = true;\n current.value = -1;\n search();\n }\n );\n\n const searchUrl = computed(() => {\n return term.value ? $env.locale.url + '/search' + searchHrefWithParameter.value : $env.locale.url + '/search';\n });\n\n const searchHrefWithParameter = computed(() => {\n return props.parameter.replace('{separator}', separator.value) + term.value.toLowerCase();\n });\n\n const preventCaret = (event) => {\n if (event.which == 38 || event.which == 40 || (event.which == 32 && current.value >= 0)) {\n event.preventDefault();\n }\n };\n\n const next = () => {\n if (current.value < results.value.length - 1) {\n current.value++;\n }\n };\n\n const prev = () => {\n if (current.value >= 0) {\n current.value--;\n }\n };\n\n const add = (event) => {\n if (current.value >= 0) {\n event.preventDefault();\n\n refs[current.value].add();\n }\n };\n\n const open = () => {\n if (current.value >= 0) {\n window.location.href = results.value[current.value].href;\n } else {\n window.location.href = searchUrl.value;\n }\n };\n\n const esc = (event) => {\n input.value.blur();\n close(event);\n };\n\n const cartRefs = (el) => {\n if (el) {\n refs.push(el);\n }\n };\n\n const close = (event) => {\n if (!event.target.closest('.cart')) {\n isDropdown.value = false;\n current.value = -1;\n }\n };\n\n const dropdown = () => {\n isDropdown.value = true;\n current.value = -1;\n };\n\n window.addEventListener('click', close);\n\n const categories = computed(() => {\n return term.value.length > 3 ? menu.value.filter((item) => item.search.indexOf(term.value) !== -1) : [];\n });\n\n const load = async () => {\n const menuElement = document.getElementById('menu');\n\n if (menuElement) {\n menuElement.querySelectorAll('[data-search]').forEach((element) => {\n const name = element.textContent.trim();\n const data = element.dataset.search;\n\n menu.value.push({\n name: (data ? data + ' / ' : '') + name,\n search: name.toLowerCase(),\n href: element.closest('a').href\n });\n });\n }\n\n if (props.q) {\n search();\n }\n };\n\n document.addEventListener('DOMContentLoaded', load, false);\n\n return {\n isLoading,\n term,\n results,\n next,\n prev,\n current,\n add,\n cartRefs,\n isDropdown,\n preventCaret,\n esc,\n input,\n dropdown,\n total,\n searchUrl,\n searchHrefWithParameter,\n open,\n categories,\n byCategory,\n dropdownContent,\n history,\n clearSearchHistory,\n setSearchHistory,\n user\n };\n }\n});\n</script>"],"names":["script","defineComponent","name","props","q","type","String","default","placeholder","parameter","setup","ls","SecureLS","isCompression","encoder","document","createElement","innerHTML","value","isLoading","ref","term","results","byCategory","total","current","isDropdown","input","separator","dropdownContent","history","get","menu","store","useStore","user","computed","getters","refs","search","clearTimeout","timeout","trim","api","shop","then","response","data","saveSearch","products","SimpleBar","finally","length","indexOf","filter","item","slice","unshift","set","onBeforeUpdate","watch","searchUrl","$env","locale","url","searchHrefWithParameter","replace","toLowerCase","close","event","target","closest","window","addEventListener","categories","load","direct","menuElement","getElementById","querySelectorAll","forEach","element","textContent","dataset","push","href","resolve","args","i","arguments","Promise","reject","e","next","prev","add","preventDefault","cartRefs","el","preventCaret","which","esc","blur","dropdown","open","location","clearSearchHistory","remove","focus","setSearchHistory","_hoisted_1","class","_hoisted_3","_createElementVNode","createElementVNode","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_11","_hoisted_12","style","max-height","overflow","_hoisted_18","_hoisted_21","_hoisted_25","_hoisted_27","_hoisted_28","_hoisted_33","_hoisted_39","_hoisted_40","_createElementBlock","createElementBlock","onClick","_cache","$event","stopPropagation","_ctx","_normalizeClass","onKeyup","apply","_withKeys","withKeys","onKeydown","_renderSlot","$slots","_withDirectives","_hoisted_5","_openBlock","_hoisted_6","__","_Fragment","_renderList","renderList","index","key","_hoisted_10","withDirectives","_hoisted_13","openBlock","_hoisted_14","Fragment","_toDisplayString","toDisplayString","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_19","count","_hoisted_20","_hoisted_22","_hoisted_23","_hoisted_24","is-active","id","renderSlot","data-code","code","shop-product","shop-product-name","_hoisted_29","price","shop-product-price","price_old","_hoisted_31","quantity","_hoisted_34","_hoisted_35","is_eol","_hoisted_37","_hoisted_36","_createVNode","_component_cart_add","is-change-quantity","is-already-in-cart","product","_hoisted_38"],"mappings":"kOA4HA,IAAeA,EAAcC,kBAAgB,CACzCC,KAAM,SACNC,MAAO,CACHC,EAAG,CACCC,KAAMC,OACNC,QAAS,IAEbC,YAAa,CACTH,KAAMC,OACNC,QAAS,IAEbE,UAAW,CACPJ,KAAMC,OACNC,QAAS,kBAGjBG,MAAK,SAACP,GACF,IAAMQ,EAAK,IAAIC,UAAS,CACpBC,eAAe,IAGfT,EAAID,EAAMC,EAEd,GAAIA,EAAG,CACH,IAAIU,EAAUC,SAASC,cAAc,YACrCF,EAAQG,UAAYb,EACpBA,EAAIU,EAAQI,MAGhB,IAAMC,EAAYC,OAAI,GAChBC,EAAOD,MAAIhB,GACXkB,EAAUF,MAAI,IACdG,EAAaH,MAAI,IACjBI,EAAQJ,MAAI,GACZK,EAAUL,EAAAA,KAAK,GACfM,EAAaN,OAAI,GACjBO,EAAQP,EAAAA,MACRQ,EAAYR,MAAI,IAChBS,EAAkBT,EAAAA,MAClBU,EAAUV,EAAAA,IAAIT,EAAGoB,IAAI,WACrBC,EAAOZ,MAAI,IACXa,EAAQC,EAAAA,WACRC,EAAOC,EAAAA,UAAS,WAAA,OAAMH,EAAMI,QAAQ,cAEtCC,EAAO,GAGLC,EAAS,WACXC,kBAHAC,GAKAhB,EAAQP,OAAS,EAEZG,EAAKH,MAAMwB,QAIZvB,EAAUD,OAAQ,EAGdG,EAAKH,MAAMwB,QACXC,EAAGC,KAACL,OAAOlB,EAAKH,OACX2B,MAAK,SAACC,GACCA,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