@ozdao/prometheus-framework 0.2.36 → 0.2.37
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.css +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +42 -52
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +61 -2
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +2 -61
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +2 -49
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +49 -2
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +39 -242
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -0
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +373 -0
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +4 -0
- package/dist/prometheus-framework/src/components/FieldPhone/click-outside.cjs +1 -2
- package/dist/prometheus-framework/src/components/FieldPhone/click-outside.js +13 -13
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +111 -2
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +49 -47
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +45 -44
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +61 -56
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.js +59 -39
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +31 -31
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +85 -55
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +30 -38
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +31 -21
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +96 -93
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +54 -74
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +58 -48
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +26 -26
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +18 -18
- package/dist/prometheus-framework.es.js +507 -493
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/modules/globals/store/globals.js +0 -1
package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Popup/Popup.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Popup/Popup.vue.cjs"),c=require("../../../../components/Magnifier/Magnifier.vue.cjs");require("./ImagesThumbnails.vue2.cjs");const d=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),p={class:"product-images"},m={class:"no-responsive cols-4 gap-thin"},_=["src","onClick"],g={__name:"ImagesThumbnails",props:{images:{type:Array,required:!0}},setup(o){const t=e.ref(!1),n=e.ref(0),a=s=>{n.value=s,t.value=!0},i=()=>{t.value=!1};return(s,v)=>(e.openBlock(),e.createElementBlock("div",p,[e.createElementVNode("div",m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.images,(l,r)=>(e.openBlock(),e.createElementBlock("img",{key:r,src:(s.FILE_SERVER_URL||"")+l,onClick:h=>a(r),class:"radius-medium bg-white o-hidden thumbnail"},null,8,_))),128))]),e.createVNode(u.default,{onClosePopup:i,isPopupOpen:t.value,class:"radius-medium o-hidden"},{default:e.withCtx(()=>[e.createVNode(c.default,{imageSrc:(s.FILE_SERVER_URL||"")+o.images[n.value],class:"magnifier z-index-4"},null,8,["imageSrc"])]),_:1},8,["isPopupOpen"])]))}},f=d.default(g,[["__scopeId","data-v-5058c750"]]);exports.default=f;
|
package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ref as r, openBlock as o, createElementBlock as i, createElementVNode as p, Fragment as d, renderList as _, createVNode as c, withCtx as g } from "vue";
|
2
|
-
import f from "../../../../components/Popup/Popup.
|
2
|
+
import f from "../../../../components/Popup/Popup.vue.js";
|
3
3
|
import h from "../../../../components/Magnifier/Magnifier.vue.js";
|
4
4
|
import "./ImagesThumbnails.vue2.js";
|
5
5
|
import v from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const n=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const i=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const b=require("../../../../components/Checkbox/Checkbox.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const n=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const i=require("../../../../components/Field/Field.vue2.cjs");require("../../../../components/Select/Select.vue.cjs");const b=require("../../../../components/Checkbox/Checkbox.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs");require("../../../../components/Popup/Popup.vue2.cjs");const w=require("../../../../components/EditImages/EditImages.vue.cjs"),c=require("../../../icons/navigation/IconDelete.vue.cjs"),h=require("../blocks/CardPosition.vue.cjs"),x=require("../sections/EditProductInfo.vue.cjs"),s=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),g=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const V={class:"for-transition w-100 cols-1 pd-thin gap-thin"},v={class:"mn-r-auto"},B={class:"cols-2 gap-thin"},q={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},C={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},y={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},E={__name:"ProductEdit",setup(U){const o=m.useRoute(),k=m.useRouter(),u=e.ref(t.state.all);e.onMounted(async()=>{await g.actions.fetchCategories(),o.params.product&&await t.actions.read({_id:o.params.product})});function N(){o.params.product?t.actions.update(o.params.product,t.state.current):t.actions.create(o.params._id,t.state.current)}function _(){t.actions.deleteProduct(t.state.current._id)}function p(){k.push({name:"Organization",params:{_id:o.params._id}})}return(D,d)=>(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(n.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",v,e.toDisplayString(e.unref(o).params.product?t.state.current.name:"Create Product"),1),e.unref(o).params.product?(e.openBlock(),e.createBlock(f.default,{key:0,submit:_,callback:p,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:N,callback:p,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(n.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(w.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":d[0]||(d[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",B,[e.createVNode(n.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(x.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(n.default,{title:"Categories"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.state.all,(a,r)=>(e.openBlock(),e.createBlock(b.default,{label:a.name,name:"categories",value:a.url,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:t.state.current.category,"onUpdate:radio":l=>t.state.current.category=l},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1}),e.createVNode(n.default,{title:"Parameters",placeholder:"No parameters added yet",actions:[{label:"+",function:()=>t.state.current.information.push({name:"",value:""})}],class:"cols-1 gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.information,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",q,[e.createVNode(c.default,{onClick:()=>t.state.current.information.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Localization",placeholder:"No localizations added yet",actions:[{label:"+",function:()=>t.state.current.localization.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.localization,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",C,[e.createVNode(c.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(n.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(i.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(i.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",y,[e.createVNode(c.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Add Ingridient",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(h.default,{onAdd:d[1]||(d[1]=a=>s.actions.add(t.state.current.ingridients,a)),products:u.value},null,8,["products"]),e.createVNode(n.default,{placeholder:"No positions added yet",class:"pd-zero mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingridients,(a,r)=>(e.openBlock(),e.createBlock(h.default,{key:a._id,product:a,array:t.state.current.ingridients,products:u.value,onAdd:d[2]||(d[2]=l=>s.actions.add(t.state.current.ingridients,l)),onUpdate:l=>s.actions.update(t.state.current.ingridients,l,r),onDelete:l=>s.actions.delete(t.state.current.ingridients,l,r)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1})]),_:1})]))}};exports.default=E;
|
@@ -7,9 +7,9 @@ import s from "../../../../components/Block/Block.vue.js";
|
|
7
7
|
import "../../../../components/Tab/Tab.vue.js";
|
8
8
|
import c from "../../../../components/Field/Field.vue2.js";
|
9
9
|
import "../../../../components/Select/Select.vue.js";
|
10
|
-
import B from "../../../../components/Checkbox/Checkbox.
|
10
|
+
import B from "../../../../components/Checkbox/Checkbox.vue.js";
|
11
11
|
import k from "../../../../components/Button/Button.vue2.js";
|
12
|
-
import "../../../../components/Popup/Popup.
|
12
|
+
import "../../../../components/Popup/Popup.vue2.js";
|
13
13
|
import E from "../../../../components/EditImages/EditImages.vue.js";
|
14
14
|
import b from "../../../icons/navigation/IconDelete.vue.js";
|
15
15
|
import U from "../blocks/CardPosition.vue.js";
|
package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../../../../components/Spoiler/Spoiler.vue2.cjs"),f=require("../../../../components/Checkbox/Checkbox.vue.cjs"),x=require("vue-i18n"),g=require("vue-router"),u=require("../../store/categories.cjs"),a=require("../../../marketplace/store/marketplace.cjs");require("./FilterProducts.vue2.cjs");const w={class:"pd-medium bg-grey radius-big"},q={class:"cursor-pointer mn-r-auto t-medium p-big"},E=e.createElementVNode("hr",{class:"mn-b-small"},null,-1),F={class:"cursor-pointer mn-r-auto t-medium p-big"},B=e.createElementVNode("hr",{class:"mn-b-small"},null,-1),C={__name:"FilterProducts",props:{selectedFilters:Object,prices:{type:Array,default:()=>[{label:"Under 300฿",value:"<300"},{label:"300฿ to 600฿",value:"300-600"},{label:"600฿ to 1200฿",value:"600-1200"},{label:"$1200 and above",value:">1200"}]},deliveryOptions:{type:Array,default:()=>[{label:"Pickup",value:{min:0,max:25}},{label:"Courier",value:{min:25,max:50}},{label:"Post",value:{min:50,max:100}}]}},emits:["updateFilters","resetFilters"],async setup(y,{emit:h}){let d,m;const n=g.useRoute(),v=g.useRouter();[d,m]=e.withAsyncContext(()=>u.actions.fetchCategories()),await d,m(),e.ref({categories:[],prices:[],delivery:[],extra:[]}),e.watch(()=>a.state.filter,(t,r)=>{const l={...n.query};Object.keys(r).forEach(s=>{l[s]&&delete l[s]});const i=Object.fromEntries(Object.entries(t).filter(([s,o])=>Array.isArray(o)&&o.length>0).map(([s,o])=>[s,o.join(",")]));Object.assign(l,i),v.push({query:l})},{deep:!0}),e.onMounted(async()=>{if(n.query){const t=n.query,r={categories:t.categories?t.categories.split(","):[],prices:t.prices?t.prices.split(","):[],delivery:t.delivery?t.delivery.split(","):[]};a.state.filter=r}});const _=h,k=()=>{_("resetFilters")},p={locale:"en",messages:{en:{categoriesTitle:"Category",categories:[],filters:{title:"Filters",price:{title:"Price",from:"From",to:"To"},filters:[],reset:"Reset Filters"}},ru:{categoriesTitle:"Категория",categories:[],filters:{title:"Фильтры",price:{title:"Цена",from:"От",to:"До"},filters:[],reset:"Сбросить фильтры"}}}};u.state.all.forEach(t=>{t.localization.forEach(r=>{p.messages[r.locale].categories.push(r.text)})});const{t:c}=x.useI18n(p);return(t,r)=>(e.openBlock(),e.createElementBlock("div",w,[e.createVNode(b.default,{class:"radius-small o-hidden br-1px br-solid br-grey mn-b-small",status:!0},{header:e.withCtx(()=>[e.createElementVNode("p",q,e.toDisplayString(e.unref(c)("categoriesTitle")),1)]),content:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.state.all,(l,i)=>(e.openBlock(),e.createBlock(f.default,{key:i,label:l.name,value:l.url,class:"w-100 mn-t-small mn-b-small bg-white radius-small pd-small",radio:a.state.filter.categories,"onUpdate:radio":r[0]||(r[0]=s=>a.state.filter.categories=s)},null,8,["label","value","radio"]))),128))]),_:1}),E,e.createVNode(b.default,{class:"radius-small o-hidden br-1px br-solid br-grey mn-b-small",status:!1},{header:e.withCtx(()=>[e.createElementVNode("p",F,e.toDisplayString(e.unref(c)("filters.price.title")),1)]),content:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.prices,(l,i)=>(e.openBlock(),e.createBlock(f.default,{key:i,label:l.label,value:l.value,class:"w-100 mn-t-small bg-white radius-small pd-small",radio:a.state.filter.prices,"onUpdate:radio":r[1]||(r[1]=s=>a.state.filter.prices=s)},null,8,["label","value","radio"]))),128))]),_:1}),B,e.createElementVNode("button",{onClick:k,class:"bg-main w-100 button"},e.toDisplayString(e.unref(c)("filters.reset")),1)]))}};exports.default=C;
|
package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
import { withAsyncContext as A, ref as P, watch as T, onMounted as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import { useI18n as
|
5
|
-
import { useRoute as
|
6
|
-
import { actions as $, state as
|
7
|
-
import { state as
|
1
|
+
import { withAsyncContext as A, ref as P, watch as T, onMounted as V, openBlock as a, createElementBlock as d, createVNode as h, withCtx as c, createElementVNode as o, toDisplayString as p, unref as b, Fragment as _, renderList as v, createBlock as x } from "vue";
|
2
|
+
import w from "../../../../components/Spoiler/Spoiler.vue2.js";
|
3
|
+
import F from "../../../../components/Checkbox/Checkbox.vue.js";
|
4
|
+
import { useI18n as B } from "vue-i18n";
|
5
|
+
import { useRoute as R, useRouter as U } from "vue-router";
|
6
|
+
import { actions as $, state as k } from "../../store/categories.js";
|
7
|
+
import { state as l } from "../../../marketplace/store/marketplace.js";
|
8
8
|
import "./FilterProducts.vue2.js";
|
9
|
-
const
|
9
|
+
const N = { class: "pd-medium bg-grey radius-big" }, D = { class: "cursor-pointer mn-r-auto t-medium p-big" }, I = /* @__PURE__ */ o("hr", { class: "mn-b-small" }, null, -1), L = { class: "cursor-pointer mn-r-auto t-medium p-big" }, M = /* @__PURE__ */ o("hr", { class: "mn-b-small" }, null, -1), X = {
|
10
10
|
__name: "FilterProducts",
|
11
11
|
props: {
|
12
12
|
selectedFilters: Object,
|
@@ -29,37 +29,37 @@ const D = { class: "pd-medium bg-grey radius-big" }, N = { class: "cursor-pointe
|
|
29
29
|
}
|
30
30
|
},
|
31
31
|
emits: ["updateFilters", "resetFilters"],
|
32
|
-
async setup(
|
33
|
-
let
|
34
|
-
const
|
35
|
-
[
|
32
|
+
async setup(C, { emit: j }) {
|
33
|
+
let f, g;
|
34
|
+
const u = R(), E = U();
|
35
|
+
[f, g] = A(() => $.fetchCategories()), await f, g(), P({
|
36
36
|
categories: [],
|
37
37
|
prices: [],
|
38
38
|
delivery: [],
|
39
39
|
extra: []
|
40
|
-
}), T(() =>
|
41
|
-
const
|
42
|
-
Object.keys(
|
43
|
-
|
40
|
+
}), T(() => l.filter, (e, t) => {
|
41
|
+
const r = { ...u.query };
|
42
|
+
Object.keys(t).forEach((s) => {
|
43
|
+
r[s] && delete r[s];
|
44
44
|
});
|
45
|
-
const
|
46
|
-
Object.entries(
|
45
|
+
const i = Object.fromEntries(
|
46
|
+
Object.entries(e).filter(([s, n]) => Array.isArray(n) && n.length > 0).map(([s, n]) => [s, n.join(",")])
|
47
47
|
);
|
48
|
-
Object.assign(
|
49
|
-
}, { deep: !0 }),
|
50
|
-
if (
|
51
|
-
const
|
52
|
-
categories:
|
53
|
-
prices:
|
54
|
-
delivery:
|
48
|
+
Object.assign(r, i), E.push({ query: r });
|
49
|
+
}, { deep: !0 }), V(async () => {
|
50
|
+
if (u.query) {
|
51
|
+
const e = u.query, t = {
|
52
|
+
categories: e.categories ? e.categories.split(",") : [],
|
53
|
+
prices: e.prices ? e.prices.split(",") : [],
|
54
|
+
delivery: e.delivery ? e.delivery.split(",") : []
|
55
55
|
// Продолжайте этот паттерн для остальных полей фильтра
|
56
56
|
};
|
57
|
-
|
57
|
+
l.filter = t;
|
58
58
|
}
|
59
59
|
});
|
60
60
|
const O = j, q = () => {
|
61
61
|
O("resetFilters");
|
62
|
-
},
|
62
|
+
}, y = {
|
63
63
|
locale: "en",
|
64
64
|
messages: {
|
65
65
|
en: {
|
@@ -92,80 +92,60 @@ const D = { class: "pd-medium bg-grey radius-big" }, N = { class: "cursor-pointe
|
|
92
92
|
}
|
93
93
|
}
|
94
94
|
};
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
k.all.forEach((e) => {
|
96
|
+
e.localization.forEach((t) => {
|
97
|
+
y.messages[t.locale].categories.push(t.text);
|
98
98
|
});
|
99
99
|
});
|
100
|
-
const { t:
|
101
|
-
return (
|
102
|
-
|
100
|
+
const { t: m } = B(y);
|
101
|
+
return (e, t) => (a(), d("div", N, [
|
102
|
+
h(w, {
|
103
103
|
class: "radius-small o-hidden br-1px br-solid br-grey mn-b-small",
|
104
104
|
status: !0
|
105
105
|
}, {
|
106
|
-
header:
|
107
|
-
o("p",
|
106
|
+
header: c(() => [
|
107
|
+
o("p", D, p(b(m)("categoriesTitle")), 1)
|
108
108
|
]),
|
109
|
-
content:
|
110
|
-
(
|
111
|
-
key:
|
112
|
-
label:
|
113
|
-
value:
|
109
|
+
content: c(() => [
|
110
|
+
(a(!0), d(_, null, v(k.all, (r, i) => (a(), x(F, {
|
111
|
+
key: i,
|
112
|
+
label: r.name,
|
113
|
+
value: r.url,
|
114
114
|
class: "w-100 mn-t-small mn-b-small bg-white radius-small pd-small",
|
115
|
-
radio:
|
116
|
-
"onUpdate:radio":
|
115
|
+
radio: l.filter.categories,
|
116
|
+
"onUpdate:radio": t[0] || (t[0] = (s) => l.filter.categories = s)
|
117
117
|
}, null, 8, ["label", "value", "radio"]))), 128))
|
118
118
|
]),
|
119
119
|
_: 1
|
120
120
|
}),
|
121
121
|
I,
|
122
|
-
|
122
|
+
h(w, {
|
123
123
|
class: "radius-small o-hidden br-1px br-solid br-grey mn-b-small",
|
124
124
|
status: !1
|
125
125
|
}, {
|
126
|
-
header:
|
127
|
-
o("p", L, b(
|
126
|
+
header: c(() => [
|
127
|
+
o("p", L, p(b(m)("filters.price.title")), 1)
|
128
128
|
]),
|
129
|
-
content:
|
130
|
-
(
|
131
|
-
key:
|
132
|
-
label:
|
133
|
-
value:
|
129
|
+
content: c(() => [
|
130
|
+
(a(!0), d(_, null, v(C.prices, (r, i) => (a(), x(F, {
|
131
|
+
key: i,
|
132
|
+
label: r.label,
|
133
|
+
value: r.value,
|
134
134
|
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
135
|
-
radio:
|
136
|
-
"onUpdate:radio":
|
135
|
+
radio: l.filter.prices,
|
136
|
+
"onUpdate:radio": t[1] || (t[1] = (s) => l.filter.prices = s)
|
137
137
|
}, null, 8, ["label", "value", "radio"]))), 128))
|
138
138
|
]),
|
139
139
|
_: 1
|
140
140
|
}),
|
141
141
|
M,
|
142
|
-
p(v, {
|
143
|
-
class: "radius-small o-hidden br-1px br-solid br-grey mn-b-small",
|
144
|
-
status: !1
|
145
|
-
}, {
|
146
|
-
header: n(() => [
|
147
|
-
Q
|
148
|
-
]),
|
149
|
-
content: n(() => [
|
150
|
-
(i(!0), c(g, null, y(x.deliveryOptions, (t, a) => (i(), h(_, {
|
151
|
-
key: a,
|
152
|
-
label: t.label,
|
153
|
-
value: t.value,
|
154
|
-
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
155
|
-
radio: s.filter.delivery,
|
156
|
-
"onUpdate:radio": e[2] || (e[2] = (l) => s.filter.delivery = l)
|
157
|
-
}, null, 8, ["label", "value", "radio"]))), 128))
|
158
|
-
]),
|
159
|
-
_: 1
|
160
|
-
}),
|
161
|
-
S,
|
162
142
|
o("button", {
|
163
143
|
onClick: q,
|
164
144
|
class: "bg-main w-100 button"
|
165
|
-
}, b(
|
145
|
+
}, p(b(m)("filters.reset")), 1)
|
166
146
|
]));
|
167
147
|
}
|
168
148
|
};
|
169
149
|
export {
|
170
|
-
|
150
|
+
X as default
|
171
151
|
};
|
package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Button/Button.vue2.cjs"),g=require("../../../icons/navigation/IconEdit.vue.cjs"),h=require("../../../icons/placeholders/PlaceholderImage.vue.cjs"),p=require("../blocks/Images360.vue.cjs"),k=require("../blocks/ImagesThumbnails.vue.cjs");require("../elements/THC.vue2.cjs");const f=require("../elements/Price.vue.cjs"),b=require("vue-i18n"),n=require("../../../orders/store/shopcart.cjs"),y={class:"cols-2-1_2 w-100 gap-big"},v={class:"flex-nowrap flex-column flex pos-relative"},B={class:"h-100 h-max-50vh bg-grey radius-big o-hidden"},V=["src"],E={class:"pos-relative w-100 h-100 flex-column flex-justify flex col"},N={key:0,class:"t-main t-semi p-big"},w={class:"w-100 h1-product mn-b-thin"},C={key:1,class:"mn-b-semi"},S={key:2,class:"w-100 mn-b-medium t-transp"},q={key:3,class:"w-100 mn-b-medium t-transp"},x={class:"cols-2 w-100 gap-small mn-b-semi"},z={class:"w-100 pd-small radius-small bg-grey-transp-30 product-information"},I={class:"t-demi"},D={class:"max-w-33rem mobile-w-100 t-white gap-small cols-2"},P={__name:"SectionProduct",props:{product:{type:Object,required:!0},recommendation:{type:String}},setup(t){const s=t,a=e.computed(()=>s.product.images),d={messages:{en:{airecommend:"AI Recommends You",description:"",addtoorder:"Add to order",fastorder:"Fast Order"},ru:{airecommend:"AI Рекомендует вам",description:"",addtoorder:"Добавить в корзину",fastorder:"Быстрый заказ"}}},{t:c}=b.useI18n(d);function l(o){return!(o.quantity>0)}function m(o){n.state.organization!==o.organization&&(n.state.positions=[],n.state.organization=o.organization),n.actions.addProductToCart(o,o.organization)}return(o,i)=>(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",v,[e.createElementVNode("div",B,[t.product&&t.product.image3d?(e.openBlock(),e.createBlock(p.default,{key:0,class:"h-100 w-100",imagePath:`/assets/images/products/${t.product.image3d}`,imageCount:36},null,8,["imagePath"])):e.createCommentVNode("",!0),a.value[0]&&!t.product.image3d?(e.openBlock(),e.createElementBlock("img",{key:1,class:"h-100 bg-grey w-100",style:{"object-fit":"contain"},src:(o.FILE_SERVER_URL||"")+a.value[0]},null,8,V)):e.createCommentVNode("",!0),!a.value[0]&&!t.product.image3d?(e.openBlock(),e.createBlock(h.default,{key:2,class:"h-100 w-100",style:{"object-fit":"cover"}})):e.createCommentVNode("",!0)]),a.value.length>1?(e.openBlock(),e.createBlock(k.default,{key:0,images:a.value,class:"mn-t-medium"},null,8,["images"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",E,[e.createVNode(g.default,{onClick:i[0]||(i[0]=r=>o.$router.push({name:"ProductEdit",params:{_id:t.product.organization,product:t.product._id}})),class:"pos-absolute pos-t-regular pos-r-regular i-regular t-transp"}),t.recommendation?(e.openBlock(),e.createElementBlock("h2",N,e.toDisplayString(e.unref(c)("airecommend")),1)):e.createCommentVNode("",!0),e.createElementVNode("h1",w,e.toDisplayString(t.product.name),1),e.createVNode(f.default,{product:t.product,size:"big",class:"mn-b-semi"},null,8,["product"]),t.recommendation?(e.openBlock(),e.createElementBlock("h3",C,e.toDisplayString(t.recommendation),1)):e.createCommentVNode("",!0),t.product.description&&!t.product.localization<1&&!t.recommendation?(e.openBlock(),e.createElementBlock("p",S,e.toDisplayString(t.product.description),1)):e.createCommentVNode("",!0),t.product.localization&&t.product.localization.length>1&&!t.recommendation?(e.openBlock(),e.createElementBlock("p",q,e.toDisplayString(e.unref(c)("description")),1)):e.createCommentVNode("",!0),e.createElementVNode("div",x,[t.product.information.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.product.information,r=>(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("p",I,e.toDisplayString(r.name),1),e.createElementVNode("p",null,e.toDisplayString(r.value),1)]))),256)):e.createCommentVNode("",!0)]),e.createElementVNode("div",D,[e.createVNode(u.default,{submit:r=>m(t.product),disabled:l(t.product),text:{success:" ✔ Added",error:"error"},class:"w-100 mn-r-small bg-main button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(c)("addtoorder")),1)]),_:1},8,["submit","disabled"])])])]))}};exports.default=P;
|
package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js
CHANGED
@@ -1,25 +1,26 @@
|
|
1
|
-
import { computed as y, openBlock as e, createElementBlock as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import I from "../../../icons/navigation/IconEdit.vue.js";
|
5
|
-
import "../elements/THC.vue2.js";
|
6
|
-
import C from "../elements/Price.vue.js";
|
1
|
+
import { computed as y, openBlock as e, createElementBlock as a, createElementVNode as r, createBlock as m, createCommentVNode as i, createVNode as l, toDisplayString as s, unref as u, Fragment as w, renderList as k, withCtx as x, createTextVNode as z } from "vue";
|
2
|
+
import I from "../../../../components/Button/Button.vue2.js";
|
3
|
+
import C from "../../../icons/navigation/IconEdit.vue.js";
|
7
4
|
import E from "../../../icons/placeholders/PlaceholderImage.vue.js";
|
8
|
-
import
|
9
|
-
import
|
10
|
-
|
5
|
+
import P from "../blocks/Images360.vue.js";
|
6
|
+
import T from "../blocks/ImagesThumbnails.vue.js";
|
7
|
+
import "../elements/THC.vue2.js";
|
8
|
+
import V from "../elements/Price.vue.js";
|
9
|
+
import { useI18n as $ } from "vue-i18n";
|
10
|
+
import { state as g, actions as j } from "../../../orders/store/shopcart.js";
|
11
|
+
const A = { class: "cols-2-1_2 w-100 gap-big" }, N = { class: "flex-nowrap flex-column flex pos-relative" }, R = { class: "h-100 h-max-50vh bg-grey radius-big o-hidden" }, S = ["src"], B = { class: "pos-relative w-100 h-100 flex-column flex-justify flex col" }, F = {
|
11
12
|
key: 0,
|
12
13
|
class: "t-main t-semi p-big"
|
13
|
-
},
|
14
|
+
}, L = { class: "w-100 h1-product mn-b-thin" }, q = {
|
14
15
|
key: 1,
|
15
16
|
class: "mn-b-semi"
|
16
|
-
},
|
17
|
+
}, O = {
|
17
18
|
key: 2,
|
18
19
|
class: "w-100 mn-b-medium t-transp"
|
19
|
-
},
|
20
|
+
}, D = {
|
20
21
|
key: 3,
|
21
22
|
class: "w-100 mn-b-medium t-transp"
|
22
|
-
},
|
23
|
+
}, U = { class: "cols-2 w-100 gap-small mn-b-semi" }, Y = { class: "w-100 pd-small radius-small bg-grey-transp-30 product-information" }, G = { class: "t-demi" }, H = { class: "max-w-33rem mobile-w-100 t-white gap-small cols-2" }, ot = {
|
23
24
|
__name: "SectionProduct",
|
24
25
|
props: {
|
25
26
|
product: {
|
@@ -31,7 +32,7 @@ const j = { class: "cols-2-1_2 w-100 gap-big" }, R = { class: "flex-nowrap flex-
|
|
31
32
|
}
|
32
33
|
},
|
33
34
|
setup(t) {
|
34
|
-
const f = t,
|
35
|
+
const f = t, n = y(() => f.product.images), b = {
|
35
36
|
messages: {
|
36
37
|
en: {
|
37
38
|
airecommend: "AI Recommends You",
|
@@ -46,43 +47,43 @@ const j = { class: "cols-2-1_2 w-100 gap-big" }, R = { class: "flex-nowrap flex-
|
|
46
47
|
fastorder: "Быстрый заказ"
|
47
48
|
}
|
48
49
|
}
|
49
|
-
}, { t:
|
50
|
-
function
|
51
|
-
return !(
|
50
|
+
}, { t: c } = $(b);
|
51
|
+
function p(o) {
|
52
|
+
return !(o.quantity > 0);
|
52
53
|
}
|
53
|
-
function v(
|
54
|
-
g.organization !==
|
54
|
+
function v(o) {
|
55
|
+
g.organization !== o.organization && (g.positions = [], g.organization = o.organization), j.addProductToCart(o, o.organization);
|
55
56
|
}
|
56
|
-
return (
|
57
|
-
|
58
|
-
|
59
|
-
t.product && t.product.image3d ? (e(),
|
57
|
+
return (o, h) => (e(), a("div", A, [
|
58
|
+
r("div", N, [
|
59
|
+
r("div", R, [
|
60
|
+
t.product && t.product.image3d ? (e(), m(P, {
|
60
61
|
key: 0,
|
61
62
|
class: "h-100 w-100",
|
62
63
|
imagePath: `/assets/images/products/${t.product.image3d}`,
|
63
64
|
imageCount: 36
|
64
65
|
}, null, 8, ["imagePath"])) : i("", !0),
|
65
|
-
|
66
|
+
n.value[0] && !t.product.image3d ? (e(), a("img", {
|
66
67
|
key: 1,
|
67
68
|
class: "h-100 bg-grey w-100",
|
68
69
|
style: { "object-fit": "contain" },
|
69
|
-
src: (
|
70
|
-
}, null, 8,
|
71
|
-
!
|
70
|
+
src: (o.FILE_SERVER_URL || "") + n.value[0]
|
71
|
+
}, null, 8, S)) : i("", !0),
|
72
|
+
!n.value[0] && !t.product.image3d ? (e(), m(E, {
|
72
73
|
key: 2,
|
73
74
|
class: "h-100 w-100",
|
74
75
|
style: { "object-fit": "cover" }
|
75
76
|
})) : i("", !0)
|
76
77
|
]),
|
77
|
-
|
78
|
+
n.value.length > 1 ? (e(), m(T, {
|
78
79
|
key: 0,
|
79
|
-
images:
|
80
|
+
images: n.value,
|
80
81
|
class: "mn-t-medium"
|
81
82
|
}, null, 8, ["images"])) : i("", !0)
|
82
83
|
]),
|
83
|
-
|
84
|
-
|
85
|
-
onClick:
|
84
|
+
r("div", B, [
|
85
|
+
l(C, {
|
86
|
+
onClick: h[0] || (h[0] = (d) => o.$router.push({
|
86
87
|
name: "ProductEdit",
|
87
88
|
params: {
|
88
89
|
_id: t.product.organization,
|
@@ -91,33 +92,42 @@ const j = { class: "cols-2-1_2 w-100 gap-big" }, R = { class: "flex-nowrap flex-
|
|
91
92
|
})),
|
92
93
|
class: "pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
|
93
94
|
}),
|
94
|
-
t.recommendation ? (e(),
|
95
|
-
|
96
|
-
|
95
|
+
t.recommendation ? (e(), a("h2", F, s(u(c)("airecommend")), 1)) : i("", !0),
|
96
|
+
r("h1", L, s(t.product.name), 1),
|
97
|
+
l(V, {
|
97
98
|
product: t.product,
|
98
99
|
size: "big",
|
99
100
|
class: "mn-b-semi"
|
100
101
|
}, null, 8, ["product"]),
|
101
|
-
t.recommendation ? (e(),
|
102
|
-
t.product.description && !t.product.localization < 1 && !t.recommendation ? (e(),
|
103
|
-
t.product.localization && t.product.localization.length > 1 && !t.recommendation ? (e(),
|
104
|
-
|
105
|
-
t.product.information.length > 0 ? (e(!0),
|
106
|
-
|
107
|
-
|
102
|
+
t.recommendation ? (e(), a("h3", q, s(t.recommendation), 1)) : i("", !0),
|
103
|
+
t.product.description && !t.product.localization < 1 && !t.recommendation ? (e(), a("p", O, s(t.product.description), 1)) : i("", !0),
|
104
|
+
t.product.localization && t.product.localization.length > 1 && !t.recommendation ? (e(), a("p", D, s(u(c)("description")), 1)) : i("", !0),
|
105
|
+
r("div", U, [
|
106
|
+
t.product.information.length > 0 ? (e(!0), a(w, { key: 0 }, k(t.product.information, (d) => (e(), a("div", Y, [
|
107
|
+
r("p", G, s(d.name), 1),
|
108
|
+
r("p", null, s(d.value), 1)
|
108
109
|
]))), 256)) : i("", !0)
|
109
110
|
]),
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
r("div", H, [
|
112
|
+
l(I, {
|
113
|
+
submit: (d) => v(t.product),
|
114
|
+
disabled: p(t.product),
|
115
|
+
text: {
|
116
|
+
success: " ✔ Added",
|
117
|
+
error: "error"
|
118
|
+
},
|
114
119
|
class: "w-100 mn-r-small bg-main button"
|
115
|
-
},
|
120
|
+
}, {
|
121
|
+
default: x(() => [
|
122
|
+
z(s(u(c)("addtoorder")), 1)
|
123
|
+
]),
|
124
|
+
_: 1
|
125
|
+
}, 8, ["submit", "disabled"])
|
116
126
|
])
|
117
127
|
])
|
118
128
|
]));
|
119
129
|
}
|
120
130
|
};
|
121
131
|
export {
|
122
|
-
|
132
|
+
ot as default
|
123
133
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),o=require("../../../../node_modules/axios/lib/axios.cjs"),s=require("../../globals/store/globals.cjs"),
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),o=require("../../../../node_modules/axios/lib/axios.cjs"),s=require("../../globals/store/globals.cjs"),i=o.default.create({baseURL:process.env.API_URL,withCredentials:!0}),t=n.reactive({all:[],current:{recommendation:!1,category:[],status:"unpublished",information:[],images:[],files:[],image3d:!1,name:"",sale:0,price:0,localization:[],modifications:[],quantityDiscount:[],ingridients:[],description:""}}),u={async create(e,r){const a={...r,organization:e};return await i.post("/api/products/create",a).then(c=>(d(c.data,"current"),Promise.resolve(c.data)),c=>(s.setError(c),Promise.reject(c)))},async read(e={}){let r={};e._id&&(r._id=e._id),e.category&&(r.category=e.category),e.organization&&(r.organization=e.organization),e.count&&(r.count=e.count),e.categories&&(r.categories=e.categories),e.prices&&(r.prices=e.prices),e.delivery&&(r.delivery=e.delivery),e.status&&(r.status=e.status),r.sort="createdAt",r.skip=e.skip||0,r.limit=e.limit||10,console.log(r);try{const a=await i.get("/api/products/read",{params:r});return e._id?(t.current={...a.data[0]},Promise.resolve(a.data[0])):Promise.resolve(a.data)}catch(a){return s.setError(a),Promise.reject(a)}},async update(e,r){return await i.post("/api/products/"+e,r).then(a=>Promise.resolve(a.data),a=>(s.setError(a),Promise.reject(a)))},async deleteProduct(e){return await i.delete("/api/products/"+e).then(r=>Promise.resolve(r.data),r=>(s.setError(r),Promise.reject(r)))},async submitMood(e=null){return console.log(e),i.post("/api/product/recommended",{mood:e}).then(r=>(t.current=r.data.product,t.current.recommendation=r.data.recommendationText,Promise.resolve(r.data)),r=>(console.log(r),s.setError(r),Promise.reject(r)))},async fetchProducts(){return await i.get("/api/products/read").then(e=>(t.all=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPopular(){return await i.get("/api/products/popular").then(e=>(t.popular=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPublished(){return await i.get("/api/products").then(e=>{let r=e.data.filter(function(a,c){return a.status!=="unpublished"});return t.all=r,t.filtered=r.slice(),t.filteredPrice=t.filtered,t.filteredPrice.sort(function(a,c){return a[t.sort.current]>c[t.sort.current]?t.sort.ascending?1:-1:a[t.sort.current]<c[t.sort.current]?t.sort.ascending?-1:1:0}),Promise.resolve(e.data)},e=>(s.setError(e),Promise.reject(e)))},async fetchProduct(e){try{const r=await i.get("/api/products/"+e);return console.log(r),t.current=r.data[0],Promise.resolve(r.data[0])}catch(r){return s.setError(r),Promise.reject(r)}},async fetchProductPopular(){return await i.get("/api/products").then(e=>(t.all=e.data.slice(1,5),Promise.resolve(e.data.slice(1,5))),e=>(s.setError(e),Promise.reject(e)))}};function d(e,r){t[r]=e}n.watch(t,(e,r)=>{});exports.actions=u;exports.state=t;
|