@ozdao/prometheus-framework 0.2.94 → 0.2.96

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. package/dist/auth.server.js +15 -14
  2. package/dist/auth.server.mjs +15 -14
  3. package/dist/main-BJvlNekm.mjs +13631 -0
  4. package/dist/main-pGo7JpSP.js +92 -0
  5. package/dist/orders.server.js +26 -22
  6. package/dist/orders.server.mjs +26 -22
  7. package/dist/organizations.server.js +31 -10
  8. package/dist/organizations.server.mjs +31 -10
  9. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Block/Block.vue.js +2 -2
  11. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  13. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
  15. package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +19 -19
  16. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  18. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  20. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  22. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +12 -12
  23. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  25. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  26. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  27. package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +21 -21
  28. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  30. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  32. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/router/auth.js +4 -0
  44. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +8 -8
  46. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  50. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  56. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  57. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  58. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  62. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  64. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  66. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  68. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +60 -60
  70. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  72. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  76. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.js +22 -21
  78. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  80. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  81. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +48 -37
  82. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +160 -167
  84. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +50 -49
  86. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +113 -110
  88. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +14 -14
  89. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  91. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/store/models/order.cjs +1 -0
  96. package/dist/prometheus-framework/src/modules/orders/store/models/order.js +28 -0
  97. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/orders/store/orders.js +25 -43
  99. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +19 -19
  101. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +47 -47
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +143 -131
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  111. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
  113. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  115. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  117. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +32 -34
  119. package/dist/prometheus-framework/src/modules/organizations/router/members.router.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/organizations/router/members.router.js +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -32
  125. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  135. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  137. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +155 -187
  139. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  141. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +19 -19
  143. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  145. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  147. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +26 -22
  149. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +68 -65
  151. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  152. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  153. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  154. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  155. package/dist/prometheus-framework.cjs.js +1 -1
  156. package/dist/prometheus-framework.es.js +1 -1
  157. package/dist/style.css +1 -1
  158. package/dist/web-B2xhKZNK.js +1 -0
  159. package/dist/web-DTzbVshr.mjs +54 -0
  160. package/package.json +1 -1
  161. package/src/components/Block/Block.vue +1 -1
  162. package/src/components/Completion/Completion.vue +2 -2
  163. package/src/modules/auth/controllers/auth.controller.js +19 -16
  164. package/src/modules/auth/router/auth.js +4 -0
  165. package/src/modules/backoffice/router/backoffice.js +3 -3
  166. package/src/modules/chats/routes/chats.routes.js +1 -2
  167. package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
  168. package/src/modules/globals/services/globals.crud.js +2 -0
  169. package/src/modules/icons/navigation/IconCross.vue +11 -7
  170. package/src/modules/orders/components/blocks/StatusHistory.vue +8 -11
  171. package/src/modules/orders/components/pages/OrderBackoffice.vue +37 -50
  172. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +8 -4
  173. package/src/modules/orders/components/pages/Orders.vue +1 -1
  174. package/src/modules/orders/controllers/orders.controller.js +26 -25
  175. package/src/modules/orders/models/order.model.js +1 -1
  176. package/src/modules/orders/routes/orders.routes.js +9 -3
  177. package/src/modules/orders/store/customers.store.js +1 -1
  178. package/src/modules/orders/store/models/order.js +33 -0
  179. package/src/modules/orders/store/orders.js +7 -28
  180. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -2
  181. package/src/modules/organizations/components/pages/DepartmentEdit.vue +7 -5
  182. package/src/modules/organizations/components/pages/Members.vue +50 -38
  183. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  184. package/src/modules/organizations/components/pages/Organizations.vue +2 -1
  185. package/src/modules/organizations/controllers/invites.controller.js +2 -0
  186. package/src/modules/organizations/controllers/memberships.controller.js +35 -11
  187. package/src/modules/organizations/controllers/organizations.controller.js +5 -4
  188. package/src/modules/organizations/models/invite.model.js +4 -0
  189. package/src/modules/organizations/organizations.client.js +0 -2
  190. package/src/modules/organizations/router/members.router.js +1 -1
  191. package/src/modules/organizations/store/departments.js +0 -1
  192. package/src/modules/organizations/store/memberships.js +1 -8
  193. package/src/modules/products/components/pages/ProductEdit.vue +39 -33
  194. package/src/modules/products/components/sections/EditProductInfo.vue +3 -3
  195. package/src/modules/users/components/blocks/CardUser.vue +9 -5
  196. package/src/modules/users/components/pages/Profile.vue +5 -3
  197. package/src/modules/users/components/pages/ProfileBlogposts.vue +1 -1
  198. package/src/modules/users/components/sections/ProfileCompletion.vue +2 -2
  199. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +0 -126
  200. package/src/modules/users/components/pages/ProfileOrganizations.vue +0 -97
@@ -1,80 +1,81 @@
1
- import { computed as I, ref as d, onMounted as T, openBlock as r, createElementBlock as m, createVNode as a, withCtx as s, createElementVNode as u, createTextVNode as q, unref as f, Fragment as g, renderList as C, createBlock as n, createCommentVNode as c, normalizeClass as E, toDisplayString as x } from "vue";
1
+ import { computed as T, ref as d, onMounted as q, openBlock as r, createElementBlock as m, createVNode as i, withCtx as s, createElementVNode as u, createTextVNode as E, unref as f, Fragment as g, renderList as C, createBlock as n, createCommentVNode as c, normalizeClass as U, toDisplayString as x } from "vue";
2
2
  import { useRoute as L, useRouter as M } from "vue-router";
