@ozdao/prometheus-framework 0.2.52 → 0.2.54
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main-0a2437f4.js +91 -0
- package/dist/main-180a9315.js +91 -0
- package/dist/main-3b7bd446.mjs +13631 -0
- package/dist/main-4fnApBsF.js +91 -0
- package/dist/main-Im8ovDCi.mjs +13609 -0
- package/dist/main-MjvO1l5U.js +91 -0
- package/dist/main-cdd0be68.mjs +13628 -0
- package/dist/main-kjbLXQEa.mjs +13606 -0
- package/dist/main.css +1 -1
- package/dist/organizations.server.js +17 -3
- package/dist/organizations.server.mjs +17 -3
- package/dist/products.server.js +62 -50
- package/dist/products.server.mjs +62 -50
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -223
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +223 -2
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +20 -20
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +81 -2
- 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/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +2 -70
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +95 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +2 -95
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +57 -77
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.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/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +4 -4
- 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 +65 -2
- 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 +2 -65
- 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/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/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.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 +100 -96
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.js +59 -52
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.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 +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 +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +8 -13
- 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 +3 -3
- 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 +11 -2
- 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 +2 -11
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +54 -78
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +42 -32
- 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 +2 -2
- 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/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +5 -5
- 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 +2 -2
- 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 +2 -2
- 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 +5 -5
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- 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 +3 -3
- 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 +5 -5
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +5 -3
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.router.js +20 -5
- package/dist/prometheus-framework/src/modules/organizations/router/products.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/products.router.js +22 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue.js +45 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardCategory.vue2.js +4 -0
- 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/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/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 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +79 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +193 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue2.js +4 -0
- 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/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- 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 +68 -58
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
- 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/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +21 -18
- 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/products.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/products.client.js +2 -2
- package/dist/prometheus-framework/src/modules/products/store/categories.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/categories.js +39 -27
- 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 +3 -3
- 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 +63 -77
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/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-0066fd51.mjs +55 -0
- package/dist/web-6b9fa713.js +1 -0
- package/dist/web-8b404cc2.js +1 -0
- package/dist/web-e9b09dc6.mjs +55 -0
- package/dist/web-i-suCpLM.mjs +55 -0
- package/dist/web-ngl7bNhF.js +1 -0
- package/dist/web-t91TrxXa.mjs +55 -0
- package/dist/web-vB7UhMOt.js +1 -0
- package/package.json +1 -1
- package/src/components/Button/Button.vue +1 -3
- package/src/components/EditImages/EditImages.vue +1 -1
- package/src/components/Field/Field.vue +8 -1
- package/src/components/LocationSelection/LocationSelection.vue +2 -2
- package/src/modules/backoffice/components/pages/Dashboard.vue +4 -25
- package/src/modules/backoffice/router/admin.js +0 -14
- package/src/modules/backoffice/router/backoffice.js +1 -1
- package/src/modules/events/components/pages/EditEvent.vue +10 -6
- package/src/modules/events/components/sections/HeroEvent.vue +12 -2
- package/src/modules/events/components/sections/SectionPreviousEvents.vue +1 -1
- package/src/modules/landing/components/sections/MobileApp.vue +2 -6
- package/src/modules/marketplace/components/sections/Filters.vue +7 -1
- package/src/modules/orders/components/blocks/StatusHistory.vue +91 -31
- package/src/modules/orders/components/pages/EditOrder.vue +4 -21
- package/src/modules/orders/components/pages/FormOrder.vue +53 -15
- package/src/modules/orders/components/pages/Order.vue +2 -2
- package/src/modules/orders/components/sections/FormClientDetails.vue +63 -0
- package/src/modules/orders/components/sections/FormDelivery.vue +72 -0
- package/src/modules/orders/components/sections/FormPayment.vue +27 -0
- package/src/modules/orders/controllers/orders.controller.js +63 -49
- package/src/modules/orders/models/order.model.js +9 -13
- package/src/modules/orders/routes/orders.routes.js +6 -20
- package/src/modules/orders/store/orders.js +24 -12
- package/src/modules/organizations/controllers/organizations.controller.js +28 -9
- package/src/modules/organizations/router/organizations.js +4 -1
- package/src/modules/organizations/router/organizations.router.js +18 -2
- package/src/modules/organizations/router/products.router.js +24 -4
- package/src/modules/products/components/blocks/CardCategory.vue +53 -0
- package/src/modules/products/components/pages/Categories.vue +90 -0
- package/src/modules/products/components/pages/CategoryEdit.vue +214 -0
- package/src/modules/products/components/pages/ProductEdit.vue +9 -1
- package/src/modules/products/components/sections/FilterProducts.vue +4 -1
- package/src/modules/products/controllers/categories.controller.js +30 -13
- package/src/modules/products/controllers/products.controller.js +3 -2
- package/src/modules/products/models/category.model.js +42 -32
- package/src/modules/products/products.client.js +4 -2
- package/src/modules/products/store/categories.js +17 -3
- package/src/modules/users/components/pages/Profile.vue +2 -2
- package/src/modules/backoffice/components/admin/Categories.vue +0 -53
- package/src/modules/backoffice/components/admin/CategoryEdit.vue +0 -98
- package/src/modules/orders/components/sections/FormOrderDetails.vue +0 -220
- package/src/modules/products/components/blocks/CategoryCard.vue +0 -42
- package/src/modules/products/router/products.router.js +0 -48
- /package/src/modules/{products → organizations}/components/pages/OrganizationCreate.vue +0 -0
- /package/src/modules/{products → organizations}/components/pages/OrganizationDetails.vue +0 -0
- /package/src/modules/{products → organizations}/components/pages/OrganizationDocuments.vue +0 -0
- /package/src/modules/{products → organizations}/components/pages/OrganizationPeople.vue +0 -0
@@ -200,16 +200,30 @@ const controllerFactory$4 = (db) => {
|
|
200
200
|
lat = location.coordinates[1];
|
201
201
|
userLocation.coordinates = [lng, lat];
|
202
202
|
}
|
203
|
-
|
203
|
+
const earthRadiusKm = 6378.1;
|
204
|
+
let radius = null;
|
205
|
+
if (locationRadius) {
|
206
|
+
radius = parseFloat(locationRadius) / earthRadiusKm;
|
207
|
+
} else if (city) {
|
208
|
+
radius = 500 / earthRadiusKm;
|
209
|
+
} else if (state) {
|
210
|
+
radius = 1e3 / earthRadiusKm;
|
211
|
+
} else {
|
212
|
+
radius = null;
|
213
|
+
}
|
214
|
+
const geoWithinCondition = {
|
204
215
|
"spots.location.coordinates": {
|
205
216
|
$geoWithin: {
|
206
217
|
$centerSphere: [
|
207
218
|
[parseFloat(lng), parseFloat(lat)],
|
208
|
-
|
219
|
+
radius
|
209
220
|
]
|
210
221
|
}
|
211
222
|
}
|
212
|
-
}
|
223
|
+
};
|
224
|
+
if (radius !== null) {
|
225
|
+
matchConditions.push(geoWithinCondition);
|
226
|
+
}
|
213
227
|
}
|
214
228
|
const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
|
215
229
|
const stages = [
|
@@ -199,16 +199,30 @@ const controllerFactory$4 = (db) => {
|
|
199
199
|
lat = location.coordinates[1];
|
200
200
|
userLocation.coordinates = [lng, lat];
|
201
201
|
}
|
202
|
-
|
202
|
+
const earthRadiusKm = 6378.1;
|
203
|
+
let radius = null;
|
204
|
+
if (locationRadius) {
|
205
|
+
radius = parseFloat(locationRadius) / earthRadiusKm;
|
206
|
+
} else if (city) {
|
207
|
+
radius = 500 / earthRadiusKm;
|
208
|
+
} else if (state) {
|
209
|
+
radius = 1e3 / earthRadiusKm;
|
210
|
+
} else {
|
211
|
+
radius = null;
|
212
|
+
}
|
213
|
+
const geoWithinCondition = {
|
203
214
|
"spots.location.coordinates": {
|
204
215
|
$geoWithin: {
|
205
216
|
$centerSphere: [
|
206
217
|
[parseFloat(lng), parseFloat(lat)],
|
207
|
-
|
218
|
+
radius
|
208
219
|
]
|
209
220
|
}
|
210
221
|
}
|
211
|
-
}
|
222
|
+
};
|
223
|
+
if (radius !== null) {
|
224
|
+
matchConditions.push(geoWithinCondition);
|
225
|
+
}
|
212
226
|
}
|
213
227
|
const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
|
214
228
|
const stages = [
|
package/dist/products.server.js
CHANGED
@@ -81,6 +81,16 @@ var category_model = (mongoose) => {
|
|
81
81
|
required: true,
|
82
82
|
trim: true
|
83
83
|
},
|
84
|
+
status: {
|
85
|
+
type: String,
|
86
|
+
enum: ["draft", "internal", "published", "removed"],
|
87
|
+
default: "draft",
|
88
|
+
required: true
|
89
|
+
},
|
90
|
+
order: {
|
91
|
+
type: Number,
|
92
|
+
required: true
|
93
|
+
},
|
84
94
|
url: {
|
85
95
|
type: String,
|
86
96
|
required: true,
|
@@ -94,43 +104,39 @@ var category_model = (mongoose) => {
|
|
94
104
|
},
|
95
105
|
filters: {
|
96
106
|
type: Array
|
97
|
-
},
|
98
|
-
owner: {
|
99
|
-
type: {
|
100
|
-
type: String,
|
101
|
-
required: true
|
102
|
-
},
|
103
|
-
target: {
|
104
|
-
type: mongoose.Schema.Types.ObjectId,
|
105
|
-
ref: function(value) {
|
106
|
-
if (this.owner.type === "user")
|
107
|
-
return "User";
|
108
|
-
if (this.owner.type === "organization")
|
109
|
-
return "Organization";
|
110
|
-
},
|
111
|
-
required: true
|
112
|
-
}
|
113
|
-
},
|
114
|
-
creator: {
|
115
|
-
hidden: {
|
116
|
-
type: Boolean,
|
117
|
-
required: true
|
118
|
-
},
|
119
|
-
type: {
|
120
|
-
type: String,
|
121
|
-
required: true
|
122
|
-
},
|
123
|
-
target: {
|
124
|
-
type: mongoose.Schema.Types.ObjectId,
|
125
|
-
ref: function(value) {
|
126
|
-
if (this.owner.type === "user")
|
127
|
-
return "User";
|
128
|
-
if (this.owner.type === "organization")
|
129
|
-
return "Organization";
|
130
|
-
},
|
131
|
-
required: true
|
132
|
-
}
|
133
107
|
}
|
108
|
+
// owner: {
|
109
|
+
// type: {
|
110
|
+
// type: String,
|
111
|
+
// required: true
|
112
|
+
// },
|
113
|
+
// target: {
|
114
|
+
// type: mongoose.Schema.Types.ObjectId,
|
115
|
+
// ref: function (value) {
|
116
|
+
// if (this.owner.type === 'user') return 'User';
|
117
|
+
// if (this.owner.type === 'organization') return 'Organization';
|
118
|
+
// },
|
119
|
+
// required: true,
|
120
|
+
// },
|
121
|
+
// },
|
122
|
+
// creator: {
|
123
|
+
// hidden: {
|
124
|
+
// type: Boolean,
|
125
|
+
// required: true
|
126
|
+
// },
|
127
|
+
// type: {
|
128
|
+
// type: String,
|
129
|
+
// required: true
|
130
|
+
// },
|
131
|
+
// target: {
|
132
|
+
// type: mongoose.Schema.Types.ObjectId,
|
133
|
+
// ref: function (value) {
|
134
|
+
// if (this.owner.type === 'user') return 'User';
|
135
|
+
// if (this.owner.type === 'organization') return 'Organization';
|
136
|
+
// },
|
137
|
+
// required: true,
|
138
|
+
// },
|
139
|
+
// }
|
134
140
|
}, {
|
135
141
|
timestamps: {
|
136
142
|
currentTime: () => Date.now()
|
@@ -227,8 +233,8 @@ var leftover_model = (mongoose) => {
|
|
227
233
|
const leftover_model$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(leftover_model);
|
228
234
|
const ObjectId = require$$0.Types.ObjectId;
|
229
235
|
const OpenAI = require$$3;
|
230
|
-
console.log(process.env.OPENAI_API_KEY);
|
231
236
|
const openai = new OpenAI({
|
237
|
+
organization: process.env.OPENAI_ORG_KEY,
|
232
238
|
apiKey: process.env.OPENAI_API_KEY
|
233
239
|
});
|
234
240
|
const controllerFactory$5 = (db) => {
|
@@ -723,7 +729,12 @@ const controllerFactory$3 = (db) => {
|
|
723
729
|
const getCategories = async (req, res) => {
|
724
730
|
console.log(Category);
|
725
731
|
try {
|
726
|
-
|
732
|
+
let query = {};
|
733
|
+
let options = {};
|
734
|
+
if (req.query.status) {
|
735
|
+
query.status = req.query.status;
|
736
|
+
}
|
737
|
+
const categories = await Category.find(query, null, options).sort({ "order": "asc" }).exec();
|
727
738
|
if (!categories) {
|
728
739
|
return res.status(404).send({ message: "Categories not found." });
|
729
740
|
}
|
@@ -734,22 +745,21 @@ const controllerFactory$3 = (db) => {
|
|
734
745
|
}
|
735
746
|
};
|
736
747
|
const updateCategories = async (req, res) => {
|
748
|
+
console.log(req.body);
|
737
749
|
try {
|
738
|
-
const
|
739
|
-
|
740
|
-
{ url: categoryUpdated.url },
|
741
|
-
{ $set: categoryUpdated },
|
742
|
-
|
743
|
-
).exec();
|
744
|
-
if (!category) {
|
745
|
-
throw new Error("Categories is not updated.");
|
750
|
+
const bulkOps = req.body.map((categoryUpdated) => ({
|
751
|
+
updateOne: {
|
752
|
+
filter: { url: categoryUpdated.url },
|
753
|
+
update: { $set: categoryUpdated },
|
754
|
+
upsert: false
|
746
755
|
}
|
747
|
-
});
|
748
|
-
await
|
749
|
-
console.log("
|
756
|
+
}));
|
757
|
+
const result = await Category.bulkWrite(bulkOps, { ordered: false });
|
758
|
+
console.log("Success", result);
|
750
759
|
res.status(200).send({ message: "Categories updated successfully." });
|
751
760
|
} catch (err) {
|
752
|
-
|
761
|
+
console.error("Error processing bulk update", err);
|
762
|
+
res.status(500).send({ message: err.message });
|
753
763
|
}
|
754
764
|
};
|
755
765
|
const getCategory = async (req, res) => {
|
@@ -765,6 +775,8 @@ const controllerFactory$3 = (db) => {
|
|
765
775
|
};
|
766
776
|
const addCategory = async (req, res) => {
|
767
777
|
try {
|
778
|
+
const highestOrderDoc = await Category.findOne().sort("-order");
|
779
|
+
req.body.order = highestOrderDoc ? highestOrderDoc.order + 1 : 1;
|
768
780
|
const category = await Category.create(req.body);
|
769
781
|
if (!category) {
|
770
782
|
return res.status(404).send({ message: "Category is not created." });
|
package/dist/products.server.mjs
CHANGED
@@ -79,6 +79,16 @@ var category_model = (mongoose) => {
|
|
79
79
|
required: true,
|
80
80
|
trim: true
|
81
81
|
},
|
82
|
+
status: {
|
83
|
+
type: String,
|
84
|
+
enum: ["draft", "internal", "published", "removed"],
|
85
|
+
default: "draft",
|
86
|
+
required: true
|
87
|
+
},
|
88
|
+
order: {
|
89
|
+
type: Number,
|
90
|
+
required: true
|
91
|
+
},
|
82
92
|
url: {
|
83
93
|
type: String,
|
84
94
|
required: true,
|
@@ -92,43 +102,39 @@ var category_model = (mongoose) => {
|
|
92
102
|
},
|
93
103
|
filters: {
|
94
104
|
type: Array
|
95
|
-
},
|
96
|
-
owner: {
|
97
|
-
type: {
|
98
|
-
type: String,
|
99
|
-
required: true
|
100
|
-
},
|
101
|
-
target: {
|
102
|
-
type: mongoose.Schema.Types.ObjectId,
|
103
|
-
ref: function(value) {
|
104
|
-
if (this.owner.type === "user")
|
105
|
-
return "User";
|
106
|
-
if (this.owner.type === "organization")
|
107
|
-
return "Organization";
|
108
|
-
},
|
109
|
-
required: true
|
110
|
-
}
|
111
|
-
},
|
112
|
-
creator: {
|
113
|
-
hidden: {
|
114
|
-
type: Boolean,
|
115
|
-
required: true
|
116
|
-
},
|
117
|
-
type: {
|
118
|
-
type: String,
|
119
|
-
required: true
|
120
|
-
},
|
121
|
-
target: {
|
122
|
-
type: mongoose.Schema.Types.ObjectId,
|
123
|
-
ref: function(value) {
|
124
|
-
if (this.owner.type === "user")
|
125
|
-
return "User";
|
126
|
-
if (this.owner.type === "organization")
|
127
|
-
return "Organization";
|
128
|
-
},
|
129
|
-
required: true
|
130
|
-
}
|
131
105
|
}
|
106
|
+
// owner: {
|
107
|
+
// type: {
|
108
|
+
// type: String,
|
109
|
+
// required: true
|
110
|
+
// },
|
111
|
+
// target: {
|
112
|
+
// type: mongoose.Schema.Types.ObjectId,
|
113
|
+
// ref: function (value) {
|
114
|
+
// if (this.owner.type === 'user') return 'User';
|
115
|
+
// if (this.owner.type === 'organization') return 'Organization';
|
116
|
+
// },
|
117
|
+
// required: true,
|
118
|
+
// },
|
119
|
+
// },
|
120
|
+
// creator: {
|
121
|
+
// hidden: {
|
122
|
+
// type: Boolean,
|
123
|
+
// required: true
|
124
|
+
// },
|
125
|
+
// type: {
|
126
|
+
// type: String,
|
127
|
+
// required: true
|
128
|
+
// },
|
129
|
+
// target: {
|
130
|
+
// type: mongoose.Schema.Types.ObjectId,
|
131
|
+
// ref: function (value) {
|
132
|
+
// if (this.owner.type === 'user') return 'User';
|
133
|
+
// if (this.owner.type === 'organization') return 'Organization';
|
134
|
+
// },
|
135
|
+
// required: true,
|
136
|
+
// },
|
137
|
+
// }
|
132
138
|
}, {
|
133
139
|
timestamps: {
|
134
140
|
currentTime: () => Date.now()
|
@@ -225,8 +231,8 @@ var leftover_model = (mongoose) => {
|
|
225
231
|
const leftover_model$1 = /* @__PURE__ */ getDefaultExportFromCjs(leftover_model);
|
226
232
|
const ObjectId = require$$0.Types.ObjectId;
|
227
233
|
const OpenAI = require$$3;
|
228
|
-
console.log(process.env.OPENAI_API_KEY);
|
229
234
|
const openai = new OpenAI({
|
235
|
+
organization: process.env.OPENAI_ORG_KEY,
|
230
236
|
apiKey: process.env.OPENAI_API_KEY
|
231
237
|
});
|
232
238
|
const controllerFactory$5 = (db) => {
|
@@ -721,7 +727,12 @@ const controllerFactory$3 = (db) => {
|
|
721
727
|
const getCategories = async (req, res) => {
|
722
728
|
console.log(Category);
|
723
729
|
try {
|
724
|
-
|
730
|
+
let query = {};
|
731
|
+
let options = {};
|
732
|
+
if (req.query.status) {
|
733
|
+
query.status = req.query.status;
|
734
|
+
}
|
735
|
+
const categories = await Category.find(query, null, options).sort({ "order": "asc" }).exec();
|
725
736
|
if (!categories) {
|
726
737
|
return res.status(404).send({ message: "Categories not found." });
|
727
738
|
}
|
@@ -732,22 +743,21 @@ const controllerFactory$3 = (db) => {
|
|
732
743
|
}
|
733
744
|
};
|
734
745
|
const updateCategories = async (req, res) => {
|
746
|
+
console.log(req.body);
|
735
747
|
try {
|
736
|
-
const
|
737
|
-
|
738
|
-
{ url: categoryUpdated.url },
|
739
|
-
{ $set: categoryUpdated },
|
740
|
-
|
741
|
-
).exec();
|
742
|
-
if (!category) {
|
743
|
-
throw new Error("Categories is not updated.");
|
748
|
+
const bulkOps = req.body.map((categoryUpdated) => ({
|
749
|
+
updateOne: {
|
750
|
+
filter: { url: categoryUpdated.url },
|
751
|
+
update: { $set: categoryUpdated },
|
752
|
+
upsert: false
|
744
753
|
}
|
745
|
-
});
|
746
|
-
await
|
747
|
-
console.log("
|
754
|
+
}));
|
755
|
+
const result = await Category.bulkWrite(bulkOps, { ordered: false });
|
756
|
+
console.log("Success", result);
|
748
757
|
res.status(200).send({ message: "Categories updated successfully." });
|
749
758
|
} catch (err) {
|
750
|
-
|
759
|
+
console.error("Error processing bulk update", err);
|
760
|
+
res.status(500).send({ message: err.message });
|
751
761
|
}
|
752
762
|
};
|
753
763
|
const getCategory = async (req, res) => {
|
@@ -763,6 +773,8 @@ const controllerFactory$3 = (db) => {
|
|
763
773
|
};
|
764
774
|
const addCategory = async (req, res) => {
|
765
775
|
try {
|
776
|
+
const highestOrderDoc = await Category.findOne().sort("-order");
|
777
|
+
req.body.order = highestOrderDoc ? highestOrderDoc.order + 1 : 1;
|
766
778
|
const category = await Category.create(req.body);
|
767
779
|
if (!category) {
|
768
780
|
return res.status(404).send({ message: "Category is not created." });
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
|
@@ -1,225 +1,4 @@
|
|
1
|
-
|
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
|
-
};
|
1
|
+
const e = "";
|
223
2
|
export {
|
224
|
-
|
3
|
+
e as default
|
225
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";
|
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: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;
|