@ozdao/prometheus-framework 0.2.92 → 0.2.93

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. package/dist/events.server.js +14 -6
  2. package/dist/events.server.mjs +14 -6
  3. package/dist/main-CX2ISR43.mjs +13629 -0
  4. package/dist/main-cffh4bbv.js +92 -0
  5. package/dist/main.css +1 -1
  6. package/dist/orders.server.js +32 -18
  7. package/dist/orders.server.mjs +32 -18
  8. package/dist/organizations.server.js +2 -1
  9. package/dist/organizations.server.mjs +2 -1
  10. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +46 -48
  12. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  14. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  16. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
  18. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  20. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  22. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  24. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
  26. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
  28. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
  30. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
  32. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  34. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  36. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  44. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  46. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  50. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +3 -3
  54. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  56. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
  61. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
  62. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  63. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
  64. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
  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/ButtonCheck.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  70. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.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 +3 -3
  74. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  76. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  78. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +3 -3
  80. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +46 -46
  84. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  86. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
  87. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
  88. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
  90. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
  91. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
  92. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
  93. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
  94. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
  96. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +30 -30
  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 +99 -70
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +3 -3
  102. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +2 -2
  104. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
  106. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +1 -1
  110. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
  112. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
  114. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
  116. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +27 -25
  118. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +11 -11
  120. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +46 -43
  124. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +162 -168
  126. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +27 -26
  128. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +7 -7
  130. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  132. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  134. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +3 -3
  136. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  138. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
  140. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +2 -2
  142. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +13 -13
  144. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  146. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  148. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  150. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  152. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  154. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +16 -17
  156. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +22 -20
  158. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  160. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
  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/store/products.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
  166. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  168. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
  170. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
  172. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  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 +2 -2
  176. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  177. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
  178. package/dist/prometheus-framework.cjs.js +1 -1
  179. package/dist/prometheus-framework.es.js +1 -1
  180. package/dist/style.css +1 -1
  181. package/dist/web-CQQEUA9l.js +1 -0
  182. package/dist/web-D2Em-p-C.mjs +54 -0
  183. package/package.json +1 -1
  184. package/src/components/Address/Address.vue +23 -34
  185. package/src/components/LocationMarker/LocationMarker.vue +6 -1
  186. package/src/components/LocationSelection/LocationSelection.vue +4 -0
  187. package/src/components/Map/Map.vue +29 -15
  188. package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
  189. package/src/modules/events/controllers/events.controller.js +4 -4
  190. package/src/modules/globals/components/blocks/CardHeader.vue +2 -2
  191. package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
  192. package/src/modules/landing/components/pages/Farming.vue +226 -0
  193. package/src/modules/landing/components/pages/Governance.vue +3 -5
  194. package/src/modules/landing/components/pages/Home.vue +0 -3
  195. package/src/modules/landing/components/pages/Hotel.vue +1 -3
  196. package/src/modules/landing/components/pages/Page.vue +0 -3
  197. package/src/modules/landing/components/sections/Examples.vue +4 -56
  198. package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
  199. package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
  200. package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
  201. package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
  202. package/src/modules/landing/router/landing.js +11 -0
  203. package/src/modules/marketplace/components/sections/Filters.vue +26 -23
  204. package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
  205. package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
  206. package/src/modules/orders/components/pages/Order.vue +2 -6
  207. package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
  208. package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
  209. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
  210. package/src/modules/orders/components/pages/Orders.vue +60 -11
  211. package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
  212. package/src/modules/orders/controllers/orders.controller.js +29 -18
  213. package/src/modules/orders/models/order.model.js +8 -2
  214. package/src/modules/orders/router/orders.backoffice.router.js +1 -1
  215. package/src/modules/orders/router/orders.router.js +2 -2
  216. package/src/modules/orders/store/orders.js +3 -7
  217. package/src/modules/orders/store/shopcart.js +1 -1
  218. package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
  219. package/src/modules/organizations/components/pages/Department.vue +5 -1
  220. package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
  221. package/src/modules/organizations/components/pages/Members.vue +2 -1
  222. package/src/modules/organizations/components/pages/Organization.vue +1 -1
  223. package/src/modules/organizations/controllers/memberships.controller.js +3 -1
  224. package/src/modules/organizations/store/memberships.js +1 -1
  225. package/src/modules/products/components/blocks/CardProduct.vue +2 -3
  226. package/src/modules/products/components/pages/ProductEdit.vue +10 -13
  227. package/src/modules/products/components/pages/Products.vue +2 -0
  228. package/src/modules/products/store/products.js +25 -2
  229. package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
  230. package/src/modules/users/components/blocks/CardUser.vue +1 -0
  231. package/src/modules/landing/components/sections/AboutSection.vue +0 -69
