@ozdao/prometheus-framework 0.2.51 → 0.2.52

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. package/dist/main-482dc398.mjs +13626 -0
  2. package/dist/main-b2JI9sFg.js +91 -0
  3. package/dist/main-c56d4c09.js +91 -0
  4. package/dist/main-x-9D8zvb.mjs +13604 -0
  5. package/dist/main.css +1 -1
  6. package/dist/organizations.server.js +2 -2
  7. package/dist/organizations.server.mjs +2 -2
  8. package/dist/products.server.js +20 -7
  9. package/dist/products.server.mjs +20 -7
  10. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  11. package/dist/prometheus-framework/src/components/Button/Button.vue.js +223 -2
  12. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  13. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +2 -225
  14. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  15. package/dist/prometheus-framework/src/components/Feed/Feed.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 +76 -2
  18. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +2 -76
  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/LocationMarker/LocationMarker.vue2.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +2 -2
  24. package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Map/Map.vue.js +35 -2
  26. package/dist/prometheus-framework/src/components/Map/Map.vue2.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Map/Map.vue2.js +2 -35
  28. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +44 -2
  30. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +2 -44
  32. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  42. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  44. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  46. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  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 +2 -2
  50. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  52. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  56. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  60. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  62. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -0
  63. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +37 -0
  64. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  66. package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.js +21 -14
  68. package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.cjs +1 -0
  69. package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.js +24 -0
  70. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +2 -11
  74. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +11 -2
  76. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
  78. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  80. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +1 -1
  82. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +49 -101
  84. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +25 -25
  85. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +68 -39
  87. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +38 -48
  89. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +69 -62
  93. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +134 -129
  95. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  97. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +117 -146
  99. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  101. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  105. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +13 -13
  107. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  109. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  111. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  117. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +44 -44
  119. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  123. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +64 -51
  125. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  131. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +22 -23
  133. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  135. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/products/store/products.js +23 -23
  137. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  139. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  141. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  143. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  145. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  147. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  149. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +1 -1
  151. package/dist/prometheus-framework.cjs.js +1 -1
  152. package/dist/prometheus-framework.es.js +1 -1
  153. package/dist/style.css +1 -1
  154. package/dist/web-6dcbb74b.mjs +55 -0
  155. package/dist/web-caJAdsxy.js +1 -0
  156. package/dist/web-ee302c1d.js +1 -0
  157. package/dist/web-i08OVMw9.mjs +55 -0
  158. package/package.json +1 -1
  159. package/src/components/Button/Button.vue +3 -3
  160. package/src/components/Feed/Feed.vue +2 -1
  161. package/src/components/LocationMarker/LocationMarker.vue +1 -0
  162. package/src/modules/applications/applications.client.js +0 -1
  163. package/src/modules/globals/components/blocks/BlockSearch.vue +42 -0
  164. package/src/modules/icons/entities/IconProfile.vue +10 -1
  165. package/src/modules/icons/entities/IconShopcart.vue +12 -2
  166. package/src/modules/marketplace/components/layouts/Marketplace.vue +7 -14
  167. package/src/modules/mobile/components/NavigationBar/NavigationBar.vue +27 -7
  168. package/src/modules/orders/components/partials/ShopCart.vue +4 -1
  169. package/src/modules/organizations/components/blocks/CardDepartment.vue +34 -66
  170. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +50 -13
  171. package/src/modules/organizations/components/blocks/User.vue +18 -9
  172. package/src/modules/organizations/components/pages/Department.vue +19 -3
  173. package/src/modules/organizations/components/pages/DepartmentEdit.vue +14 -10
  174. package/src/modules/organizations/components/pages/Organization.vue +38 -71
  175. package/src/modules/organizations/components/sections/Feed.vue +1 -1
  176. package/src/modules/organizations/controllers/memberships.controller.js +2 -2
  177. package/src/modules/organizations/controllers/organizations.controller.js +0 -1
  178. package/src/modules/products/components/pages/EditLeftover.vue +6 -4
  179. package/src/modules/products/components/pages/Products.vue +58 -38
  180. package/src/modules/products/components/sections/FilterProducts.vue +5 -5
  181. package/src/modules/products/controllers/leftovers.controller.js +12 -5
  182. package/src/modules/products/controllers/products.controller.js +18 -0
  183. package/src/modules/products/store/products.js +4 -0
