@perevorot/shop 1.0.269 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/Account.js +2 -0
- package/dist/components/account/Account.js.map +1 -0
- package/dist/components/account/OrderItem.js +2 -0
- package/dist/components/account/OrderItem.js.map +1 -0
- package/dist/components/account/Orders.js +2 -0
- package/dist/components/account/Orders.js.map +1 -0
- package/dist/components/account/User.js +2 -0
- package/dist/components/account/User.js.map +1 -0
- package/dist/components/account/Viewed.js +2 -0
- package/dist/components/account/Viewed.js.map +1 -0
- package/dist/components/account/Wish.js +2 -0
- package/dist/components/account/Wish.js.map +1 -0
- package/dist/components/auth/Forget.js +2 -0
- package/dist/components/auth/Forget.js.map +1 -0
- package/dist/components/auth/Login.js +2 -0
- package/dist/components/auth/Login.js.map +1 -0
- package/dist/components/auth/Registration.js +2 -0
- package/dist/components/auth/Registration.js.map +1 -0
- package/dist/components/auth/Reset.js +2 -0
- package/dist/components/auth/Reset.js.map +1 -0
- package/dist/components/auth/User.js +2 -0
- package/dist/components/auth/User.js.map +1 -0
- package/dist/components/shop/Catalog.js +2 -0
- package/dist/components/shop/Catalog.js.map +1 -0
- package/dist/components/shop/CodeCopy.js +2 -0
- package/dist/components/shop/CodeCopy.js.map +1 -0
- package/dist/components/shop/Cross.js +2 -0
- package/dist/components/shop/Cross.js.map +1 -0
- package/dist/components/shop/FilterToggle.js +2 -0
- package/dist/components/shop/FilterToggle.js.map +1 -0
- package/dist/components/shop/Gallery.js +2 -0
- package/dist/components/shop/Gallery.js.map +1 -0
- package/dist/components/shop/Pagination.js +2 -0
- package/dist/components/shop/Pagination.js.map +1 -0
- package/dist/components/shop/PromoProducts.js +2 -0
- package/dist/components/shop/PromoProducts.js.map +1 -0
- package/dist/components/shop/Search.js +2 -0
- package/dist/components/shop/Search.js.map +1 -0
- package/dist/components/shop/bundle/Bundle.js +2 -0
- package/dist/components/shop/bundle/Bundle.js.map +1 -0
- package/dist/components/shop/bundle/BundleAdd.js +2 -0
- package/dist/components/shop/bundle/BundleAdd.js.map +1 -0
- package/dist/components/shop/cart/Cart.js +2 -0
- package/dist/components/shop/cart/Cart.js.map +1 -0
- package/dist/components/shop/cart/CartAdd.js +2 -0
- package/dist/components/shop/cart/CartAdd.js.map +1 -0
- package/dist/components/shop/cart/CartItem.js +2 -0
- package/dist/components/shop/cart/CartItem.js.map +1 -0
- package/dist/components/shop/cart/CartTrigger.js +2 -0
- package/dist/components/shop/cart/CartTrigger.js.map +1 -0
- package/dist/components/shop/cart/SuccessMessage.js +2 -0
- package/dist/components/shop/cart/SuccessMessage.js.map +1 -0
- package/dist/components/shop/compare/Compare.js +2 -0
- package/dist/components/shop/compare/Compare.js.map +1 -0
- package/dist/components/shop/compare/CompareAdd.js +2 -0
- package/dist/components/shop/compare/CompareAdd.js.map +1 -0
- package/dist/components/shop/compare/CompareDelete.js +2 -0
- package/dist/components/shop/compare/CompareDelete.js.map +1 -0
- package/dist/components/shop/compare/Comparsion.js +2 -0
- package/dist/components/shop/compare/Comparsion.js.map +1 -0
- package/dist/components/shop/compare/SuccessMessage.js +2 -0
- package/dist/components/shop/compare/SuccessMessage.js.map +1 -0
- package/dist/components/shop/filters/FilterSearch.js +2 -0
- package/dist/components/shop/filters/FilterSearch.js.map +1 -0
- package/dist/components/shop/filters/Price.js +2 -0
- package/dist/components/shop/filters/Price.js.map +1 -0
- package/dist/components/shop/order/Checkout.js +2 -0
- package/dist/components/shop/order/Checkout.js.map +1 -0
- package/dist/components/shop/order/CheckoutItem.js +2 -0
- package/dist/components/shop/order/CheckoutItem.js.map +1 -0
- package/dist/components/shop/order/OneClick.js +2 -0
- package/dist/components/shop/order/OneClick.js.map +1 -0
- package/dist/components/shop/order/shipping/CheckoutShippingCourier.js +2 -0
- package/dist/components/shop/order/shipping/CheckoutShippingCourier.js.map +1 -0
- package/dist/components/shop/order/shipping/CheckoutShippingNovaposhtaAddress.js +2 -0
- package/dist/components/shop/order/shipping/CheckoutShippingNovaposhtaAddress.js.map +1 -0
- package/dist/components/shop/order/shipping/CheckoutShippingNovaposhtaWarehouse.js +2 -0
- package/dist/components/shop/order/shipping/CheckoutShippingNovaposhtaWarehouse.js.map +1 -0
- package/dist/components/shop/order/shipping/CheckoutShippingPickup.js +2 -0
- package/dist/components/shop/order/shipping/CheckoutShippingPickup.js.map +1 -0
- package/dist/components/shop/reviews/Review.js +2 -0
- package/dist/components/shop/reviews/Review.js.map +1 -0
- package/dist/components/shop/viewed/Viewed.js +2 -0
- package/dist/components/shop/viewed/Viewed.js.map +1 -0
- package/dist/components/shop/viewed/ViewedDelete.js +2 -0
- package/dist/components/shop/viewed/ViewedDelete.js.map +1 -0
- package/dist/components/shop/viewed/Viewer.js +2 -0
- package/dist/components/shop/viewed/Viewer.js.map +1 -0
- package/dist/components/shop/wishlist/SuccessMessage.js +2 -0
- package/dist/components/shop/wishlist/SuccessMessage.js.map +1 -0
- package/dist/components/shop/wishlist/Wishlist.js +2 -0
- package/dist/components/shop/wishlist/Wishlist.js.map +1 -0
- package/dist/components/shop/wishlist/WishlistAdd.js +2 -0
- package/dist/components/shop/wishlist/WishlistAdd.js.map +1 -0
- package/dist/components/shop/wishlist/WishlistDelete.js +2 -0
- package/dist/components/shop/wishlist/WishlistDelete.js.map +1 -0
- package/dist/forms/FormCheckbox.js +2 -0
- package/dist/forms/FormCheckbox.js.map +1 -0
- package/dist/forms/FormCheckboxes.js +2 -0
- package/dist/forms/FormCheckboxes.js.map +1 -0
- package/dist/forms/FormPassword.js +2 -0
- package/dist/forms/FormPassword.js.map +1 -0
- package/dist/forms/FormRadio.js +2 -0
- package/dist/forms/FormRadio.js.map +1 -0
- package/dist/forms/FormRating.js +2 -0
- package/dist/forms/FormRating.js.map +1 -0
- package/dist/forms/FormSection.js +2 -0
- package/dist/forms/FormSection.js.map +1 -0
- package/dist/forms/FormSelect.js +2 -0
- package/dist/forms/FormSelect.js.map +1 -0
- package/dist/forms/FormSwitch.js +2 -0
- package/dist/forms/FormSwitch.js.map +1 -0
- package/dist/forms/FormText.js +2 -0
- package/dist/forms/FormText.js.map +1 -0
- package/dist/forms/FormTextarea.js +2 -0
- package/dist/forms/FormTextarea.js.map +1 -0
- package/package.json +16 -41
- package/dist/app.js +0 -108
- package/dist/index.js +0 -110
|
@@ -0,0 +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;
|
|
2
|
+
//# sourceMappingURL=Catalog.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),o=require("vue-toastification");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(require("copy-to-clipboard"));function n(e,o,t){return o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}var a=o.useToast(),l=e.defineComponent({name:"code-copy",props:{code:{type:String,default:""},className:{type:String,default:""}},setup:function(o){var t,l=o.code,c=o.className,u=e.ref(!1),i=__("shop.copy"),p=e.ref(!1),s=e.ref(null);return n(t={code:l,copyLabel:i,isHovered:u,className:c},"isHovered",u),n(t,"style",p),n(t,"enter",(function(){p.value={width:s.value.offsetWidth+"px"},u.value=!0})),n(t,"leave",(function(){u.value=!1})),n(t,"copyToClipboard",(function(){r.default(l),a(__("shop.copied",{code:l}),{type:"success"})})),n(t,"wrapper",s),t}}),c={key:0};l.render=function(o,t,r,n,a,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["shop-code",o.className]),onMouseenter:t[0]||(t[0]=function(){return o.enter&&o.enter.apply(o,arguments)}),onMouseleave:t[1]||(t[1]=function(){return o.leave&&o.leave.apply(o,arguments)}),onClick:t[2]||(t[2]=function(){return o.copyToClipboard&&o.copyToClipboard.apply(o,arguments)}),style:e.normalizeStyle(o.style),ref:"wrapper"},[o.isHovered?(e.openBlock(),e.createElementBlock("span",c,e.toDisplayString(o.copyLabel),1)):e.renderSlot(o.$slots,"default",{key:1,code:o.code},(function(){return[e.createTextVNode(e.toDisplayString(o.code),1)]}))],38)},module.exports=l;
|
|
2
|
+
//# sourceMappingURL=CodeCopy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeCopy.js","sources":["../../../src/components/shop/CodeCopy.vue","../../../src/components/shop/CodeCopy.vue?vue&type=template&id=b4125d18&lang.js"],"sourcesContent":["<template>\n <div\n class=\"shop-code\"\n v-bind:class=\"className\"\n v-on:mouseenter=\"enter\"\n v-on:mouseleave=\"leave\"\n v-on:click=\"copyToClipboard\"\n v-bind:style=\"style\"\n ref=\"wrapper\"\n >\n <span v-if=\"isHovered\">{{ copyLabel }}</span>\n <slot :code=\"code\" v-else>\n {{ code }}\n </slot>\n </div>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport { useToast } from \"vue-toastification\";\nimport copy from \"copy-to-clipboard\";\n\nconst toast = useToast();\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"code-copy\",\n props: {\n code: {\n type: String,\n default: \"\",\n },\n className: {\n type: String,\n default: \"\",\n },\n },\n setup(props) {\n const code = props.code;\n const className = props.className;\n const isHovered = ref(false);\n const copyLabel = __(\"shop.copy\");\n const style = ref(false);\n const wrapper = ref(null);\n\n const copyToClipboard = () => {\n copy(code);\n\n toast(__(\"shop.copied\", { code: code }), {\n type: \"success\",\n });\n };\n\n const enter = () => {\n style.value = {\n width: wrapper.value.offsetWidth + \"px\",\n };\n\n isHovered.value = true;\n };\n\n const leave = () => {\n isHovered.value = false;\n };\n\n return {\n code,\n copyLabel,\n isHovered,\n className,\n isHovered,\n style,\n enter,\n leave,\n copyToClipboard,\n wrapper,\n };\n },\n});\n</script>","<template>\n <div\n class=\"shop-code\"\n v-bind:class=\"className\"\n v-on:mouseenter=\"enter\"\n v-on:mouseleave=\"leave\"\n v-on:click=\"copyToClipboard\"\n v-bind:style=\"style\"\n ref=\"wrapper\"\n >\n <span v-if=\"isHovered\">{{ copyLabel }}</span>\n <slot :code=\"code\" v-else>\n {{ code }}\n </slot>\n </div>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport { useToast } from \"vue-toastification\";\nimport copy from \"copy-to-clipboard\";\n\nconst toast = useToast();\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"code-copy\",\n props: {\n code: {\n type: String,\n default: \"\",\n },\n className: {\n type: String,\n default: \"\",\n },\n },\n setup(props) {\n const code = props.code;\n const className = props.className;\n const isHovered = ref(false);\n const copyLabel = __(\"shop.copy\");\n const style = ref(false);\n const wrapper = ref(null);\n\n const copyToClipboard = () => {\n copy(code);\n\n toast(__(\"shop.copied\", { code: code }), {\n type: \"success\",\n });\n };\n\n const enter = () => {\n style.value = {\n width: wrapper.value.offsetWidth + \"px\",\n };\n\n isHovered.value = true;\n };\n\n const leave = () => {\n isHovered.value = false;\n };\n\n return {\n code,\n copyLabel,\n isHovered,\n className,\n isHovered,\n style,\n enter,\n leave,\n copyToClipboard,\n wrapper,\n };\n },\n});\n</script>"],"names":["toast","useToast","defineComponent","name","props","code","type","String","className","setup","isHovered","ref","copyLabel","__","style","wrapper","value","width","offsetWidth","copy","_createElementBlock","_ctx","onMouseenter","onMouseleave","onClick","_renderSlot"],"mappings":"wSAqBA,IAAMA,EAAQC,eAEeC,kBAAgB,CACzCC,KAAM,YACNC,MAAO,CACHC,KAAM,CACFC,KAAMC,eACG,IAEbC,UAAW,CACPF,KAAMC,eACG,KAGjBE,eAAML,SACIC,EAAOD,EAAMC,KACbG,EAAYJ,EAAMI,UAClBE,EAAYC,OAAI,GAChBC,EAAYC,GAAG,aACfC,EAAQH,OAAI,GACZI,EAAUJ,MAAI,kBAuBhBN,KAAAA,EACAO,UAAAA,EACAF,UAAAA,EACAF,UAAAA,eACAE,eACAI,gBAlBU,WACVA,EAAME,MAAQ,CACVC,MAAOF,EAAQC,MAAME,YAAc,MAGvCR,EAAUM,OAAQ,kBAGR,WACVN,EAAUM,OAAQ,4BAjBE,WACpBG,UAAKd,GAELL,EAAMa,GAAG,cAAe,CAAER,KAAMA,IAAS,CACrCC,KAAM,6BA0BVS,sECxERK,oDACU,YACQC,cACTC,2CAAYD,sCACZE,2CAAYF,sCACZG,sCAAOH,0DACLP,uBAAOO,SACdV,IAAI,YAEQU,2BAAZD,gDAA0BC,iBAC1BI,uCAAOpB,KAAMgB,SAAb,sDACOA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),i=require("swiper/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(i);t.default.use([i.Navigation,i.Mousewheel]);var o=e.defineComponent({name:"cross",setup:function(){window.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("cross-sale"),i=e.querySelectorAll(".swiper-container"),n=e.querySelectorAll("li"),o=[];n.forEach((function(e,r){e.addEventListener("click",(function(){if(n.forEach((function(e){e.classList.remove("is-active")})),i.forEach((function(e){e.classList.add("is-hidden")})),i[r].classList.remove("is-hidden"),e.classList.add("is-active"),!o[r]){var s=window.crossSaleSwiperOptions?window.crossSaleSwiperOptions:{slidesPerView:5,spaceBetween:24,freeMode:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}};o[r]=new t.default(i[r],s)}o[r].slideTo(0)}))})),n[0].click()}))}});o.render=function(e,i,n,t,o,r){return null},module.exports=o;
|
|
2
|
+
//# sourceMappingURL=Cross.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cross.js","sources":["../../../src/components/shop/Cross.vue"],"sourcesContent":["<template></template>\n<script>\nimport { defineComponent } from \"vue\";\nimport SwiperCore, { Navigation, Mousewheel } from \"swiper/core\";\n\nSwiperCore.use([Navigation, Mousewheel]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"cross\",\n setup() {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const container = document.getElementById(\"cross-sale\");\n const sliders = container.querySelectorAll(\".swiper-container\");\n const tabs = container.querySelectorAll(\"li\");\n let inited = [];\n\n tabs.forEach((li, index) => {\n li.addEventListener(\"click\", () => {\n tabs.forEach((li) => {\n li.classList.remove(\"is-active\");\n });\n\n sliders.forEach((slider) => {\n slider.classList.add(\"is-hidden\");\n });\n\n sliders[index].classList.remove(\"is-hidden\");\n li.classList.add(\"is-active\");\n\n if (!inited[index]) {\n const options = window.crossSaleSwiperOptions\n ? window.crossSaleSwiperOptions\n : {\n slidesPerView: 5,\n spaceBetween: 24,\n freeMode: true,\n mousewheel: {\n forceToAxis: true,\n },\n navigation: {\n nextEl: \".swiper-button-next\",\n prevEl: \".swiper-button-prev\",\n },\n };\n\n inited[index] = new SwiperCore(sliders[index], options);\n }\n\n inited[index].slideTo(0);\n });\n });\n\n tabs[0].click();\n });\n },\n});\n</script>"],"names":["SwiperCore","use","Navigation","Mousewheel","defineComponent","name","setup","window","addEventListener","container","document","getElementById","sliders","querySelectorAll","tabs","inited","forEach","li","index","classList","remove","slider","add","options","crossSaleSwiperOptions","slidesPerView","spaceBetween","freeMode","mousewheel","forceToAxis","navigation","nextEl","prevEl","slideTo","click"],"mappings":"8IAKAA,UAAWC,IAAI,CAACC,aAAYC,eAE5B,MAA6BC,kBAAgB,CACzCC,KAAM,QACNC,iBACIC,OAAOC,iBAAiB,oBAAoB,eAClCC,EAAYC,SAASC,eAAe,cACpCC,EAAUH,EAAUI,iBAAiB,qBACrCC,EAAOL,EAAUI,iBAAiB,MACpCE,EAAS,GAEbD,EAAKE,SAAQ,SAACC,EAAIC,GACdD,EAAGT,iBAAiB,SAAS,cACzBM,EAAKE,SAAQ,SAACC,GACVA,EAAGE,UAAUC,OAAO,gBAGxBR,EAAQI,SAAQ,SAACK,GACbA,EAAOF,UAAUG,IAAI,gBAGzBV,EAAQM,GAAOC,UAAUC,OAAO,aAChCH,EAAGE,UAAUG,IAAI,cAEZP,EAAOG,GAAQ,KACVK,EAAUhB,OAAOiB,uBACjBjB,OAAOiB,uBACP,CACIC,cAAe,EACfC,aAAc,GACdC,UAAU,EACVC,WAAY,CACRC,aAAa,GAEjBC,WAAY,CACRC,OAAQ,sBACRC,OAAQ,wBAItBjB,EAAOG,GAAS,IAAIlB,UAAWY,EAAQM,GAAQK,GAGnDR,EAAOG,GAAOe,QAAQ,SAI9BnB,EAAK,GAAGoB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("secure-ls"),t=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(e);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,l=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(l.push(n.value),!t||l.length!==t);i=!0);}catch(e){u=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return l}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var i={name:"filter-toggle",setup:function(){t.onMounted((function(){var e=new n.default({isCompression:!1}),t=e.get("filter");t||(t={brand:!0,category:!0,price:!0},e.set("filter",t));for(var r=0,l=Object.entries(t);r<l.length;r++){var i=o(l[r],2),u=i[0];i[1];var a=document.querySelector('[shop-filter][data-code="'+u+'"]');a&&a.classList.remove("is-toggled")}document.querySelectorAll("[shop-filter-title]").forEach((function(r){r.addEventListener("click",(function(){var n=r.closest("[shop-filter]").dataset.code;t[n]?delete t[n]:t[n]=!0,r.closest("[shop-filter]").classList.toggle("is-toggled"),e.set("filter",t)}))}))}))}};i.render=function(e,t,r,n,o,l){return null},module.exports=i;
|
|
2
|
+
//# sourceMappingURL=FilterToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterToggle.js","sources":["../../../src/components/shop/FilterToggle.vue"],"sourcesContent":["<template></template>\n<script>\nimport SecureLS from 'secure-ls';\nimport { onMounted } from 'vue';\n\nexport default {\n name: 'filter-toggle',\n setup() {\n onMounted(() => {\n let ls = new SecureLS({\n isCompression: false\n });\n\n let filter = ls.get('filter');\n\n if (!filter) {\n filter = {\n brand: true,\n category: true,\n price: true\n };\n\n ls.set('filter', filter);\n }\n\n for (const [code, value] of Object.entries(filter)) {\n const group = document.querySelector('[shop-filter][data-code=\"' + code + '\"]');\n\n if (group) {\n group.classList.remove('is-toggled');\n }\n }\n\n document.querySelectorAll('[shop-filter-title]').forEach((head) => {\n head.addEventListener('click', () => {\n const code = head.closest('[shop-filter]').dataset.code;\n\n if (!filter[code]) {\n filter[code] = true;\n } else {\n delete filter[code];\n }\n\n head.closest('[shop-filter]').classList.toggle('is-toggled');\n ls.set('filter', filter);\n });\n });\n });\n }\n};\n</script>"],"names":["name","setup","onMounted","ls","SecureLS","isCompression","filter","get","brand","category","price","set","Object","entries","code","group","document","querySelector","classList","remove","querySelectorAll","forEach","head","addEventListener","closest","dataset","toggle"],"mappings":"4lCAKA,MAAe,CACXA,KAAM,gBACNC,iBACIC,aAAU,eACFC,EAAK,IAAIC,UAAS,CAClBC,eAAe,IAGfC,EAASH,EAAGI,IAAI,UAEfD,IACDA,EAAS,CACLE,OAAO,EACPC,UAAU,EACVC,OAAO,GAGXP,EAAGQ,IAAI,SAAUL,kBAGOM,OAAOC,QAAQP,kBAAS,iBAAxCQ,gBACFC,EAAQC,SAASC,cAAc,4BAA8BH,EAAO,MAEtEC,GACAA,EAAMG,UAAUC,OAAO,cAI/BH,SAASI,iBAAiB,uBAAuBC,SAAQ,SAACC,GACtDA,EAAKC,iBAAiB,SAAS,eACrBT,EAAOQ,EAAKE,QAAQ,iBAAiBC,QAAQX,KAE9CR,EAAOQ,UAGDR,EAAOQ,GAFdR,EAAOQ,IAAQ,EAKnBQ,EAAKE,QAAQ,iBAAiBN,UAAUQ,OAAO,cAC/CvB,EAAGQ,IAAI,SAAUL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),t=require("swiper/core");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(t);i.default.use([t.Navigation,t.Mousewheel,t.Thumbs]);var o=e.defineComponent({name:"gallery",props:{thumbsDirection:{type:String,default:"horizontal"},fullscreenThumbsDirection:{type:String,default:"horizontal"},prev:{type:String,default:".swiper-button-prev"},next:{type:String,default:".swiper-button-next"},thumbPrev:{type:String,default:".swiper-button-prev"},thumbNext:{type:String,default:".swiper-button-next"},fullscreen:{type:Boolean,default:!1},isResizeThumbs:{type:Boolean,default:!1},thumbsSpaceBetween:{type:Number,default:10}},setup:function(t){var n,o,r,u,l,s=e.ref(!1),a=function(){document.body.classList.remove("product-gallery-modal-open"),s.value=!1,d("close"),t.isResizeThumbs&&p()},c=function(){document.body.classList.add("product-gallery-modal-open"),s.value=!0,d("open")},d=function(e){o&&(t.thumbsDirection!=t.fullscreenThumbsDirection?u.changeDirection("open"==e?t.fullscreenThumbsDirection:t.thumbsDirection):u.update()),l.update()};window.addEventListener("keyup",(function(e){s.value&&"Escape"===e.key&&a()}));var p=function(){o.style.height=parseInt(r.offsetHeight)+"px",u.update()},m=function(){clearTimeout(n),n=setTimeout((function(){p()}),500)};return document.addEventListener("DOMContentLoaded",(function(){if(o=document.getElementById("product-gallery-thumbs"),r=document.getElementById("product-gallery"),o&&(u=new i.default(o,{spaceBetween:t.thumbsSpaceBetween,slidesPerView:"auto",mousewheel:{forceToAxis:!0},freeMode:!0,watchSlidesVisibility:!0,watchSlidesProgress:!0,direction:t.thumbsDirection,navigation:{nextEl:t.thumbNext,prevEl:t.thumbPrev}}),t.isResizeThumbs&&(window.addEventListener("resize",m),p()),o.classList.remove("not-inited")),t.fullscreen&&r.addEventListener("click",c),r){var e={spaceBetween:10,mousewheel:{forceToAxis:!0},centeredSlides:!0,navigation:{nextEl:t.next,prevEl:t.prev}};u&&(e.thumbs={swiper:u}),l=new i.default(r,e)}d("close")}),!1),{modal:s,close:a}}});o.render=function(t,n,i,o,r,u){return t.fullscreen?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["delete is-large",{"is-hidden":!t.modal}]),onClick:n[0]||(n[0]=function(){return t.close&&t.close.apply(t,arguments)})},null,2)):e.createCommentVNode("v-if",!0)},module.exports=o;
|
|
2
|
+
//# sourceMappingURL=Gallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gallery.js","sources":["../../../src/components/shop/Gallery.vue","../../../src/components/shop/Gallery.vue?vue&type=template&id=09dbf38c&lang.js"],"sourcesContent":["<template>\n <button\n class=\"delete is-large\"\n @click=\"close\"\n v-if=\"fullscreen\"\n v-bind:class=\"{ 'is-hidden': !modal }\"\n ></button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport SwiperCore, { Navigation, Mousewheel, Thumbs } from \"swiper/core\";\n\nSwiperCore.use([Navigation, Mousewheel, Thumbs]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"gallery\",\n props: {\n thumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n fullscreenThumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n fullscreen: {\n type: Boolean,\n default: false,\n },\n isResizeThumbs: {\n type: Boolean,\n default: false,\n },\n thumbsSpaceBetween: {\n type: Number,\n default: 10,\n },\n },\n setup(props) {\n const modal = ref(false);\n let resizeTimeout;\n let thumbs;\n let slider;\n let thumbsSwiper;\n let sliderSwiper;\n\n const close = () => {\n document.body.classList.remove(\"product-gallery-modal-open\");\n modal.value = false;\n\n update(\"close\");\n\n if (props.isResizeThumbs) {\n resizeThumbsSwiper();\n }\n };\n\n const open = () => {\n document.body.classList.add(\"product-gallery-modal-open\");\n modal.value = true;\n\n update(\"open\");\n };\n\n const update = (action) => {\n if (thumbs) {\n if (props.thumbsDirection != props.fullscreenThumbsDirection) {\n thumbsSwiper.changeDirection(\n action == \"open\"\n ? props.fullscreenThumbsDirection\n : props.thumbsDirection\n );\n } else {\n thumbsSwiper.update();\n }\n }\n\n sliderSwiper.update();\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n close();\n }\n });\n\n const resizeThumbsSwiper = () => {\n thumbs.style.height = parseInt(slider.offsetHeight) + \"px\";\n thumbsSwiper.update();\n };\n\n const resizeBounced = () => {\n clearTimeout(resizeTimeout);\n\n resizeTimeout = setTimeout(() => {\n resizeThumbsSwiper();\n }, 500);\n };\n\n const init = () => {\n thumbs = document.getElementById(\"product-gallery-thumbs\");\n slider = document.getElementById(\"product-gallery\");\n\n if (thumbs) {\n thumbsSwiper = new SwiperCore(thumbs, {\n spaceBetween: props.thumbsSpaceBetween,\n slidesPerView: \"auto\",\n mousewheel: {\n forceToAxis: true,\n },\n freeMode: true,\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n direction: props.thumbsDirection,\n navigation: {\n nextEl: props.thumbNext,\n prevEl: props.thumbPrev,\n },\n });\n\n if (props.isResizeThumbs) {\n window.addEventListener(\"resize\", resizeBounced);\n resizeThumbsSwiper();\n }\n\n thumbs.classList.remove(\"not-inited\");\n }\n\n if (props.fullscreen) {\n slider.addEventListener(\"click\", open);\n }\n\n if (slider) {\n let options = {\n spaceBetween: 10,\n mousewheel: {\n forceToAxis: true,\n },\n centeredSlides: true,\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n };\n\n if (thumbsSwiper) {\n options.thumbs = {\n swiper: thumbsSwiper,\n };\n }\n\n sliderSwiper = new SwiperCore(slider, options);\n }\n\n update(\"close\");\n };\n\n document.addEventListener(\"DOMContentLoaded\", init, false);\n\n return {\n modal,\n close,\n };\n },\n});\n</script>","<template>\n <button\n class=\"delete is-large\"\n @click=\"close\"\n v-if=\"fullscreen\"\n v-bind:class=\"{ 'is-hidden': !modal }\"\n ></button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport SwiperCore, { Navigation, Mousewheel, Thumbs } from \"swiper/core\";\n\nSwiperCore.use([Navigation, Mousewheel, Thumbs]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"gallery\",\n props: {\n thumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n fullscreenThumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n fullscreen: {\n type: Boolean,\n default: false,\n },\n isResizeThumbs: {\n type: Boolean,\n default: false,\n },\n thumbsSpaceBetween: {\n type: Number,\n default: 10,\n },\n },\n setup(props) {\n const modal = ref(false);\n let resizeTimeout;\n let thumbs;\n let slider;\n let thumbsSwiper;\n let sliderSwiper;\n\n const close = () => {\n document.body.classList.remove(\"product-gallery-modal-open\");\n modal.value = false;\n\n update(\"close\");\n\n if (props.isResizeThumbs) {\n resizeThumbsSwiper();\n }\n };\n\n const open = () => {\n document.body.classList.add(\"product-gallery-modal-open\");\n modal.value = true;\n\n update(\"open\");\n };\n\n const update = (action) => {\n if (thumbs) {\n if (props.thumbsDirection != props.fullscreenThumbsDirection) {\n thumbsSwiper.changeDirection(\n action == \"open\"\n ? props.fullscreenThumbsDirection\n : props.thumbsDirection\n );\n } else {\n thumbsSwiper.update();\n }\n }\n\n sliderSwiper.update();\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n close();\n }\n });\n\n const resizeThumbsSwiper = () => {\n thumbs.style.height = parseInt(slider.offsetHeight) + \"px\";\n thumbsSwiper.update();\n };\n\n const resizeBounced = () => {\n clearTimeout(resizeTimeout);\n\n resizeTimeout = setTimeout(() => {\n resizeThumbsSwiper();\n }, 500);\n };\n\n const init = () => {\n thumbs = document.getElementById(\"product-gallery-thumbs\");\n slider = document.getElementById(\"product-gallery\");\n\n if (thumbs) {\n thumbsSwiper = new SwiperCore(thumbs, {\n spaceBetween: props.thumbsSpaceBetween,\n slidesPerView: \"auto\",\n mousewheel: {\n forceToAxis: true,\n },\n freeMode: true,\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n direction: props.thumbsDirection,\n navigation: {\n nextEl: props.thumbNext,\n prevEl: props.thumbPrev,\n },\n });\n\n if (props.isResizeThumbs) {\n window.addEventListener(\"resize\", resizeBounced);\n resizeThumbsSwiper();\n }\n\n thumbs.classList.remove(\"not-inited\");\n }\n\n if (props.fullscreen) {\n slider.addEventListener(\"click\", open);\n }\n\n if (slider) {\n let options = {\n spaceBetween: 10,\n mousewheel: {\n forceToAxis: true,\n },\n centeredSlides: true,\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n };\n\n if (thumbsSwiper) {\n options.thumbs = {\n swiper: thumbsSwiper,\n };\n }\n\n sliderSwiper = new SwiperCore(slider, options);\n }\n\n update(\"close\");\n };\n\n document.addEventListener(\"DOMContentLoaded\", init, false);\n\n return {\n modal,\n close,\n };\n },\n});\n</script>"],"names":["SwiperCore","use","Navigation","Mousewheel","Thumbs","defineComponent","name","props","thumbsDirection","type","String","fullscreenThumbsDirection","prev","next","thumbPrev","thumbNext","fullscreen","Boolean","isResizeThumbs","thumbsSpaceBetween","Number","setup","resizeTimeout","thumbs","slider","thumbsSwiper","sliderSwiper","modal","ref","close","document","body","classList","remove","value","update","resizeThumbsSwiper","open","add","action","changeDirection","window","addEventListener","e","key","style","height","parseInt","offsetHeight","resizeBounced","clearTimeout","setTimeout","getElementById","spaceBetween","slidesPerView","mousewheel","forceToAxis","freeMode","watchSlidesVisibility","watchSlidesProgress","direction","navigation","nextEl","prevEl","options","centeredSlides","swiper","_ctx","_createElementBlock","onClick"],"mappings":"8IAYAA,UAAWC,IAAI,CAACC,aAAYC,aAAYC,WAExC,MAA6BC,kBAAgB,CACzCC,KAAM,UACNC,MAAO,CACHC,gBAAiB,CACbC,KAAMC,eACG,cAEbC,0BAA2B,CACvBF,KAAMC,eACG,cAEbE,KAAM,CACFH,KAAMC,eACG,uBAEbG,KAAM,CACFJ,KAAMC,eACG,uBAEbI,UAAW,CACPL,KAAMC,eACG,uBAEb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EAAQ,KACJwC,EAAU,CACVX,aAAc,GACdE,WAAY,CACRC,aAAa,GAEjBS,gBAAgB,EAChBJ,WAAY,CACRC,OAAQvD,EAAMM,KACdkD,OAAQxD,EAAMK,OAIlBa,IACAuC,EAAQzC,OAAS,CACb2C,OAAQzC,IAIhBC,EAAe,IAAI1B,UAAWwB,EAAQwC,GAG1C7B,EAAO,YAGyC,GAE7C,CACHR,MAAAA,EACAE,MAAAA,4CC7KEsC,4BAHVC,6DACU,gCAGwBD,WAF7BE,sCAAOF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),t=e.defineComponent({setup:function(){var t=e.ref(!1),n=e.ref(!0),o=e.ref([]),a=[],r={},i=!1,c=!1,l=function(e){var t=e.substring(e.lastIndexOf("/")+1);return"page-product-"+(t.match(/^page([0-9]+)$/)?t:"page1")},u=[l(window.location.href)],p=function(e){e.preventDefault(),u=[l(e.currentTarget.href)],s(e.currentTarget)},s=function(n,c){var u=n.href,p=l(u);if(i||(window.app.component("products-paginate",{data:function(){return{components:o}},template:'<teleport to="#products"><component :is="component" v-for="(component, key) in components" v-bind:key="key"></component></teleport>'}),t.value="products-paginate",i=!0),-1===a.indexOf(p))n.classList.add("is-loading"),$http.get(u+"?paginator").then((function(t){m(c);var n=document.createElement("html");n.innerHTML=t.data.products,window.app.component(p,{template:n.querySelector("#products").innerHTML}),a.push(p),history.pushState({urlPath:u},document.title,u),n.innerHTML=t.data.paginator,r[p]=t.data.paginator,document.getElementById("pagination").replaceWith(n.querySelector("#pagination")),c?(o.value.push(p),d()):(o.value=[p],window.scrollTo({top:0,left:0,behavior:"smooth"})),window.lazyImages&&window.lazyImages.update(),e.nextTick(f)}));else{history.pushState({urlPath:u},document.title,u);var s=document.createElement("html");s.innerHTML=r[p],document.getElementById("pagination").replaceWith(s.querySelector("#pagination")),c?(o.value.push(p),d()):(o.value=[p],window.scrollTo({top:0,left:0,behavior:"smooth"})),e.nextTick(f)}},d=function(){var e=document.getElementById("pagination");u.forEach((function(t){var n=e.querySelector("."+t);n&&n.classList.add("is-current")}))},m=function(e){e||c||(document.querySelectorAll("#products > *").forEach((function(e){e.remove()})),c=!0)},f=function(){var e=document.querySelector("#pagination .pagination-next:not([disabled])");document.querySelectorAll("#pagination a:not([disabled])").forEach((function(e){e.addEventListener("click",p)})),n.value=Boolean(e),window.lazyImages&&window.lazyImages.update()};return e.onMounted((function(){f()})),{component:t,hasMorePages:n,more:function(){var e=document.querySelector("#pagination .pagination-next:not([disabled])"),t=l(e.href);u.push(t),s(e,!0)}}}}),n={class:"shop-pagination has-text-centered mb-3"},o={key:0,class:"shop-pagination-more"},a=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-sync-alt"})],-1);t.render=function(t,r,i,c,l,u){return e.openBlock(),e.createElementBlock("div",n,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component))),t.hasMorePages?(e.openBlock(),e.createElementBlock("div",o,[e.renderSlot(t.$slots,"default",{more:t.more},(function(){return[e.createElementVNode("button",{class:"button is-small",onClick:r[0]||(r[0]=function(){return t.more&&t.more.apply(t,arguments)})},[a,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.pagination.more")),1)])]}))])):e.createCommentVNode("v-if",!0)])},module.exports=t;
|
|
2
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../src/components/shop/Pagination.vue","../../../src/components/shop/Pagination.vue?vue&type=template&id=4691bf65&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-pagination has-text-centered mb-3\">\n <component :is=\"component\"></component>\n <div class=\"shop-pagination-more\" v-if=\"hasMorePages\">\n <slot :more=\"more\">\n <button class=\"button is-small\" @click=\"more\">\n <span class=\"icon is-small\">\n <i class=\"fas fa-sync-alt\"></i>\n </span>\n <span>{{ __('shop.pagination.more') }}</span>\n </button>\n </slot>\n </div>\n </div>\n</template>\n<script>\nimport { ref, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n setup() {\n const component = ref(false);\n const hasMorePages = ref(true);\n const visiblePages = ref([]);\n\n let pages = [];\n let paginators = {};\n let inited = false;\n let cleared = false;\n\n const getComponentName = (href) => {\n const last = href.substring(href.lastIndexOf('/') + 1);\n\n return 'page-product-' + (last.match(/^page([0-9]+)$/) ? last : 'page1');\n };\n\n let nextPages = [getComponentName(window.location.href)];\n\n const get = (e) => {\n e.preventDefault();\n\n nextPages = [getComponentName(e.currentTarget.href)];\n\n load(e.currentTarget);\n };\n\n const load = (button, isAppend) => {\n const href = button.href;\n\n const componentName = getComponentName(href);\n\n if (!inited) {\n window.app.component('products-paginate', {\n data() {\n return {\n components: visiblePages\n };\n },\n template: '<teleport to=\"#products\"><component :is=\"component\" v-for=\"(component, key) in components\" v-bind:key=\"key\"></component></teleport>'\n });\n\n component.value = 'products-paginate';\n inited = true;\n }\n\n if (pages.indexOf(componentName) === -1) {\n button.classList.add('is-loading');\n\n $http.get(href + '?paginator').then((response) => {\n clearInitial(isAppend);\n\n let html = document.createElement('html');\n\n html.innerHTML = response.data.products;\n\n window.app.component(componentName, {\n template: html.querySelector('#products').innerHTML\n });\n\n pages.push(componentName);\n\n history.pushState({ urlPath: href }, document.title, href);\n html.innerHTML = response.data.paginator;\n\n paginators[componentName] = response.data.paginator;\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n nextTick(init);\n });\n } else {\n history.pushState({ urlPath: href }, document.title, href);\n\n let html = document.createElement('html');\n html.innerHTML = paginators[componentName];\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n nextTick(init);\n }\n };\n\n const setPaginatorCurrentPages = () => {\n const paginator = document.getElementById('pagination');\n\n nextPages.forEach((componentName) => {\n const link = paginator.querySelector('.' + componentName);\n\n if (link) {\n link.classList.add('is-current');\n }\n });\n };\n\n const clearInitial = (isAppend) => {\n if (!isAppend && !cleared) {\n let productsOld = document.querySelectorAll('#products > *');\n\n productsOld.forEach((product) => {\n product.remove();\n });\n\n cleared = true;\n }\n };\n\n const init = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const links = document.querySelectorAll('#pagination a:not([disabled])');\n\n links.forEach((link) => {\n link.addEventListener('click', get);\n });\n\n hasMorePages.value = Boolean(next);\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n };\n\n const more = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const componentName = getComponentName(next.href);\n\n nextPages.push(componentName);\n\n load(next, true);\n };\n\n onMounted(() => {\n init();\n });\n\n return {\n component,\n hasMorePages,\n more\n };\n }\n});\n</script>","<template>\n <div class=\"shop-pagination has-text-centered mb-3\">\n <component :is=\"component\"></component>\n <div class=\"shop-pagination-more\" v-if=\"hasMorePages\">\n <slot :more=\"more\">\n <button class=\"button is-small\" @click=\"more\">\n <span class=\"icon is-small\">\n <i class=\"fas fa-sync-alt\"></i>\n </span>\n <span>{{ __('shop.pagination.more') }}</span>\n </button>\n </slot>\n </div>\n </div>\n</template>\n<script>\nimport { ref, onMounted, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n setup() {\n const component = ref(false);\n const hasMorePages = ref(true);\n const visiblePages = ref([]);\n\n let pages = [];\n let paginators = {};\n let inited = false;\n let cleared = false;\n\n const getComponentName = (href) => {\n const last = href.substring(href.lastIndexOf('/') + 1);\n\n return 'page-product-' + (last.match(/^page([0-9]+)$/) ? last : 'page1');\n };\n\n let nextPages = [getComponentName(window.location.href)];\n\n const get = (e) => {\n e.preventDefault();\n\n nextPages = [getComponentName(e.currentTarget.href)];\n\n load(e.currentTarget);\n };\n\n const load = (button, isAppend) => {\n const href = button.href;\n\n const componentName = getComponentName(href);\n\n if (!inited) {\n window.app.component('products-paginate', {\n data() {\n return {\n components: visiblePages\n };\n },\n template: '<teleport to=\"#products\"><component :is=\"component\" v-for=\"(component, key) in components\" v-bind:key=\"key\"></component></teleport>'\n });\n\n component.value = 'products-paginate';\n inited = true;\n }\n\n if (pages.indexOf(componentName) === -1) {\n button.classList.add('is-loading');\n\n $http.get(href + '?paginator').then((response) => {\n clearInitial(isAppend);\n\n let html = document.createElement('html');\n\n html.innerHTML = response.data.products;\n\n window.app.component(componentName, {\n template: html.querySelector('#products').innerHTML\n });\n\n pages.push(componentName);\n\n history.pushState({ urlPath: href }, document.title, href);\n html.innerHTML = response.data.paginator;\n\n paginators[componentName] = response.data.paginator;\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n nextTick(init);\n });\n } else {\n history.pushState({ urlPath: href }, document.title, href);\n\n let html = document.createElement('html');\n html.innerHTML = paginators[componentName];\n\n document.getElementById('pagination').replaceWith(html.querySelector('#pagination'));\n\n if (!isAppend) {\n visiblePages.value = [componentName];\n\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n } else {\n visiblePages.value.push(componentName);\n setPaginatorCurrentPages();\n }\n\n nextTick(init);\n }\n };\n\n const setPaginatorCurrentPages = () => {\n const paginator = document.getElementById('pagination');\n\n nextPages.forEach((componentName) => {\n const link = paginator.querySelector('.' + componentName);\n\n if (link) {\n link.classList.add('is-current');\n }\n });\n };\n\n const clearInitial = (isAppend) => {\n if (!isAppend && !cleared) {\n let productsOld = document.querySelectorAll('#products > *');\n\n productsOld.forEach((product) => {\n product.remove();\n });\n\n cleared = true;\n }\n };\n\n const init = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const links = document.querySelectorAll('#pagination a:not([disabled])');\n\n links.forEach((link) => {\n link.addEventListener('click', get);\n });\n\n hasMorePages.value = Boolean(next);\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n };\n\n const more = () => {\n const next = document.querySelector('#pagination .pagination-next:not([disabled])');\n\n const componentName = getComponentName(next.href);\n\n nextPages.push(componentName);\n\n load(next, true);\n };\n\n onMounted(() => {\n init();\n });\n\n return {\n component,\n hasMorePages,\n more\n };\n }\n});\n</script>"],"names":["defineComponent","setup","component","ref","hasMorePages","visiblePages","pages","paginators","inited","cleared","getComponentName","href","last","substring","lastIndexOf","match","nextPages","window","location","get","e","preventDefault","currentTarget","load","button","isAppend","componentName","app","data","components","template","value","indexOf","classList","add","$http","then","response","clearInitial","html","document","createElement","innerHTML","products","querySelector","push","history","pushState","urlPath","title","paginator","getElementById","replaceWith","setPaginatorCurrentPages","scrollTo","top","left","behavior","lazyImages","update","nextTick","init","forEach","link","querySelectorAll","product","remove","next","addEventListener","Boolean","onMounted","more","_createElementVNode","_createElementBlock","_hoisted_1","_createBlock","_ctx","_hoisted_2","_renderSlot","onClick","_hoisted_3"],"mappings":"oCAkBeA,kBAAgB,CAC3BC,qBACUC,EAAYC,OAAI,GAChBC,EAAeD,OAAI,GACnBE,EAAeF,MAAI,IAErBG,EAAQ,GACRC,EAAa,GACbC,GAAS,EACTC,GAAU,EAERC,EAAmB,SAACC,OAChBC,EAAOD,EAAKE,UAAUF,EAAKG,YAAY,KAAO,SAE7C,iBAAmBF,EAAKG,MAAM,kBAAoBH,EAAO,UAGhEI,EAAY,CAACN,EAAiBO,OAAOC,SAASP,OAE5CQ,EAAM,SAACC,GACTA,EAAEC,iBAEFL,EAAY,CAACN,EAAiBU,EAAEE,cAAcX,OAE9CY,E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W,eAAe,cAE1CnC,EAAU8C,SAAQ,SAACpC,OACTqC,EAAOb,EAAUN,cAAc,IAAMlB,GAEvCqC,GACAA,EAAK9B,UAAUC,IAAI,kBAKzBI,EAAe,SAACb,GACbA,GAAahB,IACI+B,SAASwB,iBAAiB,iBAEhCF,SAAQ,SAACG,GACjBA,EAAQC,YAGZzD,GAAU,IAIZoD,EAAO,eACHM,EAAO3B,SAASI,cAAc,gDAEtBJ,SAASwB,iBAAiB,iCAElCF,SAAQ,SAACC,GACXA,EAAKK,iBAAiB,QAASjD,MAGnCf,EAAa2B,MAAQsC,QAAQF,GAEzBlD,OAAOyC,YACPzC,OAAOyC,WAAWC,iBAc1BW,aAAU,WACNT,OAGG,CACH3D,UAAAA,EACAE,aAAAA,EACAmE,KAjBS,eACHJ,EAAO3B,SAASI,cAAc,gDAE9BlB,EAAgBhB,EAAiByD,EAAKxD,MAE5CK,EAAU6B,KAAKnB,GAEfH,EAAK4C,GAAM,iBCjLR,yDAEI,0BAGCK,mCAAY,kBACRA,gCAAS,6EAN7BC,2BAAAC,kBACIC,wCAAgBC,eACwBA,8BAAxCH,2BAAAI,GACIC,iCAAOP,KAAMK,SAAb,kBACIJ,qCAAc,kBAAmBO,sCAAOH,sCACpCI,EAGAR,mDAASI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),i=require("swiper/core");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(i);s.default.use([i.Navigation,i.Mousewheel]);var n=e.defineComponent({props:{id:Number},setup:function(i){var t=!1,n=e.ref(!1),r=e.ref(null),a=e.ref(null),o=function(e){e.forEach((function(e){e.isIntersecting&&(t||(t=!0,d()))}))},d=function(){$http.post($ziggy("api.piece",{slug:"promo-products"}),{id:i.id}).then((function(t){var o="piece-promo-products-"+i.id;window.app.component(o,{template:t.data?t.data:"<i></i>"}),a.value=o,n.value=!0,e.nextTick((function(){var e=r.value.querySelectorAll(".is-faded-tabs");e.length&&e.forEach((function(e){new s.default(e.querySelector(".swiper-container"),{slidesPerView:"auto",freeMode:!0})}));var i=r.value.querySelectorAll(".is-faded-tabs .swiper-slide"),t=r.value.querySelectorAll("[products-slider]");i.forEach((function(e,s){e.addEventListener("click",(function(){i.forEach((function(e){e.classList.remove("is-active")})),t.forEach((function(e){e.classList.add("is-hidden")})),t[s].classList.remove("is-hidden"),e.classList.add("is-active")}))})),t.length&&t.forEach((function(e){new s.default(e,window.viewedSwiperOptions)})),window.lazyImages&&window.lazyImages.update()}))}))};return window.addEventListener("DOMContentLoaded",(function(){new IntersectionObserver(o,{threshold:.1}).observe(r.value)})),{container:r,component:a,loaded:n}}}),r={ref:"container"},a={key:0,class:"product-promo-block container is-fluid is-skeleton"},o=e.createStaticVNode('<div class="gradient"></div><div class="title slider-title"> </div><div class="is-faded-tabs"><div class="is-flex"><div class="swiper-slide"> </div><div class="swiper-slide"> </div></div></div>',3),d={class:"swiper-container"},c={class:"swiper-wrapper products is-slider"},l=[e.createStaticVNode('<div class="border"><div class="wrapper"><picture class="is-lazy-loaded"><img class="lazy entered loaded" src="/images/blank.png"></picture><div class="availability"> </div><div class="title"> </div><div class="prices"><div class="price"></div></div></div></div>',1)];n.render=function(i,t,s,n,u,v){return e.openBlock(),e.createElementBlock("div",r,[i.loaded?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),{key:1})):(e.openBlock(),e.createElementBlock("section",a,[o,e.createElementVNode("div",d,[e.createElementVNode("div",c,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,(function(i){return e.createElementVNode("div",{class:"product",key:i},l)})),64))])])]))],512)},module.exports=n;
|
|
2
|
+
//# sourceMappingURL=PromoProducts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PromoProducts.js","sources":["../../../src/components/shop/PromoProducts.vue","../../../src/components/shop/PromoProducts.vue?vue&type=template&id=6be3a2bf&lang.js"],"sourcesContent":["<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\"> </div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\"> </div>\n <div class=\"swiper-slide\"> </div>\n </div>\n </div>\n <div class=\"swiper-container\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\"> </div>\n <div class=\"title\"> </div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport SwiperCore, { Navigation, Mousewheel } from 'swiper/core';\n\nSwiperCore.use([Navigation, Mousewheel]);\n\nexport default defineComponent({\n props: {\n id: Number\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: 'promo-products' }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new SwiperCore(tab.querySelector('.swiper-container'), {\n slidesPerView: 'auto',\n freeMode: true\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new SwiperCore(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n","<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\"> </div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\"> </div>\n <div class=\"swiper-slide\"> </div>\n </div>\n </div>\n <div class=\"swiper-container\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\"> </div>\n <div class=\"title\"> </div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport SwiperCore, { Navigation, Mousewheel } from 'swiper/core';\n\nSwiperCore.use([Navigation, Mousewheel]);\n\nexport default defineComponent({\n props: {\n id: Number\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: 'promo-products' }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new SwiperCore(tab.querySelector('.swiper-container'), {\n slidesPerView: 'auto',\n freeMode: true\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new SwiperCore(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n"],"names":["SwiperCore","use","Navigation","Mousewheel","defineComponent","props","id","Number","setup","inited","loaded","ref","container","component","callback","entries","forEach","entry","isIntersecting","load","$http","post","$ziggy","slug","then","response","componentName","window","app","template","data","value","nextTick","fadedTabs","querySelectorAll","length","tab","querySelector","slidesPerView","freeMode","tabs","sliders","index","addEventListener","classList","remove","slider","add","viewedSwiperOptions","lazyImages","update","IntersectionObserver","threshold","observe","_createElementBlock","_hoisted_1","_ctx","_createBlock","_hoisted_2","_hoisted_3","_createElementVNode","_hoisted_6","_hoisted_7","key"],"mappings":"8IAqCAA,UAAWC,IAAI,CAACC,aAAYC,eAE5B,MAAeC,kBAAgB,CAC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IAAI,4BACU,4RASA,6BACI,6XAXvB2C,2BAAAC,GAC+EC,wBA4B3EC,wCAAgBD,sCA5BhBF,+BAAAI,GACIC,EAQAC,2BAAAC,GACID,2BAAAE,kBACIR,kDAAqC,YAATZ,UAA5BkB,kCAAW,UAA8BG,IAAKrB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),t=require("vuex"),r=require("@perevorot/shop/dist/api"),n=require("simplebar"),o=require("secure-ls");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(n),c=a(o);var i=e.defineComponent({name:"search",props:{q:{type:String,default:""},placeholder:{type:String,default:""},parameter:{type:String,default:"/q{separator}"}},setup:function(n){var o=new c.default({isCompression:!1}),a=n.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(o.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&&(_(),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)},_=function(){if(u.value.length>1){var e=o.get("search")?o.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),o.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 C=e.computed((function(){return u.value?$env.locale.url+"/search"+S.value:$env.locale.url+"/search"})),S=e.computed((function(){return n.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,o=document.getElementById("menu");return o&&o.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})})),n.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:C,searchHrefWithParameter:S,open:function(){v.value>=0?window.location.href=d.value[v.value].href:window.location.href=C.value},categories:q,byCategory:p,dropdownContent:g,history:k,clearSearchHistory:function(e){o.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"},_={class:"dropdown-item categories-list-title"},C=["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={class:"columns"},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,n,o,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,n){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:n},[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",_,e.toDisplayString(t.__("shop.search.categories")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.byCategory,(function(r,n){return e.openBlock(),e.createElementBlock("div",{class:"dropdown-item",key:n},[e.createElementVNode("div",null,[e.createElementVNode("a",{href:r.href+t.searchHrefWithParameter},e.toDisplayString(r.name),9,C)]),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,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dropdown-item",{"is-active":t.current==n}]),key:r.id},[e.renderSlot(t.$slots,"item",{user:t.user,item:r,cartRefs:t.cartRefs},(function(){return[e.createElementVNode("div",H,[e.createElementVNode("div",T,[e.createElementVNode("div",K,[e.createElementVNode("a",{href:r.href},e.toDisplayString(r.name),9,M)]),e.createElementVNode("div",{class:"price",innerHTML:r.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,ref_for:!0,ref:t.cartRefs},null,8,["id"])]))])]}))],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;
|
|
2
|
+
//# sourceMappingURL=Search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search.js","sources":["../../../src/components/shop/Search.vue","../../../src/components/shop/Search.vue?vue&type=template&id=3dba7fa2&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-search\" @click=\"$event.stopPropagation()\">\n <div\n class=\"dropdown\"\n 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 >\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\">\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\">\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.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\" :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\n class=\"dropdown\"\n 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 >\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\">\n <div class=\"column\">\n <div class=\"title\">\n <a :href=\"item.href\">\n {{ item.name }}\n </a>\n </div>\n <div class=\"price\" v-html=\"item.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\" :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":["defineComponent","name","props","q","type","String","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","then","response","data","saveSearch","products","SimpleBar","length","indexOf","filter","item","slice","unshift","set","onBeforeUpdate","watch","searchUrl","$env","locale","url","searchHrefWithParameter","replace","toLowerCase","close","event","target","closest","window","addEventListener","categories","load","menuElement","getElementById","querySelectorAll","forEach","element","textContent","dataset","push","href","resolve","arguments","i","next","prev","add","preventDefault","cartRefs","el","preventCaret","which","esc","blur","dropdown","open","location","clearSearchHistory","remove","focus","setSearchHistory","_createElementVNode","style","_createElementBlock","onClick","$event","stopPropagation","_ctx","_hoisted_1","onKeyup","onKeydown","_renderSlot","_hoisted_3","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","index","key","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_24","_hoisted_25","id","_hoisted_26","_hoisted_27","_hoisted_28","price","price_old","_hoisted_31","_hoisted_33","code","quantity","_hoisted_34","_hoisted_35","is_eol","_hoisted_37","_hoisted_36","_createVNode","_hoisted_38","_hoisted_39","_hoisted_40"],"mappings":"kOA+HA,MAA6BA,kBAAgB,CACzCC,KAAM,SACNC,MAAO,CACHC,EAAG,CACCC,KAAMC,eACG,IAEbC,YAAa,CACTF,KAAMC,eACG,IAEbE,UAAW,CACPH,KAAMC,eACG,kBAGjBG,eAAMN,OACIO,EAAK,IAAIC,UAAS,CACpBC,eAAe,IAGfR,EAAID,EAAMC,KAEVA,EAAG,KACCS,EAAUC,SAASC,cAAc,YACrCF,EAAQG,UAAYZ,EACpBA,EAAIS,EAAQI,UAGVC,EAAYC,OAAI,GAChBC,EAAOD,MAAIf,GACXiB,EAAUF,MAAI,IACdG,EAAaH,MAAI,IACjBI,EAAQJ,MAAI,GACZK,EAAUL,OAAK,GACfM,EAAaN,OAAI,GACjBO,EAAQP,QACRQ,EAAYR,MAAI,IAChBS,EAAkBT,QAClBU,EAAUV,MAAIT,EAAGoB,IAAI,WACrBC,EAAOZ,MAAI,IACXa,EAAQC,aACRC,EAAOC,YAAS,kBAAMH,EAAMI,QAAQ,cAEtCC,EAAO,GAGLC,EAAS,WACXC,kBAHAC,GAKAhB,EAAQP,OAAS,EAEZG,EAAKH,MAAMwB,QAIZvB,EAAUD,OAAQ,EAGdG,EAAKH,MAAMwB,QACXC,OAAIJ,OAAOlB,EAAKH,OACX0B,MAAK,SAACC,GACCA,EAASC,OACTC,IAEAzB,EAAQJ,MAAQ2B,EAASC,KAAKE,SAC9BxB,EAAMN,MAAQ2B,EAASC,KAAKtB,MAC5BI,EAAUV,MAAQ2B,EAASC,KAAKlB,UAChCL,EAAWL,MAAQ2B,EAASC,KAAKvB,WAEf,IAAI0B,UAAUpB,EAAgBX,oBAG/C,WACLC,EAAUD,OAAQ,OArB9BI,EAAQJ,MAAQ,GAChBC,EAAUD,OAAQ,IA2BpB6B,EAAa,cACX1B,EAAKH,MAAMgC,OAAS,E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,KAAM7B,EAAK6B,KAAO2B,6CAA4BxD,EAAKlD,aAE3DoG,kDAEQM,qGAOsBA,uBAAtCJ,2BAAAuB,GACIzB,yBAAA0B,uCAEQpB,wDAIJqB,EACA3B,0BAAIrB,KAAM2B,+BAAcA,4EAGCA,UAAQ3D,sBAAzCuD,2BAAA0B,GACI5B,2BAAA6B,oBACOvB,kDAEPJ,kDAAmDI,oBAAhBxD,EAAMkE,wBAAzCd,oDAAW,6BAAmGI,WAAWU,KAAtDC,IAAKnE,EAAKgF,KACzEpB,8BAAmB9E,KAAM0E,OAAOxD,KAAMA,EAAOqC,SAAWmB,aAAxD,kBACIN,2BAAA+B,GACI/B,2BAAAgC,GACIhC,2BAAAiC,GACIjC,0BAAIrB,KAAM7B,EAAK6B,wBACR7B,EAAKlD,aAGhBoG,kCAAW,QAAQtF,UAAQoC,EAAKoF,iBACHpF,EAAKqF,yBAAlCjC,2BAAAkC,GACIpC,6BAAMtF,UAAQoC,EAAKqF,wDAEvBnC,2BAAAqC,oBAAqBvF,EAAKwF,SACExF,EAAKyF,wBAAjCrC,2BAAAsC,oBACOlC,iDAEPJ,4BAAAuC,oBACOnC,qCAG0BxD,EAAK4F,sBAG1CxC,2BAAAyC,oBACOrC,4CAJPJ,2BAAA0C,GACIC,iBAAWf,GAAIhF,EAAKgF,yBAAyB,wBAA4B,aAAQjH,IAAKyF,oGA/DxEA,UAAQ3D,QAAU2D,aAAW3D,UAyE9B2D,aAAcA,UAAQ3D,QAAW2D,aAAW3D,sDAAjFuD,2BAAA4C,GACI9C,2BAAA+C,GACI/C,2BAAAgD,oBACO1C,wDA7EgBA,UAAQ3D,QAAU2D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("swiper/core"),t=require("countdown.to");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(e),r=n(t);i.default.use([e.Navigation,e.Pagination]);var o={name:"bundle",props:{prev:{type:String,default:".swiper-button-prev"},next:{type:String,default:".swiper-button-next"},thumbPrev:{type:String,default:".swiper-button-prev"},thumbNext:{type:String,default:".swiper-button-next"}},setup:function(e){var t=function(e,t){return e+" "+t[e%100>4&&e%100<20?2:[2,0,1,1,1,2][Math.min(e%10,5)]]};window.addEventListener("DOMContentLoaded",(function(){var n=document.getElementById("bundles-root");new i.default(n,{slidesPerView:1,spaceBetween:24,allowTouchMove:!1,mousewheel:{forceToAxis:!0},navigation:{nextEl:e.next,prevEl:e.prev}}),n.querySelectorAll("#bundles-root > .swiper-wrapper > .swiper-slide").forEach((function(n,o){var a=[],u=[],l=n.querySelectorAll(".bundle-info"),s=n.querySelectorAll(".bundles-subproduct");if(n.dataset.finish){var d=n.querySelector(".countdown");new r.default(n.dataset.finish,{onCalculateRemainingTime:function(){var e=this.timeRemaining[1],n=this.timeRemaining[2];if(e>0)d.innerHTML=t(e,__("shop.pluralize.monthes"));else if(n>0)d.innerHTML=t(n,__("shop.pluralize.days"));else{var i=this.timeRemaining[3],r=this.timeRemaining[4],o=this.timeRemaining[5];d.innerHTML=i+":"+r+":"+o}}})}s.forEach((function(t,n){var r=t.querySelector(e.thumbNext),s=t.querySelector(e.thumbPrev),d=t.querySelector(".swiper-pagination");a[n]=0,d&&(u[n]=new i.default(t.querySelector(".swiper-container"),{slidesPerView:1,spaceBetween:24,navigation:{nextEl:r,prevEl:s},pagination:{el:d,clickable:!0},on:{slideChange:function(e){a[n]=e.activeIndex,l.forEach((function(e){e.classList.add("is-hidden")}));var t="bundle"+o+"-info-"+a.join("-");document.getElementById(t).classList.remove("is-hidden")}}}))}))}))}))}};o.render=function(e,t,n,i,r,o){return null},module.exports=o;
|
|
2
|
+
//# sourceMappingURL=Bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bundle.js","sources":["../../../../src/components/shop/bundle/Bundle.vue"],"sourcesContent":["<template></template>\n<script>\nimport SwiperCore, { Navigation, Pagination } from \"swiper/core\";\nimport countdown from \"countdown.to\";\n\nSwiperCore.use([Navigation, Pagination]);\n\nexport default {\n name: \"bundle\",\n props: {\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n },\n setup(props) {\n const pluralize = (count, words) => {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return (\n count +\n \" \" +\n words[\n count % 100 > 4 && count % 100 < 20\n ? 2\n : cases[Math.min(count % 10, 5)]\n ]\n );\n };\n\n window.addEventListener(\"DOMContentLoaded\", () => {\n const container = document.getElementById(\"bundles-root\");\n\n new SwiperCore(container, {\n slidesPerView: 1,\n spaceBetween: 24,\n allowTouchMove: false,\n mousewheel: {\n forceToAxis: true,\n },\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n });\n\n const bundles = container.querySelectorAll(\n \"#bundles-root > .swiper-wrapper > .swiper-slide\"\n );\n\n bundles.forEach((bundle, bundleIndex) => {\n let active = [];\n let swipers = [];\n\n const infos = bundle.querySelectorAll(\".bundle-info\");\n const sliders = bundle.querySelectorAll(\".bundles-subproduct\");\n\n if (bundle.dataset.finish) {\n const timer = bundle.querySelector(\".countdown\");\n\n new countdown(bundle.dataset.finish, {\n onCalculateRemainingTime: function () {\n const months = this.timeRemaining[1];\n const days = this.timeRemaining[2];\n\n if (months > 0) {\n timer.innerHTML = pluralize(\n months,\n __(\"shop.pluralize.monthes\")\n );\n } else if (days > 0) {\n timer.innerHTML = pluralize(\n days,\n __(\"shop.pluralize.days\")\n );\n } else {\n const hours = this.timeRemaining[3];\n const minutes = this.timeRemaining[4];\n const seconds = this.timeRemaining[5];\n\n timer.innerHTML =\n hours + \":\" + minutes + \":\" + seconds;\n }\n },\n });\n }\n\n sliders.forEach((slider, index) => {\n const next = slider.querySelector(props.thumbNext);\n const prev = slider.querySelector(props.thumbPrev);\n const pagination =\n slider.querySelector(\".swiper-pagination\");\n\n active[index] = 0;\n\n if (pagination) {\n swipers[index] = new SwiperCore(\n slider.querySelector(\".swiper-container\"),\n {\n slidesPerView: 1,\n spaceBetween: 24,\n navigation: {\n nextEl: next,\n prevEl: prev,\n },\n pagination: {\n el: pagination,\n clickable: true,\n },\n on: {\n slideChange: function (el) {\n active[index] = el.activeIndex;\n\n infos.forEach((info) => {\n info.classList.add(\"is-hidden\");\n });\n\n const id =\n \"bundle\" +\n bundleIndex +\n \"-info-\" +\n active.join(\"-\");\n\n document\n .getElementById(id)\n .classList.remove(\"is-hidden\");\n },\n },\n }\n );\n }\n });\n });\n });\n },\n};\n</script>"],"names":["SwiperCore","use","Navigation","Pagination","name","props","prev","type","String","next","thumbPrev","thumbNext","setup","pluralize","count","words","Math","min","window","addEventListener","container","document","getElementById","slidesPerView","spaceBetween","allowTouchMove","mousewheel","forceToAxis","navigation","nextEl","prevEl","querySelectorAll","forEach","bundle","bundleIndex","active","swipers","infos","sliders","dataset","finish","timer","querySelector","countdown","onCalculateRemainingTime","months","this","timeRemaining","days","innerHTML","__","hours","minutes","seconds","slider","index","pagination","el","clickable","on","slideChange","activeIndex","info","classList","add","id","join","remove"],"mappings":"8JAKAA,UAAWC,IAAI,CAACC,aAAYC,eAE5B,MAAe,CACXC,KAAM,SACNC,MAAO,CACHC,KAAM,CACFC,KAAMC,eACG,uBAEbC,KAAM,CACFF,KAAMC,eACG,uBAEbE,UAAW,CACPH,KAAMC,eACG,uBAEbG,UAAW,CACPJ,KAAMC,eACG,wBAGjBI,eAAMP,OACIQ,EAAY,SAACC,EAAOC,UAIlBD,EACA,IACAC,EACID,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAC3B,EAPF,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAQRE,KAAKC,IAAIH,EAAQ,GAAI,MAK7CI,OAAOC,iBAAiB,oBAAoB,eAClCC,EAAYC,SAASC,eAAe,oBAEtCtB,UAAWoB,EAAW,CACtBG,cAAe,EACfC,aAAc,GACdC,gBAAgB,E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|
|
1
|
+
"use strict";var e=require("vue"),t=require("vuex"),n={name:"BundleAdd",props:{id:Number,second:Number,third:Number},setup:function(n){var r=e.ref(!1),a=t.useStore(),d=n.id+"-"+n.second+(n.third?"-"+n.third:""),o=e.computed((function(){return a.getters["cart/productQuantity"](d)})),i=n.isAlreadyInCart;return{loading:r,add:function(){r.value=!0,a.dispatch("cart/add",{product:{id:d,quantity:1},finally:function(){r.value=!1}})},remove:function(){r.value=!0,a.dispatch("cart/remove",{id:d,finally:function(){r.value=!1}})},cart:o,isAlreadyInCart:i}}},r={class:"shop-bundle-add"},a=["disabled","textContent"],d={key:0},o=e.createElementVNode("br",null,null,-1),i=["disabled","textContent"];n.render=function(t,n,l,u,c,s){return e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("button",{class:"button is-link is-small",onClick:n[0]||(n[0]=function(){return u.add&&u.add.apply(u,arguments)}),disabled:u.loading,textContent:e.toDisplayString(t.__("shop.bundle.add"))},null,8,a),t.$env.shop.isAlreadyInCart&&u.cart>0?(e.openBlock(),e.createElementBlock("div",d,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.already",{quantity:u.cart}))+" ",1),o,e.createElementVNode("a",{onClick:n[1]||(n[1]=e.withModifiers((function(){return u.remove&&u.remove.apply(u,arguments)}),["prevent"])),disabled:u.loading,textContent:e.toDisplayString(t.__("shop.cart.remove"))},null,8,i)])):e.createCommentVNode("v-if",!0)])},module.exports=n;
|
|
2
|
+
//# sourceMappingURL=BundleAdd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BundleAdd.js","sources":["../../../../src/components/shop/bundle/BundleAdd.vue","../../../../src/components/shop/bundle/BundleAdd.vue?vue&type=template&id=cf71b1a8&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-bundle-add\">\n <button\n class=\"button is-link is-small\"\n v-on:click=\"add\"\n :disabled=\"loading\"\n v-text=\"__('shop.bundle.add')\"\n ></button>\n <div v-if=\"$env.shop.isAlreadyInCart && cart > 0\">\n {{ __(\"shop.cart.already\", { quantity: cart }) }}\n <br />\n <a\n v-on:click.prevent=\"remove\"\n :disabled=\"loading\"\n v-text=\"__('shop.cart.remove')\"\n ></a>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default {\n name: \"BundleAdd\",\n props: {\n id: Number,\n second: Number,\n third: Number,\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const bundleId =\n props.id +\n \"-\" +\n props.second +\n (props.third ? \"-\" + props.third : \"\");\n\n const cart = computed(() =>\n store.getters[\"cart/productQuantity\"](bundleId)\n );\n\n let isAlreadyInCart = props.isAlreadyInCart;\n\n const add = () => {\n loading.value = true;\n\n store.dispatch(\"cart/add\", {\n product: {\n id: bundleId,\n quantity: 1,\n },\n finally: () => {\n loading.value = false;\n },\n });\n };\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch(\"cart/remove\", {\n id: bundleId,\n finally: () => {\n loading.value = false;\n },\n });\n };\n\n return {\n loading,\n add,\n remove,\n cart,\n isAlreadyInCart,\n };\n },\n};\n</script>","<template>\n <div class=\"shop-bundle-add\">\n <button\n class=\"button is-link is-small\"\n v-on:click=\"add\"\n :disabled=\"loading\"\n v-text=\"__('shop.bundle.add')\"\n ></button>\n <div v-if=\"$env.shop.isAlreadyInCart && cart > 0\">\n {{ __(\"shop.cart.already\", { quantity: cart }) }}\n <br />\n <a\n v-on:click.prevent=\"remove\"\n :disabled=\"loading\"\n v-text=\"__('shop.cart.remove')\"\n ></a>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed } from \"vue\";\nimport { useStore } from \"vuex\";\n\nexport default {\n name: \"BundleAdd\",\n props: {\n id: Number,\n second: Number,\n third: Number,\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const bundleId =\n props.id +\n \"-\" +\n props.second +\n (props.third ? \"-\" + props.third : \"\");\n\n const cart = computed(() =>\n store.getters[\"cart/productQuantity\"](bundleId)\n );\n\n let isAlreadyInCart = props.isAlreadyInCart;\n\n const add = () => {\n loading.value = true;\n\n store.dispatch(\"cart/add\", {\n product: {\n id: bundleId,\n quantity: 1,\n },\n finally: () => {\n loading.value = false;\n },\n });\n };\n\n const remove = () => {\n loading.value = true;\n\n store.dispatch(\"cart/remove\", {\n id: bundleId,\n finally: () => {\n loading.value = false;\n },\n });\n };\n\n return {\n loading,\n add,\n remove,\n cart,\n isAlreadyInCart,\n };\n },\n};\n</script>"],"names":["name","props","id","Number","second","third","setup","loading","ref","store","useStore","bundleId","cart","computed","getters","isAlreadyInCart","add","value","dispatch","product","quantity","remove","_createElementVNode","_createElementBlock","_hoisted_1","onClick","$setup","disabled","_toDisplayString","_ctx","shop","_hoisted_4"],"mappings":"sDAuBe,CACXA,KAAM,YACNC,MAAO,CACHC,GAAIC,OACJC,OAAQD,OACRE,MAAOF,QAEXG,eAAML,OACIM,EAAUC,OAAI,GACdC,EAAQC,aACRC,EACFV,EAAMC,GACN,IACAD,EAAMG,QACLH,EAAMI,MAAQ,IAAMJ,EAAMI,MAAQ,IAEjCO,EAAOC,YAAS,kBAClBJ,EAAMK,QAAQ,wBAAwBH,MAGtCI,EAAkBd,EAAMc,sBA2BrB,CACHR,QAAAA,EACAS,IA3BQ,WACRT,EAAQU,OAAQ,EAEhBR,EAAMS,SAAS,WAAY,CACvBC,QAAS,CACLjB,GAAIS,EACJS,SAAU,WAEL,WACLb,EAAQU,OAAQ,MAmBxBI,OAdW,WACXd,EAAQU,OAAQ,EAEhBR,EAAMS,SAAS,cAAe,CAC1BhB,GAAIS,UACK,WACLJ,EAAQU,OAAQ,MASxBL,KAAAA,EACAG,gBAAAA,cC1EG,4DASHO,yHATRC,2BAAAC,GACIF,qCACU,0BACDG,sCAAOC,kCACXC,SAAUD,sBACXE,kBAAQC,oCAEDA,OAAKC,KAAKf,iBAAmBW,wBAAxCH,kEACOM,mCAAoCH,iBACvCK,EACAT,0BACSG,uDAAeC,sDACnBC,SAAUD,sBACXE,kBAAQC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),t=require("vuex"),l=require("@perevorot/shop/dist/helpers"),n=require("swiper/core");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(n);r.default.use([n.Navigation]);var c=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var n=t.useStore(),o=e.ref(!1),c=e.computed((function(){return n.getters["cart/items"]})),a=e.computed((function(){return n.getters["cart/modal"]})),s=e.computed((function(){return n.getters["cart/total"]})),i=e.computed((function(){return n.getters["cart/quantity"]})),d=function(){n.commit("cart/modal",!1)};n.dispatch("cart/get",{finally:function(){}}),window.addEventListener("keyup",(function(e){a.value&&"Escape"===e.key&&d()}));var m,u,p=e.ref(null),v=e.ref(null),E=e.ref(null),N=e.computed((function(){var e=n.getters["cart/cross"];return p.value&&(m&&m.destroy(),e.length&&(m=new r.default(p.value,{slidesPerView:2,slidesPerGroup:2,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:v.value,prevEl:E.value}}))),e})),V=e.ref(null),k=e.ref(null),f=e.ref(null),g=e.computed((function(){var e=n.getters["cart/bundles"];return V.value&&(u&&u.destroy(),e.length&&(u=new r.default(V.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:k.value,prevEl:f.value}}))),e}));return window.addEventListener("beforeunload",(function(){n.commit("cart/modal",null)})),{loading:o,items:c,modal:a,total:s,quantity:i,open:function(){n.commit("cart/modal",!0)},close:d,clear:function(){o.value=!0,n.dispatch("cart/clear",{finally:function(){o.value=!1}})},pluralize:l.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){n.commit("cart/modal",!1)})),window.location.href=e},cross:N,crossSlider:p,crossSliderPrev:E,crossSliderNext:v,bundles:g,bundlesSlider:V,bundlesSliderPrev:f,bundlesSliderNext:k}}}),a={class:"cart"},s={class:"dropdown is-right is-hoverable"},i={class:"dropdown-trigger"},d=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),m=e.createElementVNode("span",{class:"icon is-small"},[e.createElementVNode("i",{class:"fas fa-angle-down","aria-hidden":"true"})],-1),u={class:"dropdown-menu",role:"menu"},p={key:0,class:"dropdown-content"},v={class:"dropdown-item"},E={class:"columns"},N={class:"column"},V=["innerHTML"],k=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),f={class:"dropdown-item has-text-centered"},g=["href"],h={class:"dropdown-item has-text-centered"},B={key:1,class:"dropdown-content"},w=e.createElementVNode("div",{class:"dropdown-item"},"Ваша корзина пуста",-1),y={class:"modal-content"},C=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],b={class:"box"},x={class:"cart-title"},T=e.createTextVNode("Корзина "),L=["textContent"],M={key:0,class:"items-wrapper"},S={class:"items"},H={class:"columns is-gapless is-vcentered main-actions"},$={class:"column"},q={class:"column has-text-right"},z={class:"totals"},D={class:"title"},P=e.createTextVNode("Итого: "),_=["innerHTML"],F={class:"column is-narrow"},O=["href"],A={key:0,class:"cross"},j=e.createElementVNode("div",{class:"title"},"С товарами из вашей корзины часто покупают",-1),G={class:"swiper-container",ref:"crossSlider"},I={class:"swiper-wrapper"},J={class:"columns is-gapless"},K={class:"column is-narrow"},Q=["onClick"],R=["src"],U={key:1},W=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],X={class:"column"},Y={class:"product"},Z={class:"name"},ee=["onClick"],te={class:"columns is-gapless is-vcentered"},le={class:"column is-narrow"},ne={class:"prices"},oe=["innerHTML"],re=["innerHTML"],ce={class:"column"},ae=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),se={class:"swiper-nav prev",ref:"crossSliderPrev"},ie=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],de={class:"swiper-nav next",ref:"crossSliderNext"},me=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ue={key:1,class:"bundles"},pe=e.createElementVNode("div",{class:"title"},"Вместе дешевле",-1),ve={class:"swiper-container",ref:"bundlesSlider"},Ee={class:"swiper-wrapper"},Ne={class:"column is-narrow"},Ve=["onClick"],ke=["src"],fe={key:1},ge=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],he={class:"column"},Be={class:"product"},we={class:"name"},ye=["onClick"],Ce={class:"columns is-gapless is-vcentered"},be={class:"prices"},xe=["innerHTML"],Te=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),Le={class:"column is-narrow"},Me=["onClick"],Se=["src"],He={key:1},$e=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],qe={class:"column"},ze={class:"product"},De={class:"name"},Pe=["onClick"],_e={class:"columns is-gapless is-vcentered"},Fe={class:"prices"},Oe=["innerHTML"],Ae={key:0,class:"column is-narrow"},je=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Ge={key:1,class:"column is-narrow"},Ie=["onClick"],Je=["src"],Ke={key:1},Qe=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Re={key:2,class:"column"},Ue={class:"product"},We={class:"name"},Xe=["onClick"],Ye={class:"columns is-gapless is-vcentered"},Ze={class:"prices"},et=["innerHTML"],tt={class:"columns is-vcentered"},lt={class:"column"},nt=["innerHTML"],ot=["innerHTML"],rt={class:"column"},ct={class:"is-flex is-align-items-center"},at=["innerHTML"],st={class:"swiper-nav prev",ref:"bundlesSliderPrev"},it=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],dt={class:"swiper-nav next",ref:"bundlesSliderNext"},mt=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ut={key:1,class:"empty"},pt=e.createElementVNode("div",{class:"title"},"В корзине пока что нет товаров",-1),vt={class:"message"},Et=e.createTextVNode("Посмотрите предложения на "),Nt=e.createTextVNode(","),Vt=e.createElementVNode("br",null,null,-1),kt=e.createTextVNode("воспользуйтесь каталогом или поиском"),ft={class:"viewed-wrapper"};c.render=function(t,l,n,o,r,c){var gt=e.resolveComponent("cart-item"),ht=e.resolveComponent("cart-add"),Bt=e.resolveComponent("bundle-add"),wt=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",s,[e.createElementVNode("div",i,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open},(function(){return[e.createElementVNode("button",{class:"button",onClick:l[0]||(l[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",null,[d,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),m])]}))]),e.createElementVNode("div",u,[t.items.length?(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,[e.createElementVNode("div",N,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,V)])]),k,e.createElementVNode("div",f,[e.createElementVNode("a",{href:t.$ziggy("shop.checkout"),class:"button is-link"},e.toDisplayString(t.__("shop.cart.checkout")),9,g)]),e.createElementVNode("div",h,[e.renderSlot(t.$slots,"open",{open:t.open},(function(){return[e.createElementVNode("a",{onClick:l[1]||(l[1]=function(){return t.open&&t.open.apply(t,arguments)})},"Открыть корзину")]}))])])):(e.openBlock(),e.createElementBlock("div",B,[e.renderSlot(t.$slots,"empty",{},(function(){return[w]}))]))])]),t.isModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:l[2]||(l[2]=function(){return t.close&&t.close.apply(t,arguments)})}),e.createElementVNode("div",y,[e.createElementVNode("button",{class:"modal-close is-large",onClick:l[3]||(l[3]=function(){return t.close&&t.close.apply(t,arguments)})},C),e.createElementVNode("div",b,[e.createElementVNode("div",x,[T,t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,L)):e.createCommentVNode("v-if",!0)]),t.items.length?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(gt,{key:t.id,item:t},null,8,["item"])})),128))]),e.createElementVNode("div",H,[e.createElementVNode("div",$,[e.createElementVNode("button",{class:"button continue",onClick:l[4]||(l[4]=function(){return t.close&&t.close.apply(t,arguments)})},"Продолжить покупки")]),e.createElementVNode("div",q,[e.createElementVNode("div",z,[e.createElementVNode("div",D,[P,e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,_)])])]),e.createElementVNode("div",F,[e.createElementVNode("a",{href:t.$ziggy("shop.checkout"),class:"button is-link checkout"},"Оформить заказ",8,O)])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",A,[j,e.createElementVNode("div",G,[e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cross,(function(l){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:l.id},[e.createElementVNode("div",J,[e.createElementVNode("div",K,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!l.image}])},[l.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.image},null,8,R)):(e.openBlock(),e.createElementBlock("svg",U,W))],2)],8,Q)]),e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.href)}},e.toDisplayString(l.name),9,ee)]),e.createElementVNode("div",te,[e.createElementVNode("div",le,[e.createElementVNode("div",ne,[l.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(l.priceOld)},null,8,oe)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.price)},null,8,re)])]),e.createElementVNode("div",ce,[e.createVNode(ht,{id:l.id,"is-simple":!0},{default:e.withCtx((function(){return[ae]})),_:2},1032,["id"])])])])])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",se,ie,512)),(e.openBlock(),e.createElementBlock("svg",de,me,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",ue,[pe,e.createElementVNode("div",ve,[e.createElementVNode("div",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bundles,(function(l){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:l.id},[e.createElementVNode("div",{class:e.normalizeClass(["columns is-gapless is-vcentered",{"is-third":l.third}])},[e.createElementVNode("div",Ne,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!l.image}])},[l.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.image},null,8,ke)):(e.openBlock(),e.createElementBlock("svg",fe,ge))],2)],8,Ve)]),e.createElementVNode("div",he,[e.createElementVNode("div",Be,[e.createElementVNode("div",we,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.href)}},e.toDisplayString(l.name),9,ye)]),e.createElementVNode("div",Ce,[e.createElementVNode("div",be,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.price)},null,8,xe)])])])]),Te,e.createElementVNode("div",Le,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.second.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!l.second.image}])},[l.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.second.image},null,8,Se)):(e.openBlock(),e.createElementBlock("svg",He,$e))],2)],8,Me)]),e.createElementVNode("div",qe,[e.createElementVNode("div",ze,[e.createElementVNode("div",De,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.second.href)}},e.toDisplayString(l.second.name),9,Pe)]),e.createElementVNode("div",_e,[e.createElementVNode("div",Fe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.second.price)},null,8,Oe)])])])]),l.third?(e.openBlock(),e.createElementBlock("div",Ae,je)):e.createCommentVNode("v-if",!0),l.third?(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.third.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!l.third.image}])},[l.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:l.third.image},null,8,Je)):(e.openBlock(),e.createElementBlock("svg",Ke,Qe))],2)],8,Ie)])):e.createCommentVNode("v-if",!0),l.third?(e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("div",Ue,[e.createElementVNode("div",We,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.third.href)}},e.toDisplayString(l.third.name),9,Xe)]),e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.third.price)},null,8,et)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",tt,[e.createElementVNode("div",lt,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(l.bundle.priceOld)},null,8,nt),e.createElementVNode("span",{class:"bundle-amount",innerHTML:"Выгода "+l.bundle.amount},null,8,ot)]),e.createElementVNode("div",rt,[e.createElementVNode("div",ct,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(l.bundle.price)},null,8,at),e.createVNode(Bt,{id:l.id,second:l.second.id,third:l.third?l.third.id:null},null,8,["id","second","third"])])])])])})),128))])],512),(e.openBlock(),e.createElementBlock("svg",st,it,512)),(e.openBlock(),e.createElementBlock("svg",dt,mt,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",ut,[pt,e.createElementVNode("div",vt,[Et,e.createElementVNode("a",{onClick:l[5]||(l[5]=function(e){return t.goto(t.$env.locale.url+"/")})},"главной странице"),Nt,Vt,kt]),e.createElementVNode("button",{class:"button continue",onClick:l[6]||(l[6]=function(){return t.close&&t.close.apply(t,arguments)})},"Продолжить покупки"),e.createElementVNode("div",ft,[e.createVNode(wt,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)])},module.exports=c;
|
|
2
|
+
//# sourceMappingURL=Cart.js.map
|