@ozdao/prometheus-framework 0.2.101 → 0.2.103

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/dist/main-DfD5hLQo.mjs +13633 -0
  2. package/dist/main-DwyUYWFX.js +92 -0
  3. package/dist/orders.server.js +16 -0
  4. package/dist/orders.server.mjs +16 -0
  5. package/dist/products.server.js +7 -1
  6. package/dist/products.server.mjs +7 -1
  7. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  9. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -94
  11. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +94 -1
  13. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +23 -21
  15. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  16. package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
  17. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  18. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
  19. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  21. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -36
  23. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
  25. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
  27. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  28. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  43. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  47. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  49. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  51. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  53. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  57. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  59. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  61. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  63. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  65. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  67. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  69. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
  73. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
  75. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
  77. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  79. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
  81. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  83. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  85. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  89. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +3 -3
  93. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +3 -3
  95. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
  97. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  99. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  101. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  103. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  105. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  107. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +87 -67
  109. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  111. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  117. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +30 -31
  119. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +120 -88
  123. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  129. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  131. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  135. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  137. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  139. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  141. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  143. package/dist/prometheus-framework.cjs.js +1 -1
  144. package/dist/prometheus-framework.es.js +1 -1
  145. package/dist/style.css +1 -1
  146. package/dist/web-C0sFgeYh.mjs +54 -0
  147. package/dist/web-kg3KgbAF.js +1 -0
  148. package/package.json +1 -1
  149. package/src/components/Feed/Feed.vue +9 -10
  150. package/src/modules/orders/controllers/orders.controller.js +20 -1
  151. package/src/modules/products/components/blocks/CardPosition.vue +32 -7
  152. package/src/modules/products/components/pages/EditLeftover.vue +0 -3
  153. package/src/modules/products/components/pages/ProductEdit.vue +51 -15
  154. package/src/modules/products/controllers/products.controller.js +1 -2
  155. package/src/modules/products/models/product.model.js +6 -0
  156. package/src/modules/products/routes/products.routes.js +1 -10
@@ -1,11 +1,11 @@
1
1
  import { ref as m, withAsyncContext as b, watch as _, openBlock as t, createElementBlock as i, createElementVNode as f, createBlock as p, Fragment as g, renderList as h, normalizeClass as w } from "vue";
2
2
  import { useRouter as v, useRoute as z } from "vue-router";
3
3
  import "../../../../../../node_modules/js-cookie/dist/js.cookie.js";
4
- import "../../../../components/Tab/Tab.vue2.js";
5
- import "../../../../components/Field/Field.vue2.js";
4
+ import "../../../../components/Tab/Tab.vue.js";
5
+ import "../../../../components/Field/Field.vue.js";
6
6
  import "../../../../components/Select/Select.vue2.js";
7
7
  import "../../../../components/Loader/Loader.vue.js";
8
- import "../../../../components/Button/Button.vue2.js";
8
+ import "../../../../components/Button/Button.vue.js";
9
9
  import "../../../../components/Dropdown/Dropdown.vue2.js";
10
10
  import "../../../../components/Chips/Chips.vue2.js";
11
11
  import { state as k } from "../../../auth/store/auth.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../../../../components/Field/Field.vue.cjs"),f=require("../../../../components/Select/Select.vue.cjs"),y=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),g=require("../../../icons/navigation/IconAdd.vue.cjs"),V=require("../../../icons/navigation/IconDelete.vue.cjs"),k={class:"gap-thin"},h={class:"gap-thin mn-b-thin flex-nowrap flex"},q=["disabled"],w={class:"gap-thin flex-nowrap flex"},x={__name:"CardPosition",props:{product:Object,array:Array,products:Array},emits:["add","delete","update"],setup(s,{emit:i}){const t=s,c=i,l=e.ref(null),a=e.ref(1),r=e.ref("pcs"),u=e.ref(0),p=e.computed(()=>l.value&&a.value>0&&u.value>0);e.watch(t.array,()=>{l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type}),t.product&&(l.value=t.product,a.value=t.product.quantity||1,u.value=t.product.price,r.value=t.product.type),e.watch([l,a,u,r],()=>{c("update",{...l.value,price:u.value,quantity:a.value||1,type:r.value})});function m(){c("add",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}function v(){c("delete",{...l.value,price:u.value,quantity:a.value||1,type:r.value})}return(b,d)=>(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("div",h,[e.createVNode(y.default,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=o=>l.value=o),options:s.products,label:"name",multiple:!1,taggable:!1,placeholder:"Select a product",class:"bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["modelValue","options"]),s.product?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,disabled:!p.value,onClick:m,class:"bg-main aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(g.default),{class:"i-semi"})],8,q)),s.product?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:v,class:"bg-red aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(V.default),{class:"i-semi"})])):e.createCommentVNode("",!0)]),e.createElementVNode("div",w,[e.createVNode(n.default,{field:u.value,"onUpdate:field":d[1]||(d[1]=o=>u.value=o),type:"number",label:"Price",symbol:b.returnCurrency(),class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["field","symbol"]),e.createVNode(n.default,{field:a.value,"onUpdate:field":d[3]||(d[3]=o=>a.value=o),type:"number",label:"Qty",class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(f.default,{select:r.value,"onUpdate:select":d[2]||(d[2]=o=>r.value=o),options:["pcs","g","ml"],class:"bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])])]))}};exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Field/Field.vue2.cjs"),i=require("../../../../components/Select/Select.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const y=require("../../../icons/navigation/IconAdd.vue.cjs"),k=require("../../../icons/navigation/IconDelete.vue.cjs"),w={class:"gap-thin"},g={class:"gap-thin mn-b-thin flex-nowrap flex"},h={class:"bg-white w-100 w-min-15r br-solid br-1px br-black-transp-5 pd-small radius-small"},x=["disabled"],V={key:0,class:"gap-thin flex-nowrap flex"},N={__name:"CardPosition",props:{product:Object,products:Array,array:Array,showPrice:{type:Boolean,default:!0}},emits:["add","delete","update"],setup(s,{emit:p}){const l=s,n=p,u=e.ref(null),t=e.ref(1),a=e.ref("pcs"),d=e.ref(0),m=e.computed(()=>u.value&&t.value>0&&d.value>=0);e.watch(l.array,()=>{u.value=l.product,t.value=l.product.quantity||1,d.value=l.product.price,a.value=l.product.type}),l.product&&(u.value=l.product,t.value=l.product.quantity||1,d.value=l.product.price,a.value=l.product.type),e.watch([u,t,d,a],()=>{n("update",{...u.value,price:d.value,quantity:t.value||1,type:a.value})});function v(){n("add",{...u.value,price:d.value,quantity:t.value||1,type:a.value})}function b(){n("delete",{...u.value,price:d.value,quantity:t.value||1,type:a.value})}return(f,r)=>(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",g,[e.createElementVNode("div",h,e.toDisplayString(u.value.name||u.value._id.name),1),s.showPrice?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c.default,{key:0,field:t.value,"onUpdate:field":r[1]||(r[1]=o=>t.value=o),type:"number",label:"Qty",class:"bg-white w-100 w-max-10r br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(i.default,{select:a.value,"onUpdate:select":r[0]||(r[0]=o=>a.value=o),options:["pcs","g","ml"],class:"bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])),s.product?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:1,disabled:!m.value,onClick:v,class:"bg-main aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(y.default),{class:"i-semi"})],8,x)),s.product?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:b,class:"bg-red aspect-1x1 radius-small pd-small"},[e.createVNode(e.unref(k.default),{class:"i-semi"})])):e.createCommentVNode("",!0)]),s.showPrice?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(c.default,{field:d.value,"onUpdate:field":r[2]||(r[2]=o=>d.value=o),type:"number",label:"Price",symbol:f.returnCurrency(),class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},null,8,["field","symbol"]),e.createVNode(c.default,{field:t.value,"onUpdate:field":r[4]||(r[4]=o=>t.value=o),type:"number",label:"Qty",class:"bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"},{default:e.withCtx(()=>[e.createVNode(i.default,{select:a.value,"onUpdate:select":r[3]||(r[3]=o=>a.value=o),options:["pcs","g","ml"],class:"bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"},null,8,["select"])]),_:1},8,["field"])])):e.createCommentVNode("",!0)]))}};exports.default=N;
