@ozdao/prometheus-framework 0.2.102 → 0.2.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main-CXObXjv-.js +92 -0
- package/dist/main-DPsHxX0l.mjs +13633 -0
- package/dist/main-DfD5hLQo.mjs +13633 -0
- package/dist/main-DwyUYWFX.js +92 -0
- package/dist/orders.server.js +16 -0
- package/dist/orders.server.mjs +16 -0
- package/dist/organizations.server.js +14 -3
- package/dist/organizations.server.mjs +14 -3
- package/dist/products.server.js +7 -1
- package/dist/products.server.mjs +7 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +43 -41
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -73
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +73 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +1 -36
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +36 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +1 -13
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +13 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +21 -21
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +87 -67
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +30 -31
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +120 -88
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-BNKN7kk3.mjs +54 -0
- package/dist/web-C0sFgeYh.mjs +54 -0
- package/dist/web-Douq6xn6.js +1 -0
- package/dist/web-kg3KgbAF.js +1 -0
- package/package.json +1 -1
- package/src/components/Feed/Feed.vue +11 -10
- package/src/modules/orders/controllers/orders.controller.js +20 -1
- package/src/modules/organizations/components/pages/Members.vue +1 -1
- package/src/modules/organizations/controllers/memberships.controller.js +22 -10
- package/src/modules/products/components/blocks/CardPosition.vue +32 -7
- package/src/modules/products/components/pages/EditLeftover.vue +0 -3
- package/src/modules/products/components/pages/ProductEdit.vue +51 -15
- package/src/modules/products/controllers/products.controller.js +1 -2
- package/src/modules/products/models/product.model.js +6 -0
- package/src/modules/products/routes/products.routes.js +1 -10
package/dist/orders.server.js
CHANGED
@@ -350,6 +350,22 @@ const controllerFactory$1 = (db) => {
|
|
350
350
|
comment: ""
|
351
351
|
});
|
352
352
|
}
|
353
|
+
if (req.body.status === "confirmed") {
|
354
|
+
try {
|
355
|
+
const leftover = await Leftover.create({
|
356
|
+
organization: order.organization,
|
357
|
+
type: "stock-out",
|
358
|
+
order: order._id,
|
359
|
+
comment: `Stock-out for order ${order._id}`,
|
360
|
+
positions: order.positions,
|
361
|
+
creator: order.creator,
|
362
|
+
owner: order.owner
|
363
|
+
});
|
364
|
+
console.log("Leftover created:", leftover);
|
365
|
+
} catch (err) {
|
366
|
+
console.error("Error creating Leftover:", err);
|
367
|
+
}
|
368
|
+
}
|
353
369
|
try {
|
354
370
|
await order.save();
|
355
371
|
res.status(200).send(order);
|
package/dist/orders.server.mjs
CHANGED
@@ -349,6 +349,22 @@ const controllerFactory$1 = (db) => {
|
|
349
349
|
comment: ""
|
350
350
|
});
|
351
351
|
}
|
352
|
+
if (req.body.status === "confirmed") {
|
353
|
+
try {
|
354
|
+
const leftover = await Leftover.create({
|
355
|
+
organization: order.organization,
|
356
|
+
type: "stock-out",
|
357
|
+
order: order._id,
|
358
|
+
comment: `Stock-out for order ${order._id}`,
|
359
|
+
positions: order.positions,
|
360
|
+
creator: order.creator,
|
361
|
+
owner: order.owner
|
362
|
+
});
|
363
|
+
console.log("Leftover created:", leftover);
|
364
|
+
} catch (err) {
|
365
|
+
console.error("Error creating Leftover:", err);
|
366
|
+
}
|
367
|
+
}
|
352
368
|
try {
|
353
369
|
await order.save();
|
354
370
|
res.status(200).send(order);
|
@@ -7,6 +7,7 @@ const require$$3 = require("uuidv4");
|
|
7
7
|
const require$$0 = require("mongoose");
|
8
8
|
const require$$5 = require("@googlemaps/google-maps-services-js");
|
9
9
|
const addMembersQuantity$1 = require("./addMembersQuantity-B8UgqlUM.js");
|
10
|
+
const queryProcessor = require("./queryProcessor-DRMo_GWK.js");
|
10
11
|
const mailing = require("./mailing-BX0q8DIs.js");
|
11
12
|
const index = require("./index-BCCiEK_u.js");
|
12
13
|
const require$$0$2 = require("mongodb");
|
@@ -453,6 +454,7 @@ const controllerFactory$5 = (db) => {
|
|
453
454
|
};
|
454
455
|
var organizations_controller = controllerFactory$5;
|
455
456
|
const ObjectId$1 = require$$0.Types.ObjectId;
|
457
|
+
const queryProcessorGlobals = queryProcessor.queryProcessor;
|
456
458
|
const controllerFactory$4 = (db) => {
|
457
459
|
const Membership = db.membership;
|
458
460
|
const read = async (req, res2) => {
|
@@ -463,9 +465,9 @@ const controllerFactory$4 = (db) => {
|
|
463
465
|
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
464
466
|
const parts = search.split(".");
|
465
467
|
if (parts.length === 2) {
|
466
|
-
regexPattern = parts.
|
468
|
+
regexPattern = parts.join("\\.");
|
467
469
|
} else {
|
468
|
-
regexPattern = search
|
470
|
+
regexPattern = search;
|
469
471
|
}
|
470
472
|
}
|
471
473
|
const memberships = await Membership.aggregate([
|
@@ -494,7 +496,16 @@ const controllerFactory$4 = (db) => {
|
|
494
496
|
},
|
495
497
|
{
|
496
498
|
$unwind: "$user"
|
497
|
-
}
|
499
|
+
},
|
500
|
+
// Pagination
|
501
|
+
...queryProcessorGlobals.getSortingOptions(
|
502
|
+
req.query.sortParam,
|
503
|
+
req.query.sortOrder
|
504
|
+
),
|
505
|
+
...queryProcessorGlobals.getPaginationOptions(
|
506
|
+
req.query.skip,
|
507
|
+
req.query.limit
|
508
|
+
)
|
498
509
|
]);
|
499
510
|
if (!memberships || memberships.length === 0) {
|
500
511
|
return res2.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
|
@@ -6,6 +6,7 @@ import require$$3 from "uuidv4";
|
|
6
6
|
import require$$0 from "mongoose";
|
7
7
|
import require$$5 from "@googlemaps/google-maps-services-js";
|
8
8
|
import { a as addUserStatusFields_1, b as addMembersQuantity_1 } from "./addMembersQuantity-BXp_LeQd.mjs";
|
9
|
+
import { q as queryProcessor } from "./queryProcessor-BJdKh0Ow.mjs";
|
9
10
|
import { m as mailing } from "./mailing-Cdp8NXhP.mjs";
|
10
11
|
import { s as server } from "./index-B6a1mPgp.mjs";
|
11
12
|
import require$$0$2 from "mongodb";
|
@@ -452,6 +453,7 @@ const controllerFactory$5 = (db) => {
|
|
452
453
|
};
|
453
454
|
var organizations_controller = controllerFactory$5;
|
454
455
|
const ObjectId$1 = require$$0.Types.ObjectId;
|
456
|
+
const queryProcessorGlobals = queryProcessor;
|
455
457
|
const controllerFactory$4 = (db) => {
|
456
458
|
const Membership = db.membership;
|
457
459
|
const read = async (req, res2) => {
|
@@ -462,9 +464,9 @@ const controllerFactory$4 = (db) => {
|
|
462
464
|
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
463
465
|
const parts = search.split(".");
|
464
466
|
if (parts.length === 2) {
|
465
|
-
regexPattern = parts.
|
467
|
+
regexPattern = parts.join("\\.");
|
466
468
|
} else {
|
467
|
-
regexPattern = search
|
469
|
+
regexPattern = search;
|
468
470
|
}
|
469
471
|
}
|
470
472
|
const memberships = await Membership.aggregate([
|
@@ -493,7 +495,16 @@ const controllerFactory$4 = (db) => {
|
|
493
495
|
},
|
494
496
|
{
|
495
497
|
$unwind: "$user"
|
496
|
-
}
|
498
|
+
},
|
499
|
+
// Pagination
|
500
|
+
...queryProcessorGlobals.getSortingOptions(
|
501
|
+
req.query.sortParam,
|
502
|
+
req.query.sortOrder
|
503
|
+
),
|
504
|
+
...queryProcessorGlobals.getPaginationOptions(
|
505
|
+
req.query.skip,
|
506
|
+
req.query.limit
|
507
|
+
)
|
497
508
|
]);
|
498
509
|
if (!memberships || memberships.length === 0) {
|
499
510
|
return res2.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
|
package/dist/products.server.js
CHANGED
@@ -45,12 +45,18 @@ var product_model = (mongoose) => {
|
|
45
45
|
price: {
|
46
46
|
type: Number,
|
47
47
|
required: true,
|
48
|
+
default: 0,
|
48
49
|
min: [0, "Price cannot be less than 0"]
|
49
50
|
},
|
50
51
|
quantity: {
|
51
52
|
type: Number,
|
52
53
|
required: true,
|
53
54
|
min: [1, "Quantity cannot be less than 1"]
|
55
|
+
},
|
56
|
+
type: {
|
57
|
+
type: String,
|
58
|
+
required: true,
|
59
|
+
default: "g"
|
54
60
|
}
|
55
61
|
}],
|
56
62
|
quantityDiscount: [{
|
@@ -296,7 +302,7 @@ const controllerFactory$5 = (db) => {
|
|
296
302
|
}
|
297
303
|
}
|
298
304
|
console.log(query);
|
299
|
-
const products = await Product.find(query, null, options);
|
305
|
+
const products = await Product.find(query, null, options).populate("ingredients._id");
|
300
306
|
if (!products.length) {
|
301
307
|
return res.status(200).json([]);
|
302
308
|
}
|
package/dist/products.server.mjs
CHANGED
@@ -43,12 +43,18 @@ var product_model = (mongoose) => {
|
|
43
43
|
price: {
|
44
44
|
type: Number,
|
45
45
|
required: true,
|
46
|
+
default: 0,
|
46
47
|
min: [0, "Price cannot be less than 0"]
|
47
48
|
},
|
48
49
|
quantity: {
|
49
50
|
type: Number,
|
50
51
|
required: true,
|
51
52
|
min: [1, "Quantity cannot be less than 1"]
|
53
|
+
},
|
54
|
+
type: {
|
55
|
+
type: String,
|
56
|
+
required: true,
|
57
|
+
default: "g"
|
52
58
|
}
|
53
59
|
}],
|
54
60
|
quantityDiscount: [{
|
@@ -294,7 +300,7 @@ const controllerFactory$5 = (db) => {
|
|
294
300
|
}
|
295
301
|
}
|
296
302
|
console.log(query);
|
297
|
-
const products = await Product.find(query, null, options);
|
303
|
+
const products = await Product.find(query, null, options).populate("ingredients._id");
|
298
304
|
if (!products.length) {
|
299
305
|
return res.status(200).json([]);
|
300
306
|
}
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../Tooltip/Tooltip.
|
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-big"},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.
|
2
|
+
import b from "../Tooltip/Tooltip.vue.js";
|
3
3
|
const k = { class: "bg-grey pd-medium radius-big" }, C = {
|
4
4
|
key: 0,
|
5
5
|
class: "mn-b-small flex-v-center flex-nowrap flex"
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("../../modules/icons/skeletons/SkeletonEvent.vue.cjs");require("../Loader/Loader.vue.cjs");const y=require("../EmptyState/EmptyState.vue.cjs");require("vue-i18n");const g=require("../../modules/globals/components/blocks/BlockSearch.vue.cjs"),d=null,b={__name:"Feed",props:{showLoadMore:{type:Boolean,default:!0},search:{type:[Boolean,Object],default:!1},states:{type:Object,default:()=>({empty:{title:String,description:String}})},store:{type:Object,default:()=>({read:Function,state:Object})},external:{type:Boolean,default:!1},options:{type:Object,default:()=>({category:null,limit:20,skip:0,owner:null,creator:null,user:null,status:null,period:null,contain:null})}},setup(n){const l=n,s=e.ref([]),r=e.ref(!1);let i=e.ref(!0),m=e.ref(null),c=e.ref(l.options.skip?l.options.skip:0),o=e.ref(l.options.limit?l.options.limit:10),f=e.ref("");function h(t){f.value=t,c.value=0,o.value=10,u()}const p=async()=>{if(r.value){c.value+=o.value;const t=await l.store.read({skip:c.value,limit:o.value,search:f.value,...l.options});t.length===0||t.length<o.value?r.value=!1:r.value=!0,s.value=[...s.value,...t]}},u=async()=>{const t=await l.store.read({skip:c.value,limit:o.value,search:f.value,...l.options});t.length===0||t.length<o.value?r.value=!1:r.value=!0,s.value=t,i.value=!1};return e.watch(()=>l.external,t=>{}),e.watch(()=>l.external,(t,a)=>{t!==a&&u()},{deep:!0}),e.watch(()=>l.options,(t,a)=>{(t.organization!==a.organization||t.categories!==a.categories||t.prices!==a.prices||t.delivery!==a.delivery||t.search!==a.search||t.status!==a.status||t.hidden!==a.hidden||t.type!==a.type)&&u()},{deep:!0}),e.onMounted(async()=>{await u(),typeof window<"u"&&!l.showLoadMore&&(d=new IntersectionObserver(t=>{t.some(a=>a.isIntersecting)&&p()}),d.observe(m.value))}),e.onUnmounted(()=>{d&&d.disconnect()}),(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[n.search?(e.openBlock(),e.createBlock(g.default,{key:0,placeholder:n.search.placeholder||"Search...",class:e.normalizeClass(n.search.class||"bg-grey mn-b-thin"),onSearch:h},null,8,["placeholder","class"])):e.createCommentVNode("",!0),e.unref(i)?(e.openBlock(),e.createBlock(e.TransitionGroup,{key:1,tag:"ul",name:"scaleTransition",class:e.normalizeClass(["o-hidden bg-grey radius-big",t.$attrs.class])},{default:e.withCtx(()=>[e.unref(i)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(o),v=>(e.openBlock(),e.createBlock(k.default,{key:"skeleton-"+v}))),128)):e.createCommentVNode("",!0)]),_:1},8,["class"])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[!e.unref(i)&&s.value.length<1?(e.openBlock(),e.createBlock(y.default,{key:0,title:n.states.empty.title,description:n.states.empty.description,action:n.states.empty.action,callback:n.states.empty.callback,class:"pd-medium mn-b-thin bg-grey radius-big"},null,8,["title","description","action","callback"])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"scaleTransition",class:e.normalizeClass(t.$attrs.class)},{default:e.withCtx(()=>[!e.unref(i)&&s.value.length>0?e.renderSlot(t.$slots,"default",{key:0,items:s.value}):e.createCommentVNode("",!0),n.showLoadMore&&r.value&&s.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:p,class:"col-w-100 w-100 bg-main button"}," Load More ")):e.createCommentVNode("",!0),e.createElementVNode("div",{key:"sentinel",ref_key:"sentinel",ref:m,class:"sentinel"},null,512)]),_:3},8,["class"])],64))}};exports.default=b;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import { ref as
|
2
|
-
import
|
1
|
+
import { ref as r, watch as y, onMounted as I, onUnmounted as T, openBlock as o, createElementBlock as g, Fragment as L, createBlock as p, normalizeClass as k, createCommentVNode as u, unref as d, TransitionGroup as M, withCtx as b, renderList as $, createVNode as B, Transition as C, renderSlot as x, createElementVNode as z } from "vue";
|
2
|
+
import E from "../../modules/icons/skeletons/SkeletonEvent.vue.js";
|
3
3
|
import "../Loader/Loader.vue.js";
|
4
|
-
import
|
4
|
+
import F from "../EmptyState/EmptyState.vue.js";
|
5
5
|
import "vue-i18n";
|
6
|
-
import
|
7
|
-
const
|
6
|
+
import N from "../../modules/globals/components/blocks/BlockSearch.vue.js";
|
7
|
+
const v = null, J = {
|
8
8
|
__name: "Feed",
|
9
9
|
props: {
|
10
10
|
showLoadMore: {
|
@@ -51,70 +51,72 @@ const H = {
|
|
51
51
|
}
|
52
52
|
},
|
53
53
|
setup(s) {
|
54
|
-
const a = s, n =
|
55
|
-
let
|
54
|
+
const a = s, n = r([]), l = r(!1);
|
55
|
+
let c = r(!0), S = r(null), m = r(a.options.skip ? a.options.skip : 0), i = r(a.options.limit ? a.options.limit : 10), h = r("");
|
56
56
|
function O(e) {
|
57
|
-
|
57
|
+
h.value = e, m.value = 0, i.value = 10, f();
|
58
58
|
}
|
59
59
|
const w = async () => {
|
60
60
|
if (l.value) {
|
61
|
-
|
61
|
+
m.value += i.value;
|
62
62
|
const e = await a.store.read({
|
63
|
-
skip:
|
64
|
-
limit:
|
65
|
-
search:
|
63
|
+
skip: m.value,
|
64
|
+
limit: i.value,
|
65
|
+
search: h.value,
|
66
66
|
...a.options
|
67
67
|
});
|
68
|
-
e.length === 0 || e.length <
|
68
|
+
e.length === 0 || e.length < i.value ? l.value = !1 : l.value = !0, n.value = [...n.value, ...e];
|
69
69
|
}
|
70
|
-
},
|
70
|
+
}, f = async () => {
|
71
71
|
const e = await a.store.read({
|
72
|
-
skip:
|
73
|
-
limit:
|
74
|
-
search:
|
72
|
+
skip: m.value,
|
73
|
+
limit: i.value,
|
74
|
+
search: h.value,
|
75
75
|
...a.options
|
76
76
|
});
|
77
|
-
e.length === 0 || e.length <
|
77
|
+
e.length === 0 || e.length < i.value ? l.value = !1 : l.value = !0, n.value = e, c.value = !1;
|
78
78
|
};
|
79
79
|
return y(() => a.external, (e) => {
|
80
80
|
}), y(() => a.external, (e, t) => {
|
81
|
-
e !== t &&
|
81
|
+
e !== t && f();
|
82
82
|
}, { deep: !0 }), y(() => a.options, (e, t) => {
|
83
|
-
(e.organization !== t.organization || e.categories !== t.categories || e.prices !== t.prices || e.delivery !== t.delivery || e.search !== t.search || e.status !== t.status || e.hidden !== t.hidden || e.type !== t.type) &&
|
84
|
-
}, { deep: !0 }),
|
85
|
-
await
|
86
|
-
|
87
|
-
}).observe(S.value);
|
88
|
-
}), (
|
89
|
-
|
83
|
+
(e.organization !== t.organization || e.categories !== t.categories || e.prices !== t.prices || e.delivery !== t.delivery || e.search !== t.search || e.status !== t.status || e.hidden !== t.hidden || e.type !== t.type) && f();
|
84
|
+
}, { deep: !0 }), I(async () => {
|
85
|
+
await f(), typeof window < "u" && !a.showLoadMore && (v = new IntersectionObserver((e) => {
|
86
|
+
e.some((t) => t.isIntersecting) && w();
|
87
|
+
}), v.observe(S.value));
|
88
|
+
}), T(() => {
|
89
|
+
v && v.disconnect();
|
90
|
+
}), (e, t) => (o(), g(L, null, [
|
91
|
+
s.search ? (o(), p(N, {
|
90
92
|
key: 0,
|
91
93
|
placeholder: s.search.placeholder || "Search...",
|
92
94
|
class: k(s.search.class || "bg-grey mn-b-thin"),
|
93
95
|
onSearch: O
|
94
|
-
}, null, 8, ["placeholder", "class"])) :
|
95
|
-
d(
|
96
|
+
}, null, 8, ["placeholder", "class"])) : u("", !0),
|
97
|
+
d(c) ? (o(), p(M, {
|
96
98
|
key: 1,
|
97
99
|
tag: "ul",
|
98
100
|
name: "scaleTransition",
|
99
101
|
class: k(["o-hidden bg-grey radius-big", e.$attrs.class])
|
100
102
|
}, {
|
101
103
|
default: b(() => [
|
102
|
-
d(
|
103
|
-
key: "skeleton-" +
|
104
|
-
}))), 128)) :
|
104
|
+
d(c) ? (o(!0), g(L, { key: 0 }, $(d(i), (j) => (o(), p(E, {
|
105
|
+
key: "skeleton-" + j
|
106
|
+
}))), 128)) : u("", !0)
|
105
107
|
]),
|
106
108
|
_: 1
|
107
|
-
}, 8, ["class"])) :
|
108
|
-
B(
|
109
|
+
}, 8, ["class"])) : u("", !0),
|
110
|
+
B(C, { name: "scaleTransition" }, {
|
109
111
|
default: b(() => [
|
110
|
-
!d(
|
112
|
+
!d(c) && n.value.length < 1 ? (o(), p(F, {
|
111
113
|
key: 0,
|
112
114
|
title: s.states.empty.title,
|
113
115
|
description: s.states.empty.description,
|
114
116
|
action: s.states.empty.action,
|
115
117
|
callback: s.states.empty.callback,
|
116
118
|
class: "pd-medium mn-b-thin bg-grey radius-big"
|
117
|
-
}, null, 8, ["title", "description", "action", "callback"])) :
|
119
|
+
}, null, 8, ["title", "description", "action", "callback"])) : u("", !0)
|
118
120
|
]),
|
119
121
|
_: 1
|
120
122
|
}),
|
@@ -124,16 +126,16 @@ const H = {
|
|
124
126
|
class: k(e.$attrs.class)
|
125
127
|
}, {
|
126
128
|
default: b(() => [
|
127
|
-
!d(
|
129
|
+
!d(c) && n.value.length > 0 ? x(e.$slots, "default", {
|
128
130
|
key: 0,
|
129
131
|
items: n.value
|
130
|
-
}) :
|
131
|
-
s.showLoadMore && l.value && n.value.length > 0 ? (
|
132
|
+
}) : u("", !0),
|
133
|
+
s.showLoadMore && l.value && n.value.length > 0 ? (o(), g("button", {
|
132
134
|
key: 1,
|
133
135
|
onClick: w,
|
134
136
|
class: "col-w-100 w-100 bg-main button"
|
135
|
-
}, " Load More ")) :
|
136
|
-
|
137
|
+
}, " Load More ")) : u("", !0),
|
138
|
+
z("div", {
|
137
139
|
key: "sentinel",
|
138
140
|
ref_key: "sentinel",
|
139
141
|
ref: S,
|
@@ -146,5 +148,5 @@ const H = {
|
|
146
148
|
}
|
147
149
|
};
|
148
150
|
export {
|
149
|
-
|
151
|
+
J as default
|
150
152
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";
|
1
|
+
"use strict";
|
@@ -1,73 +1 @@
|
|
1
|
-
|
2
|
-
import { useRoute as b, useRouter as x } from "vue-router";
|
3
|
-
import { useI18n as C } from "vue-i18n";
|
4
|
-
import O from "../../modules/icons/navigation/IconCross.vue.js";
|
5
|
-
import "./Popup.vue2.js";
|
6
|
-
const z = {
|
7
|
-
key: "popup-content",
|
8
|
-
class: "pd-small popup-wrapper"
|
9
|
-
}, B = { class: "mn-b-small" }, L = {
|
10
|
-
__name: "Popup",
|
11
|
-
props: {
|
12
|
-
isPopupOpen: {
|
13
|
-
type: Boolean,
|
14
|
-
default: !1
|
15
|
-
},
|
16
|
-
style: String,
|
17
|
-
title: String
|
18
|
-
},
|
19
|
-
emits: ["close-popup"],
|
20
|
-
setup(e, { emit: m }) {
|
21
|
-
const c = e, d = m;
|
22
|
-
function r() {
|
23
|
-
d("close-popup");
|
24
|
-
}
|
25
|
-
return v(() => c.isPopupOpen, (t) => {
|
26
|
-
t ? document.body.classList.add("no-scroll") : document.body.classList.remove("no-scroll");
|
27
|
-
}), b(), x(), C({
|
28
|
-
messages: {
|
29
|
-
en: {},
|
30
|
-
ru: {}
|
31
|
-
}
|
32
|
-
}), (t, o) => (s(), l(a, {
|
33
|
-
name: "TransitionTranslateY",
|
34
|
-
appear: ""
|
35
|
-
}, {
|
36
|
-
default: i(() => [
|
37
|
-
e.isPopupOpen ? (s(), l(y, {
|
38
|
-
key: 0,
|
39
|
-
to: "body"
|
40
|
-
}, [
|
41
|
-
e.isPopupOpen ? (s(), P("div", z, [
|
42
|
-
p(a, {
|
43
|
-
name: "TransitionTranslateY",
|
44
|
-
mode: "out-in"
|
45
|
-
}, {
|
46
|
-
default: i(() => [
|
47
|
-
n("section", k({ class: "pos-relative z-index-4" }, t.$attrs, {
|
48
|
-
class: t.$attrs.class
|
49
|
-
}), [
|
50
|
-
n("h4", B, g(e.title), 1),
|
51
|
-
p(O, {
|
52
|
-
onClick: o[0] || (o[0] = (f) => r()),
|
53
|
-
class: "cursor-pointer pos-absolute pos-t-0 pos-r-0 mn-t-semi mn-r-semi hover-scale-1 i-regular z-index-5"
|
54
|
-
}),
|
55
|
-
T(t.$slots, "default")
|
56
|
-
], 16)
|
57
|
-
]),
|
58
|
-
_: 3
|
59
|
-
}),
|
60
|
-
n("div", {
|
61
|
-
onClick: o[1] || (o[1] = (f) => r()),
|
62
|
-
class: $([{ active: e.isPopupOpen === !0 }, "color-overlay z-index-3"])
|
63
|
-
}, null, 2)
|
64
|
-
])) : u("", !0)
|
65
|
-
])) : u("", !0)
|
66
|
-
]),
|
67
|
-
_: 3
|
68
|
-
}));
|
69
|
-
}
|
70
|
-
};
|
71
|
-
export {
|
72
|
-
L as default
|
73
|
-
};
|
1
|
+
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("vue-router"),p=require("vue-i18n"),d=require("../../modules/icons/navigation/IconCross.vue.cjs");require("./Popup.vue.cjs");const m={key:"popup-content",class:"pd-small popup-wrapper"},v={class:"mn-b-small"},f={__name:"Popup",props:{isPopupOpen:{type:Boolean,default:!1},style:String,title:String},emits:["close-popup"],setup(t,{emit:l}){const a=t,i=l;function n(){i("close-popup")}e.watch(()=>a.isPopupOpen,o=>{o?document.body.classList.add("no-scroll"):document.body.classList.remove("no-scroll")}),r.useRoute(),r.useRouter();const u={messages:{en:{},ru:{}}};return p.useI18n(u),(o,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"TransitionTranslateY",appear:""},{default:e.withCtx(()=>[t.isPopupOpen?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[t.isPopupOpen?(e.openBlock(),e.createElementBlock("div",m,[e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[e.createElementVNode("section",e.mergeProps({class:"pos-relative z-index-4"},o.$attrs,{class:o.$attrs.class}),[e.createElementVNode("h4",v,e.toDisplayString(t.title),1),e.createVNode(d.default,{onClick:s[0]||(s[0]=c=>n()),class:"cursor-pointer pos-absolute pos-t-0 pos-r-0 mn-t-semi mn-r-semi hover-scale-1 i-regular z-index-5"}),e.renderSlot(o.$slots,"default")],16)]),_:3}),e.createElementVNode("div",{onClick:s[1]||(s[1]=c=>n()),class:e.normalizeClass([{active:t.isPopupOpen===!0},"color-overlay z-index-3"])},null,2)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:3}))}};exports.default=f;
|
@@ -1 +1,73 @@
|
|
1
|
-
|
1
|
+
import { watch as v, openBlock as s, createBlock as l, Transition as a, withCtx as i, Teleport as y, createElementBlock as P, createVNode as p, createElementVNode as n, mergeProps as k, toDisplayString as g, renderSlot as T, normalizeClass as $, createCommentVNode as u } from "vue";
|
2
|
+
import { useRoute as b, useRouter as x } from "vue-router";
|
3
|
+
import { useI18n as C } from "vue-i18n";
|
4
|
+
import O from "../../modules/icons/navigation/IconCross.vue.js";
|
5
|
+
import "./Popup.vue.js";
|
6
|
+
const z = {
|
7
|
+
key: "popup-content",
|
8
|
+
class: "pd-small popup-wrapper"
|
9
|
+
}, B = { class: "mn-b-small" }, L = {
|
10
|
+
__name: "Popup",
|
11
|
+
props: {
|
12
|
+
isPopupOpen: {
|
13
|
+
type: Boolean,
|
14
|
+
default: !1
|
15
|
+
},
|
16
|
+
style: String,
|
17
|
+
title: String
|
18
|
+
},
|
19
|
+
emits: ["close-popup"],
|
20
|
+
setup(e, { emit: m }) {
|
21
|
+
const c = e, d = m;
|
22
|
+
function r() {
|
23
|
+
d("close-popup");
|
24
|
+
}
|
25
|
+
return v(() => c.isPopupOpen, (t) => {
|
26
|
+
t ? document.body.classList.add("no-scroll") : document.body.classList.remove("no-scroll");
|
27
|
+
}), b(), x(), C({
|
28
|
+
messages: {
|
29
|
+
en: {},
|
30
|
+
ru: {}
|
31
|
+
}
|
32
|
+
}), (t, o) => (s(), l(a, {
|
33
|
+
name: "TransitionTranslateY",
|
34
|
+
appear: ""
|
35
|
+
}, {
|
36
|
+
default: i(() => [
|
37
|
+
e.isPopupOpen ? (s(), l(y, {
|
38
|
+
key: 0,
|
39
|
+
to: "body"
|
40
|
+
}, [
|
41
|
+
e.isPopupOpen ? (s(), P("div", z, [
|
42
|
+
p(a, {
|
43
|
+
name: "TransitionTranslateY",
|
44
|
+
mode: "out-in"
|
45
|
+
}, {
|
46
|
+
default: i(() => [
|
47
|
+
n("section", k({ class: "pos-relative z-index-4" }, t.$attrs, {
|
48
|
+
class: t.$attrs.class
|
49
|
+
}), [
|
50
|
+
n("h4", B, g(e.title), 1),
|
51
|
+
p(O, {
|
52
|
+
onClick: o[0] || (o[0] = (f) => r()),
|
53
|
+
class: "cursor-pointer pos-absolute pos-t-0 pos-r-0 mn-t-semi mn-r-semi hover-scale-1 i-regular z-index-5"
|
54
|
+
}),
|
55
|
+
T(t.$slots, "default")
|
56
|
+
], 16)
|
57
|
+
]),
|
58
|
+
_: 3
|
59
|
+
}),
|
60
|
+
n("div", {
|
61
|
+
onClick: o[1] || (o[1] = (f) => r()),
|
62
|
+
class: $([{ active: e.isPopupOpen === !0 }, "color-overlay z-index-3"])
|
63
|
+
}, null, 2)
|
64
|
+
])) : u("", !0)
|
65
|
+
])) : u("", !0)
|
66
|
+
]),
|
67
|
+
_: 3
|
68
|
+
}));
|
69
|
+
}
|
70
|
+
};
|
71
|
+
export {
|
72
|
+
L as default
|
73
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";
|
1
|
+
"use strict";
|