@webitel/ui-datalist 1.0.66 → 1.0.68
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-datalist",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.68",
|
|
4
4
|
"description": "Toolkit for building data lists in webitel ui system",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"make-all": "npm version patch --git-tag-version false && ( npm run lint:fix || true) && (npm run build:types || true) && npm run utils:publish",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@vuelidate/validators": "^2.0.4",
|
|
38
38
|
"@webitel/styleguide": "^24.12.26",
|
|
39
39
|
"@webitel/ui-sdk": "^25.8.62",
|
|
40
|
-
"@webitel/api-services": "^0.
|
|
40
|
+
"@webitel/api-services": "^0.x",
|
|
41
41
|
"zod": "^3.25.55",
|
|
42
42
|
"@vueuse/core": "^13.3.0"
|
|
43
43
|
},
|
|
@@ -67,6 +67,17 @@ export const tableStoreBody = <Entity extends { id: string; etag?: string }>(
|
|
|
67
67
|
setupPersistence: setupFiltersPersistence,
|
|
68
68
|
} = filtersStore;
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
* @description
|
|
73
|
+
* This flag is used to check if the store is set up.
|
|
74
|
+
* It is used to prevent multiple setup calls.
|
|
75
|
+
*
|
|
76
|
+
* @link
|
|
77
|
+
* https://webitel.atlassian.net/browse/WTEL-7495
|
|
78
|
+
*/
|
|
79
|
+
const isStoreSetUp = ref(false);
|
|
80
|
+
|
|
70
81
|
const dataList: Ref<Entity[]> = ref([]);
|
|
71
82
|
const selected: Ref<Entity[]> = ref([]);
|
|
72
83
|
const error = ref(null);
|
|
@@ -165,11 +176,9 @@ export const tableStoreBody = <Entity extends { id: string; etag?: string }>(
|
|
|
165
176
|
}
|
|
166
177
|
};
|
|
167
178
|
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (storeParentId) {
|
|
172
|
-
parentId.value = storeParentId;
|
|
179
|
+
const setupStore = async () => {
|
|
180
|
+
if (isStoreSetUp.value) {
|
|
181
|
+
return;
|
|
173
182
|
}
|
|
174
183
|
|
|
175
184
|
if (!disablePersistence) {
|
|
@@ -200,10 +209,24 @@ export const tableStoreBody = <Entity extends { id: string; etag?: string }>(
|
|
|
200
209
|
}
|
|
201
210
|
});
|
|
202
211
|
|
|
212
|
+
isStoreSetUp.value = true;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const initialize = async ({
|
|
216
|
+
parentId: storeParentId,
|
|
217
|
+
}: { parentId?: string | number } = {}) => {
|
|
218
|
+
if (storeParentId) {
|
|
219
|
+
parentId.value = storeParentId;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
await setupStore();
|
|
223
|
+
|
|
203
224
|
return loadDataList();
|
|
204
225
|
};
|
|
205
226
|
|
|
206
227
|
return {
|
|
228
|
+
isStoreSetUp, // internal export for pinia devtools
|
|
229
|
+
|
|
207
230
|
dataList,
|
|
208
231
|
selected,
|
|
209
232
|
error,
|
|
@@ -221,7 +244,8 @@ export const tableStoreBody = <Entity extends { id: string; etag?: string }>(
|
|
|
221
244
|
filtersManager,
|
|
222
245
|
isFiltersRestoring,
|
|
223
246
|
|
|
224
|
-
|
|
247
|
+
setupStore, // only setup, no data loading
|
|
248
|
+
initialize, // setup + load data
|
|
225
249
|
|
|
226
250
|
loadDataList,
|
|
227
251
|
appendToDataList,
|
|
@@ -2,6 +2,7 @@ export declare const filterPresetsStoreBody: (namespace?: string) => {
|
|
|
2
2
|
presetId: import("vue").Ref<any, any>;
|
|
3
3
|
setupPresetPersistence: () => Promise<void>;
|
|
4
4
|
resetPreset: () => void;
|
|
5
|
+
isStoreSetUp: import("vue").Ref<boolean, boolean>;
|
|
5
6
|
dataList: import("vue").Ref<EnginePresetQuery[], EnginePresetQuery[]>;
|
|
6
7
|
selected: import("vue").Ref<EnginePresetQuery[], EnginePresetQuery[]>;
|
|
7
8
|
error: import("vue").Ref<any, any>;
|
|
@@ -75,6 +76,7 @@ export declare const filterPresetsStoreBody: (namespace?: string) => {
|
|
|
75
76
|
}) => import("../../filters").IFilter[];
|
|
76
77
|
}>;
|
|
77
78
|
isFiltersRestoring: import("vue").Ref<boolean, boolean>;
|
|
79
|
+
setupStore: () => Promise<void>;
|
|
78
80
|
initialize: ({ parentId: storeParentId, }?: {
|
|
79
81
|
parentId?: string | number;
|
|
80
82
|
}) => Promise<void>;
|
|
@@ -96,6 +98,7 @@ export declare const createFilterPresetsStore: (namespace: string) => () => {
|
|
|
96
98
|
presetId: import("vue").Ref<any, any>;
|
|
97
99
|
setupPresetPersistence: () => Promise<void>;
|
|
98
100
|
resetPreset: () => void;
|
|
101
|
+
isStoreSetUp: import("vue").Ref<boolean, boolean>;
|
|
99
102
|
dataList: import("vue").Ref<EnginePresetQuery[], EnginePresetQuery[]>;
|
|
100
103
|
selected: import("vue").Ref<EnginePresetQuery[], EnginePresetQuery[]>;
|
|
101
104
|
error: import("vue").Ref<any, any>;
|
|
@@ -169,6 +172,7 @@ export declare const createFilterPresetsStore: (namespace: string) => () => {
|
|
|
169
172
|
}) => import("../../filters").IFilter[];
|
|
170
173
|
}>;
|
|
171
174
|
isFiltersRestoring: import("vue").Ref<boolean, boolean>;
|
|
175
|
+
setupStore: () => Promise<void>;
|
|
172
176
|
initialize: ({ parentId: storeParentId, }?: {
|
|
173
177
|
parentId?: string | number;
|
|
174
178
|
}) => Promise<void>;
|
|
@@ -4,6 +4,7 @@ export declare const tableStoreBody: <Entity extends {
|
|
|
4
4
|
id: string;
|
|
5
5
|
etag?: string;
|
|
6
6
|
}>(namespace: string, config: useTableStoreConfig<Entity>) => {
|
|
7
|
+
isStoreSetUp: Ref<boolean, boolean>;
|
|
7
8
|
dataList: Ref<Entity[], Entity[]>;
|
|
8
9
|
selected: Ref<Entity[], Entity[]>;
|
|
9
10
|
error: Ref<any, any>;
|
|
@@ -77,6 +78,7 @@ export declare const tableStoreBody: <Entity extends {
|
|
|
77
78
|
}) => import("../filters").IFilter[];
|
|
78
79
|
}>;
|
|
79
80
|
isFiltersRestoring: Ref<boolean, boolean>;
|
|
81
|
+
setupStore: () => Promise<void>;
|
|
80
82
|
initialize: ({ parentId: storeParentId, }?: {
|
|
81
83
|
parentId?: string | number;
|
|
82
84
|
}) => Promise<void>;
|
|
@@ -98,6 +100,7 @@ export declare const createTableStore: <Entity extends {
|
|
|
98
100
|
id: string;
|
|
99
101
|
etag?: string;
|
|
100
102
|
}>(namespace: string, config: useTableStoreConfig<Entity>) => import("../types/createDatalistStore.types").PatchableStoreFactory<{
|
|
103
|
+
isStoreSetUp: Ref<boolean, boolean>;
|
|
101
104
|
dataList: Ref<Entity[], Entity[]>;
|
|
102
105
|
selected: Ref<Entity[], Entity[]>;
|
|
103
106
|
error: Ref<any, any>;
|
|
@@ -171,6 +174,7 @@ export declare const createTableStore: <Entity extends {
|
|
|
171
174
|
}) => import("../filters").IFilter[];
|
|
172
175
|
}>;
|
|
173
176
|
isFiltersRestoring: Ref<boolean, boolean>;
|
|
177
|
+
setupStore: () => Promise<void>;
|
|
174
178
|
initialize: ({ parentId: storeParentId, }?: {
|
|
175
179
|
parentId?: string | number;
|
|
176
180
|
}) => Promise<void>;
|