@perevorot/shop 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +2 -0
- package/dist/api.js.map +1 -0
- package/dist/app.js +2 -0
- package/dist/app.js.map +1 -0
- package/dist/global.js +2 -0
- package/dist/global.js.map +1 -0
- package/dist/helpers.js +2 -0
- package/dist/helpers.js.map +1 -0
- package/dist/store.js +2 -0
- package/dist/store.js.map +1 -0
- package/dist/vuex.js +2 -0
- package/dist/vuex.js.map +1 -0
- package/package.json +1 -1
package/dist/api.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t={me:function(){return $http.post($ziggy("auth.me"))},login:function(t){return $http.post($ziggy("auth.login"),t)},logout:function(){return $http.post($ziggy("auth.logout"))},reset:function(t){return $http.post($ziggy("auth.password.email"),t)},passwordUpdate:function(t){return $http.post($ziggy("auth.password.update"),t)},registerShort:function(t){return $http.post($ziggy("auth.register.short"),t)},registerFull:function(t){return $http.post($ziggy("auth.register.full"),t)},registerForm:function(){return $http.post($ziggy("auth.register.form"))},update:function(t){return $http.post($ziggy("auth.register.update"),t)}},i={items:function(){return $http.post($ziggy("api.cart"),{action:"get"})},add:function(t){return $http.post($ziggy("api.cart"),{action:"add",id:t.id,quantity:t.quantity,options:!!t.options&&t.options})},options:function(t){return $http.post($ziggy("api.cart"),{action:"options",id:t.id,options:t.options})},addBundle:function(t){return $http.post($ziggy("api.cart"),{action:"addBundle",id:t.id,second:t.second,third:t.third})},remove:function(t){return $http.post($ziggy("api.cart"),{action:"remove",id:t})},clear:function(){return $http.post($ziggy("api.cart"),{action:"clear"})},quantity:function(t){return $http.post($ziggy("api.cart"),{action:"quantity",id:t.id,exact:t.exact})}},o={items:function(){return $http.post($ziggy("api.compare"),{action:"get"})},category:function(t){return $http.post($ziggy("api.compare"),{action:"category",slug:t})},toggle:function(t){return $http.post($ziggy("api.compare"),{action:"toggle",id:t})},delete:function(t){return $http.post($ziggy("api.compare"),{action:"delete",id:t})}},n={search:function(t){return $http.post($ziggy("api.search"),{term:t})}},r={items:function(){return $http.post($ziggy("api.wishlist"),{action:"get"})},toggle:function(t){return $http.post($ziggy("api.wishlist"),{action:"toggle",id:t})}};module.exports={auth:t,cart:i,compare:o,shop:n,wishlist:r};
|
|
2
|
+
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../src/api/modules/auth.js","../src/api/modules/cart.js","../src/api/modules/compare.js","../src/api/modules/shop.js","../src/api/modules/wishlist.js","../src/api/index.js"],"sourcesContent":["export default {\n me() {\n return $http.post($ziggy(\"auth.me\"));\n },\n login(credentials) {\n return $http.post($ziggy(\"auth.login\"), credentials);\n },\n logout() {\n return $http.post($ziggy(\"auth.logout\"));\n },\n reset(credentials) {\n return $http.post($ziggy(\"auth.password.email\"), credentials);\n },\n passwordUpdate(credentials) {\n return $http.post($ziggy(\"auth.password.update\"), credentials);\n },\n registerShort(credentials) {\n return $http.post($ziggy(\"auth.register.short\"), credentials);\n },\n registerFull(credentials) {\n return $http.post($ziggy(\"auth.register.full\"), credentials);\n },\n registerForm() {\n return $http.post($ziggy(\"auth.register.form\"));\n },\n update(credentials) {\n return $http.post($ziggy(\"auth.register.update\"), credentials);\n },\n}","export default {\n items() {\n return $http.post($ziggy(\"api.cart\"), {\n action: \"get\",\n });\n },\n\n add(item) {\n return $http.post($ziggy(\"api.cart\"), {\n action: \"add\",\n id: item.id,\n quantity: item.quantity,\n options: item.options ? item.options : false\n });\n },\n\n options(item) {\n return $http.post($ziggy(\"api.cart\"), {\n action: \"options\",\n id: item.id,\n options: item.options\n });\n },\n\n addBundle(item) {\n return $http.post($ziggy(\"api.cart\"), {\n action: \"addBundle\",\n id: item.id,\n second: item.second,\n third: item.third\n });\n },\n\n remove(id) {\n return $http.post($ziggy(\"api.cart\"), {\n action: \"remove\",\n id: id\n });\n },\n\n clear() {\n return $http.post($ziggy(\"api.cart\"), {\n action: \"clear\"\n });\n },\n\n quantity(item) {\n return $http.post($ziggy(\"api.cart\"), {\n action: \"quantity\",\n id: item.id,\n exact: item.exact\n });\n },\n}","export default {\n items() {\n return $http.post($ziggy(\"api.compare\"), {\n action: \"get\",\n });\n },\n\n category(slug) {\n return $http.post($ziggy(\"api.compare\"), {\n action: \"category\",\n slug: slug\n });\n },\n\n toggle(id) {\n return $http.post($ziggy(\"api.compare\"), {\n action: \"toggle\",\n id: id\n });\n },\n\n delete(id) {\n return $http.post($ziggy(\"api.compare\"), {\n action: \"delete\",\n id: id\n });\n },\n}","export default {\n search(term) {\n return $http.post($ziggy(\"api.search\"), {\n term: term,\n });\n },\n}","export default {\n items() {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"get\",\n });\n },\n\n toggle(id) {\n return $http.post($ziggy(\"api.wishlist\"), {\n action: \"toggle\",\n id: id\n });\n },\n}","import auth from './modules/auth';\nimport cart from './modules/cart';\nimport compare from './modules/compare';\nimport shop from './modules/shop';\nimport wishlist from './modules/wishlist';\n\nmodule.exports = {\n auth,\n cart,\n compare,\n shop,\n wishlist\n};"],"names":["me","$http","post","$ziggy","login","credentials","logout","reset","passwordUpdate","registerShort","registerFull","registerForm","update","items","action","add","item","id","quantity","options","addBundle","second","third","remove","clear","exact","category","slug","toggle","search","term","module","exports","auth","cart","compare","shop","wishlist"],"mappings":"aAAA,MAAe,CACXA,qBACWC,MAAMC,KAAKC,OAAO,aAE7BC,eAAMC,UACKJ,MAAMC,KAAKC,OAAO,cAAeE,IAE5CC,yBACWL,MAAMC,KAAKC,OAAO,iBAE7BI,eAAMF,UACKJ,MAAMC,KAAKC,OAAO,uBAAwBE,IAErDG,wBAAeH,UACJJ,MAAMC,KAAKC,OAAO,wBAAyBE,IAEtDI,uBAAcJ,UACHJ,MAAMC,KAAKC,OAAO,uBAAwBE,IAErDK,sBAAaL,UACFJ,MAAMC,KAAKC,OAAO,sBAAuBE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B,CACtCW,OAAQ,SACRG,GAAIA,MCJhBc,OAAOC,QAAU,CACbC,KAAAA,EACAC,KAAAA,EACAC,QAAAA,EACAC,KAAAA,EACAC,SAAAA"}
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vue"),t=require("vanilla-lazyload"),o=require("maska"),l=require("@perevorot/shop/dist/global");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),n=a(o),i=e.createApp({});i.use(n.default),window.$http=l.http,i.config.globalProperties.$filters=l.filters,i.config.globalProperties.$env=$env,"#_=_"===window.location.hash&&(history.replaceState?history.replaceState(null,null,window.location.href.split("#")[0]):window.location.hash="",window.localStorage&&window.localStorage.clear()),window.addEventListener("DOMContentLoaded",(function(){window.lazyImages=new r.default({unobserve_entered:!0,callback_enter:function(e){e.parentElement.classList.add("is-lazy-loaded")}})})),$env.loggerUrl&&l.logger.init($env.loggerUrl),module.exports=i;
|
|
2
|
+
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sources":["../src/app.js"],"sourcesContent":["import {\n createApp\n} from 'vue';\n\nimport LazyLoad from 'vanilla-lazyload';\nimport Maska from 'maska';\nimport {\n http,\n filters,\n logger\n} from '@perevorot/shop/dist/global';\n\n// import {\n// provideAppToast\n// } from '@/global/toast';\n\nconst app = createApp({});\n\napp.use(Maska);\n\n// app.use(provideAppToast, {\n// transition: \"Vue-Toastification__fade\",\n// icon: false,\n// position: \"top-center\",\n// hideProgressBar: true,\n// showCloseButtonOnHover: false,\n// });\n\nwindow.$http = http;\n\napp.config.globalProperties.$filters = filters;\napp.config.globalProperties.$env = $env;\n\nif (window.location.hash === \"#_=_\") {\n history.replaceState ? history.replaceState(null, null, window.location.href.split(\"#\")[0]) : window.location.hash = \"\";\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n}\n\nwindow.addEventListener('DOMContentLoaded', () => {\n window.lazyImages = new LazyLoad({\n unobserve_entered: true,\n callback_enter: (element) => {\n element.parentElement.classList.add('is-lazy-loaded');\n }\n });\n});\n\nif ($env.loggerUrl) {\n logger.init($env.loggerUrl);\n}\n\nmodule.exports = app;"],"names":["app","createApp","use","Maska","window","$http","http","config","globalProperties","$filters","filters","$env","location","hash","history","replaceState","href","split","localStorage","clear","addEventListener","lazyImages","LazyLoad","unobserve_entered","callback_enter","element","parentElement","classList","add","loggerUrl","logger","init","module","exports"],"mappings":"sNAgBMA,EAAMC,YAAU,IAEtBD,EAAIE,IAAIC,WAURC,OAAOC,MAAQC,OAEfN,EAAIO,OAAOC,iBAAiBC,SAAWC,UACvCV,EAAIO,OAAOC,iBAAiBG,KAAOA,KAEN,SAAzBP,OAAOQ,SAASC,OAChBC,QAAQC,aAAeD,QAAQC,aAAa,KAAM,KAAMX,OAAOQ,SAASI,KAAKC,MAAM,KAAK,IAAMb,OAAOQ,SAASC,KAAO,GAEjHT,OAAOc,cACPd,OAAOc,aAAaC,SAI5Bf,OAAOgB,iBAAiB,oBAAoB,WACxChB,OAAOiB,WAAa,IAAIC,UAAS,CAC7BC,mBAAmB,EACnBC,eAAgB,SAACC,GACbA,EAAQC,cAAcC,UAAUC,IAAI,wBAK5CjB,KAAKkB,WACLC,SAAOC,KAAKpB,KAAKkB,WAGrBG,OAAOC,QAAUjC"}
|
package/dist/global.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var n={price:function(e){var n=0==$env.format.price.decimals?Math.round(e):(e/1).toFixed(2).replace(".",$env.format.price.decPoint);return $env.format.price.symbol.replace("#",n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,$env.format.price.thousandsSep))}},r=e(require("axios")).default.create({withCredentials:!0});function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}exports.filters=n,exports.http=r,exports.logger=function(e,n){if(!e||"string"!=typeof e||e instanceof String)throw new Error("[logPostURL] is required param. It must be a String.");var r=e,o=n;function i(e,n){if(!r)throw new Error("[url] is not defined. You need to initialise logger first.");var t={},i=e+"\n\nClient info:\nURL: "+window.location+"\nCLN: "+window.navigator.userAgent+"\nX*Y: "+window.innerWidth+"x"+window.innerHeight;n?t=Object.assign({},o,{errlevel:n,message:i}):t.message=i,$http.post(r,t)}window.onerror=function(e,n,r,o,a){var s;"ResizeObserver loop limit exceeded"!==e&&(s=e&&n&&r&&o?"ERROR: \n: "+e+" \n\nat file: "+n+" \nat line:"+r+" \nat col: "+o:null!==e&&"object"===t(e)?"EventError: \n"+(e.message?e.message:" -- ")+" \n\nat file: "+(e.filename?e.filename:" -- ")+" \nat line: "+(e.lineno?e.lineno:" -- ")+" \nat col: "+(e.colno?e.colno:" -- ")+" \n\nstack: "+(e.error&&e.error.stack?e.error.stack:" -- "):e+" \n\nlocation: "+n+(o?" \nposition: "+o:"")+" \n\nerrorObj: "+(null!==e&&"object"===t(e)?JSON.stringify(a):a),a&&a.stack&&(s+=" \n\nStack: "+a.stack),s&&i(s,"error"))},window.addEventListener("unhandledrejection",(function(e){e&&e.reason&&i("Promise unhandled error \nmessage: "+e.reason.message+" \n\nstack: "+e.reason.stack,"error")}))};
|
|
2
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sources":["../src/global/modules/filters.js","../src/global/modules/http.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}","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\n// http.defaults.headers.common = {\n// 'X-Requested-With': 'XMLHttpRequest',\n// 'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content')\n// }\n\nexport default http;","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","http","create","withCredentials","logPostURL","logDefaults","String","Error","url","defaults","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":"kJAAe,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,iBCFnHC,8BAAaC,OAAO,CACpBC,iBAAiB,yRCHN,SAAgBC,EAAYC,OAClCD,GAAoC,iBAAfA,GAA2BA,aAAsBE,aACjE,IAAIC,MAAM,4DAGhBC,EAAMJ,EACNK,EAAWJ,WAENK,EAAYC,EAAWC,OACvBJ,QACK,IAAID,MAAM,kEAGhBM,EAAc,GACdC,EAAUH,EAeP,0BACSI,OAAOC,SACnB,UAAYD,OAAOE,UAAUC,UAC7B,UAAYH,OAAOI,WAAa,IAAMJ,OAAOK,YAhB7CR,EACAC,EAAcQ,OAAOC,OAAO,GAAIb,EAAU,CACtCc,SAAUX,EACVE,QAASA,IAGbD,EAAYC,QAAUA,EAG1BU,MAAMC,KAAKjB,EAAKK,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
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});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"),a=require("@perevorot/shop/dist/forms/FormRadio"),i=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"),f=require("@perevorot/shop/dist/forms/FormText"),c=require("@perevorot/shop/dist/forms/FormTextarea");function m(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}function d(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=d(e),h=m(t),v=m(o),y=m(n),b=m(a),F=m(i),g=m(u),S=m(s),q=m(l),x=m(f),w=m(c);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,a=[],i=!0,u=!1;try{for(t=t.call(r);!(i=(o=t.next()).done)&&(a.push(o.value),!e||a.length!==e);i=!0);}catch(r){u=!0,n=r}finally{try{i||null==t.return||t.return()}finally{if(u)throw n}}return a}(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}})})),exports.formParse=function(e){var t={FormCheckbox:h.default,FormCheckboxes:v.default,FormPassword:y.default,FormRadio:b.default,FormRating:F.default,FormSection:g.default,FormSelect:S.default,FormSwitch:q.default,FormText:x.default,FormTextarea:w.default},o={},n={},a={};if(e.form)for(var i=function(){var e=j(s[u],2),i=e[0],l=e[1];if("_"!=i.charAt(0)){var f;switch(l.component){case"FormCheckbox":case"FormSwitch":f=!1;break;case"FormCheckboxes":f=[];break;default:f=""}o[i]=f}var c=t[l.component];r.markRaw(c);var m={component:c,label:l.label,validations:{}};if(l.validation){var d=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&&(m.validations.required=!0),"phone"==t&&m.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;d=(n=d)[t].apply(n,O(e))}catch(r){}})),["mask","placeholder","description","type","list","model","store"].forEach((function(r){l[r]&&(m[r]=l[r])})),a[i]=d}n[i]=m},u=0,s=Object.entries(e.form);u<s.length;u++)i();return{schema:n,model:o,validation:p.object().shape(a)}},exports.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)]]};
|
|
2
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sources":["../src/helpers/modules/formParse.js","../src/helpers/modules/pluralize.js"],"sourcesContent":["import {\n markRaw\n} 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\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 = [\n phoneRegExp,\n __(\"auth.validation.phone\")\n ];\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 });\n\n ['mask', 'placeholder', 'description', 'type', 'list', 'model', 'store'].forEach((field) => {\n if (element[field]) {\n s[field] = element[field];\n }\n });\n\n validation[field] = v;\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}","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};"],"names":["yup","addMethod","string","min","msg","this","test","name","exclusive","message","params","value","length","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","Object","entries","object","shape","count","words","Math"],"mappings":"y1EAgBAA,EAAIC,UAAUD,EAAIE,OAAQ,cAAc,SAAUC,EAAKC,UAC5CC,KAAKC,KAAK,CACbC,KAAM,aACNC,WAAW,EACXC,QAASL,EACTM,OAAQ,CACJP,IAAKA,GAETG,KAAM,SAAAK,SAAkB,IAATA,GAAeA,EAAMC,QAAUT,0BAIvC,SAAmBU,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,KACpBpB,SAEImB,EAAQE,eACP,mBACA,aACDrB,GAAQ,YAGP,iBACDA,EAAQ,iBAGRA,EAAQ,GAGhBc,EAAMI,GAASlB,MAGbqB,EAAYlB,EAAWgB,EAAQE,WAErCC,UAAQD,OAEJE,EAAI,CACJF,UAAWA,EACXG,MAAOL,EAAQK,MACfC,YAAa,OAGbN,EAAQH,WAAY,KAChBU,EAAIrC,EAEY8B,EAAQH,WAEhBW,SAAQ,SAAAC,OACZC,EAAa,GACbC,EAASF,KAETE,EAAOC,MAAM,KAAK9B,OAAS,EAAG,KAC1B+B,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,kCAMhBQ,GAAG,0BAIG,SAAVP,GACAD,EAAWS,KAAKD,GAAG,mBAAqBP,cAIxCJ,KAAIA,GAAEI,aAAWD,IACnB,MAAOU,SAKZ,OAAQ,cAAe,cAAe,OAAQ,OAAQ,QAAS,SAASZ,SAAQ,SAACT,GAC1EC,EAAQD,KACRK,EAAEL,GAASC,EAAQD,OAI3BF,EAAWE,GAASQ,EAGxBX,EAAOG,GAASK,SAjFWiB,OAAOC,QAAQvC,EAAKe,+BAqFhD,CACHF,OAAQA,EACRD,MAAOA,EACPE,WAAY3B,EAAIqD,SAASC,MAAM3B,uBCvIxB,SAAmB4B,EAAOC,UAG9BD,EAAQ,IAAMC,EAAMD,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAAK,EAFrD,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAE+CE,KAAKtD,IAAIoD,EAAQ,GAAI"}
|
package/dist/store.js
ADDED
|
@@ -0,0 +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={namespaced:!0,state:{user:{},modal:!1,account:[]},getters:{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}},actions:{me:function(a,n){var e=a.commit;t.auth.me().then((function(t){e("me",t.data),t.data.flash&&t.data.flash.message&&toast(t.data.flash.message,{type:t.data.flash.type?t.data.flash.type:"default"}),t.data.flash&&t.data.flash.modal&&e("modal",t.data.flash.modal),n&&"function"==typeof n.callback&&n.callback()})).finally(n&&n.finally?n.finally:function(){})},login:function(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)}})).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)},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:{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}}},c={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}))}}},i={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}}},o={namespaced:!0,state:{modal:!1},getters:{modal:function(t){return t.modal}},mutations:{modal:function(t,a){t.modal=a}}},l={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}}},s={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=""}}};module.exports={modules:{cart:a,auth:e,wishlist:c,compare:i,review:o,order:l,checkout:s},strict:!1};
|
|
2
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sources":["../src/store/modules/cart.js","../src/store/modules/auth.js","../src/store/modules/wishlist.js","../src/store/modules/compare.js","../src/store/modules/review.js","../src/store/modules/order.js","../src/store/modules/checkout.js","../src/store/index.js"],"sourcesContent":["import {\n cart as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n items: [],\n cross: [],\n bundles: [],\n modal: false\n}\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n\n cross: (state) => {\n return state.cross;\n },\n\n bundles: (state) => {\n return state.bundles;\n },\n\n productQuantity: (state, getters) => (id) => {\n const product = getters.items.find(product => product.id === id);\n\n return product ? product.quantity : 0;\n },\n\n quantity: (state, getters) => {\n let count = 0;\n\n getters.items.forEach((item) => {\n count += parseInt(item.quantity);\n });\n\n return count;\n },\n\n total: (state, getters) => {\n let total = 0;\n\n getters.items.forEach((item) => {\n let price = (item.attributes.price ? item.attributes.price : item.price);\n\n if (item.attributes.options && item.attributes.options.length && item.options && item.options.length) {\n let optionsPrice = 0;\n\n item.options.forEach(option => {\n if (item.attributes.options.indexOf(option.id) !== -1) {\n optionsPrice += parseInt(option.price);\n }\n });\n\n price += optionsPrice;\n }\n\n total +=\n price *\n (item.attributes.active === false ? 0 : item.quantity);\n });\n\n return total;\n },\n\n modal: (state) => {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n\n return state.modal;\n }\n}\n\nconst actions = {\n get({\n commit\n }, data) {\n api.items().then((response) => {\n commit('items', response.data.items);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n add({\n commit,\n state\n }, data) {\n api.add(data.product).then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n } else {\n commit('quantity', data.product);\n }\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n options({\n commit,\n state\n }, data) {\n api.options(data.product).then((response) => {\n if (response.data && response.data.items && response.data.items.length) {\n commit('items', response.data.items);\n }\n\n if (!state.modal) {\n commit('modal', true);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n quantity({\n commit\n }, data) {\n api.quantity(data.product).then(() => {\n commit('quantity', data.product);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n remove({\n commit\n }, data) {\n api.remove(data.id).then((response) => {\n commit('remove', data.id);\n\n if (response.data && response.data.cross) {\n commit('cross', response.data.cross);\n }\n\n if (response.data && response.data.bundles) {\n commit('bundles', response.data.bundles);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n clear({\n commit\n }, data) {\n api.clear(data.id).then(() => {\n commit('clear');\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n }\n}\n\nconst mutations = {\n modal(state, action) {\n state.modal = action;\n },\n\n items(state, items) {\n state.items = items;\n },\n\n cross(state, cross) {\n state.cross = cross;\n },\n\n bundles(state, bundles) {\n state.bundles = bundles;\n },\n\n remove(state, id) {\n state.items = state.items.filter(item => item.id !== id);\n },\n\n quantity(state, item) {\n const product = state.items.find(product => product.id === item.id);\n\n product.quantity = item.exact ? item.exact : (product.quantity + item.quantity);\n },\n\n clear(state) {\n state.items = [];\n state.cross = [];\n state.bundles = [];\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import {\n auth as api\n} from '@perevorot/shop/dist/api'\n// // import {\n// // useGlobalToast as useToast\n// // } from \"@/global/toast\";\n\n// const toast = useToast();\n\nconst state = {\n user: {},\n modal: false,\n account: []\n}\n\nconst getters = {\n me: (state) => {\n return state.user;\n },\n account: (state) => {\n return state.account;\n },\n modal: (state) => {\n document.documentElement.classList[state.modal ? 'add' : 'remove']('is-modal-open');\n\n return state.modal;\n },\n is: (state) => {\n return Object.keys(state.user).length > 0;\n }\n}\n\nconst actions = {\n me({\n commit\n }, data) {\n api.me().then((response) => {\n commit('me', response.data);\n\n if (response.data.flash && response.data.flash.message) {\n toast(response.data.flash.message, {\n type: response.data.flash.type ? response.data.flash.type : 'default'\n });\n }\n\n if (response.data.flash && response.data.flash.modal) {\n commit('modal', response.data.flash.modal);\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data && data.finally ? data.finally : () => {});\n },\n login({\n commit,\n dispatch\n }, data) {\n api.login(data.credentials).then((response) => {\n commit('me', response.data);\n commit('modal', null);\n\n dispatch(\"cart/get\", {\n finally: () => {},\n }, {\n root: true\n });\n\n dispatch(\"wishlist/get\", {\n finally: () => {},\n }, {\n root: true\n });\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n }).catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n }).finally(data.finally);\n },\n logout({\n commit\n }, data) {\n api.logout().then(() => {\n commit('me', {\n user: {},\n account: []\n });\n\n commit(\"wishlist/items\", [], {\n root: true\n });\n\n if (window.localStorage) {\n window.localStorage.clear();\n }\n\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n\n if (window.location.href.indexOf('/account') !== -1) {\n window.location.href = $env.locale.url + '/';\n }\n });\n },\n reset({}, data) {\n api.reset(data.credentials).then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ?\n response.data.message :\n \"\";\n\n data.callback(message);\n }\n }).catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n }).finally(data.finally);\n },\n passwordUpdate({}, data) {\n api.passwordUpdate(data.credentials).then((response) => {\n if (data && typeof data.callback == 'function') {\n const message = response.data && response.data.message ?\n response.data.message :\n \"\";\n\n data.callback(message);\n }\n }).catch((error) => {\n if (data && typeof data.callback == 'function') {\n if (error.response.data.errors && error.response.data.errors.email) {\n data.callback(error.response.data.errors.email[0], true);\n }\n }\n }).finally(data.finally);\n },\n register({\n commit\n }, data) {\n api['register' + data.type](data.credentials).then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n }).catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n }).finally(data.finally);\n },\n update({\n commit\n }, data) {\n api['update'](data.credentials).then((response) => {\n if (data && typeof data.callback == 'function') {\n data.callback();\n }\n }).catch((error) => {\n if (data && typeof data.catch == 'function') {\n data.catch(error);\n }\n }).finally(data.finally);\n },\n}\n\nconst mutations = {\n me(state, me) {\n state.user = (Array.isArray(me.user) && !me.user.length ? {} : me.user);\n state.account = me.account;\n },\n modal(state, action) {\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import {\n wishlist as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n items: [],\n list: [],\n last: ''\n}\n\nconst getters = {\n items: (state) => {\n return state.items;\n },\n item: (state, getters) => (id) => {\n return getters.items.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n // badge: (state) => {\n // return state.items.length;\n // },\n last: (state) => {\n return state.last;\n },\n}\n\nconst actions = {\n get({\n commit,\n }, data) {\n api.items().then((response) => {\n commit('items', response.data.items);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n list({\n commit,\n }, data) {\n api.list().then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n toggle({\n commit,\n state\n }, data) {\n api.toggle(data.id).then((response) => {\n if (response.data && response.data.items) {\n commit('items', response.data.items);\n }\n\n if (response.data && response.data.last) {\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n}\n\nconst mutations = {\n items(state, items) {\n state.items = items;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n last(state, last) {\n state.last = last;\n },\n\n remove(state, id) {\n state.items = state.items.filter(item => item.id !== id);\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","import {\n compare as api\n} from '@perevorot/shop/dist/api'\n\nconst state = {\n products: [],\n categories: [],\n list: [],\n last: ''\n}\n\nconst getters = {\n products: (state) => {\n return state.products;\n },\n categories: (state) => {\n return state.categories;\n },\n product: (state, getters) => (id) => {\n return getters.products.indexOf(id) !== -1;\n },\n list: (state) => {\n return state.list;\n },\n last: (state) => {\n return state.last;\n },\n}\n\nconst actions = {\n get({\n commit,\n }, data) {\n api.items().then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n category({\n commit,\n }, data) {\n api.category(data.slug).then((response) => {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n list({\n commit,\n }, data) {\n api.list().then((response) => {\n commit('list', response.data);\n\n if (typeof data.callback == 'function') {\n data.callback();\n }\n }).finally(data.finally);\n },\n\n toggle({\n commit,\n state\n }, data) {\n api.toggle(data.id).then((response) => {\n if (response.data) {\n commit('products', response.data.products);\n commit('categories', response.data.categories);\n commit('last', response.data.last);\n }\n\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n }).finally(data.finally);\n },\n\n delete({\n commit,\n state\n }, data) {\n api.delete(data.id).then((response) => {\n if (typeof data.callback == 'function') {\n data.callback(response.data);\n }\n }).finally(data.finally);\n },\n}\n\nconst mutations = {\n products(state, products) {\n state.products = products;\n },\n\n categories(state, categories) {\n state.categories = categories;\n },\n\n list(state, list) {\n state.list = list;\n },\n\n remove(state, id) {\n state.products = state.products.filter(item => item.id !== id);\n },\n\n last(state, last) {\n state.last = last;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}","const state = {\n modal: false\n}\n\nconst getters = {\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n modal(state, action) {\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","const state = {\n steps: {},\n current: 1,\n modal: false,\n}\n\nconst getters = {\n steps: (state) => {\n return state.steps;\n },\n current: (state) => {\n return state.current;\n },\n modal: (state) => {\n return state.modal;\n }\n}\n\nconst mutations = {\n step(state, data) {\n if (Number.isInteger(data)) {\n state.current = data;\n } else {\n if (data.data) {\n state.steps[data.step] = data.data;\n }\n }\n },\n stepInit(state, data) {\n if (!state.steps[data.step]) {\n state.steps[data.step] = data.data;\n }\n },\n reset(state) {\n state.steps = {};\n state.current = 1;\n },\n modal(state, action) {\n state.modal = action;\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","const state = {\n user: {},\n payment: null,\n shipping: null,\n shippingData: {},\n dontcall: false,\n comment: ''\n};\n\nconst getters = {\n user: (state, getters, rootState, rootGetters) => {\n //return state.user;\n return Object.keys(state.user).length ? state.user : JSON.parse(JSON.stringify(rootGetters['auth/me']));\n },\n shipping: (state) => {\n return state.shipping;\n },\n shippingData: (state) => {\n return state.shippingData;\n },\n payment: (state) => {\n return state.payment;\n },\n dontcall: (state) => {\n return state.dontcall;\n },\n comment: (state) => {\n return state.comment;\n },\n}\n\nconst mutations = {\n user(state, data) {\n state.user = data;\n },\n shipping(state, data) {\n state.shipping = data;\n },\n shippingData(state, data) {\n state.shippingData = data;\n },\n payment(state, data) {\n state.payment = data;\n },\n dontcall(state, data) {\n state.dontcall = data;\n },\n comment(state, data) {\n state.comment = data;\n },\n reset(state) {\n state.user = {};\n state.payment = null;\n state.shipping = null;\n state.shippingData = {};\n state.dontcall = false;\n state.comment = '';\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n mutations\n}","import cart from './modules/cart';\nimport auth from './modules/auth';\nimport wishlist from './modules/wishlist';\nimport compare from './modules/compare';\nimport review from './modules/review';\nimport order from './modules/order';\nimport checkout from './modules/checkout';\n\nmodule.exports = {\n modules: {\n cart,\n auth,\n wishlist,\n compare,\n review,\n order,\n checkout,\n },\n strict: false,\n};"],"names":["namespaced","state","items","cross","bundles","modal","getters","productQuantity","id","product","find","quantity","count","forEach","item","parseInt","total","price","attributes","options","length","optionsPrice","option","indexOf","active","document","documentElement","classList","actions","get","data","commit","api","then","response","callback","add","remove","clear","mutations","action","filter","exact","user","account","me","is","Object","keys","flash","message","toast","type","login","dispatch","credentials","root","window","localStorage","error","logout","location","href","$env","locale","url","reset","errors","email","passwordUpdate","register","update","Array","isArray","list","last","toggle","products","categories","category","slug","steps","current","step","Number","isInteger","stepInit","payment","shipping","shippingData","dontcall","comment","rootState","rootGetters","JSON","parse","stringify","module","exports","modules","cart","auth","wishlist","compare","review","order","checkout","strict"],"mappings":"yDA6Ne,CACXA,YAAY,EACZC,MA3NU,CACVC,MAAO,GACPC,MAAO,GACPC,QAAS,GACTC,OAAO,GAwNPC,QArNY,CACZJ,MAAO,SAACD,UACGA,EAAMC,OAGjBC,MAAO,SAACF,UACGA,EAAME,OAGjBC,QAAS,SAACH,UACCA,EAAMG,SAGjBG,gBAAiB,SAACN,EAAOK,UAAY,SAACE,OAC5BC,EAAUH,EAAQJ,MAAMQ,MAAK,SAAAD,UAAWA,EAAQD,KAAOA,YAEtDC,EAAUA,EAAQE,SAAW,IAGxCA,SAAU,SAACV,EAAOK,OACVM,EAAQ,SAEZN,EAAQJ,MAAMW,SAAQ,SAACC,GACnBF,GAASG,SAASD,EAAKH,aAGpBC,GAGXI,MAAO,SAACf,EAAOK,OACPU,EAAQ,SAEZV,EAAQJ,MAAMW,SAAQ,SAACC,OACfG,EAASH,EAAKI,WAAWD,MAAQH,EAAKI,WAAWD,MAAQH,E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OC,QAAU,CACbC,QAAS,CACLC,KAAAA,EACAC,KAAAA,EACAC,SAAAA,EACAC,QAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,SAAAA,GAEJC,QAAQ"}
|
package/dist/vuex.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("vuex"),t=require("vuex-persistedstate"),r=require("secure-ls"),u=require("@perevorot/shop/dist/store");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),s=n(r),a=n(u),i=new s.default({isCompression:!1});a.default.plugins=[o.default({storage:{getItem:function(e){return i.get(e)},setItem:function(e,t){return i.set(e,t)},removeItem:function(e){return i.remove(e)}}})];var d=e.createStore(a.default);window.addEventListener("storage",(function(e){if("vuex"===e.key&&e.newValue!=e.oldValue)try{d.replaceState(JSON.parse(i.get("vuex")))}catch(e){}})),module.exports=d;
|
|
2
|
+
//# sourceMappingURL=vuex.js.map
|
package/dist/vuex.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vuex.js","sources":["../src/vuex.js"],"sourcesContent":["import {\n createStore\n} from 'vuex';\n\nimport createPersistedState from \"vuex-persistedstate\";\nimport secure from \"secure-ls\";\nimport storeObject from '@perevorot/shop/dist/store';\nconst ls = new secure({\n isCompression: false\n});\n\nstoreObject.plugins = [\n createPersistedState({\n storage: {\n getItem: key => ls.get(key),\n setItem: (key, value) => ls.set(key, value),\n removeItem: key => ls.remove(key)\n }\n })\n];\n\nconst store = createStore(storeObject);\n\nwindow.addEventListener('storage', e => {\n if (e.key === 'vuex' && e.newValue != e.oldValue) {\n try {\n store.replaceState(JSON.parse(ls.get('vuex')));\n } catch (e) {}\n }\n});\n\nmodule.exports = store;"],"names":["ls","secure","isCompression","storeObject","plugins","createPersistedState","storage","getItem","key","get","setItem","value","set","removeItem","remove","store","createStore","window","addEventListener","e","newValue","oldValue","replaceState","JSON","parse","module","exports"],"mappings":"oOAOMA,EAAK,IAAIC,UAAO,CAClBC,eAAe,IAGnBC,UAAYC,QAAU,CAClBC,UAAqB,CACjBC,QAAS,CACLC,QAAS,SAAAC,UAAOR,EAAGS,IAAID,IACvBE,QAAS,SAACF,EAAKG,UAAUX,EAAGY,IAAIJ,EAAKG,IACrCE,WAAY,SAAAL,UAAOR,EAAGc,OAAON,QAKzC,IAAMO,EAAQC,cAAYb,WAE1Bc,OAAOC,iBAAiB,WAAW,SAAAC,MACjB,SAAVA,EAAEX,KAAkBW,EAAEC,UAAYD,EAAEE,aAEhCN,EAAMO,aAAaC,KAAKC,MAAMxB,EAAGS,IAAI,UACvC,MAAOU,QAIjBM,OAAOC,QAAUX"}
|