@perevorot/shop 2.0.34 → 2.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=e.defineComponent({props:{data:Object,item:Object,commit:Function},setup:function(t){var n=e.computed((function(){return t.item.data.find((function(e){return e.id==c.value}))})),o=function(e){return!t.item.data.length||!!e};e.onMounted((function(){n.value||t.commit(t.item.code,{},o())}));var c=e.computed({get:function(){return t.data[t.item.code]?t.data[t.item.code].id:null},set:function(e){t.commit(t.item.code,{id:e},o(e))}}),l=e.ref(!1),a=function(){l.value=!1};return window.addEventListener("keyup",(function(e){l.value&&"Escape"===e.key&&a()})),window.addEventListener("click",(function(e){e.target.closest(".pickup-wrapper")||a()})),{selected:n,isOpened:l,open:function(){l.value=!0},choose:function(e,t){e.stopPropagation(),setTimeout((function(){c.value=t.id}),200),a()},close:a,pickup:c}}}),n={key:0,class:"component pickup-wrapper"},o=["textContent"],c=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),l={class:"dropdown-menu"},a={class:"dropdown-content"},i=["onClick"],r={key:0,class:"data"},d={class:"columns is-gapless"},s={class:"column"},m={class:"data-wrapper"},u={key:0,class:"hours"},p=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#hours"})],-1),v=["innerHTML"],k={key:1,class:"map"},f=["href"],E={key:2,class:"info"},N={key:0,class:"column is-4"},V={class:"image"},g=["src"];t.render=function(t,B,C,h,w,y){return t.item.data.length?(e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isOpened}]),onMouseleave:B[1]||(B[1]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"input dropdown-trigger",onClick:B[0]||(B[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",{class:e.normalizeClass({"is-placeholder":!t.selected}),textContent:e.toDisplayString(t.selected?t.selected.name:"Выберите пункт самовывоза")},null,10,o),c]),e.createElementVNode("div",l,[e.createElementVNode("div",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.data,(function(n){return e.openBlock(),e.createElementBlock("a",{class:e.normalizeClass(["dropdown-item",{"is-active":t.selected&&n.id==t.selected.id}]),key:n.id,onClick:function(e){return t.choose(e,n)}},e.toDisplayString(n.name),11,i)})),128))])])],34),t.selected&&(t.selected.hours||t.selected.map_url||t.selected.description||t.selected.image)?(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("div",d,[e.createElementVNode("div",s,[e.createElementVNode("div",m,[t.selected.hours?(e.openBlock(),e.createElementBlock("div",u,[p,e.createElementVNode("span",{innerHTML:t.selected.hours},null,8,v)])):e.createCommentVNode("v-if",!0),t.selected.map_url?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("a",{href:t.selected.map_url,target:"_blank",rel:"noopener"},"Открыть на карте",8,f)])):e.createCommentVNode("v-if",!0),t.selected.description?(e.openBlock(),e.createElementBlock("div",E,e.toDisplayString(t.selected.description),1)):e.createCommentVNode("v-if",!0)])]),t.selected.image?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",V,[e.createElementVNode("img",{src:t.selected.image},null,8,g)])])):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0)},module.exports=t;
1
+ "use strict";var e=require("vue"),t=e.defineComponent({props:{data:Object,item:Object,commit:Function},setup:function(t){var n=e.computed((function(){return t.item.data.find((function(e){return e.id==c.value}))})),o=function(e){return!t.item.data.length||!!e};e.onMounted((function(){n.value||t.commit(t.item.code,{},o())}));var c=e.computed({get:function(){return t.data[t.item.code]?t.data[t.item.code].id:null},set:function(e){t.commit(t.item.code,{id:e},o(e))}}),l=e.ref(!1),a=function(){l.value=!1};return window.addEventListener("keyup",(function(e){l.value&&"Escape"===e.key&&a()})),window.addEventListener("click",(function(e){e.target.closest(".pickup-wrapper")||a()})),{selected:n,isOpened:l,open:function(){l.value=!0},choose:function(e,t){e.stopPropagation(),setTimeout((function(){c.value=t.id}),200),a()},close:a,pickup:c}}}),n={key:0,class:"component pickup-wrapper"},o=["textContent"],c=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),l={class:"dropdown-menu"},a={class:"dropdown-content"},r=["onClick"],i={key:0,class:"data"},s={class:"columns is-gapless"},d={class:"column"},m={class:"data-wrapper"},u={key:0,class:"hours"},p=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#hours"})],-1),v=["innerHTML"],k={key:1,class:"map"},f=["href"],E={key:2,class:"info"},N={key:0,class:"column is-4"},V={class:"image"},g=["src"];t.render=function(t,h,B,y,C,w){return t.item.data.length?(e.openBlock(),e.createElementBlock("div",n,[e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isOpened}]),onMouseleave:h[1]||(h[1]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"input dropdown-trigger",onClick:h[0]||(h[0]=function(){return t.open&&t.open.apply(t,arguments)})},[e.createElementVNode("span",{class:e.normalizeClass({"is-placeholder":!t.selected}),textContent:e.toDisplayString(t.selected?t.selected.name:t.__("shop.order.pickup"))},null,10,o),c]),e.createElementVNode("div",l,[e.createElementVNode("div",a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.item.data,(function(n){return e.openBlock(),e.createElementBlock("a",{class:e.normalizeClass(["dropdown-item",{"is-active":t.selected&&n.id==t.selected.id}]),key:n.id,onClick:function(e){return t.choose(e,n)}},e.toDisplayString(n.name),11,r)})),128))])])],34),t.selected&&(t.selected.hours||t.selected.map_url||t.selected.description||t.selected.image)?(e.openBlock(),e.createElementBlock("div",i,[e.createElementVNode("div",s,[e.createElementVNode("div",d,[e.createElementVNode("div",m,[t.selected.hours?(e.openBlock(),e.createElementBlock("div",u,[p,e.createElementVNode("span",{innerHTML:t.selected.hours},null,8,v)])):e.createCommentVNode("v-if",!0),t.selected.map_url?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("a",{href:t.selected.map_url,target:"_blank",rel:"noopener"},e.toDisplayString(t.__("shop.order.map")),9,f)])):e.createCommentVNode("v-if",!0),t.selected.description?(e.openBlock(),e.createElementBlock("div",E,e.toDisplayString(t.selected.description),1)):e.createCommentVNode("v-if",!0)])]),t.selected.image?(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",V,[e.createElementVNode("img",{src:t.selected.image},null,8,g)])])):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0)},module.exports=t;
2
2
  //# sourceMappingURL=CheckoutShippingPickup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutShippingPickup.js","sources":["../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue","../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue?vue&type=template&id=ecc5d934&lang.js"],"sourcesContent":["<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : 'Выберите пункт самовывоза'\"></span>\n <svg><use xlink:href=\"#arrow-down\"></use></svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg><use xlink:href=\"#hours\"></use></svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">Открыть на карте</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\">{{ selected.description }}</div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup\n };\n }\n});\n</script>\n","<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : 'Выберите пункт самовывоза'\"></span>\n <svg><use xlink:href=\"#arrow-down\"></use></svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg><use xlink:href=\"#hours\"></use></svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">Открыть на карте</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\">{{ selected.description }}</div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","data","Object","item","commit","Function","setup","selected","computed","find","id","pickup","value","isValid","length","onMounted","code","get","set","isOpened","ref","close","window","addEventListener","e","key","target","closest","open","choose","option","stopPropagation","setTimeout","_createElementVNode","_ctx","_createElementBlock","_hoisted_1","onMouseleave","onClick","_toDisplayString","name","_hoisted_3","_hoisted_4","_hoisted_5","$event","hours","map_url","description","image","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","innerHTML","_hoisted_14","href","rel","_hoisted_16","_hoisted_17","_hoisted_18","src"],"mappings":"oCAuCeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,OACNC,KAAMD,OACNE,OAAQC,UAEZC,eAAMN,OACIO,EAAWC,YAAS,kBACfR,EAAMG,KAAKF,KAAKQ,MAAK,SAACN,UAASA,EAAKO,IAAMC,EAAOC,YAGtDC,EAAU,SAACH,UACRV,EAAMG,KAAKF,KAAKa,UAGRJ,GAIjBK,aAAU,WACDR,EAASK,OACVZ,EAAMI,OAAOJ,EAAMG,KAAKa,KAAM,GAAIH,YAIpCF,EAASH,WAAS,CACpBS,sBACWjB,EAAMC,KAAKD,EAAMG,KAAKa,MAAQhB,EAAMC,KAAKD,EAAMG,KAAKa,MAAMN,GAAK,MAE1EQ,aAAIR,GACAV,EAAMI,OACFJ,EAAMG,KAAKa,KACX,CACIN,GAAIA,GAERG,EAAQH,OAKdS,EAAWC,OAAI,GAMfC,EAAQ,WACVF,EAASP,OAAQ,UAarBU,OAAOC,iBAAiB,SAAS,SAACC,GAC1BL,EAASP,OAAmB,WAAVY,EAAEC,KACpBJ,OAIRC,OAAOC,iBAAiB,SAAS,SAACC,GACzBA,EAAEE,OAAOC,QAAQ,oBAClBN,OAID,CACHd,SAAAA,EACAY,SAAAA,EACAS,KAjCS,WACTT,EAASP,OAAQ,GAiCjBiB,OA1BW,SAACL,EAAGM,GACfN,EAAEO,kBAEFC,YAAW,WACPrB,EAAOC,MAAQkB,EAAOpB,KACvB,KAEHW,KAoBAA,MAAAA,EACAV,OAAAA,qBCpHG,gDAICsB,iCAAKA,qBAAoC,oBAApB,8BAEd,0BACI,iDAKR,iBACI,+BACI,mBACI,+BAC0B,WAC7BA,iCAAKA,qBAA+B,oBAAf,+CAGU,iCAGI,uBAGpC,wBACI,yDA3BiBC,OAAKjC,KAAKa,sBAAtDqB,2BAAAC,GACIH,oDAAW,wBAAwCC,cAAaG,2CAAYH,wCACxED,kCAAW,yBAA0BK,sCAAOJ,sCACxCD,uEAAyCC,yBAAYK,kBAAQL,WAAWA,WAASM,8CACjFC,IAEJR,2BAAAS,GACIT,2BAAAU,oBACIR,kDAA0CD,OAAKjC,eAAf6B,wBAAhCK,kDAAS,6BAAgID,YAAYJ,EAAOpB,IAAMwB,WAASxB,MAA/Ge,IAAKK,EAAOpB,GAAK4B,2BAAOJ,SAAOU,EAAQd,uBAAiFA,EAAOU,8BAI/KN,aAAaA,WAASW,OAASX,WAASY,SAAWZ,WAASa,aAAeb,WAASc,sBAA5Gb,2BAAAc,GACIhB,2BAAAiB,GACIjB,2BAAAkB,GACIlB,2BAAAmB,GACelB,WAASW,qBAApBV,2BAAAkB,GACIC,EACArB,6BAAMsB,UAAQrB,WAASW,oDAEhBX,WAASY,uBAApBX,2BAAAqB,GACIvB,0BAAIwB,KAAMvB,WAASY,QAASpB,OAAO,SAASgC,IAAI,YAAW,2DAEpDxB,WAASa,2BAApBZ,2BAAAwB,oBAAiDzB,WAASa,qDAGnCb,WAASc,qBAAxCb,2BAAAyB,GACI3B,2BAAA4B,GACI5B,4BAAM6B,IAAK5B,WAASc"}
