@ozdao/prometheus-framework 0.2.94 → 0.2.96
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +15 -14
- package/dist/auth.server.mjs +15 -14
- package/dist/main-BJvlNekm.mjs +13631 -0
- package/dist/main-pGo7JpSP.js +92 -0
- package/dist/orders.server.js +26 -22
- package/dist/orders.server.mjs +26 -22
- package/dist/organizations.server.js +31 -10
- package/dist/organizations.server.mjs +31 -10
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +2 -2
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +19 -19
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
- 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/Popup/Popup.vue.js +12 -12
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
- package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +21 -21
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/router/auth.js +4 -0
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +8 -8
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +60 -60
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.js +22 -21
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +48 -37
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +160 -167
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +50 -49
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +113 -110
- package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/models/order.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/models/order.js +28 -0
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +25 -43
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +19 -19
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- 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 +47 -47
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +143 -131
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- 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 +2 -2
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- 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/organizations/organizations.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +32 -34
- package/dist/prometheus-framework/src/modules/organizations/router/members.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/members.router.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -32
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.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 +155 -187
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +19 -19
- 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 +1 -1
- 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/blocks/CardUser.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +26 -22
- 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 +68 -65
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-B2xhKZNK.js +1 -0
- package/dist/web-DTzbVshr.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Block/Block.vue +1 -1
- package/src/components/Completion/Completion.vue +2 -2
- package/src/modules/auth/controllers/auth.controller.js +19 -16
- package/src/modules/auth/router/auth.js +4 -0
- package/src/modules/backoffice/router/backoffice.js +3 -3
- package/src/modules/chats/routes/chats.routes.js +1 -2
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
- package/src/modules/globals/services/globals.crud.js +2 -0
- package/src/modules/icons/navigation/IconCross.vue +11 -7
- package/src/modules/orders/components/blocks/StatusHistory.vue +8 -11
- package/src/modules/orders/components/pages/OrderBackoffice.vue +37 -50
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +8 -4
- package/src/modules/orders/components/pages/Orders.vue +1 -1
- package/src/modules/orders/controllers/orders.controller.js +26 -25
- package/src/modules/orders/models/order.model.js +1 -1
- package/src/modules/orders/routes/orders.routes.js +9 -3
- package/src/modules/orders/store/customers.store.js +1 -1
- package/src/modules/orders/store/models/order.js +33 -0
- package/src/modules/orders/store/orders.js +7 -28
- package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -2
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +7 -5
- package/src/modules/organizations/components/pages/Members.vue +50 -38
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/components/pages/Organizations.vue +2 -1
- package/src/modules/organizations/controllers/invites.controller.js +2 -0
- package/src/modules/organizations/controllers/memberships.controller.js +35 -11
- package/src/modules/organizations/controllers/organizations.controller.js +5 -4
- package/src/modules/organizations/models/invite.model.js +4 -0
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/organizations/router/members.router.js +1 -1
- package/src/modules/organizations/store/departments.js +0 -1
- package/src/modules/organizations/store/memberships.js +1 -8
- package/src/modules/products/components/pages/ProductEdit.vue +39 -33
- package/src/modules/products/components/sections/EditProductInfo.vue +3 -3
- package/src/modules/users/components/blocks/CardUser.vue +9 -5
- package/src/modules/users/components/pages/Profile.vue +5 -3
- package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
- package/src/modules/users/components/sections/ProfileCompletion.vue +2 -2
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +0 -126
- package/src/modules/users/components/pages/ProfileOrganizations.vue +0 -97
package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../../../components/Block/Block.vue.cjs"),N=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../../../components/Block/Block.vue.cjs"),N=require("../../../../components/Field/Field.vue.cjs"),w=require("../../../../components/Feed/Feed.vue.cjs"),C=require("../../../../components/Select/Select.vue.cjs"),q=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const P=require("../blocks/CardPosition.vue.cjs"),V=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),p=require("../../../globals/store/globals.cjs"),x=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const E={class:"pd-thin"},B={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},S={class:""},D=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),L={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},R={class:"gap-thin flex-v-center flex-nojustify flex"},F={class:"mn-r-auto"},O={__name:"EditLeftover",setup(z){const r=v.useRoute(),i=v.useRouter(),f=e.ref(m.state.all);e.ref(null);const b=e.computed(()=>Number(t.state.current.positions.reduce((a,s)=>Number(a)+Number(s.price),0))),c=e.ref(!1);function _(){c.value=!0}function h(){c.value=!1}e.onMounted(async()=>{if(r.params.leftover)try{await t.actions.fetch(r.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const a=await m.actions.read({organization:r.params._id,limit:100});f.value=a}catch{console.error("error")}});function g(){r.params.leftover?t.actions.fetch(r.params.leftover):t.state.current={type:"",order:"",positions:[]}}function y(){t.state.current.organization=r.params._id,r.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")):(t.state.current.creator={type:"user",target:x.state.user._id},t.state.current.owner={type:"organization",target:r.params._id},console.log("leftover state is",t.state.current),t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error")))}function k(){t.actions.delete(r.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:r.params._id}}),a=>console.error("error"))}return(a,s)=>(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("header",B,[e.createElementVNode("h2",S,e.toDisplayString(e.unref(r).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(C.default,{select:t.state.current.type,"onUpdate:select":s[0]||(s[0]=o=>t.state.current.type=o),options:["stock-in","stock-out"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(q.default,{title:"Add position",onClosePopup:h,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[D,e.createElementVNode("div",L,[e.createVNode(w.default,{search:!0,states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:o=>m.actions.read(o),state:null},options:{organization:e.unref(r).params._id},class:""},{default:e.withCtx(({items:o})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o,(n,l)=>(e.openBlock(),e.createBlock(V.default,{key:n._id,editable:!1,product:n,onClick:()=>{let u={...n};u.quantity=1,u.type="pcs",p.actions.add(t.state.current.positions,u),h()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),e.createVNode(d.default,{title:"Invetory Sheet",actions:[{label:"+",function:()=>_()}],placeholder:"No positions added yet",class:"mn-b-semi"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(o,n)=>(e.openBlock(),e.createBlock(P.default,{key:o._id,product:o,array:t.state.current.positions,products:f.value,onUpdate:l=>p.actions.update(t.state.current.positions,l,n),onDelete:l=>p.actions.delete(t.state.current.positions,l,n),class:"mn-b-small radius-medium bg-white pd-small"},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1},8,["actions"]),e.createVNode(d.default,{title:"Comment",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(N.default,{field:t.state.current.comment,"onUpdate:field":s[1]||(s[1]=o=>t.state.current.comment=o),label:"Comment",type:"textarea",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),_:1}),e.createVNode(d.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",R,[e.createElementVNode("h3",F," In total: "+e.toDisplayString(a.formatPrice(b.value)),1),e.createElementVNode("a",{onClick:s[2]||(s[2]=o=>y()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:s[3]||(s[3]=o=>g())}," Reset "),e.unref(r).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:s[4]||(s[4]=o=>k()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})]))}};exports.default=O;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ref as h, computed as z, onMounted as E, openBlock as l, createElementBlock as p, createElementVNode as n, toDisplayString as k, unref as b, createVNode as a, withCtx as c, Fragment as P, renderList as x, createBlock as $, createCommentVNode as U } from "vue";
|
2
2
|
import v from "../../../../components/Block/Block.vue.js";
|
3
|
-
import A from "../../../../components/Field/Field.
|
3
|
+
import A from "../../../../components/Field/Field.vue.js";
|
4
4
|
import B from "../../../../components/Feed/Feed.vue.js";
|
5
5
|
import F from "../../../../components/Select/Select.vue.js";
|
6
6
|
import I from "../../../../components/Popup/Popup.vue.js";
|
@@ -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"),h=require("vue-router");require("vue-i18n");require("../../../globals/localization/vue-i18n.cjs");require("../../../../components/Breadcrumbs/Breadcrumbs.vue.cjs");const o=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Tab/Tab.vue.cjs");const c=require("../../../../components/Field/Field.vue.cjs"),V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),k=require("../../../../components/Button/Button.vue.cjs"),B=require("../../../../components/Popup/Popup.vue.cjs"),C=require("../../../../components/EditImages/EditImages.vue.cjs"),_=require("../../../icons/navigation/IconDelete.vue.cjs"),b=require("../blocks/CardPosition.vue.cjs"),q=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),N=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const P={class:"for-transition w-100 cols-1 pd-thin gap-thin"},y={class:"mn-r-auto"},E={class:"cols-2 gap-thin"},U={key:0,class:"cols-1 gap-thin"},z={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},I={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},D={__name:"ProductEdit",setup(O){const l=h.useRoute(),m=h.useRouter(),p=e.ref(t.state.all),f=e.ref(!1);function v(d){f.value=!0}function s(){f.value=!1}e.onMounted(async()=>{t.mutations.resetProduct(),l.params.product&&await t.actions.read({_id:l.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[]),await N.actions.fetchCategories();try{const d=await t.actions.read({organization:l.params._id,limit:100});p.value=d}catch{console.error("error")}});function w(){l.params.product?t.actions.update(l.params.product,t.state.current):t.actions.create(l.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function g(){m.push({name:"Organization",params:{_id:l.params._id}})}return(d,i)=>(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",y,e.toDisplayString(e.unref(l).params.product?t.state.current.name:"Create Product"),1),e.unref(l).params.product?(e.openBlock(),e.createBlock(k.default,{key:0,submit:x,callback:g,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(k.default,{submit:w,callback:g,class:"bg-main"},{default:e.withCtx(()=>[e.createTextVNode(" Save ")]),_:1})]),_:1}),e.createVNode(o.default,{placeholder:"The product doesn't have any images yet.",class:"h-min"},{default:e.withCtx(()=>[e.createVNode(C.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":i[0]||(i[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",E,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(q.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Ingredients",placeholder:"No ingridients added yet",actions:[{label:"+",function:()=>v()}]},{default:e.withCtx(()=>[t.state.current.ingredients.length>0?(e.openBlock(),e.createElementBlock("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,n)=>(e.openBlock(),e.createBlock(b.default,{key:a._id,product:a,array:t.state.current.ingredients,products:p.value,onAdd:i[1]||(i[1]=r=>{u.actions.add(t.state.current.ingredients,r),s()}),onUpdate:r=>{u.actions.update(t.state.current.ingredients,r,n),s()},onDelete:r=>{u.actions.delete(t.state.current.ingredients,r,n),s()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])):e.createCommentVNode("",!0)]),_:1},8,["actions"])]),e.createVNode(o.default,{title:"Categories",actions:[{label:"+",function:()=>e.unref(m).push({name:"Categories Organization",params:{_id:e.unref(l).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.state.all,(a,n)=>(e.openBlock(),e.createBlock(V.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":r=>t.state.current.category=r},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1},8,["actions"]),e.createVNode(o.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,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:n},[e.createVNode(c.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(c.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",z,[e.createVNode(_.default,{onClick:()=>t.state.current.information.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(o.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,n)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:n},[e.createVNode(c.default,{field:a.name,"onUpdate:field":r=>a.name=r,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(c.default,{field:a.value,"onUpdate:field":r=>a.value=r,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",I,[e.createVNode(_.default,{onClick:()=>t.state.current.localization.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add ingredient",onClosePopup:s,isPopupOpen:f.value,class:"bg-white pd-big radius-big"},{default:e.withCtx(()=>[e.createVNode(b.default,{onAdd:i[2]||(i[2]=a=>u.actions.add(t.state.current.ingredients,a)),products:p.value,class:"flex-column"},null,8,["products"])]),_:1},8,["isPopupOpen"])]))}};exports.default=D;
|
@@ -1,80 +1,83 @@
|
|
1
|
-
import { ref as
|
2
|
-
import { useRoute as
|
1
|
+
import { ref as U, onMounted as A, openBlock as n, createElementBlock as s, createVNode as a, withCtx as l, createElementVNode as f, toDisplayString as B, unref as g, createBlock as y, createTextVNode as C, createCommentVNode as $, Fragment as _, renderList as h } from "vue";
|
2
|
+
import { useRoute as E, useRouter as R } from "vue-router";
|
3
3
|
import "vue-i18n";
|
4
4
|
import "../../../globals/localization/vue-i18n.js";
|
5
5
|
import "../../../../components/Breadcrumbs/Breadcrumbs.vue.js";
|
6
6
|
import d from "../../../../components/Block/Block.vue.js";
|
7
7
|
import "../../../../components/Tab/Tab.vue.js";
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import
|
15
|
-
import
|
8
|
+
import b from "../../../../components/Field/Field.vue.js";
|
9
|
+
import S from "../../../../components/Checkbox/Checkbox.vue.js";
|
10
|
+
import z from "../../../../components/Button/Button.vue.js";
|
11
|
+
import T from "../../../../components/Popup/Popup.vue.js";
|
12
|
+
import F from "../../../../components/EditImages/EditImages.vue.js";
|
13
|
+
import N from "../../../icons/navigation/IconDelete.vue.js";
|
14
|
+
import D from "../blocks/CardPosition.vue.js";
|
15
|
+
import L from "../sections/EditProductInfo.vue.js";
|
16
16
|
import { actions as v } from "../../../globals/store/globals.js";
|
17
|
-
import { state as e, mutations as
|
18
|
-
import { actions as
|
17
|
+
import { state as e, mutations as M, actions as u } from "../../store/products.js";
|
18
|
+
import { actions as j, state as q } from "../../store/categories.js";
|
19
19
|
import "./ProductEdit.vue2.js";
|
20
|
-
const
|
20
|
+
const G = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, H = { class: "mn-r-auto" }, J = { class: "cols-2 gap-thin" }, K = {
|
21
|
+
key: 0,
|
22
|
+
class: "cols-1 gap-thin"
|
23
|
+
}, Q = { class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red" }, W = { class: "radius-small pd-small flex-center flex aspect-1x1 bg-red" }, he = {
|
21
24
|
__name: "ProductEdit",
|
22
|
-
setup(
|
23
|
-
const
|
24
|
-
function
|
25
|
+
setup(X) {
|
26
|
+
const i = E(), k = R(), w = U(e.all), x = U(!1);
|
27
|
+
function O(m) {
|
25
28
|
x.value = !0;
|
26
29
|
}
|
27
|
-
function
|
30
|
+
function p() {
|
28
31
|
x.value = !1;
|
29
32
|
}
|
30
|
-
|
31
|
-
|
33
|
+
A(async () => {
|
34
|
+
M.resetProduct(), i.params.product && await u.read({ _id: i.params.product }), e.current.ingredients || (e.current.ingredients = []), await j.fetchCategories();
|
32
35
|
try {
|
33
|
-
const
|
34
|
-
organization:
|
36
|
+
const m = await u.read({
|
37
|
+
organization: i.params._id,
|
35
38
|
limit: 100
|
36
39
|
});
|
37
|
-
w.value =
|
40
|
+
w.value = m;
|
38
41
|
} catch {
|
39
42
|
console.error("error");
|
40
43
|
}
|
41
44
|
});
|
42
|
-
function O() {
|
43
|
-
o.params.product ? g.update(o.params.product, e.current) : g.create(o.params._id, e.current);
|
44
|
-
}
|
45
45
|
function I() {
|
46
|
-
|
46
|
+
i.params.product ? u.update(i.params.product, e.current) : u.create(i.params._id, e.current);
|
47
|
+
}
|
48
|
+
function V() {
|
49
|
+
u.deleteProduct(e.current._id);
|
47
50
|
}
|
48
|
-
function
|
49
|
-
|
51
|
+
function P() {
|
52
|
+
k.push({
|
50
53
|
name: "Organization",
|
51
54
|
params: {
|
52
|
-
_id:
|
55
|
+
_id: i.params._id
|
53
56
|
}
|
54
57
|
});
|
55
58
|
}
|
56
|
-
return (
|
59
|
+
return (m, c) => (n(), s("div", G, [
|
57
60
|
a(d, { class: "flex-nowrap flex-v-center flex" }, {
|
58
|
-
default:
|
59
|
-
|
60
|
-
|
61
|
+
default: l(() => [
|
62
|
+
f("h1", H, B(g(i).params.product ? e.current.name : "Create Product"), 1),
|
63
|
+
g(i).params.product ? (n(), y(z, {
|
61
64
|
key: 0,
|
62
|
-
submit:
|
63
|
-
callback:
|
65
|
+
submit: V,
|
66
|
+
callback: P,
|
64
67
|
class: "bg-red mn-r-thin"
|
65
68
|
}, {
|
66
|
-
default:
|
67
|
-
|
69
|
+
default: l(() => [
|
70
|
+
C(" Delete ")
|
68
71
|
]),
|
69
72
|
_: 1
|
70
|
-
})) :
|
71
|
-
a(
|
72
|
-
submit:
|
73
|
-
callback:
|
73
|
+
})) : $("", !0),
|
74
|
+
a(z, {
|
75
|
+
submit: I,
|
76
|
+
callback: P,
|
74
77
|
class: "bg-main"
|
75
78
|
}, {
|
76
|
-
default:
|
77
|
-
|
79
|
+
default: l(() => [
|
80
|
+
C(" Save ")
|
78
81
|
]),
|
79
82
|
_: 1
|
80
83
|
})
|
@@ -85,150 +88,144 @@ const j = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class
|
|
85
88
|
placeholder: "The product doesn't have any images yet.",
|
86
89
|
class: "h-min"
|
87
90
|
}, {
|
88
|
-
default:
|
89
|
-
a(
|
91
|
+
default: l(() => [
|
92
|
+
a(F, {
|
90
93
|
images: e.current.images,
|
91
94
|
uploadPath: "photos",
|
92
|
-
"onUpdate:images":
|
95
|
+
"onUpdate:images": c[0] || (c[0] = (t) => {
|
93
96
|
e.current.images = t;
|
94
97
|
})
|
95
98
|
}, null, 8, ["images"])
|
96
99
|
]),
|
97
100
|
_: 1
|
98
101
|
}),
|
99
|
-
|
102
|
+
f("div", J, [
|
100
103
|
a(d, { title: "Profile" }, {
|
101
|
-
default:
|
102
|
-
a(
|
104
|
+
default: l(() => [
|
105
|
+
a(L, {
|
103
106
|
product: e.current
|
104
107
|
}, null, 8, ["product"])
|
105
108
|
]),
|
106
109
|
_: 1
|
107
110
|
}),
|
108
111
|
a(d, {
|
109
|
-
title: "
|
112
|
+
title: "Ingredients",
|
113
|
+
placeholder: "No ingridients added yet",
|
110
114
|
actions: [{
|
111
115
|
label: "+",
|
112
|
-
function: () =>
|
113
|
-
name: "Categories Organization",
|
114
|
-
params: {
|
115
|
-
_id: b(o).params._id
|
116
|
-
}
|
117
|
-
})
|
116
|
+
function: () => O()
|
118
117
|
}]
|
119
118
|
}, {
|
120
|
-
default:
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
}],
|
139
|
-
class: "cols-1 gap-thin"
|
140
|
-
}, {
|
141
|
-
default: r(() => [
|
142
|
-
(i(!0), s(m, null, f(e.current.information, (t, n) => (i(), s("div", {
|
143
|
-
class: "gap-thin flex-nowrap flex",
|
144
|
-
key: n
|
145
|
-
}, [
|
146
|
-
a(p, {
|
147
|
-
field: t.name,
|
148
|
-
"onUpdate:field": (l) => t.name = l,
|
149
|
-
placeholder: "Название параметра",
|
150
|
-
class: "w-100 bg-white radius-small pd-medium"
|
151
|
-
}, null, 8, ["field", "onUpdate:field"]),
|
152
|
-
a(p, {
|
153
|
-
field: t.value,
|
154
|
-
"onUpdate:field": (l) => t.value = l,
|
155
|
-
placeholder: "Значение параметра",
|
156
|
-
class: "w-100 bg-white radius-small pd-medium"
|
157
|
-
}, null, 8, ["field", "onUpdate:field"]),
|
158
|
-
c("div", J, [
|
159
|
-
a(k, {
|
160
|
-
onClick: () => e.current.information.splice(n, 1),
|
161
|
-
class: "i-medium"
|
162
|
-
}, null, 8, ["onClick"])
|
163
|
-
])
|
164
|
-
]))), 128))
|
165
|
-
]),
|
166
|
-
_: 1
|
167
|
-
}, 8, ["actions"]),
|
168
|
-
a(d, {
|
169
|
-
title: "Localization",
|
170
|
-
placeholder: "No localizations added yet",
|
171
|
-
actions: [{
|
172
|
-
label: "+",
|
173
|
-
function: () => e.current.localization.push({ name: "", value: "" })
|
174
|
-
}]
|
175
|
-
}, {
|
176
|
-
default: r(() => [
|
177
|
-
(i(!0), s(m, null, f(e.current.localization, (t, n) => (i(), s("div", {
|
178
|
-
class: "gap-thin mn-b-thin flex-nowrap flex",
|
179
|
-
key: n
|
180
|
-
}, [
|
181
|
-
a(p, {
|
182
|
-
field: t.name,
|
183
|
-
"onUpdate:field": (l) => t.name = l,
|
184
|
-
placeholder: "Название параметра",
|
185
|
-
class: "w-100 bg-white radius-small pd-medium"
|
186
|
-
}, null, 8, ["field", "onUpdate:field"]),
|
187
|
-
a(p, {
|
188
|
-
field: t.value,
|
189
|
-
"onUpdate:field": (l) => t.value = l,
|
190
|
-
placeholder: "Значение параметра",
|
191
|
-
class: "w-100 bg-white radius-small pd-medium"
|
192
|
-
}, null, 8, ["field", "onUpdate:field"]),
|
193
|
-
c("div", K, [
|
194
|
-
a(k, {
|
195
|
-
onClick: () => e.current.localization.splice(n, 1),
|
196
|
-
class: "i-medium"
|
197
|
-
}, null, 8, ["onClick"])
|
198
|
-
])
|
199
|
-
]))), 128))
|
119
|
+
default: l(() => [
|
120
|
+
e.current.ingredients.length > 0 ? (n(), s("div", K, [
|
121
|
+
(n(!0), s(_, null, h(e.current.ingredients, (t, o) => (n(), y(D, {
|
122
|
+
key: t._id,
|
123
|
+
product: t,
|
124
|
+
array: e.current.ingredients,
|
125
|
+
products: w.value,
|
126
|
+
onAdd: c[1] || (c[1] = (r) => {
|
127
|
+
v.add(e.current.ingredients, r), p();
|
128
|
+
}),
|
129
|
+
onUpdate: (r) => {
|
130
|
+
v.update(e.current.ingredients, r, o), p();
|
131
|
+
},
|
132
|
+
onDelete: (r) => {
|
133
|
+
v.delete(e.current.ingredients, r, o), p();
|
134
|
+
}
|
135
|
+
}, null, 8, ["product", "array", "products", "onUpdate", "onDelete"]))), 128))
|
136
|
+
])) : $("", !0)
|
200
137
|
]),
|
201
138
|
_: 1
|
202
139
|
}, 8, ["actions"])
|
203
140
|
]),
|
204
141
|
a(d, {
|
205
|
-
title: "
|
206
|
-
|
142
|
+
title: "Categories",
|
143
|
+
actions: [{
|
144
|
+
label: "+",
|
145
|
+
function: () => g(k).push({
|
146
|
+
name: "Categories Organization",
|
147
|
+
params: {
|
148
|
+
_id: g(i).params._id
|
149
|
+
}
|
150
|
+
})
|
151
|
+
}]
|
152
|
+
}, {
|
153
|
+
default: l(() => [
|
154
|
+
(n(!0), s(_, null, h(q.all, (t, o) => (n(), y(S, {
|
155
|
+
label: t.name,
|
156
|
+
name: "categories",
|
157
|
+
value: t.url,
|
158
|
+
class: "w-100 mn-t-small bg-white radius-small pd-small",
|
159
|
+
radio: e.current.category,
|
160
|
+
"onUpdate:radio": (r) => e.current.category = r
|
161
|
+
}, null, 8, ["label", "value", "radio", "onUpdate:radio"]))), 256))
|
162
|
+
]),
|
163
|
+
_: 1
|
164
|
+
}, 8, ["actions"]),
|
165
|
+
a(d, {
|
166
|
+
title: "Parameters",
|
167
|
+
placeholder: "No parameters added yet",
|
207
168
|
actions: [{
|
208
169
|
label: "+",
|
209
|
-
function: () => e.current.
|
170
|
+
function: () => e.current.information.push({ name: "", value: "" })
|
171
|
+
}],
|
172
|
+
class: "cols-1 gap-thin"
|
173
|
+
}, {
|
174
|
+
default: l(() => [
|
175
|
+
(n(!0), s(_, null, h(e.current.information, (t, o) => (n(), s("div", {
|
176
|
+
class: "gap-thin flex-nowrap flex",
|
177
|
+
key: o
|
178
|
+
}, [
|
179
|
+
a(b, {
|
180
|
+
field: t.name,
|
181
|
+
"onUpdate:field": (r) => t.name = r,
|
182
|
+
placeholder: "Название параметра",
|
183
|
+
class: "w-100 bg-white radius-small pd-medium"
|
184
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
185
|
+
a(b, {
|
186
|
+
field: t.value,
|
187
|
+
"onUpdate:field": (r) => t.value = r,
|
188
|
+
placeholder: "Значение параметра",
|
189
|
+
class: "w-100 bg-white radius-small pd-medium"
|
190
|
+
}, null, 8, ["field", "onUpdate:field"]),
|
191
|
+
f("div", Q, [
|
192
|
+
a(N, {
|
193
|
+
onClick: () => e.current.information.splice(o, 1),
|
194
|
+
class: "i-medium"
|
195
|
+
}, null, 8, ["onClick"])
|
196
|
+
])
|
197
|
+
]))), 128))
|
198
|
+
]),
|
199
|
+
_: 1
|
200
|
+
}, 8, ["actions"]),
|
201
|
+
a(d, {
|
202
|
+
title: "Localization",
|
203
|
+
placeholder: "No localizations added yet",
|
204
|
+
actions: [{
|
205
|
+
label: "+",
|
206
|
+
function: () => e.current.localization.push({ name: "", value: "" })
|
210
207
|
}]
|
211
208
|
}, {
|
212
|
-
default:
|
213
|
-
(
|
209
|
+
default: l(() => [
|
210
|
+
(n(!0), s(_, null, h(e.current.localization, (t, o) => (n(), s("div", {
|
214
211
|
class: "gap-thin mn-b-thin flex-nowrap flex",
|
215
|
-
key:
|
212
|
+
key: o
|
216
213
|
}, [
|
217
|
-
a(
|
214
|
+
a(b, {
|
218
215
|
field: t.name,
|
219
|
-
"onUpdate:field": (
|
220
|
-
placeholder: "
|
216
|
+
"onUpdate:field": (r) => t.name = r,
|
217
|
+
placeholder: "Название параметра",
|
221
218
|
class: "w-100 bg-white radius-small pd-medium"
|
222
219
|
}, null, 8, ["field", "onUpdate:field"]),
|
223
|
-
a(
|
220
|
+
a(b, {
|
224
221
|
field: t.value,
|
225
|
-
"onUpdate:field": (
|
226
|
-
placeholder: "
|
222
|
+
"onUpdate:field": (r) => t.value = r,
|
223
|
+
placeholder: "Значение параметра",
|
227
224
|
class: "w-100 bg-white radius-small pd-medium"
|
228
225
|
}, null, 8, ["field", "onUpdate:field"]),
|
229
|
-
|
230
|
-
a(
|
231
|
-
onClick: () => e.current.
|
226
|
+
f("div", W, [
|
227
|
+
a(N, {
|
228
|
+
onClick: () => e.current.localization.splice(o, 1),
|
232
229
|
class: "i-medium"
|
233
230
|
}, null, 8, ["onClick"])
|
234
231
|
])
|
@@ -236,15 +233,15 @@ const j = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class
|
|
236
233
|
]),
|
237
234
|
_: 1
|
238
235
|
}, 8, ["actions"]),
|
239
|
-
a(
|
236
|
+
a(T, {
|
240
237
|
title: "Add ingredient",
|
241
|
-
onClosePopup:
|
238
|
+
onClosePopup: p,
|
242
239
|
isPopupOpen: x.value,
|
243
240
|
class: "bg-white pd-big radius-big"
|
244
241
|
}, {
|
245
|
-
default:
|
246
|
-
a(
|
247
|
-
onAdd:
|
242
|
+
default: l(() => [
|
243
|
+
a(D, {
|
244
|
+
onAdd: c[2] || (c[2] = (t) => v.add(
|
248
245
|
e.current.ingredients,
|
249
246
|
t
|
250
247
|
)),
|
@@ -253,39 +250,10 @@ const j = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, G = { class
|
|
253
250
|
}, null, 8, ["products"])
|
254
251
|
]),
|
255
252
|
_: 1
|
256
|
-
}, 8, ["isPopupOpen"])
|
257
|
-
a(d, {
|
258
|
-
title: "Ingredients",
|
259
|
-
placeholder: "No positions added yet",
|
260
|
-
actions: [{
|
261
|
-
label: "+",
|
262
|
-
function: () => N()
|
263
|
-
}]
|
264
|
-
}, {
|
265
|
-
default: r(() => [
|
266
|
-
c("div", X, [
|
267
|
-
(i(!0), s(m, null, f(e.current.ingredients, (t, n) => (i(), y(z, {
|
268
|
-
key: t._id,
|
269
|
-
product: t,
|
270
|
-
array: e.current.ingredients,
|
271
|
-
products: w.value,
|
272
|
-
onAdd: u[2] || (u[2] = (l) => {
|
273
|
-
v.add(e.current.ingredients, l), _();
|
274
|
-
}),
|
275
|
-
onUpdate: (l) => {
|
276
|
-
v.update(e.current.ingredients, l, n), _();
|
277
|
-
},
|
278
|
-
onDelete: (l) => {
|
279
|
-
v.delete(e.current.ingredients, l, n), _();
|
280
|
-
}
|
281
|
-
}, null, 8, ["product", "array", "products", "onUpdate", "onDelete"]))), 128))
|
282
|
-
])
|
283
|
-
]),
|
284
|
-
_: 1
|
285
|
-
}, 8, ["actions"])
|
253
|
+
}, 8, ["isPopupOpen"])
|
286
254
|
]));
|
287
255
|
}
|
288
256
|
};
|
289
257
|
export {
|
290
|
-
|
258
|
+
he as default
|
291
259
|
};
|
package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Field/Field.vue.cjs"),L={key:0,class:"mn-b-small w-100"},k={class:"w-100 flex-nowrap flex"},w=["onClick"],E=e.createElementVNode("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"24",height:"24",transform:"translate(1 1)"}),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9996 10.8L22.8994 0.900244L25.0993 3.1002L15.1995 13L25.0993 22.8998L22.8994 25.0998L12.9996 15.2L3.09976 25.0998L0.899801 22.8998L10.7996 13L0.899801 3.1002L3.09976 0.900244L12.9996 10.8Z",fill:"rgb(var(--white))"})],-1),g=[E],N=e.createElementVNode("hr",{class:"mn-b-medium"},null,-1),V=["onClick"],B=e.createElementVNode("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("rect",{width:"24",height:"24",transform:"translate(1 1)"}),e.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9996 10.8L22.8994 0.900244L25.0993 3.1002L15.1995 13L25.0993 22.8998L22.8994 25.0998L12.9996 15.2L3.09976 25.0998L0.899801 22.8998L10.7996 13L0.899801 3.1002L3.09976 0.900244L12.9996 10.8Z",fill:"rgb(var(--white))"})],-1),x=[B],C=e.createElementVNode("hr",{class:"mn-b-medium"},null,-1),U=["onClick"],y={__name:"EditModifications",props:{product:Object},emits:["add-modification","delete-modification","add-characteristic","delete-characteristic","submit"],setup(u,{emit:m}){const o=m,f=u,{product:r}=e.toRefs(f);function p(){o("add-modification")}function h(l){o("delete-modification",l)}function b(l){o("add-characteristic",l)}function _(l,d){o("delete-characteristic",{modIndex:l,charIndex:d})}function v(){o("submit")}return(l,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.unref(r).modifications.length==0?(e.openBlock(),e.createElementBlock("p",L,"У продукта еще не заданы модификации.")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).modifications,(n,i)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-b-small flex-column flex-wrap block",key:i},[e.createElementVNode("div",k,[e.createVNode(c.default,{field:n.quantity,"onUpdate:field":t=>n.quantity=t,disabled:!0,placeholder:"Количество",class:"mn-b-medium input-text input",type:"number"},null,8,["field","onUpdate:field"]),e.createVNode(c.default,{field:n.name,"onUpdate:field":t=>n.name=t,placeholder:"Новая модификация",class:"mn-b-medium input-text input"},null,8,["field","onUpdate:field"]),e.createElementVNode("button",{onClick:t=>h(i),class:"mn-l-small i-normal pd-regular button-delete button"},g,8,w)]),N,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.characteristics,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-b-medium w-100 flex-nowrap flex variants-wrapper",key:s},[e.createVNode(c.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Название параметра",class:"input-text input"},null,8,["field","onUpdate:field"]),e.createVNode(c.default,{field:t.value,"onUpdate:field":a=>t.value=a,placeholder:"Значение параметра",class:"mn-l-small input-text input"},null,8,["field","onUpdate:field"]),e.createElementVNode("button",{onClick:a=>_(i,s),class:"mn-l-small i-normal pd-regular button-delete button"},x,8,V)]))),128)),C,e.createElementVNode("button",{onClick:t=>b(i),class:"button"},"Добавить характеристику",8,U)]))),128)),e.createElementVNode("div",{class:"mn-b-big t-center flex-center flex block"},[e.createElementVNode("button",{onClick:p,class:"w-100"},"Добавить модификацю")]),e.createElementVNode("button",{onClick:d[0]||(d[0]=n=>v()),class:"button"},"Сохранить модификации")]))}};exports.default=y;
|
package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { toRefs as U, openBlock as i, createElementBlock as o, unref as p, createCommentVNode as y, Fragment as h, renderList as b, createElementVNode as e, createVNode as r } from "vue";
|
2
|
-
import u from "../../../../components/Field/Field.
|
2
|
+
import u from "../../../../components/Field/Field.vue.js";
|
3
3
|
const M = {
|
4
4
|
key: 0,
|
5
5
|
class: "mn-b-small w-100"
|
package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("vue");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.vue2.cjs");const r=require("../../../../components/Field/Field.vue.cjs"),u=require("../../../../components/Select/Select.vue.cjs"),i={__name:"EditProductInfo",props:{product:Object},setup(e){return(a,t)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode(u.default,{select:e.product.status,"onUpdate:select":t[0]||(t[0]=l=>e.product.status=l),label:"Status",options:["unpublished","published","archivied"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),d.createVNode(r.default,{field:e.product.name,"onUpdate:field":t[1]||(t[1]=l=>e.product.name=l),label:"Name",placeholder:"Enter product name",class:"w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["field"]),d.createVNode(r.default,{field:e.product.price,"onUpdate:field":t[3]||(t[3]=l=>e.product.price=l),label:"Price",placeholder:"Enter product price",class:"w-100 mn-b-small bg-white radius-small pd-medium",type:"number"},{default:d.withCtx(()=>[d.createVNode(u.default,{select:e.product.price.currency,"onUpdate:select":t[2]||(t[2]=l=>e.product.price.currency=l),placeholder:"฿",options:["฿"],class:"pos-relative bg-grey pd-thin radius-thin"},null,8,["select"])]),_:1},8,["field"]),d.createVNode(r.default,{field:e.product.description,"onUpdate:field":t[4]||(t[4]=l=>e.product.description=l),label:"Description",placeholder:"Enter product description",class:"w-100 bg-white radius-small pd-medium",type:"textarea"},null,8,["field"])],64))}};exports.default=i;
|