@perevorot/shop 2.0.79 → 2.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/User.js +1 -1
- package/dist/components/account/User.js.map +1 -1
- package/dist/components/auth/Confirm.js +2 -0
- package/dist/components/auth/Confirm.js.map +1 -0
- package/dist/components/auth/User.js.map +1 -1
- package/dist/components/shop/order/Checkout.js +1 -1
- package/dist/components/shop/order/Checkout.js.map +1 -1
- package/dist/components/shop/order/shipping/CheckoutShippingPickup.js +1 -1
- package/dist/components/shop/order/shipping/CheckoutShippingPickup.js.map +1 -1
- package/dist/forms/FormRadio.js +1 -1
- package/dist/forms/FormRadio.js.map +1 -1
- package/dist/forms/FormText.js +1 -1
- package/dist/forms/FormText.js.map +1 -1
- package/dist/global.js.map +1 -1
- package/dist/helpers.js +1 -1
- package/dist/helpers.js.map +1 -1
- package/dist/store.js +1 -1
- package/dist/store.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t
|
|
1
|
+
"use strict";var e=require("@perevorot/shop/dist/helpers"),t=require("vue"),n=t.defineComponent({props:{data:Object,item:Object,commit:Function},setup:function(n){var o=t.computed((function(){return n.item.data.find((function(e){return e.id==l.value}))})),c=function(e){return!n.item.data.length||!!e};t.onMounted((function(){o.value||n.commit(n.item.code,{},c())}));var l=t.computed({get:function(){return n.data[n.item.code]?n.data[n.item.code].id:null},set:function(e){n.commit(n.item.code,{id:e},c(e))}}),r=t.ref(!1),a=function(){r.value=!1};return window.addEventListener("keyup",(function(e){r.value&&"Escape"===e.key&&a()})),window.addEventListener("click",(function(e){e.target.closest(".pickup-wrapper")||a()})),{selected:o,isOpened:r,open:function(){r.value=!0},choose:function(e,t){e.stopPropagation(),setTimeout((function(){l.value=t.id}),200),a()},close:a,pickup:l,nl2p:e.nl2p}}}),o={key:0,class:"component pickup-wrapper"},c={key:0,class:"label"},l=["textContent"],r=t.createElementVNode("svg",null,[t.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),a={class:"dropdown-menu"},i={class:"dropdown-content"},s=["onClick"],d={key:1,class:"data"},m={class:"columns is-gapless"},p={class:"column"},u={class:"data-wrapper"},k={key:0,class:"hours"},v=t.createElementVNode("svg",null,[t.createElementVNode("use",{"xlink:href":"#hours"})],-1),f=["innerHTML"],E={key:1,class:"map"},N=["href"],V=["innerHTML"],g={key:0,class:"column is-4"},h={class:"image"},B=["src"];n.render=function(e,n,y,C,w,_){return e.item.data.length?(t.openBlock(),t.createElementBlock("div",o,[e.__("shop.order.pickup_label")?(t.openBlock(),t.createElementBlock("div",c,t.toDisplayString(e.__("shop.order.pickup_label")),1)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",{class:t.normalizeClass(["dropdown",{"is-active":e.isOpened}]),onMouseleave:n[1]||(n[1]=function(){return e.close&&e.close.apply(e,arguments)})},[t.createElementVNode("div",{class:"input dropdown-trigger",onClick:n[0]||(n[0]=function(){return e.open&&e.open.apply(e,arguments)})},[t.createElementVNode("span",{class:t.normalizeClass({"is-placeholder":!e.selected}),textContent:t.toDisplayString(e.selected?e.selected.name:e.__("shop.order.pickup"))},null,10,l),r]),t.createElementVNode("div",a,[t.createElementVNode("div",i,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.item.data,(function(n){return t.openBlock(),t.createElementBlock("a",{class:t.normalizeClass(["dropdown-item",{"is-active":e.selected&&n.id==e.selected.id}]),key:n.id,onClick:function(t){return e.choose(t,n)}},t.toDisplayString(n.name),11,s)})),128))])])],34),e.selected&&(e.selected.hours||e.selected.map_url||e.selected.description||e.selected.image)?(t.openBlock(),t.createElementBlock("div",d,[t.createElementVNode("div",m,[t.createElementVNode("div",p,[t.createElementVNode("div",u,[e.selected.hours?(t.openBlock(),t.createElementBlock("div",k,[v,t.createElementVNode("span",{innerHTML:e.selected.hours},null,8,f)])):t.createCommentVNode("v-if",!0),e.selected.map_url?(t.openBlock(),t.createElementBlock("div",E,[t.createElementVNode("a",{href:e.selected.map_url,target:"_blank",rel:"noopener"},t.toDisplayString(e.__("shop.order.map")),9,N)])):t.createCommentVNode("v-if",!0),e.selected.description?(t.openBlock(),t.createElementBlock("div",{key:2,class:"info",innerHTML:e.nl2p(e.selected.description)},null,8,V)):t.createCommentVNode("v-if",!0)])]),e.selected.image?(t.openBlock(),t.createElementBlock("div",g,[t.createElementVNode("div",h,[t.createElementVNode("img",{src:e.selected.image},null,8,B)])])):t.createCommentVNode("v-if",!0)])])):t.createCommentVNode("v-if",!0)])):t.createCommentVNode("v-if",!0)},module.exports=n;
|
|
2
2
|
//# sourceMappingURL=CheckoutShippingPickup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutShippingPickup.js","sources":["../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue","../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue?vue&type=template&id=5efb7682&lang.js"],"sourcesContent":["<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : __('shop.order.pickup')\"></span>\n <svg><use xlink:href=\"#arrow-down\"></use></svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg><use xlink:href=\"#hours\"></use></svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">{{ __('shop.order.map') }}</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\">{{ selected.description }}</div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup\n };\n }\n});\n</script>\n","<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : __('shop.order.pickup')\"></span>\n <svg><use xlink:href=\"#arrow-down\"></use></svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg><use xlink:href=\"#hours\"></use></svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">{{ __('shop.order.map') }}</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\">{{ selected.description }}</div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","data","Object","item","commit","Function","setup","selected","computed","find","id","pickup","value","isValid","length","onMounted","code","get","set","isOpened","ref","close","window","addEventListener","e","key","target","closest","open","choose","option","stopPropagation","setTimeout","_createElementVNode","_ctx","_createElementBlock","_hoisted_1","onMouseleave","onClick","_toDisplayString","name","_hoisted_3","_hoisted_4","_hoisted_5","$event","hours","map_url","description","image","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","innerHTML","_hoisted_14","href","rel","_hoisted_16","_hoisted_17","_hoisted_18","src"],"mappings":"oCAuCeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,OACNC,KAAMD,OACNE,OAAQC,UAEZC,eAAMN,OACIO,EAAWC,YAAS,kBACfR,EAAMG,KAAKF,KAAKQ,MAAK,SAACN,UAASA,EAAKO,IAAMC,EAAOC,YAGtDC,EAAU,SAACH,UACRV,EAAMG,KAAKF,KAAKa,UAGRJ,GAIjBK,aAAU,WACDR,EAASK,OACVZ,EAAMI,OAAOJ,EAAMG,KAAKa,KAAM,GAAIH,YAIpCF,EAASH,WAAS,CACpBS,sBACWjB,EAAMC,KAAKD,EAAMG,KAAKa,MAAQhB,EAAMC,KAAKD,EAAMG,KAAKa,MAAMN,GAAK,MAE1EQ,aAAIR,GACAV,EAAMI,OACFJ,EAAMG,KAAKa,KACX,CACIN,GAAIA,GAERG,EAAQH,OAKdS,EAAWC,OAAI,GAMfC,EAAQ,WACVF,EAASP,OAAQ,UAarBU,OAAOC,iBAAiB,SAAS,SAACC,GAC1BL,EAASP,OAAmB,WAAVY,EAAEC,KACpBJ,OAIRC,OAAOC,iBAAiB,SAAS,SAACC,GACzBA,EAAEE,OAAOC,QAAQ,oBAClBN,OAID,CACHd,SAAAA,EACAY,SAAAA,EACAS,KAjCS,WACTT,EAASP,OAAQ,GAiCjBiB,OA1BW,SAACL,EAAGM,GACfN,EAAEO,kBAEFC,YAAW,WACPrB,EAAOC,MAAQkB,EAAOpB,KACvB,KAEHW,KAoBAA,MAAAA,EACAV,OAAAA,qBCpHG,gDAICsB,iCAAKA,qBAAoC,oBAApB,8BAEd,0BACI,iDAKR,iBACI,+BACI,mBACI,+BAC0B,WAC7BA,iCAAKA,qBAA+B,oBAAf,+CAGU,iCAGI,uBAGpC,wBACI,yDA3BiBC,OAAKjC,KAAKa,sBAAtDqB,2BAAAC,GACIH,oDAAW,wBAAwCC,cAAaG,2CAAYH,wCACxED,kCAAW,yBAA0BK,sCAAOJ,sCACxCD,uEAAyCC,yBAAYK,kBAAQL,WAAWA,WAASM,KAAON,uCACxFO,IAEJR,2BAAAS,GACIT,2BAAAU,oBACIR,kDAA0CD,OAAKjC,eAAf6B,wBAAhCK,kDAAS,6BAAgID,YAAYJ,EAAOpB,IAAMwB,WAASxB,MAA/Ge,IAAKK,EAAOpB,GAAK4B,2BAAOJ,SAAOU,EAAQd,uBAAiFA,EAAOU,8BAI/KN,aAAaA,WAASW,OAASX,WAASY,SAAWZ,WAASa,aAAeb,WAASc,sBAA5Gb,2BAAAc,GACIhB,2BAAAiB,GACIjB,2BAAAkB,GACIlB,2BAAAmB,GACelB,WAASW,qBAApBV,2BAAAkB,GACIC,EACArB,6BAAMsB,UAAQrB,WAASW,oDAEhBX,WAASY,uBAApBX,2BAAAqB,GACIvB,0BAAIwB,KAAMvB,WAASY,QAASpB,OAAO,SAASgC,IAAI,8BAAcxB,gEAEvDA,WAASa,2BAApBZ,2BAAAwB,oBAAiDzB,WAASa,qDAGnCb,WAASc,qBAAxCb,2BAAAyB,GACI3B,2BAAA4B,GACI5B,4BAAM6B,IAAK5B,WAASc"}
|
|
1
|
+
{"version":3,"file":"CheckoutShippingPickup.js","sources":["../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue","../../../../../src/components/shop/order/shipping/CheckoutShippingPickup.vue?vue&type=template&id=f18382ec&lang.js"],"sourcesContent":["<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"label\" v-if=\"__('shop.order.pickup_label')\">{{ __('shop.order.pickup_label') }}</div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : __('shop.order.pickup')\"></span>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg>\n <use xlink:href=\"#hours\"></use>\n </svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">{{ __('shop.order.map') }}</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\" v-html=\"nl2p(selected.description)\"></div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { nl2p } from '@perevorot/shop/dist/helpers';\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup,\n nl2p\n };\n }\n});\n</script>\n","<template>\n <div class=\"component pickup-wrapper\" v-if=\"item.data.length\">\n <div class=\"label\" v-if=\"__('shop.order.pickup_label')\">{{ __('shop.order.pickup_label') }}</div>\n <div class=\"dropdown\" v-bind:class=\"{ 'is-active': isOpened }\" @mouseleave=\"close\">\n <div class=\"input dropdown-trigger\" @click=\"open\">\n <span v-bind:class=\"{ 'is-placeholder': !selected }\" v-text=\"selected ? selected.name : __('shop.order.pickup')\"></span>\n <svg>\n <use xlink:href=\"#arrow-down\"></use>\n </svg>\n </div>\n <div class=\"dropdown-menu\">\n <div class=\"dropdown-content\">\n <a class=\"dropdown-item\" v-for=\"option in item.data\" v-bind:key=\"option.id\" @click=\"choose($event, option)\" v-bind:class=\"{ 'is-active': selected && option.id == selected.id }\">{{ option.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"data\" v-if=\"selected && (selected.hours || selected.map_url || selected.description || selected.image)\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"data-wrapper\">\n <div v-if=\"selected.hours\" class=\"hours\">\n <svg>\n <use xlink:href=\"#hours\"></use>\n </svg>\n <span v-html=\"selected.hours\"></span>\n </div>\n <div v-if=\"selected.map_url\" class=\"map\">\n <a :href=\"selected.map_url\" target=\"_blank\" rel=\"noopener\">{{ __('shop.order.map') }}</a>\n </div>\n <div v-if=\"selected.description\" class=\"info\" v-html=\"nl2p(selected.description)\"></div>\n </div>\n </div>\n <div class=\"column is-4\" v-if=\"selected.image\">\n <div class=\"image\">\n <img :src=\"selected.image\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { nl2p } from '@perevorot/shop/dist/helpers';\nimport { ref, computed, defineComponent, onMounted } from 'vue';\n\nexport default defineComponent({\n props: {\n data: Object,\n item: Object,\n commit: Function\n },\n setup(props) {\n const selected = computed(() => {\n return props.item.data.find((item) => item.id == pickup.value);\n });\n\n const isValid = (id) => {\n if (!props.item.data.length) {\n return true;\n } else {\n return !!id;\n }\n };\n\n onMounted(() => {\n if (!selected.value) {\n props.commit(props.item.code, {}, isValid());\n }\n });\n\n const pickup = computed({\n get() {\n return props.data[props.item.code] ? props.data[props.item.code].id : null;\n },\n set(id) {\n props.commit(\n props.item.code,\n {\n id: id\n },\n isValid(id)\n );\n }\n });\n\n const isOpened = ref(false);\n\n const open = () => {\n isOpened.value = true;\n };\n\n const close = () => {\n isOpened.value = false;\n };\n\n const choose = (e, option) => {\n e.stopPropagation();\n\n setTimeout(() => {\n pickup.value = option.id;\n }, 200);\n\n close();\n };\n\n window.addEventListener('keyup', (e) => {\n if (isOpened.value && e.key === 'Escape') {\n close();\n }\n });\n\n window.addEventListener('click', (e) => {\n if (!e.target.closest('.pickup-wrapper')) {\n close();\n }\n });\n\n return {\n selected,\n isOpened,\n open,\n choose,\n close,\n pickup,\n nl2p\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","data","Object","item","commit","Function","setup","selected","computed","find","id","pickup","value","isValid","length","onMounted","code","get","set","isOpened","ref","close","window","addEventListener","e","key","target","closest","open","choose","option","stopPropagation","setTimeout","nl2p","_createElementVNode","_ctx","_createElementBlock","_hoisted_1","_hoisted_2","onMouseleave","onClick","_toDisplayString","name","_hoisted_4","_hoisted_5","_hoisted_6","$event","hours","map_url","description","image","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","innerHTML","_hoisted_15","href","rel","_hoisted_18","_hoisted_19","src"],"mappings":"8EA6CeA,kBAAgB,CAC3BC,MAAO,CACHC,KAAMC,OACNC,KAAMD,OACNE,OAAQC,UAEZC,eAAMN,OACIO,EAAWC,YAAS,kBACfR,EAAMG,KAAKF,KAAKQ,MAAK,SAACN,UAASA,EAAKO,IAAMC,EAAOC,YAGtDC,EAAU,SAACH,UACRV,EAAMG,KAAKF,KAAKa,UAGRJ,GAIjBK,aAAU,WACDR,EAASK,OACVZ,EAAMI,OAAOJ,EAAMG,KAAKa,KAAM,GAAIH,YAIpCF,EAASH,WAAS,CACpBS,sBACWjB,EAAMC,KAAKD,EAAMG,KAAKa,MAAQhB,EAAMC,KAAKD,EAAMG,KAAKa,MAAMN,GAAK,MAE1EQ,aAAIR,GACAV,EAAMI,OACFJ,EAAMG,KAAKa,KACX,CACIN,GAAIA,GAERG,EAAQH,OAKdS,EAAWC,OAAI,GAMfC,EAAQ,WACVF,EAASP,OAAQ,UAarBU,OAAOC,iBAAiB,SAAS,SAACC,GAC1BL,EAASP,OAAmB,WAAVY,EAAEC,KACpBJ,OAIRC,OAAOC,iBAAiB,SAAS,SAACC,GACzBA,EAAEE,OAAOC,QAAQ,oBAClBN,OAID,CACHd,SAAAA,EACAY,SAAAA,EACAS,KAjCS,WACTT,EAASP,OAAQ,GAiCjBiB,OA1BW,SAACL,EAAGM,GACfN,EAAEO,kBAEFC,YAAW,WACPrB,EAAOC,MAAQkB,EAAOpB,KACvB,KAEHW,KAoBAA,MAAAA,EACAV,OAAAA,EACAsB,KAAAA,0BC3HG,2CACI,6BAIHC,iCACIA,yCAAgB,8BAGb,0BACI,iDAKR,iBACI,+BACI,mBACI,+BAC0B,WAC7BA,iCACIA,yCAAgB,+CAIW,iDAMhC,wBACI,yDAhCiBC,OAAKlC,KAAKa,sBAAtDsB,2BAAAC,GAC6BF,+CAAzBC,2BAAAE,oBAA2DH,qEAC3DD,oDAAW,wBAAwCC,cAAaI,2CAAYJ,wCACxED,kCAAW,yBAA0BM,sCAAOL,sCACxCD,uEAAyCC,yBAAYM,kBAAQN,WAAWA,WAASO,KAAOP,uCACxFQ,IAIJT,2BAAAU,GACIV,2BAAAW,oBACIT,kDAA0CD,OAAKlC,eAAf6B,wBAAhCM,kDAAS,6BAAgID,YAAYL,EAAOpB,IAAMyB,WAASzB,MAA/Ge,IAAKK,EAAOpB,GAAK8B,2BAAOL,SAAOW,EAAQhB,uBAAiFA,EAAOY,8BAI/KP,aAAaA,WAASY,OAASZ,WAASa,SAAWb,WAASc,aAAed,WAASe,sBAA5Gd,2BAAAe,GACIjB,2BAAAkB,GACIlB,2BAAAmB,GACInB,2BAAAoB,GACenB,WAASY,qBAApBX,2BAAAmB,GACIC,EAGAtB,6BAAMuB,UAAQtB,WAASY,oDAEhBZ,WAASa,uBAApBZ,2BAAAsB,GACIxB,0BAAIyB,KAAMxB,WAASa,QAAStB,OAAO,SAASkC,IAAI,8BAAczB,gEAEvDA,WAASc,2BAApBb,wCAAuC,OAAOqB,UAAQtB,OAAKA,WAASc,6DAG7Cd,WAASe,qBAAxCd,2BAAAyB,GACI3B,2BAAA4B,GACI5B,4BAAM6B,IAAK5B,WAASe"}
|
package/dist/forms/FormRadio.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("secure-ls"),t=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=l(e),
|
|
1
|
+
"use strict";var e=require("secure-ls"),t=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=l(e),o={props:{modelValue:{required:!0},required:{type:Boolean,default:!1},label:{type:String,required:!0},list:{type:Array,default:[]},uuid:{type:Number,default:0},validation:{type:Object,default:function(){return{}}},description:{type:String,default:""},validations:{type:Object,default:function(){return{}}},model:{type:String,default:""},store:{type:String,default:""}},data:function(){return{value:null}},computed:{labelHtml:function(){var e=this.label&&this.validations&&this.validations.required?' <span class="asterisk">*</span>':"";return this.label+e}},mounted:function(){if(this.modelValue&&(this.value=this.modelValue),this.ls=new i.default({isCompression:!1}),this.store&&this.model&&!this.modelValue){var e=this.ls.get("forms");e||(e={}),e[this.store]||(e[this.store]={}),e[this.store][this.model]&&(this.value=e[this.store][this.model])}},watch:{value:function(e){if(this.store&&this.model){var t=this.ls.get("forms");t?t[this.store]||(t[this.store]={}):(t={})[this.store]={},t[this.store][this.model]=e,this.ls.set("forms",t)}this.$emit("update:modelValue",e)}}},r={class:"fields-radio"},n=["innerHTML"],s=["value","id"],a=["for","textContent"],u=["innerHTML"],d=["innerHTML"];o.render=function(e,l,i,o,c,m){return t.openBlock(),t.createElementBlock("div",r,[i.label?(t.openBlock(),t.createElementBlock("label",{key:0,class:"label",innerHTML:m.labelHtml},null,8,n)):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.list,(function(e,o){return t.openBlock(),t.createElementBlock("div",{class:"field",key:o},[t.withDirectives(t.createElementVNode("input",{class:"is-checkradio",type:"radio","onUpdate:modelValue":l[0]||(l[0]=function(e){return c.value=e}),value:e.code,id:i.uuid+"-"+o},null,8,s),[[t.vModelRadio,c.value]]),e.value?(t.openBlock(),t.createElementBlock("label",{key:0,for:i.uuid+"-"+o,textContent:t.toDisplayString(e.value)},null,8,a)):t.createCommentVNode("v-if",!0)])})),128)),i.description?(t.openBlock(),t.createElementBlock("p",{key:1,class:"description",innerHTML:i.description},null,8,u)):t.createCommentVNode("v-if",!0),i.validation.errorMessage?(t.openBlock(),t.createElementBlock("p",{key:2,class:"help is-danger",innerHTML:i.validation.errorMessage},null,8,d)):t.createCommentVNode("v-if",!0)])},module.exports=o;
|
|
2
2
|
//# sourceMappingURL=FormRadio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRadio.js","sources":["../../src/forms/FormRadio.vue","../../src/forms/FormRadio.vue?vue&type=template&id=
|
|
1
|
+
{"version":3,"file":"FormRadio.js","sources":["../../src/forms/FormRadio.vue","../../src/forms/FormRadio.vue?vue&type=template&id=327dcfa5&lang.js"],"sourcesContent":["<template>\n <div class=\"fields-radio\">\n <label class=\"label\" v-html=\"labelHtml\" v-if=\"label\"></label>\n <div class=\"field\" v-for=\"(item, index) in list\" v-bind:key=\"index\">\n <input class=\"is-checkradio\" type=\"radio\" v-model=\"value\" :value=\"item.code\" :id=\"uuid + '-' + index\" />\n <label :for=\"uuid + '-' + index\" v-text=\"item.value\" v-if=\"item.value\"></label>\n </div>\n <p class=\"description\" v-if=\"description\" v-html=\"description\"></p>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nimport SecureLS from 'secure-ls';\n\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 list: {\n type: Array,\n default: []\n },\n uuid: {\n type: Number,\n default: 0\n },\n validation: {\n type: Object,\n default: () => ({})\n },\n description: {\n type: String,\n default: ''\n },\n validations: {\n type: Object,\n default: () => ({})\n },\n model: {\n type: String,\n default: ''\n },\n store: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n value: null\n };\n },\n computed: {\n labelHtml() {\n const requiredHtml = this.label && this.validations && this.validations.required ? ' <span class=\"asterisk\">*</span>' : '';\n return this.label + requiredHtml;\n }\n },\n mounted() {\n if (this.modelValue) {\n this.value = this.modelValue;\n }\n\n this.ls = new SecureLS({\n isCompression: false\n });\n\n if (this.store && this.model && !this.modelValue) {\n let forms = this.ls.get('forms');\n\n if (!forms) {\n forms = {};\n }\n\n if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n if (forms[this.store][this.model]) {\n this.value = forms[this.store][this.model];\n }\n }\n },\n watch: {\n value: function (value) {\n if (this.store && this.model) {\n let forms = this.ls.get('forms');\n\n if (!forms) {\n forms = {};\n forms[this.store] = {};\n } else if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n forms[this.store][this.model] = value;\n\n this.ls.set('forms', forms);\n }\n\n this.$emit('update:modelValue', value);\n }\n }\n};\n</script>\n","<template>\n <div class=\"fields-radio\">\n <label class=\"label\" v-html=\"labelHtml\" v-if=\"label\"></label>\n <div class=\"field\" v-for=\"(item, index) in list\" v-bind:key=\"index\">\n <input class=\"is-checkradio\" type=\"radio\" v-model=\"value\" :value=\"item.code\" :id=\"uuid + '-' + index\" />\n <label :for=\"uuid + '-' + index\" v-text=\"item.value\" v-if=\"item.value\"></label>\n </div>\n <p class=\"description\" v-if=\"description\" v-html=\"description\"></p>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nimport SecureLS from 'secure-ls';\n\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 list: {\n type: Array,\n default: []\n },\n uuid: {\n type: Number,\n default: 0\n },\n validation: {\n type: Object,\n default: () => ({})\n },\n description: {\n type: String,\n default: ''\n },\n validations: {\n type: Object,\n default: () => ({})\n },\n model: {\n type: String,\n default: ''\n },\n store: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n value: null\n };\n },\n computed: {\n labelHtml() {\n const requiredHtml = this.label && this.validations && this.validations.required ? ' <span class=\"asterisk\">*</span>' : '';\n return this.label + requiredHtml;\n }\n },\n mounted() {\n if (this.modelValue) {\n this.value = this.modelValue;\n }\n\n this.ls = new SecureLS({\n isCompression: false\n });\n\n if (this.store && this.model && !this.modelValue) {\n let forms = this.ls.get('forms');\n\n if (!forms) {\n forms = {};\n }\n\n if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n if (forms[this.store][this.model]) {\n this.value = forms[this.store][this.model];\n }\n }\n },\n watch: {\n value: function (value) {\n if (this.store && this.model) {\n let forms = this.ls.get('forms');\n\n if (!forms) {\n forms = {};\n forms[this.store] = {};\n } else if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n forms[this.store][this.model] = value;\n\n this.ls.set('forms', forms);\n }\n\n this.$emit('update:modelValue', value);\n }\n }\n};\n</script>\n"],"names":["props","modelValue","required","type","Boolean","label","String","list","Array","uuid","Number","validation","Object","description","validations","model","store","data","value","computed","labelHtml","requiredHtml","this","mounted","ls","SecureLS","isCompression","forms","get","watch","set","$emit","_createElementBlock","_hoisted_1","$props","innerHTML","$options","item","index","key","_createElementVNode","$data","code","id","_toDisplayString","errorMessage"],"mappings":"8IAee,CACXA,MAAO,CACHC,WAAY,CAAEC,UAAU,GACxBA,SAAU,CACNC,KAAMC,iBACG,GAEbC,MAAO,CACHF,KAAMG,OACNJ,UAAU,GAEdK,KAAM,CACFJ,KAAMK,cACG,IAEbC,KAAM,CACFN,KAAMO,eACG,GAEbC,WAAY,CACRR,KAAMS,eACG,iBAAO,KAEpBC,YAAa,CACTV,KAAMG,eACG,IAEbQ,YAAa,CACTX,KAAMS,eACG,iBAAO,KAEpBG,MAAO,CACHZ,KAAMG,eACG,IAEbU,MAAO,CACHb,KAAMG,eACG,KAGjBW,sBACW,CACHC,MAAO,OAGfC,SAAU,CACNC,yBACUC,EAAeC,KAAKjB,OAASiB,KAAKR,aAAeQ,KAAKR,YAAYZ,SAAW,mCAAqC,UACjHoB,KAAKjB,MAAQgB,IAG5BE,sBACQD,KAAKrB,kBACAiB,MAAQI,KAAKrB,iBAGjBuB,GAAK,IAAIC,UAAS,CACnBC,eAAe,IAGfJ,KAAKN,OAASM,KAAKP,QAAUO,KAAKrB,WAAY,KAC1C0B,EAAQL,KAAKE,GAAGI,IAAI,SAEnBD,IACDA,EAAQ,IAGPA,EAAML,KAAKN,SACZW,EAAML,KAAKN,OAAS,IAGpBW,EAAML,KAAKN,OAAOM,KAAKP,cAClBG,MAAQS,EAAML,KAAKN,OAAOM,KAAKP,UAIhDc,MAAO,CACHX,MAAO,SAAUA,MACTI,KAAKN,OAASM,KAAKP,MAAO,KACtBY,EAAQL,KAAKE,GAAGI,IAAI,SAEnBD,EAGOA,EAAML,KAAKN,SACnBW,EAAML,KAAKN,OAAS,KAHpBW,EAAQ,IACFL,KAAKN,OAAS,GAKxBW,EAAML,KAAKN,OAAOM,KAAKP,OAASG,OAE3BM,GAAGM,IAAI,QAASH,QAGpBI,MAAM,oBAAqBb,eC3G7B,6JAAXc,2BAAAC,GACkDC,uBAA9CF,0CAAa,QAAQG,UAAQC,yEAC7BJ,kDAA2CE,iBAAhBG,EAAMC,wBAAjCN,kCAAW,QAA6CO,IAAKD,qBACzDE,oCAAa,gBAAgBrC,KAAK,6DAAiBsC,YAAQvB,MAAOmB,EAAKK,KAAOC,GAAIT,WAAaI,6BAA5CG,WACQJ,EAAKnB,qBAAhEc,wCAAaE,WAAaI,cAAOM,oBAAa1B,8DAErBgB,6BAA7BF,sCAAS,cAAiCG,UAAQD,0DAClBA,aAAWW,4BAA3Cb,sCAAS,iBAAgDG,UAAQD,aAAWW"}
|
package/dist/forms/FormText.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("secure-ls"),t=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e),l={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{}}},type:{type:String,default:"text"},mask:{type:String,default:""},model:{type:String,default:""},placeholder:{type:String,default:""},store:{type:String,default:""},description:{type:String,default:""},validations:{type:Object,default:function(){return{}}}},data:function(){return{ls:null}},computed:{labelHtml:function(){var e=this.validations&&this.validations.required?' <span class="asterisk">*</span>':"";return this.label+e}},mounted:function(){var e=this;if(this.ls=new i.default({isCompression:!1}),this.store&&this.model&&!this.modelValue){var t=this.ls.get("forms");t||(t={}),t[this.store]||(t[this.store]={}),t[this.store][this.model]&&this.update(t[this.store][this.model])}"phone"==this.type&&this.$refs.input.addEventListener("paste",(function(t){var r=t.clipboardData.getData("text");"+38"!=(r=r.replace(/[^0-9]/g,"")).substr(0,3)&&"380"!=r.substr(0,3)||(t.preventDefault(),t.stopPropagation(),r=r.substr("380"==r.substr(0,3)?2:3),e.$refs.input.value="("+r.slice(0,3)+") "+r.slice(3,6)+"-"+r.slice(6,8)+"-"+r.slice(8,10))}))},methods:{update:function(e){if(this.store&&this.model){var t=this.ls.get("forms");t?t[this.store]||(t[this.store]={}):(t={})[this.store]={},t[this.store][this.model]=e,this.ls.set("forms",t)}this.$emit("update:modelValue",e)}}},s={class:"control"},a=["type","value","required","id","disabled","placeholder"],n=["for","innerHTML"],o=["innerHTML"],
|
|
1
|
+
"use strict";var e=require("secure-ls"),t=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=r(e),l={props:{modelValue:{required:!0},required:{type:Boolean,default:!1},label:{type:String,required:!0},hidden:{type:Boolean,default:!1},config:{type:Object,default:function(){return{type:"text"}}},readOnly:{type:Boolean,default:!1},uuid:{type:Number,default:0},validation:{type:Object,default:function(){return{}}},type:{type:String,default:"text"},mask:{type:String,default:""},model:{type:String,default:""},placeholder:{type:String,default:""},store:{type:String,default:""},description:{type:String,default:""},validations:{type:Object,default:function(){return{}}}},data:function(){return{ls:null}},computed:{labelHtml:function(){var e=this.validations&&this.validations.required?' <span class="asterisk">*</span>':"";return this.label+e}},mounted:function(){var e=this;if(this.ls=new i.default({isCompression:!1}),this.store&&this.model&&!this.modelValue){var t=this.ls.get("forms");t||(t={}),t[this.store]||(t[this.store]={}),t[this.store][this.model]&&this.update(t[this.store][this.model])}"phone"==this.type&&this.$refs.input.addEventListener("paste",(function(t){var r=t.clipboardData.getData("text");"+38"!=(r=r.replace(/[^0-9]/g,"")).substr(0,3)&&"380"!=r.substr(0,3)||(t.preventDefault(),t.stopPropagation(),r=r.substr("380"==r.substr(0,3)?2:3),e.$refs.input.value="("+r.slice(0,3)+") "+r.slice(3,6)+"-"+r.slice(6,8)+"-"+r.slice(8,10))}))},methods:{update:function(e){if(this.store&&this.model){var t=this.ls.get("forms");t?t[this.store]||(t[this.store]={}):(t={})[this.store]={},t[this.store][this.model]=e,this.ls.set("forms",t)}this.$emit("update:modelValue",e)}}},s={class:"control"},a=["type","value","required","id","disabled","placeholder"],n=["for","innerHTML"],o=["innerHTML"],d=["innerHTML"];l.render=function(e,r,i,l,u,c){var p=t.resolveDirective("maska");return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",s,[t.withDirectives(t.createElementVNode("input",{class:t.normalizeClass(["input",{"is-danger":i.validation.errorMessage}]),type:i.hidden?"hidden":i.type,value:i.modelValue,required:i.required,id:i.uuid,disabled:i.readOnly,autocomplete:"chrome-off",onInput:r[0]||(r[0]=function(e){return c.update(e.target.value)}),placeholder:i.placeholder?i.placeholder:" ",ref:"input"},null,42,a),[[p,i.mask]]),i.hidden?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("label",{key:0,class:"label",for:i.uuid,innerHTML:c.labelHtml},null,8,n))]),i.description?(t.openBlock(),t.createElementBlock("p",{key:0,class:"description",innerHTML:i.description},null,8,o)):t.createCommentVNode("v-if",!0),i.validation.errorMessage?(t.openBlock(),t.createElementBlock("p",{key:1,class:"help is-danger",innerHTML:i.validation.errorMessage},null,8,d)):t.createCommentVNode("v-if",!0)])},module.exports=l;
|
|
2
2
|
//# sourceMappingURL=FormText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormText.js","sources":["../../src/forms/FormText.vue","../../src/forms/FormText.vue?vue&type=template&id=1f517e31&lang.js"],"sourcesContent":["<template>\n <div>\n <div class=\"control\">\n <input class=\"input\" :type=\"type\" :value=\"modelValue\" :required=\"required\" :id=\"uuid\" :disabled=\"readOnly\" autocomplete=\"chrome-off\" @input=\"update($event.target.value)\" v-bind:class=\"{\n 'is-danger': validation.errorMessage,\n }\" v-maska=\"mask\" :placeholder=\"placeholder ? placeholder : ' '\" ref=\"input\" />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\"></label>\n </div>\n <p class=\"description\" v-if=\"description\" v-html=\"description\"></p>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nimport SecureLS from \"secure-ls\";\n\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 mask: {\n type: String,\n default: \"\",\n },\n model: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n store: {\n type: String,\n default: \"\",\n },\n description: {\n type: String,\n default: \"\",\n },\n validations: {\n type: Object,\n default: () => ({}),\n },\n },\n data() {\n return {\n ls: null,\n };\n },\n computed: {\n labelHtml() {\n const requiredHtml =\n this.validations && this.validations.required\n ? ' <span class=\"asterisk\">*</span>'\n : \"\";\n return this.label + requiredHtml;\n },\n },\n mounted() {\n this.ls = new SecureLS({\n isCompression: false,\n });\n\n if (this.store && this.model && !this.modelValue) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n }\n\n if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n if (forms[this.store][this.model]) {\n this.update(forms[this.store][this.model]);\n }\n }\n\n if (this.type == \"phone\") {\n this.$refs.input.addEventListener(\"paste\", (event) => {\n let pastedText = event.clipboardData.getData(\"text\");\n pastedText = pastedText.replace(/[^0-9]/g, '');\n\n if (\n pastedText.substr(0, 3) == \"+38\" ||\n pastedText.substr(0, 3) == \"380\"\n ) {\n event.preventDefault();\n event.stopPropagation();\n\n pastedText = pastedText.substr(\n pastedText.substr(0, 3) == \"380\" ? 2 : 3\n );\n\n this.$refs.input.value =\n \"(\" +\n pastedText.slice(0, 3) +\n \") \" +\n pastedText.slice(3, 6) +\n \"-\" +\n pastedText.slice(6, 8) +\n \"-\" +\n pastedText.slice(8, 10);\n }\n });\n }\n },\n methods: {\n update(value) {\n if (this.store && this.model) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n forms[this.store] = {};\n } else if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n forms[this.store][this.model] = value;\n\n this.ls.set(\"forms\", forms);\n }\n\n this.$emit(\"update:modelValue\", value);\n },\n },\n};\n</script>\n","<template>\n <div>\n <div class=\"control\">\n <input class=\"input\" :type=\"type\" :value=\"modelValue\" :required=\"required\" :id=\"uuid\" :disabled=\"readOnly\" autocomplete=\"chrome-off\" @input=\"update($event.target.value)\" v-bind:class=\"{\n 'is-danger': validation.errorMessage,\n }\" v-maska=\"mask\" :placeholder=\"placeholder ? placeholder : ' '\" ref=\"input\" />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\"></label>\n </div>\n <p class=\"description\" v-if=\"description\" v-html=\"description\"></p>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nimport SecureLS from \"secure-ls\";\n\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 mask: {\n type: String,\n default: \"\",\n },\n model: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n store: {\n type: String,\n default: \"\",\n },\n description: {\n type: String,\n default: \"\",\n },\n validations: {\n type: Object,\n default: () => ({}),\n },\n },\n data() {\n return {\n ls: null,\n };\n },\n computed: {\n labelHtml() {\n const requiredHtml =\n this.validations && this.validations.required\n ? ' <span class=\"asterisk\">*</span>'\n : \"\";\n return this.label + requiredHtml;\n },\n },\n mounted() {\n this.ls = new SecureLS({\n isCompression: false,\n });\n\n if (this.store && this.model && !this.modelValue) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n }\n\n if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n if (forms[this.store][this.model]) {\n this.update(forms[this.store][this.model]);\n }\n }\n\n if (this.type == \"phone\") {\n this.$refs.input.addEventListener(\"paste\", (event) => {\n let pastedText = event.clipboardData.getData(\"text\");\n pastedText = pastedText.replace(/[^0-9]/g, '');\n\n if (\n pastedText.substr(0, 3) == \"+38\" ||\n pastedText.substr(0, 3) == \"380\"\n ) {\n event.preventDefault();\n event.stopPropagation();\n\n pastedText = pastedText.substr(\n pastedText.substr(0, 3) == \"380\" ? 2 : 3\n );\n\n this.$refs.input.value =\n \"(\" +\n pastedText.slice(0, 3) +\n \") \" +\n pastedText.slice(3, 6) +\n \"-\" +\n pastedText.slice(6, 8) +\n \"-\" +\n pastedText.slice(8, 10);\n }\n });\n }\n },\n methods: {\n update(value) {\n if (this.store && this.model) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n forms[this.store] = {};\n } else if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n forms[this.store][this.model] = value;\n\n this.ls.set(\"forms\", forms);\n }\n\n this.$emit(\"update:modelValue\", value);\n },\n },\n};\n</script>\n"],"names":["props","modelValue","required","type","Boolean","label","String","config","Object","readOnly","uuid","Number","validation","mask","model","placeholder","store","description","validations","data","ls","computed","labelHtml","requiredHtml","this","mounted","SecureLS","isCompression","forms","get","update","$refs","input","addEventListener","event","pastedText","clipboardData","getData","replace","substr","preventDefault","stopPropagation","_this","value","slice","methods","set","$emit","_createElementBlock","_createElementVNode","_hoisted_1","$props","id","disabled","autocomplete","onInput","$options","$event","target","ref","innerHTML","errorMessage"],"mappings":"8IAgBe,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,KAEpBL,KAAM,CACFA,KAAMG,eACG,QAEbO,KAAM,CACFV,KAAMG,eACG,IAEbQ,MAAO,CACHX,KAAMG,eACG,IAEbS,YAAa,CACTZ,KAAMG,eACG,IAEbU,MAAO,CACHb,KAAMG,eACG,IAEbW,YAAa,CACTd,KAAMG,eACG,IAEbY,YAAa,CACTf,KAAMK,eACG,iBAAO,MAGxBW,sBACW,CACHC,GAAI,OAGZC,SAAU,CACNC,yBACUC,EACFC,KAAKN,aAAeM,KAAKN,YAAYhB,SAC/B,mCACA,UACHsB,KAAKnB,MAAQkB,IAG5BE,sCACSL,GAAK,IAAIM,UAAS,CACnBC,eAAe,IAGfH,KAAKR,OAASQ,KAAKV,QAAUU,KAAKvB,WAAY,KAC1C2B,EAAQJ,KAAKJ,GAAGS,IAAI,SAEnBD,IACDA,EAAQ,IAGPA,EAAMJ,KAAKR,SACZY,EAAMJ,KAAKR,OAAS,IAGpBY,EAAMJ,KAAKR,OAAOQ,KAAKV,aAClBgB,OAAOF,EAAMJ,KAAKR,OAAOQ,KAAKV,QAI1B,SAAbU,KAAKrB,WACA4B,MAAMC,MAAMC,iBAAiB,SAAS,SAACC,OACpCC,EAAaD,EAAME,cAAcC,QAAQ,QAId,QAH/BF,EAAaA,EAAWG,QAAQ,UAAW,KAG5BC,OAAO,EAAG,IACM,OAA3BJ,EAAWI,OAAO,EAAG,KAErBL,EAAMM,iBACNN,EAAMO,kBAENN,EAAaA,EAAWI,OACO,OAA3BJ,EAAWI,OAAO,EAAG,GAAc,EAAI,GAG3CG,EAAKX,MAAMC,MAAMW,MACb,IACAR,EAAWS,MAAM,EAAG,GACpB,KACAT,EAAWS,MAAM,EAAG,GACpB,IACAT,EAAWS,MAAM,EAAG,GACpB,IACAT,EAAWS,MAAM,EAAG,SAKxCC,QAAS,CACLf,gBAAOa,MACCnB,KAAKR,OAASQ,KAAKV,MAAO,KACtBc,EAAQJ,KAAKJ,GAAGS,IAAI,SAEnBD,EAGOA,EAAMJ,KAAKR,SACnBY,EAAMJ,KAAKR,OAAS,KAHpBY,EAAQ,IACFJ,KAAKR,OAAS,GAKxBY,EAAMJ,KAAKR,OAAOQ,KAAKV,OAAS6B,OAE3BvB,GAAG0B,IAAI,QAASlB,QAGpBmB,MAAM,oBAAqBJ,eCvJzB,mNADfK,iCACIC,2BAAAC,oBACID,sDAAa,kDAAS9C,KAAMgD,OAAOR,MAAOQ,aAAajD,SAAUiD,WAAWC,GAAID,OAAOE,SAAUF,WAAUG,aAAa,aAAcC,uCAAOC,SAAOC,EAAOC,OAAOf,SAE/I5B,YAAaoC,cAAcA,kBAAmBQ,IAAI,wBAAzDR,UACZF,oCAAa,YAAcE,OAAMS,UAAQJ,yBAEhBL,6BAA7BH,sCAAS,cAAiCY,UAAQT,0DAClBA,aAAWU,4BAA3Cb,sCAAS,iBAAgDY,UAAQT,aAAWU"}
|
|
1
|
+
{"version":3,"file":"FormText.js","sources":["../../src/forms/FormText.vue","../../src/forms/FormText.vue?vue&type=template&id=80870c78&lang.js"],"sourcesContent":["<template>\n <div>\n <div class=\"control\">\n <input class=\"input\" :type=\"hidden ? 'hidden' : type\" :value=\"modelValue\" :required=\"required\" :id=\"uuid\" :disabled=\"readOnly\" autocomplete=\"chrome-off\" @input=\"update($event.target.value)\" v-bind:class=\"{\n 'is-danger': validation.errorMessage,\n }\" v-maska=\"mask\" :placeholder=\"placeholder ? placeholder : ' '\" ref=\"input\" />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\" v-if=\"!hidden\"></label>\n </div>\n <p class=\"description\" v-if=\"description\" v-html=\"description\"></p>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nimport SecureLS from \"secure-ls\";\n\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 hidden: {\n type: Boolean,\n default: false\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 mask: {\n type: String,\n default: \"\",\n },\n model: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n store: {\n type: String,\n default: \"\",\n },\n description: {\n type: String,\n default: \"\",\n },\n validations: {\n type: Object,\n default: () => ({}),\n },\n },\n data() {\n return {\n ls: null,\n };\n },\n computed: {\n labelHtml() {\n const requiredHtml =\n this.validations && this.validations.required\n ? ' <span class=\"asterisk\">*</span>'\n : \"\";\n return this.label + requiredHtml;\n },\n },\n mounted() {\n this.ls = new SecureLS({\n isCompression: false,\n });\n\n if (this.store && this.model && !this.modelValue) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n }\n\n if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n if (forms[this.store][this.model]) {\n this.update(forms[this.store][this.model]);\n }\n }\n\n if (this.type == \"phone\") {\n this.$refs.input.addEventListener(\"paste\", (event) => {\n let pastedText = event.clipboardData.getData(\"text\");\n pastedText = pastedText.replace(/[^0-9]/g, '');\n\n if (\n pastedText.substr(0, 3) == \"+38\" ||\n pastedText.substr(0, 3) == \"380\"\n ) {\n event.preventDefault();\n event.stopPropagation();\n\n pastedText = pastedText.substr(\n pastedText.substr(0, 3) == \"380\" ? 2 : 3\n );\n\n this.$refs.input.value =\n \"(\" +\n pastedText.slice(0, 3) +\n \") \" +\n pastedText.slice(3, 6) +\n \"-\" +\n pastedText.slice(6, 8) +\n \"-\" +\n pastedText.slice(8, 10);\n }\n });\n }\n },\n methods: {\n update(value) {\n if (this.store && this.model) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n forms[this.store] = {};\n } else if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n forms[this.store][this.model] = value;\n\n this.ls.set(\"forms\", forms);\n }\n\n this.$emit(\"update:modelValue\", value);\n },\n },\n};\n</script>\n","<template>\n <div>\n <div class=\"control\">\n <input class=\"input\" :type=\"hidden ? 'hidden' : type\" :value=\"modelValue\" :required=\"required\" :id=\"uuid\" :disabled=\"readOnly\" autocomplete=\"chrome-off\" @input=\"update($event.target.value)\" v-bind:class=\"{\n 'is-danger': validation.errorMessage,\n }\" v-maska=\"mask\" :placeholder=\"placeholder ? placeholder : ' '\" ref=\"input\" />\n <label class=\"label\" :for=\"uuid\" v-html=\"labelHtml\" v-if=\"!hidden\"></label>\n </div>\n <p class=\"description\" v-if=\"description\" v-html=\"description\"></p>\n <p class=\"help is-danger\" v-if=\"validation.errorMessage\" v-html=\"validation.errorMessage\"></p>\n </div>\n</template>\n\n<script>\nimport SecureLS from \"secure-ls\";\n\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 hidden: {\n type: Boolean,\n default: false\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 mask: {\n type: String,\n default: \"\",\n },\n model: {\n type: String,\n default: \"\",\n },\n placeholder: {\n type: String,\n default: \"\",\n },\n store: {\n type: String,\n default: \"\",\n },\n description: {\n type: String,\n default: \"\",\n },\n validations: {\n type: Object,\n default: () => ({}),\n },\n },\n data() {\n return {\n ls: null,\n };\n },\n computed: {\n labelHtml() {\n const requiredHtml =\n this.validations && this.validations.required\n ? ' <span class=\"asterisk\">*</span>'\n : \"\";\n return this.label + requiredHtml;\n },\n },\n mounted() {\n this.ls = new SecureLS({\n isCompression: false,\n });\n\n if (this.store && this.model && !this.modelValue) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n }\n\n if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n if (forms[this.store][this.model]) {\n this.update(forms[this.store][this.model]);\n }\n }\n\n if (this.type == \"phone\") {\n this.$refs.input.addEventListener(\"paste\", (event) => {\n let pastedText = event.clipboardData.getData(\"text\");\n pastedText = pastedText.replace(/[^0-9]/g, '');\n\n if (\n pastedText.substr(0, 3) == \"+38\" ||\n pastedText.substr(0, 3) == \"380\"\n ) {\n event.preventDefault();\n event.stopPropagation();\n\n pastedText = pastedText.substr(\n pastedText.substr(0, 3) == \"380\" ? 2 : 3\n );\n\n this.$refs.input.value =\n \"(\" +\n pastedText.slice(0, 3) +\n \") \" +\n pastedText.slice(3, 6) +\n \"-\" +\n pastedText.slice(6, 8) +\n \"-\" +\n pastedText.slice(8, 10);\n }\n });\n }\n },\n methods: {\n update(value) {\n if (this.store && this.model) {\n let forms = this.ls.get(\"forms\");\n\n if (!forms) {\n forms = {};\n forms[this.store] = {};\n } else if (!forms[this.store]) {\n forms[this.store] = {};\n }\n\n forms[this.store][this.model] = value;\n\n this.ls.set(\"forms\", forms);\n }\n\n this.$emit(\"update:modelValue\", value);\n },\n },\n};\n</script>\n"],"names":["props","modelValue","required","type","Boolean","label","String","hidden","config","Object","readOnly","uuid","Number","validation","mask","model","placeholder","store","description","validations","data","ls","computed","labelHtml","requiredHtml","this","mounted","SecureLS","isCompression","forms","get","update","$refs","input","addEventListener","event","pastedText","clipboardData","getData","replace","substr","preventDefault","stopPropagation","_this","value","slice","methods","set","$emit","_createElementBlock","_createElementVNode","_hoisted_1","$props","id","disabled","autocomplete","onInput","$options","$event","target","ref","innerHTML","errorMessage"],"mappings":"8IAgBe,CACXA,MAAO,CACHC,WAAY,CAAEC,UAAU,GACxBA,SAAU,CACNC,KAAMC,iBACG,GAEbC,MAAO,CACHF,KAAMG,OACNJ,UAAU,GAEdK,OAAQ,CACJJ,KAAMC,iBACG,GAEbI,OAAQ,CACJL,KAAMM,eACG,iBAAO,CAAEN,KAAM,UAE5BO,SAAU,CACNP,KAAMC,iBACG,GAEbO,KAAM,CACFR,KAAMS,eACG,GAEbC,WAAY,CACRV,KAAMM,eACG,iBAAO,KAEpBN,KAAM,CACFA,KAAMG,eACG,QAEbQ,KAAM,CACFX,KAAMG,eACG,IAEbS,MAAO,CACHZ,KAAMG,eACG,IAEbU,YAAa,CACTb,KAAMG,eACG,IAEbW,MAAO,CACHd,KAAMG,eACG,IAEbY,YAAa,CACTf,KAAMG,eACG,IAEba,YAAa,CACThB,KAAMM,eACG,iBAAO,MAGxBW,sBACW,CACHC,GAAI,OAGZC,SAAU,CACNC,yBACUC,EACFC,KAAKN,aAAeM,KAAKN,YAAYjB,SAC/B,mCACA,UACHuB,KAAKpB,MAAQmB,IAG5BE,sCACSL,GAAK,IAAIM,UAAS,CACnBC,eAAe,IAGfH,KAAKR,OAASQ,KAAKV,QAAUU,KAAKxB,WAAY,KAC1C4B,EAAQJ,KAAKJ,GAAGS,IAAI,SAEnBD,IACDA,EAAQ,IAGPA,EAAMJ,KAAKR,SACZY,EAAMJ,KAAKR,OAAS,IAGpBY,EAAMJ,KAAKR,OAAOQ,KAAKV,aAClBgB,OAAOF,EAAMJ,KAAKR,OAAOQ,KAAKV,QAI1B,SAAbU,KAAKtB,WACA6B,MAAMC,MAAMC,iBAAiB,SAAS,SAACC,OACpCC,EAAaD,EAAME,cAAcC,QAAQ,QAId,QAH/BF,EAAaA,EAAWG,QAAQ,UAAW,KAG5BC,OAAO,EAAG,IACM,OAA3BJ,EAAWI,OAAO,EAAG,KAErBL,EAAMM,iBACNN,EAAMO,kBAENN,EAAaA,EAAWI,OACO,OAA3BJ,EAAWI,OAAO,EAAG,GAAc,EAAI,GAG3CG,EAAKX,MAAMC,MAAMW,MACb,IACAR,EAAWS,MAAM,EAAG,GACpB,KACAT,EAAWS,MAAM,EAAG,GACpB,IACAT,EAAWS,MAAM,EAAG,GACpB,IACAT,EAAWS,MAAM,EAAG,SAKxCC,QAAS,CACLf,gBAAOa,MACCnB,KAAKR,OAASQ,KAAKV,MAAO,KACtBc,EAAQJ,KAAKJ,GAAGS,IAAI,SAEnBD,EAGOA,EAAMJ,KAAKR,SACnBY,EAAMJ,KAAKR,OAAS,KAHpBY,EAAQ,IACFJ,KAAKR,OAAS,GAKxBY,EAAMJ,KAAKR,OAAOQ,KAAKV,OAAS6B,OAE3BvB,GAAG0B,IAAI,QAASlB,QAGpBmB,MAAM,oBAAqBJ,eC3JzB,mNADfK,iCACIC,2BAAAC,oBACID,sDAAa,kDAAS/C,KAAMiD,kBAAoBA,OAAOR,MAAOQ,aAAalD,SAAUkD,WAAWC,GAAID,OAAOE,SAAUF,WAAUG,aAAa,aAAcC,uCAAOC,SAAOC,EAAOC,OAAOf,SAEnK5B,YAAaoC,cAAcA,kBAAmBQ,IAAI,wBAAzDR,UAC+CA,wDAA3DH,0CAAa,YAAcG,OAAMS,UAAQJ,0BAEhBL,6BAA7BH,sCAAS,cAAiCY,UAAQT,0DAClBA,aAAWU,4BAA3Cb,sCAAS,iBAAgDY,UAAQT,aAAWU"}
|
package/dist/global.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global.js","sources":["../src/global/modules/filters.js","../src/global/modules/http.js","../src/global/index.js","../src/global/modules/logger.js"],"sourcesContent":["export default {\n price(value) {\n let val = $env.format.price.decimals == 0 ? Math.round(value) : (value / 1).toFixed(2).replace('.', $env.format.price.decPoint);\n\n return $env.format.price.symbol.replace('#', val.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, $env.format.price.thousandsSep));\n },\n phoneFormat(value) {\n return value ? '+' + value.replace(/(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})/, '$1 ($2) $3-$4-$5') : '';\n },\n};\n","import axios from 'axios';\n\nlet http = axios.create({\n withCredentials: true\n});\n\n// http.interceptors.response.use(response => response,\n// function (error) {\n// if (error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false) {\n// return Promise.reject(error);\n// }\n\n// if (error.response) {\n// console.error(error.response.data.message);\n// }\n// }\n// )\n\nhttp.defaults.headers.common = {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content'),\n 'content-type': 'application/json; charset=utf-8',\n
|
|
1
|
+
{"version":3,"file":"global.js","sources":["../src/global/modules/filters.js","../src/global/modules/http.js","../src/global/index.js","../src/global/modules/logger.js"],"sourcesContent":["export default {\n price(value) {\n let val = $env.format.price.decimals == 0 ? Math.round(value) : (value / 1).toFixed(2).replace('.', $env.format.price.decPoint);\n\n return $env.format.price.symbol.replace('#', val.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, $env.format.price.thousandsSep));\n },\n phoneFormat(value) {\n return value ? '+' + value.replace(/(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})/, '$1 ($2) $3-$4-$5') : '';\n },\n};\n","import axios from 'axios';\n\nlet http = axios.create({\n withCredentials: true,\n});\n\n// http.interceptors.response.use(\n// (response) => response,\n// async (err) => {\n// const status = get(err, 'response.status');\n// console.log('status=' + status);\n// if (status === 419) {\n// // Refresh our session token\n// await axios.get('/csrf-token/');\n\n// // Return a new request using the original request's configuration\n// return axios(err.response.config);\n// }\n\n// return Promise.reject(err);\n// }\n// );\n\n// http.interceptors.response.use(response => response,\n// function (error) {\n// if (error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false) {\n// return Promise.reject(error);\n// }\n\n// if (error.response) {\n// console.error(error.response.data.message);\n// }\n// }\n// )\n\nhttp.defaults.headers.common = {\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content'),\n 'content-type': 'application/json; charset=utf-8',\n accept: 'application/json',\n};\n\nexport default http;\n","import filters from \"./modules/filters\";\nimport http from \"./modules/http\";\nimport logger from \"./modules/logger\";\n\nexport default {\n filters,\n http,\n logger,\n};","export default function logger(logPostURL, logDefaults) {\n if (!logPostURL || typeof logPostURL !== 'string' || logPostURL instanceof String) {\n throw new Error('[logPostURL] is required param. It must be a String.');\n }\n\n let url = logPostURL;\n let defaults = logDefaults;\n\n function sendMessage(errorText, errLevel) {\n if (!url) {\n throw new Error('[url] is not defined. You need to initialise logger first.');\n }\n\n let requestData = {};\n let message = errorText + getClientInfo();\n\n if (errLevel) {\n requestData = Object.assign({}, defaults, {\n errlevel: errLevel,\n message: message\n });\n } else {\n requestData.message = message;\n }\n\n $http.post(url, requestData);\n }\n\n function getClientInfo() {\n return '\\n\\nClient info:' +\n '\\nURL: ' + window.location +\n '\\nCLN: ' + window.navigator.userAgent +\n '\\nX*Y: ' + window.innerWidth + 'x' + window.innerHeight;\n }\n\n window.onerror = function (type, location, line, position, errorObj) {\n let message;\n\n if (type === 'ResizeObserver loop limit exceeded') {\n return;\n }\n\n if (type && location && line && position) {\n message = 'ERROR:' +\n ' \\n: ' + type +\n ' \\n\\nat file: ' + location + ' ' +\n ' \\nat line:' + line +\n ' \\nat col: ' + position;\n } else if (type !== null && typeof type === 'object') {\n message = 'EventError:' +\n ' \\n' + ((type.message) ? type.message : ' -- ') +\n ' \\n\\nat file: ' + ((type.filename) ? type.filename : ' -- ') +\n ' \\nat line: ' + ((type.lineno) ? type.lineno : ' -- ') +\n ' \\nat col: ' + ((type.colno) ? type.colno : ' -- ') +\n ' \\n\\nstack: ' + ((type.error && type.error.stack) ? type.error.stack : ' -- ');\n } else {\n message = type +\n ' \\n\\nlocation: ' + location +\n (position ? ' \\nposition: ' + position : '') +\n ' \\n\\nerrorObj: ' + ((type !== null && typeof type === 'object') ? JSON.stringify(errorObj) : errorObj);\n }\n\n if (errorObj && errorObj.stack) {\n message += ' \\n\\nStack: ' + errorObj.stack;\n }\n\n if (message) {\n sendMessage(message, 'error');\n }\n };\n\n window.addEventListener(\"unhandledrejection\", function (err) {\n if (err && err.reason) {\n let message = 'Promise unhandled error' +\n ' \\nmessage: ' + err.reason.message +\n ' \\n\\nstack: ' + err.reason.stack;\n\n sendMessage(message, 'error');\n }\n });\n}"],"names":["price","value","val","$env","format","decimals","Math","round","toFixed","replace","decPoint","symbol","toString","thousandsSep","phoneFormat","http","create","withCredentials","defaults","headers","common","document","querySelector","getAttribute","accept","filters","logger","logPostURL","logDefaults","String","Error","url","sendMessage","errorText","errLevel","requestData","message","window","location","navigator","userAgent","innerWidth","innerHeight","Object","assign","errlevel","$http","post","onerror","type","line","position","errorObj","_typeof","filename","lineno","colno","error","stack","JSON","stringify","addEventListener","err","reason"],"mappings":"2FAAe,CACXA,eAAMC,OACEC,EAAoC,GAA9BC,KAAKC,OAAOJ,MAAMK,SAAgBC,KAAKC,MAAMN,IAAUA,EAAQ,GAAGO,QAAQ,GAAGC,QAAQ,IAAKN,KAAKC,OAAOJ,MAAMU,iBAE/GP,KAAKC,OAAOJ,MAAMW,OAAOF,QAAQ,IAAKP,EAAIU,WAAWH,QAAQ,wBAAyBN,KAAKC,OAAOJ,MAAMa,gBAEnHC,qBAAYb,UACDA,EAAQ,IAAMA,EAAMQ,QAAQ,sCAAuC,oBAAsB,KCLpGM,8BAAaC,OAAO,CACpBC,iBAAiB,yOAgCrBF,EAAKG,SAASC,QAAQC,OAAS,oBACP,gCACJC,SAASC,cAAc,2BAA2BC,aAAa,0BAC/D,kCAChBC,OAAQ,oBCnCZ,MAAe,CACXC,QAAAA,EACAV,KAAAA,EACAW,OCPW,SAAgBC,EAAYC,OAClCD,GAAoC,iBAAfA,GAA2BA,aAAsBE,aACjE,IAAIC,MAAM,4DAGhBC,EAAMJ,EACNT,EAAWU,WAENI,EAAYC,EAAWC,OACvBH,QACK,IAAID,MAAM,kEAGhBK,EAAc,GACdC,EAAUH,EAeP,0BACSI,OAAOC,SACnB,UAAYD,OAAOE,UAAUC,UAC7B,UAAYH,OAAOI,WAAa,IAAMJ,OAAOK,YAhB7CR,EACAC,EAAcQ,OAAOC,OAAO,GAAI1B,EAAU,CACtC2B,SAAUX,EACVE,QAASA,IAGbD,EAAYC,QAAUA,EAG1BU,MAAMC,KAAKhB,EAAKI,GAUpBE,OAAOW,QAAU,SAAUC,EAAMX,EAAUY,EAAMC,EAAUC,OACnDhB,EAES,uCAATa,IAKAb,EADAa,GAAQX,GAAYY,GAAQC,EAClB,cACIF,EACV,iBAAmBX,EAFb,eAGUY,EAChB,cAAgBC,EACJ,OAATF,GAAiC,WAAhBI,EAAOJ,GACrB,kBACIA,EAAKb,QAAWa,EAAKb,QAAU,QACzC,kBAAqBa,EAAKK,SAAYL,EAAKK,SAAW,QACtD,gBAAmBL,EAAKM,OAAUN,EAAKM,OAAS,QAChD,eAAkBN,EAAKO,MAASP,EAAKO,MAAQ,QAC7C,gBAAmBP,EAAKQ,OAASR,EAAKQ,MAAMC,MAAST,EAAKQ,MAAMC,MAAQ,QAElET,EACN,kBAAoBX,GACnBa,EAAW,gBAAkBA,EAAW,IACzC,mBAA+B,OAATF,GAAiC,WAAhBI,EAAOJ,GAAqBU,KAAKC,UAAUR,GAAYA,GAGlGA,GAAYA,EAASM,QACrBtB,GAAW,eAAiBgB,EAASM,OAGrCtB,GACAJ,EAAYI,EAAS,WAI7BC,OAAOwB,iBAAiB,sBAAsB,SAAUC,GAChDA,GAAOA,EAAIC,QAKX/B,EAJc,sCACO8B,EAAIC,OAAO3B,QAC5B,eAAiB0B,EAAIC,OAAOL,MAEX"}
|
package/dist/helpers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),s=require("@perevorot/shop/dist/forms/FormSelect"),l=require("@perevorot/shop/dist/forms/FormSwitch"),c=require("@perevorot/shop/dist/forms/FormText"),f=require("@perevorot/shop/dist/forms/FormTextarea");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=d(t),v=d(o),b=d(n),y=d(i),F=d(a),g=d(u),S=d(s),q=d(l),w=d(c),x=d(f);function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==t)return;var o,n,i=[],a=!0,u=!1;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(r){u=!0,n=r}finally{try{a||null==t.return||t.return()}finally{if(u)throw n}}return i}(r,e)||k(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(r){return function(r){if(Array.isArray(r))return A(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(r,e){if(r){if("string"==typeof r)return A(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(r,e):void 0}}function A(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}p.addMethod(p.string,"minOrEmpty",(function(r,e){return this.test({name:"minOrEmpty",exclusive:!0,message:e,params:{min:r},test:function(e){return""==e||e.length>=r}})})),p.addMethod(p.string,"
|
|
1
|
+
"use strict";var r=require("vue"),e=require("yup"),t=require("@perevorot/shop/dist/forms/FormCheckbox"),o=require("@perevorot/shop/dist/forms/FormCheckboxes"),n=require("@perevorot/shop/dist/forms/FormPassword"),i=require("@perevorot/shop/dist/forms/FormRadio"),a=require("@perevorot/shop/dist/forms/FormRating"),u=require("@perevorot/shop/dist/forms/FormSection"),s=require("@perevorot/shop/dist/forms/FormSelect"),l=require("@perevorot/shop/dist/forms/FormSwitch"),c=require("@perevorot/shop/dist/forms/FormText"),f=require("@perevorot/shop/dist/forms/FormTextarea");function d(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function m(r){if(r&&r.__esModule)return r;var e=Object.create(null);return r&&Object.keys(r).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:function(){return r[t]}})}})),e.default=r,Object.freeze(e)}var p=m(e),h=d(t),v=d(o),b=d(n),y=d(i),F=d(a),g=d(u),S=d(s),q=d(l),w=d(c),x=d(f);function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==t)return;var o,n,i=[],a=!0,u=!1;try{for(t=t.call(r);!(a=(o=t.next()).done)&&(i.push(o.value),!e||i.length!==e);a=!0);}catch(r){u=!0,n=r}finally{try{a||null==t.return||t.return()}finally{if(u)throw n}}return i}(r,e)||k(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(r){return function(r){if(Array.isArray(r))return A(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||k(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(r,e){if(r){if("string"==typeof r)return A(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?A(r,e):void 0}}function A(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,o=new Array(e);t<e;t++)o[t]=r[t];return o}p.addMethod(p.string,"minOrEmpty",(function(r,e){return this.test({name:"minOrEmpty",exclusive:!0,message:e,params:{min:r},test:function(e){return""==e||e.length>=r}})})),p.addMethod(p.string,"numberFilled",(function(r,e){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:r},test:function(r){return!(""==r||isNaN(r))}})}));var _={pluralize:function(r,e){return r+" "+e[r%100>4&&r%100<20?2:[2,0,1,1,1,2][Math.min(r%10,5)]]},formParse:function(e){var t={FormCheckbox:h.default,FormCheckboxes:v.default,FormPassword:b.default,FormRadio:y.default,FormRating:F.default,FormSection:g.default,FormSelect:S.default,FormSwitch:q.default,FormText:w.default,FormTextarea:x.default},o={},n={},i={};if(e.form)for(var a=function(){var e=j(s[u],2),a=e[0],l=e[1];if("_"!=a.charAt(0)){var c;switch(l.component){case"FormCheckbox":case"FormSwitch":c=!1;break;case"FormCheckboxes":c=[];break;default:c=""}o[a]=c}var f=t[l.component];r.markRaw(f);var d={component:f,label:l.label,validations:{}};if(l.validation){var m=p;l.validation.forEach((function(r){var e=[],t=r;if(t.split(":").length>1){var o=r.split(":");t=o.shift(),e=JSON.parse(o)}if("required"==t&&(d.validations.required=!0),"phone"==t&&d.validations.required){t="matches",e=[/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")]}"array"!=t&&e.push(__("auth.validation."+t));try{var n;m=(n=m)[t].apply(n,O(e))}catch(r){}})),i[a]=m}l.condition&&(d.condition=function(r){return r[l.condition[0]]===l.condition[1]},i[a]=p.string().when(l.condition[0],{is:l.condition[1],then:i[a]})),["mask","placeholder","description","type","list","model","store","default","hidden"].forEach((function(r){l[r]&&(d[r]=l[r])})),n[a]=d},u=0,s=Object.entries(e.form);u<s.length;u++)a();return{schema:n,model:o,validation:p.object().shape(i)}},nl2p:function(r){return null==r?"":"<p>"+(r+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1</p><p>$2")+"</p>"}};module.exports=_;
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/index.js","../src/helpers/modules/pluralize.js","../src/helpers/modules/nl2p.js"],"sourcesContent":["import { markRaw } from 'vue';\nimport * as yup from 'yup';\n\nimport FormCheckbox from '@perevorot/shop/dist/forms/FormCheckbox';\nimport FormCheckboxes from '@perevorot/shop/dist/forms/FormCheckboxes';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport FormRating from '@perevorot/shop/dist/forms/FormRating';\nimport FormSection from '@perevorot/shop/dist/forms/FormSection';\nimport FormSelect from '@perevorot/shop/dist/forms/FormSelect';\nimport FormSwitch from '@perevorot/shop/dist/forms/FormSwitch';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormTextarea from '@perevorot/shop/dist/forms/FormTextarea';\n\nyup.addMethod(yup.string, 'minOrEmpty', function (min, msg) {\n return this.test({\n name: 'minOrEmpty',\n exclusive: true,\n message: msg,\n params: {\n min: min,\n },\n test: (value) => value == '' || value.length >= min,\n });\n});\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nexport default function formParse(json) {\n let components = {\n FormCheckbox: FormCheckbox,\n FormCheckboxes: FormCheckboxes,\n FormPassword: FormPassword,\n FormRadio: FormRadio,\n FormRating: FormRating,\n FormSection: FormSection,\n FormSelect: FormSelect,\n FormSwitch: FormSwitch,\n FormText: FormText,\n FormTextarea: FormTextarea,\n };\n\n let model = {};\n let schema = {};\n let validation = {};\n\n if (json.form) {\n for (const [field, element] of Object.entries(json.form)) {\n if (field.charAt(0) != '_') {\n let value;\n\n switch (element.component) {\n case 'FormCheckbox':\n case 'FormSwitch':\n value = false;\n break;\n\n case 'FormCheckboxes':\n value = [];\n break;\n default:\n value = '';\n }\n\n model[field] = value;\n }\n\n const component = components[element.component];\n\n markRaw(component);\n\n let s = {\n component: component,\n label: element.label,\n validations: {},\n };\n\n if (element.validation) {\n let v = yup;\n\n const validations = element.validation;\n\n validations.forEach((rule) => {\n let attributes = [];\n let method = rule;\n\n if (method.split(':').length > 1) {\n let ruleWithAttributes = rule.split(':');\n method = ruleWithAttributes.shift();\n\n attributes = JSON.parse(ruleWithAttributes);\n }\n\n if (method == 'required') {\n s.validations.required = true;\n }\n\n if (method == 'phone' && s.validations.required) {\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n\n method = 'matches';\n\n attributes = [phoneRegExp, __('auth.validation.phone')];\n }\n\n if (method != 'array') {\n attributes.push(__('auth.validation.' + method));\n }\n\n try {\n v = v[method](...attributes);\n } catch (error) {}\n });\n\n validation[field] = v;\n }\n\n if (element.condition) {\n s.condition = (model) => model[element.condition[0]] === element.condition[1];\n\n validation[field] = yup.string().when(element.condition[0], {\n is: element.condition[1],\n then: validation[field],\n });\n }\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store', 'default', 'hidden'].forEach((f) => {\n if (element[f]) {\n s[f] = element[f];\n }\n });\n\n schema[field] = s;\n }\n }\n\n return {\n schema: schema,\n model: model,\n validation: yup.object().shape(validation),\n };\n}\n","import pluralize from './modules/pluralize';\nimport formParse from './modules/formParse';\nimport nl2p from './modules/nl2p';\n\nexport default {\n pluralize,\n formParse,\n nl2p,\n};\n","export default function pluralize(count, words) {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return count + ' ' + words[count % 100 > 4 && count % 100 < 20 ? 2 : cases[Math.min(count % 10, 5)]];\n};","export default function nl2p(str) {\n if (typeof str === 'undefined' || str === null) {\n return '';\n }\n\n return '<p>' + (str + '').replace(/([^>\\r\\n]?)(\\r\\n|\\n\\r|\\r|\\n)/g, '$1' + '</p><p>' + '$2') + '</p>';\n}\n"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","__","isNaN","pluralize","count","words","Math","formParse","json","components","FormCheckbox","FormCheckboxes","FormPassword","FormRadio","FormRating","FormSection","FormSelect","FormSwitch","FormText","FormTextarea","model","schema","validation","form","field","element","charAt","component","markRaw","s","label","validations","v","forEach","rule","attributes","method","split","ruleWithAttributes","shift","JSON","parse","required","push","error","condition","when","is","then","f","Object","entries","object","shape","nl2p","str","replace"],"mappings":"kyEAcAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,SAAmB,IAATA,GAAeA,EAAMC,QAAUT,QAIxDH,EAAIC,UAAUD,EAAIE,OAAQ,gBAAgB,SAAUC,EAAKC,UAC9CC,KAAKC,KAAK,CACbC,KAAM,eACNC,WAAW,EACXC,QAASI,GAAG,0BACZH,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAACK,WAAqB,IAATA,GAAeG,MAAMH,UC9BhD,MAAe,CACXI,UCLW,SAAmBC,EAAOC,UAG9BD,EAAQ,IAAMC,EAAMD,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAAK,EAFrD,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAE+CE,KAAKf,IAAIa,EAAQ,GAAI,MDGhGG,UDgCW,SAAmBC,OAC1BC,EAAa,CACbC,aAAcA,UACdC,eAAgBA,UAChBC,aAAcA,UACdC,UAAWA,UACXC,WAAYA,UACZC,YAAaA,UACbC,WAAYA,UACZC,WAAYA,UACZC,SAAUA,UACVC,aAAcA,WAGdC,EAAQ,GACRC,EAAS,GACTC,EAAa,MAEbd,EAAKe,0CACOC,OAAOC,UACQ,KAAnBD,EAAME,OAAO,GAAW,KACpB3B,SAEI0B,EAAQE,eACP,mBACA,aACD5B,GAAQ,YAGP,iBACDA,EAAQ,iBAGRA,EAAQ,GAGhBqB,EAAMI,GAASzB,MAGb4B,EAAYlB,EAAWgB,EAAQE,WAErCC,UAAQD,OAEJE,EAAI,CACJF,UAAWA,EACXG,MAAOL,EAAQK,MACfC,YAAa,OAGbN,EAAQH,WAAY,KAChBU,EAAI5C,EAEYqC,EAAQH,WAEhBW,SAAQ,SAACC,OACbC,EAAa,GACbC,EAASF,KAETE,EAAOC,MAAM,KAAKrC,OAAS,EAAG,KAC1BsC,EAAqBJ,EAAKG,MAAM,KACpCD,EAASE,EAAmBC,QAE5BJ,EAAaK,KAAKC,MAAMH,MAGd,YAAVF,IACAP,EAAEE,YAAYW,UAAW,GAGf,SAAVN,GAAqBP,EAAEE,YAAYW,SAAU,CAG7CN,EAAS,UAETD,EAAa,CAJO,kCAIOlC,GAAG,0BAGpB,SAAVmC,GACAD,EAAWQ,KAAK1C,GAAG,mBAAqBmC,cAIxCJ,KAAIA,GAAEI,aAAWD,IACnB,MAAOS,QAGbtB,EAAWE,GAASQ,EAGpBP,EAAQoB,YACRhB,EAAEgB,UAAY,SAACzB,UAAUA,EAAMK,EAAQoB,UAAU,MAAQpB,EAAQoB,UAAU,IAE3EvB,EAAWE,GAASpC,EAAIE,SAASwD,KAAKrB,EAAQoB,UAAU,GAAI,CACxDE,GAAItB,EAAQoB,UAAU,GACtBG,KAAM1B,EAAWE,OAIxB,OAAQ,cAAe,cAAe,OAAQ,OAAQ,QAAS,QAAS,UAAW,UAAUS,SAAQ,SAACgB,GAC/FxB,EAAQwB,KACRpB,EAAEoB,GAAKxB,EAAQwB,OAIvB5B,EAAOG,GAASK,SArFWqB,OAAOC,QAAQ3C,EAAKe,+BAyFhD,CACHF,OAAQA,EACRD,MAAOA,EACPE,WAAYlC,EAAIgE,SAASC,MAAM/B,KC9InCgC,KEPW,SAAcC,UACrB,MAAOA,EACA,GAGJ,OAASA,EAAM,IAAIC,QAAQ,gCAAiC,eAA2B"}
|
package/dist/store.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t=require("@perevorot/shop/dist/api"),a={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 document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(a,n){var e=a.commit;t.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(a,n){var e=a.commit,c=a.state;t.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(a,n){var e=a.commit,c=a.state;t.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(a,n){var e=a.commit;t.cart.quantity(n.product).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(a,n){var e=a.commit;t.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(a,n){var e=a.commit;t.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 n(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var e=require("vue-toastification").useToast(),c={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal},is:function(t){return Object.keys(t.user).length>0}},i={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}},o={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(a,n){var e=a.commit;t.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(a,n){var e=a.commit;t.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.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}))}}},l={namespaced:!0,state:{products:[],categories:[],list:[],last:""},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}},actions:{get:function(a,n){var e=a.commit;t.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(a,n){var e=a.commit;t.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(a,n){var e=a.commit;t.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.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(a,n){a.commit,a.state,t.compare.delete(n.id).then((function(t){"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}}},s={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},u={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}}},r={modules:{cart:a,auth:{namespaced:!0,state:{user:{},modal:!1,account:[]},getters:c,actions:{me:function(a,n){var c=a.commit;t.auth.me().then((function(t){c("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),e(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&c("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(a,n){var e=a.commit,c=a.dispatch;t.auth.login(n.credentials).then((function(t){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(a,n){var e=a.commit;t.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(a,e){n(a),t.auth.reset(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a,!1,t.data)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},resetSms:function(a,e){n(a),t.auth.resetSms(e.credentials).then((function(t){e&&"function"==typeof e.callback&&e.callback(t.data,!1)})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.error&&e.callback(t.response.data,!0)})).finally(e.finally)},passwordUpdate:function(a,e){n(a),t.auth.passwordUpdate(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},register:function(a,n){a.commit,t.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(a,n){a.commit,t.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:i},wishlist:o,compare:l,review:s,order:u,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=r;
|
|
1
|
+
"use strict";var t=require("@perevorot/shop/dist/api"),a={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 document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal}},actions:{get:function(a,n){var e=a.commit;t.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(a,n){var e=a.commit,c=a.state;t.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(a,n){var e=a.commit,c=a.state;t.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(a,n){var e=a.commit;t.cart.quantity(n.product).then((function(){e("quantity",n.product),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},remove:function(a,n){var e=a.commit;t.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(a,n){var e=a.commit;t.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 n(t){if(null==t)throw new TypeError("Cannot destructure undefined")}var e=require("vue-toastification").useToast(),c={me:function(t){return t.user},account:function(t){return t.account},modal:function(t){return document.documentElement.classList[t.modal?"add":"remove"]("is-modal-open"),t.modal},is:function(t){return Object.keys(t.user).length>0}},i={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}},o={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(a,n){var e=a.commit;t.wishlist.items().then((function(t){e("items",t.data.items),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},list:function(a,n){var e=a.commit;t.wishlist.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.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}))}}},l={namespaced:!0,state:{products:[],categories:[],list:[],last:""},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}},actions:{get:function(a,n){var e=a.commit;t.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(a,n){var e=a.commit;t.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(a,n){var e=a.commit;t.compare.list().then((function(t){e("list",t.data),"function"==typeof n.callback&&n.callback()})).finally(n.finally)},toggle:function(a,n){var e=a.commit;a.state,t.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(a,n){a.commit,a.state,t.compare.delete(n.id).then((function(t){"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}}},s={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){document.documentElement.classList[a?"add":"remove"]("is-modal-open"),t.modal=a}}},u={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}}},r={modules:{cart:a,auth:{namespaced:!0,state:{user:{},modal:!1,account:[]},getters:c,actions:{me:function(a,n){var c=a.commit;t.auth.me().then((function(t){c("me",t.data),t.data.flash&&t.data.flash.message&&(console.error(t.data.flash.message),e(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"})),t.data.flash&&t.data.flash.modal&&c("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(a,n){var e=a.commit,c=a.dispatch;t.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),document.documentElement.classList.remove("is-modal-open"),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(a,n){var e=a.commit;t.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(a,e){n(a),t.auth.reset(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a,!1,t.data)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},resetSms:function(a,e){n(a),t.auth.resetSms(e.credentials).then((function(t){e&&"function"==typeof e.callback&&e.callback(t.data,!1)})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.error&&e.callback(t.response.data,!0)})).finally(e.finally)},passwordUpdate:function(a,e){n(a),t.auth.passwordUpdate(e.credentials).then((function(t){if(e&&"function"==typeof e.callback){var a=t.data&&t.data.message?t.data.message:"";e.callback(a)}})).catch((function(t){e&&"function"==typeof e.callback&&t.response.data.errors&&t.response.data.errors.email&&e.callback(t.response.data.errors.email[0],!0)})).finally(e.finally)},register:function(a,n){a.commit,t.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(a,n){a.commit,t.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:i},wishlist:o,compare:l,review:s,order:u,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=r;
|
|
2
2
|
//# sourceMappingURL=store.js.map
|