@perevorot/shop 2.0.106 → 2.0.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("vuex"),a=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/forms/FormText"),o=require("@perevorot/shop/dist/forms/FormTextarea"),l=require("yup"),i=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var u=c(r),m=c(n),d=c(o),p=s(l);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==a)return;var r,n,o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw n}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var h=i.useToast();e.markRaw(m.default),e.markRaw(d.default);var y={components:{SchemaForm:a.SchemaFormFactory([u.default({})])},name:"order-one-click",props:{id:Number,className:String,callback:Function,closeAction:Function,model:Array,nameSpace:{type:String,default:"oneclick"}},setup:function(r){var n=e.ref(!1),o=e.ref(0),l=e.ref({}),i=t.useStore(),c=e.ref(!1),s=e.computed((function(){return i.getters["auth/me"]})),u=e.ref(!1),v=function(e,t){c.value=!1,t&&r.closeAction&&r.closeAction()},y={name:{component:m.default,label:__("shop.order."+r.nameSpace+".name"),store:"oneclick",model:"name"},phone:{component:m.default,label:__("shop.order."+r.nameSpace+".phone"),type:"phone",placeholder:"(050) 123-45-67",mask:"(###) ###-##-##",store:r.nameSpace,model:"phone"}};-1!==r.model.indexOf("email")&&(y.email={component:m.default,label:__("shop.order."+r.nameSpace+".email"),store:r.nameSpace,model:"email"}),-1!==r.model.indexOf("comment")&&(y.comment={component:d.default,label:__("shop.order."+r.nameSpace+".comment"),store:r.nameSpace,model:"email"});var b=e.ref(y),S={name:p.string().trim().required(__("auth.validation.required")),phone:p.string().trim().required(__("auth.validation.required")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone"))};-1!==r.model.indexOf("email")&&(S.email=p.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")));var _=p.object().shape(S),g=e.ref({});e.onMounted((function(){g.value={name:(s.value.last_name?s.value.last_name:"")+(s.value.name?" "+s.value.name:""),email:s.value.email?s.value.email:"",phone:s.value.phone_formatted?s.value.phone_formatted:"",id:r.id?r.id:null,namespace:r.nameSpace}})),a.useSchemaForm(g);return{open:function(){u.value=!1,c.value=!0},close:v,modal:c,loading:n,key:o,errors:l,schema:b,validation:_,model:g,onSubmit:function(){n.value=!0;var e=document.querySelector(".shop-product .product-info .cart-change-quantity input");e&&(g.value.quantity=e.value),$http.post($ziggy("api.order.oneclick"),g.value).then((function(e){r.callback?(v(),r.callback(e)):(u.value=!0,o.value++)})).finally((function(){n.value=!1})).catch((function(e){if(e.response.data&&e.response.data.error&&e.response.data.message&&h(e.response.data.message,{type:"error"}),e.response.data&&e.response.data.errors){for(var t=0,a=Object.entries(e.response.data.errors);t<a.length;t++){var r=f(a[t],2),n=r[0],i=r[1];i[0]&&(l.value[n]=i[0])}o.value++}}))},thanks:u}}},b={class:"shop-order-one-click"},S={class:"modal-content"},_=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],g={class:"box"},k={class:"title"},N={class:"field"},E=["innerHTML"],q={class:"mt-3"};y.render=function(t,a,r,n,o,l){var i=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("button",{class:e.normalizeClass(r.className?r.className:"button is-link is-small"),onClick:a[0]||(a[0]=function(){return n.open&&n.open.apply(n,arguments)})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order."+r.nameSpace+".add")),1)],2),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":n.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:a[1]||(a[1]=function(){return n.close&&n.close.apply(n,arguments)})}),e.createElementVNode("div",S,[e.createElementVNode("button",{class:"modal-close is-large",onClick:a[2]||(a[2]=function(){return n.close&&n.close.apply(n,arguments)})},_),e.createElementVNode("div",g,[e.createElementVNode("div",k,e.toDisplayString(t.__("shop.order."+r.nameSpace+".title")),1),e.withDirectives(e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(i,{schemaRowClasses:"field",schema:n.schema,"validation-schema":n.validation,"initial-errors":n.errors,key:n.key,onSubmit:n.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",N,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":n.loading}]),type:"submit"},e.toDisplayString(t.__("shop.order."+r.nameSpace+".submit")),3)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],512),[[e.vShow,!n.thanks]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:t.__("shop.order."+r.nameSpace+".thanks")},null,8,E),e.createElementVNode("div",q,[e.createElementVNode("button",{class:"button",onClick:a[3]||(a[3]=function(e){return n.close(e,!0)})},e.toDisplayString(t.__("shop.order."+r.nameSpace+".continue")),1)])],512),[[e.vShow,n.thanks]])])])],2)])},module.exports=y;
1
+ "use strict";var e=require("vue"),a=require("vuex"),t=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),n=require("@perevorot/shop/dist/forms/FormText"),o=require("@perevorot/shop/dist/forms/FormTextarea"),l=require("yup"),i=require("vue-toastification");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function s(e){if(e&&e.__esModule)return e;var a=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}})),a.default=e,Object.freeze(a)}var u=c(r),m=c(n),d=c(o),p=s(l);function f(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,a){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,n,o=[],l=!0,i=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(o.push(r.value),!a||o.length!==a);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==t.return||t.return()}finally{if(i)throw n}}return o}(e,a)||function(e,a){if(!e)return;if("string"==typeof e)return h(e,a);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,a)}(e,a)||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 h(e,a){(null==a||a>e.length)&&(a=e.length);for(var t=0,r=new Array(a);t<a;t++)r[t]=e[t];return r}var v=i.useToast();e.markRaw(m.default),e.markRaw(d.default);var y={components:{SchemaForm:t.SchemaFormFactory([u.default({})])},name:"order-one-click",props:{id:Number,className:String,callback:Function,closeAction:Function,model:Array,nameSpace:{type:String,default:"oneclick"},showPlaceholders:{type:Boolean,default:!1}},setup:function(r){var n=e.ref(!1),o=e.ref(0),l=e.ref({}),i=a.useStore(),c=e.ref(!1),s=e.computed((function(){return i.getters["auth/me"]})),u=e.ref(!1),h=function(e,a){c.value=!1,a&&r.closeAction&&r.closeAction()},y={};-1!==r.model.indexOf("name")&&(y.name={component:m.default,label:__("shop.order."+r.nameSpace+".name"),store:r.nameSpace,model:"name",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".name"):" "}),-1!==r.model.indexOf("phone")&&(y.phone={component:m.default,label:__("shop.order."+r.nameSpace+".phone"),type:"phone",placeholder:"(050) 123-45-67",mask:"(###) ###-##-##",store:r.nameSpace,model:"phone"}),-1!==r.model.indexOf("email")&&(y.email={component:m.default,label:__("shop.order."+r.nameSpace+".email"),store:r.nameSpace,model:"email",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".email"):" "}),-1!==r.model.indexOf("comment")&&(y.comment={component:d.default,label:__("shop.order."+r.nameSpace+".comment"),store:r.nameSpace,model:"comment",placeholder:r.showPlaceholders?__("shop.order."+r.nameSpace+".comment"):" "});var b=e.ref(y),S={};-1!==r.model.indexOf("name")&&(S.name=p.string().trim().required(__("auth.validation.required"))),-1!==r.model.indexOf("phone")&&(S.phone=p.string().trim().required(__("auth.validation.required")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone"))),-1!==r.model.indexOf("email")&&(S.email=p.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")));var _=p.object().shape(S),g=e.ref({});e.onMounted((function(){g.value={name:(s.value.last_name?s.value.last_name:"")+(s.value.name?" "+s.value.name:""),email:s.value.email?s.value.email:"",phone:s.value.phone_formatted?s.value.phone_formatted:"",comment:"",id:r.id?r.id:null,namespace:r.nameSpace}})),t.useSchemaForm(g);return{open:function(){u.value=!1,c.value=!0},close:h,modal:c,loading:n,key:o,errors:l,schema:b,validation:_,model:g,onSubmit:function(){n.value=!0;var e=document.querySelector(".shop-product .product-info .cart-change-quantity input");e&&(g.value.quantity=e.value),$http.post($ziggy("api.order.oneclick"),g.value).then((function(e){r.callback?(h(),r.callback(e)):(u.value=!0,o.value++)})).finally((function(){n.value=!1})).catch((function(e){if(e.response.data&&e.response.data.error&&e.response.data.message&&v(e.response.data.message,{type:"error"}),e.response.data&&e.response.data.errors){for(var a=0,t=Object.entries(e.response.data.errors);a<t.length;a++){var r=f(t[a],2),n=r[0],i=r[1];i[0]&&(l.value[n]=i[0])}o.value++}}))},thanks:u}}},b={class:"shop-order-one-click"},S={class:"modal-content"},_=[e.createElementVNode("svg",{class:"icon close"},[e.createElementVNode("use",{"xlink:href":"#close"})],-1)],g={class:"box"},k={class:"title"},N={class:"field"},E=["innerHTML"],q={class:"mt-3"};y.render=function(a,t,r,n,o,l){var i=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",b,[e.createElementVNode("button",{class:e.normalizeClass(r.className?r.className:"button is-link is-small"),onClick:t[0]||(t[0]=function(){return n.open&&n.open.apply(n,arguments)})},[e.createElementVNode("span",null,e.toDisplayString(a.__("shop.order."+r.nameSpace+".add")),1)],2),e.createElementVNode("div",{class:e.normalizeClass(["modal",{"is-active":n.modal}])},[e.createElementVNode("div",{class:"modal-background",onClick:t[1]||(t[1]=function(){return n.close&&n.close.apply(n,arguments)})}),e.createElementVNode("div",S,[e.createElementVNode("button",{class:"modal-close is-large",onClick:t[2]||(t[2]=function(){return n.close&&n.close.apply(n,arguments)})},_),e.createElementVNode("div",g,[e.createElementVNode("div",k,e.toDisplayString(a.__("shop.order."+r.nameSpace+".title")),1),e.withDirectives(e.createElementVNode("div",null,[(e.openBlock(),e.createBlock(i,{schemaRowClasses:"field",schema:n.schema,"validation-schema":n.validation,"initial-errors":n.errors,key:n.key,onSubmit:n.onSubmit},{afterForm:e.withCtx((function(){return[e.createElementVNode("div",N,[e.createElementVNode("button",{class:e.normalizeClass(["button is-link",{"is-loading":n.loading}]),type:"submit"},e.toDisplayString(a.__("shop.order."+r.nameSpace+".submit")),3)])]})),_:1},8,["schema","validation-schema","initial-errors","onSubmit"]))],512),[[e.vShow,!n.thanks]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:a.__("shop.order."+r.nameSpace+".thanks")},null,8,E),e.createElementVNode("div",q,[e.createElementVNode("button",{class:"button",onClick:t[3]||(t[3]=function(e){return n.close(e,!0)})},e.toDisplayString(a.__("shop.order."+r.nameSpace+".continue")),1)])],512),[[e.vShow,n.thanks]])])])],2)])},module.exports=y;
2
2
  //# sourceMappingURL=OneClick.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OneClick.js","sources":["../../../../src/components/shop/order/OneClick.vue","../../../../src/components/shop/order/OneClick.vue?vue&type=template&id=2cf8ac6a&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {\n name: {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: 'oneclick',\n model: 'name'\n },\n phone: {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n };\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email'\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'email'\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'))\n };\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>","<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {\n name: {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: 'oneclick',\n model: 'name'\n },\n phone: {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n };\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email'\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'email'\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'))\n };\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>"],"names":["toast","useToast","markRaw","FormText","FormTextarea","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","name","props","id","Number","className","String","callback","Function","closeAction","model","Array","nameSpace","type","setup","loading","ref","key","errors","store","useStore","modal","user","computed","getters","thanks","close","e","fromButton","value","schemaObject","component","label","__","phone","placeholder","mask","indexOf","email","comment","schema","validationObject","yup","string","trim","required","matches","validation","object","shape","onMounted","last_name","phone_formatted","namespace","useSchemaForm","open","onSubmit","quantityInput","document","querySelector","quantity","$http","post","$ziggy","then","response","error","data","message","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","$props","onClick","$setup","_ctx","_hoisted_2","_hoisted_5","_hoisted_6","_createBlock","schemaRowClasses","afterForm","_hoisted_7","innerHTML","_hoisted_9","$event"],"mappings":"ymDAsDA,IAAMA,EAAQC,aAEdC,UAAQC,WACRD,UAAQE,WAER,MAEe,CACXC,WAAY,CACRC,WAJWC,oBAAkB,CAACC,UAAkB,OAMpDC,KAAM,kBACNC,MAAO,CACHC,GAAIC,OACJC,UAAWC,OACXC,SAAUC,SACVC,YAAaD,SACbE,MAAOC,MACPC,UAAW,CACPC,KAAMP,eACG,aAGjBQ,eAAMZ,OACIa,EAAUC,OAAI,GACdC,EAAMD,MAAI,GACVE,EAASF,MAAI,IACbG,EAAQC,aACRC,EAAQL,OAAI,GACZM,EAAOC,YAAS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BI,sCAAOC,wCACtCL,2BAAAO,GACIP,qCAAc,uBAAwBI,sCAAOC,0CAK7CL,2BAAAQ,GACIR,2BAAAS,oBACOH,mBAAmBH,2CAE1BH,gDACIU,iBAAYC,iBAAiB,QAAS5C,OAAQsC,6BAA4BA,8BAA6BA,SAAS7D,IAAK6D,MAAMtB,SAAQsB,aACpHO,qBACP,kBAAAZ,2BAAAa,GACIb,uDAAc,4CAAiB5D,KAAK,4BAG7BkE,mBAAmBH,sHAP5BE,6BAadL,iCACIA,4BAAKc,UAAQR,mBAAmBH,kCAChCH,2BAAAe,GACIf,qCAAc,SAAUI,uCAAOC,QAAMW,2BAC9BV,mBAAmBH,+CAJrBE"}
1
+ {"version":3,"file":"OneClick.js","sources":["../../../../src/components/shop/order/OneClick.vue","../../../../src/components/shop/order/OneClick.vue?vue&type=template&id=fe7f9726&lang.js"],"sourcesContent":["<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n schemaObject.name = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: props.nameSpace,\n model: 'name',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.name') : ' ',\n }\n }\n\n if (props.model.indexOf('phone') !== -1) {\n schemaObject.phone = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n }\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.email') : ' ',\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'comment',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.comment') : ' ',\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n validationObject.name = yup.string().trim().required(__('auth.validation.required'));\n }\n\n if (props.model.indexOf('phone') !== -1) {\n validationObject.phone = yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n comment: '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>","<template>\n <div class=\"shop-order-one-click\">\n <button v-bind:class=\"className ? className : 'button is-link is-small'\" @click=\"open\">\n <span>{{ __('shop.order.' + nameSpace + '.add') }}</span>\n </button>\n\n <div class=\"modal\" v-bind:class=\"{ 'is-active': modal }\">\n <div class=\"modal-background\" @click=\"close\"></div>\n <div class=\"modal-content\">\n <button class=\"modal-close is-large\" @click=\"close\">\n <svg class=\"icon close\">\n <use xlink:href=\"#close\" />\n </svg>\n </button>\n <div class=\"box\">\n <div class=\"title\">\n {{ __('shop.order.' + nameSpace + '.title') }}\n </div>\n <div v-show=\"!thanks\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{\n 'is-loading': loading\n }\">\n {{ __('shop.order.' + nameSpace + '.submit') }}\n </button>\n </div>\n </template>\n </SchemaForm>\n </div>\n <div v-show=\"thanks\">\n <div v-html=\"__('shop.order.' + nameSpace + '.thanks')\"></div>\n <div class=\"mt-3\">\n <button class=\"button\" @click=\"close($event, true)\">\n {{ __('shop.order.' + nameSpace + '.continue') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, markRaw, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nconst toast = useToast();\n\nmarkRaw(FormText);\nmarkRaw(FormTextarea);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n components: {\n SchemaForm\n },\n name: 'order-one-click',\n props: {\n id: Number,\n className: String,\n callback: Function,\n closeAction: Function,\n model: Array,\n nameSpace: {\n type: String,\n default: 'oneclick'\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n }\n },\n setup(props) {\n const loading = ref(false);\n const key = ref(0);\n const errors = ref({});\n const store = useStore();\n const modal = ref(false);\n const user = computed(() => store.getters['auth/me']);\n const thanks = ref(false);\n\n const open = () => {\n thanks.value = false;\n modal.value = true;\n };\n\n const close = (e, fromButton) => {\n modal.value = false;\n\n if (fromButton && props.closeAction) {\n props.closeAction();\n }\n };\n\n let schemaObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n schemaObject.name = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.name'),\n store: props.nameSpace,\n model: 'name',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.name') : ' ',\n }\n }\n\n if (props.model.indexOf('phone') !== -1) {\n schemaObject.phone = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.phone'),\n type: 'phone',\n placeholder: '(050) 123-45-67',\n mask: '(###) ###-##-##',\n store: props.nameSpace,\n model: 'phone'\n }\n }\n\n if (props.model.indexOf('email') !== -1) {\n schemaObject.email = {\n component: FormText,\n label: __('shop.order.' + props.nameSpace + '.email'),\n store: props.nameSpace,\n model: 'email',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.email') : ' ',\n };\n }\n\n if (props.model.indexOf('comment') !== -1) {\n schemaObject.comment = {\n component: FormTextarea,\n label: __('shop.order.' + props.nameSpace + '.comment'),\n store: props.nameSpace,\n model: 'comment',\n placeholder: props.showPlaceholders ? __('shop.order.' + props.nameSpace + '.comment') : ' ',\n };\n }\n\n const schema = ref(schemaObject);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n let validationObject = {};\n\n if (props.model.indexOf('name') !== -1) {\n validationObject.name = yup.string().trim().required(__('auth.validation.required'));\n }\n\n if (props.model.indexOf('phone') !== -1) {\n validationObject.phone = yup.string().trim().required(__('auth.validation.required')).matches(phoneRegExp, __('auth.validation.phone'));\n }\n\n if (props.model.indexOf('email') !== -1) {\n validationObject.email = yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required'));\n }\n\n const validation = yup.object().shape(validationObject);\n\n const model = ref({});\n\n onMounted(() => {\n model.value = {\n name: (user.value.last_name ? user.value.last_name : '') + (user.value.name ? ' ' + user.value.name : ''),\n email: user.value.email ? user.value.email : '',\n phone: user.value.phone_formatted ? user.value.phone_formatted : '',\n comment: '',\n id: props.id ? props.id : null,\n namespace: props.nameSpace\n };\n });\n\n useSchemaForm(model);\n\n const onSubmit = () => {\n loading.value = true;\n\n const quantityInput = document.querySelector('.shop-product .product-info .cart-change-quantity input');\n\n if (quantityInput) {\n model.value.quantity = quantityInput.value;\n }\n\n $http\n .post($ziggy('api.order.oneclick'), model.value)\n .then((response) => {\n if (props.callback) {\n close();\n props.callback(response);\n } else {\n thanks.value = true;\n\n key.value++;\n }\n })\n .finally(() => {\n loading.value = false;\n })\n .catch((error) => {\n if (error.response.data && error.response.data.error && error.response.data.message) {\n toast(error.response.data.message, {\n type: 'error'\n });\n }\n\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n key.value++;\n }\n });\n };\n\n return {\n open,\n close,\n modal,\n loading,\n key,\n errors,\n schema,\n validation,\n model,\n onSubmit,\n thanks\n };\n }\n};\n</script>"],"names":["toast","useToast","markRaw","FormText","FormTextarea","components","SchemaForm","SchemaFormFactory","VeeValidatePlugin","name","props","id","Number","className","String","callback","Function","closeAction","model","Array","nameSpace","type","showPlaceholders","Boolean","setup","loading","ref","key","errors","store","useStore","modal","user","computed","getters","thanks","close","e","fromButton","value","schemaObject","indexOf","component","label","__","placeholder","phone","mask","email","comment","schema","validationObject","yup","string","trim","required","matches","validation","object","shape","onMounted","last_name","phone_formatted","namespace","useSchemaForm","open","onSubmit","quantityInput","document","querySelector","quantity","$http","post","$ziggy","then","response","error","data","message","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","$props","onClick","$setup","_ctx","_hoisted_2","_hoisted_5","_hoisted_6","_createBlock","schemaRowClasses","afterForm","_hoisted_7","innerHTML","_hoisted_9","$event"],"mappings":"ymDAsDA,IAAMA,EAAQC,aAEdC,UAAQC,WACRD,UAAQE,WAER,MAEe,CACXC,WAAY,CACRC,WAJWC,oBAAkB,CAACC,UAAkB,OAMpDC,KAAM,kBACNC,MAAO,CACHC,GAAIC,OACJC,UAAWC,OACXC,SAAUC,SACVC,YAAaD,SACbE,MAAOC,MACPC,UAAW,CACPC,KAAMP,eACG,YAEbQ,iBAAkB,CACdD,KAAME,iBACG,IAGjBC,eAAMd,OACIe,EAAUC,OAAI,GACdC,EAAMD,MAAI,GACVE,EAASF,MAAI,IACbG,EAAQC,aACRC,EAAQL,OAAI,GACZM,EAAOC,YAAS,kBAAMJ,EAAMK,QAAQ,cACpCC,EAAST,OAAI,GAObU,EAAQ,SAACC,EAAGC,GACdP,EAAMQ,OAAQ,EAEVD,GAAc5B,EAAMO,aACpBP,EAAMO,eAIVuB,EAAe,IAEkB,IAAjC9B,EAAMQ,MAAMuB,QAAQ,UACpBD,EAAa/B,KAAO,CAChBiC,UAAWvC,UACXwC,MAAOC,GAAG,cAAgBlC,EAAMU,UAAY,SAC5CS,MAAOnB,EAAMU,UACbF,MAAO,OACP2B,YAAanC,EAAMY,iBAAmBsB,GAAG,cAAgBlC,EAAMU,UAAY,SAAW,OAIxD,IAAlCV,EAAMQ,MAAMuB,QAAQ,WACpBD,EAAaM,MAAQ,CACjBJ,UAAWvC,UACXw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AAc,uBAAwBI,sCAAOC,0CAK7CL,2BAAAQ,GACIR,2BAAAS,oBACOH,mBAAmBH,2CAE1BH,gDACIU,iBAAYC,iBAAiB,QAAS5C,OAAQsC,6BAA4BA,8BAA6BA,SAAS7D,IAAK6D,MAAMtB,SAAQsB,aACpHO,qBACP,kBAAAZ,2BAAAa,GACIb,uDAAc,4CAAiB9D,KAAK,4BAG7BoE,mBAAmBH,sHAP5BE,6BAadL,iCACIA,4BAAKc,UAAQR,mBAAmBH,kCAChCH,2BAAAe,GACIf,qCAAc,SAAUI,uCAAOC,QAAMW,2BAC9BV,mBAAmBH,+CAJrBE"}
@@ -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 l=i(n),m=i(r),h=i(o),p=u(a);e.markRaw(m.default),e.markRaw(h.default);var s=t.SchemaFormFactory([l.default({})]),c=e.defineComponent({components:{SchemaForm:s},setup:function(){var n,r=e.inject("user"),o=e.inject("field"),a=e.ref(null),i=e.ref(null),u=(n=function(){return i.value.click(),d.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:o("other_type","me"),name:o("other_name",""),last_name:o("other_last_name",""),phone_me:o("other_phone_me",""),phone_other:o("other_phone_other","")}),s=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"),model:"name",condition:function(e){return"other"===e.type}},last_name:{component:m.default,label:__("auth.registration.form.last_name"),model:"last_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 c=/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,d=p.object().shape({name:p.string().when("type",(function(e){if("other"==e)return p.string().trim().required(__("auth.validation.required"))})),last_name:p.string().when("type",(function(e){if("other"==e)return p.string().trim().required(__("auth.validation.required"))})),phone_me:p.string().when("type",(function(e){if("me"==e)return p.string().required(__("auth.validation.phone")).matches(c,__("auth.validation.phone"))})),phone_other:p.string().when("type",(function(e){if("other"==e)return p.string().required(__("auth.validation.phone")).matches(c,__("auth.validation.phone"))}))});return e.onMounted((function(){l.value.phone_me||(l.value.phone_me=r.value.phone)})),{schema:s,validation:d,user:l,form:a,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.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}}}}),d={class:"auth-user"},f={type:"submit",ref:"userSubmitButton",class:"is-hidden"};c.render=function(t,n,r,o,a,i){var u=e.resolveComponent("SchemaForm");return e.openBlock(),e.createElementBlock("div",d,[e.createVNode(u,{schemaRowClasses:"field",schema:t.schema,"validation-schema":t.validation,preventModelCleanupOnSchemaChange:!0,ref:"form"},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",f,null,512)]})),_:1},8,["schema","validation-schema"])])},module.exports=c;
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("user"),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;
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=2946e944&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('user');\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 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.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 model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_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 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('user');\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 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.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 model: 'name',\n condition: (model) => model.type === 'other'\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_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 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","f","checkoutUser","inject","field","form","ref","userSubmitButton","isValid","value","click","validation","user","i","resolve","apply","this","reject","e","type","name","last_name","phone_me","phone_other","schema","component","model","label","list","code","__","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,qBAqDmBC,EApDTC,EAAeC,SAAO,QACtBC,EAAQD,SAAO,SACfE,EAAOC,MAAI,MACXC,EAAmBD,MAAI,MAEvBE,GA+CSP,oBA9CXM,EAAiBE,MAAMC,QAEVC,EAAWH,QAAQI,EAAKH,6BA8C/B,KAAQ,EAAGI,sCACNA,sBAGLC,UAAUC,MAAMC,iCAEhBC,OAAOC,MAjDXN,EAAON,MAAI,CACba,KAAMf,EAAM,aAAc,MAC1BgB,KAAMhB,E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0BAA0BY,QAAQR,EAAaJ,GAAG,sCAK9Fa,aAAU,WACD/B,EAAKH,MAAMa,WACZV,EAAKH,MAAMa,SAAWpB,EAAaO,MAAMmC,UAK1C,CACHpB,OAAAA,EACAb,WAAAA,EACAC,KAAAA,EACAP,KAAAA,EACAE,iBAAAA,EACAC,QAAAA,EACAqC,SAvGa,eACPC,EAAMC,KAAKC,MAAMD,KAAKE,UAAUrC,EAAKH,cAE3B,MAAZqC,EAAI3B,MACJ2B,EAAI1B,KAAOlB,EAAaO,MAAMW,KAC9B0B,EAAIzB,UAAYnB,EAAaO,MAAMY,UACnCyB,EAAIF,MAAQE,EAAIxB,gBAETwB,EAAIvB,mBACJuB,EAAIxB,WAEXwB,EAAIF,MAAQE,EAAIvB,mBAETuB,EAAIxB,gBACJwB,EAAIvB,oBAGRuB,EAAI3B,KAEJ2B,gBChEJ,gBAGS3B,KAAK,SAASb,IAAI,yBAAyB,wGAH/D4C,2BAAAC,GACIC,iBAAYC,iBAAiB,QAAS7B,OAAQ8B,6BAA4BA,aAAaC,mCAAmC,EAAMjD,IAAI,SACrHkD,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=25c0bbf4&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('user');\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('user');\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,Q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AASb,IAAI,yBAAyB,wGAH/D8C,2BAAAC,GACIC,iBAAYC,iBAAiB,QAAS9B,OAAQ+B,6BAA4BA,aAAaC,mCAAmC,EAAMnD,IAAI,SACrHoD,qBACP,kBAAAC,8BAAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t={props:{modelValue:{required:!0},required:{type:Boolean,default:!1},label:{type:String,required:!0},config:{type:Object,default:function(){return{type:"text"}}},readOnly:{type:Boolean,default:!1},uuid:{type:Number,default:0},validation:{type:Object,default:function(){return{}}},validations:{type:Object,default:function(){return{}}}},computed:{labelHtml:function(){var e=this.validations&&this.validations.required?' <span class="asterisk">*</span>':"";return this.label+e},strength:function(){return this.getStrength(this.modelValue)}},data:function(){return{type:"password"}},methods:{update:function(e){this.$emit("update:modelValue",e)},getStrength:function(e){var t=0;return e?(e.length>=6&&(t=1),e.length>6&&(e.match(/[a-zA-Zа-яА-Я]/)||e.match(/\d+/)||e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))&&(t=2),e.length>6&&(e.match(/[a-zA-Zа-яА-Я]/)&&e.match(/\d+/)||e.match(/\d+/)&&e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)||e.match(/[a-zA-Zа-яА-Я]/)&&e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))&&(t=3),e.length>6&&e.match(/[a-zA-Zа-яА-Я]/)&&e.match(/\d+/)&&e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)&&(t=4),t):t}}},a={class:"field-password"},n={class:"control has-icons-right"},r=["type","value","required","id","disabled"],l=["for","innerHTML"],o={key:0,class:"show-hide"},s=e.createElementVNode("svg",{class:"icon password-eye"},[e.createElementVNode("use",{"xlink:href":"#eye"})],-1),i=e.createElementVNode("svg",{class:"icon password-eye"},[e.createElementVNode("use",{"xlink:href":"#eye"})],-1),d={class:"mt-1 mb-5 password-strenth-wrapper"},c=[e.createElementVNode("div",{class:"item"},null,-1)],u=["innerHTML"];t.render=function(t,m,p,h,f,v){return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",n,[e.createElementVNode("input",{class:e.normalizeClass(["input",{"is-danger":p.validation.errorMessage}]),type:f.type,value:p.modelValue,required:p.required,id:p.uuid,disabled:p.readOnly,onInput:m[0]||(m[0]=function(e){return v.update(e.target.value)}),placeholder:" "},null,42,r),e.createElementVNode("label",{class:"label",for:p.uuid,innerHTML:v.labelHtml},null,8,l),p.modelValue?(e.openBlock(),e.createElementBlock("div",o,["password"==f.type?(e.openBlock(),e.createElementBlock("a",{key:0,class:"password-hidden",onClick:m[1]||(m[1]=function(e){return f.type="text"})},[s,e.createElementVNode("span",null,e.toDisplayString(t.__("auth.registration.password_show")),1)])):e.createCommentVNode("v-if",!0),"text"==f.type?(e.openBlock(),e.createElementBlock("a",{key:1,class:"password-visible",onClick:m[2]||(m[2]=function(e){return f.type="password"})},[i,e.createElementVNode("span",null,e.toDisplayString(t.__("auth.registration.password_hide")),1)])):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",d,[e.createElementVNode("div",{class:e.normalizeClass(["columns is-variable is-1 password-strenth","strenth-"+v.strength])},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(4,(function(t){return e.createElementVNode("div",{class:"column",key:t},c)})),64))],2)]),p.validation.errorMessage?(e.openBlock(),e.createElementBlock("p",{key:0,class:"help is-danger",innerHTML:p.validation.errorMessage},null,8,u)):e.createCommentVNode("v-if",!0)])},module.exports=t;
1
+ "use strict";var e=require("vue"),t={props:{modelValue:{required:!0},required:{type:Boolean,default:!1},label:{type:String,required:!0},config:{type:Object,default:function(){return{type:"text"}}},readOnly:{type:Boolean,default:!1},uuid:{type:Number,default:0},validation:{type:Object,default:function(){return{}}},validations:{type:Object,default:function(){return{}}},placeholder:{type:String,default:""}},computed:{labelHtml:function(){var e=this.validations&&this.validations.required?' <span class="asterisk">*</span>':"";return this.label+e},strength:function(){return this.getStrength(this.modelValue)}},data:function(){return{type:"password"}},methods:{update:function(e){this.$emit("update:modelValue",e)},getStrength:function(e){var t=0;return e?(e.length>=6&&(t=1),e.length>6&&(e.match(/[a-zA-Zа-яА-Я]/)||e.match(/\d+/)||e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))&&(t=2),e.length>6&&(e.match(/[a-zA-Zа-яА-Я]/)&&e.match(/\d+/)||e.match(/\d+/)&&e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)||e.match(/[a-zA-Zа-яА-Я]/)&&e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))&&(t=3),e.length>6&&e.match(/[a-zA-Zа-яА-Я]/)&&e.match(/\d+/)&&e.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)&&(t=4),t):t}}},a={class:"field-password"},l={class:"control has-icons-right"},n=["type","value","required","id","disabled","placeholder"],r=["for","innerHTML"],o={key:0,class:"show-hide"},s=e.createElementVNode("svg",{class:"icon password-eye"},[e.createElementVNode("use",{"xlink:href":"#eye"})],-1),i=e.createElementVNode("svg",{class:"icon password-eye"},[e.createElementVNode("use",{"xlink:href":"#eye"})],-1),d={class:"mt-1 mb-5 password-strenth-wrapper"},c=[e.createElementVNode("div",{class:"item"},null,-1)],u=["innerHTML"];t.render=function(t,p,m,h,f,y){return e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",l,[e.createElementVNode("input",{class:e.normalizeClass(["input",{"is-danger":m.validation.errorMessage}]),type:f.type,value:m.modelValue,required:m.required,id:m.uuid,disabled:m.readOnly,onInput:p[0]||(p[0]=function(e){return y.update(e.target.value)}),placeholder:m.placeholder?m.placeholder:" "},null,42,n),e.createElementVNode("label",{class:"label",for:m.uuid,innerHTML:y.labelHtml},null,8,r),m.modelValue?(e.openBlock(),e.createElementBlock("div",o,["password"==f.type?(e.openBlock(),e.createElementBlock("a",{key:0,class:"password-hidden",onClick:p[1]||(p[1]=function(e){return f.type="text"})},[s,e.createElementVNode("span",null,e.toDisplayString(t.__("auth.registration.password_show")),1)])):e.createCommentVNode("v-if",!0),"text"==f.type?(e.openBlock(),e.createElementBlock("a",{key:1,class:"password-visible",onClick:p[2]||(p[2]=function(e){return f.type="password"})},[i,e.createElementVNode("span",null,e.toDisplayString(t.__("auth.registration.password_hide")),1)])):e.createCommentVNode("v-if",!0)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",d,[e.createElementVNode("div",{class:e.normalizeClass(["columns is-variable is-1 password-strenth","strenth-"+y.strength])},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(4,(function(t){return e.createElementVNode("div",{class:"column",key:t},c)})),64))],2)]),m.validation.errorMessage?(e.openBlock(),e.createElementBlock("p",{key:0,class:"help is-danger",innerHTML:m.validation.errorMessage},null,8,u)):e.createCommentVNode("v-if",!0)])},module.exports=t;
2
2
  //# sourceMappingURL=FormPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormPassword.js","sources":["../../src/forms/FormPassword.vue","../../src/forms/FormPassword.vue?vue&type=template&id=234aba20&lang.js"],"sourcesContent":["<template>\n <div class=\"field-password\">\n <div class=\"control has-icons-right\">\n <input\n class=\"input\"\n :type=\"type\"\n :value=\"modelValue\"\n :required=\"required\"\n :id=\"uuid\"\n :disabled=\"readOnly\"\n @input=\"update($event.target.value)\"\n v-bind:class=\"{\n 'is-danger': validation.errorMessage\n }\"\n placeholder=\" \"\n />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\"></label>\n <div class=\"show-hide\" v-if=\"modelValue\">\n <a class=\"password-hidden\" @click=\"type = 'text'\" v-if=\"type == 'password'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_show') }}</span>\n </a>\n <a class=\"password-visible\" @click=\"type = 'password'\" v-if=\"type == 'text'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_hide') }}</span>\n </a>\n </div>\n </div>\n <div class=\"mt-1 mb-5 password-strenth-wrapper\">\n <div class=\"columns is-variable is-1 password-strenth\" v-bind:class=\"'strenth-' + strength\">\n <div class=\"column\" v-for=\"index in 4\" :key=\"index\">\n <div class=\"item\"></div>\n </div>\n </div>\n </div>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n modelValue: { required: true },\n required: {\n type: Boolean,\n default: false\n },\n label: {\n type: String,\n required: true\n },\n config: {\n type: Object,\n default: () => ({ type: 'text' })\n },\n readOnly: {\n type: Boolean,\n default: false\n },\n uuid: {\n type: Number,\n default: 0\n },\n validation: {\n type: Object,\n default: () => ({})\n },\n // type: {\n // type: String,\n // default: \"text\",\n // },\n validations: {\n type: Object,\n default: () => ({})\n }\n },\n computed: {\n labelHtml() {\n const requiredHtml = this.validations && this.validations.required ? ' <span class=\"asterisk\">*</span>' : '';\n return this.label + requiredHtml;\n },\n strength() {\n return this.getStrength(this.modelValue);\n }\n },\n data() {\n return {\n type: 'password'\n };\n },\n methods: {\n update(value) {\n this.$emit('update:modelValue', value);\n },\n getStrength: function (password) {\n let strength = 0;\n\n if (!password) {\n return strength;\n }\n\n if (password.length >= 6) {\n strength = 1;\n }\n\n if (password.length > 6 && (password.match(/[a-zA-Zа-яА-Я]/) || password.match(/\\d+/) || password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))) {\n strength = 2;\n }\n\n if (password.length > 6 && ((password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/)) || (password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) || (password.match(/[a-zA-Zа-яА-Я]/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)))) {\n strength = 3;\n }\n\n if (password.length > 6 && password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) {\n strength = 4;\n }\n\n return strength;\n }\n }\n};\n</script>\n","<template>\n <div class=\"field-password\">\n <div class=\"control has-icons-right\">\n <input\n class=\"input\"\n :type=\"type\"\n :value=\"modelValue\"\n :required=\"required\"\n :id=\"uuid\"\n :disabled=\"readOnly\"\n @input=\"update($event.target.value)\"\n v-bind:class=\"{\n 'is-danger': validation.errorMessage\n }\"\n placeholder=\" \"\n />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\"></label>\n <div class=\"show-hide\" v-if=\"modelValue\">\n <a class=\"password-hidden\" @click=\"type = 'text'\" v-if=\"type == 'password'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_show') }}</span>\n </a>\n <a class=\"password-visible\" @click=\"type = 'password'\" v-if=\"type == 'text'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_hide') }}</span>\n </a>\n </div>\n </div>\n <div class=\"mt-1 mb-5 password-strenth-wrapper\">\n <div class=\"columns is-variable is-1 password-strenth\" v-bind:class=\"'strenth-' + strength\">\n <div class=\"column\" v-for=\"index in 4\" :key=\"index\">\n <div class=\"item\"></div>\n </div>\n </div>\n </div>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n modelValue: { required: true },\n required: {\n type: Boolean,\n default: false\n },\n label: {\n type: String,\n required: true\n },\n config: {\n type: Object,\n default: () => ({ type: 'text' })\n },\n readOnly: {\n type: Boolean,\n default: false\n },\n uuid: {\n type: Number,\n default: 0\n },\n validation: {\n type: Object,\n default: () => ({})\n },\n // type: {\n // type: String,\n // default: \"text\",\n // },\n validations: {\n type: Object,\n default: () => ({})\n }\n },\n computed: {\n labelHtml() {\n const requiredHtml = this.validations && this.validations.required ? ' <span class=\"asterisk\">*</span>' : '';\n return this.label + requiredHtml;\n },\n strength() {\n return this.getStrength(this.modelValue);\n }\n },\n data() {\n return {\n type: 'password'\n };\n },\n methods: {\n update(value) {\n this.$emit('update:modelValue', value);\n },\n getStrength: function (password) {\n let strength = 0;\n\n if (!password) {\n return strength;\n }\n\n if (password.length >= 6) {\n strength = 1;\n }\n\n if (password.length > 6 && (password.match(/[a-zA-Zа-яА-Я]/) || password.match(/\\d+/) || password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))) {\n strength = 2;\n }\n\n if (password.length > 6 && ((password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/)) || (password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) || (password.match(/[a-zA-Zа-яА-Я]/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)))) {\n strength = 3;\n }\n\n if (password.length > 6 && password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) {\n strength = 4;\n }\n\n return strength;\n }\n }\n};\n</script>\n"],"names":["props","modelValue","required","type","Boolean","label","String","config","Object","readOnly","uuid","Number","validation","validations","computed","labelHtml","requiredHtml","this","strength","getStrength","data","methods","update","value","$emit","password","length","match","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","$data","$props","id","disabled","onInput","$options","$event","target","placeholder","innerHTML","_hoisted_5","onClick","_hoisted_6","_ctx","_hoisted_7","_hoisted_8","index","key","errorMessage"],"mappings":"oCA4Ce,CACXA,MAAO,CACHC,WAAY,CAAEC,UAAU,GACxBA,SAAU,CACNC,KAAMC,iBACG,GAEbC,MAAO,CACHF,KAAMG,OACNJ,UAAU,GAEdK,OAAQ,CACJJ,KAAMK,eACG,iBAAO,CAAEL,KAAM,UAE5BM,SAAU,CACNN,KAAMC,iBACG,GAEbM,KAAM,CACFP,KAAMQ,eACG,GAEbC,WAAY,CACRT,KAAMK,eACG,iBAAO,KAMpBK,YAAa,CACTV,KAAMK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kCAAW,SAA6BqB,IAAKD,oBAKrBf,aAAWiB,4BAA3CrB,sCAAS,iBAAgDY,UAAQR,aAAWiB"}