@@ -1,99 +1,119 @@
1
- import { ref as i, computed as V, watch as m, openBlock as n, createElementBlock as c, createElementVNode as v, createVNode as s, unref as b, createCommentVNode as f, withCtx as C } from "vue";
2
- import y from "../../../../components/Field/Field.vue.js";
3
- import P from "../../../../components/Select/Select.vue.js";
4
- import q from "../../../../components/SelectMulti/SelectMulti.vue.js";
5
- import S from "../../../icons/navigation/IconAdd.vue.js";
6
- import U from "../../../icons/navigation/IconDelete.vue.js";
7
- const _ = { class: "gap-thin" }, N = { class: "gap-thin mn-b-thin flex-nowrap flex" }, Q = ["disabled"], A = { class: "gap-thin flex-nowrap flex" }, O = {
1
+ import { ref as n, computed as q, watch as v, openBlock as o, createElementBlock as p, createElementVNode as y, toDisplayString as U, createBlock as B, withCtx as f, createVNode as d, createCommentVNode as c, unref as w } from "vue";
2
+ import b from "../../../../components/Field/Field.vue2.js";
3
+ import g from "../../../../components/Select/Select.vue.js";
4
+ import "../../../../components/SelectMulti/SelectMulti.vue2.js";
5
+ import Q from "../../../icons/navigation/IconAdd.vue.js";
6
+ import V from "../../../icons/navigation/IconDelete.vue.js";
7
+ const _ = { class: "gap-thin" }, N = { class: "gap-thin mn-b-thin flex-nowrap flex" }, S = { class: "bg-white w-100 w-min-15r br-solid br-1px br-black-transp-5 pd-small radius-small" }, A = ["disabled"], E = {
8
+ key: 0,
9
+ class: "gap-thin flex-nowrap flex"
10
+ }, z = {
8
11
  __name: "CardPosition",
9
12
  props: {
10
13
  product: Object,
14
+ products: Array,
11
15
  array: Array,
12
- products: Array
16
+ showPrice: {
17
+ type: Boolean,
18
+ default: !0
19
+ }
13
20
  },
14
21
  emits: [
15
22
  "add",
16
23
  "delete",
17
24
  "update"
18
25
  ],
19
- setup(d, { emit: g }) {
20
- const e = d, p = g, t = i(null), l = i(1), u = i("pcs"), a = i(0), x = V(
21
- () => t.value && l.value > 0 && a.value > 0
26
+ setup(i, { emit: h }) {
27
+ const t = i, m = h, r = n(null), e = n(1), l = n("pcs"), s = n(0), k = q(
28
+ () => r.value && e.value > 0 && s.value >= 0
22
29
  );
23
- m(e.array, () => {
24
- t.value = e.product, l.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type;
25
- }), e.product && (t.value = e.product, l.value = e.product.quantity || 1, a.value = e.product.price, u.value = e.product.type), m([t, l, a, u], () => {
26
- p("update", {
27
- ...t.value,
28
- price: a.value,
29
- quantity: l.value || 1,
30
- type: u.value
30
+ v(t.array, () => {
31
+ r.value = t.product, e.value = t.product.quantity || 1, s.value = t.product.price, l.value = t.product.type;
32
+ }), t.product && (r.value = t.product, e.value = t.product.quantity || 1, s.value = t.product.price, l.value = t.product.type), v([r, e, s, l], () => {
33
+ m("update", {
34
+ ...r.value,
35
+ price: s.value,
36
+ quantity: e.value || 1,
37
+ type: l.value
31
38
  });
32
39
  });
33
- function h() {
34
- p("add", {
35
- ...t.value,
36
- price: a.value,
37
- quantity: l.value || 1,
38
- type: u.value
40
+ function x() {
41
+ m("add", {
42
+ ...r.value,
43
+ price: s.value,
44
+ quantity: e.value || 1,
45
+ type: l.value
39
46
  });
40
47
  }
41
- function k() {
42
- p("delete", {
43
- ...t.value,
44
- price: a.value,
45
- quantity: l.value || 1,
46
- type: u.value
48
+ function P() {
49
+ m("delete", {
50
+ ...r.value,
51
+ price: s.value,
52
+ quantity: e.value || 1,
53
+ type: l.value
47
54
  });
48
55
  }
49
- return (w, r) => (n(), c("div", _, [
50
- v("div", N, [
51
- s(q, {
52
- modelValue: t.value,
53
- "onUpdate:modelValue": r[0] || (r[0] = (o) => t.value = o),
54
- options: d.products,
55
- label: "name",
56
- multiple: !1,
57
- taggable: !1,
58
- placeholder: "Select a product",
59
- class: "bg-white br-solid br-1px br-black-transp-5 pd-small radius-small"
60
- }, null, 8, ["modelValue", "options"]),
61
- d.product ? f("", !0) : (n(), c("button", {
56
+ return (C, a) => (o(), p("div", _, [
57
+ y("div", N, [
58
+ y("div", S, U(r.value.name || r.value._id.name), 1),
59
+ i.showPrice ? c("", !0) : (o(), B(b, {
62
60
  key: 0,
63
- disabled: !x.value,
64
- onClick: h,
61
+ field: e.value,
62
+ "onUpdate:field": a[1] || (a[1] = (u) => e.value = u),
63
+ type: "number",
64
+ label: "Qty",
65
+ class: "bg-white w-100 w-max-10r br-solid br-1px br-black-transp-5 pd-small radius-small"
66
+ }, {
67
+ default: f(() => [
68
+ d(g, {
69
+ select: l.value,
70
+ "onUpdate:select": a[0] || (a[0] = (u) => l.value = u),
71
+ options: [
72
+ "pcs",
73
+ "g",
74
+ "ml"
75
+ ],
76
+ class: "bg-grey pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"
77
+ }, null, 8, ["select"])
78
+ ]),
79
+ _: 1
80
+ }, 8, ["field"])),
81
+ i.product ? c("", !0) : (o(), p("button", {
82
+ key: 1,
83
+ disabled: !k.value,
84
+ onClick: x,
65
85
  class: "bg-main aspect-1x1 radius-small pd-small"
66
86
  }, [
67
- s(b(S), { class: "i-semi" })
68
- ], 8, Q)),
69
- d.product ? (n(), c("button", {
70
- key: 1,
71
- onClick: k,
87
+ d(w(Q), { class: "i-semi" })
88
+ ], 8, A)),
89
+ i.product ? (o(), p("button", {
90
+ key: 2,
91
+ onClick: P,
72
92
  class: "bg-red aspect-1x1 radius-small pd-small"
73
93
  }, [
74
- s(b(U), { class: "i-semi" })
75
- ])) : f("", !0)
94
+ d(w(V), { class: "i-semi" })
95
+ ])) : c("", !0)
76
96
  ]),
77
- v("div", A, [
78
- s(y, {
79
- field: a.value,
80
- "onUpdate:field": r[1] || (r[1] = (o) => a.value = o),
97
+ i.showPrice ? (o(), p("div", E, [
98
+ d(b, {
99
+ field: s.value,
100
+ "onUpdate:field": a[2] || (a[2] = (u) => s.value = u),
81
101
  type: "number",
82
102
  label: "Price",
83
- symbol: w.returnCurrency(),
103
+ symbol: C.returnCurrency(),
84
104
  class: "bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
85
105
  }, null, 8, ["field", "symbol"]),
86
- s(y, {
87
- field: l.value,
88
- "onUpdate:field": r[3] || (r[3] = (o) => l.value = o),
106
+ d(b, {
107
+ field: e.value,
108
+ "onUpdate:field": a[4] || (a[4] = (u) => e.value = u),
89
109
  type: "number",
90
110
  label: "Qty",
91
111
  class: "bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
92
112
  }, {
93
- default: C(() => [
94
- s(P, {
95
- select: u.value,
96
- "onUpdate:select": r[2] || (r[2] = (o) => u.value = o),
113
+ default: f(() => [
114
+ d(g, {
115
+ select: l.value,
116
+ "onUpdate:select": a[3] || (a[3] = (u) => l.value = u),
97
117
  options: [
98
118
  "pcs",
99
119
  "g",
@@ -104,10 +124,10 @@ const _ = { class: "gap-thin" }, N = { class: "gap-thin mn-b-thin flex-nowrap fl
104
124
  ]),
105
125
  _: 1
106
126
  }, 8, ["field"])
107
- ])
127
+ ])) : c("", !0)
108
128
  ]));
109
129
  }
110
130
  };
111
131
  export {
112
- O as default
132
+ z as default
113
133
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),s=require("../../../../components/Field/Field.vue.cjs"),d=require("../../store/leftovers.cjs");require("./LeftoverPositions.vue2.cjs");const u={class:"flex-column flex-wrap block"},m={key:0,class:"w-100"},f={class:"mn-r-regular w-100"},p=["onClick"],y={__name:"LeftoverPositions",props:{order:Object},setup(o){r.useRouter(),r.useRoute();const i=o;function a(n){d.actions.deleteItemFromLeftover(i.order.positions[n])}return(n,b)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",u,[o.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",m," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.order.positions,(t,c)=>(e.openBlock(),e.createElementBlock("li",{key:t._id,class:"w-100 flex-center flex-nowrap flex"},[e.createElementVNode("span",f,e.toDisplayString(t.name),1),e.createVNode(s.default,{field:t.price,"onUpdate:field":l=>t.price=l,type:"number",label:"Price",symbol:n.returnCurrency(),class:"bg-grey pd-medium radius-small"},null,8,["field","onUpdate:field","symbol"]),e.createVNode(s.default,{field:t.quantity,"onUpdate:field":l=>t.quantity=l,type:"number",label:"Quantity",class:"bg-grey pd-medium radius-small",symbol:t.type},null,8,["field","onUpdate:field","symbol"]),e.createElementVNode("a",{class:"button",onClick:l=>a(c)}," Delete ",8,p)]))),128))])]))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),s=require("../../../../components/Field/Field.vue2.cjs"),d=require("../../store/leftovers.cjs");require("./LeftoverPositions.vue2.cjs");const u={class:"flex-column flex-wrap block"},m={key:0,class:"w-100"},f={class:"mn-r-regular w-100"},p=["onClick"],y={__name:"LeftoverPositions",props:{order:Object},setup(o){r.useRouter(),r.useRoute();const i=o;function a(n){d.actions.deleteItemFromLeftover(i.order.positions[n])}return(n,b)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",u,[o.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",m," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.order.positions,(t,c)=>(e.openBlock(),e.createElementBlock("li",{key:t._id,class:"w-100 flex-center flex-nowrap flex"},[e.createElementVNode("span",f,e.toDisplayString(t.name),1),e.createVNode(s.default,{field:t.price,"onUpdate:field":l=>t.price=l,type:"number",label:"Price",symbol:n.returnCurrency(),class:"bg-grey pd-medium radius-small"},null,8,["field","onUpdate:field","symbol"]),e.createVNode(s.default,{field:t.quantity,"onUpdate:field":l=>t.quantity=l,type:"number",label:"Quantity",class:"bg-grey pd-medium radius-small",symbol:t.type},null,8,["field","onUpdate:field","symbol"]),e.createElementVNode("a",{class:"button",onClick:l=>a(c)}," Delete ",8,p)]))),128))])]))}};exports.default=y;
@@ -1,6 +1,6 @@
1
1
  import { openBlock as o, createElementBlock as l, createElementVNode as s, createCommentVNode as u, Fragment as f, renderList as p, toDisplayString as y, createVNode as i } from "vue";
2
2
  import { useRouter as b, useRoute as _ } from "vue-router";
3
- import a from "../../../../components/Field/Field.vue.js";
3
+ import a from "../../../../components/Field/Field.vue2.js";
4
4
  import { actions as g } from "../../store/leftovers.js";
5
5
  import "./LeftoverPositions.vue2.js";
6
6
  const k = { class: "flex-column flex-wrap block" }, h = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router");require("../../../../components/Field/Field.vue2.cjs");const i=require("./CardPosition.vue.cjs"),u=require("../../store/leftovers.cjs");require("./ListPositions.vue2.cjs");const a={class:"flex-column flex-wrap"},d={key:0,class:"w-100"},m={class:"flex-v-center flex radius-medium pd-small bg-white w-100"},p={__name:"ListPositions",props:{order:Object},setup(t){n.useRouter(),n.useRoute();const l=t;function s(r){u.actions.deleteItemFromLeftover(l.order.positions[r])}return(r,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",a,[t.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",d," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.order.positions,(o,c)=>(e.openBlock(),e.createElementBlock("li",{key:o._id,class:"w-100 gap-small flex-stretch flex-center flex-nowrap flex"},[e.createElementVNode("span",m,e.toDisplayString(o.name),1),e.createVNode(i.default,{products:[],product:o,onAdd:_=>s(c)},null,8,["product","onAdd"])]))),128))])]))}};exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("vue-router");require("../../../../components/Field/Field.vue.cjs");const i=require("./CardPosition.vue.cjs"),u=require("../../store/leftovers.cjs");require("./ListPositions.vue2.cjs");const a={class:"flex-column flex-wrap"},d={key:0,class:"w-100"},m={class:"flex-v-center flex radius-medium pd-small bg-white w-100"},p={__name:"ListPositions",props:{order:Object},setup(t){n.useRouter(),n.useRoute();const l=t;function s(r){u.actions.deleteItemFromLeftover(l.order.positions[r])}return(r,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("ul",a,[t.order.positions.length===0?(e.openBlock(),e.createElementBlock("span",d," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.order.positions,(o,c)=>(e.openBlock(),e.createElementBlock("li",{key:o._id,class:"w-100 gap-small flex-stretch flex-center flex-nowrap flex"},[e.createElementVNode("span",m,e.toDisplayString(o.name),1),e.createVNode(i.default,{products:[],product:o,onAdd:_=>s(c)},null,8,["product","onAdd"])]))),128))])]))}};exports.default=p;
@@ -1,6 +1,6 @@
1
1
  import { openBlock as e, createElementBlock as t, createElementVNode as n, createCommentVNode as d, Fragment as a, renderList as m, toDisplayString as p, createVNode as u } from "vue";
2
2
  import { useRouter as f, useRoute as _ } from "vue-router";
3
- import "../../../../components/Field/Field.vue2.js";
3
+ import "../../../../components/Field/Field.vue.js";
4
4
  import x from "./CardPosition.vue.js";
5
5
  import { actions as h } from "../../store/leftovers.js";
6
6
  import "./ListPositions.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),l=require("vue-router"),t=require("../../store/categories.cjs"),d=require("../../../../components/Button/Button.vue.cjs"),m=require("../../../../components/Block/Block.vue.cjs"),g=require("../blocks/CardCategory.vue.cjs"),f={class:"pd-thin"},p=e.createElementVNode("h1",{class:"mn-r-auto"}," Product Categories ",-1),_={__name:"Categories",setup(C){l.useRoute(),l.useRouter(),e.onMounted(async()=>{await t.actions.fetchCategories()});function s(){t.state.all.forEach((r,a)=>{r.order=a}),o()}async function o(){await t.actions.updateCategories(t.state.all)}async function i(r){confirm(`Are you sure you want to delete the category "${r.name}"?`)?await t.actions.deleteCategory(r.url):alert("Category deletion cancelled")}return(r,a)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",f,[e.createVNode(m.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[p,e.createVNode(u,{to:{name:"CategoryAdd",params:{_id:r.$route.params._id}},class:"mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"},{default:e.withCtx(()=>[e.createTextVNode(" Add category ")]),_:1},8,["to"]),e.createVNode(d.default,{onClick:o,class:"pd-small radius-big bg-black t-white uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Change Order ")]),_:1})]),_:1}),e.createVNode(e.unref(c.VueDraggableNext),{class:"dragArea list-group w-full",list:t.state.all,"item-key":"order",onEnd:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.all,(n,h)=>(e.openBlock(),e.createBlock(g.default,{key:n.id,category:n,onDelete:i,class:"pd-medium bg-grey radius-medium mn-b-thin"},null,8,["category"]))),128))]),_:1},8,["list"])])}}};exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.cjs"),l=require("vue-router"),t=require("../../store/categories.cjs"),d=require("../../../../components/Button/Button.vue2.cjs"),m=require("../../../../components/Block/Block.vue.cjs"),g=require("../blocks/CardCategory.vue.cjs"),f={class:"pd-thin"},p=e.createElementVNode("h1",{class:"mn-r-auto"}," Product Categories ",-1),_={__name:"Categories",setup(C){l.useRoute(),l.useRouter(),e.onMounted(async()=>{await t.actions.fetchCategories()});function s(){t.state.all.forEach((r,a)=>{r.order=a}),o()}async function o(){await t.actions.updateCategories(t.state.all)}async function i(r){confirm(`Are you sure you want to delete the category "${r.name}"?`)?await t.actions.deleteCategory(r.url):alert("Category deletion cancelled")}return(r,a)=>{const u=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",f,[e.createVNode(m.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[p,e.createVNode(u,{to:{name:"CategoryAdd",params:{_id:r.$route.params._id}},class:"mn-r-medium uppercase t-medium pd-small radius-big bg-white nav-link"},{default:e.withCtx(()=>[e.createTextVNode(" Add category ")]),_:1},8,["to"]),e.createVNode(d.default,{onClick:o,class:"pd-small radius-big bg-black t-white uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Change Order ")]),_:1})]),_:1}),e.createVNode(e.unref(c.VueDraggableNext),{class:"dragArea list-group w-full",list:t.state.all,"item-key":"order",onEnd:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.all,(n,h)=>(e.openBlock(),e.createBlock(g.default,{key:n.id,category:n,onDelete:i,class:"pd-medium bg-grey radius-medium mn-b-thin"},null,8,["category"]))),128))]),_:1},8,["list"])])}}};exports.default=_;
