@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.
- package/dist/events.server.js +14 -6
- package/dist/events.server.mjs +14 -6
- package/dist/main-CX2ISR43.mjs +13629 -0
- package/dist/main-cffh4bbv.js +92 -0
- package/dist/main.css +1 -1
- package/dist/orders.server.js +32 -18
- package/dist/orders.server.mjs +32 -18
- package/dist/organizations.server.js +2 -1
- package/dist/organizations.server.mjs +2 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.js +46 -48
- 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/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +25 -20
- package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Map/Map.vue.js +36 -26
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +103 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -103
- 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/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
- 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 +3 -3
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/VideoPlayer.vue.js +11 -11
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.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/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.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 +3 -3
- 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 +2 -2
- 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 +3 -3
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.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 +46 -46
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +39 -65
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +31 -31
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +242 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +62 -62
- 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 +30 -30
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +99 -70
- 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 +3 -3
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +10 -10
- 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/orders/router/orders.backoffice.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +33 -34
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +42 -42
- 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 +27 -25
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +11 -11
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.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 +46 -43
- 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 +162 -168
- 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 +27 -26
- 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 +7 -7
- 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 +3 -3
- 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 +2 -2
- 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 +3 -3
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.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 +3 -3
- 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 +2 -2
- 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 +16 -17
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +22 -20
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +59 -38
- 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/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +23 -22
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +17 -14
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- 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-CQQEUA9l.js +1 -0
- package/dist/web-D2Em-p-C.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Address/Address.vue +23 -34
- package/src/components/LocationMarker/LocationMarker.vue +6 -1
- package/src/components/LocationSelection/LocationSelection.vue +4 -0
- package/src/components/Map/Map.vue +29 -15
- package/src/modules/constructor/components/elements/VideoPlayer.vue +2 -2
- package/src/modules/events/controllers/events.controller.js +4 -4
- package/src/modules/globals/components/blocks/CardHeader.vue +2 -2
- package/src/modules/integrations/stripe/controllers/services/stripe.service.js +17 -6
- package/src/modules/landing/components/pages/Farming.vue +226 -0
- package/src/modules/landing/components/pages/Governance.vue +3 -5
- package/src/modules/landing/components/pages/Home.vue +0 -3
- package/src/modules/landing/components/pages/Hotel.vue +1 -3
- package/src/modules/landing/components/pages/Page.vue +0 -3
- package/src/modules/landing/components/sections/Examples.vue +4 -56
- package/src/modules/landing/components/sections/SectionFeature.vue +41 -0
- package/src/modules/landing/components/sections/SectionFeaturesImages.vue +122 -0
- package/src/modules/landing/components/sections/SectionFocus.vue +59 -0
- package/src/modules/landing/components/sections/SectionHeroVideo.vue +164 -0
- package/src/modules/landing/router/landing.js +11 -0
- package/src/modules/marketplace/components/sections/Filters.vue +26 -23
- package/src/modules/orders/components/blocks/CardOrderItem.vue +8 -0
- package/src/modules/orders/components/blocks/StatusHistory.vue +25 -53
- package/src/modules/orders/components/pages/Order.vue +2 -6
- package/src/modules/orders/components/pages/OrderBackoffice.vue +393 -0
- package/src/modules/orders/components/pages/OrderCreate.vue +5 -4
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -3
- package/src/modules/orders/components/pages/Orders.vue +60 -11
- package/src/modules/orders/components/sections/FormDelivery.vue +2 -2
- package/src/modules/orders/controllers/orders.controller.js +29 -18
- package/src/modules/orders/models/order.model.js +8 -2
- package/src/modules/orders/router/orders.backoffice.router.js +1 -1
- package/src/modules/orders/router/orders.router.js +2 -2
- package/src/modules/orders/store/orders.js +3 -7
- package/src/modules/orders/store/shopcart.js +1 -1
- package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -0
- package/src/modules/organizations/components/pages/Department.vue +5 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +65 -27
- package/src/modules/organizations/components/pages/Members.vue +2 -1
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/controllers/memberships.controller.js +3 -1
- package/src/modules/organizations/store/memberships.js +1 -1
- package/src/modules/products/components/blocks/CardProduct.vue +2 -3
- package/src/modules/products/components/pages/ProductEdit.vue +10 -13
- package/src/modules/products/components/pages/Products.vue +2 -0
- package/src/modules/products/store/products.js +25 -2
- package/src/modules/spots/components/blocks/CardSpot.vue +2 -2
- package/src/modules/users/components/blocks/CardUser.vue +1 -0
- package/src/modules/landing/components/sections/AboutSection.vue +0 -69
package/dist/orders.server.js
CHANGED
@@ -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
|
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:
|
243
|
-
|
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.
|
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
|
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
|
-
|
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
|
}
|
package/dist/orders.server.mjs
CHANGED
@@ -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
|
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:
|
242
|
-
|
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.
|
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
|
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
|
-
|
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"),
|
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
|
2
|
-
import { Loader as
|
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
|
5
|
-
const
|
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
|
-
},
|
8
|
+
}, L = ["placeholder", "value"], N = {
|
9
9
|
key: 0,
|
10
10
|
class: "mn-t-thin invalid-feedback"
|
11
|
-
},
|
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(
|
32
|
-
const
|
35
|
+
setup(n, { emit: f }) {
|
36
|
+
const g = n, o = f, c = w(null);
|
33
37
|
let s;
|
34
|
-
const
|
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
|
51
|
-
for (let
|
52
|
-
|
53
|
-
|
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
|
57
|
-
o("update:address",
|
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
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
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
|
-
|
67
|
-
|
68
|
-
])) :
|
69
|
-
|
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:
|
69
|
+
ref: c,
|
72
70
|
class: "w-100",
|
73
|
-
placeholder:
|
74
|
-
value:
|
75
|
-
onInput:
|
76
|
-
}, null, 40,
|
77
|
-
|
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:
|
82
|
-
e.validation ? (
|
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
|
-
},
|
86
|
+
}, x = /* @__PURE__ */ E(V, [["__scopeId", "data-v-1fe1017e"]]);
|
89
87
|
export {
|
90
|
-
|
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.
|
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.
|
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";
|
1
|
+
"use strict";
|
@@ -1,94 +1 @@
|
|
1
|
-
|
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;
|