@perevorot/shop 3.0.4 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue");function t(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var o=e.defineComponent({props:{data:Object,item:Object,commit:Function},setup:function(o){var n,a,r=e.computed({get:function(){return o.data[o.item.code]?o.data[o.item.code].city:null},set:function(e){var t={city:e};o.commit(o.item.code,t,i(t))}}),u=e.computed({get:function(){return o.data[o.item.code]?o.data[o.item.code].warehouse:null},set:function(e){var t={city:r.value,warehouse:e};o.commit(o.item.code,t,i(t))}}),l=e.ref(null),i=function(e){return!(!e.city||!e.warehouse)},c=e.inject("shippingComponentValid"),s=e.inject("shippingComponentUserData"),d=e.ref(!1),p=e.ref(!1),v=e.ref(""),y=e.ref(""),h=e.ref([]),m=e.ref([]),f=e.ref([]),w=e.ref(null),g=e.ref(null),k=e.ref(!1),V=e.ref(!1),C=e.ref(!1),E=e.ref(!1),I=e.computed((function(){return!!r.value||!N.value})),N=e.ref(!1),Q=e.computed((function(){return!!u.value||!_.value})),_=e.ref(!1);e.onMounted((function(){var e;c.value=(e=function(){var e=!1;return N.value=!0,_.value=!0,function(e,t){var o=e();return o&&o.then?o.then(t):t(o)}((function(){var t,n,a,i;if(null!==(t=o.item.params)&&void 0!==t&&t.is_other_recipient&&l.value)return n=l.value.isValid(),a=function(t){t&&(s.value=l.value.getValue());var o=!!(r.value&&u.value&&t);return e=!0,o},i?a?a(n):n:(n&&n.then||(n=Promise.resolve(n)),a?n.then(a):n)}),(function(t){return e?t:!(!r.value||!u.value)}))},function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}),o.item.data&&o.item.data.length&&(m.value=o.item.data)}));var B=function(){d.value=!1,p.value=!1,C.value=!1,E.value=!1,N.value=!0,_.value=!0};window.addEventListener("keyup",(function(e){(d.value||p.value)&&"Escape"===e.key&&B()})),window.addEventListener("click",(function(e){!d.value&&!p.value||e.target.closest(".dropdown")||B()})),e.watch(v,(function(e){clearTimeout(a),r.value=null,e&&(k.value=!0,a=setTimeout((function(){$http.post($ziggy("api.delivery-nova-poshta"),{q:e,action:"cities"}).then((function(e){h.value=e.data.cities})).finally((function(){k.value=!1}))}),400))})),e.watch(y,(function(e){clearTimeout(a),e?(V.value=!0,a=setTimeout((function(){$http.post($ziggy("api.delivery-nova-poshta"),{q:e,city:r.value.id,action:"warehouses"}).then((function(e){f.value=e.data.warehouses})).finally((function(){V.value=!1}))}),400)):(u.value=null,f.value=[])}));return t(n={isCityOpened:d,isWarehouseOpened:p,openCity:function(){d.value=!0},openWarehouse:function(){p.value=!0},cities:h,citiesPopular:m,warehouses:f,chooseCity:function(e,t){e.stopPropagation(),r.value=t,f.value=[],y.value="",C.value=!1,$http.post($ziggy("api.delivery-nova-poshta"),{city:t.id,action:"warehouses"}).then((function(e){f.value=e.data.warehouses})).finally((function(){V.value=!1})),B()},chooseWarehouse:function(e,t){e.stopPropagation(),u.value=t,E.value=!1,u.value=t,B()},queryCity:v,queryWarehouse:y,city:r,warehouse:u,loadingCity:k,loadingWarehouse:V,focusWarehouse:function(){_.value=!1,d.value=!1,C.value=!1,E.value||(E.value=!0,e.nextTick((function(){g.value.value=" ",g.value.focus()})))},focusCity:function(){N.value=!1,_.value=!1,p.value=!1,E.value=!1,C.value||(C.value=!0,e.nextTick((function(){w.value.value=" ",w.value.focus()})))}},"city",r),t(n,"warehouse",u),t(n,"cityQueryInput",w),t(n,"warehouseQueryInput",g),t(n,"cityQueryInputInQueryMode",C),t(n,"warehouseQueryInputInQueryMode",E),t(n,"userForm",l),t(n,"cityIsValid",I),t(n,"warehouseIsValid",Q),n}}),n={class:"component novaposhta-wrapper"},a={class:"user-form"},r=["placeholder"],u=["value"],l=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),i={key:0,class:"help is-danger"},c={class:"dropdown-menu"},s={class:"dropdown-content"},d=["onClick"],p={key:0,class:"dropdown-item"},v={class:"user-form"},y=["placeholder"],h=["value"],m=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),f={key:0,class:"help is-danger"},w={class:"dropdown-menu"},g={class:"dropdown-content"},k=["onClick"],V={key:0,class:"dropdown-item"},C={class:"dropdown-trigger"},E={class:"user-form"},I={class:"control"},N=e.createElementVNode("input",{type:"text",class:"input",disabled:""},null,-1),Q={class:"label"};o.render=function(t,o,_,B,W,D){var M,b=e.resolveComponent("checkout-shipping-other-recipient");return e.openBlock(),e.createElementBlock("div",n,[null!==(M=t.item.params)&&void 0!==M&&M.is_other_recipient?(e.openBlock(),e.createBlock(b,{key:0,ref:"userForm"},null,512)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isCityOpened,"is-top":t.cityQueryInputInQueryMode}]),onMouseleave:o[4]||(o[4]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"dropdown-trigger",onClick:o[3]||(o[3]=function(){return t.openCity&&t.openCity.apply(t,arguments)})},[e.createElementVNode("div",a,[e.createElementVNode("div",{class:e.normalizeClass(["control",{"is-loading":t.loadingCity,"is-danger":!t.cityIsValid}])},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input is-nolabel","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.queryCity=e}),onFocus:o[1]||(o[1]=function(){return t.focusCity&&t.focusCity.apply(t,arguments)}),placeholder:t.__("shop.order.city_placeholder"),autocomplete:"chrome-off",ref:"cityQueryInput"},null,40,r),[[e.vModelText,t.queryCity],[e.vShow,t.cityQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",value:t.city?t.city.name:"",onFocus:o[2]||(o[2]=function(){return t.focusCity&&t.focusCity.apply(t,arguments)}),placeholder:" "},null,40,u),[[e.vShow,!t.cityQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("label",{class:"label"},e.toDisplayString(t.__("shop.order.city")),513),[[e.vShow,!t.cityQueryInputInQueryMode]]),l],2),t.cityIsValid?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("p",i,e.toDisplayString(t.__("auth.validation.required")),1))])]),e.createElementVNode("div",c,[e.createElementVNode("div",s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.queryCity?t.cities:t.citiesPopular,(function(o){return e.openBlock(),e.createElementBlock("a",{class:"dropdown-item",key:o.id,onClick:function(e){return t.chooseCity(e,o)}},e.toDisplayString(o.name),9,d)})),128)),!t.queryCity||t.cities.length||t.loadingCity?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",p,e.toDisplayString(t.__("shop.checkout.shipment.warehouse.not_found")),1))])])],34),t.city?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dropdown",{"is-active":t.isWarehouseOpened,"is-top":t.warehouseQueryInputInQueryMode}]),onMouseleave:o[9]||(o[9]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"dropdown-trigger",onClick:o[8]||(o[8]=function(){return t.openWarehouse&&t.openWarehouse.apply(t,arguments)})},[e.createElementVNode("div",v,[e.createElementVNode("div",{class:e.normalizeClass(["control",{"is-loading":t.loadingWarehouse,"is-danger":!t.warehouseIsValid}])},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input is-nolabel","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.queryWarehouse=e}),onFocus:o[6]||(o[6]=function(){return t.focusWarehouse&&t.focusWarehouse.apply(t,arguments)}),placeholder:t.__("shop.order.warehouse_placeholder"),autocomplete:"chrome-off",ref:"warehouseQueryInput"},null,40,y),[[e.vModelText,t.queryWarehouse],[e.vShow,t.warehouseQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",value:t.warehouse?t.warehouse.name:"",onFocus:o[7]||(o[7]=function(){return t.focusWarehouse&&t.focusWarehouse.apply(t,arguments)}),placeholder:" "},null,40,h),[[e.vShow,!t.warehouseQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("label",{class:"label"},e.toDisplayString(t.__("shop.order.warehouse")),513),[[e.vShow,!t.warehouseQueryInputInQueryMode]]),m],2),t.warehouseIsValid?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("p",f,e.toDisplayString(t.__("auth.validation.required")),1))])]),e.createElementVNode("div",w,[e.createElementVNode("div",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.warehouses,(function(o){return e.openBlock(),e.createElementBlock("a",{class:"dropdown-item",key:o.id,onClick:function(e){return t.chooseWarehouse(e,o)}},e.toDisplayString(o.name),9,k)})),128)),!t.queryWarehouse||t.warehouses.length||t.loadingWarehouse?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(t.__("shop.checkout.shipment.warehouse.not_found")),1))])])],34)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dropdown",{"is-top":t.warehouseQueryInputInQueryMode}])},[e.createElementVNode("div",C,[e.createElementVNode("div",E,[e.createElementVNode("div",I,[N,e.createElementVNode("label",Q,e.toDisplayString(t.__("shop.order.warehouse")),1)])])])],2))])},module.exports=o;
1
+ "use strict";var e=require("vue");function t(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}var o=e.defineComponent({props:{data:Object,item:Object,commit:Function,takeUserData:Boolean},setup:function(o){var n,a,r=e.computed({get:function(){return o.data[o.item.code]?o.data[o.item.code].city:N.value},set:function(e){var t={city:e};return o.commit(o.item.code,t,i(t)),e}}),u=e.computed({get:function(){return o.data[o.item.code]?o.data[o.item.code].warehouse:I.value},set:function(e){var t={city:r.value,warehouse:e};return o.commit(o.item.code,t,i(t)),e}}),l=e.ref(null),i=function(e){return!(!e.city||!e.warehouse)},c=e.inject("shippingComponentValid"),s=e.inject("shippingComponentUserData"),d=e.ref(!1),p=e.ref(!1),v=e.ref(""),y=e.ref(""),h=e.ref([]),m=e.ref([]),f=e.ref([]),w=e.ref(null),g=e.ref(null),k=e.ref(!1),V=e.ref(!1),C=e.ref(!1),E=e.ref(!1),N=e.ref(null),I=e.ref(null),_=e.computed((function(){return!!r.value||!Q.value})),Q=e.ref(!1),B=e.computed((function(){return!!u.value||!S.value})),S=e.ref(!1);e.onMounted((function(){var t;if(c.value=(t=function(){var e=!1;return Q.value=!0,S.value=!0,function(e,t){var o=e();return o&&o.then?o.then(t):t(o)}((function(){var t,n,a,i;if(null!==(t=o.item.params)&&void 0!==t&&t.is_other_recipient&&l.value)return n=l.value.isValid(),a=function(t){t&&(s.value=l.value.getValue());var o=!!(r.value&&u.value&&t);return e=!0,o},i?a?a(n):n:(n&&n.then||(n=Promise.resolve(n)),a?n.then(a):n)}),(function(t){return e?t:!(!r.value||!u.value)}))},function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];try{return Promise.resolve(t.apply(this,e))}catch(e){return Promise.reject(e)}}),o.item.data&&o.item.data.length&&(m.value=o.item.data),o.takeUserData){var n,a=e.inject("loggedUser");(null===(n=a.value.shipping_data)||void 0===n?void 0:n.delivery)===o.item.code&&setTimeout((function(){var e,t;N.value=JSON.parse(JSON.stringify(null===(e=a.value.shipping_data)||void 0===e?void 0:e.city)),I.value=JSON.parse(JSON.stringify(null===(t=a.value.shipping_data)||void 0===t?void 0:t.warehouse))}),300)}}));var W=function(){d.value=!1,p.value=!1,C.value=!1,E.value=!1,Q.value=!0,S.value=!0};window.addEventListener("keyup",(function(e){(d.value||p.value)&&"Escape"===e.key&&W()})),window.addEventListener("click",(function(e){!d.value&&!p.value||e.target.closest(".dropdown")||W()})),e.watch(v,(function(e){clearTimeout(a),r.value=null,e&&(k.value=!0,a=setTimeout((function(){$http.post($ziggy("api.delivery-nova-poshta"),{q:e,action:"cities"}).then((function(e){h.value=e.data.cities})).finally((function(){k.value=!1}))}),400))})),e.watch(y,(function(e){clearTimeout(a),e?(V.value=!0,a=setTimeout((function(){$http.post($ziggy("api.delivery-nova-poshta"),{q:e,city:r.value.id,action:"warehouses"}).then((function(e){f.value=e.data.warehouses})).finally((function(){V.value=!1}))}),400)):(u.value=null,f.value=[])}));return t(n={isCityOpened:d,isWarehouseOpened:p,openCity:function(){d.value=!0},openWarehouse:function(){p.value=!0},cities:h,citiesPopular:m,warehouses:f,chooseCity:function(e,t){e.stopPropagation(),r.value=t,f.value=[],y.value="",C.value=!1,$http.post($ziggy("api.delivery-nova-poshta"),{city:t.id,action:"warehouses"}).then((function(e){f.value=e.data.warehouses})).finally((function(){V.value=!1})),W()},chooseWarehouse:function(e,t){e.stopPropagation(),u.value=t,E.value=!1,u.value=t,W()},queryCity:v,queryWarehouse:y,city:r,warehouse:u,loadingCity:k,loadingWarehouse:V,focusWarehouse:function(){S.value=!1,d.value=!1,C.value=!1,E.value||(E.value=!0,e.nextTick((function(){g.value.value=" ",g.value.focus()})))},focusCity:function(){Q.value=!1,S.value=!1,p.value=!1,E.value=!1,C.value||(C.value=!0,e.nextTick((function(){w.value.value=" ",w.value.focus()})))}},"city",r),t(n,"warehouse",u),t(n,"cityQueryInput",w),t(n,"warehouseQueryInput",g),t(n,"cityQueryInputInQueryMode",C),t(n,"warehouseQueryInputInQueryMode",E),t(n,"userForm",l),t(n,"cityIsValid",_),t(n,"warehouseIsValid",B),n}}),n={class:"component novaposhta-wrapper"},a={class:"user-form"},r=["placeholder"],u=["value"],l=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),i={key:0,class:"help is-danger"},c={class:"dropdown-menu"},s={class:"dropdown-content"},d=["onClick"],p={key:0,class:"dropdown-item"},v={class:"user-form"},y=["placeholder"],h=["value"],m=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),f={key:0,class:"help is-danger"},w={class:"dropdown-menu"},g={class:"dropdown-content"},k=["onClick"],V={key:0,class:"dropdown-item"},C={class:"dropdown-trigger"},E={class:"user-form"},N={class:"control"},I=e.createElementVNode("input",{type:"text",class:"input",disabled:""},null,-1),_={class:"label"};o.render=function(t,o,Q,B,S,W){var D,M=e.resolveComponent("checkout-shipping-other-recipient");return e.openBlock(),e.createElementBlock("div",n,[null!==(D=t.item.params)&&void 0!==D&&D.is_other_recipient?(e.openBlock(),e.createBlock(M,{key:0,ref:"userForm"},null,512)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["dropdown",{"is-active":t.isCityOpened,"is-top":t.cityQueryInputInQueryMode}]),onMouseleave:o[4]||(o[4]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"dropdown-trigger",onClick:o[3]||(o[3]=function(){return t.openCity&&t.openCity.apply(t,arguments)})},[e.createElementVNode("div",a,[e.createElementVNode("div",{class:e.normalizeClass(["control",{"is-loading":t.loadingCity,"is-danger":!t.cityIsValid}])},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input is-nolabel","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.queryCity=e}),onFocus:o[1]||(o[1]=function(){return t.focusCity&&t.focusCity.apply(t,arguments)}),placeholder:t.__("shop.order.city_placeholder"),autocomplete:"chrome-off",ref:"cityQueryInput"},null,40,r),[[e.vModelText,t.queryCity],[e.vShow,t.cityQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",value:t.city?t.city.name:"",onFocus:o[2]||(o[2]=function(){return t.focusCity&&t.focusCity.apply(t,arguments)}),placeholder:" "},null,40,u),[[e.vShow,!t.cityQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("label",{class:"label"},e.toDisplayString(t.__("shop.order.city")),513),[[e.vShow,!t.cityQueryInputInQueryMode]]),l],2),t.cityIsValid?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("p",i,e.toDisplayString(t.__("auth.validation.required")),1))])]),e.createElementVNode("div",c,[e.createElementVNode("div",s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.queryCity?t.cities:t.citiesPopular,(function(o){return e.openBlock(),e.createElementBlock("a",{class:"dropdown-item",key:o.id,onClick:function(e){return t.chooseCity(e,o)}},e.toDisplayString(o.name),9,d)})),128)),!t.queryCity||t.cities.length||t.loadingCity?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",p,e.toDisplayString(t.__("shop.checkout.shipment.warehouse.not_found")),1))])])],34),t.city?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dropdown",{"is-active":t.isWarehouseOpened,"is-top":t.warehouseQueryInputInQueryMode}]),onMouseleave:o[9]||(o[9]=function(){return t.close&&t.close.apply(t,arguments)})},[e.createElementVNode("div",{class:"dropdown-trigger",onClick:o[8]||(o[8]=function(){return t.openWarehouse&&t.openWarehouse.apply(t,arguments)})},[e.createElementVNode("div",v,[e.createElementVNode("div",{class:e.normalizeClass(["control",{"is-loading":t.loadingWarehouse,"is-danger":!t.warehouseIsValid}])},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input is-nolabel","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.queryWarehouse=e}),onFocus:o[6]||(o[6]=function(){return t.focusWarehouse&&t.focusWarehouse.apply(t,arguments)}),placeholder:t.__("shop.order.warehouse_placeholder"),autocomplete:"chrome-off",ref:"warehouseQueryInput"},null,40,y),[[e.vModelText,t.queryWarehouse],[e.vShow,t.warehouseQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",value:t.warehouse?t.warehouse.name:"",onFocus:o[7]||(o[7]=function(){return t.focusWarehouse&&t.focusWarehouse.apply(t,arguments)}),placeholder:" "},null,40,h),[[e.vShow,!t.warehouseQueryInputInQueryMode]]),e.withDirectives(e.createElementVNode("label",{class:"label"},e.toDisplayString(t.__("shop.order.warehouse")),513),[[e.vShow,!t.warehouseQueryInputInQueryMode]]),m],2),t.warehouseIsValid?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("p",f,e.toDisplayString(t.__("auth.validation.required")),1))])]),e.createElementVNode("div",w,[e.createElementVNode("div",g,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.warehouses,(function(o){return e.openBlock(),e.createElementBlock("a",{class:"dropdown-item",key:o.id,onClick:function(e){return t.chooseWarehouse(e,o)}},e.toDisplayString(o.name),9,k)})),128)),!t.queryWarehouse||t.warehouses.length||t.loadingWarehouse?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",V,e.toDisplayString(t.__("shop.checkout.shipment.warehouse.not_found")),1))])])],34)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dropdown",{"is-top":t.warehouseQueryInputInQueryMode}])},[e.createElementVNode("div",C,[e.createElementVNode("div",E,[e.createElementVNode("div",N,[I,e.createElementVNode("label",_,e.toDisplayString(t.__("shop.order.warehouse")),1)])])])],2))])},module.exports=o;
2
2
  //# sourceMappingURL=CheckoutShippingNovaposhtaWarehouse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutShippingNovaposhtaWarehouse.js","sources":["../../../../../src/components/shop/order/shipping/CheckoutShippingNovaposhtaWarehouse.vue","../../../../../src/components/shop/order/shipping/CheckoutShippingNovaposhtaWarehouse.vue?vue&type=template&id=b8ffe8f4&lang.js"],"sourcesContent":["<template>\n <div class=\"component novaposhta-wrapper\">\n <checkout-shipping-other-recipient v-if=\"item.params?.is_other_recipient\" ref=\"userForm\"></checkout-shipping-other-recipient>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isCityOpened, 'is-top': cityQueryInputInQueryMode }\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openCity\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingCity, 'is-danger': !cityIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryCity\" @focus=\"focusCity\" :placeholder=\"__('shop.order.city_placeholder')\" autocomplete=\"chrome-off\" v-show=\"cityQueryInputInQueryMode\" ref=\"cityQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"city ? city.name : ''\" @focus=\"focusCity\" placeholder=\" \" v-show=\"!cityQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!cityQueryInputInQueryMode\">{{ __('shop.order.city') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!cityIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in queryCity ? cities : citiesPopular\" v-bind:key=\"item.id\" @click=\"chooseCity($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryCity && !cities.length && !loadingCity\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isWarehouseOpened, 'is-top': warehouseQueryInputInQueryMode }\" v-if=\"city\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openWarehouse\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingWarehouse, 'is-danger': !warehouseIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryWarehouse\" @focus=\"focusWarehouse\" :placeholder=\"__('shop.order.warehouse_placeholder')\" autocomplete=\"chrome-off\" v-show=\"warehouseQueryInputInQueryMode\" ref=\"warehouseQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"warehouse ? warehouse.name : ''\" @focus=\"focusWarehouse\" placeholder=\" \" v-show=\"!warehouseQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!warehouseQueryInputInQueryMode\">{{ __('shop.order.warehouse') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!warehouseIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in warehouses\" v-bind:key=\"item.id\" @click=\"chooseWarehouse($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryWarehouse && !warehouses.length && !loadingWarehouse\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-top': warehouseQueryInputInQueryMode }\" v-else>\n <div class=\"dropdown-trigger\">\n <div class=\"user-form\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" disabled />\n <label class=\"label\">{{ __('shop.order.warehouse') }}</label>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, onMounted, defineComponent, nextTick, inject } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const city = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].city : null;\n },\n set(city) {\n const data = {\n city: city\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const warehouse = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].warehouse : null;\n },\n set(warehouse) {\n const data = {\n city: city.value,\n warehouse: warehouse\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const userForm = ref(null);\n\n const isValid = (data) => {\n return !!(data.city && data.warehouse);\n };\n\n const shippingComponentValid = inject('shippingComponentValid');\n const shippingComponentUserData = inject('shippingComponentUserData');\n\n const isCityOpened = ref(false);\n const isWarehouseOpened = ref(false);\n const queryCity = ref('');\n const queryWarehouse = ref('');\n const cities = ref([]);\n const citiesPopular = ref([]);\n const warehouses = ref([]);\n const cityQueryInput = ref(null);\n const warehouseQueryInput = ref(null);\n const loadingCity = ref(false);\n const loadingWarehouse = ref(false);\n const cityQueryInputInQueryMode = ref(false);\n const warehouseQueryInputInQueryMode = ref(false);\n\n const cityIsValid = computed(() => {\n return city.value ? true : (!isCityInputBlured.value ? true : false);\n });\n\n const isCityInputBlured = ref(false);\n\n const warehouseIsValid = computed(() => {\n return warehouse.value ? true : (!isWarehouseInputBlured.value ? true : false);\n });\n\n const isWarehouseInputBlured = ref(false);\n\n let typeTimeout;\n\n onMounted(() => {\n shippingComponentValid.value = async () => {\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n\n if (props.item.params?.is_other_recipient && userForm.value) {\n const valid = await userForm.value.isValid();\n\n if (valid) {\n shippingComponentUserData.value = userForm.value.getValue();\n }\n\n return !!(city.value && warehouse.value && valid);\n }\n\n return !!(city.value && warehouse.value);\n };\n\n if (props.item.data && props.item.data.length) {\n citiesPopular.value = props.item.data;\n }\n });\n\n const openCity = () => {\n isCityOpened.value = true;\n };\n\n const openWarehouse = () => {\n isWarehouseOpened.value = true;\n };\n\n const close = () => {\n isCityOpened.value = false;\n isWarehouseOpened.value = false;\n\n cityQueryInputInQueryMode.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n };\n\n const chooseCity = (e, item) => {\n e.stopPropagation();\n\n city.value = item;\n //warehouse.value = null;\n warehouses.value = [];\n queryWarehouse.value = '';\n\n cityQueryInputInQueryMode.value = false;\n\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n city: item.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n\n close();\n };\n\n const chooseWarehouse = (e, item) => {\n e.stopPropagation();\n\n warehouse.value = item;\n warehouseQueryInputInQueryMode.value = false;\n warehouse.value = item;\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && !e.target.closest('.dropdown')) {\n close();\n }\n });\n\n watch(queryCity, (q) => {\n clearTimeout(typeTimeout);\n city.value = null;\n\n if (q) {\n loadingCity.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n action: 'cities'\n })\n .then((response) => {\n cities.value = response.data.cities;\n })\n .finally(() => {\n loadingCity.value = false;\n });\n }, 400);\n }\n });\n\n watch(queryWarehouse, (q) => {\n clearTimeout(typeTimeout);\n\n if (q) {\n loadingWarehouse.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n city: city.value.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n }, 400);\n } else {\n warehouse.value = null;\n warehouses.value = [];\n }\n });\n\n const focusWarehouse = () => {\n isWarehouseInputBlured.value = false;\n isCityOpened.value = false;\n cityQueryInputInQueryMode.value = false;\n\n if (!warehouseQueryInputInQueryMode.value) {\n warehouseQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n warehouseQueryInput.value.value = ' ';\n warehouseQueryInput.value.focus();\n });\n }\n };\n\n const focusCity = () => {\n isCityInputBlured.value = false;\n isWarehouseInputBlured.value = false;\n isWarehouseOpened.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n if (!cityQueryInputInQueryMode.value) {\n cityQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n cityQueryInput.value.value = ' ';\n cityQueryInput.value.focus();\n });\n }\n };\n\n return {\n isCityOpened,\n isWarehouseOpened,\n openCity,\n openWarehouse,\n cities,\n citiesPopular,\n warehouses,\n chooseCity,\n chooseWarehouse,\n queryCity,\n queryWarehouse,\n city,\n warehouse,\n loadingCity,\n loadingWarehouse,\n focusWarehouse,\n focusCity,\n city,\n warehouse,\n cityQueryInput,\n warehouseQueryInput,\n cityQueryInputInQueryMode,\n warehouseQueryInputInQueryMode,\n userForm,\n cityIsValid,\n warehouseIsValid\n };\n }\n});\n</script>\n","<template>\n <div class=\"component novaposhta-wrapper\">\n <checkout-shipping-other-recipient v-if=\"item.params?.is_other_recipient\" ref=\"userForm\"></checkout-shipping-other-recipient>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isCityOpened, 'is-top': cityQueryInputInQueryMode }\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openCity\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingCity, 'is-danger': !cityIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryCity\" @focus=\"focusCity\" :placeholder=\"__('shop.order.city_placeholder')\" autocomplete=\"chrome-off\" v-show=\"cityQueryInputInQueryMode\" ref=\"cityQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"city ? city.name : ''\" @focus=\"focusCity\" placeholder=\" \" v-show=\"!cityQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!cityQueryInputInQueryMode\">{{ __('shop.order.city') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!cityIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in queryCity ? cities : citiesPopular\" v-bind:key=\"item.id\" @click=\"chooseCity($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryCity && !cities.length && !loadingCity\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isWarehouseOpened, 'is-top': warehouseQueryInputInQueryMode }\" v-if=\"city\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openWarehouse\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingWarehouse, 'is-danger': !warehouseIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryWarehouse\" @focus=\"focusWarehouse\" :placeholder=\"__('shop.order.warehouse_placeholder')\" autocomplete=\"chrome-off\" v-show=\"warehouseQueryInputInQueryMode\" ref=\"warehouseQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"warehouse ? warehouse.name : ''\" @focus=\"focusWarehouse\" placeholder=\" \" v-show=\"!warehouseQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!warehouseQueryInputInQueryMode\">{{ __('shop.order.warehouse') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!warehouseIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in warehouses\" v-bind:key=\"item.id\" @click=\"chooseWarehouse($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryWarehouse && !warehouses.length && !loadingWarehouse\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-top': warehouseQueryInputInQueryMode }\" v-else>\n <div class=\"dropdown-trigger\">\n <div class=\"user-form\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" disabled />\n <label class=\"label\">{{ __('shop.order.warehouse') }}</label>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, onMounted, defineComponent, nextTick, inject } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const city = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].city : null;\n },\n set(city) {\n const data = {\n city: city\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const warehouse = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].warehouse : null;\n },\n set(warehouse) {\n const data = {\n city: city.value,\n warehouse: warehouse\n };\n\n props.commit(props.item.code, data, isValid(data));\n }\n });\n\n const userForm = ref(null);\n\n const isValid = (data) => {\n return !!(data.city && data.warehouse);\n };\n\n const shippingComponentValid = inject('shippingComponentValid');\n const shippingComponentUserData = inject('shippingComponentUserData');\n\n const isCityOpened = ref(false);\n const isWarehouseOpened = ref(false);\n const queryCity = ref('');\n const queryWarehouse = ref('');\n const cities = ref([]);\n const citiesPopular = ref([]);\n const warehouses = ref([]);\n const cityQueryInput = ref(null);\n const warehouseQueryInput = ref(null);\n const loadingCity = ref(false);\n const loadingWarehouse = ref(false);\n const cityQueryInputInQueryMode = ref(false);\n const warehouseQueryInputInQueryMode = ref(false);\n\n const cityIsValid = computed(() => {\n return city.value ? true : (!isCityInputBlured.value ? true : false);\n });\n\n const isCityInputBlured = ref(false);\n\n const warehouseIsValid = computed(() => {\n return warehouse.value ? true : (!isWarehouseInputBlured.value ? true : false);\n });\n\n const isWarehouseInputBlured = ref(false);\n\n let typeTimeout;\n\n onMounted(() => {\n shippingComponentValid.value = async () => {\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n\n if (props.item.params?.is_other_recipient && userForm.value) {\n const valid = await userForm.value.isValid();\n\n if (valid) {\n shippingComponentUserData.value = userForm.value.getValue();\n }\n\n return !!(city.value && warehouse.value && valid);\n }\n\n return !!(city.value && warehouse.value);\n };\n\n if (props.item.data && props.item.data.length) {\n citiesPopular.value = props.item.data;\n }\n });\n\n const openCity = () => {\n isCityOpened.value = true;\n };\n\n const openWarehouse = () => {\n isWarehouseOpened.value = true;\n };\n\n const close = () => {\n isCityOpened.value = false;\n isWarehouseOpened.value = false;\n\n cityQueryInputInQueryMode.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n };\n\n const chooseCity = (e, item) => {\n e.stopPropagation();\n\n city.value = item;\n //warehouse.value = null;\n warehouses.value = [];\n queryWarehouse.value = '';\n\n cityQueryInputInQueryMode.value = false;\n\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n city: item.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n\n close();\n };\n\n const chooseWarehouse = (e, item) => {\n e.stopPropagation();\n\n warehouse.value = item;\n warehouseQueryInputInQueryMode.value = false;\n warehouse.value = item;\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && !e.target.closest('.dropdown')) {\n close();\n }\n });\n\n watch(queryCity, (q) => {\n clearTimeout(typeTimeout);\n city.value = null;\n\n if (q) {\n loadingCity.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n action: 'cities'\n })\n .then((response) => {\n cities.value = response.data.cities;\n })\n .finally(() => {\n loadingCity.value = false;\n });\n }, 400);\n }\n });\n\n watch(queryWarehouse, (q) => {\n clearTimeout(typeTimeout);\n\n if (q) {\n loadingWarehouse.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n city: city.value.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n }, 400);\n } else {\n warehouse.value = null;\n warehouses.value = [];\n }\n });\n\n const focusWarehouse = () => {\n isWarehouseInputBlured.value = false;\n isCityOpened.value = false;\n cityQueryInputInQueryMode.value = false;\n\n if (!warehouseQueryInputInQueryMode.value) {\n warehouseQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n warehouseQueryInput.value.value = ' ';\n warehouseQueryInput.value.focus();\n });\n }\n };\n\n const focusCity = () => {\n isCityInputBlured.value = false;\n isWarehouseInputBlured.value = false;\n isWarehouseOpened.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n if (!cityQueryInputInQueryMode.value) {\n cityQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n cityQueryInput.value.value = ' ';\n cityQueryInput.value.focus();\n });\n }\n };\n\n return {\n isCityOpened,\n isWarehouseOpened,\n openCity,\n openWarehouse,\n cities,\n citiesPopular,\n warehouses,\n chooseCity,\n chooseWarehouse,\n queryCity,\n queryWarehouse,\n city,\n warehouse,\n loadingCity,\n loadingWarehouse,\n focusWarehouse,\n focusCity,\n city,\n warehouse,\n cityQueryInput,\n warehouseQueryInput,\n cityQueryInputInQueryMode,\n warehouseQueryInputInQueryMode,\n userForm,\n cityIsValid,\n warehouseIsValid\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","data","Object","item","commit","Function","setup","typeTimeout","city","computed","get","code","set","isValid","warehouse","value","userForm","ref","shippingComponentValid","inject","shippingComponentUserData","isCityOpened","isWarehouseOpened","queryCity","queryWarehouse","cities","citiesPopular","warehouses","cityQueryInput","warehouseQueryInput","loadingCity","loadingWarehouse","cityQueryInputInQueryMode","warehouseQueryInputInQueryMode","cityIsValid","isCityInputBlured","warehouseIsValid","isWarehouseInputBlured","onMounted","f","params","is_other_recipient","valid","getValue","resolve","i","apply","this","args","length","close","window","addEventListener","e","key","target","closest","watch","q","clearTimeout","setTimeout","$http","post","$ziggy","action","then","response","id","openCity","openWarehouse","chooseCity","stopPropagation","chooseWarehouse","focusWarehouse","nextTick","focus","focusCity","_createElementVNode","type","disabled","_createElementBlock","_hoisted_1","_ctx","_ctx$item$params","_createBlock","onMouseleave","onClick","_hoisted_2","onFocus","placeholder","autocomplete","name","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","$event","_hoisted_10","_hoisted_11","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24"],"mappings":"0JA4DA,MAAeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,OACNC,KAAMD,OACNE,OAAQC,UAEZC,eAAMN,SA+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AAOC,KAAK,aAAa,QAAS/D,MAAOmE,YAAYA,YAAUS,QAAYH,sCAAON,wDAAgBO,YAAY,2BAAaP,qDAC3HL,oCAAa,2BAAoDK,8CAAnCA,oCAC9BiB,MAI6BjB,kEAAjCF,yBAAAoB,oBAAsDlB,0CAG9DL,2BAAAwB,GACIxB,2BAAAyB,oBACItB,kDAAwCE,uBAAR/E,wBAAhC6E,gCAAS,gBAAkD1B,IAAKnD,EAAKgE,GAAKmB,2BAAOJ,kBAAgBc,EAAQ7F,uBAAUA,EAAKwF,qBACvFT,kBAAmBA,aAAWjC,QAAWiC,kEAA1EF,2BAAAuB,oBAA+FrB,iFAI3GF,0DAAW,qBAAqCE,sCAC5CL,2BAAA2B,GACI3B,2BAAA4B,GACI5B,2BAAA6B,GACIC,EACA9B,6BAAA+B,oBAAwB1B"}