@@ -2,7 +2,7 @@ import { onMounted as p, resolveComponent as _, openBlock as i, createElementBlo
2
2
  import { VueDraggableNext as k } from "../../../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js";
3
3
  import { useRoute as w, useRouter as x } from "vue-router";
4
4
  import { actions as n, state as a } from "../../store/categories.js";
5
- import $ from "../../../../components/Button/Button.vue.js";
5
+ import $ from "../../../../components/Button/Button.vue2.js";
6
6
  import v from "../../../../components/Block/Block.vue.js";
7
7
  import A from "../blocks/CardCategory.vue.js";
8
8
  const E = { class: "pd-thin" }, N = /* @__PURE__ */ b("h1", { class: "mn-r-auto" }, " Product Categories ", -1), T = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue.cjs"),g=require("../../../../components/Select/Select.vue.cjs"),d=require("../../../../components/Field/Field.vue.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");require("./CategoryEdit.vue2.cjs");const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("vue-router"),i=require("../../../icons/navigation/IconDelete.vue.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),g=require("../../../../components/Select/Select.vue.cjs"),d=require("../../../../components/Field/Field.vue2.cjs"),n=require("../../../../components/Block/Block.vue.cjs"),l=require("../../store/categories.cjs");require("./CategoryEdit.vue2.cjs");const b={class:"mn-r-auto"},h={class:"mn-b-medium w-100 flex-nowrap gap-thin flex"},w={class:"flex-v-center flex-nowrap flex"},x=e.createElementVNode("h4",{class:"mn-r-thin t-medium"},"Localization",-1),N=["onClick"],k=["onClick"],V=["onClick"],y={__name:"CategoryEdit",setup(C){const o=c.useRoute(),u=c.useRouter();o.params.category?l.actions.fetchCategory(o.params.category):l.actions.resetCategory(),e.computed(()=>l.state.current),e.computed(()=>o.name);function m(){o.params.category?l.actions.updateCategory(o.params.category):l.actions.addCategory()}function p(){u.push({name:"Categories Organization",params:{_id:o.params._id}})}return(_,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n.default,{class:"radius-big mn-b-thin flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",b,e.toDisplayString(e.unref(o).params.category?"Edit Category":"Add Category"),1),e.createVNode(f.default,{submit:m,callback:p,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Save Category ")]),_:1})]),_:1}),e.createVNode(n.default,{title:"Profile",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",h,[e.createVNode(d.default,{field:l.state.current.order,"onUpdate:field":r[0]||(r[0]=t=>l.state.current.order=t),label:"Order",disabled:!0,class:"w-25 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.url,"onUpdate:field":r[1]||(r[1]=t=>l.state.current.url=t),label:"URL",placeholder:"Enter category URL",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"]),e.createVNode(d.default,{field:l.state.current.name,"onUpdate:field":r[2]||(r[2]=t=>l.state.current.name=t),label:"Name",placeholder:"Enter category name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field"])]),e.createVNode(g.default,{select:l.state.current.status,"onUpdate:select":r[3]||(r[3]=t=>l.state.current.status=t),label:"Status",options:["draft","internal","published","removed"],placeholder:"Display product",class:"pos-relative w-100 mn-b-small bg-white radius-small pd-medium"},null,8,["select"]),e.createElementVNode("div",w,[x,e.createElementVNode("button",{onClick:r[4]||(r[4]=()=>l.state.current.localization.push({locale:"",text:""})),class:"i-small pd-thin button-delete button"}," + ")]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.localization,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.locale,"onUpdate:field":a=>t.locale=a,placeholder:"Locale",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.text,"onUpdate:field":a=>t.text=a,placeholder:"Text",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.localization.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,N)]))),128))]),_:1}),e.createVNode(n.default,{title:"Subcategories",placeholder:"No subcategories added yet",actions:[{label:"+",function:()=>l.state.current.subcategories.push({name:"",url:""})}],class:"mn-b-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.subcategories,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Subcategory name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.url,"onUpdate:field":a=>t.url=a,placeholder:"Subcategory",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.subcategories.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,k)]))),128))]),_:1},8,["actions"]),e.createVNode(n.default,{title:"Filters",placeholder:"No filters added yet",actions:[{label:"+",function:()=>l.state.current.filters.push({name:"",url:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.state.current.filters,(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:s},[e.createVNode(d.default,{field:t.name,"onUpdate:field":a=>t.name=a,placeholder:"Filter name",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(d.default,{field:t.options,"onUpdate:field":a=>t.options=a,placeholder:"Filter options divided by ,",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",{onClick:()=>l.state.current.filters.splice(s,1),class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},[e.createVNode(i.default,{class:"i-medium"})],8,V)]))),128))]),_:1},8,["actions"])],64))}};exports.default=y;
