@perevorot/shop 2.0.3 → 2.0.4

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(),document.documentElement.classList.remove("is-catalog-loading"),c()},r=function(r,c){var i=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")}(r),u=function(e){return e.replace(/[^a-z0-9]/g,"")}(i);-1===n.indexOf(u)?(document.documentElement.classList.add("is-catalog-loading"),$http.get(i).then((function(i){var l=document.createElement("html");l.innerHTML=i.data.page,window.app.component(u,{template:l.querySelector("#subcategory").innerHTML}),o(),n.push(u),t.value=u,c||history.pushState({urlPath:r.href},document.title,r.href),e.nextTick(a)})).catch((function(e){console.error(e)})).finally((function(){document.documentElement.classList.remove("is-catalog-loading")}))):(o(),t.value=u,c||history.pushState({urlPath:r.href},document.title,r.href),e.nextTick(a))},c=function(){document.querySelectorAll("[shop-filter] a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),r(e)}))}))},i=function(){var e=document.createElement("a");e.href=window.location.href,r(e,!0)};return window.addEventListener("DOMContentLoaded",(function(){c(),window.addEventListener("popstate",(function(){i()})),window.location.hash&&i()})),{page:t}}});t.render=function(t,n,o,a,r,c){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=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(),document.documentElement.classList.remove("is-catalog-loading"),i()},r=function(r,i){var c=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 $env.shop.isTrailingSlash&&(n=n.replace(/\/$/,"")+"/"),e.origin+n+(e.search?e.search+"&filter":"?filter")}(r),l=function(e){return e.replace(/[^a-z0-9]/g,"")}(c);-1===n.indexOf(l)?(document.documentElement.classList.add("is-catalog-loading"),$http.get(c).then((function(c){var u=document.createElement("html");u.innerHTML=c.data.page,window.app.component(l,{template:u.querySelector("#subcategory").innerHTML}),o(),n.push(l),t.value=l,i||history.pushState({urlPath:r.href},document.title,r.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:r.href},document.title,r.href),e.nextTick(a))},i=function(){document.querySelectorAll("[shop-filter] a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),r(e)}))}))},c=function(){var e=document.createElement("a");e.href=window.location.href,r(e,!0)};return window.addEventListener("DOMContentLoaded",(function(){i(),window.addEventListener("popstate",(function(){c()})),window.location.hash&&c()})),{page:t}}});t.render=function(t,n,o,a,r,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/components/shop/Catalog.vue","../../../src/components/shop/Catalog.vue?vue&type=template&id=dc5ff766&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } 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 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] 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.addEventListener('DOMContentLoaded', () => {\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 } 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 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] 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.addEventListener('DOMContentLoaded', () => {\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":["defineComponent","name","setup","page","ref","pages","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","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","error","console","addEventListener","e","preventDefault","refresh","location","_createBlock","_ctx"],"mappings":"oCAMeA,kBAAgB,CAC3BC,KAAM,UACNC,qBACUC,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,SAGtBZ,SAASa,gBAAgBC,UAAUV,OAAO,sBAE1CW,KAUEC,EAAM,SAACC,EAAGC,OACNC,EARc,SAACF,OACfG,EAAOH,EAAEG,KAAOH,EAAEG,KAAKC,UAAU,GAAK,GACtCC,EAAWF,GAAqC,IAA7BH,EAAEK,SAASC,QAAQ,KAAcN,EAAEK,SAAW,IAAMF,EAAOH,EAAEK,SAAW,IAAMF,EAAQH,EAAEK,gBAE1GL,EAAEO,OAASF,GAAYL,EAAEQ,OAASR,EAAEQ,OAAS,UAAY,WAInDC,CAAgBT,GAEvBU,EApCU,SAACR,UACVA,EAAKS,QAAQ,aAAc,IAmCZC,CAAYV,IAEI,IAAlCrB,EAAMyB,QAAQI,IACd3B,SAASa,gBAAgBC,UAAUgB,IAAI,sBAEvCC,MACKf,IAAIG,GACJa,MAAK,SAACC,OACCC,EAAOlC,SAASmC,cAAc,QAElCD,EAAKE,UAAYH,EAASI,KAAKzC,KAE/BU,OAAOgC,IAAIC,UAAUZ,EAAe,CAChCa,SAAUN,EAAKO,cAAc,gBAAgBL,YAGjDrC,IAEAD,EAAM4C,KAAKf,GAEX/B,EAAK+C,MAAQhB,EAERT,GACD0B,QAAQC,UAAU,CAAEC,QAAS7B,EAAEE,MAAQnB,SAAS+C,MAAO9B,EAAEE,MAG7D6B,WAAS3C,aAEN,SAAC4C,GACJC,QAAQD,MAAMA,eAET,WACLjD,SAASa,gBAAgBC,UAAUV,OAAO,2BAGlDL,IAEAH,EAAK+C,MAAQhB,EAERT,GACD0B,QAAQC,UAAU,CAAEC,QAAS7B,EAAEE,MAAQnB,SAAS+C,MAAO9B,EAAEE,MAG7D6B,WAAS3C,KAIXU,EAAO,WACTf,SAASC,iBAAiB,mBAAmBC,SAAQ,SAACe,GAClDA,EAAEkC,iBAAiB,SAAS,SAACC,GACzBA,EAAEC,iBAEFrC,EAAIC,UAKVqC,EAAU,eACNrC,EAAIjB,SAASmC,cAAc,KACjClB,EAAEE,KAAOb,OAAOiD,SAASpC,KAEzBH,EAAIC,GAAG,WAGXX,OAAO6C,iBAAiB,oBAAoB,WACxCpC,IAEAT,OAAO6C,iBAAiB,YAAY,WAChCG,OAGAhD,OAAOiD,SAASnC,MAChBkC,OAID,CACH1D,KAAAA,0DC5HR4D,wCAAgBC"}
1
+ {"version":3,"file":"Catalog.js","sources":["../../../src/components/shop/Catalog.vue","../../../src/components/shop/Catalog.vue?vue&type=template&id=6334ff0d&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } 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 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 let pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname.replace(/\\/$/, '') + '/';\n }\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] 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.addEventListener('DOMContentLoaded', () => {\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 } 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 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 let pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname.replace(/\\/$/, '') + '/';\n }\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] 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.addEventListener('DOMContentLoaded', () => {\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":["defineComponent","name","setup","page","ref","pages","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","documentElement","classList","init","get","a","ignoreHistory","href","hash","substring","pathname","indexOf","$env","shop","isTrailingSlash","replace","origin","search","parseFilterHref","componentName","getPageName","add","$http","then","response","html","createElement","innerHTML","data","app","component","template","querySelector","push","value","history","pushState","urlPath","title","nextTick","error","console","addEventListener","e","preventDefault","refresh","location","_createBlock","_ctx"],"mappings":"oCAMeA,kBAAgB,CAC3BC,KAAM,UACNC,qBACUC,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,SAGtBZ,SAASa,gBAAgBC,UAAUV,OAAO,sBAE1CW,KAcEC,EAAM,SAACC,EAAGC,OACNC,EAZc,SAACF,OACfG,EAAOH,EAAEG,KAAOH,EAAEG,KAAKC,UAAU,GAAK,GACxCC,EAAWF,GAAqC,IAA7BH,EAAEK,SAASC,QAAQ,KAAcN,EAAEK,SAAW,IAAMF,EAAOH,EAAEK,SAAW,IAAMF,EAAQH,EAAEK,gBAE3GE,KAAKC,KAAKC,kBACVJ,EAAWA,EAASK,QAAQ,MAAO,IAAM,KAGtCV,EAAEW,OAASN,GAAYL,EAAEY,OAASZ,EAAEY,OAAS,UAAY,WAInDC,CAAgBb,GAEvBc,EAxCU,SAACZ,UACVA,EAAKQ,QAAQ,aAAc,IAuCZK,CAAYb,IAEI,IAAlCrB,EAAMyB,QAAQQ,IACd/B,SAASa,gBAAgBC,UAAUmB,IAAI,sBAEvCC,MACKlB,IAAIG,GACJgB,MAAK,SAACC,OACCC,EAAOrC,SAASsC,cAAc,QAElCD,EAAKE,UAAYH,EAASI,KAAK5C,KAE/BU,OAAOmC,IAAIC,UAAUX,EAAe,CAChCY,SAAUN,EAAKO,cAAc,gBAAgBL,YAGjDxC,IAEAD,EAAM+C,KAAKd,GAEXnC,EAAKkD,MAAQf,EAERb,GACD6B,QAAQC,UAAU,CAAEC,QAAShC,EAAEE,MAAQnB,SAASkD,MAAOjC,EAAEE,MAG7DgC,WAAS9C,aAEN,SAAC+C,GACJC,QAAQD,MAAMA,eAET,WACLpD,SAASa,gBAAgBC,UAAUV,OAAO,2BAGlDL,IAEAH,EAAKkD,MAAQf,EAERb,GACD6B,QAAQC,UAAU,CAAEC,QAAShC,EAAEE,MAAQnB,SAASkD,MAAOjC,EAAEE,MAG7DgC,WAAS9C,KAIXU,EAAO,WACTf,SAASC,iBAAiB,mBAAmBC,SAAQ,SAACe,GAClDA,EAAEqC,iBAAiB,SAAS,SAACC,GACzBA,EAAEC,iBAEFxC,EAAIC,UAKVwC,EAAU,eACNxC,EAAIjB,SAASsC,cAAc,KACjCrB,EAAEE,KAAOb,OAAOoD,SAASvC,KAEzBH,EAAIC,GAAG,WAGXX,OAAOgD,iBAAiB,oBAAoB,WACxCvC,IAEAT,OAAOgD,iBAAiB,YAAY,WAChCG,OAGAnD,OAAOoD,SAAStC,MAChBqC,OAID,CACH7D,KAAAA,0DChIR+D,wCAAgBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perevorot/shop",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist/*"
@@ -25,6 +25,7 @@
25
25
  "dayjs": "^1.10.7",
26
26
  "formvuelate": "^3.8.1",
27
27
  "maska": "^1.5.0",
28
+ "rollup-plugin-vue": "^6.0.0",
28
29
  "secure-ls": "^1.2.6",
29
30
  "simplebar": "^5.3.6",
30
31
  "swiper": "^7.3.2",