3
- import "../../../../components/Field/Field.vue.js";
4
- import U from "../../../../components/Button/Button.vue2.js";
5
- import j from "../../../../components/Tab/Tab.vue2.js";
6
- import $ from "../../../../components/Popup/Popup.vue.js";
3
+ import "../../../../components/Field/Field.vue2.js";
4
+ import j from "../../../../components/Button/Button.vue.js";
5
+ import G from "../../../../components/Tab/Tab.vue2.js";
6
+ import O from "../../../../components/Popup/Popup.vue.js";
7
7
  import _ from "../../../../components/Block/Block.vue.js";
8
- import O from "../../../../components/Feed/Feed.vue.js";
8
+ import $ from "../../../../components/Feed/Feed.vue.js";
9
9
  import N from "../blocks/CardOrderItem.vue.js";
10
10
  import "../../../../components/Select/Select.vue2.js";
11
11
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
12
12
  import B from "../../../users/components/blocks/CardUser.vue.js";
13
- import G from "../sections/FormAddCustomer.vue.js";
14
- import H from "../sections/FormDelivery.vue.js";
15
- import J from "../sections/FormPayment.vue.js";
13
+ import H from "../sections/FormAddCustomer.vue.js";
14
+ import J from "../sections/FormDelivery.vue.js";
15
+ import K from "../sections/FormPayment.vue.js";
16
16
  import { actions as h } from "../../../globals/store/globals.js";
17
- import { state as K } from "../../../auth/store/auth.js";
18
- import { state as e, mutations as Q, actions as W } from "../../store/orders.js";
17
+ import { state as Q } from "../../../auth/store/auth.js";
18
+ import { mutations as D, state as e, actions as W } from "../../store/orders.js";
19
19
  import { actions as X } from "../../../products/store/products.js";
20
20
  import Y from "../../store/customers.store.js";
21
21
  import "./OrderCreateBackoffice.vue2.js";
22
22
  const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-center flex-nowrap flex" }, te = /* @__PURE__ */ u("h2", { class: "mn-r-auto" }, "Create Order", -1), re = /* @__PURE__ */ u("h3", { class: "mn-b-small" }, "Add to order", -1), oe = { class: "bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big" }, se = {
23
23
  key: 0,
24
24
  class: "w-100"
