@webitel/ui-datalist 1.1.28 → 1.1.30
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 +1 -1
- package/src/modules/filters/components/config/static-view/static-filter-field.vue +1 -0
- package/src/modules/table/createTableStore.store.ts +11 -3
- package/src/modules/types/tableStore.types.ts +5 -1
- package/types/modules/filter-presets/stores/createFilterPresetsStore.d.ts +2 -2
- package/types/modules/table/createTableStore.store.d.ts +3 -3
- package/types/modules/types/tableStore.types.d.ts +4 -1
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import { createTableFiltersStore } from '../filters/createTableFiltersStore';
|
|
|
10
10
|
import { createTableHeadersStore } from '../headers/createTableHeadersStore';
|
|
11
11
|
import { createTablePaginationStore } from '../pagination/createTablePaginationStore';
|
|
12
12
|
import type {
|
|
13
|
+
LoadDataListOptions,
|
|
13
14
|
PatchItemPropertyParams,
|
|
14
15
|
useTableStoreConfig,
|
|
15
16
|
} from '../types/tableStore.types';
|
|
@@ -112,8 +113,13 @@ export const tableStoreBody = <
|
|
|
112
113
|
parentId: parentId.value,
|
|
113
114
|
});
|
|
114
115
|
|
|
115
|
-
const loadDataList = async (
|
|
116
|
-
|
|
116
|
+
const loadDataList = async ({
|
|
117
|
+
withLoading = true,
|
|
118
|
+
}: LoadDataListOptions = {}) => {
|
|
119
|
+
if (withLoading) {
|
|
120
|
+
isLoading.value = true;
|
|
121
|
+
}
|
|
122
|
+
|
|
117
123
|
$patchPaginationStore({
|
|
118
124
|
next: false,
|
|
119
125
|
});
|
|
@@ -141,7 +147,9 @@ export const tableStoreBody = <
|
|
|
141
147
|
error.value = err;
|
|
142
148
|
throw err;
|
|
143
149
|
} finally {
|
|
144
|
-
|
|
150
|
+
if (withLoading) {
|
|
151
|
+
isLoading.value = false;
|
|
152
|
+
}
|
|
145
153
|
}
|
|
146
154
|
};
|
|
147
155
|
|
|
@@ -22,6 +22,10 @@ export interface PatchItemPropertyParams {
|
|
|
22
22
|
value: unknown;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export interface LoadDataListOptions {
|
|
26
|
+
withLoading?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
export interface TableStore<Entity> {
|
|
26
30
|
// tableStore
|
|
27
31
|
dataList: Ref<Entity[]>;
|
|
@@ -47,7 +51,7 @@ export interface TableStore<Entity> {
|
|
|
47
51
|
|
|
48
52
|
// tableStore
|
|
49
53
|
initialize: () => Promise<void>;
|
|
50
|
-
loadDataList: (
|
|
54
|
+
loadDataList: (options?: LoadDataListOptions) => Promise<void>;
|
|
51
55
|
updateSelected: (selected: Entity[]) => void;
|
|
52
56
|
patchItemProperty: (payload: PatchItemPropertyParams) => Promise<void>;
|
|
53
57
|
deleteEls: (deleted: Entity[]) => Promise<void>;
|
|
@@ -89,7 +89,7 @@ export declare const filterPresetsStoreBody: (namespace?: string) => {
|
|
|
89
89
|
initialize: ({ parentId: storeParentId, }?: {
|
|
90
90
|
parentId?: string | number;
|
|
91
91
|
}) => Promise<void>;
|
|
92
|
-
loadDataList: () => Promise<void>;
|
|
92
|
+
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
93
93
|
appendToDataList: () => Promise<void>;
|
|
94
94
|
updateSelected: (value: EnginePresetQuery[]) => void;
|
|
95
95
|
patchItemProperty: ({ index, path, value, }: import("../../types/tableStore.types").PatchItemPropertyParams) => Promise<void>;
|
|
@@ -202,7 +202,7 @@ export declare const createFilterPresetsStore: (namespace: string) => () => {
|
|
|
202
202
|
initialize: ({ parentId: storeParentId, }?: {
|
|
203
203
|
parentId?: string | number;
|
|
204
204
|
}) => Promise<void>;
|
|
205
|
-
loadDataList: () => Promise<void>;
|
|
205
|
+
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
206
206
|
appendToDataList: () => Promise<void>;
|
|
207
207
|
updateSelected: (value: EnginePresetQuery[]) => void;
|
|
208
208
|
patchItemProperty: ({ index, path, value, }: import("../../types/tableStore.types").PatchItemPropertyParams) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import deepEqual from 'deep-equal';
|
|
2
2
|
import { type Ref } from 'vue';
|
|
3
|
-
import type { PatchItemPropertyParams, useTableStoreConfig } from '../types/tableStore.types';
|
|
3
|
+
import type { LoadDataListOptions, PatchItemPropertyParams, useTableStoreConfig } from '../types/tableStore.types';
|
|
4
4
|
export declare const tableStoreBody: <Entity extends {
|
|
5
5
|
id: string;
|
|
6
6
|
etag?: string;
|
|
@@ -91,7 +91,7 @@ export declare const tableStoreBody: <Entity extends {
|
|
|
91
91
|
initialize: ({ parentId: storeParentId, }?: {
|
|
92
92
|
parentId?: string | number;
|
|
93
93
|
}) => Promise<void>;
|
|
94
|
-
loadDataList: () => Promise<void>;
|
|
94
|
+
loadDataList: ({ withLoading, }?: LoadDataListOptions) => Promise<void>;
|
|
95
95
|
appendToDataList: () => Promise<void>;
|
|
96
96
|
updateSelected: (value: Entity[]) => void;
|
|
97
97
|
patchItemProperty: ({ index, path, value, }: PatchItemPropertyParams) => Promise<void>;
|
|
@@ -204,7 +204,7 @@ export declare const createTableStore: <Entity extends {
|
|
|
204
204
|
initialize: ({ parentId: storeParentId, }?: {
|
|
205
205
|
parentId?: string | number;
|
|
206
206
|
}) => Promise<void>;
|
|
207
|
-
loadDataList: () => Promise<void>;
|
|
207
|
+
loadDataList: ({ withLoading, }?: LoadDataListOptions) => Promise<void>;
|
|
208
208
|
appendToDataList: () => Promise<void>;
|
|
209
209
|
updateSelected: (value: Entity[]) => void;
|
|
210
210
|
patchItemProperty: ({ index, path, value, }: PatchItemPropertyParams) => Promise<void>;
|
|
@@ -16,6 +16,9 @@ export interface PatchItemPropertyParams {
|
|
|
16
16
|
path: string;
|
|
17
17
|
value: unknown;
|
|
18
18
|
}
|
|
19
|
+
export interface LoadDataListOptions {
|
|
20
|
+
withLoading?: boolean;
|
|
21
|
+
}
|
|
19
22
|
export interface TableStore<Entity> {
|
|
20
23
|
dataList: Ref<Entity[]>;
|
|
21
24
|
selected: Ref<Entity[]>;
|
|
@@ -32,7 +35,7 @@ export interface TableStore<Entity> {
|
|
|
32
35
|
filtersManager: Ref<IFiltersManager>;
|
|
33
36
|
isFiltersRestoring: Ref<boolean>;
|
|
34
37
|
initialize: () => Promise<void>;
|
|
35
|
-
loadDataList: (
|
|
38
|
+
loadDataList: (options?: LoadDataListOptions) => Promise<void>;
|
|
36
39
|
updateSelected: (selected: Entity[]) => void;
|
|
37
40
|
patchItemProperty: (payload: PatchItemPropertyParams) => Promise<void>;
|
|
38
41
|
deleteEls: (deleted: Entity[]) => Promise<void>;
|