1
+ {"version":3,"file":"CheckoutShippingNovaposhtaWarehouse.js","sources":["../../../../../src/components/shop/order/shipping/CheckoutShippingNovaposhtaWarehouse.vue","../../../../../src/components/shop/order/shipping/CheckoutShippingNovaposhtaWarehouse.vue?vue&type=template&id=b5dbac5e&lang.js"],"sourcesContent":["<template>\n <div class=\"component novaposhta-wrapper\">\n <checkout-shipping-other-recipient v-if=\"item.params?.is_other_recipient\" ref=\"userForm\"></checkout-shipping-other-recipient>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isCityOpened, 'is-top': cityQueryInputInQueryMode }\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openCity\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingCity, 'is-danger': !cityIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryCity\" @focus=\"focusCity\" :placeholder=\"__('shop.order.city_placeholder')\" autocomplete=\"chrome-off\" v-show=\"cityQueryInputInQueryMode\" ref=\"cityQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"city ? city.name : ''\" @focus=\"focusCity\" placeholder=\" \" v-show=\"!cityQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!cityQueryInputInQueryMode\">{{ __('shop.order.city') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!cityIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in queryCity ? cities : citiesPopular\" v-bind:key=\"item.id\" @click=\"chooseCity($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryCity && !cities.length && !loadingCity\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isWarehouseOpened, 'is-top': warehouseQueryInputInQueryMode }\" v-if=\"city\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openWarehouse\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingWarehouse, 'is-danger': !warehouseIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryWarehouse\" @focus=\"focusWarehouse\" :placeholder=\"__('shop.order.warehouse_placeholder')\" autocomplete=\"chrome-off\" v-show=\"warehouseQueryInputInQueryMode\" ref=\"warehouseQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"warehouse ? warehouse.name : ''\" @focus=\"focusWarehouse\" placeholder=\" \" v-show=\"!warehouseQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!warehouseQueryInputInQueryMode\">{{ __('shop.order.warehouse') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!warehouseIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in warehouses\" v-bind:key=\"item.id\" @click=\"chooseWarehouse($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryWarehouse && !warehouses.length && !loadingWarehouse\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-top': warehouseQueryInputInQueryMode }\" v-else>\n <div class=\"dropdown-trigger\">\n <div class=\"user-form\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" disabled />\n <label class=\"label\">{{ __('shop.order.warehouse') }}</label>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, onMounted, defineComponent, nextTick, inject } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function,\n takeUserData: Boolean\n },\n setup(props) {\n const city = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].city : userCity.value;\n },\n set(city) {\n const data = {\n city: city\n };\n\n props.commit(props.item.code, data, isValid(data));\n\n return city;\n }\n });\n\n const warehouse = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].warehouse : userWarehouse.value;\n },\n set(warehouse) {\n const data = {\n city: city.value,\n warehouse: warehouse\n };\n\n props.commit(props.item.code, data, isValid(data));\n\n return warehouse;\n }\n });\n\n const userForm = ref(null);\n\n const isValid = (data) => {\n return !!(data.city && data.warehouse);\n };\n\n const shippingComponentValid = inject('shippingComponentValid');\n const shippingComponentUserData = inject('shippingComponentUserData');\n\n const isCityOpened = ref(false);\n const isWarehouseOpened = ref(false);\n const queryCity = ref('');\n const queryWarehouse = ref('');\n const cities = ref([]);\n const citiesPopular = ref([]);\n const warehouses = ref([]);\n const cityQueryInput = ref(null);\n const warehouseQueryInput = ref(null);\n const loadingCity = ref(false);\n const loadingWarehouse = ref(false);\n const cityQueryInputInQueryMode = ref(false);\n const warehouseQueryInputInQueryMode = ref(false);\n const userCity = ref(null);\n const userWarehouse = ref(null);\n\n const cityIsValid = computed(() => {\n return city.value ? true : (!isCityInputBlured.value ? true : false);\n });\n\n const isCityInputBlured = ref(false);\n\n const warehouseIsValid = computed(() => {\n return warehouse.value ? true : (!isWarehouseInputBlured.value ? true : false);\n });\n\n const isWarehouseInputBlured = ref(false);\n\n let typeTimeout;\n\n onMounted(() => {\n shippingComponentValid.value = async () => {\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n\n if (props.item.params?.is_other_recipient && userForm.value) {\n const valid = await userForm.value.isValid();\n\n if (valid) {\n shippingComponentUserData.value = userForm.value.getValue();\n }\n\n return !!(city.value && warehouse.value && valid);\n }\n\n return !!(city.value && warehouse.value);\n };\n\n if (props.item.data && props.item.data.length) {\n citiesPopular.value = props.item.data;\n }\n\n if (props.takeUserData) {\n const loggedUser = inject('loggedUser');\n const code = loggedUser.value.shipping_data?.delivery;\n\n if (code === props.item.code) {\n setTimeout(() => {\n userCity.value = JSON.parse(JSON.stringify(loggedUser.value.shipping_data?.city));\n userWarehouse.value = JSON.parse(JSON.stringify(loggedUser.value.shipping_data?.warehouse));\n }, 300);\n }\n }\n });\n\n const openCity = () => {\n isCityOpened.value = true;\n };\n\n const openWarehouse = () => {\n isWarehouseOpened.value = true;\n };\n\n const close = () => {\n isCityOpened.value = false;\n isWarehouseOpened.value = false;\n\n cityQueryInputInQueryMode.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n };\n\n const chooseCity = (e, item) => {\n e.stopPropagation();\n\n city.value = item;\n //warehouse.value = null;\n warehouses.value = [];\n queryWarehouse.value = '';\n\n cityQueryInputInQueryMode.value = false;\n\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n city: item.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n\n close();\n };\n\n const chooseWarehouse = (e, item) => {\n e.stopPropagation();\n\n warehouse.value = item;\n warehouseQueryInputInQueryMode.value = false;\n warehouse.value = item;\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && !e.target.closest('.dropdown')) {\n close();\n }\n });\n\n watch(queryCity, (q) => {\n clearTimeout(typeTimeout);\n city.value = null;\n\n if (q) {\n loadingCity.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n action: 'cities'\n })\n .then((response) => {\n cities.value = response.data.cities;\n })\n .finally(() => {\n loadingCity.value = false;\n });\n }, 400);\n }\n });\n\n watch(queryWarehouse, (q) => {\n clearTimeout(typeTimeout);\n\n if (q) {\n loadingWarehouse.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n city: city.value.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n }, 400);\n } else {\n warehouse.value = null;\n warehouses.value = [];\n }\n });\n\n const focusWarehouse = () => {\n isWarehouseInputBlured.value = false;\n isCityOpened.value = false;\n cityQueryInputInQueryMode.value = false;\n\n if (!warehouseQueryInputInQueryMode.value) {\n warehouseQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n warehouseQueryInput.value.value = ' ';\n warehouseQueryInput.value.focus();\n });\n }\n };\n\n const focusCity = () => {\n isCityInputBlured.value = false;\n isWarehouseInputBlured.value = false;\n isWarehouseOpened.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n if (!cityQueryInputInQueryMode.value) {\n cityQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n cityQueryInput.value.value = ' ';\n cityQueryInput.value.focus();\n });\n }\n };\n\n return {\n isCityOpened,\n isWarehouseOpened,\n openCity,\n openWarehouse,\n cities,\n citiesPopular,\n warehouses,\n chooseCity,\n chooseWarehouse,\n queryCity,\n queryWarehouse,\n city,\n warehouse,\n loadingCity,\n loadingWarehouse,\n focusWarehouse,\n focusCity,\n city,\n warehouse,\n cityQueryInput,\n warehouseQueryInput,\n cityQueryInputInQueryMode,\n warehouseQueryInputInQueryMode,\n userForm,\n cityIsValid,\n warehouseIsValid,\n };\n }\n});\n</script>\n","<template>\n <div class=\"component novaposhta-wrapper\">\n <checkout-shipping-other-recipient v-if=\"item.params?.is_other_recipient\" ref=\"userForm\"></checkout-shipping-other-recipient>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isCityOpened, 'is-top': cityQueryInputInQueryMode }\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openCity\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingCity, 'is-danger': !cityIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryCity\" @focus=\"focusCity\" :placeholder=\"__('shop.order.city_placeholder')\" autocomplete=\"chrome-off\" v-show=\"cityQueryInputInQueryMode\" ref=\"cityQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"city ? city.name : ''\" @focus=\"focusCity\" placeholder=\" \" v-show=\"!cityQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!cityQueryInputInQueryMode\">{{ __('shop.order.city') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!cityIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in queryCity ? cities : citiesPopular\" v-bind:key=\"item.id\" @click=\"chooseCity($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryCity && !cities.length && !loadingCity\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isWarehouseOpened, 'is-top': warehouseQueryInputInQueryMode }\" v-if=\"city\" @mouseleave=\"close\">\n <div class=\"dropdown-trigger\" @click=\"openWarehouse\">\n <div class=\"user-form\">\n <div class=\"control\" v-bind:class=\"{ 'is-loading': loadingWarehouse, 'is-danger': !warehouseIsValid }\">\n <input type=\"text\" class=\"input is-nolabel\" v-model=\"queryWarehouse\" @focus=\"focusWarehouse\" :placeholder=\"__('shop.order.warehouse_placeholder')\" autocomplete=\"chrome-off\" v-show=\"warehouseQueryInputInQueryMode\" ref=\"warehouseQueryInput\" />\n <input type=\"text\" class=\"input\" :value=\"warehouse ? warehouse.name : ''\" @focus=\"focusWarehouse\" placeholder=\" \" v-show=\"!warehouseQueryInputInQueryMode\" />\n <label class=\"label\" v-show=\"!warehouseQueryInputInQueryMode\">{{ __('shop.order.warehouse') }}</label>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <p class=\"help is-danger\" v-if=\"!warehouseIsValid\">{{ __('auth.validation.required') }}</p>\n </div>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"item in warehouses\" v-bind:key=\"item.id\" @click=\"chooseWarehouse($event, item)\">{{ item.name }}</a>\n <div class=\"dropdown-item\" v-if=\"queryWarehouse && !warehouses.length && !loadingWarehouse\">{{ __('shop.checkout.shipment.warehouse.not_found') }}</div>\n </div>\n </div>\n </div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-top': warehouseQueryInputInQueryMode }\" v-else>\n <div class=\"dropdown-trigger\">\n <div class=\"user-form\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" disabled />\n <label class=\"label\">{{ __('shop.order.warehouse') }}</label>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, watch, onMounted, defineComponent, nextTick, inject } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function,\n takeUserData: Boolean\n },\n setup(props) {\n const city = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].city : userCity.value;\n },\n set(city) {\n const data = {\n city: city\n };\n\n props.commit(props.item.code, data, isValid(data));\n\n return city;\n }\n });\n\n const warehouse = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].warehouse : userWarehouse.value;\n },\n set(warehouse) {\n const data = {\n city: city.value,\n warehouse: warehouse\n };\n\n props.commit(props.item.code, data, isValid(data));\n\n return warehouse;\n }\n });\n\n const userForm = ref(null);\n\n const isValid = (data) => {\n return !!(data.city && data.warehouse);\n };\n\n const shippingComponentValid = inject('shippingComponentValid');\n const shippingComponentUserData = inject('shippingComponentUserData');\n\n const isCityOpened = ref(false);\n const isWarehouseOpened = ref(false);\n const queryCity = ref('');\n const queryWarehouse = ref('');\n const cities = ref([]);\n const citiesPopular = ref([]);\n const warehouses = ref([]);\n const cityQueryInput = ref(null);\n const warehouseQueryInput = ref(null);\n const loadingCity = ref(false);\n const loadingWarehouse = ref(false);\n const cityQueryInputInQueryMode = ref(false);\n const warehouseQueryInputInQueryMode = ref(false);\n const userCity = ref(null);\n const userWarehouse = ref(null);\n\n const cityIsValid = computed(() => {\n return city.value ? true : (!isCityInputBlured.value ? true : false);\n });\n\n const isCityInputBlured = ref(false);\n\n const warehouseIsValid = computed(() => {\n return warehouse.value ? true : (!isWarehouseInputBlured.value ? true : false);\n });\n\n const isWarehouseInputBlured = ref(false);\n\n let typeTimeout;\n\n onMounted(() => {\n shippingComponentValid.value = async () => {\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n\n if (props.item.params?.is_other_recipient && userForm.value) {\n const valid = await userForm.value.isValid();\n\n if (valid) {\n shippingComponentUserData.value = userForm.value.getValue();\n }\n\n return !!(city.value && warehouse.value && valid);\n }\n\n return !!(city.value && warehouse.value);\n };\n\n if (props.item.data && props.item.data.length) {\n citiesPopular.value = props.item.data;\n }\n\n if (props.takeUserData) {\n const loggedUser = inject('loggedUser');\n const code = loggedUser.value.shipping_data?.delivery;\n\n if (code === props.item.code) {\n setTimeout(() => {\n userCity.value = JSON.parse(JSON.stringify(loggedUser.value.shipping_data?.city));\n userWarehouse.value = JSON.parse(JSON.stringify(loggedUser.value.shipping_data?.warehouse));\n }, 300);\n }\n }\n });\n\n const openCity = () => {\n isCityOpened.value = true;\n };\n\n const openWarehouse = () => {\n isWarehouseOpened.value = true;\n };\n\n const close = () => {\n isCityOpened.value = false;\n isWarehouseOpened.value = false;\n\n cityQueryInputInQueryMode.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n isCityInputBlured.value = true;\n isWarehouseInputBlured.value = true;\n };\n\n const chooseCity = (e, item) => {\n e.stopPropagation();\n\n city.value = item;\n //warehouse.value = null;\n warehouses.value = [];\n queryWarehouse.value = '';\n\n cityQueryInputInQueryMode.value = false;\n\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n city: item.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n\n close();\n };\n\n const chooseWarehouse = (e, item) => {\n e.stopPropagation();\n\n warehouse.value = item;\n warehouseQueryInputInQueryMode.value = false;\n warehouse.value = item;\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if ((isCityOpened.value || isWarehouseOpened.value) && !e.target.closest('.dropdown')) {\n close();\n }\n });\n\n watch(queryCity, (q) => {\n clearTimeout(typeTimeout);\n city.value = null;\n\n if (q) {\n loadingCity.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n action: 'cities'\n })\n .then((response) => {\n cities.value = response.data.cities;\n })\n .finally(() => {\n loadingCity.value = false;\n });\n }, 400);\n }\n });\n\n watch(queryWarehouse, (q) => {\n clearTimeout(typeTimeout);\n\n if (q) {\n loadingWarehouse.value = true;\n\n typeTimeout = setTimeout(() => {\n $http\n .post($ziggy('api.delivery-nova-poshta'), {\n q: q,\n city: city.value.id,\n action: 'warehouses'\n })\n .then((response) => {\n warehouses.value = response.data.warehouses;\n })\n .finally(() => {\n loadingWarehouse.value = false;\n });\n }, 400);\n } else {\n warehouse.value = null;\n warehouses.value = [];\n }\n });\n\n const focusWarehouse = () => {\n isWarehouseInputBlured.value = false;\n isCityOpened.value = false;\n cityQueryInputInQueryMode.value = false;\n\n if (!warehouseQueryInputInQueryMode.value) {\n warehouseQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n warehouseQueryInput.value.value = ' ';\n warehouseQueryInput.value.focus();\n });\n }\n };\n\n const focusCity = () => {\n isCityInputBlured.value = false;\n isWarehouseInputBlured.value = false;\n isWarehouseOpened.value = false;\n warehouseQueryInputInQueryMode.value = false;\n\n if (!cityQueryInputInQueryMode.value) {\n cityQueryInputInQueryMode.value = true;\n\n nextTick(() => {\n cityQueryInput.value.value = ' ';\n cityQueryInput.value.focus();\n });\n }\n };\n\n return {\n isCityOpened,\n isWarehouseOpened,\n openCity,\n openWarehouse,\n cities,\n citiesPopular,\n warehouses,\n chooseCity,\n chooseWarehouse,\n queryCity,\n queryWarehouse,\n city,\n warehouse,\n loadingCity,\n loadingWarehouse,\n focusWarehouse,\n focusCity,\n city,\n warehouse,\n cityQueryInput,\n warehouseQueryInput,\n cityQueryInputInQueryMode,\n warehouseQueryInputInQueryMode,\n userForm,\n cityIsValid,\n warehouseIsValid,\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","data","Object","item","commit","Function","takeUserData","Boolean","setup","typeTimeout","city","computed","get","code","userCity","value","set","isValid","warehouse","userWarehouse","userForm","ref","shippingComponentValid","inject","shippingComponentUserData","isCityOpened","isWarehouseOpened","queryCity","queryWarehouse","cities","citiesPopular","warehouses","cityQueryInput","warehouseQueryInput","loadingCity","loadingWarehouse","cityQueryInputInQueryMode","warehouseQueryInputInQueryMode","cityIsValid","isCityInputBlured","warehouseIsValid","isWarehouseInputBlured","onMounted","then","direct","params","is_other_recipient","valid","getValue","i","e","length","loggedUser","shipping_data","_loggedUser$value$shi","delivery","setTimeout","JSON","parse","stringify","_loggedUser$value$shi2","_loggedUser$value$shi3","close","window","addEventListener","key","target","closest","watch","q","clearTimeout","$http","post","$ziggy","action","response","id","openCity","openWarehouse","chooseCity","stopPropagation","chooseWarehouse","focusWarehouse","nextTick","focus","focusCity","_createElementVNode","type","disabled","_createElementBlock","_hoisted_1","_ctx","_ctx$item$params","_createBlock","onMouseleave","onClick","_hoisted_2","onFocus","placeholder","autocomplete","name","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","$event","_hoisted_10","_hoisted_11","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24"],"mappings":"0JA4DA,MAAeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,OACNC,KAAMD,OACNE,OAAQC,SACRC,aAAcC,SAElBC,eAAMR,SAqEES,EApEEC,EAAOC,WAAS,CAClBC,sBACWZ,EAAMC,KAAKD,EAAMG,KAAKU,MAAQb,EAAMC,KAAKD,EAAMG,KAAKU,MAAMH,KAAOI,EAASC,OAErFC,aAAIN,OACMT,EAAO,CACTS,KAAMA,UAGVV,EAAMI,OAAOJ,EAAMG,KAAKU,KAAMZ,EAAMgB,EAAQhB,IAErCS,KAITQ,EAAYP,WAAS,CACvBC,sBACWZ,EAAMC,KAAKD,EAAMG,KAAKU,MAAQb,EAAMC,KAAKD,EAAMG,KAAKU,MAAMK,UAAYC,EAAcJ,OAE/FC,aAAIE,OACMjB,EAAO,CACTS,KAAMA,EAAKK,MACXG,UAAWA,UAGflB,EAAMI,OAAOJ,EAAMG,KAAKU,KAAMZ,EAAMgB,EAAQhB,IAErCiB,KAITE,EAAWC,MAAI,MAEfJ,EAAU,SAAChB,YACHA,EAAKS,OAAQT,EAAKiB,YAG1BI,EAAyBC,SAAO,0BAChCC,EAA4BD,SAAO,6BAEnCE,EAAeJ,OAAI,GACnBK,EAAoBL,OAAI,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gCAAS,gBAAkDxB,IAAK9D,EAAKyE,GAAKmB,2BAAOJ,kBAAgBc,EAAQtG,uBAAUA,EAAKiG,qBACvFT,kBAAmBA,aAAWxC,QAAWwC,kEAA1EF,2BAAAuB,oBAA+FrB,iFAI3GF,0DAAW,qBAAqCE,sCAC5CL,2BAAA2B,GACI3B,2BAAA4B,GACI5B,2BAAA6B,GACIC,EACA9B,6BAAA+B,oBAAwB1B"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),r=require("@perevorot/shop/dist/forms/FormText"),o=require("@perevorot/shop/dist/forms/FormRadio"),a=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=i(n),l=i(r),h=i(o),d=u(a);e.markRaw(l.default),e.markRaw(h.default);var _=t.SchemaFormFactory([m.default({})]),s=e.defineComponent({components:{SchemaForm:_},setup:function(){var n,r=e.inject("loggedUser"),o=e.inject("field"),a=e.ref(null),i=e.ref(null),u=(n=function(){return i.value.click(),p.isValid(m.value)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(n.apply(this,e))}catch(e){return Promise.reject(e)}}),m=e.ref({type:o("other_type","me"),name:o("other_name",""),last_name:o("other_last_name",""),middle_name:o("other_middle_name",""),phone_me:o("other_phone_me",""),phone_other:o("other_phone_other","")}),_=e.ref({type:{component:h.default,model:"type",label:"",list:[{code:"me",value:__("auth.registration.form.user_type_me")},{code:"other",value:__("auth.registration.form.user_type_other")}]},name:{component:l.default,label:__("auth.registration.form.name"),placeholder:__("auth.registration.form.name"),model:"name",condition:function(e){return"other"===e.type}},last_name:{component:l.default,label:__("auth.registration.form.last_name"),placeholder:__("auth.registration.form.last_name"),model:"last_name",condition:function(e){return"other"===e.type}},middle_name:{component:l.default,label:__("auth.registration.form.middle_name"),placeholder:__("auth.registration.form.middle_name"),model:"middle_name",condition:function(e){return"other"===e.type}},phone_me:{component:l.default,label:__("auth.registration.form.phone"),model:"phone_me",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"me"===e.type}},phone_other:{component:l.default,label:__("auth.registration.form.phone"),model:"phone_other",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"other"===e.type}}});t.useSchemaForm(m);var s=/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,p=d.object().shape({name:d.string().when("type",(function(e){if("other"==e)return d.string().trim().required(__("auth.validation.required"))})),last_name:d.string().when("type",(function(e){if("other"==e)return d.string().trim().required(__("auth.validation.required"))})),middle_name:d.string().when("type",(function(e){if("other"==e)return d.string().trim().required(__("auth.validation.required"))})),phone_me:d.string().when("type",(function(e){if("me"==e)return d.string().required(__("auth.validation.phone")).matches(s,__("auth.validation.phone"))})),phone_other:d.string().when("type",(function(e){if("other"==e)return d.string().required(__("auth.validation.phone")).matches(s,__("auth.validation.phone"))}))});return e.onMounted((function(){m.value.phone_me||(m.value.phone_me=r.value.phone)})),{schema:_,validation:p,user:m,form:a,userSubmitButton:i,isValid:u,getValue:function(){var e=JSON.parse(JSON.stringify(m.value));return"me"==e.type?(e.name=r.value.name,e.last_name=r.value.last_name,e.middle_name=r.value.middle_name,e.phone=e.phone_me,delete e.phone_other,delete e.phone_me):(e.phone=e.phone_other,delete e.phone_me,delete e.phone_other),delete e.type,e}}}}),p={class:"auth-user"},c={type:"submit",ref:"userSubmitButton",class:"is-hidden"};s.render=function(t,n,r,o,a,i){var u=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",p,[e.createVNode(u,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,preventModelCleanupOnSchemaChange:!0,ref:"form"},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",c,null,512)]})),_:1},8,["schema","validation-schema"])])},module.exports=s;
1
+ "use strict";var e=require("vue"),t=require("formvuelate"),n=require("@formvuelate/plugin-vee-validate"),r=require("@perevorot/shop/dist/forms/FormText"),a=require("@perevorot/shop/dist/forms/FormRadio"),o=require("yup");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var l=i(n),m=i(r),h=i(a),d=u(o);e.markRaw(m.default),e.markRaw(h.default);var _=t.SchemaFormFactory([l.default({})]),s=e.defineComponent({components:{SchemaForm:_},setup:function(){var n,r=e.inject("loggedUser"),a=e.inject("field"),o=e.ref(null),i=e.ref(null),u=(n=function(){return i.value.click(),p.isValid(l.value)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(n.apply(this,e))}catch(e){return Promise.reject(e)}}),l=e.ref({type:a("other_type","me"),name:a("other_name",""),last_name:a("other_last_name",""),middle_name:a("other_middle_name",""),phone_me:a("other_phone_me",""),phone_other:a("other_phone_other","")}),_=e.ref({type:{component:h.default,model:"type",label:"",list:[{code:"me",value:__("auth.registration.form.user_type_me")},{code:"other",value:__("auth.registration.form.user_type_other")}]},name:{component:m.default,label:__("auth.registration.form.name"),placeholder:__("auth.registration.form.name"),model:"name",condition:function(e){return"other"===e.type}},last_name:{component:m.default,label:__("auth.registration.form.last_name"),placeholder:__("auth.registration.form.last_name"),model:"last_name",condition:function(e){return"other"===e.type}},middle_name:{component:m.default,label:__("auth.registration.form.middle_name"),placeholder:__("auth.registration.form.middle_name"),model:"middle_name",condition:function(e){return"other"===e.type}},phone_me:{component:m.default,label:__("auth.registration.form.phone"),model:"phone_me",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"me"===e.type}},phone_other:{component:m.default,label:__("auth.registration.form.phone"),model:"phone_other",mask:"(###) ###-##-##",type:"phone",condition:function(e){return"other"===e.type}}});t.useSchemaForm(l);var s=/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,p=d.object().shape({name:d.string().when("type",(function(e){if("other"==e)return d.string().trim().required(__("auth.validation.required"))})),last_name:d.string().when("type",(function(e){if("other"==e)return d.string().trim().required(__("auth.validation.required"))})),middle_name:d.string().when("type",(function(e){if("other"==e)return d.string().trim().required(__("auth.validation.required"))})),phone_me:d.string().when("type",(function(e){if("me"==e)return d.string().required(__("auth.validation.phone")).matches(s,__("auth.validation.phone"))})),phone_other:d.string().when("type",(function(e){if("other"==e)return d.string().required(__("auth.validation.phone")).matches(s,__("auth.validation.phone"))}))});return e.onMounted((function(){l.value.phone_me||(l.value.phone_me=r.value.phone);var t=e.inject("loggedUser"),n=JSON.parse(JSON.stringify(t.value.shipping_data));n&&(l.value.name||(l.value.name=n.name),l.value.last_name||(l.value.last_name=n.last_name),l.value.middle_name||(l.value.middle_name=n.middle_name),l.value.phone_other||(l.value.phone_other=n.phone))})),{schema:_,validation:p,user:l,form:o,userSubmitButton:i,isValid:u,getValue:function(){var e=JSON.parse(JSON.stringify(l.value));return"me"==e.type?(e.name=r.value.name,e.last_name=r.value.last_name,e.middle_name=r.value.middle_name,e.phone=e.phone_me,delete e.phone_other,delete e.phone_me):(e.phone=e.phone_other,delete e.phone_me,delete e.phone_other),delete e.type,e}}}}),p={class:"auth-user"},c={type:"submit",ref:"userSubmitButton",class:"is-hidden"};s.render=function(t,n,r,a,o,i){var u=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",p,[e.createVNode(u,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,preventModelCleanupOnSchemaChange:!0,ref:"form"},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",c,null,512)]})),_:1},8,["schema","validation-schema"])])},module.exports=s;
2
2
  //# sourceMappingURL=OtherRecipient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OtherRecipient.js","sources":["../../../../../src/components/shop/order/shipping/OtherRecipient.vue","../../../../../src/components/shop/order/shipping/OtherRecipient.vue?vue&type=template&id=6f94f6d6&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject, onMounted } from 'vue';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('loggedUser');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type', 'me'),\n name: field('other_name', ''),\n last_name: field('other_last_name', ''),\n middle_name: field('other_middle_name', ''),\n phone_me: field('other_phone_me', ''),\n phone_other: field('other_phone_other', ''),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.middle_name = checkoutUser.value.middle_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n placeholder: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n placeholder: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n placeholder: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n middle_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n onMounted(() => {\n if (!user.value.phone_me) {\n user.value.phone_me = checkoutUser.value.phone;\n }\n //console.log('checkoutUser.phone', checkoutUser.value.phone);\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>","<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject, onMounted } from 'vue';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('loggedUser');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type', 'me'),\n name: field('other_name', ''),\n last_name: field('other_last_name', ''),\n middle_name: field('other_middle_name', ''),\n phone_me: field('other_phone_me', ''),\n phone_other: field('other_phone_other', ''),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.middle_name = checkoutUser.value.middle_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n placeholder: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n placeholder: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n placeholder: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n middle_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n onMounted(() => {\n if (!user.value.phone_me) {\n user.value.phone_me = checkoutUser.value.phone;\n }\n //console.log('checkoutUser.phone', checkoutUser.value.phone);\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>"],"names":["markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","defineComponent","components","setup","checkoutUser","inject","field","form","ref","userSubmitButton","isValid","value","click","validation","user","i","arguments","resolve","apply","args","reject","type","name","last_name","middle_name","phone_me","phone_other","schema","component","model","label","list","code","__","placeholder","condition","mask","useSchemaForm","phoneRegExp","yup","object","shape","string","when","trim","required","matches","onMounted","phone","getValue","raw","JSON","parse","stringify","_createElementBlock","_hoisted_1","_createVNode","schemaRowClasses","_ctx","preventModelCleanupOnSchemaChange","afterForm","_createElementVNode","_hoisted_2"],"mappings":"omBAiBAA,UAAQC,WACRD,UAAQE,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzCC,kBAAgB,CAC3BC,WAAY,CACRJ,WAAAA,GAEJK,uBACUC,EAAeC,SAAO,cACtBC,EAAQD,SAAO,SACfE,EAAOC,MAAI,MACXC,EAAmBD,MAAI,MAEvBE,uBACFD,EAAiBE,MAAMC,QAEVC,EAAWH,QAAQI,EAAKH,6BA8C/B,GAAII,IAAOA,EAAIC,oCACVD,sBAGLE,UAAUC,WAAYC,4BAEtBC,aAjDJN,EAAON,MAAI,CACba,KAAMf,EAAM,aAAc,MAC1BgB,KAAMhB,EAAM,aAAc,IAC1BiB,UAAWjB,EAAM,kBAAmB,IACpCkB,YAAalB,EAAM,oBAAqB,IACxCmB,SAAUnB,EAAM,iBAAkB,IAClCoB,YAAapB,EAAM,oBAAqB,MA0BtCqB,EAASnB,MAAI,CACfa,KAAM,CACFO,UAAW/B,UACXgC,MAAO,OACPC,MAAO,GACPC,KAAM,CACF,CAAEC,KAAM,KAAMrB,MAAOsB,GAAG,wCACxB,CAAED,KAAM,QAASrB,MAAOsB,GAAG,6CAGnCX,KAAM,CACFM,UAAWhC,UACXkC,MAAOG,GAAG,+BACVC,YAAaD,GAAG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AAMc,WACZX,EAAKH,MAAMc,SAAWrB,EAAaO,MAAMqC,UAK1C,CACHrB,OAAAA,EACAd,WAAAA,EACAC,KAAAA,EACAP,KAAAA,EACAE,iBAAAA,EACAC,QAAAA,EACAuC,SAtHa,eACPC,EAAMC,KAAKC,MAAMD,KAAKE,UAAUvC,EAAKH,cAE3B,MAAZuC,EAAI7B,MACJ6B,EAAI5B,KAAOlB,EAAaO,MAAMW,KAC9B4B,EAAI3B,UAAYnB,EAAaO,MAAMY,UACnC2B,EAAI1B,YAAcpB,EAAaO,MAAMa,YACrC0B,EAAIF,MAAQE,EAAIzB,gBAETyB,EAAIxB,mBACJwB,EAAIzB,WAEXyB,EAAIF,MAAQE,EAAIxB,mBAETwB,EAAIzB,gBACJyB,EAAIxB,oBAGRwB,EAAI7B,KAEJ6B,gBClEJ,gBAGS7B,KAAK,SAASb,IAAI,yBAAyB,wGAH/D8C,2BAAAC,GACIC,iBAAYC,iBAAiB,QAAS9B,OAAQ+B,6BAA4BA,aAAaC,mCAAmC,EAAMnD,IAAI,SACrHoD,qBACP,kBAAAC,8BAAAC"}
