@ozdao/prometheus-framework 0.2.52 → 0.2.54

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. package/dist/main-0a2437f4.js +91 -0
  2. package/dist/main-180a9315.js +91 -0
  3. package/dist/main-3b7bd446.mjs +13631 -0
  4. package/dist/main-4fnApBsF.js +91 -0
  5. package/dist/main-Im8ovDCi.mjs +13609 -0
  6. package/dist/main-MjvO1l5U.js +91 -0
  7. package/dist/main-cdd0be68.mjs +13628 -0
  8. package/dist/main-kjbLXQEa.mjs +13606 -0
  9. package/dist/main.css +1 -1
  10. package/dist/organizations.server.js +17 -3
  11. package/dist/organizations.server.mjs +17 -3
  12. package/dist/products.server.js +62 -50
  13. package/dist/products.server.mjs +62 -50
  14. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -223
  16. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +223 -2
  18. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +20 -20
  20. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
  22. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +81 -2
  24. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  26. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
  28. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
  30. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Select/Select.vue.js +95 -2
  32. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -95
  34. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
  36. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
  38. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  42. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  44. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
  46. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  48. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  50. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  52. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +57 -77
  54. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +1 -1
  56. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +4 -4
  60. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  63. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +65 -2
  64. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  65. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +2 -65
  66. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
  72. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +100 -96
  74. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.js +59 -52
  78. package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.js +1 -1
  80. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
  84. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  86. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +8 -13
  90. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
  92. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +11 -2
  94. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
  96. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +54 -78
  98. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +1 -1
  102. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/orders/store/orders.js +42 -32
  104. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +2 -2
  106. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +5 -5
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +2 -2
  114. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +5 -5
  116. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  120. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  122. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +5 -5
  124. package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +5 -3
  126. package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.js +20 -5
  128. package/dist/prometheus-framework/src/modules/organizations/router/products.router.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/organizations/router/products.router.js +22 -0
  130. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs +1 -0
  131. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js +45 -0
  132. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.cjs +1 -0
  133. package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.js +4 -0
  134. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  136. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  138. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  140. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  142. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -0
  143. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +79 -0
  144. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -0
  145. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +193 -0
  146. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.cjs +1 -0
  147. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.js +4 -0
  148. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  150. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  152. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +68 -58
  154. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
  156. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  158. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
  160. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +21 -18
  162. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  164. package/dist/prometheus-framework/src/modules/products/products.client.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/products/products.client.js +2 -2
  166. package/dist/prometheus-framework/src/modules/products/store/categories.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/products/store/categories.js +39 -27
  168. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
  170. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +63 -77
  172. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  174. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  175. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  176. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  177. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  178. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  179. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +3 -3
  180. package/dist/prometheus-framework.cjs.js +1 -1
  181. package/dist/prometheus-framework.es.js +1 -1
  182. package/dist/style.css +1 -1
  183. package/dist/web-0066fd51.mjs +55 -0
  184. package/dist/web-6b9fa713.js +1 -0
  185. package/dist/web-8b404cc2.js +1 -0
  186. package/dist/web-e9b09dc6.mjs +55 -0
  187. package/dist/web-i-suCpLM.mjs +55 -0
  188. package/dist/web-ngl7bNhF.js +1 -0
  189. package/dist/web-t91TrxXa.mjs +55 -0
  190. package/dist/web-vB7UhMOt.js +1 -0
  191. package/package.json +1 -1
  192. package/src/components/Button/Button.vue +1 -3
  193. package/src/components/EditImages/EditImages.vue +1 -1
  194. package/src/components/Field/Field.vue +8 -1
  195. package/src/components/LocationSelection/LocationSelection.vue +2 -2
  196. package/src/modules/backoffice/components/pages/Dashboard.vue +4 -25
  197. package/src/modules/backoffice/router/admin.js +0 -14
  198. package/src/modules/backoffice/router/backoffice.js +1 -1
  199. package/src/modules/events/components/pages/EditEvent.vue +10 -6
  200. package/src/modules/events/components/sections/HeroEvent.vue +12 -2
  201. package/src/modules/events/components/sections/SectionPreviousEvents.vue +1 -1
  202. package/src/modules/landing/components/sections/MobileApp.vue +2 -6
  203. package/src/modules/marketplace/components/sections/Filters.vue +7 -1
  204. package/src/modules/orders/components/blocks/StatusHistory.vue +91 -31
  205. package/src/modules/orders/components/pages/EditOrder.vue +4 -21
  206. package/src/modules/orders/components/pages/FormOrder.vue +53 -15
  207. package/src/modules/orders/components/pages/Order.vue +2 -2
  208. package/src/modules/orders/components/sections/FormClientDetails.vue +63 -0
  209. package/src/modules/orders/components/sections/FormDelivery.vue +72 -0
  210. package/src/modules/orders/components/sections/FormPayment.vue +27 -0
  211. package/src/modules/orders/controllers/orders.controller.js +63 -49
  212. package/src/modules/orders/models/order.model.js +9 -13
  213. package/src/modules/orders/routes/orders.routes.js +6 -20
  214. package/src/modules/orders/store/orders.js +24 -12
  215. package/src/modules/organizations/controllers/organizations.controller.js +28 -9
  216. package/src/modules/organizations/router/organizations.js +4 -1
  217. package/src/modules/organizations/router/organizations.router.js +18 -2
  218. package/src/modules/organizations/router/products.router.js +24 -4
  219. package/src/modules/products/components/blocks/CardCategory.vue +53 -0
  220. package/src/modules/products/components/pages/Categories.vue +90 -0
  221. package/src/modules/products/components/pages/CategoryEdit.vue +214 -0
  222. package/src/modules/products/components/pages/ProductEdit.vue +9 -1
  223. package/src/modules/products/components/sections/FilterProducts.vue +4 -1
  224. package/src/modules/products/controllers/categories.controller.js +30 -13
  225. package/src/modules/products/controllers/products.controller.js +3 -2
  226. package/src/modules/products/models/category.model.js +42 -32
  227. package/src/modules/products/products.client.js +4 -2
  228. package/src/modules/products/store/categories.js +17 -3
  229. package/src/modules/users/components/pages/Profile.vue +2 -2
  230. package/src/modules/backoffice/components/admin/Categories.vue +0 -53
  231. package/src/modules/backoffice/components/admin/CategoryEdit.vue +0 -98
  232. package/src/modules/orders/components/sections/FormOrderDetails.vue +0 -220
  233. package/src/modules/products/components/blocks/CategoryCard.vue +0 -42
  234. package/src/modules/products/router/products.router.js +0 -48
  235. /package/src/modules/{products → organizations}/components/pages/OrganizationCreate.vue +0 -0
  236. /package/src/modules/{products → organizations}/components/pages/OrganizationDetails.vue +0 -0
  237. /package/src/modules/{products → organizations}/components/pages/OrganizationDocuments.vue +0 -0
  238. /package/src/modules/{products → organizations}/components/pages/OrganizationPeople.vue +0 -0