1
+ {"version":3,"file":"FormPassword.js","sources":["../../src/forms/FormPassword.vue","../../src/forms/FormPassword.vue?vue&type=template&id=4876efd4&lang.js"],"sourcesContent":["<template>\n <div class=\"field-password\">\n <div class=\"control has-icons-right\">\n <input class=\"input\" :type=\"type\" :value=\"modelValue\" :required=\"required\" :id=\"uuid\" :disabled=\"readOnly\" @input=\"update($event.target.value)\" v-bind:class=\"{\n 'is-danger': validation.errorMessage\n }\" :placeholder=\"placeholder ? placeholder : ' '\" />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\"></label>\n <div class=\"show-hide\" v-if=\"modelValue\">\n <a class=\"password-hidden\" @click=\"type = 'text'\" v-if=\"type == 'password'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_show') }}</span>\n </a>\n <a class=\"password-visible\" @click=\"type = 'password'\" v-if=\"type == 'text'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_hide') }}</span>\n </a>\n </div>\n </div>\n <div class=\"mt-1 mb-5 password-strenth-wrapper\">\n <div class=\"columns is-variable is-1 password-strenth\" v-bind:class=\"'strenth-' + strength\">\n <div class=\"column\" v-for=\"index in 4\" :key=\"index\">\n <div class=\"item\"></div>\n </div>\n </div>\n </div>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n modelValue: { required: true },\n required: {\n type: Boolean,\n default: false\n },\n label: {\n type: String,\n required: true\n },\n config: {\n type: Object,\n default: () => ({ type: 'text' })\n },\n readOnly: {\n type: Boolean,\n default: false\n },\n uuid: {\n type: Number,\n default: 0\n },\n validation: {\n type: Object,\n default: () => ({})\n },\n // type: {\n // type: String,\n // default: \"text\",\n // },\n validations: {\n type: Object,\n default: () => ({})\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n },\n computed: {\n labelHtml() {\n const requiredHtml = this.validations && this.validations.required ? ' <span class=\"asterisk\">*</span>' : '';\n return this.label + requiredHtml;\n },\n strength() {\n return this.getStrength(this.modelValue);\n }\n },\n data() {\n return {\n type: 'password'\n };\n },\n methods: {\n update(value) {\n this.$emit('update:modelValue', value);\n },\n getStrength: function (password) {\n let strength = 0;\n\n if (!password) {\n return strength;\n }\n\n if (password.length >= 6) {\n strength = 1;\n }\n\n if (password.length > 6 && (password.match(/[a-zA-Zа-яА-Я]/) || password.match(/\\d+/) || password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))) {\n strength = 2;\n }\n\n if (password.length > 6 && ((password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/)) || (password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) || (password.match(/[a-zA-Zа-яА-Я]/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)))) {\n strength = 3;\n }\n\n if (password.length > 6 && password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) {\n strength = 4;\n }\n\n return strength;\n }\n }\n};\n</script>\n","<template>\n <div class=\"field-password\">\n <div class=\"control has-icons-right\">\n <input class=\"input\" :type=\"type\" :value=\"modelValue\" :required=\"required\" :id=\"uuid\" :disabled=\"readOnly\" @input=\"update($event.target.value)\" v-bind:class=\"{\n 'is-danger': validation.errorMessage\n }\" :placeholder=\"placeholder ? placeholder : ' '\" />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\"></label>\n <div class=\"show-hide\" v-if=\"modelValue\">\n <a class=\"password-hidden\" @click=\"type = 'text'\" v-if=\"type == 'password'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_show') }}</span>\n </a>\n <a class=\"password-visible\" @click=\"type = 'password'\" v-if=\"type == 'text'\">\n <svg class=\"icon password-eye\">\n <use xlink:href=\"#eye\" />\n </svg>\n <span>{{ __('auth.registration.password_hide') }}</span>\n </a>\n </div>\n </div>\n <div class=\"mt-1 mb-5 password-strenth-wrapper\">\n <div class=\"columns is-variable is-1 password-strenth\" v-bind:class=\"'strenth-' + strength\">\n <div class=\"column\" v-for=\"index in 4\" :key=\"index\">\n <div class=\"item\"></div>\n </div>\n </div>\n </div>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n modelValue: { required: true },\n required: {\n type: Boolean,\n default: false\n },\n label: {\n type: String,\n required: true\n },\n config: {\n type: Object,\n default: () => ({ type: 'text' })\n },\n readOnly: {\n type: Boolean,\n default: false\n },\n uuid: {\n type: Number,\n default: 0\n },\n validation: {\n type: Object,\n default: () => ({})\n },\n // type: {\n // type: String,\n // default: \"text\",\n // },\n validations: {\n type: Object,\n default: () => ({})\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n },\n computed: {\n labelHtml() {\n const requiredHtml = this.validations && this.validations.required ? ' <span class=\"asterisk\">*</span>' : '';\n return this.label + requiredHtml;\n },\n strength() {\n return this.getStrength(this.modelValue);\n }\n },\n data() {\n return {\n type: 'password'\n };\n },\n methods: {\n update(value) {\n this.$emit('update:modelValue', value);\n },\n getStrength: function (password) {\n let strength = 0;\n\n if (!password) {\n return strength;\n }\n\n if (password.length >= 6) {\n strength = 1;\n }\n\n if (password.length > 6 && (password.match(/[a-zA-Zа-яА-Я]/) || password.match(/\\d+/) || password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/))) {\n strength = 2;\n }\n\n if (password.length > 6 && ((password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/)) || (password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) || (password.match(/[a-zA-Zа-яА-Я]/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)))) {\n strength = 3;\n }\n\n if (password.length > 6 && password.match(/[a-zA-Zа-яА-Я]/) && password.match(/\\d+/) && password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) {\n strength = 4;\n }\n\n return strength;\n }\n }\n};\n</script>\n"],"names":["props","modelValue","required","type","Boolean","label","String","config","Object","readOnly","uuid","Number","validation","validations","placeholder","computed","labelHtml","requiredHtml","this","strength","getStrength","data","methods","update","value","$emit","password","length","match","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","$data","$props","id","disabled","onInput","$options","$event","target","innerHTML","_hoisted_5","onClick","_hoisted_6","_ctx","_hoisted_7","_hoisted_8","index","key","errorMessage"],"mappings":"oCAkCe,CACXA,MAAO,CACHC,WAAY,CAAEC,UAAU,GACxBA,SAAU,CACNC,KAAMC,iBACG,GAEbC,MAAO,CACHF,KAAMG,OACNJ,UAAU,GAEdK,OAAQ,CACJJ,KAAMK,eACG,iBAAO,CAAEL,KAAM,UAE5BM,SAAU,CACNN,KAAMC,iBACG,GAEbM,KAAM,CACFP,KAAMQ,eACG,GAEbC,WAAY,CACRT,KAAMK,eACG,iBAAO,KAMpBK,YAAa,CACTV,KAAMK,eACG,iBAAO,KAEpBM,YAAa,CACTX,KAAMG,eACG,KAGjBS,SAAU,CACNC,yBACUC,EAAeC,KAAKL,aAAeK,KAAKL,YAAYX,SAAW,mCAAqC,UACnGgB,KAAKb,MAAQY,GAExBE,2BACWD,KAAKE,YAAYF,KAAKjB,cAGrCoB,sBACW,CACHlB,KAAM,aAGdmB,QAAS,CACLC,gBAAOC,QACEC,MAAM,oBAAqBD,IAEpCJ,YAAa,SAAUM,OACfP,EAAW,SAEVO,GAIDA,EAASC,QAAU,IACnBR,EAAW,GAGXO,EAASC,OAAS,IAAMD,EAASE,MAAM,mBAAqBF,EAASE,MAAM,QAAUF,EAASE,MAAM,qCACpGT,EAAW,GAGXO,EAASC,OAAS,IAAOD,EAASE,MAAM,mBAAqBF,EAASE,MAAM,QAAYF,EAASE,MAAM,QAAUF,EAASE,MAAM,mCAAuCF,EAASE,MAAM,mBAAqBF,EAASE,MAAM,qCAC1NT,EAAW,GAGXO,EAASC,OAAS,GAAKD,EAASE,MAAM,mBAAqBF,EAASE,MAAM,QAAUF,EAASE,MAAM,oCACnGT,EAAW,GAGRA,GAnBIA,cC/FR,2BACI,4HAKI,eAEHU,kCAAW,sBACPA,yCAAgB,gBAKpBA,kCAAW,sBACPA,yCAAgB,uBAMrB,yCAGCA,kCAAW,sFAxB3BC,2BAAAC,GACIF,2BAAAG,GACIH,sDAAa,kDAAS1B,KAAM8B,OAAOT,MAAOU,aAAahC,SAAUgC,WAAWC,GAAID,OAAOE,SAAUF,WAAWG,uCAAOC,SAAOC,EAAOC,OAAOhB,SAEpIV,YAAaoB,cAAcA,8BAC/BL,oCAAa,YAAcK,OAAMO,UAAQH,uBACZJ,4BAA7BJ,2BAAAY,eAC4DT,sBAAxDH,sCAAS,kBAAmBa,uCAAOV,kBAC/BW,EAGAf,mDAASgB,uFAEgDZ,sBAA7DH,sCAAS,mBAAoBa,uCAAOV,sBAChCa,EAGAjB,mDAASgB,oHAIrBhB,2BAAAkB,GACIlB,oDAAW,uDAAuES,8BAC9ER,kDAAoC,YAATkB,UAA3BnB,kCAAW,SAA6BoB,IAAKD,oBAKrBd,aAAWgB,4BAA3CpB,sCAAS,iBAAgDW,UAAQP,aAAWgB"}
package/dist/store.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("vue"),a=require("@perevorot/shop/dist/api"),n={namespaced:!0,state:{items:[],cross:[],bundles:[],modal:!1},getters:{items:function(t){return t.items},cross:function(t){return t.cross},bundles:function(t){return t.bundles},productQuantity:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n?n.quantity:0}},quantity:function(t,a){var n=0;return a.items.forEach((function(t){n+=parseInt(t.quantity)})),n},total:function(t,a){var n=0;return a.items.forEach((function(t){var a=t.attributes.price?t.attributes.price:t.price;if(t.attributes.options&&t.attributes.options.length&&t.options&&t.options.length){var e=0;t.options.forEach((function(a){-1!==t.attributes.options.indexOf(a.id)&&(e+=parseInt(a.price))})),a+=e}n+=a*(!1===t.attributes.active?0:t.quantity)})),n},modal:function(t){return!1!==t.modal&&document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(t,n){var e=t.commit;a.cart.items().then((function(t){e("items",t.data.items),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},add:function(t,n){var e=t.commit,c=t.state;a.cart.add(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length?e("items",t.data.items):e("quantity",n.product),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},options:function(t,n){var e=t.commit,c=t.state;a.cart.options(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length&&e("items",t.data.items),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},quantity:function(t,n){var e=t.commit;a.cart.quantity(n.product).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(t,n){var e=t.commit;a.cart.remove(n.id).then((function(t){e("remove",n.id),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},clear:function(t,n){var e=t.commit;a.cart.clear(n.id).then((function(){e("clear"),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{modal:function(t,a){t.modal=a},items:function(t,a){t.items=a},cross:function(t,a){t.cross=a},bundles:function(t,a){t.bundles=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))},quantity:function(t,a){var n=t.items.find((function(t){return t.id===a.id}));n.quantity=a.exact?a.exact:n.quantity+a.quantity},clear:function(t){t.items=[],t.cross=[],t.bundles=[]}}};function e(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var c=require("vue-toastification").useToast(),o={user:{},modal:!1,account:[]},i={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return t.modal},is:function(t){return Object.keys(t.user).length>0}};t.watch((function(){return o.modal}),(function(t){!1!==t&&document.documentElement.classList[t?"add":"remove"]("is-modal-open")}),{immediate:!0});var l={me:function(t,a){t.user=Array.isArray(a.user)&&!a.user.length?{}:a.user,t.account=a.account},modal:function(t,a){t.modal=a}},s={namespaced:!0,state:{items:[],list:[],last:""},getters:{items:function(t){return t.items},item:function(t,a){return function(t){return-1!==a.items.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last}},actions:{get:function(t,n){var e=t.commit;a.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.wishlist.toggle(n.id).then((function(t){t.data&&t.data.items&&e("items",t.data.items),t.data&&t.data.last&&e("last",t.data.last),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{items:function(t,a){t.items=a},list:function(t,a){t.list=a},last:function(t,a){t.last=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))}}},u={namespaced:!0,state:{products:[],categories:[],list:[],last:"",modal:null},getters:{products:function(t){return t.products},categories:function(t){return t.categories},product:function(t,a){return function(t){return-1!==a.products.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last},modal:function(t){return t.modal}},actions:{get:function(t,n){var e=t.commit;a.compare.items().then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},category:function(t,n){var e=t.commit;a.compare.category(n.slug).then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.compare.toggle(n.id).then((function(t){t.data&&(e("products",t.data.products),e("categories",t.data.categories),e("last",t.data.last)),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},delete:function(t,n){t.commit,t.state,a.compare.delete(n.id).then((function(t){"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},modal:function(t,n){var e=t.commit;t.state,a.compare.modal(n.id).then((function(t){e("modal",t.data),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)}},mutations:{products:function(t,a){t.products=a},categories:function(t,a){t.categories=a},list:function(t,a){t.list=a},remove:function(t,a){t.products=t.products.filter((function(t){return t.id!==a}))},last:function(t,a){t.last=a},modal:function(t,a){t.modal=a}}},r={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){!1!==t.modal&&document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},f={namespaced:!0,state:{steps:{},current:1,modal:!1},getters:{steps:function(t){return t.steps},current:function(t){return t.current},modal:function(t){return t.modal}},mutations:{step:function(t,a){Number.isInteger(a)?t.current=a:a.data&&(t.steps[a.step]=a.data)},stepInit:function(t,a){t.steps[a.step]||(t.steps[a.step]=a.data)},reset:function(t){t.steps={},t.current=1},modal:function(t,a){t.modal=a}}},d={modules:{cart:n,auth:{namespaced:!0,state:o,getters:i,actions:{me:function(t,n){var e=t.commit;a.auth.me().then((function(t){e("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),c(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&e("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(t,n){var e=t.commit,c=t.dispatch;a.auth.login(n.credentials).then((function(t){t.data.csrf_token&&($http.defaults.headers.common["X-CSRF-TOKEN"]=t.data.csrf_token,delete t.data.csrf_token),e("me",t.data),e("modal",null),c("cart/get",{finally:function(){}},{root:!0}),c("wishlist/get",{finally:function(){}},{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},logout:function(t,n){var e=t.commit;a.auth.logout().then((function(){e("me",{user:{},account:[]}),e("wishlist/items",[],{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback(),-1!==window.location.href.indexOf("/account")&&(window.location.href=$env.locale.url+"/")}))},reset:function(t,n){e(t),a.auth.reset(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a,!1,t.data)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},resetSms:function(t,n){e(t),a.auth.resetSms(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback(t.data,!1)})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.error&&n.callback(t.response.data,!0)})).finally(n.finally)},passwordUpdate:function(t,n){e(t),a.auth.passwordUpdate(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},register:function(t,n){t.commit,a.auth["register"+n.type](n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},update:function(t,n){t.commit,a.auth.update(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)}},mutations:l},wishlist:s,compare:u,review:r,order:f,checkout:{namespaced:!0,state:{user:{},payment:null,shipping:null,shippingData:{},dontcall:!1,comment:""},getters:{user:function(t,a,n,e){return Object.keys(t.user).length?t.user:JSON.parse(JSON.stringify(e["auth/me"]))},shipping:function(t){return t.shipping},shippingData:function(t){return t.shippingData},payment:function(t){return t.payment},dontcall:function(t){return t.dontcall},comment:function(t){return t.comment}},mutations:{user:function(t,a){t.user=a},shipping:function(t,a){t.shipping=a},shippingData:function(t,a){t.shippingData=a},payment:function(t,a){t.payment=a},dontcall:function(t,a){t.dontcall=a},comment:function(t,a){t.comment=a},reset:function(t){t.user={},t.payment=null,t.shipping=null,t.shippingData={},t.dontcall=!1,t.comment=""}}}},strict:!1};module.exports=d;
1
+ "use strict";var t=require("vue"),a=require("@perevorot/shop/dist/api"),n=require("vue-toastification"),e=n.useToast(),c={namespaced:!0,state:{items:[],cross:[],bundles:[],modal:!1},getters:{items:function(t){return t.items},cross:function(t){return t.cross},bundles:function(t){return t.bundles},productQuantity:function(t,a){return function(t){var n=a.items.find((function(a){return a.id===t}));return n?n.quantity:0}},quantity:function(t,a){var n=0;return a.items.forEach((function(t){n+=parseInt(t.quantity)})),n},total:function(t,a){var n=0;return a.items.forEach((function(t){var a=t.attributes.price?t.attributes.price:t.price;if(t.attributes.options&&t.attributes.options.length&&t.options&&t.options.length){var e=0;t.options.forEach((function(a){-1!==t.attributes.options.indexOf(a.id)&&(e+=parseInt(a.price))})),a+=e}n+=a*(!1===t.attributes.active?0:t.quantity)})),n},modal:function(t){return!1!==t.modal&&document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(t,n){var e=t.commit;a.cart.items().then((function(t){e("items",t.data.items),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},add:function(t,n){var c=t.commit,o=t.state;a.cart.add(n.product).then((function(t){t.data&&t.data.error&&t.data.message?e(t.data.message,{type:"error"}):(t.data&&t.data.items&&t.data.items.length?c("items",t.data.items):c("quantity",n.product),t.data&&t.data.cross&&c("cross",t.data.cross),t.data&&t.data.bundles&&c("bundles",t.data.bundles),o.modal||c("modal",!0),"function"==typeof n.callback&&n.callback())})).finally(n.finally)},options:function(t,n){var e=t.commit,c=t.state;a.cart.options(n.product).then((function(t){t.data&&t.data.items&&t.data.items.length&&e("items",t.data.items),c.modal||e("modal",!0),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},quantity:function(t,n){var e=t.commit;a.cart.quantity(n.product).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(t,n){var e=t.commit;a.cart.remove(n.id).then((function(t){e("remove",n.id),t.data&&t.data.cross&&e("cross",t.data.cross),t.data&&t.data.bundles&&e("bundles",t.data.bundles),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},clear:function(t,n){var e=t.commit;a.cart.clear(n.id).then((function(){e("clear"),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{modal:function(t,a){t.modal=a},items:function(t,a){t.items=a},cross:function(t,a){t.cross=a},bundles:function(t,a){t.bundles=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))},quantity:function(t,a){var n=t.items.find((function(t){return t.id===a.id}));n.quantity=a.exact?a.exact:n.quantity+a.quantity},clear:function(t){t.items=[],t.cross=[],t.bundles=[]}}};function o(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var i=n.useToast(),l={user:{},modal:!1,account:[]},s={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return t.modal},is:function(t){return Object.keys(t.user).length>0}};t.watch((function(){return l.modal}),(function(t){!1!==t&&document.documentElement.classList[t?"add":"remove"]("is-modal-open")}),{immediate:!0});var r={me:function(t,a){t.user=Array.isArray(a.user)&&!a.user.length?{}:a.user,t.account=a.account},modal:function(t,a){t.modal=a}},u={namespaced:!0,state:{items:[],list:[],last:""},getters:{items:function(t){return t.items},item:function(t,a){return function(t){return-1!==a.items.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last}},actions:{get:function(t,n){var e=t.commit;a.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.wishlist.toggle(n.id).then((function(t){t.data&&t.data.items&&e("items",t.data.items),t.data&&t.data.last&&e("last",t.data.last),"function"==typeof n.callback&&n.callback()})).finally(n.finally)}},mutations:{items:function(t,a){t.items=a},list:function(t,a){t.list=a},last:function(t,a){t.last=a},remove:function(t,a){t.items=t.items.filter((function(t){return t.id!==a}))}}},f={namespaced:!0,state:{products:[],categories:[],list:[],last:"",modal:null},getters:{products:function(t){return t.products},categories:function(t){return t.categories},product:function(t,a){return function(t){return-1!==a.products.indexOf(t)}},list:function(t){return t.list},last:function(t){return t.last},modal:function(t){return t.modal}},actions:{get:function(t,n){var e=t.commit;a.compare.items().then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},category:function(t,n){var e=t.commit;a.compare.category(n.slug).then((function(t){e("products",t.data.products),e("categories",t.data.categories),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(t,n){var e=t.commit;a.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(t,n){var e=t.commit;t.state,a.compare.toggle(n.id).then((function(t){t.data&&(e("products",t.data.products),e("categories",t.data.categories),e("last",t.data.last)),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},delete:function(t,n){t.commit,t.state,a.compare.delete(n.id).then((function(t){"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)},modal:function(t,n){var e=t.commit;t.state,a.compare.modal(n.id).then((function(t){e("modal",t.data),"function"==typeof n.callback&&n.callback(t.data)})).finally(n.finally)}},mutations:{products:function(t,a){t.products=a},categories:function(t,a){t.categories=a},list:function(t,a){t.list=a},remove:function(t,a){t.products=t.products.filter((function(t){return t.id!==a}))},last:function(t,a){t.last=a},modal:function(t,a){t.modal=a}}},d={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){!1!==t.modal&&document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},m={namespaced:!0,state:{steps:{},current:1,modal:!1},getters:{steps:function(t){return t.steps},current:function(t){return t.current},modal:function(t){return t.modal}},mutations:{step:function(t,a){Number.isInteger(a)?t.current=a:a.data&&(t.steps[a.step]=a.data)},stepInit:function(t,a){t.steps[a.step]||(t.steps[a.step]=a.data)},reset:function(t){t.steps={},t.current=1},modal:function(t,a){t.modal=a}}},p={modules:{cart:c,auth:{namespaced:!0,state:l,getters:s,actions:{me:function(t,n){var e=t.commit;a.auth.me().then((function(t){e("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),i(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&e("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(t,n){var e=t.commit,c=t.dispatch;a.auth.login(n.credentials).then((function(t){t.data.csrf_token&&($http.defaults.headers.common["X-CSRF-TOKEN"]=t.data.csrf_token,delete t.data.csrf_token),e("me",t.data),e("modal",null),c("cart/get",{finally:function(){}},{root:!0}),c("wishlist/get",{finally:function(){}},{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},logout:function(t,n){var e=t.commit;a.auth.logout().then((function(){e("me",{user:{},account:[]}),e("wishlist/items",[],{root:!0}),window.localStorage&&window.localStorage.clear(),n&&"function"==typeof n.callback&&n.callback(),-1!==window.location.href.indexOf("/account")&&(window.location.href=$env.locale.url+"/")}))},reset:function(t,n){o(t),a.auth.reset(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a,!1,t.data)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},resetSms:function(t,n){o(t),a.auth.resetSms(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback(t.data,!1)})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.error&&n.callback(t.response.data,!0)})).finally(n.finally)},passwordUpdate:function(t,n){o(t),a.auth.passwordUpdate(n.credentials).then((function(t){if(n&&"function"==typeof n.callback){var a=t.data&&t.data.message?t.data.message:"";n.callback(a)}})).catch((function(t){n&&"function"==typeof n.callback&&t.response.data.errors&&t.response.data.errors.email&&n.callback(t.response.data.errors.email[0],!0)})).finally(n.finally)},register:function(t,n){t.commit,a.auth["register"+n.type](n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)},update:function(t,n){t.commit,a.auth.update(n.credentials).then((function(t){n&&"function"==typeof n.callback&&n.callback()})).catch((function(t){n&&"function"==typeof n.catch&&n.catch(t)})).finally(n.finally)}},mutations:r},wishlist:u,compare:f,review:d,order:m,checkout:{namespaced:!0,state:{user:{},payment:null,shipping:null,shippingData:{},dontcall:!1,comment:""},getters:{user:function(t,a,n,e){return Object.keys(t.user).length?t.user:JSON.parse(JSON.stringify(e["auth/me"]))},shipping:function(t){return t.shipping},shippingData:function(t){return t.shippingData},payment:function(t){return t.payment},dontcall:function(t){return t.dontcall},comment:function(t){return t.comment}},mutations:{user:function(t,a){t.user=a},shipping:function(t,a){t.shipping=a},shippingData:function(t,a){t.shippingData=a},payment:function(t,a){t.payment=a},dontcall:function(t,a){t.dontcall=a},comment:function(t,a){t.comment=a},reset:function(t){t.user={},t.payment=null,t.shipping=null,t.shippingData={},t.dontcall=!1,t.comment=""}}}},strict:!1};module.exports=p;
2
2
  //# sourceMappingURL=store.js.map