@perevorot/shop 2.0.136 → 2.0.138
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/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/components/shop/cart/Cart.js +1 -1
- package/dist/components/shop/cart/Cart.js.map +1 -1
- package/dist/components/shop/cart/CartAdd.js +1 -1
- package/dist/components/shop/cart/CartAdd.js.map +1 -1
- package/dist/components/shop/cart/CartItem.js +1 -1
- package/dist/components/shop/cart/CartItem.js.map +1 -1
- package/dist/components/shop/cart/CartTrigger.js +1 -1
- package/dist/components/shop/cart/CartTrigger.js.map +1 -1
- package/dist/store.js +1 -1
- package/dist/store.js.map +1 -1
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t={auth:{me:function(){return $http.post($ziggy("auth.me"))},login:function(t){return $http.post($ziggy("auth.login"),t)},logout:function(){return $http.post($ziggy("auth.logout"))},reset:function(t){return $http.post($ziggy("auth.password.email"),t)},resetSms:function(t){return $http.post($ziggy("auth.password.sms"),t)},passwordUpdate:function(t){return $http.post($ziggy("auth.password.update"),t)},registerShort:function(t){return $http.post($ziggy("auth.register.short"),t)},registerFull:function(t){return $http.post($ziggy("auth.register.full"),t)},registerForm:function(){return $http.post($ziggy("auth.register.form"))},update:function(t){return $http.post($ziggy("auth.register.update"),t)}},cart:{items:function(){return $http.post($ziggy("api.cart"),{action:"get"})},add:function(t){return $http.post($ziggy("api.cart"),{action:"add",id:t.id,quantity:t.quantity,options:!!t.options&&t.options,extra:!!t.extra&&t.extra})},options:function(t){return $http.post($ziggy("api.cart"),{action:"options",id:t.id,options:t.options})},addBundle:function(t){return $http.post($ziggy("api.cart"),{action:"addBundle",id:t.id,second:t.second,third:t.third})},remove:function(t){return $http.post($ziggy("api.cart"),{action:"remove",id:t})},clear:function(){return $http.post($ziggy("api.cart"),{action:"clear"})},quantity:function(t){return $http.post($ziggy("api.cart"),{action:"quantity",id:t.id,exact:t.exact})}},compare:{items:function(){return $http.post($ziggy("api.compare"),{action:"get"})},category:function(t){return $http.post($ziggy("api.compare"),{action:"category",slug:t})},toggle:function(t){return $http.post($ziggy("api.compare"),{action:"toggle",id:t})},delete:function(t){return $http.post($ziggy("api.compare"),{action:"delete",id:t})},modal:function(t){return $http.post($ziggy("api.compare"),{action:"modal",id:t})}},shop:{search:function(t){return $http.post($ziggy("api.search"),{term:t})}},wishlist:{items:function(){return $http.post($ziggy("api.wishlist"),{action:"get"})},toggle:function(t){return $http.post($ziggy("api.wishlist"),{action:"toggle",id:t})}}};module.exports=t;
|
|
1
|
+
"use strict";var t={auth:{me:function(){return $http.post($ziggy("auth.me"))},login:function(t){return $http.post($ziggy("auth.login"),t)},logout:function(){return $http.post($ziggy("auth.logout"))},reset:function(t){return $http.post($ziggy("auth.password.email"),t)},resetSms:function(t){return $http.post($ziggy("auth.password.sms"),t)},passwordUpdate:function(t){return $http.post($ziggy("auth.password.update"),t)},registerShort:function(t){return $http.post($ziggy("auth.register.short"),t)},registerFull:function(t){return $http.post($ziggy("auth.register.full"),t)},registerForm:function(){return $http.post($ziggy("auth.register.form"))},update:function(t){return $http.post($ziggy("auth.register.update"),t)}},cart:{items:function(t){return $http.post($ziggy("api.cart"),{action:"get",storage:t})},add:function(t,i){return $http.post($ziggy("api.cart"),{action:"add",id:t.id,quantity:t.quantity,options:!!t.options&&t.options,extra:!!t.extra&&t.extra,storage:i})},options:function(t,i){return $http.post($ziggy("api.cart"),{action:"options",id:t.id,options:t.options,storage:i})},addBundle:function(t){return $http.post($ziggy("api.cart"),{action:"addBundle",id:t.id,second:t.second,third:t.third})},remove:function(t,i){return $http.post($ziggy("api.cart"),{action:"remove",id:t,storage:i})},clear:function(t){return $http.post($ziggy("api.cart"),{action:"clear",storage:t})},quantity:function(t,i){return $http.post($ziggy("api.cart"),{action:"quantity",id:t.id,exact:t.exact,storage:i})}},compare:{items:function(){return $http.post($ziggy("api.compare"),{action:"get"})},category:function(t){return $http.post($ziggy("api.compare"),{action:"category",slug:t})},toggle:function(t){return $http.post($ziggy("api.compare"),{action:"toggle",id:t})},delete:function(t){return $http.post($ziggy("api.compare"),{action:"delete",id:t})},modal:function(t){return $http.post($ziggy("api.compare"),{action:"modal",id:t})}},shop:{search:function(t){return $http.post($ziggy("api.search"),{term:t})}},wishlist:{items:function(){return $http.post($ziggy("api.wishlist"),{action:"get"})},toggle:function(t){return $http.post($ziggy("api.wishlist"),{action:"toggle",id:t})}}};module.exports=t;
|
|
2
2
|
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["../src/api/modules/auth.js","../src/api/index.js","../src/api/modules/cart.js","../src/api/modules/compare.js","../src/api/modules/shop.js","../src/api/modules/wishlist.js"],"sourcesContent":["export default {\n me() {\n return $http.post($ziggy('auth.me'));\n },\n login(credentials) {\n return $http.post($ziggy('auth.login'), credentials);\n },\n logout() {\n return $http.post($ziggy('auth.logout'));\n },\n reset(credentials) {\n return $http.post($ziggy('auth.password.email'), credentials);\n },\n resetSms(credentials) {\n return $http.post($ziggy('auth.password.sms'), credentials);\n },\n passwordUpdate(credentials) {\n return $http.post($ziggy('auth.password.update'), credentials);\n },\n registerShort(credentials) {\n return $http.post($ziggy('auth.register.short'), credentials);\n },\n registerFull(credentials) {\n return $http.post($ziggy('auth.register.full'), credentials);\n },\n registerForm() {\n return $http.post($ziggy('auth.register.form'));\n },\n update(credentials) {\n return $http.post($ziggy('auth.register.update'), credentials);\n },\n};\n","import auth from './modules/auth';\nimport cart from './modules/cart';\nimport compare from './modules/compare';\nimport shop from './modules/shop';\nimport wishlist from './modules/wishlist';\n\nexport default {\n auth,\n cart,\n compare,\n shop,\n wishlist\n};","export default {\n items() {\n return $http.post($ziggy('api.cart'), {\n action: 'get',\n });\n },\n\n add(item) {\n return $http.post($ziggy('api.cart'), {\n action: 'add',\n id: item.id,\n quantity: item.quantity,\n options: item.options ? item.options : false,\n extra: item.extra ? item.extra : false,\n });\n },\n\n options(item) {\n return $http.post($ziggy('api.cart'), {\n action: 'options',\n id: item.id,\n options: item.options,\n });\n },\n\n addBundle(item) {\n return $http.post($ziggy('api.cart'), {\n action: 'addBundle',\n id: item.id,\n second: item.second,\n third: item.third,\n });\n },\n\n remove(id) {\n return $http.post($ziggy('api.cart'), {\n action: 'remove',\n id: id,\n });\n },\n\n clear() {\n return $http.post($ziggy('api.cart'), {\n action: 'clear',\n });\n },\n\n quantity(item) {\n return $http.post($ziggy('api.cart'), {\n action: 'quantity',\n id: item.id,\n exact: item.exact,\n });\n },\n};\n","export default {\n items() {\n return $http.post($ziggy('api.compare'), {\n action: 'get',\n });\n },\n\n category(slug) {\n return $http.post($ziggy('api.compare'), {\n action: 'category',\n slug: slug,\n });\n },\n\n toggle(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'toggle',\n id: id,\n });\n },\n\n delete(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'delete',\n id: id,\n });\n },\n modal(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'modal',\n id: id,\n });\n },\n};\n","export default {\n search(term) {\n return $http.post($ziggy(\"api.search\"), {\n term: term,\n });\n },\n}","export default {\n items() {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"get\",\n });\n },\n\n toggle(id) {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"toggle\",\n id: id\n });\n },\n}"],"names":["auth","me","$http","post","$ziggy","login","credentials","logout","reset","resetSms","passwordUpdate","registerShort","registerFull","registerForm","update","cart","items","action","add","item","id","quantity","options","extra","addBundle","second","third","remove","clear","exact","compare","category","slug","toggle","modal","shop","search","term","wishlist"],"mappings":"aAAA,MCMe,CACXA,KDPW,CACXC,qBACWC,MAAMC,KAAKC,OAAO,aAE7BC,eAAMC,UACKJ,MAAMC,KAAKC,OAAO,cAAeE,IAE5CC,yBACWL,MAAMC,KAAKC,OAAO,iBAE7BI,eAAMF,UACKJ,MAAMC,KAAKC,OAAO,uBAAwBE,IAErDG,kBAASH,UACEJ,MAAMC,KAAKC,OAAO,qBAAsBE,IAEnDI,wBAAeJ,UACJJ,MAAMC,KAAKC,OAAO,wBAAyBE,IAEtDK,uBAAcL,UACHJ,MAAMC,KAAKC,OAAO,uBAAwBE,IAErDM,sBAAaN,UACFJ,MAAMC,KAAKC,OAAO,sBAAuBE,IAEpDO,+BACWX,MAAMC,KAAKC,OAAO,wBAE7BU,gBAAOR,UACIJ,MAAMC,KAAKC,OAAO,wBAAyBE,KCrBtDS,KCRW,CACXC,
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../src/api/modules/auth.js","../src/api/index.js","../src/api/modules/cart.js","../src/api/modules/compare.js","../src/api/modules/shop.js","../src/api/modules/wishlist.js"],"sourcesContent":["export default {\n me() {\n return $http.post($ziggy('auth.me'));\n },\n login(credentials) {\n return $http.post($ziggy('auth.login'), credentials);\n },\n logout() {\n return $http.post($ziggy('auth.logout'));\n },\n reset(credentials) {\n return $http.post($ziggy('auth.password.email'), credentials);\n },\n resetSms(credentials) {\n return $http.post($ziggy('auth.password.sms'), credentials);\n },\n passwordUpdate(credentials) {\n return $http.post($ziggy('auth.password.update'), credentials);\n },\n registerShort(credentials) {\n return $http.post($ziggy('auth.register.short'), credentials);\n },\n registerFull(credentials) {\n return $http.post($ziggy('auth.register.full'), credentials);\n },\n registerForm() {\n return $http.post($ziggy('auth.register.form'));\n },\n update(credentials) {\n return $http.post($ziggy('auth.register.update'), credentials);\n },\n};\n","import auth from './modules/auth';\nimport cart from './modules/cart';\nimport compare from './modules/compare';\nimport shop from './modules/shop';\nimport wishlist from './modules/wishlist';\n\nexport default {\n auth,\n cart,\n compare,\n shop,\n wishlist\n};","export default {\n items(cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'get',\n storage: cart,\n });\n },\n\n add(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'add',\n id: item.id,\n quantity: item.quantity,\n options: item.options ? item.options : false,\n extra: item.extra ? item.extra : false,\n storage: cart,\n });\n },\n\n options(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'options',\n id: item.id,\n options: item.options,\n storage: cart,\n });\n },\n\n addBundle(item) {\n return $http.post($ziggy('api.cart'), {\n action: 'addBundle',\n id: item.id,\n second: item.second,\n third: item.third,\n });\n },\n\n remove(id, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'remove',\n id: id,\n storage: cart,\n });\n },\n\n clear(cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'clear',\n storage: cart,\n });\n },\n\n quantity(item, cart) {\n return $http.post($ziggy('api.cart'), {\n action: 'quantity',\n id: item.id,\n exact: item.exact,\n storage: cart,\n });\n },\n};\n","export default {\n items() {\n return $http.post($ziggy('api.compare'), {\n action: 'get',\n });\n },\n\n category(slug) {\n return $http.post($ziggy('api.compare'), {\n action: 'category',\n slug: slug,\n });\n },\n\n toggle(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'toggle',\n id: id,\n });\n },\n\n delete(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'delete',\n id: id,\n });\n },\n modal(id) {\n return $http.post($ziggy('api.compare'), {\n action: 'modal',\n id: id,\n });\n },\n};\n","export default {\n search(term) {\n return $http.post($ziggy(\"api.search\"), {\n term: term,\n });\n },\n}","export default {\n items() {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"get\",\n });\n },\n\n toggle(id) {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"toggle\",\n id: id\n });\n },\n}"],"names":["auth","me","$http","post","$ziggy","login","credentials","logout","reset","resetSms","passwordUpdate","registerShort","registerFull","registerForm","update","cart","items","action","storage","add","item","id","quantity","options","extra","addBundle","second","third","remove","clear","exact","compare","category","slug","toggle","modal","shop","search","term","wishlist"],"mappings":"aAAA,MCMe,CACXA,KDPW,CACXC,qBACWC,MAAMC,KAAKC,OAAO,aAE7BC,eAAMC,UACKJ,MAAMC,KAAKC,OAAO,cAAeE,IAE5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,wBACWd,MAAMC,KAAKC,OAAO,eAAgB,CACrCa,OAAQ,SAIhBe,kBAASC,UACE/B,MAAMC,KAAKC,OAAO,eAAgB,CACrCa,OAAQ,WACRgB,KAAMA,KAIdC,gBAAOb,UACInB,MAAMC,KAAKC,OAAO,eAAgB,CACrCa,OAAQ,SACRI,GAAIA,qBAILA,UACInB,MAAMC,KAAKC,OAAO,eAAgB,CACrCa,OAAQ,SACRI,GAAIA,KAGZc,eAAMd,UACKnB,MAAMC,KAAKC,OAAO,eAAgB,CACrCa,OAAQ,QACRI,GAAIA,MFpBZe,KGVW,CACXC,gBAAOC,UACIpC,MAAMC,KAAKC,OAAO,cAAe,CACpCkC,KAAMA,MHQdC,SIXW,CACXvB,wBACWd,MAAMC,KAAKC,OAAO,gBAAiB,CACtCa,OAAQ,SAIhBiB,gBAAOb,UACInB,MAAMC,KAAKC,OAAO,gBAAiB,CACtCa,OAAQ,SACRI,GAAIA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t=require("vuex"),l=require("@perevorot/shop/dist/helpers"),n=require("swiper");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(n),c=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0}},setup:function(){var o=t.useStore(),c=e.ref(!1),a=e.computed((function(){return o.getters["cart/items"]})),s=e.computed((function(){return o.getters["cart/modal"]})),i=e.computed((function(){return o.getters["cart/total"]})),d=e.computed((function(){return o.getters["cart/quantity"]})),u=function(){o.commit("cart/modal",null)};o.dispatch("cart/get",{finally:function(){}}),document.body.addEventListener("click",(function(e){s.value&&!e.target.closest(".cart")&&u()})),window.addEventListener("keyup",(function(e){s.value&&"Escape"===e.key&&u()}));var m,p,v=e.ref(null),E=e.ref(null),k=e.ref(null),N=e.computed((function(){var e=o.getters["cart/cross"];return v.value&&(m&&m.destroy(),e.length&&(m=new r.default(v.value,{slidesPerView:1,slidesPerGroup:1,breakpoints:{768:{slidesPerView:2,slidesPerGroup:2}},spaceBetween:0,allowTouchMove:!0,modules:[n.Navigation],mousewheel:{forceToAxis:!0},navigation:{nextEl:E.value,prevEl:k.value}}))),e})),V=e.ref(null),f=e.ref(null),g=e.ref(null),h=e.computed((function(){var e=o.getters["cart/bundles"];return V.value&&(p&&p.destroy(),e.length&&(p=new r.default(V.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:f.value,prevEl:g.value}}))),e}));window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",null)}));var y=e.ref(!1);return{loading:c,items:a,modal:s,total:i,quantity:d,open:function(){o.commit("cart/modal",s.value?null:"cart")},close:u,clear:function(){c.value=!0,o.dispatch("cart/clear",{finally:function(){c.value=!1}})},pluralize:l.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){o.commit("cart/modal",null)})),window.addEventListener("pagehide",(function(){o.commit("cart/modal",null)})),window.location.href=e},cross:N,crossSlider:v,crossSliderPrev:k,crossSliderNext:E,bundles:h,bundlesSlider:V,bundlesSliderPrev:g,bundlesSliderNext:f,checkout:function(){y.value=!0,window.location.href=$ziggy("shop.checkout")},isLoading:y}}}),a={class:"dropdown is-right is-hoverable"},s={class:"dropdown-trigger"},i=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),d=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"},m={key:0,class:"dropdown-content"},p={class:"dropdown-item"},v={class:"columns"},E={class:"column"},k=["innerHTML"],N=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),V={class:"dropdown-item has-text-centered"},f={class:"dropdown-item has-text-centered"},g={key:1,class:"dropdown-content"},h={class:"dropdown-item"},y={class:"modal-content"},w=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],B={class:"box"},b={class:"cart-title"},C=["textContent"],_={key:0,class:"items-wrapper"},S={class:"items"},x={class:"columns is-gapless is-vcentered main-actions"},L={class:"column"},T={class:"column has-text-right"},M={class:"totals"},D={class:"title"},H=["innerHTML"],$={class:"column is-narrow"},q={key:0,class:"cross"},z={class:"title"},P={class:"swiper",ref:"crossSlider"},F={class:"swiper-wrapper"},O={class:"columns is-gapless"},A={class:"column is-narrow"},G=["onClick"],j=["src"],R={key:1},I=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],J={class:"column"},K=["data-code"],Q={class:"name"},U=["onClick"],W={class:"columns is-gapless is-vcentered"},X={class:"column is-narrow"},Y={class:"prices"},Z=["innerHTML"],ee=["innerHTML"],te={class:"column"},le=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),ne={class:"swiper-nav prev",ref:"crossSliderPrev"},oe=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],re={class:"swiper-nav next",ref:"crossSliderNext"},ce=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ae={key:1,class:"bundles"},se={class:"title"},ie={class:"swiper",ref:"bundlesSlider"},de={class:"swiper-wrapper"},ue={class:"column is-narrow"},me=["onClick"],pe=["src"],ve={key:1},Ee=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],ke={class:"column"},Ne={class:"product"},Ve={class:"name"},fe=["onClick"],ge={class:"columns is-gapless is-vcentered"},he={class:"prices"},ye=["innerHTML"],we=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),Be={class:"column is-narrow"},be=["onClick"],Ce=["src"],_e={key:1},Se=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],xe={class:"column"},Le={class:"product"},Te={class:"name"},Me=["onClick"],De={class:"columns is-gapless is-vcentered"},He={class:"prices"},$e=["innerHTML"],qe={key:0,class:"column is-narrow"},ze=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Pe={key:1,class:"column is-narrow"},Fe=["onClick"],Oe=["src"],Ae={key:1},Ge=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],je={key:2,class:"column"},Re={class:"product"},Ie={class:"name"},Je=["onClick"],Ke={class:"columns is-gapless is-vcentered"},Qe={class:"prices"},Ue=["innerHTML"],We={class:"columns is-vcentered"},Xe={class:"column"},Ye=["innerHTML"],Ze=["innerHTML"],et={class:"column"},tt={class:"is-flex is-align-items-center"},lt=["innerHTML"],nt={class:"swiper-nav prev",ref:"bundlesSliderPrev"},ot=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],rt={class:"swiper-nav next",ref:"bundlesSliderNext"},ct=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],at={key:1,class:"empty"},st={class:"title"},it={class:"message"},dt=["href"],ut=e.createElementVNode("br",null,null,-1),mt={class:"viewed-wrapper"};c.render=function(t,l,n,o,r,c){var pt=e.resolveComponent("cart-item"),vt=e.resolveComponent("cart-add"),Et=e.resolveComponent("bundle-add"),kt=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cart",{"is-open":t.modal}])},[e.createElementVNode("div",a,[e.createElementVNode("div",s,[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,[i,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),d])]}))]),e.createElementVNode("div",u,[t.items.length?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,k)])]),N,e.createElementVNode("div",V,[e.createElementVNode("a",{onClick:l[1]||(l[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:e.normalizeClass(["button is-link",{"is-disabled":t.isLoading}])},e.toDisplayString(t.__("shop.cart.checkout")),3)]),e.createElementVNode("div",f,[e.renderSlot(t.$slots,"open",{open:t.open},(function(){return[e.createElementVNode("a",{onClick:l[2]||(l[2]=function(){return t.open&&t.open.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.open")),1)]}))])])):(e.openBlock(),e.createElementBlock("div",g,[e.renderSlot(t.$slots,"empty",{},(function(){return[e.createElementVNode("div",h,e.toDisplayString(t.__("shop.cart.empty")),1)]}))]))])]),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[3]||(l[3]=function(){return t.close&&t.close.apply(t,arguments)})}),e.createElementVNode("div",y,[e.createElementVNode("button",{class:"modal-close is-large",onClick:l[4]||(l[4]=function(){return t.close&&t.close.apply(t,arguments)})},w),e.createElementVNode("div",B,[e.createElementVNode("div",b,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.title"))+" ",1),t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,C)):e.createCommentVNode("v-if",!0)]),e.renderSlot(t.$slots,"clear",{clear:t.clear,quantity:t.quantity}),t.items.length?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(l){return e.openBlock(),e.createBlock(pt,{key:l.id,item:l},e.createSlots({_:2},[e.renderList(t.$slots,(function(l,n){return{name:n,fn:e.withCtx((function(l){return[e.renderSlot(t.$slots,n,e.normalizeProps(e.guardReactiveProps(l||{})))]}))}}))]),1032,["item"])})),128))]),e.createElementVNode("div",x,[e.createElementVNode("div",L,[e.createElementVNode("button",{class:"button continue",onClick:l[5]||(l[5]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)]),e.createElementVNode("div",T,[e.createElementVNode("div",M,[e.createElementVNode("div",D,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.total"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,H)])]),e.renderSlot(t.$slots,"loyalty",{pluralize:t.pluralize,items:t.items})]),e.createElementVNode("div",$,[e.createElementVNode("a",{onClick:l[6]||(l[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},e.toDisplayString(t.__("shop.cart.go_checkout")),1)])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",z,e.toDisplayString(t.__("shop.cart.cross")),1),e.createElementVNode("div",P,[e.createElementVNode("div",F,[(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",O,[e.createElementVNode("div",A,[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,j)):(e.openBlock(),e.createElementBlock("svg",R,I))],2)],8,G)]),e.createElementVNode("div",J,[e.createElementVNode("div",{class:"product","data-code":l.code,"shop-product":""},[e.createElementVNode("div",Q,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.href)},"shop-product-name":""},e.toDisplayString(l.name),9,U)]),e.createElementVNode("div",W,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[l.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(l.priceOld)},null,8,Z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.price),"shop-product-price":""},null,8,ee)])]),e.createElementVNode("div",te,[e.createVNode(vt,{id:l.id,"is-simple":!0},{default:e.withCtx((function(){return[le]})),_:2},1032,["id"])])])],8,K)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",ne,oe,512)),(e.openBlock(),e.createElementBlock("svg",re,ce,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",se,e.toDisplayString(t.__("shop.cart.bundle")),1),e.createElementVNode("div",ie,[e.createElementVNode("div",de,[(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",ue,[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,pe)):(e.openBlock(),e.createElementBlock("svg",ve,Ee))],2)],8,me)]),e.createElementVNode("div",ke,[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ve,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.href)}},e.toDisplayString(l.name),9,fe)]),e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.price)},null,8,ye)])])])]),we,e.createElementVNode("div",Be,[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,Ce)):(e.openBlock(),e.createElementBlock("svg",_e,Se))],2)],8,be)]),e.createElementVNode("div",xe,[e.createElementVNode("div",Le,[e.createElementVNode("div",Te,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.second.href)}},e.toDisplayString(l.second.name),9,Me)]),e.createElementVNode("div",De,[e.createElementVNode("div",He,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.second.price)},null,8,$e)])])])]),l.third?(e.openBlock(),e.createElementBlock("div",qe,ze)):e.createCommentVNode("v-if",!0),l.third?(e.openBlock(),e.createElementBlock("div",Pe,[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,Oe)):(e.openBlock(),e.createElementBlock("svg",Ae,Ge))],2)],8,Fe)])):e.createCommentVNode("v-if",!0),l.third?(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[e.createElementVNode("div",Ie,[e.createElementVNode("a",{onClick:function(e){return t.goto(l.third.href)}},e.toDisplayString(l.third.name),9,Je)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(l.third.price)},null,8,Ue)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(l.bundle.priceOld)},null,8,Ye),e.createElementVNode("span",{class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+l.bundle.amount},null,8,Ze)]),e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(l.bundle.price)},null,8,lt),e.createVNode(Et,{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",nt,ot,512)),(e.openBlock(),e.createElementBlock("svg",rt,ct,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",st,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",it,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dt),e.createTextVNode(", "),ut,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("button",{class:"button continue",onClick:l[7]||(l[7]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1),e.createElementVNode("div",mt,[e.createVNode(kt,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)],2)},module.exports=c;
|
|
1
|
+
"use strict";var e=require("vue"),t=require("vuex"),n=require("@perevorot/shop/dist/helpers"),l=require("swiper");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=o(l),c=e.defineComponent({name:"cart",props:{isModal:{type:Boolean,default:!0},cartStorage:{type:String,default:"cart"}},setup:function(o){var c=t.useStore(),a=e.ref(!1),s=o.cartStorage;e.provide("cartStorage",s);var i=e.computed((function(){return c.getters[s+"/items"]})),d=e.computed((function(){return c.getters[s+"/modal"]})),u=e.computed((function(){return c.getters[s+"/total"]})),m=e.computed((function(){return c.getters[s+"/quantity"]})),p=function(){c.commit(s+"/modal",null)};c.dispatch(s+"/get",{cart:s,finally:function(){}}),document.body.addEventListener("click",(function(e){d.value&&!e.target.closest(".cart")&&p()})),window.addEventListener("keyup",(function(e){d.value&&"Escape"===e.key&&p()}));var v,E,k=e.ref(null),N=e.ref(null),V=e.ref(null),f=e.computed((function(){var e=c.getters[s+"/cross"];return k.value&&(v&&v.destroy(),e.length&&(v=new r.default(k.value,{slidesPerView:1,slidesPerGroup:1,breakpoints:{768:{slidesPerView:2,slidesPerGroup:2}},spaceBetween:0,allowTouchMove:!0,modules:[l.Navigation],mousewheel:{forceToAxis:!0},navigation:{nextEl:N.value,prevEl:V.value}}))),e})),g=e.ref(null),h=e.ref(null),y=e.ref(null),w=e.computed((function(){var e=c.getters[s+"/bundles"];return g.value&&(E&&E.destroy(),e.length&&(E=new r.default(g.value,{slidesPerView:1,spaceBetween:0,allowTouchMove:!0,mousewheel:{forceToAxis:!0},navigation:{nextEl:h.value,prevEl:y.value}}))),e}));window.addEventListener("beforeunload",(function(){c.commit(s+"/modal",null)})),window.addEventListener("pagehide",(function(){c.commit(s+"/modal",null)}));var B=e.ref(!1);return{loading:a,items:i,modal:d,total:u,quantity:m,open:function(){c.commit(s+"/modal",d.value?null:"cart")},close:p,clear:function(){a.value=!0,c.dispatch(s+"/clear",{cart:s,finally:function(){a.value=!1}})},pluralize:n.pluralize,goto:function(e){window.addEventListener("beforeunload",(function(){c.commit(s+"/modal",null)})),window.addEventListener("pagehide",(function(){c.commit(s+"/modal",null)})),window.location.href=e},cross:f,crossSlider:k,crossSliderPrev:V,crossSliderNext:N,bundles:w,bundlesSlider:g,bundlesSliderPrev:y,bundlesSliderNext:h,checkout:function(){B.value=!0,window.location.href=$ziggy("shop.checkout")},isLoading:B}}}),a={class:"dropdown is-right is-hoverable"},s={class:"dropdown-trigger"},i=e.createElementVNode("i",{class:"fas fa-shopping-cart"},null,-1),d=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"},m={key:0,class:"dropdown-content"},p={class:"dropdown-item"},v={class:"columns"},E={class:"column"},k=["innerHTML"],N=e.createElementVNode("div",{class:"dropdown-divider"},null,-1),V={class:"dropdown-item has-text-centered"},f={class:"dropdown-item has-text-centered"},g={key:1,class:"dropdown-content"},h={class:"dropdown-item"},y={class:"modal-content"},w=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],B={class:"box"},b={class:"cart-title"},C=["textContent"],S={key:0,class:"items-wrapper"},_={class:"items"},x={class:"columns is-gapless is-vcentered main-actions"},L={class:"column"},T={class:"column has-text-right"},M={class:"totals"},D={class:"title"},H=["innerHTML"],$={class:"column is-narrow"},q={key:0,class:"cross"},z={class:"title"},P={class:"swiper",ref:"crossSlider"},F={class:"swiper-wrapper"},O={class:"columns is-gapless"},A={class:"column is-narrow"},G=["onClick"],j=["src"],R={key:1},I=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],J={class:"column"},K=["data-code"],Q={class:"name"},U=["onClick"],W={class:"columns is-gapless is-vcentered"},X={class:"column is-narrow"},Y={class:"prices"},Z=["innerHTML"],ee=["innerHTML"],te={class:"column"},ne=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-alternate"})],-1),le={class:"swiper-nav prev",ref:"crossSliderPrev"},oe=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],re={class:"swiper-nav next",ref:"crossSliderNext"},ce=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],ae={key:1,class:"bundles"},se={class:"title"},ie={class:"swiper",ref:"bundlesSlider"},de={class:"swiper-wrapper"},ue={class:"column is-narrow"},me=["onClick"],pe=["src"],ve={key:1},Ee=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],ke={class:"column"},Ne={class:"product"},Ve={class:"name"},fe=["onClick"],ge={class:"columns is-gapless is-vcentered"},he={class:"prices"},ye=["innerHTML"],we=e.createElementVNode("div",{class:"column is-narrow"},[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})])],-1),Be={class:"column is-narrow"},be=["onClick"],Ce=["src"],Se={key:1},_e=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],xe={class:"column"},Le={class:"product"},Te={class:"name"},Me=["onClick"],De={class:"columns is-gapless is-vcentered"},He={class:"prices"},$e=["innerHTML"],qe={key:0,class:"column is-narrow"},ze=[e.createElementVNode("svg",{class:"bundle-icon plus"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1)],Pe={key:1,class:"column is-narrow"},Fe=["onClick"],Oe=["src"],Ae={key:1},Ge=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],je={key:2,class:"column"},Re={class:"product"},Ie={class:"name"},Je=["onClick"],Ke={class:"columns is-gapless is-vcentered"},Qe={class:"prices"},Ue=["innerHTML"],We={class:"columns is-vcentered"},Xe={class:"column"},Ye=["innerHTML"],Ze=["innerHTML"],et={class:"column"},tt={class:"is-flex is-align-items-center"},nt=["innerHTML"],lt={class:"swiper-nav prev",ref:"bundlesSliderPrev"},ot=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],rt={class:"swiper-nav next",ref:"bundlesSliderNext"},ct=[e.createElementVNode("use",{"xlink:href":"#arrow-submenu"},null,-1)],at={key:1,class:"empty"},st={class:"title"},it={class:"message"},dt=["href"],ut=e.createElementVNode("br",null,null,-1),mt={class:"viewed-wrapper"};c.render=function(t,n,l,o,r,c){var pt=e.resolveComponent("cart-item"),vt=e.resolveComponent("cart-add"),Et=e.resolveComponent("bundle-add"),kt=e.resolveComponent("viewed");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cart",{"is-open":t.modal}])},[e.createElementVNode("div",a,[e.createElementVNode("div",s,[e.renderSlot(t.$slots,"default",{total:t.quantity,open:t.open},(function(){return[e.createElementVNode("button",{class:"button",onClick:n[0]||(n[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",null,[i,e.createTextVNode(" "+e.toDisplayString(t.quantity),1)]),d])]}))]),e.createElementVNode("div",u,[t.items.length?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",p,[e.createElementVNode("div",v,[e.createElementVNode("div",E,e.toDisplayString(t.__("shop.cart.total")),1),e.createElementVNode("div",{class:"column has-text-right",innerHTML:t.$filters.price(t.total)},null,8,k)])]),N,e.createElementVNode("div",V,[e.createElementVNode("a",{onClick:n[1]||(n[1]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:e.normalizeClass(["button is-link",{"is-disabled":t.isLoading}])},e.toDisplayString(t.__("shop.cart.checkout")),3)]),e.createElementVNode("div",f,[e.renderSlot(t.$slots,"open",{open:t.open},(function(){return[e.createElementVNode("a",{onClick:n[2]||(n[2]=function(){return t.open&&t.open.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.open")),1)]}))])])):(e.openBlock(),e.createElementBlock("div",g,[e.renderSlot(t.$slots,"empty",{},(function(){return[e.createElementVNode("div",h,e.toDisplayString(t.__("shop.cart.empty")),1)]}))]))])]),t.isModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal",{"is-active":t.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:n[3]||(n[3]=function(){return t.close&&t.close.apply(t,arguments)})}),e.createElementVNode("div",y,[e.createElementVNode("button",{class:"modal-close is-large",onClick:n[4]||(n[4]=function(){return t.close&&t.close.apply(t,arguments)})},w),e.createElementVNode("div",B,[e.renderSlot(t.$slots,"cart-title",{quantity:t.quantity},(function(){return[e.createElementVNode("div",b,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.title"))+" ",1),t.quantity?(e.openBlock(),e.createElementBlock("span",{key:0,textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,C)):e.createCommentVNode("v-if",!0)])]})),e.renderSlot(t.$slots,"clear",{clear:t.clear,quantity:t.quantity}),t.items.length?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(n){return e.openBlock(),e.createBlock(pt,{key:n.id,item:n},e.createSlots({_:2},[e.renderList(t.$slots,(function(n,l){return{name:l,fn:e.withCtx((function(n){return[e.renderSlot(t.$slots,l,e.normalizeProps(e.guardReactiveProps(n||{})))]}))}}))]),1032,["item"])})),128))]),e.createElementVNode("div",x,[e.createElementVNode("div",L,[e.createElementVNode("button",{class:"button continue",onClick:n[5]||(n[5]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)]),e.createElementVNode("div",T,[e.createElementVNode("div",M,[e.createElementVNode("div",D,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.total"))+" ",1),e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,H)])]),e.renderSlot(t.$slots,"loyalty",{pluralize:t.pluralize,items:t.items})]),e.createElementVNode("div",$,[e.createElementVNode("a",{onClick:n[6]||(n[6]=function(){return t.checkout&&t.checkout.apply(t,arguments)}),class:"button is-link checkout"},e.toDisplayString(t.__("shop.cart.go_checkout")),1)])]),t.cross.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",z,e.toDisplayString(t.__("shop.cart.cross")),1),e.createElementVNode("div",P,[e.createElementVNode("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.cross,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",O,[e.createElementVNode("div",A,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,j)):(e.openBlock(),e.createElementBlock("svg",R,I))],2)],8,G)]),e.createElementVNode("div",J,[e.createElementVNode("div",{class:"product","data-code":n.code,"shop-product":""},[e.createElementVNode("div",Q,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)},"shop-product-name":""},e.toDisplayString(n.name),9,U)]),e.createElementVNode("div",W,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[n.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(n.priceOld)},null,8,Z)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price),"shop-product-price":""},null,8,ee)])]),e.createElementVNode("div",te,[e.createVNode(vt,{id:n.id,"is-simple":!0},{default:e.withCtx((function(){return[ne]})),_:2},1032,["id"])])])],8,K)])])])})),128))]),(e.openBlock(),e.createElementBlock("svg",le,oe,512)),(e.openBlock(),e.createElementBlock("svg",re,ce,512))],512)])):e.createCommentVNode("v-if",!0),t.bundles.length?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",se,e.toDisplayString(t.__("shop.cart.bundle")),1),e.createElementVNode("div",ie,[e.createElementVNode("div",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bundles,(function(n){return e.openBlock(),e.createElementBlock("div",{class:"swiper-slide",key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["columns is-gapless is-vcentered",{"is-third":n.third}])},[e.createElementVNode("div",ue,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.image}])},[n.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.image},null,8,pe)):(e.openBlock(),e.createElementBlock("svg",ve,Ee))],2)],8,me)]),e.createElementVNode("div",ke,[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ve,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.href)}},e.toDisplayString(n.name),9,fe)]),e.createElementVNode("div",ge,[e.createElementVNode("div",he,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.price)},null,8,ye)])])])]),we,e.createElementVNode("div",Be,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.second.image}])},[n.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.second.image},null,8,Ce)):(e.openBlock(),e.createElementBlock("svg",Se,_e))],2)],8,be)]),e.createElementVNode("div",xe,[e.createElementVNode("div",Le,[e.createElementVNode("div",Te,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.second.href)}},e.toDisplayString(n.second.name),9,Me)]),e.createElementVNode("div",De,[e.createElementVNode("div",He,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.second.price)},null,8,$e)])])])]),n.third?(e.openBlock(),e.createElementBlock("div",qe,ze)):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!n.third.image}])},[n.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.third.image},null,8,Oe)):(e.openBlock(),e.createElementBlock("svg",Ae,Ge))],2)],8,Fe)])):e.createCommentVNode("v-if",!0),n.third?(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[e.createElementVNode("div",Ie,[e.createElementVNode("a",{onClick:function(e){return t.goto(n.third.href)}},e.toDisplayString(n.third.name),9,Je)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",{class:"price",innerHTML:t.$filters.price(n.third.price)},null,8,Ue)])])])])):e.createCommentVNode("v-if",!0)],2),e.createElementVNode("div",We,[e.createElementVNode("div",Xe,[e.createElementVNode("span",{class:"total-old",innerHTML:t.$filters.price(n.bundle.priceOld)},null,8,Ye),e.createElementVNode("span",{class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+n.bundle.amount},null,8,Ze)]),e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",{class:"total",innerHTML:t.$filters.price(n.bundle.price)},null,8,nt),e.createVNode(Et,{id:n.id,second:n.second.id,third:n.third?n.third.id:null},null,8,["id","second","third"])])])])])})),128))])],512),(e.openBlock(),e.createElementBlock("svg",lt,ot,512)),(e.openBlock(),e.createElementBlock("svg",rt,ct,512))])):e.createCommentVNode("v-if",!0)])):(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",st,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",it,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dt),e.createTextVNode(", "),ut,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("button",{class:"button continue",onClick:n[7]||(n[7]=function(){return t.close&&t.close.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1),e.createElementVNode("div",mt,[e.createVNode(kt,{slider:!0})])]))])])],2)):e.createCommentVNode("v-if",!0)],2)},module.exports=c;
|
|
2
2
|
//# sourceMappingURL=Cart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cart.js","sources":["../../../../src/components/shop/cart/Cart.vue","../../../../src/components/shop/cart/Cart.vue?vue&type=template&id=0ca13540&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"loyalty\" :pluralize=\"pluralize\" :items=\"items\"></slot>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', modal.value ? null : 'cart');\n };\n\n const close = () => {\n store.commit('cart/modal', null);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n isLoading.value = true;\n window.location.href = $ziggy('shop.checkout');\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>","<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"loyalty\" :pluralize=\"pluralize\" :items=\"items\"></slot>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n }\n },\n setup() {\n const store = useStore();\n const loading = ref(false);\n\n const items = computed(() => store.getters['cart/items']);\n const modal = computed(() => store.getters['cart/modal']);\n const total = computed(() => store.getters['cart/total']);\n const quantity = computed(() => store.getters['cart/quantity']);\n\n const open = () => {\n store.commit('cart/modal', modal.value ? null : 'cart');\n };\n\n const close = () => {\n store.commit('cart/modal', null);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch('cart/get', {\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters['cart/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters['cart/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit('cart/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('cart/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n isLoading.value = true;\n window.location.href = $ziggy('shop.checkout');\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","isModal","type","Boolean","setup","store","useStore","loading","ref","items","computed","getters","modal","total","quantity","close","commit","dispatch","document","body","addEventListener","event","value","target","closest","window","e","key","crossSwiper","bundlesSwiper","crossSlider","crossSliderNext","crossSliderPrev","cross","destroy","length","Swiper","slidesPerView","slidesPerGroup","breakpoints","spaceBetween","allowTouchMove","modules","Navigation","mousewheel","forceToAxis","navigation","nextEl","prevEl","bundlesSlider","bundlesSliderNext","bundlesSliderPrev","bundles","isLoading","open","clear","pluralize","href","location","checkout","$ziggy","_createElementVNode","role","_createElementBlock","_ctx","_hoisted_1","_hoisted_2","_renderSlot","onClick","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","innerHTML","price","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_19","_hoisted_20","_toDisplayString","_hoisted_22","_hoisted_23","item","_createBlock","id","_","slotProps","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","image","src","_hoisted_42","code","_hoisted_44","_hoisted_46","_hoisted_47","_hoisted_48","priceOld","_hoisted_51","_createVNode","_hoisted_52","_hoisted_53","_hoisted_56","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","third","_hoisted_63","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_73","_hoisted_74","_hoisted_76","_hoisted_77","second","_hoisted_83","_hoisted_84","_hoisted_85","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_93","_hoisted_99","_hoisted_100","_hoisted_101","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","bundle","amount","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_116","_hoisted_119","_hoisted_120","_hoisted_121","locale","url","_hoisted_123","_hoisted_124","slider"],"mappings":"uMAoQ6BA,kBAAgB,CACzCC,KAAM,OACNC,MAAO,CACHC,QAAS,CACLC,KAAMC,iBACG,IAGjBC,qBACUC,EAAQC,aACRC,EAAUC,OAAI,GAEdC,EAAQC,YAAS,kBAAML,EAAMM,QAAQ,iBACrCC,EAAQF,YAAS,kBAAML,EAAMM,QAAQ,iBACrCE,EAAQH,YAAS,kBAAML,EAAMM,QAAQ,iBACrCG,EAAWJ,YAAS,kBAAML,EAAMM,QAAQ,oBAMxCI,EAAQ,WACVV,EAAMW,OAAO,aAAc,OAa/BX,EAAMY,SAAS,WAAY,SACd,eAGbC,SAASC,KAAKC,iBAAiB,SAAS,SAACC,GAC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F,IACIpF,kCAAW,QAAQe,UAAQZ,WAASa,MAAMY,EAAKmC,MAAM/C,gEAMzEhB,2BAAAqF,IACIrF,2BAAAsF,IACItF,mCAAY,YAAYe,UAAQZ,WAASa,MAAMY,EAAK2D,OAAOlC,sBAC3DrD,mCAAY,gBAAgBe,UAAQZ,gCAAgCyB,EAAK2D,OAAOC,qBAEpFxF,2BAAAyF,IACIzF,2BAAA0F,IACI1F,mCAAY,QAAQe,UAAQZ,WAASa,MAAMY,EAAK2D,OAAOvE,mBACvDuC,kBAAazB,GAAIF,EAAKE,GAAK0C,OAAQ5C,EAAK4C,OAAO1C,GAAWiC,MAAOnC,EAAKmC,MAAQnC,EAAKmC,MAAMjC,iFAOjH5B,2BAAAyF,2BAGAzF,2BAAA0F,iEAKR1F,2BAAA2F,IACI7F,2BAAA8F,qBAAsB3F,4BACtBH,2BAAA+F,wCACO5F,kCACHH,qBAAoF,KAAhFJ,KAAMO,OAAK6F,OAAOC,IAAM9F,OAAK6F,OAAOC,2BAAc9F,mDAA8B,MAAE+F,uCAAS/F,kCAEnGH,qCAAc,kBAAmBO,sCAAOJ,yDAAUA,+BAClDH,2BAAAmG,IACI5C,kBAAS6C,QAAQ"}
|
|
1
|
+
{"version":3,"file":"Cart.js","sources":["../../../../src/components/shop/cart/Cart.vue","../../../../src/components/shop/cart/Cart.vue?vue&type=template&id=603b9bfa&lang.js"],"sourcesContent":["<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <slot name=\"cart-title\" :quantity=\"quantity\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n </slot>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"loyalty\" :pluralize=\"pluralize\" :items=\"items\"></slot>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent, provide } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n//import cart from '../../../api/modules/cart';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n },\n cartStorage: {\n type: String,\n default: 'cart'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const cartStorage = props.cartStorage;\n\n provide('cartStorage', cartStorage);\n\n const items = computed(() => store.getters[cartStorage + '/items']);\n const modal = computed(() => store.getters[cartStorage + '/modal']);\n const total = computed(() => store.getters[cartStorage + '/total']);\n const quantity = computed(() => store.getters[cartStorage + '/quantity']);\n\n const open = () => {\n store.commit(cartStorage + '/modal', modal.value ? null : 'cart');\n };\n\n const close = () => {\n store.commit(cartStorage + '/modal', null);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/clear', {\n cart: cartStorage,\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch(cartStorage + '/get', {\n cart: cartStorage,\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters[cartStorage + '/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters[cartStorage + '/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n isLoading.value = true;\n window.location.href = $ziggy('shop.checkout');\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>","<template>\n <div class=\"cart\" v-bind:class=\"{ 'is-open': modal }\">\n <div class=\"dropdown is-right is-hoverable\">\n <div class=\"dropdown-trigger\">\n <slot :total=\"quantity\" :open=\"open\">\n <button class=\"button\" @click=\"open\">\n <span>\n <i class=\"fas fa-shopping-cart\"></i>\n {{ quantity }}\n </span>\n <span class=\"icon is-small\">\n <i class=\"fas fa-angle-down\" aria-hidden=\"true\"></i>\n </span>\n </button>\n </slot>\n </div>\n <div class=\"dropdown-menu\" role=\"menu\">\n <div class=\"dropdown-content\" v-if=\"items.length\">\n <div class=\"dropdown-item\">\n <div class=\"columns\">\n <div class=\"column\">{{ __('shop.cart.total') }}</div>\n <div class=\"column has-text-right\" v-html=\"$filters.price(total)\"></div>\n </div>\n </div>\n <div class=\"dropdown-divider\"></div>\n <div class=\"dropdown-item has-text-centered\">\n <a @click=\"checkout\" class=\"button is-link\" v-bind:class=\"{ 'is-disabled': isLoading }\">{{ __('shop.cart.checkout') }}</a>\n </div>\n <div class=\"dropdown-item has-text-centered\">\n <slot name=\"open\" :open=\"open\">\n <a @click=\"open\">{{ __('shop.cart.open') }}</a>\n </slot>\n </div>\n </div>\n <div class=\"dropdown-content\" v-else>\n <slot name=\"empty\">\n <div class=\"dropdown-item\">{{ __('shop.cart.empty') }}</div>\n </slot>\n </div>\n </div>\n </div>\n <div class=\"modal\" v-if=\"isModal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <slot name=\"cart-title\" :quantity=\"quantity\">\n <div class=\"cart-title\">\n {{ __('shop.cart.title') }}\n <span v-if=\"quantity\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>\n </div>\n </slot>\n <slot name=\"clear\" :clear=\"clear\" :quantity=\"quantity\"></slot>\n <div class=\"items-wrapper\" v-if=\"items.length\">\n <div class=\"items\">\n <cart-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\"></slot>\n </template>\n </cart-item>\n </div>\n\n <div class=\"columns is-gapless is-vcentered main-actions\">\n <div class=\"column\">\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column has-text-right\">\n <div class=\"totals\">\n <div class=\"title\">\n {{ __('shop.cart.total') }}\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"loyalty\" :pluralize=\"pluralize\" :items=\"items\"></slot>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"checkout\" class=\"button is-link checkout\">{{ __('shop.cart.go_checkout') }}</a>\n </div>\n </div>\n\n <div class=\"cross\" v-if=\"cross.length\">\n <div class=\"title\">{{ __('shop.cart.cross') }}</div>\n <div class=\"swiper\" ref=\"crossSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in cross\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\" :data-code=\"item.code\" shop-product>\n <div class=\"name\">\n <a @click=\"goto(item.href)\" shop-product-name>{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"column is-narrow\">\n <div class=\"prices\">\n <div class=\"price-old\" v-if=\"item.priceOld\" v-html=\"$filters.price(item.priceOld)\"></div>\n <div class=\"price\" v-html=\"$filters.price(item.price)\" shop-product-price></div>\n </div>\n </div>\n <div class=\"column\">\n <cart-add :id=\"item.id\" :is-simple=\"true\">\n <svg>\n <use xlink:href=\"#cart-alternate\" />\n </svg>\n </cart-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"crossSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"crossSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div class=\"bundles\" v-if=\"bundles.length\">\n <div class=\"title\">{{ __('shop.cart.bundle') }}</div>\n <div class=\"swiper\" ref=\"bundlesSlider\">\n <div class=\"swiper-wrapper\">\n <div class=\"swiper-slide\" v-for=\"item in bundles\" v-bind:key=\"item.id\">\n <div class=\"columns is-gapless is-vcentered\" v-bind:class=\"{ 'is-third': item.third }\">\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.image }\">\n <img :src=\"item.image\" v-if=\"item.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.href)\">{{ item.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\">\n <a @click=\"goto(item.second.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.second.image }\">\n <img :src=\"item.second.image\" v-if=\"item.second.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.second.href)\">{{ item.second.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.second.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <svg class=\"bundle-icon plus\">\n <use xlink:href=\"#bundle-plus\" />\n </svg>\n </div>\n <div class=\"column is-narrow\" v-if=\"item.third\">\n <a @click=\"goto(item.third.href)\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.third.image }\">\n <img :src=\"item.third.image\" v-if=\"item.third.image\" />\n <svg v-else>\n <use xlink:href=\"#logo\" />\n </svg>\n </figure>\n </a>\n </div>\n <div class=\"column\" v-if=\"item.third\">\n <div class=\"product\">\n <div class=\"name\">\n <a @click=\"goto(item.third.href)\">{{ item.third.name }}</a>\n </div>\n <div class=\"columns is-gapless is-vcentered\">\n <div class=\"prices\">\n <div class=\"price\" v-html=\"$filters.price(item.third.price)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"columns is-vcentered\">\n <div class=\"column\">\n <span class=\"total-old\" v-html=\"$filters.price(item.bundle.priceOld)\"></span>\n <span class=\"bundle-amount\" v-html=\"__('shop.cart.bundle_amount') + item.bundle.amount\"></span>\n </div>\n <div class=\"column\">\n <div class=\"is-flex is-align-items-center\">\n <span class=\"total\" v-html=\"$filters.price(item.bundle.price)\"></span>\n <bundle-add :id=\"item.id\" :second=\"item.second.id\" v-bind:third=\"item.third ? item.third.id : null\"></bundle-add>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <svg class=\"swiper-nav prev\" ref=\"bundlesSliderPrev\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n <svg class=\"swiper-nav next\" ref=\"bundlesSliderNext\">\n <use xlink:href=\"#arrow-submenu\" />\n </svg>\n </div>\n </div>\n <div v-else class=\"empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <button class=\"button continue\" @click=\"close\">{{ __('shop.cart.continue') }}</button>\n <div class=\"viewed-wrapper\">\n <viewed :slider=\"true\"></viewed>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, defineComponent, provide } from 'vue';\nimport { useStore } from 'vuex';\nimport { pluralize } from '@perevorot/shop/dist/helpers';\nimport Swiper, { Navigation } from 'swiper';\n//import cart from '../../../api/modules/cart';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'cart',\n props: {\n isModal: {\n type: Boolean,\n default: true\n },\n cartStorage: {\n type: String,\n default: 'cart'\n }\n },\n setup(props) {\n const store = useStore();\n const loading = ref(false);\n const cartStorage = props.cartStorage;\n\n provide('cartStorage', cartStorage);\n\n const items = computed(() => store.getters[cartStorage + '/items']);\n const modal = computed(() => store.getters[cartStorage + '/modal']);\n const total = computed(() => store.getters[cartStorage + '/total']);\n const quantity = computed(() => store.getters[cartStorage + '/quantity']);\n\n const open = () => {\n store.commit(cartStorage + '/modal', modal.value ? null : 'cart');\n };\n\n const close = () => {\n store.commit(cartStorage + '/modal', null);\n };\n\n const clear = () => {\n loading.value = true;\n\n store.dispatch(cartStorage + '/clear', {\n cart: cartStorage,\n finally: () => {\n loading.value = false;\n }\n });\n };\n\n store.dispatch(cartStorage + '/get', {\n cart: cartStorage,\n finally: () => { }\n });\n\n document.body.addEventListener('click', (event) => {\n if (modal.value && !event.target.closest('.cart')) {\n close();\n }\n });\n\n window.addEventListener('keyup', (e) => {\n if (modal.value && e.key === 'Escape') {\n close();\n }\n });\n\n const goto = (href) => {\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.location.href = href;\n };\n\n let crossSwiper;\n const crossSlider = ref(null);\n const crossSliderNext = ref(null);\n const crossSliderPrev = ref(null);\n\n const cross = computed(() => {\n const cross = store.getters[cartStorage + '/cross'];\n\n if (crossSlider.value) {\n if (crossSwiper) {\n crossSwiper.destroy();\n }\n\n if (cross.length) {\n crossSwiper = new Swiper(crossSlider.value, {\n slidesPerView: 1,\n slidesPerGroup: 1,\n breakpoints: {\n 768: {\n slidesPerView: 2,\n slidesPerGroup: 2\n }\n },\n spaceBetween: 0,\n allowTouchMove: true,\n modules: [Navigation],\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: crossSliderNext.value,\n prevEl: crossSliderPrev.value\n }\n });\n }\n }\n\n return cross;\n });\n\n let bundlesSwiper;\n const bundlesSlider = ref(null);\n const bundlesSliderNext = ref(null);\n const bundlesSliderPrev = ref(null);\n\n const bundles = computed(() => {\n const bundles = store.getters[cartStorage + '/bundles'];\n\n if (bundlesSlider.value) {\n if (bundlesSwiper) {\n bundlesSwiper.destroy();\n }\n\n if (bundles.length) {\n bundlesSwiper = new Swiper(bundlesSlider.value, {\n slidesPerView: 1,\n spaceBetween: 0,\n allowTouchMove: true,\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: bundlesSliderNext.value,\n prevEl: bundlesSliderPrev.value\n }\n });\n }\n }\n\n return bundles;\n });\n\n window.addEventListener('beforeunload', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit(cartStorage + '/modal', null);\n });\n\n const isLoading = ref(false);\n\n const checkout = () => {\n isLoading.value = true;\n window.location.href = $ziggy('shop.checkout');\n };\n\n return {\n loading,\n items,\n modal,\n total,\n quantity,\n open,\n close,\n clear,\n pluralize,\n goto,\n cross,\n crossSlider,\n crossSliderPrev,\n crossSliderNext,\n bundles,\n bundlesSlider,\n bundlesSliderPrev,\n bundlesSliderNext,\n checkout,\n isLoading,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","isModal","type","Boolean","cartStorage","String","setup","store","useStore","loading","ref","provide","items","computed","getters","modal","total","quantity","close","commit","dispatch","cart","document","body","addEventListener","event","value","target","closest","window","e","key","crossSwiper","bundlesSwiper","crossSlider","crossSliderNext","crossSliderPrev","cross","destroy","length","Swiper","slidesPerView","slidesPerGroup","breakpoints","spaceBetween","allowTouchMove","modules","Navigation","mousewheel","forceToAxis","navigation","nextEl","prevEl","bundlesSlider","bundlesSliderNext","bundlesSliderPrev","bundles","isLoading","open","clear","pluralize","href","location","checkout","$ziggy","_createElementVNode","role","_createElementBlock","_ctx","_hoisted_1","_hoisted_2","_renderSlot","onClick","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","innerHTML","price","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_19","_hoisted_20","_toDisplayString","_hoisted_22","_hoisted_23","item","_createBlock","id","_","slotProps","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","image","src","_hoisted_42","code","_hoisted_44","_hoisted_46","_hoisted_47","_hoisted_48","priceOld","_hoisted_51","_createVNode","_hoisted_52","_hoisted_53","_hoisted_56","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","third","_hoisted_63","_hoisted_69","_hoisted_70","_hoisted_71","_hoisted_73","_hoisted_74","_hoisted_76","_hoisted_77","second","_hoisted_83","_hoisted_84","_hoisted_85","_hoisted_87","_hoisted_88","_hoisted_90","_hoisted_93","_hoisted_99","_hoisted_100","_hoisted_101","_hoisted_103","_hoisted_104","_hoisted_106","_hoisted_107","bundle","amount","_hoisted_110","_hoisted_111","_hoisted_113","_hoisted_116","_hoisted_119","_hoisted_120","_hoisted_121","locale","url","_hoisted_123","_hoisted_124","slider"],"mappings":"uMAuQ6BA,kBAAgB,CACzCC,KAAM,OACNC,MAAO,CACHC,QAAS,CACLC,KAAMC,iBACG,GAEbC,YAAa,CACTF,KAAMG,eACG,SAGjBC,eAAMN,OACIO,EAAQC,aACRC,EAAUC,OAAI,GACdN,EAAcJ,EAAMI,YAE1BO,UAAQ,cAAeP,OAEjBQ,EAAQC,YAAS,kBAAMN,EAAMO,QAAQV,EAAc,aACnDW,EAAQF,YAAS,kBAAMN,EAAMO,QAAQV,EAAc,aACnDY,EAAQH,YAAS,kBAAMN,EAAMO,QAAQV,EAAc,aACnDa,EAAWJ,YAAS,kBAAMN,EAAMO,QAAQV,EAAc,gBAMtDc,EAAQ,WACVX,EAAMY,OAAOf,EAAc,SAAU,OAczCG,EAAMa,SAAShB,EAAc,OAAQ,CACjCiB,KAAMjB,UACG,eAGbkB,SAASC,KAAKC,iBAAiB,SAAS,SAACC,GACjCV,EAAMW,QAAUD,EAAME,OAAOC,QAAQ,UACrC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AAKmC,MAAMnE,0BAAUgC,EAAKmC,MAAMjI,cAEpDkE,2BAAAmF,IACInF,2BAAAoF,IACIpF,kCAAW,QAAQe,UAAQZ,WAASa,MAAMY,EAAKmC,MAAM/C,gEAMzEhB,2BAAAqF,IACIrF,2BAAAsF,IACItF,mCAAY,YAAYe,UAAQZ,WAASa,MAAMY,EAAK2D,OAAOlC,sBAC3DrD,mCAAY,gBAAgBe,UAAQZ,gCAAgCyB,EAAK2D,OAAOC,qBAEpFxF,2BAAAyF,IACIzF,2BAAA0F,IACI1F,mCAAY,QAAQe,UAAQZ,WAASa,MAAMY,EAAK2D,OAAOvE,mBACvDuC,kBAAazB,GAAIF,EAAKE,GAAK0C,OAAQ5C,EAAK4C,OAAO1C,GAAWiC,MAAOnC,EAAKmC,MAAQnC,EAAKmC,MAAMjC,iFAOjH5B,2BAAAyF,2BAGAzF,2BAAA0F,iEAKR1F,2BAAA2F,IACI7F,2BAAA8F,qBAAsB3F,4BACtBH,2BAAA+F,wCACO5F,kCACHH,qBAAoF,KAAhFJ,KAAMO,OAAK6F,OAAOC,IAAM9F,OAAK6F,OAAOC,2BAAc9F,mDAA8B,MAAE+F,uCAAS/F,kCAEnGH,qCAAc,kBAAmBO,sCAAOJ,yDAAUA,+BAClDH,2BAAAmG,IACI5C,kBAAS6C,QAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t=require("vuex"),
|
|
1
|
+
"use strict";var e=require("vue"),t=require("vuex"),a=require("vue-toastification"),n={setup:function(){return{translate:window.__}}},r={class:"shop-cart-success-message"};n.render=function(t,a,n,o,i,l){return e.openBlock(),e.createElementBlock("div",r,e.toDisplayString(o.translate("shop.cart.message")),1)};var o=a.useToast(),i={name:"cart-add",props:{id:Number,isChangeQuantity:{type:Boolean,default:!0},isAlreadyInCart:{type:Boolean,default:!0},isSimple:{type:Boolean,default:!1},isPlusMinus:{type:Boolean,default:!1},after:{type:String,default:"modal"},property:{type:String,default:null},code:{type:String,default:null},name:{type:String,default:null},price:{type:Number,default:null},cartStorage:{type:String,default:"cart"}},setup:function(a){var r=t.useStore(),i=e.ref(!1),l=e.ref(1),c=e.ref(null),s=a.cartStorage,d=e.computed((function(){return r.getters[s+"/productQuantity"](a.id)})),u=a.isAlreadyInCart,m=a.isChangeQuantity,p=a.isPlusMinus;a.isSimple&&(u=!1,m=!1,p=!1);return{button:c,loading:i,quantity:l,add:function(){var e,t,d,u,m;i.value=!0;var p=[];c.value.closest(".product-main")&&document.querySelectorAll("#options input[type=checkbox]:checked").forEach((function(e){p.push(parseInt(e.value))}));var y={};window.getTrackingIndexProductsList&&"function"==typeof window.getTrackingIndexProductsList&&(y=window.getTrackingIndexProductsList(c.value));var v=Math.max(1,l.value),f=c.value.closest("[shop-product]"),g=a.name?a.name:null===(e=f.querySelector("[shop-product-name]"))||void 0===e?void 0:e.textContent,h=a.price?a.price:null===(t=f.querySelector("[shop-product-price]"))||void 0===t?void 0:t.childNodes[0].nodeValue.replace(/ /g,""),b=a.property?a.property:null===(d=f.querySelector("[shop-product-property]"))||void 0===d?void 0:d.textContent,k=a.code?a.code:f.dataset.code,C=null===(u=f.querySelector("[shop-product-category]"))||void 0===u?void 0:u.textContent,_=null===(m=f.querySelector("[shop-product-brand]"))||void 0===m?void 0:m.textContent;r.dispatch(s+"/add",{cart:s,after:a.after,product:{id:a.id,quantity:v,options:p,extra:{trackingIndex:y}},finally:function(){(i.value=!1,l.value=1,"message"==a.after)&&o({component:n},{type:"success-cart"})},callback:function(){var e={ecommerce:{currency:"UAH",value:parseFloat(h),items:[{item_name:g,item_id:k,price:parseFloat(h),quantity:v}]},event:"add_to_cart"};y.index&&(e.ecommerce.items[0].index=y.index),y.item_list_name&&(e.ecommerce.items[0].item_list_name=y.item_list_name),_&&(e.ecommerce.items[0].item_brand=_),C&&(-1!==C.indexOf("/")?C.split("/").forEach((function(t,a){e.ecommerce.items[0]["item_category"+(a?a+1:"")]=t.trim()})):e.ecommerce.items[0].item_category=C),b&&(e.ecommerce.items[0].item_variant=b),$env.debug.ecommerce&&console.log(e),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(e))}})},remove:function(){i.value=!0,r.dispatch(s+"/remove",{id:a.id,cart:s,finally:function(){i.value=!1}})},cart:d,increase:function(){l.value++},decrease:function(){l.value>1&&l.value--},isAlreadyInCart:u,isChangeQuantity:m,isPlusMinus:p}}},l={class:"cart-add",ref:"button"},c={class:"columns"},s={key:0,class:"column"},d={class:"cart-change-quantity"},u=["disabled"],m=["disabled"],p=["disabled"],y={class:"column is-narrow"},v=["disabled"],f=e.createElementVNode("svg",{class:"icon cart"},[e.createElementVNode("use",{"xlink:href":"#cart-add"})],-1),g={class:"cart-add-button-label"},h={key:0},b=e.createElementVNode("br",null,null,-1),k=["disabled","textContent"];i.render=function(t,a,n,r,o,i){return e.openBlock(),e.createElementBlock("div",l,[e.createElementVNode("div",c,[t.$env.shop.isCustomQuantity&&r.isChangeQuantity?(e.openBlock(),e.createElementBlock("div",s,[e.createElementVNode("div",d,[r.isPlusMinus?(e.openBlock(),e.createElementBlock("button",{key:0,class:"button is-small decrease",onClick:a[0]||(a[0]=function(){return r.decrease&&r.decrease.apply(r,arguments)}),disabled:r.loading||1==r.quantity},"-",8,u)):e.createCommentVNode("v-if",!0),e.withDirectives(e.createElementVNode("input",{class:"input is-small",type:"number",min:"1","onUpdate:modelValue":a[1]||(a[1]=function(e){return r.quantity=e}),disabled:r.loading},null,8,m),[[e.vModelText,r.quantity]]),r.isPlusMinus?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button is-small increase",onClick:a[2]||(a[2]=function(){return r.increase&&r.increase.apply(r,arguments)}),disabled:r.loading},"+",8,p)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",y,[e.createElementVNode("button",{class:"button is-link is-small",onClick:a[3]||(a[3]=function(){return r.add&&r.add.apply(r,arguments)}),disabled:r.loading},[e.renderSlot(t.$slots,"default",{label:t.__("shop.cart.add")},(function(){return[f,e.createElementVNode("span",g,e.toDisplayString(t.__("shop.cart.add")),1)]}))],8,v)])]),t.$env.shop.isAlreadyInCart&&r.isAlreadyInCart&&r.cart>0?(e.openBlock(),e.createElementBlock("div",h,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.already",{quantity:r.cart}))+" ",1),b,e.createElementVNode("a",{onClick:a[4]||(a[4]=e.withModifiers((function(){return r.remove&&r.remove.apply(r,arguments)}),["prevent"])),disabled:r.loading,textContent:e.toDisplayString(t.__("shop.cart.remove"))},null,8,k)])):e.createCommentVNode("v-if",!0)],512)},module.exports=i;
|
|
2
2
|
//# sourceMappingURL=CartAdd.js.map
|