@perevorot/shop 2.0.1 → 2.0.5
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 +1 -1
- package/dist/api.js.map +1 -1
- package/dist/app.js +1 -1
- package/dist/app.js.map +1 -1
- package/dist/components/auth/Login.js.map +1 -1
- package/dist/components/shop/Catalog.js +1 -1
- package/dist/components/shop/Catalog.js.map +1 -1
- package/dist/components/shop/Cross.js +1 -1
- package/dist/components/shop/Cross.js.map +1 -1
- package/dist/components/shop/Gallery.js +1 -1
- package/dist/components/shop/Gallery.js.map +1 -1
- package/dist/components/shop/PromoProducts.js +1 -1
- package/dist/components/shop/PromoProducts.js.map +1 -1
- package/dist/components/shop/bundle/Bundle.js +1 -1
- package/dist/components/shop/bundle/Bundle.js.map +1 -1
- package/dist/components/shop/cart/Cart.js +1 -1
- package/dist/components/shop/cart/Cart.js.map +1 -1
- package/dist/components/shop/viewed/Viewed.js +1 -1
- package/dist/components/shop/viewed/Viewed.js.map +1 -1
- package/dist/components/shop/wishlist/WishlistAdd.js +1 -1
- package/dist/components/shop/wishlist/WishlistAdd.js.map +1 -1
- package/dist/global.js +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/dist/vuex.js.map +1 -1
- package/package.json +3 -1
package/dist/api.js
CHANGED
|
@@ -1,2 +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)}},
|
|
1
|
+
"use strict";var t={auth:{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)}},cart:{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})}},compare:{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})}},shop:{search:function(t){return $http.post($ziggy("api.search"),{term:t})}},wishlist:{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=t;
|
|
2
2
|
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["../src/api/modules/auth.js","../src/api/
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../src/api/modules/auth.js","../src/api/index.js","../src/api/modules/cart.js","../src/api/modules/compare.js","../src/api/modules/shop.js","../src/api/modules/wishlist.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}","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\nexport default {\n auth,\n cart,\n compare,\n shop,\n wishlist\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}"],"names":["auth","me","$http","post","$ziggy","login","credentials","logout","reset","passwordUpdate","registerShort","registerFull","registerForm","update","cart","items","action","add","item","id","quantity","options","addBundle","second","third","remove","clear","exact","compare","category","slug","toggle","shop","search","term","wishlist"],"mappings":"aAAA,MCMe,CACXA,KDPW,CACXC,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,IAEpDM,+BACWV,MAAMC,KAAKC,OAAO,wBAE7BS,gBAAOP,UACIJ,MAAMC,KAAKC,OAAO,wBAAyBE,KClBtDQ,KCRW,CACXC,wBACWb,MAAMC,KAAKC,OAAO,YAAa,CAClCY,OAAQ,SAIhBC,aAAIC,UACOhB,MAAMC,KAAKC,OAAO,YAAa,CAClCY,OAAQ,MACRG,GAAID,EAAKC,GACTC,SAAUF,EAAKE,SACfC,UAASH,EAAKG,SAAUH,EAAKG,WAIrCA,iBAAQH,UACGhB,MAAMC,KAAKC,OAAO,YAAa,CAClCY,OAAQ,UACRG,GAAID,EAAKC,GACTE,QAASH,EAAKG,WAItBC,mBAAUJ,UACChB,MAAMC,KAAKC,OAAO,YAAa,CAClCY,OAAQ,YACRG,GAAID,EAAKC,GACTI,OAAQL,EAAKK,OACbC,MAAON,EAAKM,SAIpBC,gBAAON,UACIjB,MAAMC,KAAKC,OAAO,YAAa,CAClCY,OAAQ,SACRG,GAAIA,KAIZO,wBACWxB,MAAMC,KAAKC,OAAO,YAAa,CAClCY,OAAQ,WAIhBI,kBAASF,UACEhB,MAAMC,KAAKC,OAAO,YAAa,CAClCY,OAAQ,WACRG,GAAID,EAAKC,GACTQ,MAAOT,EAAKS,UDzCpBC,QETW,CACXb,wBACWb,MAAMC,KAAKC,OAAO,eAAgB,CACrCY,OAAQ,SAIhBa,kBAASC,UACE5B,MAAMC,KAAKC,OAAO,eAAgB,CACrCY,OAAQ,WACRc,KAAMA,KAIdC,gBAAOZ,UACIjB,MAAMC,KAAKC,OAAO,eAAgB,CACrCY,OAAQ,SACRG,GAAIA,qBAILA,UACIjB,MAAMC,KAAKC,OAAO,eAAgB,CACrCY,OAAQ,SACRG,GAAIA,MFdZa,KGVW,CACXC,gBAAOC,UACIhC,MAAMC,KAAKC,OAAO,cAAe,CACpC8B,KAAMA,MHQdC,SIXW,CACXpB,wBACWb,MAAMC,KAAKC,OAAO,gBAAiB,CACtCY,OAAQ,SAIhBe,gBAAOZ,UACIjB,MAAMC,KAAKC,OAAO,gBAAiB,CACtCY,OAAQ,SACRG,GAAIA"}
|
package/dist/app.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),
|
|
1
|
+
"use strict";var e=require("vue"),o=require("vanilla-lazyload"),t=require("maska"),a=require("@perevorot/shop/dist/global"),i=require("vue-toastification");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(o),l=r(t),s=r(i),d=e.createApp({});d.use(l.default),d.use(s.default,{transition:"Vue-Toastification__fade",icon:!1,position:"top-center",hideProgressBar:!0,showCloseButtonOnHover:!1}),window.$http=a.http,d.config.globalProperties.$filters=a.filters,d.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 n.default({unobserve_entered:!0,callback_enter:function(e){e.parentElement.classList.add("is-lazy-loaded")}})})),$env.loggerUrl&&a.logger.init($env.loggerUrl),module.exports=d;
|
|
2
2
|
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
CHANGED
|
@@ -1 +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\
|
|
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\nimport Toast from \"vue-toastification\";\n\nconst app = createApp({});\n\napp.use(Maska);\n\napp.use(Toast, {\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\nexport default app;"],"names":["app","createApp","use","Maska","Toast","transition","icon","position","hideProgressBar","showCloseButtonOnHover","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"],"mappings":"6PAcMA,EAAMC,YAAU,IAEtBD,EAAIE,IAAIC,WAERH,EAAIE,IAAIE,UAAO,CACXC,WAAY,2BACZC,MAAM,EACNC,SAAU,aACVC,iBAAiB,EACjBC,wBAAwB,IAG5BC,OAAOC,MAAQC,OAEfZ,EAAIa,OAAOC,iBAAiBC,SAAWC,UACvChB,EAAIa,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Login.js","sources":["../../../src/components/auth/Login.vue","../../../src/components/auth/Login.vue?vue&type=template&id=7e1f4c0e&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.login.form.submit') }}\n </button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">\n {{ __('auth.login.socials') }}\n </div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\"\n ><svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: Function,\n default: () => {}\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email'\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password')\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: ()=>{\n if (props.loginCallback) {\n props.loginCallback();\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>","<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm schemaRowClasses=\"field\" :schema=\"schema\" :validation-schema=\"validation\" :initial-errors=\"errors\" :key=\"key\" @submit=\"onSubmit\">\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button class=\"button is-link\" type=\"submit\" v-bind:class=\"{ 'is-loading': loading }\">\n {{ __('auth.login.form.submit') }}\n </button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">\n {{ __('auth.login.socials') }}\n </div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\"\n ><svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: Function,\n default: () => {}\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email'\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password')\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: ()=>{\n if (props.loginCallback) {\n props.loginCallback();\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>"],"names":["markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","loginCallback","Function","name","components","setup","loading","ref","store","useStore","key","errors","modal","computed","getters","schema","email","component","label","__","model","password","FormPassword","validation","yup","object","shape","string","required","useSchemaForm","reset","commit","facebook","window","location","href","$ziggy","provider","google","value","dispatch","credentials","callback","error","response","data","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_createBlock","schemaRowClasses","$setup","onSubmit","afterForm","_hoisted_3","onClick","_hoisted_4","type","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_14"],"mappings":"isDAoDAA,UAAQC,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzC,CACXC,MAAO,CACHC,cAAeC,iBACN,cAEbC,KAAM,QACNC,WAAY,CACRP,WAAAA,GAEJQ,eAAML,SACIM,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,GACVI,EAASJ,MAAI,IACbK,EAAQC,YAAS,kBAAML,EAAMM,QAAQ,iBAErCC,EAASR,MAAI,CACfS,MAAO,CACHC,UAAWrB,UACXsB,MAAOC,GAAG,yBACVX,MAAO,QACPY,MAAO,SAEXC,SAAU,CACNJ,UAAWK,UACXJ,MAAOC,GAAG,+BAIZI,EAAaC,EAAIC,SAASC,MAAM,CAClCV,MAAOQ,EAAIG,SAASX,MAAMG,GAAG,0BAA0BS,SAAST,GAAG,6BACnEE,SAAUG,EAAIG,SAASC,SAAST,GAAG,+BAGjCC,EAAQb,MAAI,CACdS,MAAO,GACPK,SAAU,KAGdQ,gBAAcT,eAoDVd,QAAAA,EACAM,MAAAA,EACAG,OAAAA,EACAQ,WAAAA,EACAO,MAtDU,WACVtB,EAAMuB,OAAO,aAAc,WAsD3BC,SA/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MAAOyC,QAAMzC"}
|
|
1
|
+
{"version":3,"file":"Login.js","sources":["../../../src/components/auth/Login.vue","../../../src/components/auth/Login.vue?vue&type=template&id=67850c25&lang.js"],"sourcesContent":["<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm\n schemaRowClasses=\"field\"\n :schema=\"schema\"\n :validation-schema=\"validation\"\n :initial-errors=\"errors\"\n :key=\"key\"\n @submit=\"onSubmit\"\n >\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button\n class=\"button is-link\"\n type=\"submit\"\n v-bind:class=\"{ 'is-loading': loading }\"\n >{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: Function,\n default: () => { }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email'\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password')\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: () => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>","<template>\n <div class=\"auth-login\">\n <div v-show=\"modal == 'login'\">\n <div class=\"title\">{{ __('auth.login.title') }}</div>\n <SchemaForm\n schemaRowClasses=\"field\"\n :schema=\"schema\"\n :validation-schema=\"validation\"\n :initial-errors=\"errors\"\n :key=\"key\"\n @submit=\"onSubmit\"\n >\n <template #afterForm>\n <div class=\"href-forget-password\">\n <a @click=\"reset\">{{ __('auth.login.forget_password') }}</a>\n </div>\n <div class=\"field\">\n <button\n class=\"button is-link\"\n type=\"submit\"\n v-bind:class=\"{ 'is-loading': loading }\"\n >{{ __('auth.login.form.submit') }}</button>\n </div>\n <div class=\"socials\">\n <div class=\"description has-text-centered\">{{ __('auth.login.socials') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n <div class=\"href-register\">\n <a @click=\"register\">{{ __('auth.login.signup') }}</a>\n </div>\n </template>\n </SchemaForm>\n </div>\n\n <forget v-if=\"modal == 'forget'\" :email=\"model.email\"></forget>\n </div>\n</template>\n<script>\nimport { ref, markRaw, computed } from 'vue';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormPassword from '@perevorot/shop/dist/forms/FormPassword';\nimport * as yup from 'yup';\n\nmarkRaw(FormText);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nexport default {\n props: {\n loginCallback: Function,\n default: () => { }\n },\n name: 'login',\n components: {\n SchemaForm\n },\n setup(props) {\n const loading = ref(false);\n const store = useStore();\n const key = ref(0);\n const errors = ref({});\n const modal = computed(() => store.getters['auth/modal']);\n\n const schema = ref({\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n store: 'login',\n model: 'email'\n },\n password: {\n component: FormPassword,\n label: __('auth.login.form.password')\n }\n });\n\n const validation = yup.object().shape({\n email: yup.string().email(__('auth.validation.email')).required(__('auth.validation.required')),\n password: yup.string().required(__('auth.validation.required'))\n });\n\n const model = ref({\n email: '',\n password: ''\n });\n\n useSchemaForm(model);\n\n const reset = () => {\n store.commit('auth/modal', 'forget');\n };\n\n const register = () => {\n store.commit('auth/modal', 'registration');\n };\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const onSubmit = () => {\n loading.value = true;\n\n store.dispatch('auth/login', {\n credentials: model.value,\n callback: () => {\n if (props.loginCallback) {\n props.loginCallback();\n }\n },\n finally: () => {\n loading.value = false;\n },\n catch: (error) => {\n if (error.response.data && error.response.data.errors) {\n for (const [field, messages] of Object.entries(error.response.data.errors)) {\n if (messages[0]) {\n errors.value[field] = messages[0];\n }\n }\n\n model.value.password = '';\n\n key.value++;\n }\n }\n });\n };\n\n return {\n loading,\n modal,\n schema,\n validation,\n reset,\n facebook,\n google,\n schema,\n onSubmit,\n errors,\n key,\n model,\n register\n };\n }\n};\n</script>"],"names":["markRaw","FormText","SchemaForm","SchemaFormFactory","VeeValidatePlugin","props","loginCallback","Function","name","components","setup","loading","ref","store","useStore","key","errors","modal","computed","getters","schema","email","component","label","__","model","password","FormPassword","validation","yup","object","shape","string","required","useSchemaForm","reset","commit","facebook","window","location","href","$ziggy","provider","google","value","dispatch","credentials","callback","error","response","data","Object","entries","field","messages","_createElementVNode","_createElementBlock","_hoisted_1","_hoisted_2","_ctx","_createBlock","schemaRowClasses","$setup","onSubmit","afterForm","_hoisted_3","onClick","_hoisted_4","type","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_14"],"mappings":"isDA2DAA,UAAQC,WAER,IAAMC,EAAaC,oBAAkB,CAACC,UAAkB,QAEzC,CACXC,MAAO,CACHC,cAAeC,iBACN,cAEbC,KAAM,QACNC,WAAY,CACRP,WAAAA,GAEJQ,eAAML,SACIM,EAAUC,OAAI,GACdC,EAAQC,aACRC,EAAMH,MAAI,GACVI,EAASJ,MAAI,IACbK,EAAQC,YAAS,kBAAML,EAAMM,QAAQ,iBAErCC,EAASR,MAAI,CACfS,MAA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IC,iBAAiB,QAChBzC,OAAQ0C,6BACWA,8BACHA,SAChB/C,IAAK+C,MACLC,SAAQD,aAEEE,qBACP,kBAAAT,2BAAAU,GACIV,0BAAIW,sCAAOJ,yDAAUH,yCAEzBJ,2BAAAY,GACIZ,uDACU,+BAEwBO,aAD9BM,KAAK,4BAELT,qCAERJ,2BAAAc,GACId,2BAAAe,oBAA8CX,+BAC9CJ,2BAAAgB,GACIhB,gCAAS,SAAUW,sCAAOJ,gDAM1BP,gCAAS,SAAUW,sCAAOJ,gDAQlCP,2BAAAiB,GACIjB,0BAAIW,sCAAOJ,+DAAaH,iIAvC3BG,qBA6CCA,uBAAdF,uBAAkCvC,MAAOyC,QAAMzC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t=e.defineComponent({name:"catalog",setup:function(){var t=e.ref(null),n=[],o=function(){document.querySelectorAll("#subcategory > div").forEach((function(e){e.remove()}))},a=function(){window.scrollTo({top:0,left:0,behavior:"smooth"}),window.lazyImages&&window.lazyImages.update(),document.documentElement.classList.remove("is-catalog-loading"),
|
|
1
|
+
"use strict";var e=require("vue"),t=e.defineComponent({name:"catalog",setup:function(){var t=e.ref(null),n=[],o=function(){document.querySelectorAll("#subcategory > div").forEach((function(e){e.remove()}))},a=function(){window.scrollTo({top:0,left:0,behavior:"smooth"}),window.lazyImages&&window.lazyImages.update(),document.documentElement.classList.remove("is-catalog-loading"),i()},r=function(r,i){var c=function(e){var t=e.hash?e.hash.substring(1):"",n=e.pathname.replace(/\/$/,"");return n=t?-1!==e.pathname.indexOf(":")?n+";"+t:n+"/"+t:n,$env.shop.isTrailingSlash&&(n+="/"),e.origin+n+(e.search?e.search+"&filter":"?filter")}(r),l=function(e){return e.replace(/[^a-z0-9]/g,"")}(c);-1===n.indexOf(l)?(document.documentElement.classList.add("is-catalog-loading"),$http.get(c).then((function(c){var u=document.createElement("html");u.innerHTML=c.data.page,window.app.component(l,{template:u.querySelector("#subcategory").innerHTML}),o(),n.push(l),t.value=l,i||history.pushState({urlPath:r.href},document.title,r.href),e.nextTick(a)})).catch((function(e){console.error(e)})).finally((function(){document.documentElement.classList.remove("is-catalog-loading")}))):(o(),t.value=l,i||history.pushState({urlPath:r.href},document.title,r.href),e.nextTick(a))},i=function(){document.querySelectorAll("[shop-filter] a").forEach((function(e){e.addEventListener("click",(function(t){t.preventDefault(),r(e)}))}))},c=function(){var e=document.createElement("a");e.href=window.location.href,r(e,!0)};return window.addEventListener("DOMContentLoaded",(function(){i(),window.addEventListener("popstate",(function(){c()})),window.location.hash&&c()})),{page:t}}});t.render=function(t,n,o,a,r,i){return e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.page))},module.exports=t;
|
|
2
2
|
//# sourceMappingURL=Catalog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Catalog.js","sources":["../../../src/components/shop/Catalog.vue","../../../src/components/shop/Catalog.vue?vue&type=template&id=dc5ff766&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n const pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>","<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n const pathname = hash ? (a.pathname.indexOf(':') !== -1 ? a.pathname + ';' + hash : a.pathname + '/' + hash) : a.pathname;\n\n return a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>"],"names":["defineComponent","name","setup","page","ref","pages","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","documentElement","classList","init","get","a","ignoreHistory","href","hash","substring","pathname","indexOf","origin","search","parseFilterHref","componentName","replace","getPageName","add","$http","then","response","html","createElement","innerHTML","data","app","component","template","querySelector","push","value","history","pushState","urlPath","title","nextTick","error","console","addEventListener","e","preventDefault","refresh","location","_createBlock","_ctx"],"mappings":"oCAMeA,kBAAgB,CAC3BC,KAAM,UACNC,qBACUC,EAAOC,MAAI,MACXC,EAAQ,GAMRC,EAAiB,W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SAAQ,SAACe,GAClDA,EAAEkC,iBAAiB,SAAS,SAACC,GACzBA,EAAEC,iBAEFrC,EAAIC,UAKVqC,EAAU,eACNrC,EAAIjB,SAASmC,cAAc,KACjClB,EAAEE,KAAOb,OAAOiD,SAASpC,KAEzBH,EAAIC,GAAG,WAGXX,OAAO6C,iBAAiB,oBAAoB,WACxCpC,IAEAT,OAAO6C,iBAAiB,YAAY,WAChCG,OAGAhD,OAAOiD,SAASnC,MAChBkC,OAID,CACH1D,KAAAA,0DC5HR4D,wCAAgBC"}
|
|
1
|
+
{"version":3,"file":"Catalog.js","sources":["../../../src/components/shop/Catalog.vue","../../../src/components/shop/Catalog.vue?vue&type=template&id=e2c63aa8&lang.js"],"sourcesContent":["<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n\n let pathname = a.pathname.replace(/\\/$/, '');\n\n pathname = hash ? (a.pathname.indexOf(':') !== -1 ? pathname + ';' + hash : pathname + '/' + hash) : pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname + '/';\n }\n\n const href = a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n\n return href;\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>","<template>\n <component :is=\"page\"></component>\n</template>\n<script>\nimport { ref, defineComponent, nextTick } from 'vue';\n\nexport default defineComponent({\n name: 'catalog',\n setup() {\n const page = ref(null);\n const pages = [];\n\n const getPageName = (href) => {\n return href.replace(/[^a-z0-9]/g, '');\n };\n\n const clearContainer = () => {\n document.querySelectorAll('#subcategory > div').forEach((element) => {\n element.remove();\n });\n };\n\n const after = () => {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: 'smooth'\n });\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n\n document.documentElement.classList.remove('is-catalog-loading');\n\n init();\n };\n\n const parseFilterHref = (a) => {\n const hash = a.hash ? a.hash.substring(1) : '';\n\n let pathname = a.pathname.replace(/\\/$/, '');\n\n pathname = hash ? (a.pathname.indexOf(':') !== -1 ? pathname + ';' + hash : pathname + '/' + hash) : pathname;\n\n if ($env.shop.isTrailingSlash) {\n pathname = pathname + '/';\n }\n\n const href = a.origin + pathname + (a.search ? a.search + '&filter' : '?filter');\n\n return href;\n };\n\n const get = (a, ignoreHistory) => {\n const href = parseFilterHref(a);\n\n const componentName = getPageName(href);\n\n if (pages.indexOf(componentName) === -1) {\n document.documentElement.classList.add('is-catalog-loading');\n\n $http\n .get(href)\n .then((response) => {\n let html = document.createElement('html');\n\n html.innerHTML = response.data.page;\n\n window.app.component(componentName, {\n template: html.querySelector('#subcategory').innerHTML\n });\n\n clearContainer();\n\n pages.push(componentName);\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n })\n .catch((error) => {\n console.error(error);\n })\n .finally(() => {\n document.documentElement.classList.remove('is-catalog-loading');\n });\n } else {\n clearContainer();\n\n page.value = componentName;\n\n if (!ignoreHistory) {\n history.pushState({ urlPath: a.href }, document.title, a.href);\n }\n\n nextTick(after);\n }\n };\n\n const init = () => {\n document.querySelectorAll('[shop-filter] a').forEach((a) => {\n a.addEventListener('click', (e) => {\n e.preventDefault();\n\n get(a);\n });\n });\n };\n\n const refresh = () => {\n const a = document.createElement('a');\n a.href = window.location.href;\n\n get(a, true);\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n init();\n\n window.addEventListener('popstate', () => {\n refresh();\n });\n\n if (window.location.hash) {\n refresh();\n }\n });\n\n return {\n page\n };\n }\n});\n</script>"],"names":["defineComponent","name","setup","page","ref","pages","clearContainer","document","querySelectorAll","forEach","element","remove","after","window","scrollTo","top","left","behavior","lazyImages","update","documentElement","classList","init","get","a","ignoreHistory","href","hash","substring","pathname","replace","indexOf","$env","shop","isTrailingSlash","origin","search","parseFilterHref","componentName","getPageName","add","$http","then","response","html","createElement","innerHTML","data","app","component","template","querySelector","push","value","history","pushState","urlPath","title","nextTick","error","console","addEventListener","e","preventDefault","refresh","location","_createBlock","_ctx"],"mappings":"oCAMeA,kBAAgB,CAC3BC,KAAM,UACNC,qBACUC,EAAOC,MAAI,MACXC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D,MAAOjC,EAAEE,MAG7DgC,WAAS9C,KAIXU,EAAO,WACTf,SAASC,iBAAiB,mBAAmBC,SAAQ,SAACe,GAClDA,EAAEqC,iBAAiB,SAAS,SAACC,GACzBA,EAAEC,iBAEFxC,EAAIC,UAKVwC,EAAU,eACNxC,EAAIjB,SAASsC,cAAc,KACjCrB,EAAEE,KAAOb,OAAOoD,SAASvC,KAEzBH,EAAIC,GAAG,WAGXX,OAAOgD,iBAAiB,oBAAoB,WACxCvC,IAEAT,OAAOgD,iBAAiB,YAAY,WAChCG,OAGAnD,OAAOoD,SAAStC,MAChBqC,OAID,CACH7D,KAAAA,0DCrIR+D,wCAAgBC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),i=require("swiper
|
|
1
|
+
"use strict";var e=require("vue"),i=require("swiper");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(i),o=e.defineComponent({name:"cross",setup:function(){window.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("cross-sale"),n=e.querySelectorAll(".swiper"),o=e.querySelectorAll("li"),s=[];o.forEach((function(e,r){e.addEventListener("click",(function(){if(o.forEach((function(e){e.classList.remove("is-active")})),n.forEach((function(e){e.classList.add("is-hidden")})),n[r].classList.remove("is-hidden"),e.classList.add("is-active"),!s[r]){var c=window.crossSaleSwiperOptions?window.crossSaleSwiperOptions:{slidesPerView:5,spaceBetween:24,freeMode:{enabled:!0},mousewheel:{forceToAxis:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}};c.modules=[i.Navigation,i.Mousewheel,i.FreeMode],s[r]=new t.default(n[r],c)}s[r].slideTo(0)}))})),o[0].click()}))}});o.render=function(e,i,n,t,o,s){return null},module.exports=o;
|
|
2
2
|
//# sourceMappingURL=Cross.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cross.js","sources":["../../../src/components/shop/Cross.vue"],"sourcesContent":["<template></template>\n<script>\nimport { defineComponent } from \"vue\";\nimport
|
|
1
|
+
{"version":3,"file":"Cross.js","sources":["../../../src/components/shop/Cross.vue"],"sourcesContent":["<template></template>\n<script>\nimport { defineComponent } from \"vue\";\nimport Swiper, { Navigation, Mousewheel, FreeMode } from \"swiper\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"cross\",\n setup() {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const container = document.getElementById(\"cross-sale\");\n const sliders = container.querySelectorAll(\".swiper\");\n const tabs = container.querySelectorAll(\"li\");\n let inited = [];\n\n tabs.forEach((li, index) => {\n li.addEventListener(\"click\", () => {\n tabs.forEach((li) => {\n li.classList.remove(\"is-active\");\n });\n\n sliders.forEach((slider) => {\n slider.classList.add(\"is-hidden\");\n });\n\n sliders[index].classList.remove(\"is-hidden\");\n li.classList.add(\"is-active\");\n\n if (!inited[index]) {\n const options = window.crossSaleSwiperOptions\n ? window.crossSaleSwiperOptions\n : {\n slidesPerView: 5,\n spaceBetween: 24,\n freeMode: {\n enabled: true\n },\n mousewheel: {\n forceToAxis: true,\n },\n navigation: {\n nextEl: \".swiper-button-next\",\n prevEl: \".swiper-button-prev\",\n },\n };\n\n options.modules = [Navigation, Mousewheel, FreeMode];\n\n inited[index] = new Swiper(sliders[index], options);\n }\n\n inited[index].slideTo(0);\n });\n });\n\n tabs[0].click();\n });\n },\n});\n</script>"],"names":["defineComponent","name","setup","window","addEventListener","container","document","getElementById","sliders","querySelectorAll","tabs","inited","forEach","li","index","classList","remove","slider","add","options","crossSaleSwiperOptions","slidesPerView","spaceBetween","freeMode","enabled","mousewheel","forceToAxis","navigation","nextEl","prevEl","modules","Navigation","Mousewheel","FreeMode","Swiper","slideTo","click"],"mappings":"2IAK6BA,kBAAgB,CACzCC,KAAM,QACNC,iBACIC,OAAOC,iBAAiB,oBAAoB,eAClCC,EAAYC,SAASC,eAAe,cACpCC,EAAUH,EAAUI,iBAAiB,WACrCC,EAAOL,EAAUI,iBAAiB,MACpCE,EAAS,GAEbD,EAAKE,SAAQ,SAACC,EAAIC,GACdD,EAAGT,iBAAiB,SAAS,cACzBM,EAAKE,SAAQ,SAACC,GACVA,EAAGE,UAAUC,OAAO,gBAGxBR,EAAQI,SAAQ,SAACK,GACbA,EAAOF,UAAUG,IAAI,gBAGzBV,EAAQM,GAAOC,UAAUC,OAAO,aAChCH,EAAGE,UAAUG,IAAI,cAEZP,EAAOG,GAAQ,KACVK,EAAUhB,OAAOiB,uBACjBjB,OAAOiB,uBACP,CACEC,cAAe,EACfC,aAAc,GACdC,SAAU,CACNC,SAAS,GAEbC,WAAY,CACRC,aAAa,GAEjBC,WAAY,CACRC,OAAQ,sBACRC,OAAQ,wBAIpBV,EAAQW,QAAU,CAACC,aAAYC,aAAYC,YAE3CtB,EAAOG,GAAS,IAAIoB,UAAO1B,EAAQM,GAAQK,GAG/CR,EAAOG,GAAOqB,QAAQ,SAI9BzB,EAAK,GAAG0B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),t=require("swiper
|
|
1
|
+
"use strict";var e=require("vue"),t=require("swiper");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),i=e.defineComponent({name:"gallery",props:{thumbsDirection:{type:String,default:"horizontal"},fullscreenThumbsDirection:{type:String,default:"horizontal"},prev:{type:String,default:".swiper-button-prev"},next:{type:String,default:".swiper-button-next"},thumbPrev:{type:String,default:".swiper-button-prev"},thumbNext:{type:String,default:".swiper-button-next"},fullscreen:{type:Boolean,default:!1},isResizeThumbs:{type:Boolean,default:!1},thumbsSpaceBetween:{type:Number,default:10}},setup:function(n){var i,u,r,l,s,a=e.ref(!1),d=function(){document.body.classList.remove("product-gallery-modal-open"),a.value=!1,p("close"),n.isResizeThumbs&&m()},c=function(){document.body.classList.add("product-gallery-modal-open"),a.value=!0,p("open")},p=function(e){u&&(n.thumbsDirection!=n.fullscreenThumbsDirection?l.changeDirection("open"==e?n.fullscreenThumbsDirection:n.thumbsDirection):l.update()),s.update()};window.addEventListener("keyup",(function(e){a.value&&"Escape"===e.key&&d()}));var m=function(){u.style.height=parseInt(r.offsetHeight)+"px",l.update()},f=function(){clearTimeout(i),i=setTimeout((function(){m()}),500)};return document.addEventListener("DOMContentLoaded",(function(){if(u=document.getElementById("product-gallery-thumbs"),r=document.getElementById("product-gallery"),u&&(l=new o.default(u,{spaceBetween:n.thumbsSpaceBetween,slidesPerView:"auto",mousewheel:{forceToAxis:!0},freeMode:{enabled:!0},watchSlidesVisibility:!0,watchSlidesProgress:!0,direction:n.thumbsDirection,navigation:{nextEl:n.thumbNext,prevEl:n.thumbPrev},modules:[t.Navigation,t.Mousewheel,t.FreeMode,t.Thumbs]}),n.isResizeThumbs&&(window.addEventListener("resize",f),m()),u.classList.remove("not-inited")),n.fullscreen&&r.addEventListener("click",c),r){var e={spaceBetween:10,mousewheel:{forceToAxis:!0},centeredSlides:!0,navigation:{nextEl:n.next,prevEl:n.prev}};l&&(e.thumbs={swiper:l}),e.modules=[t.Navigation,t.Mousewheel,t.FreeMode,t.Thumbs],s=new o.default(r,e)}p("close")}),!1),{modal:a,close:d}}});i.render=function(t,n,o,i,u,r){return t.fullscreen?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["delete is-large",{"is-hidden":!t.modal}]),onClick:n[0]||(n[0]=function(){return t.close&&t.close.apply(t,arguments)})},null,2)):e.createCommentVNode("v-if",!0)},module.exports=i;
|
|
2
2
|
//# sourceMappingURL=Gallery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gallery.js","sources":["../../../src/components/shop/Gallery.vue","../../../src/components/shop/Gallery.vue?vue&type=template&id=09dbf38c&lang.js"],"sourcesContent":["<template>\n <button\n class=\"delete is-large\"\n @click=\"close\"\n v-if=\"fullscreen\"\n v-bind:class=\"{ 'is-hidden': !modal }\"\n ></button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport SwiperCore, { Navigation, Mousewheel, Thumbs } from \"swiper/core\";\n\nSwiperCore.use([Navigation, Mousewheel, Thumbs]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"gallery\",\n props: {\n thumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n fullscreenThumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n fullscreen: {\n type: Boolean,\n default: false,\n },\n isResizeThumbs: {\n type: Boolean,\n default: false,\n },\n thumbsSpaceBetween: {\n type: Number,\n default: 10,\n },\n },\n setup(props) {\n const modal = ref(false);\n let resizeTimeout;\n let thumbs;\n let slider;\n let thumbsSwiper;\n let sliderSwiper;\n\n const close = () => {\n document.body.classList.remove(\"product-gallery-modal-open\");\n modal.value = false;\n\n update(\"close\");\n\n if (props.isResizeThumbs) {\n resizeThumbsSwiper();\n }\n };\n\n const open = () => {\n document.body.classList.add(\"product-gallery-modal-open\");\n modal.value = true;\n\n update(\"open\");\n };\n\n const update = (action) => {\n if (thumbs) {\n if (props.thumbsDirection != props.fullscreenThumbsDirection) {\n thumbsSwiper.changeDirection(\n action == \"open\"\n ? props.fullscreenThumbsDirection\n : props.thumbsDirection\n );\n } else {\n thumbsSwiper.update();\n }\n }\n\n sliderSwiper.update();\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n close();\n }\n });\n\n const resizeThumbsSwiper = () => {\n thumbs.style.height = parseInt(slider.offsetHeight) + \"px\";\n thumbsSwiper.update();\n };\n\n const resizeBounced = () => {\n clearTimeout(resizeTimeout);\n\n resizeTimeout = setTimeout(() => {\n resizeThumbsSwiper();\n }, 500);\n };\n\n const init = () => {\n thumbs = document.getElementById(\"product-gallery-thumbs\");\n slider = document.getElementById(\"product-gallery\");\n\n if (thumbs) {\n thumbsSwiper = new SwiperCore(thumbs, {\n spaceBetween: props.thumbsSpaceBetween,\n slidesPerView: \"auto\",\n mousewheel: {\n forceToAxis: true,\n },\n freeMode: true,\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n direction: props.thumbsDirection,\n navigation: {\n nextEl: props.thumbNext,\n prevEl: props.thumbPrev,\n },\n });\n\n if (props.isResizeThumbs) {\n window.addEventListener(\"resize\", resizeBounced);\n resizeThumbsSwiper();\n }\n\n thumbs.classList.remove(\"not-inited\");\n }\n\n if (props.fullscreen) {\n slider.addEventListener(\"click\", open);\n }\n\n if (slider) {\n let options = {\n spaceBetween: 10,\n mousewheel: {\n forceToAxis: true,\n },\n centeredSlides: true,\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n };\n\n if (thumbsSwiper) {\n options.thumbs = {\n swiper: thumbsSwiper,\n };\n }\n\n sliderSwiper = new SwiperCore(slider, options);\n }\n\n update(\"close\");\n };\n\n document.addEventListener(\"DOMContentLoaded\", init, false);\n\n return {\n modal,\n close,\n };\n },\n});\n</script>","<template>\n <button\n class=\"delete is-large\"\n @click=\"close\"\n v-if=\"fullscreen\"\n v-bind:class=\"{ 'is-hidden': !modal }\"\n ></button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport SwiperCore, { Navigation, Mousewheel, Thumbs } from \"swiper/core\";\n\nSwiperCore.use([Navigation, Mousewheel, Thumbs]);\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"gallery\",\n props: {\n thumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n fullscreenThumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n fullscreen: {\n type: Boolean,\n default: false,\n },\n isResizeThumbs: {\n type: Boolean,\n default: false,\n },\n thumbsSpaceBetween: {\n type: Number,\n default: 10,\n },\n },\n setup(props) {\n const modal = ref(false);\n let resizeTimeout;\n let thumbs;\n let slider;\n let thumbsSwiper;\n let sliderSwiper;\n\n const close = () => {\n document.body.classList.remove(\"product-gallery-modal-open\");\n modal.value = false;\n\n update(\"close\");\n\n if (props.isResizeThumbs) {\n resizeThumbsSwiper();\n }\n };\n\n const open = () => {\n document.body.classList.add(\"product-gallery-modal-open\");\n modal.value = true;\n\n update(\"open\");\n };\n\n const update = (action) => {\n if (thumbs) {\n if (props.thumbsDirection != props.fullscreenThumbsDirection) {\n thumbsSwiper.changeDirection(\n action == \"open\"\n ? props.fullscreenThumbsDirection\n : props.thumbsDirection\n );\n } else {\n thumbsSwiper.update();\n }\n }\n\n sliderSwiper.update();\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n close();\n }\n });\n\n const resizeThumbsSwiper = () => {\n thumbs.style.height = parseInt(slider.offsetHeight) + \"px\";\n thumbsSwiper.update();\n };\n\n const resizeBounced = () => {\n clearTimeout(resizeTimeout);\n\n resizeTimeout = setTimeout(() => {\n resizeThumbsSwiper();\n }, 500);\n };\n\n const init = () => {\n thumbs = document.getElementById(\"product-gallery-thumbs\");\n slider = document.getElementById(\"product-gallery\");\n\n if (thumbs) {\n thumbsSwiper = new SwiperCore(thumbs, {\n spaceBetween: props.thumbsSpaceBetween,\n slidesPerView: \"auto\",\n mousewheel: {\n forceToAxis: true,\n },\n freeMode: true,\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n direction: props.thumbsDirection,\n navigation: {\n nextEl: props.thumbNext,\n prevEl: props.thumbPrev,\n },\n });\n\n if (props.isResizeThumbs) {\n window.addEventListener(\"resize\", resizeBounced);\n resizeThumbsSwiper();\n }\n\n thumbs.classList.remove(\"not-inited\");\n }\n\n if (props.fullscreen) {\n slider.addEventListener(\"click\", open);\n }\n\n if (slider) {\n let options = {\n spaceBetween: 10,\n mousewheel: {\n forceToAxis: true,\n },\n centeredSlides: true,\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n };\n\n if (thumbsSwiper) {\n options.thumbs = {\n swiper: thumbsSwiper,\n };\n }\n\n sliderSwiper = new SwiperCore(slider, options);\n }\n\n update(\"close\");\n };\n\n document.addEventListener(\"DOMContentLoaded\", init, false);\n\n return {\n modal,\n close,\n };\n },\n});\n</script>"],"names":["SwiperCore","use","Navigation","Mousewheel","Thumbs","defineComponent","name","props","thumbsDirection","type","String","fullscreenThumbsDirection","prev","next","thumbPrev","thumbNext","fullscreen","Boolean","isResizeThumbs","thumbsSpaceBetween","Number","setup","resizeTimeout","thumbs","slider","thumbsSwiper","sliderSwiper","modal","ref","close","document","body","classList","remove","value","update","resizeThumbsSwiper","open","add","action","changeDirection","window","addEventListener","e","key","style","height","parseInt","offsetHeight","resizeBounced","clearTimeout","setTimeout","getElementById","spaceBetween","slidesPerView","mousewheel","forceToAxis","freeMode","watchSlidesVisibility","watchSlidesProgress","direction","navigation","nextEl","prevEl","options","centeredSlides","swiper","_ctx","_createElementBlock","onClick"],"mappings":"8IAYAA,UAAWC,IAAI,CAACC,aAAYC,aAAYC,WAExC,MAA6BC,kBAAgB,CACzCC,KAAM,UACNC,MAAO,CACHC,gBAAiB,CACbC,KAAMC,eACG,cAEbC,0BAA2B,CACvBF,KAAMC,eACG,cAEbE,KAAM,CACFH,KAAMC,eACG,uBAEbG,KAAM,CACFJ,KAAMC,eACG,uBAEbI,UAAW,CACPL,KAAMC,eACG,uBAEbK,UAAW,CACPN,KAAMC,eACG,uBAEbM,WAAY,CACRP,KAAMQ,iBACG,GAEbC,eAAgB,CACZT,KAAMQ,iBACG,GAEbE,mBAAoB,CAChBV,KAAMW,eACG,KAGjBC,eAAMd,OAEEe,EACAC,EACAC,EACAC,EACAC,EALEC,EAAQC,OAAI,GAOZC,EAAQ,WACVC,SAASC,KAAKC,UAAUC,OAAO,8BAC/BN,EAAMO,OAAQ,EAEdC,EAAO,SAEH5B,EAAMW,gBACNkB,KAIFC,EAAO,WAC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AOF"}
|
|
1
|
+
{"version":3,"file":"Gallery.js","sources":["../../../src/components/shop/Gallery.vue","../../../src/components/shop/Gallery.vue?vue&type=template&id=6658f808&lang.js"],"sourcesContent":["<template>\n <button\n class=\"delete is-large\"\n @click=\"close\"\n v-if=\"fullscreen\"\n v-bind:class=\"{ 'is-hidden': !modal }\"\n ></button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport Swiper, { Navigation, Mousewheel, Thumbs, FreeMode } from \"swiper\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"gallery\",\n props: {\n thumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n fullscreenThumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n fullscreen: {\n type: Boolean,\n default: false,\n },\n isResizeThumbs: {\n type: Boolean,\n default: false,\n },\n thumbsSpaceBetween: {\n type: Number,\n default: 10,\n },\n },\n setup(props) {\n const modal = ref(false);\n let resizeTimeout;\n let thumbs;\n let slider;\n let thumbsSwiper;\n let sliderSwiper;\n\n const close = () => {\n document.body.classList.remove(\"product-gallery-modal-open\");\n modal.value = false;\n\n update(\"close\");\n\n if (props.isResizeThumbs) {\n resizeThumbsSwiper();\n }\n };\n\n const open = () => {\n document.body.classList.add(\"product-gallery-modal-open\");\n modal.value = true;\n\n update(\"open\");\n };\n\n const update = (action) => {\n if (thumbs) {\n if (props.thumbsDirection != props.fullscreenThumbsDirection) {\n thumbsSwiper.changeDirection(\n action == \"open\"\n ? props.fullscreenThumbsDirection\n : props.thumbsDirection\n );\n } else {\n thumbsSwiper.update();\n }\n }\n\n sliderSwiper.update();\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n close();\n }\n });\n\n const resizeThumbsSwiper = () => {\n thumbs.style.height = parseInt(slider.offsetHeight) + \"px\";\n thumbsSwiper.update();\n };\n\n const resizeBounced = () => {\n clearTimeout(resizeTimeout);\n\n resizeTimeout = setTimeout(() => {\n resizeThumbsSwiper();\n }, 500);\n };\n\n const init = () => {\n thumbs = document.getElementById(\"product-gallery-thumbs\");\n slider = document.getElementById(\"product-gallery\");\n\n if (thumbs) {\n thumbsSwiper = new Swiper(thumbs, {\n spaceBetween: props.thumbsSpaceBetween,\n slidesPerView: \"auto\",\n mousewheel: {\n forceToAxis: true,\n },\n freeMode: {\n enabled: true\n },\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n direction: props.thumbsDirection,\n navigation: {\n nextEl: props.thumbNext,\n prevEl: props.thumbPrev,\n },\n modules: [Navigation, Mousewheel, FreeMode, Thumbs]\n });\n\n if (props.isResizeThumbs) {\n window.addEventListener(\"resize\", resizeBounced);\n resizeThumbsSwiper();\n }\n\n thumbs.classList.remove(\"not-inited\");\n }\n\n if (props.fullscreen) {\n slider.addEventListener(\"click\", open);\n }\n\n if (slider) {\n let options = {\n spaceBetween: 10,\n mousewheel: {\n forceToAxis: true,\n },\n centeredSlides: true,\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n };\n\n if (thumbsSwiper) {\n options.thumbs = {\n swiper: thumbsSwiper,\n };\n }\n\n options.modules = [Navigation, Mousewheel, FreeMode, Thumbs];\n\n sliderSwiper = new Swiper(slider, options);\n }\n\n update(\"close\");\n };\n\n document.addEventListener(\"DOMContentLoaded\", init, false);\n\n return {\n modal,\n close,\n };\n },\n});\n</script>","<template>\n <button\n class=\"delete is-large\"\n @click=\"close\"\n v-if=\"fullscreen\"\n v-bind:class=\"{ 'is-hidden': !modal }\"\n ></button>\n</template>\n<script>\nimport { ref, defineComponent } from \"vue\";\nimport Swiper, { Navigation, Mousewheel, Thumbs, FreeMode } from \"swiper\";\n\nexport default /*#__PURE__*/ defineComponent({\n name: \"gallery\",\n props: {\n thumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n fullscreenThumbsDirection: {\n type: String,\n default: \"horizontal\",\n },\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n fullscreen: {\n type: Boolean,\n default: false,\n },\n isResizeThumbs: {\n type: Boolean,\n default: false,\n },\n thumbsSpaceBetween: {\n type: Number,\n default: 10,\n },\n },\n setup(props) {\n const modal = ref(false);\n let resizeTimeout;\n let thumbs;\n let slider;\n let thumbsSwiper;\n let sliderSwiper;\n\n const close = () => {\n document.body.classList.remove(\"product-gallery-modal-open\");\n modal.value = false;\n\n update(\"close\");\n\n if (props.isResizeThumbs) {\n resizeThumbsSwiper();\n }\n };\n\n const open = () => {\n document.body.classList.add(\"product-gallery-modal-open\");\n modal.value = true;\n\n update(\"open\");\n };\n\n const update = (action) => {\n if (thumbs) {\n if (props.thumbsDirection != props.fullscreenThumbsDirection) {\n thumbsSwiper.changeDirection(\n action == \"open\"\n ? props.fullscreenThumbsDirection\n : props.thumbsDirection\n );\n } else {\n thumbsSwiper.update();\n }\n }\n\n sliderSwiper.update();\n };\n\n window.addEventListener(\"keyup\", (e) => {\n if (modal.value && e.key === \"Escape\") {\n close();\n }\n });\n\n const resizeThumbsSwiper = () => {\n thumbs.style.height = parseInt(slider.offsetHeight) + \"px\";\n thumbsSwiper.update();\n };\n\n const resizeBounced = () => {\n clearTimeout(resizeTimeout);\n\n resizeTimeout = setTimeout(() => {\n resizeThumbsSwiper();\n }, 500);\n };\n\n const init = () => {\n thumbs = document.getElementById(\"product-gallery-thumbs\");\n slider = document.getElementById(\"product-gallery\");\n\n if (thumbs) {\n thumbsSwiper = new Swiper(thumbs, {\n spaceBetween: props.thumbsSpaceBetween,\n slidesPerView: \"auto\",\n mousewheel: {\n forceToAxis: true,\n },\n freeMode: {\n enabled: true\n },\n watchSlidesVisibility: true,\n watchSlidesProgress: true,\n direction: props.thumbsDirection,\n navigation: {\n nextEl: props.thumbNext,\n prevEl: props.thumbPrev,\n },\n modules: [Navigation, Mousewheel, FreeMode, Thumbs]\n });\n\n if (props.isResizeThumbs) {\n window.addEventListener(\"resize\", resizeBounced);\n resizeThumbsSwiper();\n }\n\n thumbs.classList.remove(\"not-inited\");\n }\n\n if (props.fullscreen) {\n slider.addEventListener(\"click\", open);\n }\n\n if (slider) {\n let options = {\n spaceBetween: 10,\n mousewheel: {\n forceToAxis: true,\n },\n centeredSlides: true,\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n };\n\n if (thumbsSwiper) {\n options.thumbs = {\n swiper: thumbsSwiper,\n };\n }\n\n options.modules = [Navigation, Mousewheel, FreeMode, Thumbs];\n\n sliderSwiper = new Swiper(slider, options);\n }\n\n update(\"close\");\n };\n\n document.addEventListener(\"DOMContentLoaded\", init, false);\n\n return {\n modal,\n close,\n };\n },\n});\n</script>"],"names":["defineComponent","name","props","thumbsDirection","type","String","fullscreenThumbsDirection","prev","next","thumbPrev","thumbNext","fullscreen","Boolean","isResizeThumbs","thumbsSpaceBetween","Number","setup","resizeTimeout","thumbs","slider","thumbsSwiper","sliderSwiper","modal","ref","close","document","body","classList","remove","value","update","resizeThumbsSwiper","open","add","action","changeDirection","window","addEventListener","e","key","style","height","parseInt","offsetHeight","resizeBounced","clearTimeout","setTimeout","getElementById","Swiper","spaceBetween","slidesPerView","mousewheel","forceToAxis","freeMode","enabled","watchSlidesVisibility","watchSlidesProgress","direction","navigation","nextEl","prevEl","modules","Navigation","Mousewheel","FreeMode","Thumbs","options","centeredSlides","swiper","_ctx","_createElementBlock","onClick"],"mappings":"2IAY6BA,kBAAgB,CACzCC,KAAM,UACNC,MAAO,CACHC,gBAAiB,CACbC,KAAMC,eACG,cAEbC,0BAA2B,CACvBF,KAAMC,eACG,cAEbE,KAAM,CACFH,KAAMC,eACG,uBAEbG,KAAM,CACFJ,KAAMC,e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iB,SAAUO,GAClCb,KAGJb,EAAOS,UAAUC,OAAO,eAGxB1B,EAAMS,YACNQ,EAAOkB,iBAAiB,QAASL,GAGjCb,EAAQ,KACJ+C,EAAU,CACVjB,aAAc,GACdE,WAAY,CACRC,aAAa,GAEjBe,gBAAgB,EAChBT,WAAY,CACRC,OAAQzD,EAAMM,KACdoD,OAAQ1D,EAAMK,OAIlBa,IACA8C,EAAQhD,OAAS,CACbkD,OAAQhD,IAIhB8C,EAAQL,QAAU,CAACC,aAAYC,aAAYC,WAAUC,UAErD5C,EAAe,IAAI2B,UAAO7B,EAAQ+C,GAGtCpC,EAAO,YAGyC,GAE7C,CACHR,MAAAA,EACAE,MAAAA,4CChLE6C,4BAHVC,6DACU,gCAGwBD,WAF7BE,sCAAOF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("vue"),i=require("swiper
|
|
1
|
+
"use strict";var e=require("vue"),i=require("swiper");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=t(i),d=e.defineComponent({props:{id:Number},setup:function(t){var d=!1,n=e.ref(!1),r=e.ref(null),a=e.ref(null),o=function(e){e.forEach((function(e){e.isIntersecting&&(d||(d=!0,c()))}))},c=function(){$http.post($ziggy("api.piece",{slug:"promo-products"}),{id:t.id}).then((function(d){var o="piece-promo-products-"+t.id;window.app.component(o,{template:d.data?d.data:"<i></i>"}),a.value=o,n.value=!0,e.nextTick((function(){var e=r.value.querySelectorAll(".is-faded-tabs");e.length&&e.forEach((function(e){new s.default(e.querySelector(".swiper"),{slidesPerView:"auto",freeMode:{enabled:!0},modules:[i.Navigation,i.Mousewheel,i.FreeMode]})}));var t=r.value.querySelectorAll(".is-faded-tabs .swiper-slide"),d=r.value.querySelectorAll("[products-slider]");t.forEach((function(e,i){e.addEventListener("click",(function(){t.forEach((function(e){e.classList.remove("is-active")})),d.forEach((function(e){e.classList.add("is-hidden")})),d[i].classList.remove("is-hidden"),e.classList.add("is-active")}))})),d.length&&d.forEach((function(e){new s.default(e,window.viewedSwiperOptions)})),window.lazyImages&&window.lazyImages.update()}))}))};return window.addEventListener("DOMContentLoaded",(function(){new IntersectionObserver(o,{threshold:.1}).observe(r.value)})),{container:r,component:a,loaded:n}}}),n={ref:"container"},r={key:0,class:"product-promo-block container is-fluid is-skeleton"},a=e.createStaticVNode('<div class="gradient"></div><div class="title slider-title"> </div><div class="is-faded-tabs"><div class="is-flex"><div class="swiper-slide"> </div><div class="swiper-slide"> </div></div></div>',3),o={class:"swiper"},c={class:"swiper-wrapper products is-slider"},l=[e.createStaticVNode('<div class="border"><div class="wrapper"><picture class="is-lazy-loaded"><img class="lazy entered loaded" src="/images/blank.png"></picture><div class="availability"> </div><div class="title"> </div><div class="prices"><div class="price"></div></div></div></div>',1)];d.render=function(i,t,s,d,u,v){return e.openBlock(),e.createElementBlock("div",n,[i.loaded?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.component),{key:1})):(e.openBlock(),e.createElementBlock("section",r,[a,e.createElementVNode("div",o,[e.createElementVNode("div",c,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,(function(i){return e.createElementVNode("div",{class:"product",key:i},l)})),64))])])]))],512)},module.exports=d;
|
|
2
2
|
//# sourceMappingURL=PromoProducts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromoProducts.js","sources":["../../../src/components/shop/PromoProducts.vue","../../../src/components/shop/PromoProducts.vue?vue&type=template&id=6be3a2bf&lang.js"],"sourcesContent":["<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\"> </div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\"> </div>\n <div class=\"swiper-slide\"> </div>\n </div>\n </div>\n <div class=\"swiper-container\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\"> </div>\n <div class=\"title\"> </div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport SwiperCore, { Navigation, Mousewheel } from 'swiper/core';\n\nSwiperCore.use([Navigation, Mousewheel]);\n\nexport default defineComponent({\n props: {\n id: Number\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: 'promo-products' }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new SwiperCore(tab.querySelector('.swiper-container'), {\n slidesPerView: 'auto',\n freeMode: true\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new SwiperCore(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n","<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\"> </div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\"> </div>\n <div class=\"swiper-slide\"> </div>\n </div>\n </div>\n <div class=\"swiper-container\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\"> </div>\n <div class=\"title\"> </div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport SwiperCore, { Navigation, Mousewheel } from 'swiper/core';\n\nSwiperCore.use([Navigation, Mousewheel]);\n\nexport default defineComponent({\n props: {\n id: Number\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: 'promo-products' }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new SwiperCore(tab.querySelector('.swiper-container'), {\n slidesPerView: 'auto',\n freeMode: true\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new SwiperCore(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n"],"names":["SwiperCore","use","Navigation","Mousewheel","defineComponent","props","id","Number","setup","inited","loaded","ref","container","component","callback","entries","forEach","entry","isIntersecting","load","$http","post","$ziggy","slug","then","response","componentName","window","app","template","data","value","nextTick","fadedTabs","querySelectorAll","length","tab","querySelector","slidesPerView","freeMode","tabs","sliders","index","addEventListener","classList","remove","slider","add","viewedSwiperOptions","lazyImages","update","IntersectionObserver","threshold","observe","_createElementBlock","_hoisted_1","_ctx","_createBlock","_hoisted_2","_hoisted_3","_createElementVNode","_hoisted_6","_hoisted_7","key"],"mappings":"8IAqCAA,UAAWC,IAAI,CAACC,aAAYC,eAE5B,MAAeC,kBAAgB,CAC3BC,MAAO,CACHC,GAAIC,QAERC,eAAMH,OACEI,GAAS,EAEPC,EAASC,OAAI,GACbC,EAAYD,MAAI,MAChBE,EAAYF,MAAI,MAEhBG,EAAW,SAACC,GACdA,EAAQC,SAAQ,SAACC,GACTA,EAAMC,iBACDT,IACDA,GAAS,EAETU,UAMVA,EAAO,WACTC,MACKC,KAAKC,OAAO,YAAa,CAAEC,KAAM,mBAAqB,CACnDjB,GAAID,EAAMC,KAEbkB,MAAK,SAACC,OACGC,EAAgB,wBAA0BrB,EAAMC,GAEtDqB,OAAOC,IAAIf,UAAUa,EAAe,CAChCG,SAAUJ,EAASK,KAAOL,EAASK,KAAO,YAG9CjB,EAAUkB,MAAQL,EAClBhB,EAAOqB,OAAQ,EAEfC,YAAS,eACCC,EAAYrB,EAAUmB,MAAMG,iBAAiB,kBAE/CD,EAAUE,QACVF,EAAUjB,SAAQ,SAACoB,OACXpC,UAAWoC,EAAIC,cAAc,qBAAsB,CACnDC,cAAe,OACfC,UAAU,WAKhBC,EAAO5B,EAAUmB,MAAMG,iBAAiB,gCACxCO,EAAU7B,EAAUmB,MAAMG,iBAAiB,qBAEjDM,EAAKxB,SAAQ,SAACoB,EAAKM,GACfN,EAAIO,iBAAiB,SAAS,WAC1BH,EAAKxB,SAAQ,SAACoB,GACVA,EAAIQ,UAAUC,OAAO,gBAGzBJ,EAAQzB,SAAQ,SAAC8B,GACbA,EAAOF,UAAUG,IAAI,gBAGzBN,EAAQC,GAAOE,UAAUC,OAAO,aAChCT,EAAIQ,UAAUG,IAAI,mBAItBN,EAAQN,QACRM,EAAQzB,SAAQ,SAAC8B,OACT9C,UAAW8C,EAAQnB,OAAOqB,wBAIlCrB,OAAOsB,YACPtB,OAAOsB,WAAWC,uBAMtCvB,OAAOgB,iBAAiB,oBAAoB,eACpCQ,qBAAqBrC,EAAU,CAC/BsC,UAAW,KACZC,QAAQzC,EAAUmB,UAGlB,CACHnB,UAAAA,EACAC,UAAAA,EACAH,OAAAA,SChIHC,IAAI,4BACU,4RASA,6BACI,6XAXvB2C,2BAAAC,GAC+EC,wBA4B3EC,wCAAgBD,sCA5BhBF,+BAAAI,GACIC,EAQAC,2BAAAC,GACID,2BAAAE,kBACIR,kDAAqC,YAATZ,UAA5BkB,kCAAW,UAA8BG,IAAKrB"}
|
|
1
|
+
{"version":3,"file":"PromoProducts.js","sources":["../../../src/components/shop/PromoProducts.vue","../../../src/components/shop/PromoProducts.vue?vue&type=template&id=3398114c&lang.js"],"sourcesContent":["<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\"> </div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\"> </div>\n <div class=\"swiper-slide\"> </div>\n </div>\n </div>\n <div class=\"swiper\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\"> </div>\n <div class=\"title\"> </div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport Swiper, { Navigation, Mousewheel, FreeMode } from 'swiper';\n\nexport default defineComponent({\n props: {\n id: Number\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: 'promo-products' }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new Swiper(tab.querySelector('.swiper'), {\n slidesPerView: 'auto',\n freeMode: {\n enabled: true\n },\n modules: [Navigation, Mousewheel, FreeMode]\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new Swiper(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n","<template>\n <div ref=\"container\">\n <section class=\"product-promo-block container is-fluid is-skeleton\" v-if=\"!loaded\">\n <div class=\"gradient\"></div>\n <div class=\"title slider-title\"> </div>\n <div class=\"is-faded-tabs\">\n <div class=\"is-flex\">\n <div class=\"swiper-slide\"> </div>\n <div class=\"swiper-slide\"> </div>\n </div>\n </div>\n <div class=\"swiper\">\n <div class=\"swiper-wrapper products is-slider\">\n <div class=\"product\" v-for=\"index in 5\" :key=\"index\">\n <div class=\"border\">\n <div class=\"wrapper\">\n <picture class=\"is-lazy-loaded\">\n <img class=\"lazy entered loaded\" src=\"/images/blank.png\" />\n </picture>\n <div class=\"availability\"> </div>\n <div class=\"title\"> </div>\n <div class=\"prices\">\n <div class=\"price\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </section>\n <component :is=\"component\" v-else></component>\n </div>\n</template>\n<script>\nimport { ref, nextTick, defineComponent } from 'vue';\nimport Swiper, { Navigation, Mousewheel, FreeMode } from 'swiper';\n\nexport default defineComponent({\n props: {\n id: Number\n },\n setup(props) {\n let inited = false;\n\n const loaded = ref(false);\n const container = ref(null);\n const component = ref(null);\n\n const callback = (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!inited) {\n inited = true;\n\n load();\n }\n }\n });\n };\n\n const load = () => {\n $http\n .post($ziggy('api.piece', { slug: 'promo-products' }), {\n id: props.id\n })\n .then((response) => {\n const componentName = 'piece-promo-products-' + props.id;\n\n window.app.component(componentName, {\n template: response.data ? response.data : '<i></i>'\n });\n\n component.value = componentName;\n loaded.value = true;\n\n nextTick(() => {\n const fadedTabs = container.value.querySelectorAll('.is-faded-tabs');\n\n if (fadedTabs.length) {\n fadedTabs.forEach((tab) => {\n new Swiper(tab.querySelector('.swiper'), {\n slidesPerView: 'auto',\n freeMode: {\n enabled: true\n },\n modules: [Navigation, Mousewheel, FreeMode]\n });\n });\n }\n\n const tabs = container.value.querySelectorAll('.is-faded-tabs .swiper-slide');\n const sliders = container.value.querySelectorAll('[products-slider]');\n\n tabs.forEach((tab, index) => {\n tab.addEventListener('click', () => {\n tabs.forEach((tab) => {\n tab.classList.remove('is-active');\n });\n\n sliders.forEach((slider) => {\n slider.classList.add('is-hidden');\n });\n\n sliders[index].classList.remove('is-hidden');\n tab.classList.add('is-active');\n });\n });\n\n if (sliders.length) {\n sliders.forEach((slider) => {\n new Swiper(slider, window.viewedSwiperOptions);\n });\n }\n\n if (window.lazyImages) {\n window.lazyImages.update();\n }\n });\n });\n };\n\n window.addEventListener('DOMContentLoaded', () => {\n new IntersectionObserver(callback, {\n threshold: 0.1\n }).observe(container.value);\n });\n\n return {\n container,\n component,\n loaded\n };\n }\n});\n</script>\n"],"names":["defineComponent","props","id","Number","setup","inited","loaded","ref","container","component","callback","entries","forEach","entry","isIntersecting","load","$http","post","$ziggy","slug","then","response","componentName","window","app","template","data","value","nextTick","fadedTabs","querySelectorAll","length","tab","Swiper","querySelector","slidesPerView","freeMode","enabled","modules","Navigation","Mousewheel","FreeMode","tabs","sliders","index","addEventListener","classList","remove","slider","add","viewedSwiperOptions","lazyImages","update","IntersectionObserver","threshold","observe","_createElementBlock","_hoisted_1","_ctx","_createBlock","_hoisted_2","_hoisted_3","_createElementVNode","_ho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4C,UAAW,KACZC,QAAQ/C,EAAUmB,UAGlB,CACHnB,UAAAA,EACAC,UAAAA,EACAH,OAAAA,SCjIHC,IAAI,4BACU,4RASA,mBACI,6XAXvBiD,2BAAAC,GAC+EC,wBA4B3EC,wCAAgBD,sCA5BhBF,+BAAAI,GACIC,EAQAC,2BAAAC,GACID,2BAAAE,kBACIR,kDAAqC,YAATZ,UAA5BkB,kCAAW,UAA8BG,IAAKrB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("swiper
|
|
1
|
+
"use strict";var e=require("swiper"),n=require("countdown.to");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=t(e),r=t(n),o={name:"bundle",props:{prev:{type:String,default:".swiper-button-prev"},next:{type:String,default:".swiper-button-next"},thumbPrev:{type:String,default:".swiper-button-prev"},thumbNext:{type:String,default:".swiper-button-next"}},setup:function(n){var t=function(e,n){return e+" "+n[e%100>4&&e%100<20?2:[2,0,1,1,1,2][Math.min(e%10,5)]]};window.addEventListener("DOMContentLoaded",(function(){var o=document.getElementById("bundles-root");new i.default(o,{slidesPerView:1,spaceBetween:24,allowTouchMove:!1,mousewheel:{forceToAxis:!0},navigation:{nextEl:n.next,prevEl:n.prev},modules:[e.Navigation,e.Pagination]}),o.querySelectorAll("#bundles-root > .swiper-wrapper > .swiper-slide").forEach((function(o,a){var u=[],l=[],s=o.querySelectorAll(".bundle-info"),d=o.querySelectorAll(".bundles-subproduct");if(o.dataset.finish){var c=o.querySelector(".countdown");new r.default(o.dataset.finish,{onCalculateRemainingTime:function(){var e=this.timeRemaining[1],n=this.timeRemaining[2];if(e>0)c.innerHTML=t(e,__("shop.pluralize.monthes"));else if(n>0)c.innerHTML=t(n,__("shop.pluralize.days"));else{var i=this.timeRemaining[3],r=this.timeRemaining[4],o=this.timeRemaining[5];c.innerHTML=i+":"+r+":"+o}}})}d.forEach((function(t,r){var o=t.querySelector(n.thumbNext),d=t.querySelector(n.thumbPrev),c=t.querySelector(".swiper-pagination");u[r]=0,c&&(l[r]=new i.default(t.querySelector(".swiper"),{modules:[e.Navigation,e.Pagination],slidesPerView:1,spaceBetween:24,navigation:{nextEl:o,prevEl:d},pagination:{el:c,clickable:!0},on:{slideChange:function(e){u[r]=e.activeIndex,s.forEach((function(e){e.classList.add("is-hidden")}));var n="bundle"+a+"-info-"+u.join("-");document.getElementById(n).classList.remove("is-hidden")}}}))}))}))}))}};o.render=function(e,n,t,i,r,o){return null},module.exports=o;
|
|
2
2
|
//# sourceMappingURL=Bundle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bundle.js","sources":["../../../../src/components/shop/bundle/Bundle.vue"],"sourcesContent":["<template></template>\n<script>\nimport
|
|
1
|
+
{"version":3,"file":"Bundle.js","sources":["../../../../src/components/shop/bundle/Bundle.vue"],"sourcesContent":["<template></template>\n<script>\nimport Swiper, { Navigation, Pagination } from \"swiper\";\nimport countdown from \"countdown.to\";\n\nexport default {\n name: \"bundle\",\n props: {\n prev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n next: {\n type: String,\n default: \".swiper-button-next\",\n },\n thumbPrev: {\n type: String,\n default: \".swiper-button-prev\",\n },\n thumbNext: {\n type: String,\n default: \".swiper-button-next\",\n },\n },\n setup(props) {\n const pluralize = (count, words) => {\n let cases = [2, 0, 1, 1, 1, 2];\n\n return (\n count +\n \" \" +\n words[\n count % 100 > 4 && count % 100 < 20\n ? 2\n : cases[Math.min(count % 10, 5)]\n ]\n );\n };\n\n window.addEventListener(\"DOMContentLoaded\", () => {\n const container = document.getElementById(\"bundles-root\");\n\n new Swiper(container, {\n slidesPerView: 1,\n spaceBetween: 24,\n allowTouchMove: false,\n mousewheel: {\n forceToAxis: true,\n },\n navigation: {\n nextEl: props.next,\n prevEl: props.prev,\n },\n modules: [Navigation, Pagination]\n });\n\n const bundles = container.querySelectorAll(\n \"#bundles-root > .swiper-wrapper > .swiper-slide\"\n );\n\n bundles.forEach((bundle, bundleIndex) => {\n let active = [];\n let swipers = [];\n\n const infos = bundle.querySelectorAll(\".bundle-info\");\n const sliders = bundle.querySelectorAll(\".bundles-subproduct\");\n\n if (bundle.dataset.finish) {\n const timer = bundle.querySelector(\".countdown\");\n\n new countdown(bundle.dataset.finish, {\n onCalculateRemainingTime: function () {\n const months = this.timeRemaining[1];\n const days = this.timeRemaining[2];\n\n if (months > 0) {\n timer.innerHTML = pluralize(\n months,\n __(\"shop.pluralize.monthes\")\n );\n } else if (days > 0) {\n timer.innerHTML = pluralize(\n days,\n __(\"shop.pluralize.days\")\n );\n } else {\n const hours = this.timeRemaining[3];\n const minutes = this.timeRemaining[4];\n const seconds = this.timeRemaining[5];\n\n timer.innerHTML =\n hours + \":\" + minutes + \":\" + seconds;\n }\n },\n });\n }\n\n sliders.forEach((slider, index) => {\n const next = slider.querySelector(props.thumbNext);\n const prev = slider.querySelector(props.thumbPrev);\n const pagination = slider.querySelector(\".swiper-pagination\");\n\n active[index] = 0;\n\n if (pagination) {\n swipers[index] = new Swiper(\n slider.querySelector(\".swiper\"),\n {\n modules: [Navigation, Pagination],\n slidesPerView: 1,\n spaceBetween: 24,\n navigation: {\n nextEl: next,\n prevEl: prev,\n },\n pagination: {\n el: pagination,\n clickable: true,\n },\n on: {\n slideChange: function (el) {\n active[index] = el.activeIndex;\n\n infos.forEach((info) => {\n info.classList.add(\"is-hidden\");\n });\n\n const id = \"bundle\" + bundleIndex + \"-info-\" + active.join(\"-\");\n\n document.getElementById(id).classList.remove(\"is-hidden\");\n },\n },\n }\n );\n }\n });\n });\n });\n },\n};\n</script>"],"names":["name","props","prev","type","String","next","thumbPrev","thumbNext","setup","pluralize","count","words","Math","min","window","addEventListener","container","document","getElementById","Swiper","slidesPerView","spaceBetween","allowTouchMove","mousewheel","forceToAxis","navigation","nextEl","prevEl","modules","Navigation","Pagination","querySelectorAll","forEach","bundle","bundleIndex","active","swipers","infos","sliders","dataset","finish","timer","querySelector","countdown","onCalculateRemainingTime","months","this","timeRemaining","days","innerHTML","__","hours","minutes","seconds","slider","index","pagination","el","clickable","on","slideChange","activeIndex","info","classList","add","id","join","remove"],"mappings":"2JAKe,CACXA,KAAM,SACNC,MAAO,CACHC,KAAM,CACFC,KAAMC,eACG,uBAEbC,KAAM,CACFF,KAAMC,eACG,uBAEbE,UAAW,CACPH,KAAMC,eACG,uBAEbG,UAAW,CACPJ,KAAMC,eACG,wBAGjBI,eAAMP,OACIQ,EAAY,SAACC,EAAOC,UAIlBD,EACA,IACAC,EACAD,EAAQ,IAAM,GAAKA,EAAQ,IAAM,GAC3B,EAPE,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,GAQZE,KAAKC,IAAIH,EAAQ,GAAI,MAKzCI,OAAOC,iBAAiB,oBAAoB,eAClCC,EAAYC,SAASC,eAAe,oBAEtCC,UAAOH,EAAW,CAClBI,cAAe,EACfC,aAAc,GACdC,gBAAgB,EAChBC,WAAY,CACRC,aAAa,GAEjBC,WAAY,CACRC,OAAQzB,EAAMI,KACdsB,OAAQ1B,EAAMC,MAElB0B,QAAS,CAACC,aAAYC,gBAGVd,EAAUe,iBACtB,mDAGIC,SAAQ,SAACC,EAAQC,OACjBC,EAAS,GACTC,EAAU,GAERC,EAAQJ,EAAOF,iBAAiB,gBAChCO,EAAUL,EAAOF,iBAAiB,0BAEpCE,EAAOM,QAAQC,OAAQ,KACjBC,EAAQR,EAAOS,cAAc,kBAE/BC,UAAUV,EAAOM,QAAQC,OAAQ,CACjCI,yBAA0B,eAChBC,EAASC,KAAKC,cAAc,GAC5BC,EAAOF,KAAKC,cAAc,MAE5BF,EAAS,EACTJ,EAAMQ,UAAYxC,EACdoC,EACAK,GAAG,gCAEJ,GAAIF,EAAO,EACdP,EAAMQ,UAAYxC,EACduC,EACAE,GAAG,4BAEJ,KACGC,EAAQL,KAAKC,cAAc,GAC3BK,EAAUN,KAAKC,cAAc,GAC7BM,EAAUP,KAAKC,cAAc,GAEnCN,EAAMQ,UACFE,EAAQ,IAAMC,EAAU,IAAM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