1
+ {"version":3,"file":"CheckoutShippingPickup.js","sources":["../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue","../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue?vue&type=template&id=5efb7682&lang.js"],"sourcesContent":["<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : __('shop.order.pickup')\"></span>\n <svg><use xlink:href=\"#arrow-down\"></use></svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg><use xlink:href=\"#hours\"></use></svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">{{ __('shop.order.map') }}</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\">{{ selected.description }}</div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup\n };\n }\n});\n</script>\n","<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : __('shop.order.pickup')\"></span>\n <svg><use xlink:href=\"#arrow-down\"></use></svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg><use xlink:href=\"#hours\"></use></svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">{{ __('shop.order.map') }}</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\">{{ selected.description }}</div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","data","Object","item","commit","Function","setup","selected","computed","find","id","pickup","value","isValid","length","onMounted","code","get","set","isOpened","ref","close","window","addEventListener","e","key","target","closest","open","choose","option","stopPropagation","setTimeout","_createElementVNode","_ctx","_createElementBlock","_hoisted_1","onMouseleave","onClick","_toDisplayString","name","_hoisted_3","_hoisted_4","_hoisted_5","$event","hours","map_url","description","image","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","innerHTML","_hoisted_14","href","rel","_hoisted_16","_hoisted_17","_hoisted_18","src"],"mappings":"oCAuCeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,OACNC,KAAMD,OACNE,OAAQC,UAEZC,eAAMN,OACIO,EAAWC,YAAS,kBACfR,EAAMG,KAAKF,KAAKQ,MAAK,SAACN,UAASA,EAAKO,IAAMC,EAAOC,YAGtDC,EAAU,SAACH,UACRV,EAAMG,KAAKF,KAAKa,UAGRJ,GAIjBK,aAAU,WACDR,EAASK,OACVZ,EAAMI,OAAOJ,EAAMG,KAAKa,KAAM,GAAIH,YAIpCF,EAASH,WAAS,CACpBS,sBACWjB,EAAMC,KAAKD,EAAMG,KAAKa,MAAQhB,EAAMC,KAAKD,EAAMG,KAAKa,MAAMN,GAAK,MAE1EQ,aAAIR,GACAV,EAAMI,OACFJ,EAAMG,KAAKa,KACX,CACIN,GAAIA,GAERG,EAAQH,OAKdS,EAAWC,OAAI,GAMfC,EAAQ,WACVF,EAASP,OAAQ,UAarBU,OAAOC,iBAAiB,SAAS,SAACC,GAC1BL,EAASP,OAAmB,WAAVY,EAAEC,KACpBJ,OAIRC,OAAOC,iBAAiB,SAAS,SAACC,GACzBA,EAAEE,OAAOC,QAAQ,oBAClBN,OAID,CACHd,SAAAA,EACAY,SAAAA,EACAS,KAjCS,WACTT,EAASP,OAAQ,GAiCjBiB,OA1BW,SAACL,EAAGM,GACfN,EAAEO,kBAEFC,YAAW,WACPrB,EAAOC,MAAQkB,EAAOpB,KACvB,KAEHW,KAoBAA,MAAAA,EACAV,OAAAA,qBCpHG,gDAICsB,iCAAKA,qBAAoC,oBAApB,8BAEd,0BACI,iDAKR,iBACI,+BACI,mBACI,+BAC0B,WAC7BA,iCAAKA,qBAA+B,oBAAf,+CAGU,iCAGI,uBAGpC,wBACI,yDA3BiBC,OAAKjC,KAAKa,sBAAtDqB,2BAAAC,GACIH,oDAAW,wBAAwCC,cAAaG,2CAAYH,wCACxED,kCAAW,yBAA0BK,sCAAOJ,sCACxCD,uEAAyCC,yBAAYK,kBAAQL,WAAWA,WAASM,KAAON,uCACxFO,IAEJR,2BAAAS,GACIT,2BAAAU,oBACIR,kDAA0CD,OAAKjC,eAAf6B,wBAAhCK,kDAAS,6BAAgID,YAAYJ,EAAOpB,IAAMwB,WAASxB,MAA/Ge,IAAKK,EAAOpB,GAAK4B,2BAAOJ,SAAOU,EAAQd,uBAAiFA,EAAOU,8BAI/KN,aAAaA,WAASW,OAASX,WAASY,SAAWZ,WAASa,aAAeb,WAASc,sBAA5Gb,2BAAAc,GACIhB,2BAAAiB,GACIjB,2BAAAkB,GACIlB,2BAAAmB,GACelB,WAASW,qBAApBV,2BAAAkB,GACIC,EACArB,6BAAMsB,UAAQrB,WAASW,oDAEhBX,WAASY,uBAApBX,2BAAAqB,GACIvB,0BAAIwB,KAAMvB,WAASY,QAASpB,OAAO,SAASgC,IAAI,8BAAcxB,gEAEvDA,WAASa,2BAApBZ,2BAAAwB,oBAAiDzB,WAASa,qDAGnCb,WAASc,qBAAxCb,2BAAAyB,GACI3B,2BAAA4B,GACI5B,4BAAM6B,IAAK5B,WAASc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perevorot/shop",
3
- "version": "2.0.34",
3
+ "version": "2.0.37",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist/*"