@@ -0,0 +1,193 @@
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
+ import { useRoute as k, useRouter as v } from "vue-router";
3
+ import g from "../../../icons/navigation/IconDelete.vue.js";
4
+ import S from "../../../../components/Button/Button.vue2.js";
5
+ import E from "../../../../components/Select/Select.vue.js";
6
+ import i from "../../../../components/Field/Field.vue2.js";
7
+ import p from "../../../../components/Block/Block.vue.js";
8
+ import { actions as f, state as t } from "../../store/categories.js";
9
+ import "./CategoryEdit.vue2.js";
10
+ const N = { class: "mn-r-auto" }, z = { class: "mn-b-medium w-100 flex-nowrap gap-thin flex" }, F = { class: "flex-v-center flex-nowrap flex" }, L = /* @__PURE__ */ d("h4", { class: "mn-r-thin t-medium" }, "Localization", -1), R = ["onClick"], T = ["onClick"], V = ["onClick"], J = {
11
+ __name: "CategoryEdit",
12
+ setup($) {
13
+ const n = k(), w = v();
14
+ n.params.category ? f.fetchCategory(n.params.category) : f.resetCategory(), h(() => t.current), h(() => n.name);
15
+ function x() {
16
+ n.params.category ? f.updateCategory(n.params.category) : f.addCategory();
17
+ }
18
+ function y() {
19
+ w.push({
20
+ name: "Categories Organization",
21
+ params: {
22
+ _id: n.params._id
23
+ }
24
+ });
25
+ }
26
+ return (B, r) => (o(), c(m, null, [
27
+ l(p, { class: "radius-big mn-b-thin flex-nowrap flex-v-center flex" }, {
28
+ default: u(() => [
29
+ d("h1", N, _(U(n).params.category ? "Edit Category" : "Add Category"), 1),
30
+ l(S, {
31
+ submit: x,
32
+ callback: y,
33
+ class: "pd-small radius-big bg-main t-black uppercase t-medium"
34
+ }, {
35
+ default: u(() => [
36
+ C(" Save Category ")
37
+ ]),
38
+ _: 1
39
+ })
40
+ ]),
41
+ _: 1
42
+ }),
43
+ l(p, {
44
+ title: "Profile",
45
+ class: "mn-b-thin"
46
+ }, {
47
+ default: u(() => [
48
+ d("div", z, [
49
+ l(i, {
50
+ field: t.current.order,
51
+ "onUpdate:field": r[0] || (r[0] = (e) => t.current.order = e),
52
+ label: "Order",
53
+ disabled: !0,
54
+ class: "w-25 bg-white radius-small pd-medium"
55
+ }, null, 8, ["field"]),
56
+ l(i, {
57
+ field: t.current.url,
58
+ "onUpdate:field": r[1] || (r[1] = (e) => t.current.url = e),
59
+ label: "URL",
60
+ placeholder: "Enter category URL",
61
+ class: "w-100 bg-white radius-small pd-medium"
62
+ }, null, 8, ["field"]),
63
+ l(i, {
64
+ field: t.current.name,
65
+ "onUpdate:field": r[2] || (r[2] = (e) => t.current.name = e),
66
+ label: "Name",
67
+ placeholder: "Enter category name",
68
+ class: "w-100 bg-white radius-small pd-medium"
69
+ }, null, 8, ["field"])
70
+ ]),
71
+ l(E, {
72
+ select: t.current.status,
73
+ "onUpdate:select": r[3] || (r[3] = (e) => t.current.status = e),
74
+ label: "Status",
75
+ options: [
76
+ "draft",
77
+ "internal",
78
+ "published",
79
+ "removed"
80
+ ],
81
+ placeholder: "Display product",
82
+ class: "pos-relative w-100 mn-b-small bg-white radius-small pd-medium"
83
+ }, null, 8, ["select"]),
84
+ d("div", F, [
85
+ L,
86
+ d("button", {
87
+ onClick: r[4] || (r[4] = () => t.current.localization.push({ locale: "", text: "" })),
88
+ class: "i-small pd-thin button-delete button"
89
+ }, " + ")
90
+ ]),
91
+ (o(!0), c(m, null, b(t.current.localization, (e, s) => (o(), c("div", {
92
+ class: "gap-thin mn-b-thin flex-nowrap flex",
93
+ key: s
94
+ }, [
95
+ l(i, {
96
+ field: e.locale,
97
+ "onUpdate:field": (a) => e.locale = a,
98
+ placeholder: "Locale",
99
+ class: "w-100 bg-white radius-small pd-medium"
100
+ }, null, 8, ["field", "onUpdate:field"]),
101
+ l(i, {
102
+ field: e.text,
103
+ "onUpdate:field": (a) => e.text = a,
104
+ placeholder: "Text",
105
+ class: "w-100 bg-white radius-small pd-medium"
106
+ }, null, 8, ["field", "onUpdate:field"]),
107
+ d("div", {
108
+ onClick: () => t.current.localization.splice(s, 1),
109
+ class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
110
+ }, [
111
+ l(g, { class: "i-medium" })
112
+ ], 8, R)
113
+ ]))), 128))
114
+ ]),
115
+ _: 1
116
+ }),
117
+ l(p, {
118
+ title: "Subcategories",
119
+ placeholder: "No subcategories added yet",
120
+ actions: [{
121
+ label: "+",
122
+ function: () => t.current.subcategories.push({ name: "", url: "" })
123
+ }],
124
+ class: "mn-b-thin"
125
+ }, {
126
+ default: u(() => [
127
+ (o(!0), c(m, null, b(t.current.subcategories, (e, s) => (o(), c("div", {
128
+ class: "gap-thin mn-b-thin flex-nowrap flex",
129
+ key: s
130
+ }, [
131
+ l(i, {
132
+ field: e.name,
133
+ "onUpdate:field": (a) => e.name = a,
134
+ placeholder: "Subcategory name",
135
+ class: "w-100 bg-white radius-small pd-medium"
136
+ }, null, 8, ["field", "onUpdate:field"]),
137
+ l(i, {
138
+ field: e.url,
139
+ "onUpdate:field": (a) => e.url = a,
140
+ placeholder: "Subcategory",
141
+ class: "w-100 bg-white radius-small pd-medium"
142
+ }, null, 8, ["field", "onUpdate:field"]),
143
+ d("div", {
144
+ onClick: () => t.current.subcategories.splice(s, 1),
145
+ class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
146
+ }, [
147
+ l(g, { class: "i-medium" })
148
+ ], 8, T)
149
+ ]))), 128))
150
+ ]),
151
+ _: 1
152
+ }, 8, ["actions"]),
153
+ l(p, {
154
+ title: "Filters",
155
+ placeholder: "No filters added yet",
156
+ actions: [{
157
+ label: "+",
158
+ function: () => t.current.filters.push({ name: "", url: "" })
159
+ }]
160
+ }, {
161
+ default: u(() => [
162
+ (o(!0), c(m, null, b(t.current.filters, (e, s) => (o(), c("div", {
163
+ class: "gap-thin mn-b-thin flex-nowrap flex",
164
+ key: s
165
+ }, [
166
+ l(i, {
167
+ field: e.name,
168
+ "onUpdate:field": (a) => e.name = a,
169
+ placeholder: "Filter name",
170
+ class: "w-100 bg-white radius-small pd-medium"
171
+ }, null, 8, ["field", "onUpdate:field"]),
172
+ l(i, {
173
+ field: e.options,
174
+ "onUpdate:field": (a) => e.options = a,
175
+ placeholder: "Filter options divided by ,",
176
+ class: "w-100 bg-white radius-small pd-medium"
177
+ }, null, 8, ["field", "onUpdate:field"]),
178
+ d("div", {
179
+ onClick: () => t.current.filters.splice(s, 1),
180
+ class: "radius-small pd-small flex-center flex aspect-1x1 bg-red"
181
+ }, [
182
+ l(g, { class: "i-medium" })
183
+ ], 8, V)
184
+ ]))), 128))
185
+ ]),
186
+ _: 1
187
+ }, 8, ["actions"])
188
+ ], 64));
189
+ }
190
+ };
191
+ export {
192
+ J as default
193
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -0,0 +1,4 @@
1
+ const e = "";
2
+ export {
3
+ e as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue2.cjs");const b=require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const p=require("../blocks/CardPosition.vue.cjs"),m=require("vue-router"),l=require("../../../globals/store/globals.cjs"),t=require("../../store/leftovers.cjs"),f=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const g={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},h={class:""},N={class:"gap-thin flex-v-center flex-nojustify flex"},V={class:"mn-r-auto"},q={__name:"EditLeftover",setup(E){const o=m.useRoute(),i=m.useRouter(),c=e.ref(f.state.all);e.ref(null);const v=e.computed(()=>t.state.current.positions.reduce((s,r)=>s+r.price,0));e.onMounted(async()=>{if(o.params.leftover)try{await t.actions.fetch(o.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const s=await f.actions.read({organization:o.params._id,limit:100});c.value=s}catch{console.error("error")}});function y(){o.params.leftover?t.actions.fetch(o.params.leftover):t.state.current={type:"",order:"",positions:[]}}function k(){t.state.current.organization=o.params._id,o.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error")):t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}function _(){t.actions.delete(o.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}return(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("header",g,[e.createElementVNode("h2",h,e.toDisplayString(e.unref(o).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(b.default,{select:t.state.current.type,"onUpdate:select":r[0]||(r[0]=n=>t.state.current.type=n),options:["stock-in","stock-out","write-off"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(u.default,{title:"Add Position",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(p.default,{onAdd:r[1]||(r[1]=n=>l.actions.add(t.state.current.positions,n)),products:c.value},null,8,["products"])]),_:1}),e.createVNode(u.default,{title:"Invetory Sheet",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,(n,d)=>(e.openBlock(),e.createBlock(p.default,{key:n._id,product:n,array:t.state.current.positions,products:c.value,onAdd:r[2]||(r[2]=a=>l.actions.add(t.state.current.positions,a)),onUpdate:a=>l.actions.update(t.state.current.positions,a,d),onDelete:a=>l.actions.delete(t.state.current.positions,a,d)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1}),e.createVNode(u.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",N,[e.createElementVNode("h3",V," In total: "+e.toDisplayString(s.formatPrice(v.value)),1),e.createElementVNode("a",{onClick:r[3]||(r[3]=n=>k()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:r[4]||(r[4]=n=>y())}," Reset "),e.unref(o).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:r[5]||(r[5]=n=>_()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})],64))}};exports.default=q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue.cjs");const b=require("../../../../components/Select/Select.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const p=require("../blocks/CardPosition.vue.cjs"),m=require("vue-router"),l=require("../../../globals/store/globals.cjs"),t=require("../../store/leftovers.cjs"),f=require("../../store/products.cjs");require("./EditLeftover.vue2.cjs");const g={class:"mn-b-medium gap-small flex-v-center flex-nowrap flex"},h={class:""},N={class:"gap-thin flex-v-center flex-nojustify flex"},V={class:"mn-r-auto"},q={__name:"EditLeftover",setup(E){const o=m.useRoute(),i=m.useRouter(),c=e.ref(f.state.all);e.ref(null);const v=e.computed(()=>t.state.current.positions.reduce((s,r)=>s+r.price,0));e.onMounted(async()=>{if(o.params.leftover)try{await t.actions.fetch(o.params.leftover)}catch{console.error("error")}else t.state.current={type:"",order:"",positions:[]};try{const s=await f.actions.read({organization:o.params._id,limit:100});c.value=s}catch{console.error("error")}});function y(){o.params.leftover?t.actions.fetch(o.params.leftover):t.state.current={type:"",order:"",positions:[]}}function k(){t.state.current.organization=o.params._id,o.params.leftover?t.actions.update(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error")):t.actions.create(t.state.current).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}function _(){t.actions.delete(o.params.leftover).then(()=>i.push({name:"Leftovers",params:{_id:o.params._id}}),s=>console.error("error"))}return(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("header",g,[e.createElementVNode("h2",h,e.toDisplayString(e.unref(o).params.leftover?"Edit ":"Add ")+" Inventory",1),e.createVNode(b.default,{select:t.state.current.type,"onUpdate:select":r[0]||(r[0]=n=>t.state.current.type=n),options:["stock-in","stock-out","write-off"],placeholder:"Select type",class:"bg-main t-black w-max pd-small t-semi p-big uppercase radius-small"},null,8,["select"])]),e.createVNode(u.default,{title:"Add Position",class:"mn-b-semi"},{default:e.withCtx(()=>[e.createVNode(p.default,{onAdd:r[1]||(r[1]=n=>l.actions.add(t.state.current.positions,n)),products:c.value},null,8,["products"])]),_:1}),e.createVNode(u.default,{title:"Invetory Sheet",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,(n,d)=>(e.openBlock(),e.createBlock(p.default,{key:n._id,product:n,array:t.state.current.positions,products:c.value,onAdd:r[2]||(r[2]=a=>l.actions.add(t.state.current.positions,a)),onUpdate:a=>l.actions.update(t.state.current.positions,a,d),onDelete:a=>l.actions.delete(t.state.current.positions,a,d)},null,8,["product","array","products","onUpdate","onDelete"]))),128))]),_:1}),e.createVNode(u.default,{class:""},{default:e.withCtx(()=>[e.createElementVNode("section",N,[e.createElementVNode("h3",V," In total: "+e.toDisplayString(s.formatPrice(v.value)),1),e.createElementVNode("a",{onClick:r[3]||(r[3]=n=>k()),class:"bg-main button"}," Save "),e.createElementVNode("a",{class:"t-white bg-second button",onClick:r[4]||(r[4]=n=>y())}," Reset "),e.unref(o).params.leftover?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:r[5]||(r[5]=n=>_()),class:"t-white bg-red button"}," Delete ")):e.createCommentVNode("",!0)])]),_:1})],64))}};exports.default=q;
@@ -1,7 +1,7 @@
1
1
  import { ref as y, computed as C, onMounted as D, openBlock as c, createElementBlock as d, Fragment as b, createElementVNode as n, toDisplayString as h, unref as g, createVNode as i, withCtx as f, renderList as L, createBlock as R, createCommentVNode as A } from "vue";
