@webitel/ui-datalist 1.0.66 → 1.0.67
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.67",
|
|
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",
|
|
@@ -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,13 +176,7 @@ export const tableStoreBody = <Entity extends { id: string; etag?: string }>(
|
|
|
165
176
|
}
|
|
166
177
|
};
|
|
167
178
|
|
|
168
|
-
const
|
|
169
|
-
parentId: storeParentId,
|
|
170
|
-
}: { parentId?: string | number } = {}) => {
|
|
171
|
-
if (storeParentId) {
|
|
172
|
-
parentId.value = storeParentId;
|
|
173
|
-
}
|
|
174
|
-
|
|
179
|
+
const setupStore = async () => {
|
|
175
180
|
if (!disablePersistence) {
|
|
176
181
|
await Promise.allSettled([
|
|
177
182
|
setupPaginationPersistence(),
|
|
@@ -200,10 +205,26 @@ export const tableStoreBody = <Entity extends { id: string; etag?: string }>(
|
|
|
200
205
|
}
|
|
201
206
|
});
|
|
202
207
|
|
|
208
|
+
isStoreSetUp.value = true;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const initialize = async ({
|
|
212
|
+
parentId: storeParentId,
|
|
213
|
+
}: { parentId?: string | number } = {}) => {
|
|
214
|
+
if (storeParentId) {
|
|
215
|
+
parentId.value = storeParentId;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (!isStoreSetUp.value) {
|
|
219
|
+
await setupStore();
|
|
220
|
+
}
|
|
221
|
+
|
|
203
222
|
return loadDataList();
|
|
204
223
|
};
|
|
205
224
|
|
|
206
225
|
return {
|
|
226
|
+
isStoreSetUp, // internal export for pinia devtools
|
|
227
|
+
|
|
207
228
|
dataList,
|
|
208
229
|
selected,
|
|
209
230
|
error,
|
|
@@ -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>;
|
|
@@ -96,6 +97,7 @@ export declare const createFilterPresetsStore: (namespace: string) => () => {
|
|
|
96
97
|
presetId: import("vue").Ref<any, any>;
|
|
97
98
|
setupPresetPersistence: () => Promise<void>;
|
|
98
99
|
resetPreset: () => void;
|
|
100
|
+
isStoreSetUp: import("vue").Ref<boolean, boolean>;
|
|
99
101
|
dataList: import("vue").Ref<EnginePresetQuery[], EnginePresetQuery[]>;
|
|
100
102
|
selected: import("vue").Ref<EnginePresetQuery[], EnginePresetQuery[]>;
|
|
101
103
|
error: import("vue").Ref<any, any>;
|
|
@@ -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>;
|
|
@@ -98,6 +99,7 @@ export declare const createTableStore: <Entity extends {
|
|
|
98
99
|
id: string;
|
|
99
100
|
etag?: string;
|
|
100
101
|
}>(namespace: string, config: useTableStoreConfig<Entity>) => import("../types/createDatalistStore.types").PatchableStoreFactory<{
|
|
102
|
+
isStoreSetUp: Ref<boolean, boolean>;
|
|
101
103
|
dataList: Ref<Entity[], Entity[]>;
|
|
102
104
|
selected: Ref<Entity[], Entity[]>;
|
|
103
105
|
error: Ref<any, any>;
|