@ozdao/martyrs 0.2.539 → 0.2.541
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{globals.verifier-CJ1lr-NW.cjs → globals.verifier-Bi-XLEi9.cjs} +24 -23
- package/dist/{globals.verifier-BhqUrneb.js → globals.verifier-gPPX_jhf.js} +24 -23
- package/dist/inventory.server.cjs +1 -1
- package/dist/inventory.server.js +1 -1
- package/dist/{main-Zhs0EqRp.cjs → main-7IA3UHca.cjs} +6 -6
- package/dist/{main-gOfhekZG.js → main-BpBtIUcJ.js} +549 -549
- package/dist/martyrs/src/components/Button/Button.vue.cjs +1 -1
- package/dist/martyrs/src/components/Button/Button.vue.js +1 -1
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs → Dropdown.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Dropdown/Dropdown.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.js → Dropdown.vue2.js} +2 -2
- package/dist/martyrs/src/components/Dropdown/{Dropdown.vue.cjs.map → Dropdown.vue2.js.map} +1 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue.cjs +0 -93
- package/dist/martyrs/src/components/EditImages/EditImages.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue.js +1 -94
- package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.cjs +93 -0
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.cjs.map +1 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.js +94 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +1 -1
- package/dist/martyrs/src/components/Feed/Carousel.vue.cjs +1 -1
- package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs +3 -3
- package/dist/martyrs/src/components/Feed/Feed.vue.js +3 -3
- package/dist/martyrs/src/components/FieldTags/create-tags.cjs +11 -2
- package/dist/martyrs/src/components/FieldTags/create-tags.cjs.map +1 -1
- package/dist/martyrs/src/components/FieldTags/create-tags.js +11 -2
- package/dist/martyrs/src/components/FieldTags/create-tags.js.map +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue.cjs → Loader.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Loader/Loader.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Loader/{Loader.vue.js → Loader.vue2.js} +2 -2
- package/dist/martyrs/src/components/Loader/{Loader.vue.cjs.map → Loader.vue2.js.map} +1 -1
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue.cjs → Menu.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/store/auth.cjs +0 -2
- package/dist/martyrs/src/modules/auth/views/store/auth.cjs.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/auth.js +0 -2
- package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +3 -3
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +3 -3
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/globals.client.cjs +0 -3
- package/dist/martyrs/src/modules/globals/globals.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/globals.client.js +0 -3
- package/dist/martyrs/src/modules/globals/globals.client.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.app.cjs +31 -41
- package/dist/martyrs/src/modules/globals/views/classes/globals.app.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.app.js +31 -41
- package/dist/martyrs/src/modules/globals/views/classes/globals.app.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/module-registry.cjs +0 -3
- package/dist/martyrs/src/modules/globals/views/classes/module-registry.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/module-registry.js +0 -3
- package/dist/martyrs/src/modules/globals/views/classes/module-registry.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/store.cjs +0 -5
- package/dist/martyrs/src/modules/globals/views/classes/store.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/store.js +0 -5
- package/dist/martyrs/src/modules/globals/views/classes/store.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +2 -2
- package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +2 -2
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/sections/{Filters.vue.cjs → Filters.vue2.cjs} +2 -2
- package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.cjs.map +1 -0
- package/dist/martyrs/src/modules/globals/views/components/sections/{Filters.vue.js → Filters.vue2.js} +2 -2
- package/dist/martyrs/src/modules/globals/views/components/sections/{Filters.vue.cjs.map → Filters.vue2.js.map} +1 -1
- package/dist/martyrs/src/modules/globals/views/store/globals.cjs +2 -2
- package/dist/martyrs/src/modules/globals/views/store/globals.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/store/globals.js +2 -2
- package/dist/martyrs/src/modules/globals/views/store/globals.js.map +1 -1
- package/dist/martyrs/src/modules/globals/views/utils/vue-app-renderer.cjs +7 -3
- package/dist/martyrs/src/modules/globals/views/utils/vue-app-renderer.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/utils/vue-app-renderer.js +7 -3
- package/dist/martyrs/src/modules/globals/views/utils/vue-app-renderer.js.map +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.cjs +2 -2
- package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.cjs +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +3 -3
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +4 -4
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +4 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.cjs +4 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +4 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +4 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +4 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +4 -4
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +4 -4
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Image360.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +19 -3
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +19 -3
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
- package/dist/martyrs/src/modules/products/store/categories.cjs +4 -0
- package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.js +4 -0
- package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.cjs +1 -1
- package/dist/music.server.js +1 -1
- package/dist/orders.server.cjs +1 -1
- package/dist/orders.server.js +1 -1
- package/dist/organizations.server.cjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/products.server.cjs +10 -2
- package/dist/products.server.js +10 -2
- package/dist/rents.server.cjs +1 -1
- package/dist/rents.server.js +1 -1
- package/dist/{web-bMa0DMyG.cjs → web-C9bVm6Nw.cjs} +1 -1
- package/dist/{web-DxxU2bwy.js → web-DsdyXC8n.js} +1 -1
- package/package.json +1 -1
- package/src/components/FieldTags/FieldTagsNew.vue +366 -0
- package/src/components/FieldTags/README.md +513 -0
- package/src/components/FieldTags/create-tags.js +15 -2
- package/src/modules/auth/views/store/auth.js +0 -2
- package/src/modules/globals/controllers/classes/globals.validator.js +24 -23
- package/src/modules/globals/globals.client.js +0 -3
- package/src/modules/globals/views/classes/globals.app.js +21 -34
- package/src/modules/globals/views/classes/module-registry.js +0 -3
- package/src/modules/globals/views/classes/store.js +0 -7
- package/src/modules/globals/views/store/globals.js +2 -2
- package/src/modules/globals/views/utils/vue-app-renderer.js +11 -3
- package/src/modules/products/components/pages/CategoryEdit.vue +20 -0
- package/src/modules/products/middlewares/categories.verifier.js +9 -1
- package/src/modules/products/store/categories.js +5 -0
- package/dist/martyrs/src/components/Dropdown/Dropdown.vue.js.map +0 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
- package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue.js.map +0 -1
|
@@ -50,15 +50,8 @@ export function createUniversalApp({
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
// Основная функция создания приложения
|
|
53
|
-
|
|
53
|
+
function createApp() {
|
|
54
54
|
const store = getStore();
|
|
55
|
-
console.log('[DEBUG createApp] store created:', !!store);
|
|
56
|
-
|
|
57
|
-
// Установить SSR store для useStore
|
|
58
|
-
if (typeof window === 'undefined') {
|
|
59
|
-
const { setSSRStore } = await import('./store.js');
|
|
60
|
-
setSSRStore(store);
|
|
61
|
-
}
|
|
62
55
|
const app = process.env.MOBILE_APP
|
|
63
56
|
? createVueApp(layoutApp, config)
|
|
64
57
|
: createVueSSRApp(layoutApp, config);
|
|
@@ -84,10 +77,8 @@ export function createUniversalApp({
|
|
|
84
77
|
|
|
85
78
|
for (const moduleName of criticalModules) {
|
|
86
79
|
try {
|
|
87
|
-
console.log(`[DEBUG] Loading module ${moduleName}, context.store:`, !!context.store);
|
|
88
80
|
await moduleRegistry.load(moduleName, context);
|
|
89
81
|
await moduleRegistry.initialize(moduleName, context);
|
|
90
|
-
console.log(`[DEBUG] Module ${moduleName} initialized, store.${moduleName}:`, !!context.store[moduleName]);
|
|
91
82
|
} catch (error) {
|
|
92
83
|
console.error(`Failed to load critical module ${moduleName}:`, error);
|
|
93
84
|
}
|
|
@@ -202,7 +193,12 @@ export function createUniversalApp({
|
|
|
202
193
|
// FOR SSR / SERVER ENTRY
|
|
203
194
|
async function renderApp({ url, cookies, languages, ssrContext }) {
|
|
204
195
|
const { app, router, store, i18n, meta, moduleRegistry } = await createApp();
|
|
205
|
-
|
|
196
|
+
|
|
197
|
+
// Set SSR store for useStore calls
|
|
198
|
+
if (typeof window === 'undefined') {
|
|
199
|
+
const { setSSRStore } = await import('./store.js');
|
|
200
|
+
setSSRStore(store);
|
|
201
|
+
}
|
|
206
202
|
|
|
207
203
|
|
|
208
204
|
// if (typeof window === 'undefined') {
|
|
@@ -271,26 +267,18 @@ export function createUniversalApp({
|
|
|
271
267
|
|
|
272
268
|
// FOR SSR / CLIENT ENTRY
|
|
273
269
|
if (typeof window !== 'undefined' && !process.env.MOBILE_APP) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
hooks.afterHydration({ app, router, store, moduleRegistry });
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// Создаем context для загрузки модулей
|
|
290
|
-
const context = { app, store, router, config };
|
|
291
|
-
|
|
292
|
-
// Загружаем auth модуль сразу - он критичен
|
|
293
|
-
moduleRegistry.load('auth', context).then(() => {
|
|
270
|
+
// Используем renderAndMountApp для правильной гидратации со state
|
|
271
|
+
appRenderer.renderAndMountApp({ createApp, hooks }).then(({ app, router, store, moduleRegistry }) => {
|
|
272
|
+
// Хук ПОСЛЕ гидратации
|
|
273
|
+
if (hooks.afterHydration) {
|
|
274
|
+
hooks.afterHydration({ app, router, store, moduleRegistry });
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Создаем context для загрузки модулей
|
|
278
|
+
const context = { app, store, router, config };
|
|
279
|
+
|
|
280
|
+
// Загружаем auth модуль сразу - он критичен
|
|
281
|
+
moduleRegistry.load('auth', context).then(() => {
|
|
294
282
|
// Загружаем важные модули в следующем тике
|
|
295
283
|
setTimeout(async () => {
|
|
296
284
|
try {
|
|
@@ -315,9 +303,8 @@ export function createUniversalApp({
|
|
|
315
303
|
console.error('Error loading non-critical modules:', error);
|
|
316
304
|
}
|
|
317
305
|
});
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
});
|
|
306
|
+
}).catch(error => {
|
|
307
|
+
console.error('Error loading auth module:', error);
|
|
321
308
|
});
|
|
322
309
|
}).catch(error => {
|
|
323
310
|
console.error('Hydration failed:', error);
|
|
@@ -97,11 +97,8 @@ export class ModuleRegistry {
|
|
|
97
97
|
// Инициализируем модуль
|
|
98
98
|
// Поддерживаем оба варианта: module.initialize и module.default.initialize для обратной совместимости
|
|
99
99
|
const initFunc = module.initialize || (module.default && module.default.initialize);
|
|
100
|
-
console.log(`[DEBUG registry] Module ${name} initFunc found:`, !!initFunc);
|
|
101
100
|
if (initFunc) {
|
|
102
|
-
console.log(`[DEBUG registry] Calling initialize for ${name}`);
|
|
103
101
|
await initFunc(app, store, router, config);
|
|
104
|
-
console.log(`[DEBUG registry] Module ${name} initialize completed`);
|
|
105
102
|
}
|
|
106
103
|
|
|
107
104
|
this.initialized.set(name, true);
|
|
@@ -20,25 +20,18 @@ export function createStore() {
|
|
|
20
20
|
return initialState;
|
|
21
21
|
},
|
|
22
22
|
async setInitialState(initialState, isHydration = false) {
|
|
23
|
-
console.time('[PERF] Store.setInitialState');
|
|
24
23
|
const modules = Object.entries(initialState);
|
|
25
|
-
console.log(`[PERF] Setting initial state for ${modules.length} modules (hydration: ${isHydration})`);
|
|
26
24
|
|
|
27
25
|
for (const [moduleName, moduleState] of modules) {
|
|
28
26
|
if (this[moduleName] && this[moduleName].state) {
|
|
29
|
-
console.time(`[PERF] Merge state: ${moduleName}`);
|
|
30
|
-
|
|
31
27
|
// При гидратации просто заменяем state целиком для скорости
|
|
32
28
|
if (isHydration) {
|
|
33
29
|
Object.assign(this[moduleName].state, moduleState);
|
|
34
30
|
} else {
|
|
35
31
|
mergeReactive(this[moduleName].state, moduleState);
|
|
36
32
|
}
|
|
37
|
-
|
|
38
|
-
console.timeEnd(`[PERF] Merge state: ${moduleName}`);
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
|
-
console.timeEnd('[PERF] Store.setInitialState');
|
|
42
35
|
}
|
|
43
36
|
});
|
|
44
37
|
|
|
@@ -162,7 +162,7 @@ function setError(error) {
|
|
|
162
162
|
if (error?.response?.data) errorData = error.response.data;
|
|
163
163
|
|
|
164
164
|
// Обработка ошибок верификации
|
|
165
|
-
if (errorData?.error === 'VALIDATION_ERROR' && errorData?.errors) {
|
|
165
|
+
if ((errorData?.error === 'VALIDATION_ERROR' || errorData?.errors) && errorData?.errors) {
|
|
166
166
|
// Собираем все сообщения об ошибках в одну строку
|
|
167
167
|
const errorMessages = [];
|
|
168
168
|
for (const field in errorData.errors) {
|
|
@@ -173,7 +173,7 @@ function setError(error) {
|
|
|
173
173
|
errorMessages.push(fieldErrors);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
state.error.message = errorMessages.join(', ') || 'Validation error';
|
|
176
|
+
state.error.message = errorMessages.join(', ') || errorData.message || 'Validation error';
|
|
177
177
|
} else if (error && errorData.errorCode) {
|
|
178
178
|
// state.error.message = i18n.global.t(`errors.${errorData.errorCode}`);
|
|
179
179
|
state.error.message = errorData.errorCode;
|
|
@@ -2,9 +2,14 @@ import { setAuthToken } from '@martyrs/src/modules/globals/views/utils/axios-ins
|
|
|
2
2
|
import { renderSSRHead } from '@unhead/ssr';
|
|
3
3
|
import { renderToString } from '@vue/server-renderer';
|
|
4
4
|
|
|
5
|
-
export function renderAndMountApp({ createApp }) {
|
|
5
|
+
export function renderAndMountApp({ createApp, hooks = {} }) {
|
|
6
6
|
const start = async () => {
|
|
7
|
-
const { app, router, store } = createApp();
|
|
7
|
+
const { app, router, store, moduleRegistry } = await createApp();
|
|
8
|
+
|
|
9
|
+
// Call beforeHydration hook if provided
|
|
10
|
+
if (hooks.beforeHydration) {
|
|
11
|
+
hooks.beforeHydration({ app, router, store, moduleRegistry });
|
|
12
|
+
}
|
|
8
13
|
|
|
9
14
|
let initialState;
|
|
10
15
|
|
|
@@ -58,8 +63,11 @@ export function renderAndMountApp({ createApp }) {
|
|
|
58
63
|
await router.isReady();
|
|
59
64
|
|
|
60
65
|
app.mount('#app');
|
|
66
|
+
|
|
67
|
+
// Return the objects for further use
|
|
68
|
+
return { app, router, store, moduleRegistry };
|
|
61
69
|
};
|
|
62
|
-
start();
|
|
70
|
+
return start();
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
export async function render({ url, cookies, ssrContext, createApp}) {
|
|
@@ -224,6 +224,16 @@
|
|
|
224
224
|
? categories.state.current.owner.target._id
|
|
225
225
|
: categories.state.current.owner.target
|
|
226
226
|
}
|
|
227
|
+
|
|
228
|
+
// Очищаем filters от tiClasses перед отправкой
|
|
229
|
+
if (categories.state.current.filters) {
|
|
230
|
+
categories.state.current.filters = categories.state.current.filters.map(filter => ({
|
|
231
|
+
...filter,
|
|
232
|
+
options: filter.options ? filter.options.map(opt =>
|
|
233
|
+
typeof opt === 'string' ? opt : opt.text
|
|
234
|
+
) : []
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
227
237
|
|
|
228
238
|
await categories.actions.update(categories.state.current)
|
|
229
239
|
|
|
@@ -241,6 +251,16 @@
|
|
|
241
251
|
hidden: false,
|
|
242
252
|
target: route.params._id ? route.params._id : null
|
|
243
253
|
}
|
|
254
|
+
|
|
255
|
+
// Очищаем filters от tiClasses перед отправкой
|
|
256
|
+
if (categories.state.current.filters) {
|
|
257
|
+
categories.state.current.filters = categories.state.current.filters.map(filter => ({
|
|
258
|
+
...filter,
|
|
259
|
+
options: filter.options ? filter.options.map(opt =>
|
|
260
|
+
typeof opt === 'string' ? opt : opt.text
|
|
261
|
+
) : []
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
244
264
|
|
|
245
265
|
await categories.actions.create(categories.state.current)
|
|
246
266
|
redirectTo()
|
|
@@ -79,7 +79,15 @@ export default (function (db) {
|
|
|
79
79
|
slug: { rule: 'optional', validator: Validator.schema().string() },
|
|
80
80
|
parent: { rule: 'optional', validator: Validator.schema().oneOfTypes(['string', 'null']) },
|
|
81
81
|
localization: { rule: 'optional' },
|
|
82
|
-
filters: {
|
|
82
|
+
filters: {
|
|
83
|
+
rule: 'optional',
|
|
84
|
+
validator: Validator.schema().array().items(
|
|
85
|
+
Validator.schema().object({
|
|
86
|
+
name: Validator.schema().string(),
|
|
87
|
+
options: Validator.schema().array().items(Validator.schema().string())
|
|
88
|
+
})
|
|
89
|
+
)
|
|
90
|
+
},
|
|
83
91
|
owner: {
|
|
84
92
|
rule: 'optional',
|
|
85
93
|
validator: Validator.schema().object({
|
|
@@ -36,6 +36,11 @@ const actions = {
|
|
|
36
36
|
const response = await $axios.get('/api/categories', { params: options });
|
|
37
37
|
|
|
38
38
|
if (options._id) {
|
|
39
|
+
// Проверяем что приходит с сервера
|
|
40
|
+
console.log('Category data from server:', response.data[0]);
|
|
41
|
+
if (response.data[0].filters) {
|
|
42
|
+
console.log('Filters:', response.data[0].filters);
|
|
43
|
+
}
|
|
39
44
|
state.current = { ...response.data[0] };
|
|
40
45
|
return Promise.resolve(response.data[0]);
|
|
41
46
|
} else {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.vue.js","sources":["../../../../../src/components/Dropdown/Dropdown.vue"],"sourcesContent":["<template>\n <div class=\"dropdown pos-relative\" v-click-outside=\"clickedOutside\" @click.stop=\"isOpen = !isOpen\">\n <div v-if=\"isComponentLabel\" class=\"w-100 h-100 flex-center flex\">\n <component :is=\"label.component\" v-bind=\"label.props\" :class=\"label.class\"></component>\n </div>\n <div v-else>\n {{ label }}\n </div>\n <transition name=\"TransitionTranslateY\" mode=\"out-in\">\n <div \n v-show=\"isOpen\" \n :style=\"{ left: align === 'left' ? '0' : 'auto', right: align === 'right' ? '0' : 'auto' }\" \n class=\"dropdown-content radius-big\" \n >\n <slot></slot>\n </div>\n </transition>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed } from 'vue';\nimport clickOutside from '../FieldPhone/click-outside.js';\n\nlet vClickOutside = clickOutside\n\nconst props = defineProps({\n label: {\n type: [String, Object],\n default: 'Open'\n },\n align: {\n type: String,\n default: 'left'\n }\n})\n\nconst isOpen = ref(false);\nconst isComponentLabel = computed(() => typeof props.label === 'object');\n\nfunction clickedOutside () {\n isOpen.value = false\n}\n</script>\n\n<style >\n.dropdown-content {\n display: block;\n position: absolute;\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n z-index: 1;\n}\n\n/*.dropdown:hover .dropdown-content {\n display: block;\n}*/\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,QAAI,gBAAgB;AAEpB,UAAM,QAAQ;AAWd,UAAM,SAAS,IAAI,KAAK;AACxB,UAAM,mBAAmB,SAAS,MAAM,OAAO,MAAM,UAAU,QAAQ;AAEvE,aAAS,iBAAkB;AACzB,aAAO,QAAQ;AAAA,IACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.vue.js","sources":["../../../../../src/components/Loader/Loader.vue"],"sourcesContent":["<template>\n <div class=\"circular-loader pos-relative z-index-1 w-100 h-100 w-max-2r h-max-2r\" :class=\"{ 'circular-loader-centered': centered }\">\n <svg viewBox=\"25 25 50 50\">\n <circle class=\"circular-loader-fill\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n <circle class=\"circular-loader-circle\" cx=\"50\" cy=\"50\" r=\"20\" fill=\"none\" stroke-width=\"4\" stroke-miterlimit=\"10\" />\n </svg>\n <div v-if=\"progress\" class=\"progress-text\">{{ progress }}</div>\n <div v-if=\"status\" class=\"uppercase t-semi w-m-10r status-text\">{{ status }}</div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n progress: {\n type: Number,\n default: null,\n },\n status: {\n type: String,\n default: null,\n },\n centered: {\n type: Boolean,\n default: true, // По умолчанию лоадер центрирован (для обратной совместимости)\n },\n },\n};\n</script>\n\n<style>\n.circular-loader-centered {\n top: calc(50% - 1rem);\n left: calc(50% - 1rem);\n}\n\n.circular-loader svg {\n animation: rotate 2s linear infinite;\n}\n\n.circular-loader-circle {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n stroke-linecap: round;\n stroke: rgb(var(--main));\n animation: dash 1.5s ease-in-out infinite;\n}\n\n.circular-loader-fill {\n stroke-linecap: round;\n stroke: rgba(var(--black),0.2);\n}\n\n.progress-text {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.8rem;\n color: rgb(var(--main));;\n}\n\n.status-text {\n position: absolute;\n top: 120%;\n left: calc(50% - 5rem);\n font-size: 0.8rem;\n width: 10rem !important;\n text-align: center;\n}\n\n@keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes dash {\n 0% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 89, 200;\n stroke-dashoffset: -35;\n }\n 100% {\n stroke-dasharray: 1, 200;\n stroke-dashoffset: -124;\n }\n}\n</style>"],"names":["_createElementBlock","_normalizeClass","_createElementVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;AAYA,MAAK,YAAU;AAAA,EACb,OAAO;AAAA,IACL,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA;IAEX,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA;;AAGf;;EA3BA,KAAA;AAAA,EAMyB,OAAM;;;EAN/B,KAAA;AAAA,EAOuB,OAAM;;;sBAN3BA,mBAOM,OAAA;AAAA,IAPD,OADPC,eAAA,CACa,wEAAsE,EAAA,4BAAuC,OAAA,UAAQ,CAAA;AAAA;8BAC9HC,mBAGM,OAAA,EAHD,SAAQ,iBAAa;AAAA,MACxBA,mBAAkH,UAAA;AAAA,QAA1G,OAAM;AAAA,QAAuB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;MAC3GA,mBAAoH,UAAA;AAAA,QAA5G,OAAM;AAAA,QAAyB,IAAG;AAAA,QAAK,IAAG;AAAA,QAAK,GAAE;AAAA,QAAK,MAAK;AAAA,QAAO,gBAAa;AAAA,QAAI,qBAAkB;AAAA;;IAEpG,OAAA,yBAAXF,mBAA+D,OAA/D,YAA+DG,gBAAjB,OAAA,QAAQ,GAAA,CAAA,KAN1DC,mBAAA,IAAA,IAAA;AAAA,IAOe,OAAA,uBAAXJ,mBAAkF,OAAlF,YAAkFG,gBAAf,OAAA,MAAM,GAAA,CAAA,KAP7EC,mBAAA,IAAA,IAAA;AAAA;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Filters.vue.js","sources":["../../../../../../../../src/modules/globals/views/components/sections/Filters.vue"],"sourcesContent":["<template>\n <div class=\"flex t-nowrap gap-thin\">\n <!-- All Filters Button -->\n <button\n @click=\"showAllFilters = true\"\n class=\"pd-small radius-medium bg-light flex-v-center flex gap-micro cursor-pointer\"\n :class=\"{ 'bg-main': activeFiltersCount > 0 }\"\n >\n <IconFilter class=\"i-medium\" />\n <span class=\"h-1r\"></span>\n <span v-if=\"activeFiltersCount\">{{ activeFiltersCount }}</span>\n </button>\n\n <!-- Individual Filter Buttons -->\n <button\n v-for=\"filter in filters\"\n :key=\"filter.value\"\n @click=\"openFilter(filter.value)\"\n class=\"pd-small radius-medium bg-light cursor-pointer flex-v-center flex gap-micro\"\n :class=\"{ 'selected bg-main': isFilterActive(filter) }\"\n >\n <IconCalendar v-if=\"filter.type === 'date'\" class=\"mn-r-micro i-medium\" />\n <span class=\"t-nowrap\">{{ filter.type === 'date' && getFilterValue(filter) ? formatFilterValue(filter) : filter.title }}</span>\n <span v-if=\"getFilterValue(filter) && filter.type !== 'date'\" class=\"mn-l-micro\">\n {{ formatFilterValue(filter) }}\n </span>\n </button>\n\n <!-- All Filters Popup -->\n <Popup\n :isPopupOpen=\"showAllFilters\"\n @close-popup=\"showAllFilters = false\"\n :align=\"isPhone() ? 'bottom center' : 'center center'\"\n class=\"w-min-20r bg-white radius-medium mobile:radius-zero mobile:radius-tr-medium mobile:radius-tl-medium mobile:w-100 pd-medium\"\n >\n <div class=\"flex-v-center flex-nowrap flex mn-b-medium\">\n <h3 class=\"flex-child-full\">Filters</h3>\n </div>\n\n <div class=\"filters-content\">\n <div \n v-for=\"filter in filters\" \n :key=\"filter.value\"\n class=\"mn-b-medium\"\n >\n <h4 class=\"mn-b-small\">{{ filter.title }}</h4>\n \n <!-- Checkbox Filter -->\n <div v-if=\"filter.type === 'checkbox'\">\n <Checkbox\n v-for=\"option in filter.options\"\n :key=\"option.value\"\n :label=\"option.label\"\n :value=\"option.value\"\n v-model:radio=\"tempSelected[filter.value]\"\n mode=\"checkbox\"\n class=\"mn-b-micro\"\n />\n </div>\n\n <!-- Radio Filter -->\n <div v-else-if=\"filter.type === 'radio'\">\n <div\n v-for=\"option in filter.options\"\n :key=\"option.value\"\n @click=\"tempSelected[filter.value] = option.value\"\n class=\"pd-small radius-small cursor-pointer mn-b-micro\"\n :class=\"{ \n 'bg-main': tempSelected[filter.value] === option.value,\n 'bg-light': tempSelected[filter.value] !== option.value\n }\"\n >\n {{ option.label }}\n </div>\n </div>\n\n <!-- Range Filter -->\n <div v-else-if=\"filter.type === 'range'\" class=\"flex gap-thin\">\n <Field\n v-model:field=\"tempSelected[filter.value].min\"\n :placeholder=\"filter.minPlaceholder || 'Min'\"\n type=\"number\"\n :label=\"returnCurrency()\"\n class=\"w-50 bg-light pd-small radius-small\"\n />\n <Field\n v-model:field=\"tempSelected[filter.value].max\"\n :placeholder=\"filter.maxPlaceholder || 'Max'\"\n type=\"number\"\n :label=\"returnCurrency()\"\n class=\"w-50 bg-light pd-small radius-small\"\n />\n </div>\n\n <!-- Date Filter -->\n <div v-else-if=\"filter.type === 'date'\">\n <Calendar\n v-model:date=\"tempSelected[filter.value]\"\n :allowRange=\"true\"\n :disablePastDates=\"true\"\n class=\"bg-light radius-small\"\n />\n </div>\n </div>\n </div>\n\n <div class=\"flex gap-thin mn-t-medium\">\n <button \n @click=\"applyAllFilters\" \n class=\"button bg-main flex-child-full\"\n >\n Apply\n </button>\n <button \n @click=\"resetFilters\" \n class=\"button bg-light\"\n >\n Reset Filters\n </button>\n </div>\n </Popup>\n\n <!-- Individual Filter Popups -->\n <Popup\n v-for=\"filter in filters\"\n :key=\"`popup-${filter.value}`\"\n :isPopupOpen=\"individualPopups[filter.value]\"\n @close-popup=\"individualPopups[filter.value] = false\"\n :align=\"isPhone() ? 'bottom center' : 'center center'\"\n class=\"bg-white radius-medium mobile:radius-zero mobile:radius-tr-medium mobile:radius-tl-medium mobile:w-100 pd-medium\"\n >\n <h4 class=\"mn-b-medium\">{{ filter.title }}</h4>\n \n <!-- Checkbox Filter -->\n <div v-if=\"filter.type === 'checkbox'\">\n <Checkbox\n v-for=\"option in filter.options\"\n :key=\"option.value\"\n :label=\"option.label\"\n :value=\"option.value\"\n v-model:radio=\"tempSelected[filter.value]\"\n mode=\"checkbox\"\n class=\"mn-b-micro\"\n />\n </div>\n\n <!-- Radio Filter -->\n <div v-else-if=\"filter.type === 'radio'\">\n <div\n v-for=\"option in filter.options\"\n :key=\"option.value\"\n @click=\"tempSelected[filter.value] = option.value\"\n class=\"pd-small radius-small cursor-pointer mn-b-micro\"\n :class=\"{ \n 'bg-main': tempSelected[filter.value] === option.value,\n 'bg-light': tempSelected[filter.value] !== option.value\n }\"\n >\n {{ option.label }}\n </div>\n </div>\n\n <!-- Range Filter -->\n <div v-else-if=\"filter.type === 'range'\" class=\"flex gap-thin\">\n <Field\n v-model:field=\"tempSelected[filter.value].min\"\n :placeholder=\"filter.minPlaceholder || 'Min'\"\n type=\"number\"\n :label=\"returnCurrency()\"\n class=\"w-50 bg-light pd-small radius-small\"\n />\n <Field\n v-model:field=\"tempSelected[filter.value].max\"\n :placeholder=\"filter.maxPlaceholder || 'Max'\"\n type=\"number\"\n :label=\"returnCurrency()\"\n class=\"w-50 bg-light pd-small radius-small\"\n />\n </div>\n\n <!-- Date Filter -->\n <div v-else-if=\"filter.type === 'date'\">\n <div class=\"mn-t-small\">\n <Calendar\n v-model:date=\"tempSelected[filter.value]\"\n :allowRange=\"true\"\n :disablePastDates=\"true\"\n class=\"bg-light radius-small\"\n />\n </div>\n </div>\n\n <div class=\"flex gap-thin mn-t-medium\">\n <button \n @click=\"cancelFilter(filter.value)\" \n class=\"bg-light button flex-child-full\"\n >\n Cancel\n </button>\n <button \n @click=\"applyFilter(filter.value)\" \n class=\"bg-main w-100 button flex-child-full\"\n >\n Apply\n </button>\n \n \n </div>\n </Popup>\n </div>\n</template>\n\n<script setup>\nimport { ref, computed, reactive, watch } from 'vue'\nimport { useGlobalMixins } from '@martyrs/src/modules/globals/views/mixins/mixins.js'\nimport Popup from '@martyrs/src/components/Popup/Popup.vue'\nimport Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport Calendar from '@martyrs/src/components/Calendar/Calendar.vue'\nimport IconFilter from '@martyrs/src/modules/icons/navigation/IconFilter.vue'\nimport IconCross from '@martyrs/src/modules/icons/navigation/IconCross.vue'\nimport IconCalendar from '@martyrs/src/modules/icons/entities/IconCalendar.vue'\n\nconst filters = defineModel('filters', {\n type: Array,\n required: true\n})\n\nconst selected = defineModel('selected', {\n type: Object,\n default: () => ({})\n})\n\nconst emit = defineEmits(['select'])\n\nconst { formatDate } = useGlobalMixins()\n\n// State\nconst showAllFilters = ref(false)\nconst individualPopups = reactive({})\nconst tempSelected = reactive({})\nconst tempDateRange = ref(null)\n\n// Initialize popups and temp values\nwatch(filters, (newFilters) => {\n newFilters.forEach(filter => {\n individualPopups[filter.value] = false\n \n if (!tempSelected[filter.value]) {\n if (filter.type === 'checkbox') {\n tempSelected[filter.value] = [...(selected.value[filter.value] || [])]\n } else if (filter.type === 'range') {\n tempSelected[filter.value] = { ...(selected.value[filter.value] || { min: '', max: '' }) }\n } else if (filter.type === 'date') {\n tempSelected[filter.value] = selected.value[filter.value] || null\n } else {\n tempSelected[filter.value] = selected.value[filter.value] || null\n }\n }\n })\n}, { immediate: true, deep: true })\n\n// Sync selected to tempSelected\nwatch(selected, (newSelected) => {\n Object.keys(newSelected).forEach(key => {\n const filter = filters.value.find(f => f.value === key)\n if (filter) {\n if (filter.type === 'checkbox') {\n tempSelected[key] = [...(newSelected[key] || [])]\n } else if (filter.type === 'range') {\n tempSelected[key] = { ...(newSelected[key] || { min: '', max: '' }) }\n } else {\n tempSelected[key] = newSelected[key]\n }\n }\n })\n}, { deep: true })\n\n// Computed\nconst activeFiltersCount = computed(() => {\n return Object.entries(selected.value).filter(([key, value]) => {\n if (Array.isArray(value)) return value.length > 0\n if (typeof value === 'object' && value !== null) {\n return value.min || value.max\n }\n return value !== null && value !== undefined\n }).length\n})\n\n// Methods\nconst openFilter = (filterValue) => {\n individualPopups[filterValue] = true\n}\n\nconst isFilterActive = (filter) => {\n const value = selected.value[filter.value]\n if (!value) return false\n if (Array.isArray(value)) return value.length > 0\n if (filter.type === 'range') return value.min || value.max\n return true\n}\n\nconst getFilterValue = (filter) => {\n const value = selected.value[filter.value]\n if (!value) return false\n \n if (filter.type === 'range') {\n return value.min || value.max\n }\n \n if (filter.type === 'date') {\n return value && value.start && value.end\n }\n \n if (Array.isArray(value)) {\n return value.length > 0\n }\n \n return value\n}\n\nconst formatFilterValue = (filter) => {\n const value = selected.value[filter.value]\n if (!value) return ''\n \n if (Array.isArray(value)) {\n return `(${value.length})`\n }\n \n if (filter.type === 'range') {\n if (!value.min && !value.max) return ''\n return `${value.min || '0'}-${value.max || '∞'}`\n }\n \n if (filter.type === 'date') {\n if (!value || !value.start || !value.end) return ''\n return `${formatDate(value.start, { dayMonth: true, language: 'en' })} - ${formatDate(value.end, { dayMonth: true, language: 'en' })}`\n }\n \n if (filter.type === 'radio') {\n const option = filter.options.find(o => o.value === value)\n return option ? `(${option.label})` : ''\n }\n \n return ''\n}\n\nconst applyFilter = (filterValue) => {\n selected.value[filterValue] = tempSelected[filterValue]\n individualPopups[filterValue] = false\n emit('select', { filter: filterValue, value: tempSelected[filterValue] })\n}\n\nconst cancelFilter = (filterValue) => {\n const filter = filters.value.find(f => f.value === filterValue)\n if (filter) {\n if (filter.type === 'checkbox') {\n tempSelected[filterValue] = [...(selected.value[filterValue] || [])]\n } else if (filter.type === 'range') {\n tempSelected[filterValue] = { ...(selected.value[filterValue] || { min: '', max: '' }) }\n } else if (filter.type === 'date') {\n tempSelected[filterValue] = selected.value[filterValue] || null\n } else {\n tempSelected[filterValue] = selected.value[filterValue] || null\n }\n }\n individualPopups[filterValue] = false\n}\n\nconst applyAllFilters = () => {\n Object.entries(tempSelected).forEach(([key, value]) => {\n if (selected.value[key] !== value) {\n selected.value[key] = value\n emit('select', { filter: key, value })\n }\n })\n showAllFilters.value = false\n}\n\nconst resetFilters = () => {\n filters.value.forEach(filter => {\n if (filter.type === 'checkbox') {\n tempSelected[filter.value] = []\n selected.value[filter.value] = []\n } else if (filter.type === 'range') {\n tempSelected[filter.value] = { min: '', max: '' }\n selected.value[filter.value] = { min: '', max: '' }\n } else if (filter.type === 'date') {\n tempSelected[filter.value] = null\n selected.value[filter.value] = null\n } else {\n tempSelected[filter.value] = null\n selected.value[filter.value] = null\n }\n emit('select', { filter: filter.value, value: null })\n })\n}\n</script>\n\n<style scoped>\n.filters-content {\n max-height: 60vh;\n overflow-y: auto;\n}\n</style>"],"names":["_useModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+NA,UAAM,UAAUA,SAAW,SAAC,SAG3B;AAED,UAAM,WAAWA,SAAW,SAAC,UAG5B;AAED,UAAM,OAAO;AAEb,UAAM,EAAE,WAAU,IAAK,gBAAe;AAGtC,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,mBAAmB,SAAS,CAAA,CAAE;AACpC,UAAM,eAAe,SAAS,CAAA,CAAE;AACV,QAAI,IAAI;AAG9B,UAAM,SAAS,CAAC,eAAe;AAC7B,iBAAW,QAAQ,YAAU;AAC3B,yBAAiB,OAAO,KAAK,IAAI;AAEjC,YAAI,CAAC,aAAa,OAAO,KAAK,GAAG;AAC/B,cAAI,OAAO,SAAS,YAAY;AAC9B,yBAAa,OAAO,KAAK,IAAI,CAAC,GAAI,SAAS,MAAM,OAAO,KAAK,KAAK,EAAG;AAAA,UACvE,WAAW,OAAO,SAAS,SAAS;AAClC,yBAAa,OAAO,KAAK,IAAI,EAAE,GAAI,SAAS,MAAM,OAAO,KAAK,KAAK,EAAE,KAAK,IAAI,KAAK,GAAE,EAAG;AAAA,UAC1F,WAAW,OAAO,SAAS,QAAQ;AACjC,yBAAa,OAAO,KAAK,IAAI,SAAS,MAAM,OAAO,KAAK,KAAK;AAAA,UAC/D,OAAO;AACL,yBAAa,OAAO,KAAK,IAAI,SAAS,MAAM,OAAO,KAAK,KAAK;AAAA,UAC/D;AAAA,QACF;AAAA,MACF,CA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