@@ -30,6 +30,11 @@ var order_model = (db) => {
30
30
  status: {
31
31
  type: String
32
32
  },
33
+ deadline: {
34
+ type: Date,
35
+ default: () => new Date(Date.now() + 30 * 6e4)
36
+ // Добавляет 30 минут к текущему времени
37
+ },
33
38
  status_history: [{
34
39
  status: {
35
40
  type: String,
@@ -55,11 +60,13 @@ var order_model = (db) => {
55
60
  payment: {
56
61
  type: {
57
62
  type: String,
58
- trim: true
63
+ trim: true,
64
+ default: "cash"
59
65
  },
60
66
  status: {
61
67
  type: String,
62
- trim: true
68
+ trim: true,
69
+ default: "unpaid"
63
70
  }
64
71
  },
65
72
  delivery: {
@@ -213,17 +220,7 @@ ${formatPositions(order.positions)}
213
220
  🧑 Agent: ${order.referralCode}
214
221
  `;
215
222
  }
216
- function initializeOrder(orderData, userId) {
217
- orderData.status = "created";
218
- orderData.status_history = orderData.status_history || [];
219
- orderData.status_history.push({
220
- status: orderData.status,
221
- changedBy: userId,
222
- timestamp: /* @__PURE__ */ new Date(),
223
- comment: ""
224
- });
225
- }
226
- async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor) {
223
+ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCreator) {
227
224
  let searchCriteria = {};
228
225
  if (customerInfo.phone) {
229
226
  searchCriteria.phone = customerInfo.phone;
@@ -239,8 +236,14 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor)
239
236
  const newCustomerData = {
240
237
  ...customerInfo,
241
238
  owner: orderOwner,
242
- creator: customerInfo.creator || { type: "Visitor", target: visitor || orderOwner.target },
243
- identity: customerInfo.indentity || { type: "Visitor", target: visitor || orderOwner.target }
239
+ creator: {
240
+ type: customerInfo.creator.type || orderCreator.type,
241
+ target: customerInfo.creator.target || orderCreator.target
242
+ },
243
+ identity: {
244
+ type: customerInfo.identity.type || orderCreator.type,
245
+ target: customerInfo.identity.target || orderCreator.target
246
+ }
244
247
  };
245
248
  customer = await Customer.create(newCustomerData);
246
249
  }
@@ -254,6 +257,16 @@ async function sendOrderMessage(orderData) {
254
257
  console.error(err);
255
258
  }
256
259
  }
260
+ function initializeOrder(orderData, userId) {
261
+ orderData.status = "created";
262
+ orderData.status_history = orderData.status_history || [];
263
+ orderData.status_history.push({
264
+ status: orderData.status,
265
+ changedBy: userId,
266
+ timestamp: /* @__PURE__ */ new Date(),
267
+ comment: ""
268
+ });
269
+ }
257
270
  const controllerFactory$1 = (db) => {
258
271
  const Order = db.order;
259
272
  const Customer = db.customer;
@@ -263,9 +276,9 @@ const controllerFactory$1 = (db) => {
263
276
  initializeOrder(orderData, userId);
264
277
  try {
265
278
  if (!orderData.customer.target) {
266
- let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.visitor);
279
+ let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
267
280
  orderData.customer = { type: "Customer", target: customer._id };
268
- if (!orderData.creator?.target) {
281
+ if (!orderData.creator.target) {
269
282
  orderData.creator = { type: "Customer", target: customer._id };
270
283
  }
271
284
  }
@@ -326,7 +339,8 @@ const controllerFactory$1 = (db) => {
326
339
  }
327
340
  };
328
341
  const update = async (req, res) => {
329
- const order = await Order.findById(new db.mongoose.Schema.Types.ObjectId(req.body._id));
342
+ console.log(req.body);
343
+ const order = await Order.findOne({ _id: req.body._id });
330
344
  if (!order) {
331
345
  return res.status(404).send({ errorCode: "ORDER_NOT_FOUND", message: "Order not found." });
332
346
  }
@@ -29,6 +29,11 @@ var order_model = (db) => {
29
29
  status: {
30
30
  type: String
31
31
  },
32
+ deadline: {
33
+ type: Date,
34
+ default: () => new Date(Date.now() + 30 * 6e4)
35
+ // Добавляет 30 минут к текущему времени
36
+ },
32
37
  status_history: [{
33
38
  status: {
34
39
  type: String,
@@ -54,11 +59,13 @@ var order_model = (db) => {
54
59
  payment: {
55
60
  type: {
56
61
  type: String,
57
- trim: true
62
+ trim: true,
63
+ default: "cash"
58
64
  },
59
65
  status: {
60
66
  type: String,
61
- trim: true
67
+ trim: true,
68
+ default: "unpaid"
62
69
  }
63
70
  },
64
71
  delivery: {
@@ -212,17 +219,7 @@ ${formatPositions(order.positions)}
212
219
  🧑 Agent: ${order.referralCode}
213
220
  `;
214
221
  }
215
- function initializeOrder(orderData, userId) {
216
- orderData.status = "created";
217
- orderData.status_history = orderData.status_history || [];
218
- orderData.status_history.push({
219
- status: orderData.status,
220
- changedBy: userId,
221
- timestamp: /* @__PURE__ */ new Date(),
222
- comment: ""
223
- });
224
- }
225
- async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor) {
222
+ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCreator) {
226
223
  let searchCriteria = {};
227
224
  if (customerInfo.phone) {
228
225
  searchCriteria.phone = customerInfo.phone;
@@ -238,8 +235,14 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, visitor)
238
235
  const newCustomerData = {
239
236
  ...customerInfo,
240
237
  owner: orderOwner,
241
- creator: customerInfo.creator || { type: "Visitor", target: visitor || orderOwner.target },
242
- identity: customerInfo.indentity || { type: "Visitor", target: visitor || orderOwner.target }
238
+ creator: {
239
+ type: customerInfo.creator.type || orderCreator.type,
240
+ target: customerInfo.creator.target || orderCreator.target
241
+ },
242
+ identity: {
243
+ type: customerInfo.identity.type || orderCreator.type,
244
+ target: customerInfo.identity.target || orderCreator.target
245
+ }
243
246
  };
244
247
  customer = await Customer.create(newCustomerData);
245
248
  }
@@ -253,6 +256,16 @@ async function sendOrderMessage(orderData) {
253
256
  console.error(err);
254
257
  }
255
258
  }
259
+ function initializeOrder(orderData, userId) {
260
+ orderData.status = "created";
261
+ orderData.status_history = orderData.status_history || [];
262
+ orderData.status_history.push({
263
+ status: orderData.status,
264
+ changedBy: userId,
265
+ timestamp: /* @__PURE__ */ new Date(),
266
+ comment: ""
267
+ });
268
+ }
256
269
  const controllerFactory$1 = (db) => {
257
270
  const Order = db.order;
258
271
  const Customer = db.customer;
@@ -262,9 +275,9 @@ const controllerFactory$1 = (db) => {
262
275
  initializeOrder(orderData, userId);
263
276
  try {
264
277
  if (!orderData.customer.target) {
265
- let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.visitor);
278
+ let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
266
279
  orderData.customer = { type: "Customer", target: customer._id };
267
- if (!orderData.creator?.target) {
280
+ if (!orderData.creator.target) {
268
281
  orderData.creator = { type: "Customer", target: customer._id };
269
282
  }
270
283
  }
@@ -325,7 +338,8 @@ const controllerFactory$1 = (db) => {
325
338
  }
326
339
  };
327
340
  const update = async (req, res) => {
328
- const order = await Order.findById(new db.mongoose.Schema.Types.ObjectId(req.body._id));
341
+ console.log(req.body);
342
+ const order = await Order.findOne({ _id: req.body._id });
329
343
  if (!order) {
330
344
  return res.status(404).send({ errorCode: "ORDER_NOT_FOUND", message: "Order not found." });
331
345
  }
@@ -462,7 +462,8 @@ const controllerFactory$4 = (db) => {
462
462
  ...req.query.user && { user: new ObjectId$1(req.query.user) },
463
463
  ...req.query.type && { type: req.query.type },
464
464
  ...req.query.target && { target: new ObjectId$1(req.query.target) },
465
- ...req.query.role && { role: req.query.role }
465
+ // ...(req.query.role && { role: req.query.role }),
466
+ ...req.query.role && { role: { $in: req.query.role } }
466
467
  }
467
468
  },
468
469
  {
@@ -461,7 +461,8 @@ const controllerFactory$4 = (db) => {
461
461
  ...req.query.user && { user: new ObjectId$1(req.query.user) },
462
462
  ...req.query.type && { type: req.query.type },
463
463
  ...req.query.target && { target: new ObjectId$1(req.query.target) },
464
- ...req.query.role && { role: req.query.role }
464
+ // ...(req.query.role && { role: req.query.role }),
465
+ ...req.query.role && { role: { $in: req.query.role } }
465
466
  }
466
467
  },
467
468
  {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");require("./Address.vue.cjs");const v=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),k={key:0,class:"t-transp mn-r-small"},b=["placeholder","value"],w={key:0,class:"mn-t-thin invalid-feedback"},E={__name:"Address",props:{apiKey:{type:String,required:!0},label:null,placeholder:"Enter something here",field:null,location:{type:Object,default:{lat:48.6900735,lng:41.1620239}},address:{type:String,default:""}},emits:["update:address","update:location","update:country","update:state","update:city"],setup(n,{emit:m}){const r=n,l=m,s=e.ref(null);let d;const i=()=>{new h.Loader({apiKey:r.apiKey,version:"weekly",libraries:["places"]}).load().then(()=>{d=new google.maps.places.Autocomplete(s.value),d.addListener("place_changed",f)}).catch(o=>{console.error(o)})},y=()=>{d||i()},f=()=>{const t=d.getPlace();if(!t.geometry||!t.address_components)return;let o="",u="",p="";for(let c=0;c<t.address_components.length;c++){console.log(t.address_components);let a=t.address_components[c];a.types.includes("country")&&(o=a.long_name),a.types.includes("administrative_area_level_1")&&(u=a.long_name),a.types.includes("locality")&&(p=a.long_name)}const g=t.formatted_address,_={lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};l("update:address",g),l("update:location",_),l("update:country",o),l("update:state",u),l("update:city",p)};return e.watchEffect(()=>{r.address!==s.value&&(s.value=r.address)}),e.onMounted(()=>{i()}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.$attrs.class,"flex-nowrap flex"])},[n.label?(e.openBlock(),e.createElementBlock("div",k,[e.createElementVNode("span",null,e.toDisplayString(n.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"addressInput",ref:s,class:"w-100",placeholder:n.placeholder,value:n.address,onInput:y},null,40,b),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[t.validation?(e.openBlock(),e.createElementBlock("div",w," * "+e.toDisplayString(t.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],2))}},B=v.default(E,[["__scopeId","data-v-5cf1cb51"]]);exports.default=B;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../../../../node_modules/@googlemaps/js-api-loader/dist/index.cjs");require("./Address.vue.cjs");const v=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),_={key:0,class:"t-transp mn-r-small"},h=["placeholder","value"],k={key:0,class:"mn-t-thin invalid-feedback"},b={__name:"Address",props:{apiKey:{type:String,required:!0},label:null,placeholder:"Enter something here",field:null,location:{type:Object,default:{lat:48.6900735,lng:41.1620239}},address:{type:String,default:""},locale:{type:String,default:"en"}},emits:["update:address","update:location","update:country","update:state","update:city"],setup(l,{emit:u}){const p=l,o=u,c=e.ref(null);let d;const m=()=>{const t=d.getPlace();if(!t.geometry||!t.address_components)return;let a="",s="",i="";for(let r=0;r<t.address_components.length;r++){let n=t.address_components[r];n.types.includes("country")&&(a=n.long_name),n.types.includes("administrative_area_level_1")&&(s=n.long_name),n.types.includes("locality")&&(i=n.long_name)}const y=t.formatted_address,g={lat:t.geometry.location.lat(),lng:t.geometry.location.lng()};o("update:address",y),o("update:location",g),o("update:country",a),o("update:state",s),o("update:city",i)};return e.onMounted(()=>{new f.Loader({apiKey:p.apiKey,version:"weekly",libraries:["places"]}).load().then(()=>{d=new google.maps.places.Autocomplete(c.value),d.addListener("place_changed",m)}).catch(a=>{console.error(a)})}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.$attrs.class,"flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"addressInput",ref:c,class:"w-100",placeholder:l.placeholder,value:l.address,onInput:a[0]||(a[0]=(...s)=>t.onInput&&t.onInput(...s))},null,40,h),e.createVNode(e.Transition,{mode:"out-in",name:"fade"},{default:e.withCtx(()=>[t.validation?(e.openBlock(),e.createElementBlock("div",k," * "+e.toDisplayString(t.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],2))}},w=v.default(b,[["__scopeId","data-v-1fe1017e"]]);exports.default=w;
@@ -1,14 +1,14 @@
1
- import { ref as k, watchEffect as A, onMounted as I, openBlock as c, createElementBlock as i, normalizeClass as C, createElementVNode as f, toDisplayString as y, createCommentVNode as g, createVNode as E, Transition as x, withCtx as K } from "vue";
2
- import { Loader as L } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
1
+ import { ref as w, onMounted as k, openBlock as r, createElementBlock as i, normalizeClass as b, createElementVNode as u, toDisplayString as m, createCommentVNode as y, createVNode as I, Transition as A, withCtx as C } from "vue";
2
+ import { Loader as S } from "../../../../node_modules/@googlemaps/js-api-loader/dist/index.js";
3
3
  import "./Address.vue.js";
4
- import N from "../../../../_virtual/_plugin-vue_export-helper.js";
5
- const S = {
4
+ import E from "../../../../_virtual/_plugin-vue_export-helper.js";
5
+ const K = {
6
6
  key: 0,
7
7
  class: "t-transp mn-r-small"
8
- }, V = ["placeholder", "value"], B = {
8
+ }, L = ["placeholder", "value"], N = {
9
9
  key: 0,
10
10
  class: "mn-t-thin invalid-feedback"
11
- }, P = {
11
+ }, V = {
12
12
  __name: "Address",
13
13
  props: {
14
14
  apiKey: {
@@ -25,67 +25,65 @@ const S = {
25
25
  address: {
26
26
  type: String,
27
27
  default: ""
28
+ },
29
+ locale: {
30
+ type: String,
31
+ default: "en"
28
32
  }
29
33
  },
30
34
  emits: ["update:address", "update:location", "update:country", "update:state", "update:city"],
31
- setup(a, { emit: _ }) {
32
- const d = a, o = _, l = k(null);
35
+ setup(n, { emit: f }) {
36
+ const g = n, o = f, c = w(null);
33
37
  let s;
34
- const p = () => {
35
- new L({
36
- apiKey: d.apiKey,
37
- version: "weekly",
38
- libraries: ["places"]
39
- }).load().then(() => {
40
- s = new google.maps.places.Autocomplete(l.value), s.addListener("place_changed", v);
41
- }).catch((n) => {
42
- console.error(n);
43
- });
44
- }, h = () => {
45
- s || p();
46
- }, v = () => {
38
+ const h = () => {
47
39
  const e = s.getPlace();
48
40
  if (!e.geometry || !e.address_components)
49
41
  return;
50
- let n = "", u = "", m = "";
51
- for (let r = 0; r < e.address_components.length; r++) {
52
- console.log(e.address_components);
53
- let t = e.address_components[r];
54
- t.types.includes("country") && (n = t.long_name), t.types.includes("administrative_area_level_1") && (u = t.long_name), t.types.includes("locality") && (m = t.long_name);
42
+ let t = "", l = "", p = "";
43
+ for (let d = 0; d < e.address_components.length; d++) {
44
+ let a = e.address_components[d];
45
+ a.types.includes("country") && (t = a.long_name), a.types.includes("administrative_area_level_1") && (l = a.long_name), a.types.includes("locality") && (p = a.long_name);
55
46
  }
56
- const w = e.formatted_address, b = { lat: e.geometry.location.lat(), lng: e.geometry.location.lng() };
57
- o("update:address", w), o("update:location", b), o("update:country", n), o("update:state", u), o("update:city", m);
47
+ const _ = e.formatted_address, v = { lat: e.geometry.location.lat(), lng: e.geometry.location.lng() };
48
+ o("update:address", _), o("update:location", v), o("update:country", t), o("update:state", l), o("update:city", p);
58
49
  };
59
- return A(() => {
60
- d.address !== l.value && (l.value = d.address);
61
- }), I(() => {
62
- p();
63
- }), (e, n) => (c(), i("div", {
64
- class: C([e.$attrs.class, "flex-nowrap flex"])
50
+ return k(() => {
51
+ new S({
52
+ apiKey: g.apiKey,
53
+ version: "weekly",
54
+ libraries: ["places"]
55
+ // language: props.locale,
56
+ }).load().then(() => {
57
+ s = new google.maps.places.Autocomplete(c.value), s.addListener("place_changed", h);
58
+ }).catch((t) => {
59
+ console.error(t);
60
+ });
61
+ }), (e, t) => (r(), i("div", {
62
+ class: b([e.$attrs.class, "flex-nowrap flex"])
65
63
  }, [
66
- a.label ? (c(), i("div", S, [
67
- f("span", null, y(a.label), 1)
68
- ])) : g("", !0),
69
- f("input", {
64
+ n.label ? (r(), i("div", K, [
65
+ u("span", null, m(n.label), 1)
66
+ ])) : y("", !0),
67
+ u("input", {
70
68
  ref_key: "addressInput",
71
- ref: l,
69
+ ref: c,
72
70
  class: "w-100",
73
- placeholder: a.placeholder,
74
- value: a.address,
75
- onInput: h
76
- }, null, 40, V),
77
- E(x, {
71
+ placeholder: n.placeholder,
72
+ value: n.address,
73
+ onInput: t[0] || (t[0] = (...l) => e.onInput && e.onInput(...l))
74
+ }, null, 40, L),
75
+ I(A, {
78
76
  mode: "out-in",
79
77
  name: "fade"
80
78
  }, {
81
- default: K(() => [
82
- e.validation ? (c(), i("div", B, " * " + y(e.validation.message), 1)) : g("", !0)
79
+ default: C(() => [
80
+ e.validation ? (r(), i("div", N, " * " + m(e.validation.message), 1)) : y("", !0)
83
81
  ]),
84
82
  _: 1
85
83
  })
86
84
  ], 2));
87
85
  }
88
- }, M = /* @__PURE__ */ N(P, [["__scopeId", "data-v-5cf1cb51"]]);
86
+ }, x = /* @__PURE__ */ E(V, [["__scopeId", "data-v-1fe1017e"]]);
89
87
  export {
90
- M as default
88
+ x as default
91
89
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../Tooltip/Tooltip.vue2.cjs"),a={class:"bg-grey pd-medium radius-medium"},c={key:0,class:"mn-b-small flex-v-center flex-nowrap flex"},s={key:0,class:"mn-r-thin t-medium p-big"},u=["onClick"],d=e.createElementVNode("p",{class:"bg-main radius-small t-center i-medium"},"i",-1),m={key:1,class:"w-100"},k={__name:"Block",props:{title:{type:String,default:null},tooltip:{type:String,default:null},actions:{type:Array,default:null},placeholder:{type:String,default:"Nothing here"},options:{type:Object,default:{theme:"white"}}},setup(t){e.useSlots();const r=(n,o={})=>n?n(o).some(l=>Array.isArray(l.children)?!!l.children.length:l.type!==e.Comment):!1;return(n,o)=>(e.openBlock(),e.createElementBlock("div",a,[t.title||t.actions?(e.openBlock(),e.createElementBlock("div",c,[t.title?(e.openBlock(),e.createElementBlock("p",s,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,l=>(e.openBlock(),e.createElementBlock("button",{onClick:l.function,class:e.normalizeClass(["pd-thin button-delete button",l.class||"bg-main radius-small t-center i-medium"])},e.toDisplayString(l.label),11,u))),256)),t.tooltip?(e.openBlock(),e.createBlock(i.default,{key:1,text:t.tooltip},{default:e.withCtx(()=>[d]),_:1},8,["text"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r(n.$slots.default)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",m,e.toDisplayString(t.placeholder),1)),e.renderSlot(n.$slots,"default")]))}};exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../Tooltip/Tooltip.vue.cjs"),a={class:"bg-grey pd-medium radius-medium"},c={key:0,class:"mn-b-small flex-v-center flex-nowrap flex"},s={key:0,class:"mn-r-thin t-medium p-big"},u=["onClick"],d=e.createElementVNode("p",{class:"bg-main radius-small t-center i-medium"},"i",-1),m={key:1,class:"w-100"},k={__name:"Block",props:{title:{type:String,default:null},tooltip:{type:String,default:null},actions:{type:Array,default:null},placeholder:{type:String,default:"Nothing here"},options:{type:Object,default:{theme:"white"}}},setup(t){e.useSlots();const r=(n,o={})=>n?n(o).some(l=>Array.isArray(l.children)?!!l.children.length:l.type!==e.Comment):!1;return(n,o)=>(e.openBlock(),e.createElementBlock("div",a,[t.title||t.actions?(e.openBlock(),e.createElementBlock("div",c,[t.title?(e.openBlock(),e.createElementBlock("p",s,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,l=>(e.openBlock(),e.createElementBlock("button",{onClick:l.function,class:e.normalizeClass(["pd-thin button-delete button",l.class||"bg-main radius-small t-center i-medium"])},e.toDisplayString(l.label),11,u))),256)),t.tooltip?(e.openBlock(),e.createBlock(i.default,{key:1,text:t.tooltip},{default:e.withCtx(()=>[d]),_:1},8,["text"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r(n.$slots.default)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",m,e.toDisplayString(t.placeholder),1)),e.renderSlot(n.$slots,"default")]))}};exports.default=k;
@@ -1,5 +1,5 @@
1
1
  import { useSlots as u, openBlock as l, createElementBlock as n, toDisplayString as o, createCommentVNode as r, Fragment as c, renderList as d, normalizeClass as m, createBlock as h, withCtx as f, renderSlot as y, createElementVNode as p, Comment as g } from "vue";
2
- import b from "../Tooltip/Tooltip.vue2.js";
2
+ import b from "../Tooltip/Tooltip.vue.js";
3
3
  const k = { class: "bg-grey pd-medium radius-medium" }, C = {
4
4
  key: 0,
5
5
  class: "mn-b-small flex-v-center flex-nowrap flex"
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../Loader/Loader.vue2.cjs");require("./Button.vue2.cjs");const v=["disabled"],b={key:2,class:"t-semi loading t-black"},m={key:3,class:"error"},y={key:0,class:"button-counter"},k={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},text:{type:Object,default:t=>(console.log(t),t={...t.text,success:"✔",error:"✖"})},counter:{type:Object},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},showSucces:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!0},validation:{type:Boolean,default:!1}},emits:["error"],setup(t,{emit:r}){const o=t,i=r,l=e.ref(null),a=e.ref(null),s=e.ref(!1),n=e.ref(!1);async function d(){l.value.style["pointer-events"]="none",a.value=null,s.value=!0;const c=()=>{l.value&&(l.value.classList.replace("bg-second","bg-main"),l.value.style.pointerEvents="auto",s.value=!1,n.value=!1,a.value=null)};try{await o.submit(),l.value.classList.replace("bg-main","bg-second"),s.value=!1,o.showSucces?(n.value=!0,setTimeout(c,500)):c(),o.callback&&setTimeout(()=>o.callback(),o.callbackDelay)}catch(u){i("error",u),l.value.classList.replace("bg-main","bg-fourth-nano"),a.value=o.error,setTimeout(()=>{c(),l.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(c,u)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(d,["stop"]),disabled:t.validation,ref_key:"button",ref:l,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!s.value&&!a.value&&!n.value||!t.showLoader?e.renderSlot(c.$slots,"default",{key:0}):s.value&&!a.value&&t.showLoader?(e.openBlock(),e.createBlock(f.default,{key:1,class:"pos-relative pos-t-0 pos-l-0 loading"})):n.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(t.text.success),1)):a.value?(e.openBlock(),e.createElementBlock("span",m,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",y,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,v))}};exports.default=k;
@@ -1 +1,94 @@
1
-
1
+ import { ref as n, openBlock as c, createElementBlock as r, withModifiers as y, createVNode as k, Transition as h, withCtx as p, renderSlot as g, createBlock as B, toDisplayString as i, createCommentVNode as f } from "vue";
2
+ import w from "../Loader/Loader.vue2.js";
3
+ import "./Button.vue2.js";
4
+ const L = ["disabled"], S = {
5
+ key: 2,
6
+ class: "t-semi loading t-black"
7
+ }, T = {
8
+ key: 3,
9
+ class: "error"
10
+ }, x = {
11
+ key: 0,
12
+ class: "button-counter"
13
+ }, j = {
14
+ __name: "Button",
15
+ props: {
16
+ submit: {
17
+ type: Function,
18
+ default: async () => {
19
+ console.log("Button click.");
20
+ }
21
+ },
22
+ text: {
23
+ type: Object,
24
+ default: (e) => (console.log(e), e = {
25
+ ...e.text,
26
+ success: "✔",
27
+ error: "✖"
28
+ })
29
+ },
30
+ counter: {
31
+ type: Object
32
+ },
33
+ callback: {
34
+ type: Function,
35
+ default: async () => {
36
+ console.log("Button callback.");
37
+ }
38
+ },
39
+ callbackDelay: {
40
+ type: Number,
41
+ default: 750
42
+ },
43
+ showSucces: {
44
+ type: Boolean,
45
+ default: !0
46
+ },
47
+ showLoader: {
48
+ type: Boolean,
49
+ default: !0
50
+ },
51
+ validation: {
52
+ type: Boolean,
53
+ default: !1
54
+ }
55
+ },
56
+ emits: ["error"],
57
+ setup(e, { emit: b }) {
58
+ const l = e, v = b, t = n(null), a = n(null), o = n(!1), u = n(!1);
59
+ async function m() {
60
+ t.value.style["pointer-events"] = "none", a.value = null, o.value = !0;
61
+ const s = () => {
62
+ t.value && (t.value.classList.replace("bg-second", "bg-main"), t.value.style.pointerEvents = "auto", o.value = !1, u.value = !1, a.value = null);
63
+ };
64
+ try {
65
+ await l.submit(), t.value.classList.replace("bg-main", "bg-second"), o.value = !1, l.showSucces ? (u.value = !0, setTimeout(s, 500)) : s(), l.callback && setTimeout(() => l.callback(), l.callbackDelay);
66
+ } catch (d) {
67
+ v("error", d), t.value.classList.replace("bg-main", "bg-fourth-nano"), a.value = l.error, setTimeout(() => {
68
+ s(), t.value.classList.replace("bg-fourth-nano", "bg-main");
69
+ }, 1330);
70
+ }
71
+ }
72
+ return (s, d) => (c(), r("button", {
73
+ onClick: y(m, ["stop"]),
74
+ disabled: e.validation,
75
+ ref_key: "button",
76
+ ref: t,
77
+ class: "button"
78
+ }, [
79
+ k(h, { name: "moveFromTopAbsolute" }, {
80
+ default: p(() => [
81
+ !o.value && !a.value && !u.value || !e.showLoader ? g(s.$slots, "default", { key: 0 }) : o.value && !a.value && e.showLoader ? (c(), B(w, {
82
+ key: 1,
83
+ class: "pos-relative pos-t-0 pos-l-0 loading"
84
+ })) : u.value && e.showSucces ? (c(), r("span", S, i(e.text.success), 1)) : a.value ? (c(), r("span", T, i(a.value), 1)) : f("", !0)
85
+ ]),
86
+ _: 3
87
+ }),
88
+ e.counter ? (c(), r("p", x, i(e.counter), 1)) : f("", !0)
89
+ ], 8, L));
90
+ }
91
+ };
92
+ export {
93
+ j as default
94
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../Loader/Loader.vue2.cjs");require("./Button.vue.cjs");const v=["disabled"],b={key:2,class:"t-semi loading t-black"},m={key:3,class:"error"},y={key:0,class:"button-counter"},k={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},text:{type:Object,default:t=>(console.log(t),t={...t.text,success:"✔",error:"✖"})},counter:{type:Object},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},showSucces:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!0},validation:{type:Boolean,default:!1}},emits:["error"],setup(t,{emit:r}){const o=t,i=r,l=e.ref(null),a=e.ref(null),s=e.ref(!1),n=e.ref(!1);async function d(){l.value.style["pointer-events"]="none",a.value=null,s.value=!0;const c=()=>{l.value&&(l.value.classList.replace("bg-second","bg-main"),l.value.style.pointerEvents="auto",s.value=!1,n.value=!1,a.value=null)};try{await o.submit(),l.value.classList.replace("bg-main","bg-second"),s.value=!1,o.showSucces?(n.value=!0,setTimeout(c,500)):c(),o.callback&&setTimeout(()=>o.callback(),o.callbackDelay)}catch(u){i("error",u),l.value.classList.replace("bg-main","bg-fourth-nano"),a.value=o.error,setTimeout(()=>{c(),l.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(c,u)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(d,["stop"]),disabled:t.validation,ref_key:"button",ref:l,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!s.value&&!a.value&&!n.value||!t.showLoader?e.renderSlot(c.$slots,"default",{key:0}):s.value&&!a.value&&t.showLoader?(e.openBlock(),e.createBlock(f.default,{key:1,class:"pos-relative pos-t-0 pos-l-0 loading"})):n.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",b,e.toDisplayString(t.text.success),1)):a.value?(e.openBlock(),e.createElementBlock("span",m,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",y,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,v))}};exports.default=k;
1
+ "use strict";
@@ -1,94 +1 @@
1
- import { ref as n, openBlock as c, createElementBlock as r, withModifiers as y, createVNode as k, Transition as h, withCtx as p, renderSlot as g, createBlock as B, toDisplayString as i, createCommentVNode as f } from "vue";
2
- import w from "../Loader/Loader.vue2.js";
3
- import "./Button.vue.js";
4
- const L = ["disabled"], S = {
5
- key: 2,
6
- class: "t-semi loading t-black"
7
- }, T = {
8
- key: 3,
9
- class: "error"
10
- }, x = {
11
- key: 0,
12
- class: "button-counter"
13
- }, j = {
14
- __name: "Button",
15
- props: {
16
- submit: {
17
- type: Function,
18
- default: async () => {
19
- console.log("Button click.");
20
- }
21
- },
22
- text: {
23
- type: Object,
24
- default: (e) => (console.log(e), e = {
25
- ...e.text,
26
- success: "✔",
27
- error: "✖"
28
- })
29
- },
30
- counter: {
31
- type: Object
32
- },
33
- callback: {
34
- type: Function,
35
- default: async () => {
36
- console.log("Button callback.");
37
- }
38
- },
39
- callbackDelay: {
40
- type: Number,
41
- default: 750
42
- },
43
- showSucces: {
44
- type: Boolean,
45
- default: !0
46
- },
47
- showLoader: {
48
- type: Boolean,
49
- default: !0
50
- },
51
- validation: {
52
- type: Boolean,
53
- default: !1
54
- }
55
- },
56
- emits: ["error"],
57
- setup(e, { emit: b }) {
58
- const l = e, v = b, t = n(null), a = n(null), o = n(!1), u = n(!1);
59
- async function m() {
60
- t.value.style["pointer-events"] = "none", a.value = null, o.value = !0;
61
- const s = () => {
62
- t.value && (t.value.classList.replace("bg-second", "bg-main"), t.value.style.pointerEvents = "auto", o.value = !1, u.value = !1, a.value = null);
63
- };
64
- try {
65
- await l.submit(), t.value.classList.replace("bg-main", "bg-second"), o.value = !1, l.showSucces ? (u.value = !0, setTimeout(s, 500)) : s(), l.callback && setTimeout(() => l.callback(), l.callbackDelay);
66
- } catch (d) {
67
- v("error", d), t.value.classList.replace("bg-main", "bg-fourth-nano"), a.value = l.error, setTimeout(() => {
68
- s(), t.value.classList.replace("bg-fourth-nano", "bg-main");
69
- }, 1330);
70
- }
71
- }
72
- return (s, d) => (c(), r("button", {
73
- onClick: y(m, ["stop"]),
74
- disabled: e.validation,
75
- ref_key: "button",
76
- ref: t,
77
- class: "button"
78
- }, [
79
- k(h, { name: "moveFromTopAbsolute" }, {
80
- default: p(() => [
81
- !o.value && !a.value && !u.value || !e.showLoader ? g(s.$slots, "default", { key: 0 }) : o.value && !a.value && e.showLoader ? (c(), B(w, {
82
- key: 1,
83
- class: "pos-relative pos-t-0 pos-l-0 loading"
84
- })) : u.value && e.showSucces ? (c(), r("span", S, i(e.text.success), 1)) : a.value ? (c(), r("span", T, i(a.value), 1)) : f("", !0)
85
- ]),
86
- _: 3
87
- }),
88
- e.counter ? (c(), r("p", x, i(e.counter), 1)) : f("", !0)
89
- ], 8, L));
90
- }
91
- };
92
- export {
93
- j as default
94
- };
1
+
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Field.vue2.cjs");const u=require("../../../../_virtual/_plugin-vue_export-helper.cjs"),r={key:0,class:"t-transp mn-r-small"},c={class:"w-100"},m=["type","value","placeholder","tabindex","disabled"],b=["value","placeholder","tabindex","disabled"],f={key:1,class:"t-transp mn-l-small"},v={key:0,class:"mn-t-thin mn-b-thin mn-b-thin invalid-feedback"},k={__name:"Field",props:{label:null,symbol:null,type:"text",placeholder:"Enter something here",field:null,value:null,validation:!1,disabled:null,tabindex:-1},emits:["update:field","focus","blur"],setup(l,{emit:s}){const a=s,d=l;d.value&&a("update:field",d.value);const i=e.ref(d.field);return(o,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass([[o.$attrs.class,{"bg-fourth-nano":l.validation}],"flex-center flex-nowrap flex"])},[l.label?(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("span",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",c,[l.type!=="textarea"?(e.openBlock(),e.createElementBlock("input",{key:0,onInput:t[0]||(t[0]=n=>i.value=a("update:field",n.target.value)),onFocus:t[1]||(t[1]=n=>a("focus",n)),onBlur:t[2]||(t[2]=n=>a("blur",n)),type:l.type,class:"w-100",value:l.field,placeholder:l.placeholder,tabindex:l.tabindex,disabled:l.disabled},null,40,m)):(e.openBlock(),e.createElementBlock("textarea",{key:1,onInput:t[3]||(t[3]=n=>i.value=a("update:field",n.target.value)),onFocus:t[4]||(t[4]=n=>a("focus",n)),onBlur:t[5]||(t[5]=n=>a("blur",n)),class:"w-100",style:{resize:"vertical"},value:l.field,placeholder:l.placeholder,tabindex:l.tabindex,disabled:l.disabled},null,40,b))]),e.renderSlot(o.$slots,"default",{},void 0,!0),l.symbol?(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("span",null,e.toDisplayString(l.symbol),1)])):e.createCommentVNode("",!0)],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.validation?(e.openBlock(),e.createElementBlock("div",v," * "+e.toDisplayString(l.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64))}},y=u.default(k,[["__scopeId","data-v-47c78b3c"]]);exports.default=y;