1
+ {"version":3,"file":"OtherRecipient.js","sources":["../../../../../src/components/shop/order/shipping/OtherRecipient.vue","../../../../../src/components/shop/order/shipping/OtherRecipient.vue?vue&type=template&id=471f4537&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject, onMounted } from 'vue';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('loggedUser');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type', 'me'),\n name: field('other_name', ''),\n last_name: field('other_last_name', ''),\n middle_name: field('other_middle_name', ''),\n phone_me: field('other_phone_me', ''),\n phone_other: field('other_phone_other', ''),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.middle_name = checkoutUser.value.middle_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n placeholder: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n placeholder: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n placeholder: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n middle_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n onMounted(() => {\n if (!user.value.phone_me) {\n user.value.phone_me = checkoutUser.value.phone;\n }\n\n const loggedUser = inject('loggedUser');\n const userData = JSON.parse(JSON.stringify(loggedUser.value.shipping_data));\n\n if (userData) {\n if (!user.value.name) {\n user.value.name = userData.name;\n }\n\n if (!user.value.last_name) {\n user.value.last_name = userData.last_name;\n }\n\n if (!user.value.middle_name) {\n user.value.middle_name = userData.middle_name;\n }\n\n if (!user.value.phone_other) {\n user.value.phone_other = userData.phone;\n }\n }\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>","<template>\n <div class=\"auth-user\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :preventModelCleanupOnSchemaChange=\"true\" ref=\"form\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n</template>\n<script>\nimport { ref, defineComponent, markRaw, inject, onMounted } from 'vue';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default defineComponent({\n components: {\n SchemaForm,\n },\n setup() {\n const checkoutUser = inject('loggedUser');\n const field = inject('field');\n const form = ref(null);\n const userSubmitButton = ref(null);\n\n const isValid = async () => {\n userSubmitButton.value.click();\n\n return await validation.isValid(user.value);\n }\n\n const user = ref({\n type: field('other_type', 'me'),\n name: field('other_name', ''),\n last_name: field('other_last_name', ''),\n middle_name: field('other_middle_name', ''),\n phone_me: field('other_phone_me', ''),\n phone_other: field('other_phone_other', ''),\n });\n\n const getValue = () => {\n const raw = JSON.parse(JSON.stringify(user.value));\n\n if (raw.type == 'me') {\n raw.name = checkoutUser.value.name;\n raw.last_name = checkoutUser.value.last_name;\n raw.middle_name = checkoutUser.value.middle_name;\n raw.phone = raw.phone_me;\n\n delete raw.phone_other;\n delete raw.phone_me;\n } else {\n raw.phone = raw.phone_other;\n\n delete raw.phone_me;\n delete raw.phone_other;\n }\n\n delete raw.type;\n\n return raw;\n }\n\n const schema = ref({\n type: {\n component: FormRadio,\n model: 'type',\n label: '',\n list: [\n { code: 'me', value: __('auth.registration.form.user_type_me') },\n { code: 'other', value: __('auth.registration.form.user_type_other') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n placeholder: __('auth.registration.form.name'),\n model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n placeholder: __('auth.registration.form.last_name'),\n model: 'last_name',\n condition: (model) => model.type === 'other'\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n placeholder: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n condition: (model) => model.type === 'other'\n },\n phone_me: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_me',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'me'\n },\n phone_other: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone_other',\n mask: '(###) ###-##-##',\n type: 'phone',\n condition: (model) => model.type === 'other'\n },\n });\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n const validation = yup.object().shape({\n name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n last_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n middle_name: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().trim().required(__('auth.validation.required'));\n }\n }),\n phone_me: yup.string().when('type', (type) => {\n if (type == 'me') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n }),\n phone_other: yup.string().when('type', (type) => {\n if (type == 'other') {\n return yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n })\n });\n\n onMounted(() => {\n if (!user.value.phone_me) {\n user.value.phone_me = checkoutUser.value.phone;\n }\n\n const loggedUser = inject('loggedUser');\n const userData = JSON.parse(JSON.stringify(loggedUser.value.shipping_data));\n\n if (userData) {\n if (!user.value.name) {\n user.value.name = userData.name;\n }\n\n if (!user.value.last_name) {\n user.value.last_name = userData.last_name;\n }\n\n if (!user.value.middle_name) {\n user.value.middle_name = userData.middle_name;\n }\n\n if (!user.value.phone_other) {\n user.value.phone_other = userData.phone;\n }\n }\n });\n\n return {\n schema,\n validation,\n user,\n form,\n userSubmitButton,\n isValid,\n getValue,\n }\n }\n});\n</script>"],"names":["markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","defineComponent","components","setup","checkoutUser","inject","field","form","ref","userSubmitButton","isValid","value","click","validation","user","i","arguments","resolve","apply","args","reject","type","name","last_name","middle_name","phone_me","phone_other","schema","component","model","label","list","code","__","placeholder","condition","mask","useSchemaForm","phoneRegExp","yup","object","shape","string","when","trim","required","matches","onMounted","phone","loggedUser","userData","JSON","parse","stringify","shipping_data","getValue","raw","_createElementBlock","_hoisted_1","_createVNode","schemaRowClasses","_ctx","preventModelCleanupOnSchemaChange","afterForm","_createElementVNode","_hoisted_2"],"mappings":"omBAiBAA,UAAQC,WACRD,UAAQE,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzCC,kBAAgB,CAC3BC,WAAY,CACRJ,WAAAA,GAEJK,uBACUC,EAAeC,SAAO,cACtBC,EAAQD,SAAO,SACfE,EAAOC,MAAI,MACXC,EAAmBD,MAAI,MAEvBE,uBACFD,EAAiBE,MAAMC,QAEVC,EAAWH,QAAQI,EAAKH,6BA8C/B,GAAII,IAAOA,EAAIC,oCACVD,sBAGLE,UAAUC,WAAYC,4BAEtBC,aAjDJN,EAAON,MAAI,CACba,KAAMf,EAAM,aAAc,MAC1BgB,KAAMhB,EAAM,aAAc,IAC1BiB,UAAWjB,EAAM,kBAAmB,IACpCkB,YAAalB,EAAM,oBAAqB,IACxCmB,SAAUnB,EAAM,iBAAkB,IAClCoB,YAAapB,EAAM,oBAAqB,MA0BtCqB,EAASnB,MAAI,CACfa,KAAM,CACFO,UAAW/B,UACXgC,MAAO,OACPC,MAAO,GACPC,KAAM,CACF,CAAEC,KAAM,KAAMrB,MAAOsB,GAAG,wCACxB,CAAED,KAAM,QAASrB,MAAOsB,GAAG,6CAGnCX,KAAM,CACFM,UAAWhC,UACXkC,MAAOG,GAAG,+BACVC,YAAaD,GAAG,+BAChBJ,MAAO,OACPM,UAAW,SAACN,SAAyB,UAAfA,EAAMR,OAEhCE,UAAW,CACPK,UAAWhC,UACXkC,MAAOG,G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D,KAAKE,UAAUJ,EAAWtC,MAAM2C,gBAExDJ,IACKpC,EAAKH,MAAMW,OACZR,EAAKH,MAAMW,KAAO4B,EAAS5B,MAG1BR,EAAKH,MAAMY,YACZT,EAAKH,MAAMY,UAAY2B,EAAS3B,WAG/BT,EAAKH,MAAMa,cACZV,EAAKH,MAAMa,YAAc0B,EAAS1B,aAGjCV,EAAKH,MAAMe,cACZZ,EAAKH,MAAMe,YAAcwB,EAASF,WAKvC,CACHrB,OAAAA,EACAd,WAAAA,EACAC,KAAAA,EACAP,KAAAA,EACAE,iBAAAA,EACAC,QAAAA,EACA6C,SA1Ia,eACPC,EAAML,KAAKC,MAAMD,KAAKE,UAAUvC,EAAKH,cAE3B,MAAZ6C,EAAInC,MACJmC,EAAIlC,KAAOlB,EAAaO,MAAMW,KAC9BkC,EAAIjC,UAAYnB,EAAaO,MAAMY,UACnCiC,EAAIhC,YAAcpB,EAAaO,MAAMa,YACrCgC,EAAIR,MAAQQ,EAAI/B,gBAET+B,EAAI9B,mBACJ8B,EAAI/B,WAEX+B,EAAIR,MAAQQ,EAAI9B,mBAET8B,EAAI/B,gBACJ+B,EAAI9B,oBAGR8B,EAAInC,KAEJmC,gBClEJ,gBAGSnC,KAAK,SAASb,IAAI,yBAAyB,wGAH/DiD,2BAAAC,GACIC,iBAAYC,iBAAiB,QAASjC,OAAQkC,6BAA4BA,aAAaC,mCAAmC,EAAMtD,IAAI,SACrHuD,qBACP,kBAAAC,8BAAAC"}
package/dist/helpers.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),l=require("@perevorot/shop/dist/forms/FormSelect"),s=require("@perevorot/shop/dist/forms/FormSwitch"),d=require("@perevorot/shop/dist/forms/FormText"),c=require("@perevorot/shop/dist/forms/FormTextarea");function f(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=f(t),v=f(o),b=f(n),y=f(i),F=f(a),g=f(u),w=f(l),x=f(s),S=f(d),q=f(c);function O(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==t)return;var o,n,i=[],a=!0,u=!1;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(r){u=!0,n=r}finally{try{a||null==t.return||t.return()}finally{if(u)throw n}}return i}(r,e)||k(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(r){return function(r){if(Array.isArray(r))return _(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(r,e){if(r){if("string"==typeof r)return _(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(r,e):void 0}}function _(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}p.addMethod(p.string,"minOrEmpty",(function(r,e){return this.test({name:"minOrEmpty",exclusive:!0,message:e,params:{min:r},test:function(e){return""==e||e.length>=r}})})),p.addMethod(p.string,"numberFilled",(function(r,e){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:r},test:function(r){return!(""==r||isNaN(r))}})}));var A={pluralize:function(r,e){var t=Number(String(r).replace(/\D/g,""));return r+" "+e[t%100>4&&t%100<20?2:[2,0,1,1,1,2][Math.min(t%10,5)]]},formParse:function(e){var t={FormCheckbox:h.default,FormCheckboxes:v.default,FormPassword:b.default,FormRadio:y.default,FormRating:F.default,FormSection:g.default,FormSelect:w.default,FormSwitch:x.default,FormText:S.default,FormTextarea:q.default};window.extraFormFields&&(t=Object.assign({},t,window.extraFormFields));var o={},n={},i={};if(e.form)for(var a=function(){var e=O(l[u],2),a=e[0],s=e[1];if("_"!=a.charAt(0)){var d;switch(s.component){case"FormCheckbox":case"FormSwitch":d=!1;break;case"FormCheckboxes":d=[];break;default:d=""}o[a]=d}var c=t[s.component];c&&r.markRaw(c);var f={component:c||s.component,label:s.label,validations:{}};if(s.validation){var m=p;s.validation.forEach((function(r){var e=[],t=r;if(t.split(":").length>1){var o=r.split(":");t=o.shift(),e=JSON.parse(o)}("required"==t&&(f.validations.required=!0),"phone"==t&&f.validations.required)&&(t="matches",e=[s.pattern?new RegExp(s.pattern):/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")]);"array"!=t&&e.push(__("auth.validation."+t));try{var n;if("booleanTrue"==t)m=p.mixed.apply(p,j(e)).oneOf([!0],s.validationLabel?s.validationLabel:__("auth.validation.boolean"));else m=(n=m)[t].apply(n,j(e))}catch(r){}})),i[a]=m}s.condition&&("true"!==s.condition[1]&&"false"!==s.condition[1]||(s.condition[1]="true"===s.condition[1]),f.condition=function(r){return r[s.condition[0]]===s.condition[1]},i[a]=p.mixed().when(s.condition[0],{is:s.condition[1],then:i[a]})),window.extraFormValidators&&(i=Object.assign({},i,window.extraFormValidators)),["mask","placeholder","description","type","list","model","store","default","hidden"].forEach((function(r){s[r]&&(f[r]=s[r])})),n[a]=f},u=0,l=Object.entries(e.form);u<l.length;u++)a();return{schema:n,model:o,validation:p.object().shape(i)}},nl2p:function(r){return null==r?"":"<p>"+(r+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1</p><p>$2")+"</p>"},numberFormat:function(r){return r?r.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "):"0"}};module.exports=A;
1
+ "use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),l=require("@perevorot/shop/dist/forms/FormSelect"),s=require("@perevorot/shop/dist/forms/FormSwitch"),d=require("@perevorot/shop/dist/forms/FormText"),c=require("@perevorot/shop/dist/forms/FormTextarea");function f(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=f(t),v=f(o),b=f(n),y=f(i),F=f(a),g=f(u),w=f(l),x=f(s),S=f(d),q=f(c);function O(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==t)return;var o,n,i=[],a=!0,u=!1;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(r){u=!0,n=r}finally{try{a||null==t.return||t.return()}finally{if(u)throw n}}return i}(r,e)||k(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(r){return function(r){if(Array.isArray(r))return _(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(r,e){if(r){if("string"==typeof r)return _(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(r,e):void 0}}function _(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}p.addMethod(p.string,"minOrEmpty",(function(r,e){return this.test({name:"minOrEmpty",exclusive:!0,message:e,params:{min:r},test:function(e){return""==e||e.length>=r}})})),p.addMethod(p.string,"numberFilled",(function(r,e){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:r},test:function(r){return!(""==r||isNaN(r))}})}));var A={pluralize:function(r,e){var t=Number(String(r).replace(/\D/g,""));return r+" "+e[t%100>4&&t%100<20?2:[2,0,1,1,1,2][Math.min(t%10,5)]]},formParse:function(e){var t={FormCheckbox:h.default,FormCheckboxes:v.default,FormPassword:b.default,FormRadio:y.default,FormRating:F.default,FormSection:g.default,FormSelect:w.default,FormSwitch:x.default,FormText:S.default,FormTextarea:q.default};window.extraFormFields&&(t=Object.assign({},t,window.extraFormFields));var o={},n={},i={};if(e.form)for(var a=function(){var e,a=O(l[u],2),s=a[0],d=a[1];if("_"!=s.charAt(0)){var c;switch(d.component){case"FormCheckbox":case"FormSwitch":c=!1;break;case"FormCheckboxes":c=[];break;default:c=""}o[s]=c}var f=t[d.component];f&&r.markRaw(f);var m={component:f||d.component,label:d.label,validations:{}};if(d.validation){var h=p;d.validation.forEach((function(r){var e=[],t=r;if(t.split(":").length>1){var o=r.split(":");t=o.shift(),e=JSON.parse(o)}("required"==t&&(m.validations.required=!0),"phone"==t&&m.validations.required)&&(t="matches",e=[d.pattern?new RegExp(d.pattern):/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")]);"array"!=t&&e.push(__("auth.validation."+t));try{var n;if("booleanTrue"==t)h=p.mixed.apply(p,j(e)).oneOf([!0],d.validationLabel?d.validationLabel:__("auth.validation.boolean"));else h=(n=h)[t].apply(n,j(e))}catch(r){}})),i[s]=h}d.condition&&("true"!==d.condition[1]&&"false"!==d.condition[1]||(d.condition[1]="true"===d.condition[1]),m.condition=function(r){return r[d.condition[0]]===d.condition[1]},i[s]=p.mixed().when(d.condition[0],{is:d.condition[1],then:i[s]})),null!==(e=window.extraFormValidators)&&void 0!==e&&e[s]&&(i[s]=window.extraFormValidators[s]),["mask","placeholder","description","type","list","model","store","default","hidden"].forEach((function(r){d[r]&&(m[r]=d[r])})),n[s]=m},u=0,l=Object.entries(e.form);u<l.length;u++)a();return{schema:n,model:o,validation:p.object().shape(i)}},nl2p:function(r){return null==r?"":"<p>"+(r+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1</p><p>$2")+"</p>"},numberFormat:function(r){return r?r.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "):"0"}};module.exports=A;
2
2
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js","../src/helpers/modules/nl2p.js","../src/helpers/modules/numberFormat.js"],"sourcesContent":["import { markRaw } from 'vue';\nimport * as yup from 'yup';\n\nimport FormCheckbox from '@perevorot/shop/dist/forms/FormCheckbox';\nimport FormCheckboxes from '@perevorot/shop/dist/forms/FormCheckboxes';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport FormRating from '@perevorot/shop/dist/forms/FormRating';\nimport FormSection from '@perevorot/shop/dist/forms/FormSection';\nimport FormSelect from '@perevorot/shop/dist/forms/FormSelect';\nimport FormSwitch from '@perevorot/shop/dist/forms/FormSwitch';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\n\nyup.addMethod(yup.string, 'minOrEmpty', function (min, msg) {\n return this.test({\n name: 'minOrEmpty',\n exclusive: true,\n message: msg,\n params: {\n min: min,\n },\n test: (value) => value == '' || value.length >= min,\n });\n});\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nexport default function formParse(json) {\n let components = {\n FormCheckbox: FormCheckbox,\n FormCheckboxes: FormCheckboxes,\n FormPassword: FormPassword,\n FormRadio: FormRadio,\n FormRating: FormRating,\n FormSection: FormSection,\n FormSelect: FormSelect,\n FormSwitch: FormSwitch,\n FormText: FormText,\n FormTextarea: FormTextarea,\n };\n\n if (window.extraFormFields) {\n components = {\n ...components,\n ...window.extraFormFields,\n };\n }\n\n let model = {};\n let schema = {};\n let validation = {};\n\n if (json.form) {\n for (const [field, element] of Object.entries(json.form)) {\n if (field.charAt(0) != '_') {\n let value;\n\n switch (element.component) {\n case 'FormCheckbox':\n case 'FormSwitch':\n value = false;\n break;\n\n case 'FormCheckboxes':\n value = [];\n break;\n default:\n value = '';\n }\n\n model[field] = value;\n }\n\n const component = components[element.component];\n\n if (component) {\n markRaw(component);\n }\n\n let s = {\n component: component ? component : element.component,\n label: element.label,\n validations: {},\n };\n\n if (element.validation) {\n let v = yup;\n\n const validations = element.validation;\n\n validations.forEach((rule) => {\n let attributes = [];\n let method = rule;\n\n if (method.split(':').length > 1) {\n let ruleWithAttributes = rule.split(':');\n method = ruleWithAttributes.shift();\n\n attributes = JSON.parse(ruleWithAttributes);\n }\n\n if (method == 'required') {\n s.validations.required = true;\n }\n\n if (method == 'phone' && s.validations.required) {\n const phoneRegExp = element.pattern ? new RegExp(element.pattern) : /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n method = 'matches';\n\n attributes = [phoneRegExp, __('auth.validation.phone')];\n }\n\n if (method != 'array') {\n attributes.push(__('auth.validation.' + method));\n }\n\n try {\n if (method == 'booleanTrue') {\n v = yup.mixed(...attributes).oneOf([true], element.validationLabel ? element.validationLabel : __('auth.validation.boolean'));\n } else {\n v = v[method](...attributes);\n }\n } catch (error) {}\n });\n\n validation[field] = v;\n }\n\n if (element.condition) {\n if (element.condition[1] === 'true' || element.condition[1] === 'false') {\n element.condition[1] = element.condition[1] === 'true';\n }\n\n s.condition = (model) => model[element.condition[0]] === element.condition[1];\n\n validation[field] = yup.mixed().when(element.condition[0], {\n is: element.condition[1],\n then: validation[field],\n });\n }\n\n if (window.extraFormValidators) {\n validation = {\n ...validation,\n ...window.extraFormValidators,\n };\n }\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store', 'default', 'hidden'].forEach((f) => {\n if (element[f]) {\n s[f] = element[f];\n }\n });\n\n schema[field] = s;\n }\n }\n\n return {\n schema: schema,\n model: model,\n validation: yup.object().shape(validation),\n };\n}\n","import pluralize from './modules/pluralize';\nimport formParse from './modules/formParse';\nimport nl2p from './modules/nl2p';\nimport numberFormat from './modules/numberFormat';\n\nexport default {\n pluralize,\n formParse,\n nl2p,\n numberFormat,\n};\n","export default function pluralize(count, words) {\n let cases = [2, 0, 1, 1, 1, 2];\n\n const countClear = Number(String(count).replace(/\\D/g, ''));\n\n return count + ' ' + words[countClear % 100 > 4 && countClear % 100 < 20 ? 2 : cases[Math.min(countClear % 10, 5)]];\n}\n","export default function nl2p(str) {\n if (typeof str === 'undefined' || str === null) {\n return '';\n }\n\n return '<p>' + (str + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + '</p><p>' + '$2') + '</p>';\n}\n","export default function numberFormat(value) {\n return value ? value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ') : '0';\n}\n"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","__","isNaN","pluralize","count","words","countClear","Number","String","replace","Math","formParse","json","components","FormCheckbox","FormCheckboxes","FormPassword","FormRadio","FormRating","FormSection","FormSelect","FormSwitch","FormText","FormTextarea","window","extraFormFields","model","schema","validation","form","field","element","charAt","component","markRaw","s","label","validations","v","forEach","rule","attributes","method","split","ruleWithAttributes","shift","JSON","parse","required","pattern","RegExp","push","mixed","oneOf","validationLabel","error","condition","when","is","then","extraFormValidators","f","Object","entries","object","shape","nl2p","str","numberFormat","toString"],"mappings":"kyEAcAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,SAAmB,IAATA,GAAeA,EAAMC,QAAUT,QAIxDH,EAAIC,UAAUD,EAAIE,OAAQ,gBAAgB,SAAUC,EAAKC,UAC9CC,KAAKC,KAAK,CACbC,KAAM,eACNC,WAAW,EACXC,QAASI,GAAG,0BACZH,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,WAAqB,IAATA,GAAeG,MAAMH,UC7BhD,MAAe,CACXI,UCNW,SAAmBC,EAAOC,OAG/BC,EAAaC,OAAOC,OAAOJ,GAAOK,QAAQ,MAAO,YAEhDL,EAAQ,IAAMC,EAAMC,EAAa,IAAM,GAAKA,EAAa,IAAM,GAAK,EAJ/D,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAIyDI,KAAKnB,IAAIe,EAAa,GAAI,MDE/GK,UD+BW,SAAmBC,OAC1BC,EAAa,CACbC,aAAcA,UACdC,eAAgBA,UAChBC,aAAcA,UACdC,UAAWA,UACXC,WAAYA,UACZC,YAAaA,UACbC,WAAYA,UACZC,WAAYA,UACZC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,EAAQyB,UAAU,MAAQzB,EAAQyB,UAAU,IAE3E5B,EAAWE,GAAS1C,EAAIgE,QAAQK,KAAK1B,EAAQyB,UAAU,GAAI,CACvDE,GAAI3B,EAAQyB,UAAU,GACtBG,KAAM/B,EAAWE,MAIrBN,OAAOoC,sBACPhC,mBACOA,EACAJ,OAAOoC,uBAIjB,OAAQ,cAAe,cAAe,OAAQ,OAAQ,QAAS,QAAS,UAAW,UAAUrB,SAAQ,SAACsB,GAC/F9B,EAAQ8B,KACR1B,EAAE0B,GAAK9B,EAAQ8B,OAIvBlC,EAAOG,GAASK,SAtGW2B,OAAOC,QAAQnD,EAAKiB,+BA0GhD,CACHF,OAAQA,EACRD,MAAOA,EACPE,WAAYxC,EAAI4E,SAASC,MAAMrC,KCrKnCsC,KERW,SAAcC,UACrB,MAAOA,EACA,GAGJ,OAASA,EAAM,IAAI1D,QAAQ,gCAAiC,eAA2B,QFI9F2D,aGTW,SAAsBrE,UAC1BA,EAAQA,EAAMsE,WAAW5D,QAAQ,wBAAyB,KAAO"}
1
+ {"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js","../src/helpers/modules/nl2p.js","../src/helpers/modules/numberFormat.js"],"sourcesContent":["import { markRaw } from 'vue';\nimport * as yup from 'yup';\n\nimport FormCheckbox from '@perevorot/shop/dist/forms/FormCheckbox';\nimport FormCheckboxes from '@perevorot/shop/dist/forms/FormCheckboxes';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport FormRating from '@perevorot/shop/dist/forms/FormRating';\nimport FormSection from '@perevorot/shop/dist/forms/FormSection';\nimport FormSelect from '@perevorot/shop/dist/forms/FormSelect';\nimport FormSwitch from '@perevorot/shop/dist/forms/FormSwitch';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\n\nyup.addMethod(yup.string, 'minOrEmpty', function (min, msg) {\n return this.test({\n name: 'minOrEmpty',\n exclusive: true,\n message: msg,\n params: {\n min: min,\n },\n test: (value) => value == '' || value.length >= min,\n });\n});\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nexport default function formParse(json) {\n let components = {\n FormCheckbox: FormCheckbox,\n FormCheckboxes: FormCheckboxes,\n FormPassword: FormPassword,\n FormRadio: FormRadio,\n FormRating: FormRating,\n FormSection: FormSection,\n FormSelect: FormSelect,\n FormSwitch: FormSwitch,\n FormText: FormText,\n FormTextarea: FormTextarea,\n };\n\n if (window.extraFormFields) {\n components = {\n ...components,\n ...window.extraFormFields,\n };\n }\n\n let model = {};\n let schema = {};\n let validation = {};\n\n if (json.form) {\n for (const [field, element] of Object.entries(json.form)) {\n if (field.charAt(0) != '_') {\n let value;\n\n switch (element.component) {\n case 'FormCheckbox':\n case 'FormSwitch':\n value = false;\n break;\n\n case 'FormCheckboxes':\n value = [];\n break;\n default:\n value = '';\n }\n\n model[field] = value;\n }\n\n const component = components[element.component];\n\n if (component) {\n markRaw(component);\n }\n\n let s = {\n component: component ? component : element.component,\n label: element.label,\n validations: {},\n };\n\n if (element.validation) {\n let v = yup;\n\n const validations = element.validation;\n\n validations.forEach((rule) => {\n let attributes = [];\n let method = rule;\n\n if (method.split(':').length > 1) {\n let ruleWithAttributes = rule.split(':');\n method = ruleWithAttributes.shift();\n\n attributes = JSON.parse(ruleWithAttributes);\n }\n\n if (method == 'required') {\n s.validations.required = true;\n }\n\n if (method == 'phone' && s.validations.required) {\n const phoneRegExp = element.pattern ? new RegExp(element.pattern) : /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n method = 'matches';\n\n attributes = [phoneRegExp, __('auth.validation.phone')];\n }\n\n if (method != 'array') {\n attributes.push(__('auth.validation.' + method));\n }\n\n try {\n if (method == 'booleanTrue') {\n v = yup.mixed(...attributes).oneOf([true], element.validationLabel ? element.validationLabel : __('auth.validation.boolean'));\n } else {\n v = v[method](...attributes);\n }\n } catch (error) {}\n });\n\n validation[field] = v;\n }\n\n if (element.condition) {\n if (element.condition[1] === 'true' || element.condition[1] === 'false') {\n element.condition[1] = element.condition[1] === 'true';\n }\n\n s.condition = (model) => model[element.condition[0]] === element.condition[1];\n\n validation[field] = yup.mixed().when(element.condition[0], {\n is: element.condition[1],\n then: validation[field],\n });\n }\n\n if (window.extraFormValidators?.[field]) {\n validation[field] = window.extraFormValidators[field];\n }\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store', 'default', 'hidden'].forEach((f) => {\n if (element[f]) {\n s[f] = element[f];\n }\n });\n\n schema[field] = s;\n }\n }\n\n return {\n schema: schema,\n model: model,\n validation: yup.object().shape(validation),\n };\n}\n","import pluralize from './modules/pluralize';\nimport formParse from './modules/formParse';\nimport nl2p from './modules/nl2p';\nimport numberFormat from './modules/numberFormat';\n\nexport default {\n pluralize,\n formParse,\n nl2p,\n numberFormat,\n};\n","export default function pluralize(count, words) {\n let cases = [2, 0, 1, 1, 1, 2];\n\n const countClear = Number(String(count).replace(/\\D/g, ''));\n\n return count + ' ' + words[countClear % 100 > 4 && countClear % 100 < 20 ? 2 : cases[Math.min(countClear % 10, 5)]];\n}\n","export default function nl2p(str) {\n if (typeof str === 'undefined' || str === null) {\n return '';\n }\n\n return '<p>' + (str + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + '</p><p>' + '$2') + '</p>';\n}\n","export default function numberFormat(value) {\n return value ? value.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ') : '0';\n}\n"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","__","isNaN","pluralize","count","words","countClear","Number","String","replace","Math","formParse","json","components","FormCheckbox","FormCheckboxes","FormPassword","FormRadio","FormRating","FormSection","FormSelect","FormSwitch","FormText","FormTextarea","window","extraFormFields","model","schema","validation","form","field","element","charAt","component","markRaw","s","label","validations","v","forEach","rule","attributes","method","split","ruleWithAttributes","shift","JSON","parse","required","pattern","RegExp","push","mixed","oneOf","validationLabel","error","condition","when","is","then","extraFormValidators","_window$extraFormVali","f","Object","entries","object","shape","nl2p","str","numberFormat","toString"],"mappings":"kyEAcAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,SAAmB,IAATA,GAAeA,EAAMC,QAAUT,QAIxDH,EAAIC,UAAUD,EAAIE,OAAQ,gBAAgB,SAAUC,EAAKC,UAC9CC,KAAKC,KAAK,CACbC,KAAM,eACNC,WAAW,EACXC,QAASI,GAAG,0BACZH,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,WAAqB,IAATA,GAAeG,MAAMH,UC7BhD,MAAe,CACXI,UCNW,SAAmBC,EAAOC,OAG/BC,EAAaC,OAAOC,OAAOJ,GAAOK,QAAQ,MAAO,YAEhDL,EAAQ,IAAMC,EAAMC,EAAa,IAAM,GAAKA,EAAa,IAAM,GAAK,EAJ/D,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAIyDI,KAAKnB,IAAIe,EAAa,GAAI,MDE/GK,UD+BW,SAAmBC,OAC1BC,EAAa,CACbC,aAAcA,UACdC,eAAgBA,UAChBC,aAAcA,UACdC,UAAWA,UACXC,WAAYA,UACZC,YAAaA,UACbC,WAAYA,UACZC,WAAYA,UACZC,SAAUA,UACVC,aAAcA,WAGdC,OAAOC,kBACPZ,mBACOA,EACAW,OAAOC,sBAIdC,EAAQ,GACRC,EAAS,GACTC,EAAa,MAEbhB,EAAKiB,4CACOC,OAAOC,UACQ,KAAnBD,EAAME,OAAO,GAAW,KACpBjC,SAEIgC,EAAQE,eACP,mBACA,a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