25
- }, ne = { class: "h3 flex" }, ae = /* @__PURE__ */ u("span", { class: "mn-r-auto t-transp" }, "In total", -1), Be = {
25
+ }, ne = { class: "h3 flex" }, ie = /* @__PURE__ */ u("span", { class: "mn-r-auto t-transp" }, "In total", -1), Be = {
26
26
  __name: "OrderCreateBackoffice",
27
- setup(ie) {
28
- const p = L(), D = M();
29
- let R = I(() => Number(e.current.positions.reduce((v, i) => v + i.price * i.quantity, 0)));
27
+ setup(ae) {
28
+ const p = L(), R = M();
29
+ D.resetOrder(e.current);
30
+ let S = T(() => Number(e.current.positions.reduce((v, a) => v + a.price * a.quantity, 0)));
30
31
  const l = d("positions"), b = d(!1);
31
- function S() {
32
+ function V() {
32
33
  b.value = !0;
33
34
  }
34
35
  function k() {
35
36
  b.value = !1;
36
37
  }
37
38
  const y = d(!1);
38
- function V() {
39
+ function z() {
39
40
  y.value = !0;
40
41
  }
41
42
  function P() {
42
43
  y.value = !1;
43
44
  }
44
45
  d(null);
45
- function z() {
46
+ function A() {
46
47
  e.current.creator = {
47
- type: "user",
48
- target: K.user._id
48
+ type: "User",
49
+ target: Q.user._id
49
50
  }, e.current.owner = {
50
- type: "organization",
51
+ type: "Organization",
51
52
  target: p.params._id
52
53
  }, e.current.customer = {
53
54
  type: "Customer",
54
55
  target: e.current.customer._id || null
55
56
  }, W.create(e.current);
56
57
  }
57
- function A() {
58
- D.push({
58
+ function F() {
59
+ R.push({
59
60
  name: "Backoffice Orders",
60
61
  params: {
61
62
  _id: p.params._id
62
63
  }
63
64
  });
64
65
  }
65
- return T(async () => {
66
- }), (v, i) => (r(), m("div", Z, [
67
- a(_, { class: "mn-b-thin" }, {
66
+ return q(() => {
67
+ }), (v, a) => (r(), m("div", Z, [
68
+ i(_, { class: "mn-b-thin" }, {
68
69
  default: s(() => [
69
70
  u("header", ee, [
70
71
  te,
71
- a(U, {
72
- submit: z,
73
- callback: A,
72
+ i(j, {
73
+ submit: A,
74
+ callback: F,
74
75
  class: "pd-small radius-big bg-main t-black uppercase t-medium"
75
76
  }, {
76
77
  default: s(() => [
77
- q(" Add Order ")
78
+ E(" Add Order ")
78
79
  ]),
79
80
  _: 1
80
81
  })
@@ -82,9 +83,9 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
82
83
  ]),
83
84
  _: 1
84
85
  }),
85
- a(j, {
86
+ i(G, {
86
87
  selected: l.value,
87
- "onUpdate:selected": i[0] || (i[0] = (t) => l.value = t),
88
+ "onUpdate:selected": a[0] || (a[0] = (t) => l.value = t),
88
89
  tabs: [
89
90
  { name: "Positions", value: "positions" },
90
91
  { name: "Customer", value: "customer" },
@@ -93,7 +94,7 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
93
94
  ],
94
95
  class: "t-medium radius-medium bg-grey mn-b-small"
95
96
  }, null, 8, ["selected"]),
96
- a($, {
97
+ i(O, {
97
98
  onClosePopup: k,
98
99
  isPopupOpen: b.value,
99
100
  class: "bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"
@@ -101,7 +102,7 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
101
102
  default: s(() => [
102
103
  re,
103
104
  u("div", oe, [
104
- a(O, {
105
+ i($, {
105
106
  search: {
106
107
  placeholder: "Search products...",
107
108
  class: "bg-white mn-b-thin"
@@ -124,7 +125,7 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
124
125
  default: s(({
125
126
  items: t
126
127
  }) => [
127
- (r(!0), m(g, null, C(t, (o, F) => (r(), n(N, {
128
+ (r(!0), m(g, null, C(t, (o, I) => (r(), n(N, {
128
129
  key: o._id,
129
130
  editable: !1,
130
131
  product: o,
@@ -146,7 +147,7 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
146
147
  title: "Positions",
147
148
  actions: [{
148
149
  label: "+",
149
- function: () => S()
150
+ function: () => V()
150
151
  }],
151
152
  class: "mn-b-small"
152
153
  }, {
@@ -176,7 +177,7 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
176
177
  class: "mn-b-semi",
177
178
  actions: [{
178
179
  label: "+",
179
- function: () => V()
180
+ function: () => z()
180
181
  }]
181
182
  }, {
182
183
  default: s(() => [
@@ -185,11 +186,11 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
185
186
  user: e.current.customer,
186
187
  photo: e.current.customer.profile.photo,
187
188
  name: e.current.customer.profile.name || e.current.customer.phone || e.current.customer.email,
188
- onClick: i[1] || (i[1] = () => {
189
- Q.resetCustomer(e.current.customer);
189
+ onClick: a[1] || (a[1] = () => {
190
+ D.resetCustomer(e.current.customer);
190
191
  }),
191
192
  class: "bg-white pd-thin radius-medium w-100 mn-b-thin"
192
- }, null, 8, ["user", "photo", "name"])) : (r(), n(O, {
193
+ }, null, 8, ["user", "photo", "name"])) : (r(), n($, {
193
194
  key: 1,
194
195
  search: {
195
196
  placeholder: "Search customer...",
@@ -213,7 +214,7 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
213
214
  default: s(({
214
215
  items: t
215
216
  }) => [
216
- (r(!0), m(g, null, C(t, (o, F) => (r(), n(B, {
217
+ (r(!0), m(g, null, C(t, (o, I) => (r(), n(B, {
217
218
  key: o._id,
218
219
  user: o,
219
220
  photo: o.profile.photo,
@@ -229,30 +230,30 @@ const Z = { class: "h-100 flex flex-column pd-thin" }, ee = { class: "flex-v-cen
229
230
  ]),
230
231
  _: 1
231
232
  }, 8, ["actions"])) : c("", !0),
232
- l.value === "delivery" ? (r(), n(H, {
233
+ l.value === "delivery" ? (r(), n(J, {
233
234
  key: 2,
234
235
  order: e.current
235
236
  }, null, 8, ["order"])) : c("", !0),
236
- l.value === "payment" ? (r(), n(J, {
237
+ l.value === "payment" ? (r(), n(K, {
237
238
  key: 3,
238
239
  order: e.current
239
240
  }, null, 8, ["order"])) : c("", !0),
240
- a($, {
241
+ i(O, {
241
242
  title: "Add customer",
242
243
  onClosePopup: P,
243
244
  isPopupOpen: y.value,
244
- class: E("bg-white w-min-30r w-max-30r radius-big pd-medium")
245
+ class: U("bg-white w-min-30r w-max-30r radius-big pd-medium")
245
246
  }, {
246
247
  default: s(() => [
247
- a(G, { onCallbackCustomer: P })
248
+ i(H, { onCallbackCustomer: P })
248
249
  ]),
249
250
  _: 1
250
251
  }, 8, ["isPopupOpen"]),
251
- a(_, { class: "mn-b-semi" }, {
252
+ i(_, { class: "mn-b-semi" }, {
252
253
  default: s(() => [
253
254
  u("div", ne, [
254
- ae,
255
- u("span", null, x(f(R)) + " " + x(v.returnCurrency()), 1)
255
+ ie,
256
+ u("span", null, x(f(S)) + " " + x(v.returnCurrency()), 1)
256
257
  ])
257
258
  ]),
258
259
  _: 1
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("vue-router");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");require("../../../../components/Tab/Tab.vue.cjs");const y=require("../../../../components/Block/Block.vue.cjs"),c=require("../../store/orders.cjs"),v=require("../../../auth/store/auth.cjs");require("../blocks/CardOrder.vue2.cjs");const f=require("../../../globals/components/blocks/CardHeader.vue.cjs"),N=require("../../../globals/components/sections/SectionPageTitle.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),V=require("../../../icons/entities/IconTime.vue.cjs"),E={class:"pd-thin"},k={class:"gap-micro flex-nowrap flex"},w={class:"w-100 bg-white radius-small pd-small"},S=e.createElementVNode("p",{class:"mn-b-thin"},"Total",-1),D={class:"w-100 bg-white radius-small pd-small"},B=e.createElementVNode("p",{class:"mn-b-thin"},"Paid",-1),x={class:"w-100 bg-white radius-small pd-small"},C=e.createElementVNode("p",{class:"mn-b-thin"},"Unpaid",-1),q={class:"mn-b-small pd-small bg-white radius-small flex-nowrap flex"},P={class:"w-100"},T={class:"mn-b-thin"},O={class:"t-truncate"},F={class:"w-100 t-right"},A={class:"mn-b-thin"},M={class:"cols-1 mn-b-small gap-thin pd-small bg-white radius-small"},U={class:"mn-r-auto"},L={class:"t-right"},R={class:"t-transp"},z={key:0},H={class:"mn-r-auto"},I={class:"t-right"},$={class:"t-transp"},j={class:"pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex"},G={class:"t-medium mn-r-auto"},J={class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main"},K=e.createElementVNode("span",{class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red"}," Unpaid ",-1),Q={key:0,class:"pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small"},W=e.createElementVNode("p",{class:"mn-b-thin t-transp uppercase p-small t-medium"},"Comment",-1),X={__name:"Orders",setup(Y){const p=m.useRoute();m.useRouter();const i=e.ref(!1),o=e.ref("all"),u=e.computed(()=>_(c.state.all)),h=e.computed(()=>g(c.state.all,"unpaid"));function _(n){return n.reduce((s,r)=>s+r.positions.reduce((l,t)=>l+t.price,0),0)}function g(n,s){return n.reduce((r,l)=>l.payment.status===s?r+l.positions.reduce((t,a)=>t+a.price,0):r,0)}return e.onMounted(async()=>{}),(n,s)=>{const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",E,[e.createVNode(N.default,{title:"Orders","onUpdate:tabs_current":s[0]||(s[0]=l=>o.value=l),tabs_current:o.value,tabs:[{name:"All",value:"all"},{name:"Created",value:"created"},{name:"Confirmed",value:"confirmed"},{name:"Preparing",value:"preparing"},{name:"Prepared",value:"prepared"},{name:"In delivery",value:"in delivery"},{name:"Delivered",value:"delivered"},{name:"Closed",value:"closed"}],actions:[{to:{name:"AdminOrderAdd"},label:"Create Order"}],class:"mn-b-small bg-grey bg-grey radius-big"},null,8,["tabs_current"]),e.createVNode(y.default,{title:"Balance",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",k,[e.createElementVNode("div",w,[S,e.createElementVNode("h3",null,e.toDisplayString(n.formatPrice(u.value)),1)]),e.createElementVNode("div",D,[B,e.createElementVNode("h3",null,e.toDisplayString(n.formatPrice(h.value)),1)]),e.createElementVNode("div",x,[C,e.createElementVNode("h3",null,e.toDisplayString(n.formatPrice(u.value)),1)])])]),_:1}),e.createVNode(b.default,{search:!0,states:{empty:{title:"No Orders Found",description:"Currently, there are no orders."}},store:{read:l=>c.actions.read(l)},options:{limit:15,owner:e.unref(p).params._id,...o.value!=="all"&&{status:o.value}},class:"gap-thin cols-3"},{default:e.withCtx(({items:l})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,t=>(e.openBlock(),e.createBlock(r,{to:{name:"Order Edit",params:{order:t._id}},class:"bg-grey pos-relative pd-medium radius-big"},{default:e.withCtx(()=>[e.createVNode(f.default,{entity:t,entityType:"order",user:v.state.user,owner:t.creator,creator:t.creator,date:t.createdAt,class:"mn-b-small"},null,8,["entity","user","owner","creator","date"]),e.createElementVNode("div",q,[e.createElementVNode("div",P,[e.createElementVNode("h3",T,e.toDisplayString(t.customer.target.profile.name||t.customer.target.phone||t.customer.target.email||"No name"),1),e.createElementVNode("p",O,e.toDisplayString(t.delivery.address||"Not specified"),1)]),e.createElementVNode("div",F,[e.createElementVNode("h3",A,e.toDisplayString(n.returnCurrency())+e.toDisplayString(c.getters.getTotal(t.positions)),1),e.createElementVNode("p",null,"#"+e.toDisplayString(t._id.slice(0,4)+"..."+t._id.slice(-4)),1)])]),e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(0,2),(a,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"w-100 flex"},[e.createElementVNode("p",U,e.toDisplayString(a.name),1),e.createElementVNode("p",L,[e.createTextVNode(e.toDisplayString(a.quantity)+" "+e.toDisplayString(a.type)+" x "+e.toDisplayString(a.price)+" ",1),e.createElementVNode("span",R,e.toDisplayString(n.returnCurrency()),1)])]))),128)),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value&&t.positions.length>2?(e.openBlock(),e.createElementBlock("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(2),(a,d)=>(e.openBlock(),e.createElementBlock("div",{key:d+2,class:"w-100 flex"},[e.createElementVNode("p",H,e.toDisplayString(a.name),1),e.createElementVNode("p",I,[e.createTextVNode(e.toDisplayString(a.quantity)+" "+e.toDisplayString(a.type)+" x "+e.toDisplayString(a.price)+" ",1),e.createElementVNode("span",$,e.toDisplayString(n.returnCurrency()),1)])]))),128))])):e.createCommentVNode("",!0)]),_:2},1024),t.positions.length>2?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:s[1]||(s[1]=e.withModifiers(a=>i.value=!i.value,["prevent"])),class:"radius-big bg-grey-transp-50 pd-nano w-100 flex-center flex"},e.toDisplayString(i.value?"Hide":`+${t.positions.length-2} more`),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",j,[e.createVNode(V.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",G,e.toDisplayString(n.formatDate(t.deadline)),1),e.createElementVNode("span",J,e.toDisplayString(t.status),1),K]),t.comment?(e.openBlock(),e.createElementBlock("div",Q,[W,e.createElementVNode("p",null,e.toDisplayString(t.comment),1)])):e.createCommentVNode("",!0)]),_:2},1032,["to"]))),256))]),_:1},8,["store","options"])])}}};exports.default=X;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");require("../../../../components/Tab/Tab.vue.cjs");const v=require("../../../../components/Block/Block.vue.cjs"),d=require("../../store/orders.cjs"),f=require("../../../auth/store/auth.cjs");require("../blocks/CardOrder.vue2.cjs");const N=require("../../../globals/components/blocks/CardHeader.vue.cjs"),b=require("../../../globals/components/sections/SectionPageTitle.vue.cjs"),V=require("../../../../components/Feed/Feed.vue.cjs"),E=require("../../../icons/entities/IconTime.vue.cjs"),k={class:"pd-thin"},w={class:"gap-micro flex-nowrap flex"},S={class:"w-100 bg-white radius-small pd-small"},D=e.createElementVNode("p",{class:"mn-b-thin"},"Total",-1),B={class:"w-100 bg-white radius-small pd-small"},x=e.createElementVNode("p",{class:"mn-b-thin"},"Paid",-1),C={class:"w-100 bg-white radius-small pd-small"},q=e.createElementVNode("p",{class:"mn-b-thin"},"Unpaid",-1),P={class:"mn-b-small pd-small bg-white radius-small flex-nowrap flex"},T={class:"w-100"},O={class:"mn-b-thin"},F={class:"t-truncate"},A={class:"w-100 t-right"},M={class:"mn-b-thin"},U={class:"cols-1 mn-b-small gap-thin pd-small bg-white radius-small"},L={class:"mn-r-auto"},R={class:"t-right"},z={class:"t-transp"},H={key:0},I={class:"mn-r-auto"},$={class:"t-right"},j={class:"t-transp"},G={class:"pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex"},J={class:"t-medium mn-r-auto"},K={class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main"},Q=e.createElementVNode("span",{class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red"}," Unpaid ",-1),W={key:0,class:"pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small"},X=e.createElementVNode("p",{class:"mn-b-thin t-transp uppercase p-small t-medium"},"Comment",-1),Y={__name:"Orders",setup(Z){const h=p.useRoute();p.useRouter();const i=e.ref(!1),o=e.ref("all"),m=e.computed(()=>g(d.state.all)),_=e.computed(()=>y(d.state.all,"unpaid"));function g(a){return a.reduce((s,r)=>s+r.positions.reduce((n,t)=>n+t.price,0),0)}function y(a,s){return a.reduce((r,n)=>n.payment.status===s?r+n.positions.reduce((t,c)=>t+c.price,0):r,0)}return e.onMounted(async()=>{}),(a,s)=>{const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",k,[e.createVNode(b.default,{title:"Orders","onUpdate:tabs_current":s[0]||(s[0]=n=>o.value=n),tabs_current:o.value,tabs:[{name:"All",value:"all"},{name:"Created",value:"created"},{name:"Confirmed",value:"confirmed"},{name:"Preparing",value:"preparing"},{name:"Prepared",value:"prepared"},{name:"In delivery",value:"in delivery"},{name:"Delivered",value:"delivered"},{name:"Closed",value:"closed"}],actions:[{to:{name:"AdminOrderAdd"},label:"Create Order"}],class:"mn-b-small bg-grey bg-grey radius-big"},null,8,["tabs_current"]),e.createVNode(v.default,{title:"Balance",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",S,[D,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(m.value)),1)]),e.createElementVNode("div",B,[x,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(_.value)),1)]),e.createElementVNode("div",C,[q,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(m.value)),1)])])]),_:1}),e.createVNode(V.default,{search:!0,states:{empty:{title:"No Orders Found",description:"Currently, there are no orders."}},store:{read:n=>d.actions.read(n)},options:{limit:15,owner:e.unref(h).params._id,...o.value!=="all"&&{status:o.value}},class:"gap-thin cols-3"},{default:e.withCtx(({items:n})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n,t=>(e.openBlock(),e.createBlock(r,{to:{name:"Order Edit",params:{order:t._id}},class:"bg-grey pos-relative pd-medium radius-big"},{default:e.withCtx(()=>{var c;return[e.createVNode(N.default,{entity:t,entityType:"order",user:f.state.user,owner:t.creator,creator:t.creator,date:t.createdAt,class:"mn-b-small"},null,8,["entity","user","owner","creator","date"]),e.createElementVNode("div",P,[e.createElementVNode("div",T,[e.createElementVNode("h3",O,e.toDisplayString(((c=t.customer.target.profile)==null?void 0:c.name)||t.customer.target.phone||t.customer.target.email||"No name"),1),e.createElementVNode("p",F,e.toDisplayString(t.delivery.address||"Not specified"),1)]),e.createElementVNode("div",A,[e.createElementVNode("h3",M,e.toDisplayString(a.returnCurrency())+e.toDisplayString(d.getters.getTotal(t.positions)),1),e.createElementVNode("p",null,"#"+e.toDisplayString(t._id.slice(0,4)+"..."+t._id.slice(-4)),1)])]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(0,2),(l,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"w-100 flex"},[e.createElementVNode("p",L,e.toDisplayString(l.name),1),e.createElementVNode("p",R,[e.createTextVNode(e.toDisplayString(l.quantity)+" "+e.toDisplayString(l.type)+" x "+e.toDisplayString(l.price)+" ",1),e.createElementVNode("span",z,e.toDisplayString(a.returnCurrency()),1)])]))),128)),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value&&t.positions.length>2?(e.openBlock(),e.createElementBlock("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(2),(l,u)=>(e.openBlock(),e.createElementBlock("div",{key:u+2,class:"w-100 flex"},[e.createElementVNode("p",I,e.toDisplayString(l.name),1),e.createElementVNode("p",$,[e.createTextVNode(e.toDisplayString(l.quantity)+" "+e.toDisplayString(l.type)+" x "+e.toDisplayString(l.price)+" ",1),e.createElementVNode("span",j,e.toDisplayString(a.returnCurrency()),1)])]))),128))])):e.createCommentVNode("",!0)]),_:2},1024),t.positions.length>2?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:s[1]||(s[1]=e.withModifiers(l=>i.value=!i.value,["prevent"])),class:"radius-big bg-grey-transp-50 pd-nano w-100 flex-center flex"},e.toDisplayString(i.value?"Hide":`+${t.positions.length-2} more`),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",G,[e.createVNode(E.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",J,e.toDisplayString(a.formatDate(t.deadline)),1),e.createElementVNode("span",K,e.toDisplayString(t.status),1),Q]),t.comment?(e.openBlock(),e.createElementBlock("div",W,[X,e.createElementVNode("p",null,e.toDisplayString(t.comment),1)])):e.createCommentVNode("",!0)]}),_:2},1032,["to"]))),256))]),_:1},8,["store","options"])])}}};exports.default=Y;
@@ -1,38 +1,38 @@
1
- import { ref as b, computed as y, onMounted as T, resolveComponent as $, openBlock as i, createElementBlock as r, createVNode as d, withCtx as p, createElementVNode as e, toDisplayString as s, unref as O, Fragment as h, renderList as f, createBlock as A, createTextVNode as w, Transition as B, createCommentVNode as v, withModifiers as U } from "vue";
2
- import { useRoute as V, useRouter as D } from "vue-router";
1
+ import { ref as y, computed as w, onMounted as $, resolveComponent as O, openBlock as i, createElementBlock as r, createVNode as d, withCtx as _, createElementVNode as e, toDisplayString as s, unref as A, Fragment as f, renderList as v, createBlock as B, createTextVNode as x, Transition as U, createCommentVNode as g, withModifiers as V } from "vue";
2
+ import { useRoute as D, useRouter as E } from "vue-router";
3
3
  import "../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
4
4
  import "../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.js";
5
5
  import "../../../../components/Tab/Tab.vue.js";
6
- import E from "../../../../components/Block/Block.vue.js";
7
- import { state as x, actions as q, getters as z } from "../../store/orders.js";
8
- import { state as F } from "../../../auth/store/auth.js";
6
+ import q from "../../../../components/Block/Block.vue.js";
7
+ import { state as k, actions as z, getters as F } from "../../store/orders.js";
8
+ import { state as I } from "../../../auth/store/auth.js";
9
9
  import "../blocks/CardOrder.vue2.js";
10
- import I from "../../../globals/components/blocks/CardHeader.vue.js";
11
- import M from "../../../globals/components/sections/SectionPageTitle.vue.js";
12
- import R from "../../../../components/Feed/Feed.vue.js";
13
- import S from "../../../icons/entities/IconTime.vue.js";
14
- const H = { class: "pd-thin" }, L = { class: "gap-micro flex-nowrap flex" }, j = { class: "w-100 bg-white radius-small pd-small" }, G = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Total", -1), J = { class: "w-100 bg-white radius-small pd-small" }, K = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Paid", -1), Q = { class: "w-100 bg-white radius-small pd-small" }, W = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Unpaid", -1), X = { class: "mn-b-small pd-small bg-white radius-small flex-nowrap flex" }, Y = { class: "w-100" }, Z = { class: "mn-b-thin" }, ee = { class: "t-truncate" }, te = { class: "w-100 t-right" }, se = { class: "mn-b-thin" }, ae = { class: "cols-1 mn-b-small gap-thin pd-small bg-white radius-small" }, ne = { class: "mn-r-auto" }, le = { class: "t-right" }, ie = { class: "t-transp" }, re = { key: 0 }, oe = { class: "mn-r-auto" }, ce = { class: "t-right" }, de = { class: "t-transp" }, me = { class: "pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex" }, ue = { class: "t-medium mn-r-auto" }, pe = { class: "flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main" }, _e = /* @__PURE__ */ e("span", { class: "flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red" }, " Unpaid ", -1), he = {
10
+ import M from "../../../globals/components/blocks/CardHeader.vue.js";
11
+ import R from "../../../globals/components/sections/SectionPageTitle.vue.js";
12
+ import S from "../../../../components/Feed/Feed.vue.js";
13
+ import H from "../../../icons/entities/IconTime.vue.js";
14
+ const L = { class: "pd-thin" }, j = { class: "gap-micro flex-nowrap flex" }, G = { class: "w-100 bg-white radius-small pd-small" }, J = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Total", -1), K = { class: "w-100 bg-white radius-small pd-small" }, Q = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Paid", -1), W = { class: "w-100 bg-white radius-small pd-small" }, X = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Unpaid", -1), Y = { class: "mn-b-small pd-small bg-white radius-small flex-nowrap flex" }, Z = { class: "w-100" }, ee = { class: "mn-b-thin" }, te = { class: "t-truncate" }, se = { class: "w-100 t-right" }, ae = { class: "mn-b-thin" }, ne = { class: "cols-1 mn-b-small gap-thin pd-small bg-white radius-small" }, le = { class: "mn-r-auto" }, ie = { class: "t-right" }, re = { class: "t-transp" }, oe = { key: 0 }, ce = { class: "mn-r-auto" }, de = { class: "t-right" }, me = { class: "t-transp" }, ue = { class: "pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex" }, pe = { class: "t-medium mn-r-auto" }, _e = { class: "flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main" }, he = /* @__PURE__ */ e("span", { class: "flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red" }, " Unpaid ", -1), fe = {
15
15
  key: 0,
16
16
  class: "pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small"
17
- }, fe = /* @__PURE__ */ e("p", { class: "mn-b-thin t-transp uppercase p-small t-medium" }, "Comment", -1), Be = {
17
+ }, ve = /* @__PURE__ */ e("p", { class: "mn-b-thin t-transp uppercase p-small t-medium" }, "Comment", -1), Ue = {
18
18
  __name: "Orders",
19
- setup(ve) {
20
- const k = V();
21
- D();
22
- const m = b(!1), u = b("all"), g = y(() => P(x.all)), C = y(() => N(x.all, "unpaid"));
23
- function P(n) {
24
- return n.reduce((o, c) => o + c.positions.reduce((l, t) => l + t.price, 0), 0);
19
+ setup(ge) {
20
+ const C = D();
21
+ E();
22
+ const m = y(!1), u = y("all"), b = w(() => N(k.all)), P = w(() => T(k.all, "unpaid"));
23
+ function N(a) {
24
+ return a.reduce((o, c) => o + c.positions.reduce((n, t) => n + t.price, 0), 0);
25
25
  }
26
- function N(n, o) {
27
- return n.reduce((c, l) => l.payment.status === o ? c + l.positions.reduce((t, a) => t + a.price, 0) : c, 0);
26
+ function T(a, o) {
27
+ return a.reduce((c, n) => n.payment.status === o ? c + n.positions.reduce((t, p) => t + p.price, 0) : c, 0);
28
28
  }
29
- return T(async () => {
30
- }), (n, o) => {
31
- const c = $("router-link");
32
- return i(), r("div", H, [
33
- d(M, {
29
+ return $(async () => {
30
+ }), (a, o) => {
31
+ const c = O("router-link");
32
+ return i(), r("div", L, [
33
+ d(R, {
34
34
  title: "Orders",
35
- "onUpdate:tabs_current": o[0] || (o[0] = (l) => u.value = l),
35
+ "onUpdate:tabs_current": o[0] || (o[0] = (n) => u.value = n),
36
36
  tabs_current: u.value,
37
37
  tabs: [
38
38
  { name: "All", value: "all" },
@@ -49,29 +49,29 @@ const H = { class: "pd-thin" }, L = { class: "gap-micro flex-nowrap flex" }, j =
49
49
  ],
50
50
  class: "mn-b-small bg-grey bg-grey radius-big"
51
51
  }, null, 8, ["tabs_current"]),
52
- d(E, {
52
+ d(q, {
53
53
  title: "Balance",
54
54
  class: "mn-b-thin"
55
55
  }, {
56
- default: p(() => [
57
- e("div", L, [
58
- e("div", j, [
59
- G,
60
- e("h3", null, s(n.formatPrice(g.value)), 1)
56
+ default: _(() => [
57
+ e("div", j, [
58
+ e("div", G, [
59
+ J,
60
+ e("h3", null, s(a.formatPrice(b.value)), 1)
61
61
  ]),
62
- e("div", J, [
63
- K,
64
- e("h3", null, s(n.formatPrice(C.value)), 1)
62
+ e("div", K, [
63
+ Q,
64
+ e("h3", null, s(a.formatPrice(P.value)), 1)
65
65
  ]),
66
- e("div", Q, [
67
- W,
68
- e("h3", null, s(n.formatPrice(g.value)), 1)
66
+ e("div", W, [
67
+ X,
68
+ e("h3", null, s(a.formatPrice(b.value)), 1)
69
69
  ])
70
70
  ])
71
71
  ]),
72
72
  _: 1
73
73
  }),
74
- d(R, {
74
+ d(S, {
75
75
  search: !0,
76
76
  states: {
77
77
  empty: {
@@ -80,19 +80,19 @@ const H = { class: "pd-thin" }, L = { class: "gap-micro flex-nowrap flex" }, j =
80
80
  }
81
81
  },
82
82
  store: {
83
- read: (l) => q.read(l)
83
+ read: (n) => z.read(n)
84
84
  },
85
85
  options: {
86
86
  limit: 15,
87
- owner: O(k).params._id,
87
+ owner: A(C).params._id,
88
88
  ...u.value !== "all" && { status: u.value }
89
89
  },
90
90
  class: "gap-thin cols-3"
91
91
  }, {
92
- default: p(({
93
- items: l
92
+ default: _(({
93
+ items: n
94
94
  }) => [
95
- (i(!0), r(h, null, f(l, (t) => (i(), A(c, {
95
+ (i(!0), r(f, null, v(n, (t) => (i(), B(c, {
96
96
  to: {
97
97
  name: "Order Edit",
98
98
  params: {
@@ -101,74 +101,77 @@ const H = { class: "pd-thin" }, L = { class: "gap-micro flex-nowrap flex" }, j =
101
101
  },
102
102
  class: "bg-grey pos-relative pd-medium radius-big"
103
103
  }, {
104
- default: p(() => [
105
- d(I, {
106
- entity: t,
107
- entityType: "order",
108
- user: F.user,
109
- owner: t.creator,
110
- creator: t.creator,
111
- date: t.createdAt,
112
- class: "mn-b-small"
113
- }, null, 8, ["entity", "user", "owner", "creator", "date"]),
114
- e("div", X, [
104
+ default: _(() => {
105
+ var p;
106
+ return [
107
+ d(M, {
108
+ entity: t,
109
+ entityType: "order",
110
+ user: I.user,
111
+ owner: t.creator,
112
+ creator: t.creator,
113
+ date: t.createdAt,
114
+ class: "mn-b-small"
115
+ }, null, 8, ["entity", "user", "owner", "creator", "date"]),
115
116
  e("div", Y, [
116
- e("h3", Z, s(t.customer.target.profile.name || t.customer.target.phone || t.customer.target.email || "No name"), 1),
117
- e("p", ee, s(t.delivery.address || "Not specified"), 1)
118
- ]),
119
- e("div", te, [
120
- e("h3", se, s(n.returnCurrency()) + s(z.getTotal(t.positions)), 1),
121
- e("p", null, "#" + s(t._id.slice(0, 4) + "..." + t._id.slice(-4)), 1)
122
- ])
123
- ]),
124
- e("div", ae, [
125
- (i(!0), r(h, null, f(t.positions.slice(0, 2), (a, _) => (i(), r("div", {
126
- key: _,
127
- class: "w-100 flex"
128
- }, [
129
- e("p", ne, s(a.name), 1),
130
- e("p", le, [
131
- w(s(a.quantity) + " " + s(a.type) + " x " + s(a.price) + " ", 1),
132
- e("span", ie, s(n.returnCurrency()), 1)
133
- ])
134
- ]))), 128)),
135
- d(B, { name: "fade" }, {
136
- default: p(() => [
137
- m.value && t.positions.length > 2 ? (i(), r("div", re, [
138
- (i(!0), r(h, null, f(t.positions.slice(2), (a, _) => (i(), r("div", {
139
- key: _ + 2,
140
- class: "w-100 flex"
141
- }, [
142
- e("p", oe, s(a.name), 1),
143
- e("p", ce, [
144
- w(s(a.quantity) + " " + s(a.type) + " x " + s(a.price) + " ", 1),
145
- e("span", de, s(n.returnCurrency()), 1)
146
- ])
147
- ]))), 128))
148
- ])) : v("", !0)
117
+ e("div", Z, [
118
+ e("h3", ee, s(((p = t.customer.target.profile) == null ? void 0 : p.name) || t.customer.target.phone || t.customer.target.email || "No name"), 1),
119
+ e("p", te, s(t.delivery.address || "Not specified"), 1)
149
120
  ]),
150
- _: 2
151
- }, 1024),
152
- t.positions.length > 2 ? (i(), r("button", {
153
- key: 0,
154
- onClick: o[1] || (o[1] = U((a) => m.value = !m.value, ["prevent"])),
155
- class: "radius-big bg-grey-transp-50 pd-nano w-100 flex-center flex"
156
- }, s(m.value ? "Hide" : `+${t.positions.length - 2} more`), 1)) : v("", !0)
157
- ]),
158
- e("div", me, [
159
- d(S, {
160
- class: "i-semi t-transp",
161
- fill: "rgb(var(--black)"
162
- }),
163
- e("p", ue, s(n.formatDate(t.deadline)), 1),
164
- e("span", pe, s(t.status), 1),
165
- _e
166
- ]),
167
- t.comment ? (i(), r("div", he, [
168
- fe,
169
- e("p", null, s(t.comment), 1)
170
- ])) : v("", !0)
171
- ]),
121
+ e("div", se, [
122
+ e("h3", ae, s(a.returnCurrency()) + s(F.getTotal(t.positions)), 1),
123
+ e("p", null, "#" + s(t._id.slice(0, 4) + "..." + t._id.slice(-4)), 1)
124
+ ])
125
+ ]),
126
+ e("div", ne, [
127
+ (i(!0), r(f, null, v(t.positions.slice(0, 2), (l, h) => (i(), r("div", {
128
+ key: h,
129
+ class: "w-100 flex"
130
+ }, [
131
+ e("p", le, s(l.name), 1),
132
+ e("p", ie, [
133
+ x(s(l.quantity) + " " + s(l.type) + " x " + s(l.price) + " ", 1),
134
+ e("span", re, s(a.returnCurrency()), 1)
135
+ ])
136
+ ]))), 128)),
137
+ d(U, { name: "fade" }, {
138
+ default: _(() => [
139
+ m.value && t.positions.length > 2 ? (i(), r("div", oe, [
140
+ (i(!0), r(f, null, v(t.positions.slice(2), (l, h) => (i(), r("div", {
141
+ key: h + 2,
142
+ class: "w-100 flex"
143
+ }, [
144
+ e("p", ce, s(l.name), 1),
145
+ e("p", de, [
146
+ x(s(l.quantity) + " " + s(l.type) + " x " + s(l.price) + " ", 1),
147
+ e("span", me, s(a.returnCurrency()), 1)
148
+ ])
149
+ ]))), 128))
150
+ ])) : g("", !0)
151
+ ]),
152
+ _: 2
153
+ }, 1024),
154
+ t.positions.length > 2 ? (i(), r("button", {
155
+ key: 0,
156
+ onClick: o[1] || (o[1] = V((l) => m.value = !m.value, ["prevent"])),
157
+ class: "radius-big bg-grey-transp-50 pd-nano w-100 flex-center flex"
158
+ }, s(m.value ? "Hide" : `+${t.positions.length - 2} more`), 1)) : g("", !0)
159
+ ]),
160
+ e("div", ue, [
161
+ d(H, {
162
+ class: "i-semi t-transp",
163
+ fill: "rgb(var(--black)"
164
+ }),
165
+ e("p", pe, s(a.formatDate(t.deadline)), 1),
166
+ e("span", _e, s(t.status), 1),
167
+ he
168
+ ]),
169
+ t.comment ? (i(), r("div", fe, [
170
+ ve,
171
+ e("p", null, s(t.comment), 1)
172
+ ])) : g("", !0)
173
+ ];
174
+ }),
172
175
  _: 2
173
176
  }, 1032, ["to"]))), 256))
174
177
  ]),
@@ -179,5 +182,5 @@ const H = { class: "pd-thin" }, L = { class: "gap-micro flex-nowrap flex" }, j =
179
182
  }
180
183
  };
181
184
  export {
182
- Be as default
185
+ Ue as default
183
186
  };