2
2
  import v from "../../../../components/Block/Block.vue.js";
3
- import "../../../../components/Field/Field.vue2.js";
4
- import E from "../../../../components/Select/Select.vue2.js";
3
+ import "../../../../components/Field/Field.vue.js";
4
+ import E from "../../../../components/Select/Select.vue.js";
5
5
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
6
6
  import k from "../blocks/CardPosition.vue.js";
7
7
  import { useRoute as N, useRouter as P } from "vue-router";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router"),d=require("../../../../components/Tab/Tab.vue.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),f=require("../blocks/CardLeftover.vue.cjs"),i=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const v={class:"pd-thin"},p={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),g={class:"mn-b-semi pd-medium bg-grey radius-big"},_=e.createElementVNode("p",{class:"mn-b-thin"},"Spended:",-1),h={__name:"Leftovers",setup(k){const s=u.useRoute();u.useRouter();const l=e.ref(s.query.tab?s.query.tab:"all"),c=e.computed(()=>i.state.all.reduce((o,r)=>{const t=r.positions.reduce((n,a)=>n+a.price*(a.quantity||1),0);return o+t},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("header",p,[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",g,[_,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(c.value)),1)]),e.createVNode(d.default,{selected:l.value,"onUpdate:selected":r[1]||(r[1]=t=>l.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"},{name:"Write-Off",value:"write-off"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>i.actions.read(t)},options:{limit:15,organization:e.unref(s).params._id}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(f.default,{leftover:n,class:"bg-grey pd-small radius-big"},null,8,["leftover"]))),256))]),_:1},8,["states","store","options"])]))}};exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("vue-router"),d=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Feed/Feed.vue.cjs"),f=require("../blocks/CardLeftover.vue.cjs"),i=require("../../store/leftovers.cjs");require("./Leftovers.vue2.cjs");const v={class:"pd-thin"},p={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Inventory",-1),g={class:"mn-b-semi pd-medium bg-grey radius-big"},_=e.createElementVNode("p",{class:"mn-b-thin"},"Spended:",-1),h={__name:"Leftovers",setup(k){const s=u.useRoute();u.useRouter();const l=e.ref(s.query.tab?s.query.tab:"all"),c=e.computed(()=>i.state.all.reduce((o,r)=>{const t=r.positions.reduce((n,a)=>n+a.price*(a.quantity||1),0);return o+t},0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("header",p,[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",g,[_,e.createElementVNode("h3",null,e.toDisplayString(o.formatPrice(c.value)),1)]),e.createVNode(d.default,{selected:l.value,"onUpdate:selected":r[1]||(r[1]=t=>l.value=t),tabs:[{name:"All",value:"all"},{name:"Stock-In",value:"stock-in"},{name:"Stock-Out",value:"stock-out"},{name:"Write-Off",value:"write-off"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(m.default,{states:{empty:{title:"No Leftovers Found",description:"Currently, there are no leftovers available."}},store:{read:t=>i.actions.read(t)},options:{limit:15,organization:e.unref(s).params._id}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,n=>(e.openBlock(),e.createBlock(f.default,{leftover:n,class:"bg-grey pd-small radius-big"},null,8,["leftover"]))),256))]),_:1},8,["states","store","options"])]))}};exports.default=h;
@@ -1,6 +1,6 @@
1
1
  import { ref as d, computed as p, openBlock as a, createElementBlock as u, createElementVNode as r, toDisplayString as f, createVNode as m, unref as v, withCtx as b, Fragment as _, renderList as g, createBlock as h } 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 C, actions as S } 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 s=require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Select/Select.vue.cjs");const V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),k=require("../../../../components/Button/Button.vue.cjs"),B=require("../../../../components/Popup/Popup.vue2.cjs"),C=require("../../../../components/EditImages/EditImages.vue.cjs"),m=require("../../../icons/navigation/IconDelete.vue.cjs"),_=require("../blocks/CardPosition.vue.cjs"),q=require("../sections/EditProductInfo.vue.cjs"),u=require("../../../globals/store/globals.cjs"),t=require("../../store/products.cjs"),b=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const y={class:"for-transition w-100 cols-1 pd-thin gap-thin"},E={class:"mn-r-auto"},P={class:"cols-2 gap-thin"},U={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},D={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},z={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},I={class:"cols-1 gap-thin"},F={__name:"ProductEdit",setup(L){const n=h.useRoute(),w=h.useRouter(),p=e.ref(t.state.all),f=e.ref(!1);function N(c){f.value=!0}function d(){f.value=!1}e.onMounted(async()=>{await b.actions.fetchCategories();try{const c=await t.actions.read({organization:n.params._id,limit:100});p.value=c}catch{console.error("error")}n.params.product&&await t.actions.read({_id:n.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[])});function v(){n.params.product?t.actions.update(n.params.product,t.state.current):t.actions.create(n.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function g(){w.push({name:"Organization",params:{_id:n.params._id}})}return(c,i)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",E,e.toDisplayString(e.unref(n).params.product?t.state.current.name:"Create Product"),1),e.unref(n).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:v,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",P,[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:"Categories"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.state.all,(a,r)=>(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":l=>t.state.current.category=l},null,8,["label","value","radio","onUpdate:radio"]))),256))]),_:1}),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,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",U,[e.createVNode(m.default,{onClick:()=>t.state.current.information.splice(r,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,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",D,[e.createVNode(m.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(o.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",z,[e.createVNode(m.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add ingredient",onClosePopup:d,isPopupOpen:f.value,class:"bg-white pd-big radius-big"},{default:e.withCtx(()=>[e.createVNode(_.default,{onAdd:i[1]||(i[1]=a=>u.actions.add(t.state.current.ingredients,a)),products:p.value,class:"flex-column"},null,8,["products"])]),_:1},8,["isPopupOpen"]),e.createVNode(o.default,{title:"Ingredients",placeholder:"No positions added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,r)=>(e.openBlock(),e.createBlock(_.default,{key:a._id,product:a,array:t.state.current.ingredients,products:p.value,onAdd:i[2]||(i[2]=l=>{u.actions.add(t.state.current.ingredients,l),d()}),onUpdate:l=>{u.actions.update(t.state.current.ingredients,l,r),d()},onDelete:l=>{u.actions.delete(t.state.current.ingredients,l,r),d()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])]),_:1},8,["actions"])]))}};exports.default=F;
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 s=require("../../../../components/Field/Field.vue2.cjs"),V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),B=require("../../../../components/Popup/Popup.vue.cjs"),C=require("../../../../components/EditImages/EditImages.vue.cjs"),m=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"),w=require("../../store/categories.cjs");require("./ProductEdit.vue2.cjs");const y={class:"for-transition w-100 cols-1 pd-thin gap-thin"},E={class:"mn-r-auto"},P={class:"cols-2 gap-thin"},U={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},D={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},z={class:"radius-small pd-small flex-center flex aspect-1x1 bg-red"},I={class:"cols-1 gap-thin"},F={__name:"ProductEdit",setup(L){const n=k.useRoute(),g=k.useRouter(),p=e.ref(t.state.all),f=e.ref(!1);function N(c){f.value=!0}function d(){f.value=!1}e.onMounted(async()=>{await w.actions.fetchCategories();try{const c=await t.actions.read({organization:n.params._id,limit:100});p.value=c}catch{console.error("error")}n.params.product&&await t.actions.read({_id:n.params.product}),t.state.current.ingredients||(t.state.current.ingredients=[])});function v(){n.params.product?t.actions.update(n.params.product,t.state.current):t.actions.create(n.params._id,t.state.current)}function x(){t.actions.deleteProduct(t.state.current._id)}function h(){g.push({name:"Organization",params:{_id:n.params._id}})}return(c,i)=>(e.openBlock(),e.createElementBlock("div",y,[e.createVNode(o.default,{class:"flex-nowrap flex-v-center flex"},{default:e.withCtx(()=>[e.createElementVNode("h1",E,e.toDisplayString(e.unref(n).params.product?t.state.current.name:"Create Product"),1),e.unref(n).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(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",P,[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:"Categories",actions:[{label:"+",function:()=>e.unref(g).push({name:"Categories Organization",params:{_id:e.unref(n).params._id}})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.state.all,(a,r)=>(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":l=>t.state.current.category=l},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,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",U,[e.createVNode(m.default,{onClick:()=>t.state.current.information.splice(r,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,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Название параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Значение параметра",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",D,[e.createVNode(m.default,{onClick:()=>t.state.current.localization.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"])]),e.createVNode(o.default,{title:"Quantity Discount",class:"mn-b-semi",actions:[{label:"+",function:()=>t.state.current.quantityDiscount.push({name:"",value:""})}]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.quantityDiscount,(a,r)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin mn-b-thin flex-nowrap flex",key:r},[e.createVNode(s.default,{field:a.name,"onUpdate:field":l=>a.name=l,placeholder:"Quantity",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(s.default,{field:a.value,"onUpdate:field":l=>a.value=l,placeholder:"Discount",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",z,[e.createVNode(m.default,{onClick:()=>t.state.current.quantityDiscount.splice(r,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),e.createVNode(B.default,{title:"Add ingredient",onClosePopup:d,isPopupOpen:f.value,class:"bg-white pd-big radius-big"},{default:e.withCtx(()=>[e.createVNode(b.default,{onAdd:i[1]||(i[1]=a=>u.actions.add(t.state.current.ingredients,a)),products:p.value,class:"flex-column"},null,8,["products"])]),_:1},8,["isPopupOpen"]),e.createVNode(o.default,{title:"Ingredients",placeholder:"No positions added yet",actions:[{label:"+",function:()=>N()}]},{default:e.withCtx(()=>[e.createElementVNode("div",I,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.ingredients,(a,r)=>(e.openBlock(),e.createBlock(b.default,{key:a._id,product:a,array:t.state.current.ingredients,products:p.value,onAdd:i[2]||(i[2]=l=>{u.actions.add(t.state.current.ingredients,l),d()}),onUpdate:l=>{u.actions.update(t.state.current.ingredients,l,r),d()},onDelete:l=>{u.actions.delete(t.state.current.ingredients,l,r),d()}},null,8,["product","array","products","onUpdate","onDelete"]))),128))])]),_:1},8,["actions"])]))}};exports.default=F;
@@ -1,32 +1,31 @@
1
- import { ref as U, onMounted as V, openBlock as r, createElementBlock as s, createVNode as a, withCtx as i, createElementVNode as c, toDisplayString as q, unref as C, createBlock as x, createTextVNode as P, createCommentVNode as A, Fragment as m, renderList as f } from "vue";
1
+ import { ref as P, onMounted as V, openBlock as i, createElementBlock as s, createVNode as a, withCtx as r, createElementVNode as c, toDisplayString as q, unref as b, createBlock as y, createTextVNode as D, createCommentVNode as A, Fragment as m, renderList as f } from "vue";
2
2
  import { useRoute as B, useRouter as E } 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
- import "../../../../components/Tab/Tab.vue2.js";
8
- import p from "../../../../components/Field/Field.vue.js";
9
- import "../../../../components/Select/Select.vue.js";
7
+ import "../../../../components/Tab/Tab.vue.js";
8
+ import p from "../../../../components/Field/Field.vue2.js";
10
9
  import R from "../../../../components/Checkbox/Checkbox.vue.js";
11
- import D from "../../../../components/Button/Button.vue.js";
12
- import S from "../../../../components/Popup/Popup.vue2.js";
10
+ import $ from "../../../../components/Button/Button.vue2.js";
11
+ import S from "../../../../components/Popup/Popup.vue.js";
13
12
  import T from "../../../../components/EditImages/EditImages.vue.js";
14
- import y from "../../../icons/navigation/IconDelete.vue.js";
15
- import $ from "../blocks/CardPosition.vue.js";
13
+ import k from "../../../icons/navigation/IconDelete.vue.js";
14
+ import z from "../blocks/CardPosition.vue.js";
16
15
  import F from "../sections/EditProductInfo.vue.js";
17
- import { actions as b } from "../../../globals/store/globals.js";
16
+ import { actions as v } from "../../../globals/store/globals.js";
18
17
  import { state as e, actions as g } from "../../store/products.js";
19
18
  import { actions as L, state as Q } from "../../store/categories.js";
20
19
  import "./ProductEdit.vue2.js";
21
- const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class: "mn-r-auto" }, G = { class: "cols-2 gap-thin" }, H = { class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red" }, J = { class: "radius-small pd-small flex-center flex aspect-1x1 bg-red" }, K = { class: "radius-small pd-small flex-center flex aspect-1x1 bg-red" }, W = { class: "cols-1 gap-thin" }, be = {
20
+ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class: "mn-r-auto" }, G = { class: "cols-2 gap-thin" }, H = { class: "radius-small h-100 i-big flex-center flex aspect-1x1 bg-red" }, J = { class: "radius-small pd-small flex-center flex aspect-1x1 bg-red" }, K = { class: "radius-small pd-small flex-center flex aspect-1x1 bg-red" }, W = { class: "cols-1 gap-thin" }, he = {
22
21
  __name: "ProductEdit",
23
22
  setup(X) {
24
- const o = B(), z = E(), v = U(e.all), w = U(!1);
23
+ const o = B(), U = E(), w = P(e.all), x = P(!1);
25
24
  function N(h) {
26
- w.value = !0;
25
+ x.value = !0;
27
26
  }
28
27
  function _() {
29
- w.value = !1;
28
+ x.value = !1;
30
29
  }
31
30
  V(async () => {
32
31
  await L.fetchCategories();
@@ -35,48 +34,48 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
35
34
  organization: o.params._id,
36
35
  limit: 100
37
36
  });
38
- v.value = h;
37
+ w.value = h;
39
38
  } catch {
40
39
  console.error("error");
41
40
  }
42
41
  o.params.product && await g.read({ _id: o.params.product }), e.current.ingredients || (e.current.ingredients = []);
43
42
  });
44
- function I() {
43
+ function O() {
45
44
  o.params.product ? g.update(o.params.product, e.current) : g.create(o.params._id, e.current);
46
45
  }
47
- function O() {
46
+ function I() {
48
47
  g.deleteProduct(e.current._id);
49
48
  }
50
- function k() {
51
- z.push({
49
+ function C() {
50
+ U.push({
52
51
  name: "Organization",
53
52
  params: {
54
53
  _id: o.params._id
55
54
  }
56
55
  });
57
56
  }
58
- return (h, u) => (r(), s("div", M, [
57
+ return (h, u) => (i(), s("div", M, [
59
58
  a(d, { class: "flex-nowrap flex-v-center flex" }, {
60
- default: i(() => [
61
- c("h1", j, q(C(o).params.product ? e.current.name : "Create Product"), 1),
62
- C(o).params.product ? (r(), x(D, {
59
+ default: r(() => [
60
+ c("h1", j, q(b(o).params.product ? e.current.name : "Create Product"), 1),
61
+ b(o).params.product ? (i(), y($, {
63
62
  key: 0,
64
- submit: O,
65
- callback: k,
63
+ submit: I,
64
+ callback: C,
66
65
  class: "bg-red mn-r-thin"
67
66
  }, {
68
- default: i(() => [
69
- P(" Delete ")
67
+ default: r(() => [
68
+ D(" Delete ")
70
69
  ]),
71
70
  _: 1
72
71
  })) : A("", !0),
73
- a(D, {
74
- submit: I,
75
- callback: k,
72
+ a($, {
73
+ submit: O,
74
+ callback: C,
76
75
  class: "bg-main"
77
76
  }, {
78
- default: i(() => [
79
- P(" Save ")
77
+ default: r(() => [
78
+ D(" Save ")
80
79
  ]),
81
80
  _: 1
82
81
  })
@@ -87,7 +86,7 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
87
86
  placeholder: "The product doesn't have any images yet.",
88
87
  class: "h-min"
89
88
  }, {
90
- default: i(() => [
89
+ default: r(() => [
91
90
  a(T, {
92
91
  images: e.current.images,
93
92
  uploadPath: "photos",
@@ -100,16 +99,27 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
100
99
  }),
101
100
  c("div", G, [
102
101
  a(d, { title: "Profile" }, {
103
- default: i(() => [
102
+ default: r(() => [
104
103
  a(F, {
105
104
  product: e.current
106
105
  }, null, 8, ["product"])
107
106
  ]),
108
107
  _: 1
109
108
  }),
110
- a(d, { title: "Categories" }, {
111
- default: i(() => [
112
- (r(!0), s(m, null, f(Q.all, (t, n) => (r(), x(R, {
109
+ a(d, {
110
+ title: "Categories",
111
+ actions: [{
112
+ label: "+",
113
+ function: () => b(U).push({
114
+ name: "Categories Organization",
115
+ params: {
116
+ _id: b(o).params._id
117
+ }
118
+ })
119
+ }]
120
+ }, {
121
+ default: r(() => [
122
+ (i(!0), s(m, null, f(Q.all, (t, n) => (i(), y(R, {
113
123
  label: t.name,
114
124
  name: "categories",
115
125
  value: t.url,
@@ -119,7 +129,7 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
119
129
  }, null, 8, ["label", "value", "radio", "onUpdate:radio"]))), 256))
120
130
  ]),
121
131
  _: 1
122
- }),
132
+ }, 8, ["actions"]),
123
133
  a(d, {
124
134
  title: "Parameters",
125
135
  placeholder: "No parameters added yet",
@@ -129,8 +139,8 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
129
139
  }],
130
140
  class: "cols-1 gap-thin"
131
141
  }, {
132
- default: i(() => [
133
- (r(!0), s(m, null, f(e.current.information, (t, n) => (r(), s("div", {
142
+ default: r(() => [
143
+ (i(!0), s(m, null, f(e.current.information, (t, n) => (i(), s("div", {
134
144
  class: "gap-thin flex-nowrap flex",
135
145
  key: n
136
146
  }, [
@@ -147,7 +157,7 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
147
157
  class: "w-100 bg-white radius-small pd-medium"
148
158
  }, null, 8, ["field", "onUpdate:field"]),
149
159
  c("div", H, [
150
- a(y, {
160
+ a(k, {
151
161
  onClick: () => e.current.information.splice(n, 1),
152
162
  class: "i-medium"
153
163
  }, null, 8, ["onClick"])
@@ -164,8 +174,8 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
164
174
  function: () => e.current.localization.push({ name: "", value: "" })
165
175
  }]
166
176
  }, {
167
- default: i(() => [
168
- (r(!0), s(m, null, f(e.current.localization, (t, n) => (r(), s("div", {
177
+ default: r(() => [
178
+ (i(!0), s(m, null, f(e.current.localization, (t, n) => (i(), s("div", {
169
179
  class: "gap-thin mn-b-thin flex-nowrap flex",
170
180
  key: n
171
181
  }, [
@@ -182,7 +192,7 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
182
192
  class: "w-100 bg-white radius-small pd-medium"
183
193
  }, null, 8, ["field", "onUpdate:field"]),
184
194
  c("div", J, [
185
- a(y, {
195
+ a(k, {
186
196
  onClick: () => e.current.localization.splice(n, 1),
187
197
  class: "i-medium"
188
198
  }, null, 8, ["onClick"])
@@ -200,8 +210,8 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
200
210
  function: () => e.current.quantityDiscount.push({ name: "", value: "" })
201
211
  }]
202
212
  }, {
203
- default: i(() => [
204
- (r(!0), s(m, null, f(e.current.quantityDiscount, (t, n) => (r(), s("div", {
213
+ default: r(() => [
214
+ (i(!0), s(m, null, f(e.current.quantityDiscount, (t, n) => (i(), s("div", {
205
215
  class: "gap-thin mn-b-thin flex-nowrap flex",
206
216
  key: n
207
217
  }, [
@@ -218,7 +228,7 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
218
228
  class: "w-100 bg-white radius-small pd-medium"
219
229
  }, null, 8, ["field", "onUpdate:field"]),
220
230
  c("div", K, [
221
- a(y, {
231
+ a(k, {
222
232
  onClick: () => e.current.quantityDiscount.splice(n, 1),
223
233
  class: "i-medium"
224
234
  }, null, 8, ["onClick"])
@@ -230,16 +240,16 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
230
240
  a(S, {
231
241
  title: "Add ingredient",
232
242
  onClosePopup: _,
233
- isPopupOpen: w.value,
243
+ isPopupOpen: x.value,
234
244
  class: "bg-white pd-big radius-big"
235
245
  }, {
236
- default: i(() => [
237
- a($, {
238
- onAdd: u[1] || (u[1] = (t) => b.add(
246
+ default: r(() => [
247
+ a(z, {
248
+ onAdd: u[1] || (u[1] = (t) => v.add(
239
249
  e.current.ingredients,
240
250
  t
241
251
  )),
242
- products: v.value,
252
+ products: w.value,
243
253
  class: "flex-column"
244
254
  }, null, 8, ["products"])
245
255
  ]),
@@ -253,21 +263,21 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
253
263
  function: () => N()
254
264
  }]
255
265
  }, {
256
- default: i(() => [
266
+ default: r(() => [
257
267
  c("div", W, [
258
- (r(!0), s(m, null, f(e.current.ingredients, (t, n) => (r(), x($, {
268
+ (i(!0), s(m, null, f(e.current.ingredients, (t, n) => (i(), y(z, {
259
269
  key: t._id,
260
270
  product: t,
261
271
  array: e.current.ingredients,
262
- products: v.value,
272
+ products: w.value,
263
273
  onAdd: u[2] || (u[2] = (l) => {
264
- b.add(e.current.ingredients, l), _();
274
+ v.add(e.current.ingredients, l), _();
265
275
  }),
266
276
  onUpdate: (l) => {
267
- b.update(e.current.ingredients, l, n), _();
277
+ v.update(e.current.ingredients, l, n), _();
268
278
  },
269
279
  onDelete: (l) => {
270
- b.delete(e.current.ingredients, l, n), _();
280
+ v.delete(e.current.ingredients, l, n), _();
271
281
  }
272
282
  }, null, 8, ["product", "array", "products", "onUpdate", "onDelete"]))), 128))
273
283
  ])
@@ -278,5 +288,5 @@ const M = { class: "for-transition w-100 cols-1 pd-thin gap-thin" }, j = { class
278
288
  }
279
289
  };
280
290
  export {
281
- be as default
291
+ he as default
282
292
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),n=require("../../store/products.cjs"),d=require("../../../../components/Feed/Feed.vue.cjs"),i=require("../blocks/CardProduct.vue.cjs"),m=require("../../../../components/Tab/Tab.vue.cjs"),p={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Products",-1),v={__name:"ProductsBackoffice",setup(h){const r=l.useRoute(),c=l.useRouter(),o=e.ref(r.query.tab?r.query.tab:"posts");return r.query.tab=o.value,e.watch(o,u=>{c.replace({query:{...r.query,tab:u}})}),e.onMounted(async()=>{await n.actions.fetchProducts()}),(u,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("header",p,[b,e.createElementVNode("button",{onClick:a[0]||(a[0]=t=>u.$router.push({name:"AddProduct"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createVNode(m.default,{selected:o.value,"onUpdate:selected":a[1]||(a[1]=t=>o.value=t),tabs:[{name:"All",value:"all"},{name:"Published",value:"published"},{name:"Unpublished",value:"unpublished"},{name:"Archivied",value:"archivied"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(d.default,{states:{empty:{title:"No Products Found",description:"Currently, there are no products available."}},store:{read:t=>n.actions.read(t),state:n.state},options:{limit:15,organization:e.unref(r).params._id,status:o.value}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,s=>(e.openBlock(),e.createBlock(i.default,{key:s._id,product:s,onClick:f=>u.$router.push({name:"ProductEdit",params:{product:s._id}})},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])],64))}};exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("vue-router"),n=require("../../store/products.cjs"),d=require("../../../../components/Feed/Feed.vue.cjs"),i=require("../blocks/CardProduct.vue.cjs"),m=require("../../../../components/Tab/Tab.vue2.cjs"),p={class:"mn-b-medium flex-v-center flex-nowrap flex"},b=e.createElementVNode("h2",{class:"mn-r-medium"},"Products",-1),v={__name:"ProductsBackoffice",setup(h){const r=l.useRoute(),c=l.useRouter(),o=e.ref(r.query.tab?r.query.tab:"posts");return r.query.tab=o.value,e.watch(o,u=>{c.replace({query:{...r.query,tab:u}})}),e.onMounted(async()=>{await n.actions.fetchProducts()}),(u,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("header",p,[b,e.createElementVNode("button",{onClick:a[0]||(a[0]=t=>u.$router.push({name:"AddProduct"})),class:"radius-100 i-big hover-scale-1 cursor-pointer t-white bg-second"}," + ")]),e.createVNode(m.default,{selected:o.value,"onUpdate:selected":a[1]||(a[1]=t=>o.value=t),tabs:[{name:"All",value:"all"},{name:"Published",value:"published"},{name:"Unpublished",value:"unpublished"},{name:"Archivied",value:"archivied"}],class:"mn-b-small o-hidden h5 radius-big bg-grey"},null,8,["selected"]),e.createVNode(d.default,{states:{empty:{title:"No Products Found",description:"Currently, there are no products available."}},store:{read:t=>n.actions.read(t),state:n.state},options:{limit:15,organization:e.unref(r).params._id,status:o.value}},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,s=>(e.openBlock(),e.createBlock(i.default,{key:s._id,product:s,onClick:f=>u.$router.push({name:"ProductEdit",params:{product:s._id}})},null,8,["product","onClick"]))),128))]),_:1},8,["states","store","options"])],64))}};exports.default=v;
@@ -3,7 +3,7 @@ import { useRoute as k, useRouter as g } from "vue-router";
3
3
  import { actions as c, state as P } from "../../store/products.js";
4
4
  import $ from "../../../../components/Feed/Feed.vue.js";
5
5
  import q from "../blocks/CardProduct.vue.js";
6
- import w from "../../../../components/Tab/Tab.vue.js";
6
+ import w from "../../../../components/Tab/Tab.vue2.js";
7
7
  const C = { class: "mn-b-medium flex-v-center flex-nowrap flex" }, x = /* @__PURE__ */ u("h2", { class: "mn-r-medium" }, "Products", -1), z = {
8
8
  __name: "ProductsBackoffice",
9
9
  setup(B) {
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../../../../components/Field/Field.vue2.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;