@@ -433,9 +433,9 @@ const controllerFactory$3 = (db) => {
433
433
  const memberships = await Membership.aggregate([
434
434
  {
435
435
  $match: {
436
- ...req.query.user && { user: req.query.user },
436
+ ...req.query.user && { user: new ObjectId$1(req.query.user) },
437
437
  ...req.query.type && { type: req.query.type },
438
- ...req.query.target && { target: req.query.target },
438
+ ...req.query.target && { target: new ObjectId$1(req.query.target) },
439
439
  ...req.query.role && { role: req.query.role }
440
440
  }
441
441
  },
@@ -432,9 +432,9 @@ const controllerFactory$3 = (db) => {
432
432
  const memberships = await Membership.aggregate([
433
433
  {
434
434
  $match: {
435
- ...req.query.user && { user: req.query.user },
435
+ ...req.query.user && { user: new ObjectId$1(req.query.user) },
436
436
  ...req.query.type && { type: req.query.type },
437
- ...req.query.target && { target: req.query.target },
437
+ ...req.query.target && { target: new ObjectId$1(req.query.target) },
438
438
  ...req.query.role && { role: req.query.role }
439
439
  }
440
440
  },
@@ -225,7 +225,7 @@ var leftover_model = (mongoose) => {
225
225
  return Leftover;
226
226
  };
227
227
  const leftover_model$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(leftover_model);
228
- const ObjectId$1 = require$$0.Types.ObjectId;
228
+ const ObjectId = require$$0.Types.ObjectId;
229
229
  const OpenAI = require$$3;
230
230
  console.log(process.env.OPENAI_API_KEY);
231
231
  const openai = new OpenAI({
@@ -250,7 +250,7 @@ const controllerFactory$5 = (db) => {
250
250
  let query = {};
251
251
  let options = {};
252
252
  if (req.query.organization) {
253
- query.organization = new ObjectId$1(req.query.organization);
253
+ query.organization = new ObjectId(req.query.organization);
254
254
  }
255
255
  if (req.query._id) {
256
256
  query._id = req.query._id;
@@ -266,6 +266,17 @@ const controllerFactory$5 = (db) => {
266
266
  if (deliveryOptions.length) {
267
267
  query.delivery = { $in: deliveryOptions };
268
268
  }
269
+ const search = req.query.search;
270
+ if (search) {
271
+ const parts = search.split(".");
272
+ let regexPattern = "";
273
+ if (parts.length === 2) {
274
+ regexPattern = parts.map((part) => part.substr(0, part.length - 1) + ".{1}").join("\\.");
275
+ } else {
276
+ regexPattern = search.substr(0, search.length - 1) + ".{1}";
277
+ }
278
+ query.name = { $regex: regexPattern, $options: "i" };
279
+ }
269
280
  const prices = req.query.prices?.split(",") || [];
270
281
  console.log(prices);
271
282
  if (prices.length) {
@@ -535,7 +546,7 @@ const controllerFactory$5 = (db) => {
535
546
  try {
536
547
  const product = await Product.aggregate([
537
548
  {
538
- $match: { "_id": new ObjectId$1(req.params._id) }
549
+ $match: { "_id": new ObjectId(req.params._id) }
539
550
  },
540
551
  {
541
552
  $lookup: {
@@ -843,21 +854,23 @@ var categories_routes = function(app, db) {
843
854
  );
844
855
  };
845
856
  const categories_routes$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(categories_routes);
846
- const ObjectId = require$$0.Types.ObjectId;
847
857
  const controllerFactory$1 = (db) => {
848
858
  const Leftover = db.leftover;
849
859
  const getAll = async (req, res) => {
850
860
  try {
851
861
  let query = {};
852
862
  let options = {};
853
- if (req.query.organization)
854
- query.organization = new ObjectId(req.query.organization);
855
- const leftoveres = await Leftover.find(query, null, options).sort({ "createdAt": "desc" }).exec();
863
+ if (req.query.organization) {
864
+ query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
865
+ }
866
+ console.log(query);
867
+ const leftoveres = await Leftover.find(query, null, options).sort({ createdAt: "desc" }).exec();
856
868
  if (!leftoveres) {
857
869
  return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
858
870
  }
859
871
  res.status(200).send(leftoveres);
860
872
  } catch (err) {
873
+ console.error(err);
861
874
  res.status(500).send({ message: "ERROR_GET_ALL_LEFTOVERES" });
862
875
  }
863
876
  };
@@ -223,7 +223,7 @@ var leftover_model = (mongoose) => {
223
223
  return Leftover;
224
224
  };
225
225
  const leftover_model$1 = /* @__PURE__ */ getDefaultExportFromCjs(leftover_model);
226
- const ObjectId$1 = require$$0.Types.ObjectId;
226
+ const ObjectId = require$$0.Types.ObjectId;
227
227
  const OpenAI = require$$3;
228
228
  console.log(process.env.OPENAI_API_KEY);
229
229
  const openai = new OpenAI({
@@ -248,7 +248,7 @@ const controllerFactory$5 = (db) => {
248
248
  let query = {};
249
249
  let options = {};
250
250
  if (req.query.organization) {
251
- query.organization = new ObjectId$1(req.query.organization);
251
+ query.organization = new ObjectId(req.query.organization);
252
252
  }
253
253
  if (req.query._id) {
254
254
  query._id = req.query._id;
@@ -264,6 +264,17 @@ const controllerFactory$5 = (db) => {
264
264
  if (deliveryOptions.length) {
265
265
  query.delivery = { $in: deliveryOptions };
266
266
  }
267
+ const search = req.query.search;
268
+ if (search) {
269
+ const parts = search.split(".");
270
+ let regexPattern = "";
271
+ if (parts.length === 2) {
272
+ regexPattern = parts.map((part) => part.substr(0, part.length - 1) + ".{1}").join("\\.");
273
+ } else {
274
+ regexPattern = search.substr(0, search.length - 1) + ".{1}";
275
+ }
276
+ query.name = { $regex: regexPattern, $options: "i" };
277
+ }
267
278
  const prices = req.query.prices?.split(",") || [];
268
279
  console.log(prices);
269
280
  if (prices.length) {
@@ -533,7 +544,7 @@ const controllerFactory$5 = (db) => {
533
544
  try {
534
545
  const product = await Product.aggregate([
535
546
  {
536
- $match: { "_id": new ObjectId$1(req.params._id) }
547
+ $match: { "_id": new ObjectId(req.params._id) }
537
548
  },
538
549
  {
539
550
  $lookup: {
@@ -841,21 +852,23 @@ var categories_routes = function(app, db) {
841
852
  );
842
853
  };
843
854
  const categories_routes$1 = /* @__PURE__ */ getDefaultExportFromCjs(categories_routes);
844
- const ObjectId = require$$0.Types.ObjectId;
845
855
  const controllerFactory$1 = (db) => {
846
856
  const Leftover = db.leftover;
847
857
  const getAll = async (req, res) => {
848
858
  try {
849
859
  let query = {};
850
860
  let options = {};
851
- if (req.query.organization)
852
- query.organization = new ObjectId(req.query.organization);
853
- const leftoveres = await Leftover.find(query, null, options).sort({ "createdAt": "desc" }).exec();
861
+ if (req.query.organization) {
862
+ query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
863
+ }
864
+ console.log(query);
865
+ const leftoveres = await Leftover.find(query, null, options).sort({ createdAt: "desc" }).exec();
854
866
  if (!leftoveres) {
855
867
  return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
856
868
  }
857
869
  res.status(200).send(leftoveres);
858
870
  } catch (err) {
871
+ console.error(err);
859
872
  res.status(500).send({ message: "ERROR_GET_ALL_LEFTOVERES" });
860
873
  }
861
874
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Button.vue2.cjs");const u=["disabled"],d={key:1,class:"loading"},m=e.createElementVNode("svg",{class:"i-regular",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])],-1),b=[m],h={key:2,class:"t-semi loading t-black"},f={key:3,class:"error"},g={key:0,class:"button-counter"},v={__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}},setup(t){const n=t,a=e.ref(null),l=e.ref(null),o=e.ref(!1),r=e.ref(!1);async function c(){a.value.style["pointer-events"]="none",l.value=null,o.value=!0;const i=()=>{a.value&&(a.value.classList.replace("bg-second","bg-main"),a.value.style.pointerEvents="auto",o.value=!1,r.value=!1,l.value=null)};try{await n.submit(),a.value.classList.replace("bg-main","bg-second"),o.value=!1,n.showSucces?(r.value=!0,setTimeout(i,500)):i(),n.callback&&setTimeout(()=>n.callback(),n.callbackDelay)}catch{a.value.classList.replace("bg-main","bg-fourth-nano"),l.value=n.error,setTimeout(()=>{i(),a.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(i,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(c,["stop"]),disabled:t.validation,ref_key:"button",ref:a,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!o.value&&!l.value&&!r.value||!t.showLoader?e.renderSlot(i.$slots,"default",{key:0}):o.value&&!l.value&&t.showLoader?(e.openBlock(),e.createElementBlock("span",d,b)):r.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",h,e.toDisplayString(t.text.success),1)):l.value?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,u))}};exports.default=v;
@@ -1,4 +1,225 @@
1
- const e = "";
1
+ import { ref as d, openBlock as u, createElementBlock as o, withModifiers as v, createVNode as g, Transition as y, withCtx as p, renderSlot as w, toDisplayString as b, createCommentVNode as h, createElementVNode as e, createTextVNode as r } from "vue";
2
+ import "./Button.vue2.js";
3
+ const k = ["disabled"], x = {
4
+ key: 1,
5
+ class: "loading"
6
+ }, N = /* @__PURE__ */ e("svg", {
7
+ class: "i-regular",
8
+ width: "135",
9
+ height: "140",
10
+ viewBox: "0 0 135 140",
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ fill: "#fff"
13
+ }, [
14
+ /* @__PURE__ */ e("rect", {
15
+ y: "10",
16
+ width: "15",
17
+ height: "120",
18
+ rx: "6"
19
+ }, [
20
+ /* @__PURE__ */ e("animate", {
21
+ attributeName: "height",
22
+ begin: "0.5s",
23
+ dur: "1s",
24
+ values: "120;110;100;90;80;70;60;50;40;140;120",
25
+ calcMode: "linear",
26
+ repeatCount: "indefinite"
27
+ }),
28
+ /* @__PURE__ */ r(),
29
+ /* @__PURE__ */ e("animate", {
30
+ attributeName: "y",
31
+ begin: "0.5s",
32
+ dur: "1s",
33
+ values: "10;15;20;25;30;35;40;45;50;0;10",
34
+ calcMode: "linear",
35
+ repeatCount: "indefinite"
36
+ })
37
+ ]),
38
+ /* @__PURE__ */ e("rect", {
39
+ x: "30",
40
+ y: "10",
41
+ width: "15",
42
+ height: "120",
43
+ rx: "6"
44
+ }, [
45
+ /* @__PURE__ */ e("animate", {
46
+ attributeName: "height",
47
+ begin: "0.25s",
48
+ dur: "1s",
49
+ values: "120;110;100;90;80;70;60;50;40;140;120",
50
+ calcMode: "linear",
51
+ repeatCount: "indefinite"
52
+ }),
53
+ /* @__PURE__ */ r(),
54
+ /* @__PURE__ */ e("animate", {
55
+ attributeName: "y",
56
+ begin: "0.25s",
57
+ dur: "1s",
58
+ values: "10;15;20;25;30;35;40;45;50;0;10",
59
+ calcMode: "linear",
60
+ repeatCount: "indefinite"
61
+ })
62
+ ]),
63
+ /* @__PURE__ */ e("rect", {
64
+ x: "60",
65
+ width: "15",
66
+ height: "140",
67
+ rx: "6"
68
+ }, [
69
+ /* @__PURE__ */ e("animate", {
70
+ attributeName: "height",
71
+ begin: "0s",
72
+ dur: "1s",
73
+ values: "120;110;100;90;80;70;60;50;40;140;120",
74
+ calcMode: "linear",
75
+ repeatCount: "indefinite"
76
+ }),
77
+ /* @__PURE__ */ r(),
78
+ /* @__PURE__ */ e("animate", {
79
+ attributeName: "y",
80
+ begin: "0s",
81
+ dur: "1s",
82
+ values: "10;15;20;25;30;35;40;45;50;0;10",
83
+ calcMode: "linear",
84
+ repeatCount: "indefinite"
85
+ })
86
+ ]),
87
+ /* @__PURE__ */ e("rect", {
88
+ x: "90",
89
+ y: "10",
90
+ width: "15",
91
+ height: "120",
92
+ rx: "6"
93
+ }, [
94
+ /* @__PURE__ */ e("animate", {
95
+ attributeName: "height",
96
+ begin: "0.25s",
97
+ dur: "1s",
98
+ values: "120;110;100;90;80;70;60;50;40;140;120",
99
+ calcMode: "linear",
100
+ repeatCount: "indefinite"
101
+ }),
102
+ /* @__PURE__ */ r(),
103
+ /* @__PURE__ */ e("animate", {
104
+ attributeName: "y",
105
+ begin: "0.25s",
106
+ dur: "1s",
107
+ values: "10;15;20;25;30;35;40;45;50;0;10",
108
+ calcMode: "linear",
109
+ repeatCount: "indefinite"
110
+ })
111
+ ]),
112
+ /* @__PURE__ */ e("rect", {
113
+ x: "120",
114
+ y: "10",
115
+ width: "15",
116
+ height: "120",
117
+ rx: "6"
118
+ }, [
119
+ /* @__PURE__ */ e("animate", {
120
+ attributeName: "height",
121
+ begin: "0.5s",
122
+ dur: "1s",
123
+ values: "120;110;100;90;80;70;60;50;40;140;120",
124
+ calcMode: "linear",
125
+ repeatCount: "indefinite"
126
+ }),
127
+ /* @__PURE__ */ r(),
128
+ /* @__PURE__ */ e("animate", {
129
+ attributeName: "y",
130
+ begin: "0.5s",
131
+ dur: "1s",
132
+ values: "10;15;20;25;30;35;40;45;50;0;10",
133
+ calcMode: "linear",
134
+ repeatCount: "indefinite"
135
+ })
136
+ ])
137
+ ], -1), C = [
138
+ N
139
+ ], M = {
140
+ key: 2,
141
+ class: "t-semi loading t-black"
142
+ }, B = {
143
+ key: 3,
144
+ class: "error"
145
+ }, L = {
146
+ key: 0,
147
+ class: "button-counter"
148
+ }, T = {
149
+ __name: "Button",
150
+ props: {
151
+ submit: {
152
+ type: Function,
153
+ default: async () => {
154
+ console.log("Button click.");
155
+ }
156
+ },
157
+ text: {
158
+ type: Object,
159
+ default: (t) => (console.log(t), t = {
160
+ ...t.text,
161
+ success: "✔",
162
+ error: "✖"
163
+ })
164
+ },
165
+ counter: {
166
+ type: Object
167
+ },
168
+ callback: {
169
+ type: Function,
170
+ default: async () => {
171
+ console.log("Button callback.");
172
+ }
173
+ },
174
+ callbackDelay: {
175
+ type: Number,
176
+ default: 750
177
+ },
178
+ showSucces: {
179
+ type: Boolean,
180
+ default: !0
181
+ },
182
+ showLoader: {
183
+ type: Boolean,
184
+ default: !0
185
+ },
186
+ validation: {
187
+ type: Boolean,
188
+ default: !1
189
+ }
190
+ },
191
+ setup(t) {
192
+ const n = t, a = d(null), i = d(null), l = d(!1), c = d(!1);
193
+ async function f() {
194
+ a.value.style["pointer-events"] = "none", i.value = null, l.value = !0;
195
+ const s = () => {
196
+ a.value && (a.value.classList.replace("bg-second", "bg-main"), a.value.style.pointerEvents = "auto", l.value = !1, c.value = !1, i.value = null);
197
+ };
198
+ try {
199
+ await n.submit(), a.value.classList.replace("bg-main", "bg-second"), l.value = !1, n.showSucces ? (c.value = !0, setTimeout(s, 500)) : s(), n.callback && setTimeout(() => n.callback(), n.callbackDelay);
200
+ } catch {
201
+ a.value.classList.replace("bg-main", "bg-fourth-nano"), i.value = n.error, setTimeout(() => {
202
+ s(), a.value.classList.replace("bg-fourth-nano", "bg-main");
203
+ }, 1330);
204
+ }
205
+ }
206
+ return (s, m) => (u(), o("button", {
207
+ onClick: v(f, ["stop"]),
208
+ disabled: t.validation,
209
+ ref_key: "button",
210
+ ref: a,
211
+ class: "button"
212
+ }, [
213
+ g(y, { name: "moveFromTopAbsolute" }, {
214
+ default: p(() => [
215
+ !l.value && !i.value && !c.value || !t.showLoader ? w(s.$slots, "default", { key: 0 }) : l.value && !i.value && t.showLoader ? (u(), o("span", x, C)) : c.value && t.showSucces ? (u(), o("span", M, b(t.text.success), 1)) : i.value ? (u(), o("span", B, b(i.value), 1)) : h("", !0)
216
+ ]),
217
+ _: 3
218
+ }),
219
+ t.counter ? (u(), o("p", L, b(t.counter), 1)) : h("", !0)
220
+ ], 8, k));
221
+ }
222
+ };
2
223
  export {
3
- e as default
224
+ T as default
4
225
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Button.vue.cjs");const u=["disabled"],d={key:0},m={key:1,class:"loading"},b=e.createElementVNode("svg",{class:"i-regular",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])],-1),h=[b],f={key:2,class:"t-semi loading t-black"},g={key:3,class:"error"},v={key:0,class:"button-counter"},y={__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}},setup(t){const n=t,a=e.ref(null),l=e.ref(null),o=e.ref(!1),c=e.ref(!1);async function r(){a.value.style["pointer-events"]="none",l.value=null,o.value=!0;const i=()=>{a.value&&(a.value.classList.replace("bg-second","bg-main"),a.value.style.pointerEvents="auto",o.value=!1,c.value=!1,l.value=null)};try{await n.submit(),a.value.classList.replace("bg-main","bg-second"),o.value=!1,n.showSucces?(c.value=!0,setTimeout(i,500)):i(),n.callback&&setTimeout(()=>n.callback(),n.callbackDelay)}catch{a.value.classList.replace("bg-main","bg-fourth-nano"),l.value=n.error,setTimeout(()=>{i(),a.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(i,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(r,["stop"]),disabled:t.validation,ref_key:"button",ref:a,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!o.value&&!l.value&&!c.value||!t.showLoader?(e.openBlock(),e.createElementBlock("span",d,[e.renderSlot(i.$slots,"default")])):o.value&&!l.value&&t.showLoader?(e.openBlock(),e.createElementBlock("span",m,h)):c.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(t.text.success),1)):l.value?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",v,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,u))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
@@ -1,227 +1,4 @@
1
- import { ref as d, openBlock as l, createElementBlock as s, withModifiers as v, createVNode as g, Transition as y, withCtx as p, renderSlot as w, toDisplayString as h, createCommentVNode as b, createElementVNode as e, createTextVNode as r } from "vue";
2
- import "./Button.vue.js";
3
- const k = ["disabled"], x = { key: 0 }, N = {
4
- key: 1,
5
- class: "loading"
6
- }, C = /* @__PURE__ */ e("svg", {
7
- class: "i-regular",
8
- width: "135",
9
- height: "140",
10
- viewBox: "0 0 135 140",
11
- xmlns: "http://www.w3.org/2000/svg",
12
- fill: "#fff"
13
- }, [
14
- /* @__PURE__ */ e("rect", {
15
- y: "10",
16
- width: "15",
17
- height: "120",
18
- rx: "6"
19
- }, [
20
- /* @__PURE__ */ e("animate", {
21
- attributeName: "height",
22
- begin: "0.5s",
23
- dur: "1s",
24
- values: "120;110;100;90;80;70;60;50;40;140;120",
25
- calcMode: "linear",
26
- repeatCount: "indefinite"
27
- }),
28
- /* @__PURE__ */ r(),
29
- /* @__PURE__ */ e("animate", {
30
- attributeName: "y",
31
- begin: "0.5s",
32
- dur: "1s",
33
- values: "10;15;20;25;30;35;40;45;50;0;10",
34
- calcMode: "linear",
35
- repeatCount: "indefinite"
36
- })
37
- ]),
38
- /* @__PURE__ */ e("rect", {
39
- x: "30",
40
- y: "10",
41
- width: "15",
42
- height: "120",
43
- rx: "6"
44
- }, [
45
- /* @__PURE__ */ e("animate", {
46
- attributeName: "height",
47
- begin: "0.25s",
48
- dur: "1s",
49
- values: "120;110;100;90;80;70;60;50;40;140;120",
50
- calcMode: "linear",
51
- repeatCount: "indefinite"
52
- }),
53
- /* @__PURE__ */ r(),
54
- /* @__PURE__ */ e("animate", {
55
- attributeName: "y",
56
- begin: "0.25s",
57
- dur: "1s",
58
- values: "10;15;20;25;30;35;40;45;50;0;10",
59
- calcMode: "linear",
60
- repeatCount: "indefinite"
61
- })
62
- ]),
63
- /* @__PURE__ */ e("rect", {
64
- x: "60",
65
- width: "15",
66
- height: "140",
67
- rx: "6"
68
- }, [
69
- /* @__PURE__ */ e("animate", {
70
- attributeName: "height",
71
- begin: "0s",
72
- dur: "1s",
73
- values: "120;110;100;90;80;70;60;50;40;140;120",
74
- calcMode: "linear",
75
- repeatCount: "indefinite"
76
- }),
77
- /* @__PURE__ */ r(),
78
- /* @__PURE__ */ e("animate", {
79
- attributeName: "y",
80
- begin: "0s",
81
- dur: "1s",
82
- values: "10;15;20;25;30;35;40;45;50;0;10",
83
- calcMode: "linear",
84
- repeatCount: "indefinite"
85
- })
86
- ]),
87
- /* @__PURE__ */ e("rect", {
88
- x: "90",
89
- y: "10",
90
- width: "15",
91
- height: "120",
92
- rx: "6"
93
- }, [
94
- /* @__PURE__ */ e("animate", {
95
- attributeName: "height",
96
- begin: "0.25s",
97
- dur: "1s",
98
- values: "120;110;100;90;80;70;60;50;40;140;120",
99
- calcMode: "linear",
100
- repeatCount: "indefinite"
101
- }),
102
- /* @__PURE__ */ r(),
103
- /* @__PURE__ */ e("animate", {
104
- attributeName: "y",
105
- begin: "0.25s",
106
- dur: "1s",
107
- values: "10;15;20;25;30;35;40;45;50;0;10",
108
- calcMode: "linear",
109
- repeatCount: "indefinite"
110
- })
111
- ]),
112
- /* @__PURE__ */ e("rect", {
113
- x: "120",
114
- y: "10",
115
- width: "15",
116
- height: "120",
117
- rx: "6"
118
- }, [
119
- /* @__PURE__ */ e("animate", {
120
- attributeName: "height",
121
- begin: "0.5s",
122
- dur: "1s",
123
- values: "120;110;100;90;80;70;60;50;40;140;120",
124
- calcMode: "linear",
125
- repeatCount: "indefinite"
126
- }),
127
- /* @__PURE__ */ r(),
128
- /* @__PURE__ */ e("animate", {
129
- attributeName: "y",
130
- begin: "0.5s",
131
- dur: "1s",
132
- values: "10;15;20;25;30;35;40;45;50;0;10",
133
- calcMode: "linear",
134
- repeatCount: "indefinite"
135
- })
136
- ])
137
- ], -1), M = [
138
- C
139
- ], B = {
140
- key: 2,
141
- class: "t-semi loading t-black"
142
- }, _ = {
143
- key: 3,
144
- class: "error"
145
- }, L = {
146
- key: 0,
147
- class: "button-counter"
148
- }, V = {
149
- __name: "Button",
150
- props: {
151
- submit: {
152
- type: Function,
153
- default: async () => {
154
- console.log("Button click.");
155
- }
156
- },
157
- text: {
158
- type: Object,
159
- default: (t) => (console.log(t), t = {
160
- ...t.text,
161
- success: "✔",
162
- error: "✖"
163
- })
164
- },
165
- counter: {
166
- type: Object
167
- },
168
- callback: {
169
- type: Function,
170
- default: async () => {
171
- console.log("Button callback.");
172
- }
173
- },
174
- callbackDelay: {
175
- type: Number,
176
- default: 750
177
- },
178
- showSucces: {
179
- type: Boolean,
180
- default: !0
181
- },
182
- showLoader: {
183
- type: Boolean,
184
- default: !0
185
- },
186
- validation: {
187
- type: Boolean,
188
- default: !1
189
- }
190
- },
191
- setup(t) {
192
- const n = t, a = d(null), i = d(null), o = d(!1), c = d(!1);
193
- async function f() {
194
- a.value.style["pointer-events"] = "none", i.value = null, o.value = !0;
195
- const u = () => {
196
- a.value && (a.value.classList.replace("bg-second", "bg-main"), a.value.style.pointerEvents = "auto", o.value = !1, c.value = !1, i.value = null);
197
- };
198
- try {
199
- await n.submit(), a.value.classList.replace("bg-main", "bg-second"), o.value = !1, n.showSucces ? (c.value = !0, setTimeout(u, 500)) : u(), n.callback && setTimeout(() => n.callback(), n.callbackDelay);
200
- } catch {
201
- a.value.classList.replace("bg-main", "bg-fourth-nano"), i.value = n.error, setTimeout(() => {
202
- u(), a.value.classList.replace("bg-fourth-nano", "bg-main");
203
- }, 1330);
204
- }
205
- }
206
- return (u, m) => (l(), s("button", {
207
- onClick: v(f, ["stop"]),
208
- disabled: t.validation,
209
- ref_key: "button",
210
- ref: a,
211
- class: "button"
212
- }, [
213
- g(y, { name: "moveFromTopAbsolute" }, {
214
- default: p(() => [
215
- !o.value && !i.value && !c.value || !t.showLoader ? (l(), s("span", x, [
216
- w(u.$slots, "default")
217
- ])) : o.value && !i.value && t.showLoader ? (l(), s("span", N, M)) : c.value && t.showSucces ? (l(), s("span", B, h(t.text.success), 1)) : i.value ? (l(), s("span", _, h(i.value), 1)) : b("", !0)
218
- ]),
219
- _: 3
220
- }),
221
- t.counter ? (l(), s("p", L, h(t.counter), 1)) : b("", !0)
222
- ], 8, k));
223
- }
224
- };
1
+ const e = "";
225
2
  export {
226
- V as default
3
+ e as default
227
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../../modules/icons/skeletons/SkeletonEvent.vue.cjs");require("../Loader/Loader.vue.cjs");const f=require("../EmptyState/EmptyState.vue.cjs");require("vue-i18n");const v={__name:"Feed",props:{showLoadMore:{type:Boolean,default:!0},states:{type:Object,default:()=>({empty:{title:String,description:String}})},store:{type:Object,default:()=>({read:Function,state:Object})},options:{type:Object,default:()=>({category:null,limit:20,skip:0,owner:null,creator:null,user:null,status:null,period:null,contain:null})}},setup(i){const a=i,o=e.ref([]),l=e.ref(!1);let r=e.ref(!0),u=e.ref(a.options.skip?a.options.skip:0),n=e.ref(a.options.limit?a.options.limit:10);const d=async()=>{if(l.value){u.value+=n.value;const t=await a.store.read({skip:u.value,limit:n.value,...a.options});t.length===0||t.length<n.value?l.value=!1:l.value=!0,o.value=[...o.value,...t]}},c=async()=>{const t=await a.store.read({skip:u.value,limit:n.value,...a.options});t.length===0||t.length<n.value?l.value=!1:l.value=!0,console.log(t),o.value=t,r.value=!1};return e.watch(()=>a.options,(t,s)=>{(t.organization!==s.organization||t.categories!==s.categories||t.prices!==s.prices||t.delivery!==s.delivery)&&c()},{deep:!0}),e.onMounted(async()=>{await c()}),(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(r)?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:0,tag:"ul",name:"scaleTransition",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(n),m=>(e.openBlock(),e.createBlock(p.default,{key:m}))),128)):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[!e.unref(r)&&o.value.length<1?(e.openBlock(),e.createBlock(f.default,{key:0,title:i.states.empty.title,description:i.states.empty.description,class:"pd-medium mn-b-thin bg-grey radius-big"},null,8,["title","description"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"scaleTransition",class:e.normalizeClass(t.$attrs.class)},{default:e.withCtx(()=>[!e.unref(r)&&o.value.length>0?e.renderSlot(t.$slots,"default",{key:0,items:o.value,user:t.user}):e.createCommentVNode("",!0),i.showLoadMore&&l.value&&o.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:d,class:"col-w-100 w-100 bg-main button"}," Load more ")):e.createCommentVNode("",!0)]),_:3},8,["class"])],64))}};exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("../../modules/icons/skeletons/SkeletonEvent.vue.cjs");require("../Loader/Loader.vue.cjs");const f=require("../EmptyState/EmptyState.vue.cjs");require("vue-i18n");const v={__name:"Feed",props:{showLoadMore:{type:Boolean,default:!0},states:{type:Object,default:()=>({empty:{title:String,description:String}})},store:{type:Object,default:()=>({read:Function,state:Object})},options:{type:Object,default:()=>({category:null,limit:20,skip:0,owner:null,creator:null,user:null,status:null,period:null,contain:null})}},setup(i){const a=i,r=e.ref([]),l=e.ref(!1);let s=e.ref(!0),u=e.ref(a.options.skip?a.options.skip:0),o=e.ref(a.options.limit?a.options.limit:10);const d=async()=>{if(l.value){u.value+=o.value;const t=await a.store.read({skip:u.value,limit:o.value,...a.options});t.length===0||t.length<o.value?l.value=!1:l.value=!0,r.value=[...r.value,...t]}},c=async()=>{const t=await a.store.read({skip:u.value,limit:o.value,...a.options});t.length===0||t.length<o.value?l.value=!1:l.value=!0,console.log(t),r.value=t,s.value=!1};return e.watch(()=>a.options,(t,n)=>{(t.organization!==n.organization||t.categories!==n.categories||t.prices!==n.prices||t.delivery!==n.delivery||t.search!==n.search)&&c()},{deep:!0}),e.onMounted(async()=>{await c()}),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(s)?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:0,tag:"ul",name:"scaleTransition",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o),m=>(e.openBlock(),e.createBlock(p.default,{key:m}))),128)):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[!e.unref(s)&&r.value.length<1?(e.openBlock(),e.createBlock(f.default,{key:0,title:i.states.empty.title,description:i.states.empty.description,class:"pd-medium mn-b-thin bg-grey radius-big"},null,8,["title","description"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"scaleTransition",class:e.normalizeClass(t.$attrs.class)},{default:e.withCtx(()=>[!e.unref(s)&&r.value.length>0?e.renderSlot(t.$slots,"default",{key:0,items:r.value,user:t.user}):e.createCommentVNode("",!0),i.showLoadMore&&l.value&&r.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:d,class:"col-w-100 w-100 bg-main button"}," Load more ")):e.createCommentVNode("",!0)]),_:3},8,["class"])],64))}};exports.default=v;