@@ -1,9 +1,9 @@
1
1
  import { computed as h, openBlock as o, createElementBlock as c, Fragment as m, createVNode as l, withCtx as u, createElementVNode as d, toDisplayString as _, unref as U, createTextVNode as C, renderList as b } from "vue";
2
2
  import { useRoute as k, useRouter as v } from "vue-router";
3
3
  import g from "../../../icons/navigation/IconDelete.vue.js";
4
- import S from "../../../../components/Button/Button.vue.js";
4
+ import S from "../../../../components/Button/Button.vue2.js";
5
5
  import E from "../../../../components/Select/Select.vue.js";
6
- import i from "../../../../components/Field/Field.vue.js";
6
+ import i from "../../../../components/Field/Field.vue2.js";
7
7
  import p from "../../../../components/Block/Block.vue.js";
8
8
  import { actions as f, state as t } from "../../store/categories.js";
9
9
  import "./CategoryEdit.vue2.js";
@@ -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.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
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("../../../../components/Block/Block.vue.cjs"),w=require("../../../../components/Field/Field.vue2.cjs"),N=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"),x=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),v=require("vue-router"),p=require("../../../globals/store/globals.cjs"),V=require("../../../auth/store/auth.cjs"),t=require("../../store/leftovers.cjs"),m=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const B={class:"pd-thin"},E={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},S={class:""},D={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},L={class:"gap-thin flex-v-center flex-nojustify flex"},R={class:"mn-r-auto"},F={__name:"EditLeftover",setup(O){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 g(){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 _(){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:V.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",B,[e.createElementVNode("header",E,[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(()=>[e.createElementVNode("div",D,[e.createVNode(N.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(x.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:()=>g()}],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(w.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",L,[e.createElementVNode("h3",R," 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=>_())}," 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=F;
@@ -1,24 +1,24 @@
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";
1
+ import { ref as b, computed as z, onMounted as E, openBlock as l, createElementBlock as m, createElementVNode as n, toDisplayString as k, unref as h, 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.vue.js";
4
- import B from "../../../../components/Feed/Feed.vue.js";
5
- import F from "../../../../components/Select/Select.vue.js";
6
- import I from "../../../../components/Popup/Popup.vue.js";
3
+ import B from "../../../../components/Field/Field.vue2.js";
4
+ import F from "../../../../components/Feed/Feed.vue.js";
5
+ import I from "../../../../components/Select/Select.vue.js";
6
+ import O from "../../../../components/Popup/Popup.vue.js";
7
7
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
8
- import O from "../blocks/CardPosition.vue.js";
9
- import V from "../../../orders/components/blocks/CardOrderItem.vue.js";
8
+ import V from "../blocks/CardPosition.vue.js";
9
+ import A from "../../../orders/components/blocks/CardOrderItem.vue.js";
10
10
  import { useRoute as j, useRouter as q } from "vue-router";
11
11
  import { actions as y } from "../../../globals/store/globals.js";
12
12
  import { state as M } from "../../../auth/store/auth.js";
13
13
  import { state as e, actions as u } from "../../store/leftovers.js";
14
14
  import { state as G, actions as C } from "../../store/products.js";
15
15
  import "./EditLeftover.vue2.js";
16
- const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, K = { class: "" }, Q = /* @__PURE__ */ n("h3", { class: "mn-b-small" }, "Add to order", -1), T = { class: "bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big" }, W = { class: "gap-thin flex-v-center flex-nojustify flex" }, X = { class: "mn-r-auto" }, fe = {
16
+ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-center flex-nowrap flex" }, K = { class: "" }, Q = { class: "bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big" }, T = { class: "gap-thin flex-v-center flex-nojustify flex" }, W = { class: "mn-r-auto" }, de = {
17
17
  __name: "EditLeftover",
18
- setup(Y) {
19
- const t = j(), d = q(), g = h(G.all);
20
- h(null);
21
- const N = z(() => Number(e.current.positions.reduce((s, o) => Number(s) + Number(o.price), 0))), f = h(!1);
18
+ setup(X) {
19
+ const t = j(), d = q(), g = b(G.all);
20
+ b(null);
21
+ const N = z(() => Number(e.current.positions.reduce((s, o) => Number(s) + Number(o.price), 0))), f = b(!1);
22
22
  function S() {
23
23
  f.value = !0;
24
24
  }
@@ -68,10 +68,10 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
68
68
  (s) => console.error("error")
69
69
  );
70
70
  }
71
- return (s, o) => (l(), p("div", H, [
71
+ return (s, o) => (l(), m("div", H, [
72
72
  n("header", J, [
73
- n("h2", K, k(b(t).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
74
- a(F, {
73
+ n("h2", K, k(h(t).params.leftover ? "Edit " : "Add ") + " Inventory", 1),
74
+ a(I, {
75
75
  select: e.current.type,
76
76
  "onUpdate:select": o[0] || (o[0] = (r) => e.current.type = r),
77
77
  options: [
@@ -82,16 +82,15 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
82
82
  class: "bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"
83
83
  }, null, 8, ["select"])
84
84
  ]),
85
- a(I, {
85
+ a(O, {
86
86
  title: "Add position",
87
87
  onClosePopup: w,
88
88
  isPopupOpen: f.value,
89
89
  class: "bg-white w-min-30r w-max-30r radius-big pd-medium"
90
90
  }, {
91
91
  default: c(() => [
92
- Q,
93
- n("div", T, [
94
- a(B, {
92
+ n("div", Q, [
93
+ a(F, {
95
94
  search: !0,
96
95
  states: {
97
96
  empty: {
@@ -104,14 +103,14 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
104
103
  state: null
105
104
  },
106
105
  options: {
107
- organization: b(t).params._id
106
+ organization: h(t).params._id
108
107
  },
109
108
  class: ""
110
109
  }, {
111
110
  default: c(({
112
111
  items: r
113
112
  }) => [
114
- (l(!0), p(P, null, x(r, (i, m) => (l(), $(V, {
113
+ (l(!0), m(P, null, x(r, (i, p) => (l(), $(A, {
115
114
  key: i._id,
116
115
  editable: !1,
117
116
  product: i,
@@ -138,19 +137,19 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
138
137
  class: "mn-b-semi"
139
138
  }, {
140
139
  default: c(() => [
141
- (l(!0), p(P, null, x(e.current.positions, (r, i) => (l(), $(O, {
140
+ (l(!0), m(P, null, x(e.current.positions, (r, i) => (l(), $(V, {
142
141
  key: r._id,
143
142
  product: r,
144
143
  array: e.current.positions,
145
144
  products: g.value,
146
- onUpdate: (m) => y.update(
145
+ onUpdate: (p) => y.update(
147
146
  e.current.positions,
148
- m,
147
+ p,
149
148
  i
150
149
  ),
151
- onDelete: (m) => y.delete(
150
+ onDelete: (p) => y.delete(
152
151
  e.current.positions,
153
- m,
152
+ p,
154
153
  i
155
154
  ),
156
155
  class: "mn-b-small radius-medium bg-white pd-small"
@@ -163,7 +162,7 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
163
162
  class: "mn-b-semi"
164
163
  }, {
165
164
  default: c(() => [
166
- a(A, {
165
+ a(B, {
167
166
  field: e.current.comment,
168
167
  "onUpdate:field": o[1] || (o[1] = (r) => e.current.comment = r),
169
168
  label: "Comment",
@@ -175,8 +174,8 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
175
174
  }),
176
175
  a(v, { class: "" }, {
177
176
  default: c(() => [
178
- n("section", W, [
179
- n("h3", X, " In total: " + k(s.formatPrice(N.value)), 1),
177
+ n("section", T, [
178
+ n("h3", W, " In total: " + k(s.formatPrice(N.value)), 1),
180
179
  n("a", {
181
180
  onClick: o[2] || (o[2] = (r) => L()),
182
181
  class: "bg-main button"
@@ -185,7 +184,7 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
185
184
  class: "t-white bg-second button",
186
185
  onClick: o[3] || (o[3] = (r) => D())
187
186
  }, " Reset "),
188
- b(t).params.leftover ? (l(), p("a", {
187
+ h(t).params.leftover ? (l(), m("a", {
189
188
  key: 0,
190
189
  onClick: o[4] || (o[4] = (r) => R()),
191
190
  class: "t-white bg-red button"
@@ -198,5 +197,5 @@ const H = { class: "pd-thin" }, J = { class: "mn-b-medium gap-small flex-v-cente
198
197
  }
199
198
  };
200
199
  export {
201
- fe as default
200
+ de as default
202
201
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.vue.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),p=require("../blocks/CardLeftover.vue.cjs"),u=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const v={class:"pd-thin"},f={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),h={class:"mn-b-semi pd-medium bg-grey radius-big"},_=e.createElementVNode("p",{class:"mn-b-thin"},"Balance:",-1),g={__name:"Leftovers",setup(k){const l=a.useRoute();a.useRouter();const s=e.ref(l.query.tab?l.query.tab:"all"),c=e.computed(()=>u.state.all.reduce((o,r)=>{const t=r.positions.reduce((n,i)=>n+i.price,0);return r.type==="stock-in"?o-t:r.type==="stock-out"?o+t:o},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("header",f,[b,e.createElementVNode("button",{onClick:r[0]||(r[0]=t=>o.$router.push({name:"LeftoverAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createElementVNode("section",h,[_,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(c.value)),1)]),e.createVNode(d.default,{selected:s.value,"onUpdate:selected":r[1]||(r[1]=t=>s.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{search:!0,states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>u.actions.read(t)},options:{limit:15,owner:e.unref(l).params._id,...s.value!=="all"&&{type:s.value}}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(p.default,{leftover:n,class:"bg-grey pd-small mn-b-thin radius-small"},null,8,["leftover"]))),256))]),_:1},8,["store","options"])]))}};exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("vue-router"),d=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),p=require("../blocks/CardLeftover.vue.cjs"),u=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const v={class:"pd-thin"},f={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),h={class:"mn-b-semi pd-medium bg-grey radius-big"},_=e.createElementVNode("p",{class:"mn-b-thin"},"Balance:",-1),g={__name:"Leftovers",setup(k){const l=a.useRoute();a.useRouter();const s=e.ref(l.query.tab?l.query.tab:"all"),c=e.computed(()=>u.state.all.reduce((o,r)=>{const t=r.positions.reduce((n,i)=>n+i.price,0);return r.type==="stock-in"?o-t:r.type==="stock-out"?o+t:o},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("header",f,[b,e.createElementVNode("button",{onClick:r[0]||(r[0]=t=>o.$router.push({name:"LeftoverAdd"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createElementVNode("section",h,[_,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(c.value)),1)]),e.createVNode(d.default,{selected:s.value,"onUpdate:selected":r[1]||(r[1]=t=>s.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{search:!0,states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>u.actions.read(t)},options:{limit:15,owner:e.unref(l).params._id,...s.value!=="all"&&{type:s.value}}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(p.default,{leftover:n,class:"bg-grey pd-small mn-b-thin radius-small"},null,8,["leftover"]))),256))]),_:1},8,["store","options"])]))}};exports.default=g;
@@ -1,6 +1,6 @@
1
1
  import { ref as d, computed as p, openBlock as a, createElementBlock as i, createElementVNode as o, toDisplayString as f, createVNode as u, unref as v, withCtx as b, Fragment as _, renderList as h, createBlock as g } from "vue";
2
2
  import { useRoute as y, useRouter as k } from "vue-router";
3
- import L from "../../../../components/Tab/Tab.vue.js";
3
+ import L from "../../../../components/Tab/Tab.vue2.js";
4
4
  import w from "../../../../components/Feed/Feed.vue.js";
5
5
  import x from "../blocks/CardLeftover.vue.js";
6
6
  import { state as B, actions as C } from "../../store/leftovers.js";
@@ -1 +1 @@
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.vue2.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
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=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 d=require("../../../../components/Field/Field.vue2.cjs"),B=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../../components/Popup/Popup.vue.cjs"),V=require("../../../../components/Feed/Feed.vue.cjs"),y=require("../../../../components/EditImages/EditImages.vue.cjs"),b=require("../../../icons/navigation/IconDelete.vue.cjs"),q=require("../blocks/CardPosition.vue.cjs"),P=require("../../../orders/components/blocks/CardOrderItem.vue.cjs"),E=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),w=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const U={class:"for-transition w-100 cols-1 pd-thin gap-thin"},z={class:"mn-r-auto"},F={class:"cols-2 gap-thin"},I={key:0,class:"cols-1 gap-thin"},O={class:"bg-grey mn-b-thin h-min-20r h-max-20r o-scroll pd-medium radius-big"},D={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},L={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},S={__name:"ProductEdit",setup(T){const l=k.useRoute(),f=k.useRouter(),g=e.ref(t.state.all),p=e.ref(!1);function N(s){p.value=!0}function i(){p.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 w.actions.fetchCategories();try{const s=await t.actions.read({organization:l.params._id,limit:100});g.value=s}catch{console.error("error")}});function v(){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 h(){f.push({name:"Organization",params:{_id:l.params._id}})}return(s,c)=>(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",z,e.toDisplayString(e.unref(l).params.product?t.state.current.name:"Create Product"),1),e.unref(l).params.product?(e.openBlock(),e.createBlock(_.default,{key:0,submit:x,callback:h,class:"bg-red mn-r-thin"},{default:e.withCtx(()=>[e.createTextVNode(" Delete ")]),_:1})):e.createCommentVNode("",!0),e.createVNode(_.default,{submit:v,callback:h,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(y.default,{images:t.state.current.images,uploadPath:"photos","onUpdate:images":c[0]||(c[0]=a=>{t.state.current.images=a})},null,8,["images"])]),_:1}),e.createElementVNode("div",F,[e.createVNode(o.default,{title:"Profile"},{default:e.withCtx(()=>[e.createVNode(E.default,{product:t.state.current},null,8,["product"])]),_:1}),e.createVNode(o.default,{title:"Ingredients",placeholder:"No ingridients added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[t.state.current.ingredients.length>0?(e.openBlock(),e.createElementBlock("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,n)=>(e.openBlock(),e.createBlock(q.default,{key:a._id,product:a,array:t.state.current.ingredients,products:g.value,showPrice:!1,onAdd:c[1]||(c[1]=r=>{u.actions.add(t.state.current.ingredients,r),i()}),onUpdate:r=>{u.actions.update(t.state.current.ingredients,r,n),i()},onDelete:r=>{u.actions.delete(t.state.current.ingredients,r,n),i()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])):e.createCommentVNode("",!0)]),_:1},8,["actions"]),e.createVNode(C.default,{title:"Add ingredient",onClosePopup:i,isPopupOpen:p.value,class:"bg-white w-min-30r w-max-30r radius-big pd-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(V.default,{search:{class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:a=>t.actions.read(a),state:null},options:{organization:e.unref(l).params._id},class:""},{default:e.withCtx(({items:a})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(n,r)=>(e.openBlock(),e.createBlock(P.default,{key:n._id,editable:!1,product:n,onClick:()=>{let m={...n};m.quantity=1,m.type="pcs",u.actions.add(t.state.current.ingredients,m),i()},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(o.default,{title:"Categories",actions:[{label:"+",function:()=>e.unref(f).push({name:"Categories Organization",params:{_id:e.unref(l).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.state.all,(a,n)=>(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":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(d.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(d.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",D,[e.createVNode(b.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(d.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(d.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",L,[e.createVNode(b.default,{onClick:()=>t.state.current.localization.splice(n,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]))}};exports.default=S;