@webitel/ui-datalist 1.1.65 → 1.1.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 +1 -1
- package/src/modules/filters/__tests__/createTableFiltersStore.spec.ts +143 -0
- package/src/modules/filters/createTableFiltersStore.ts +23 -5
- package/src/modules/filters/modules/filterConfig/components/contact-group/contact-group-filter-value-field.vue +40 -25
- package/src/modules/headers/__tests__/createTableHeadersStore.spec.ts +169 -0
- package/src/modules/headers/createTableHeadersStore.ts +26 -7
- package/src/modules/pagination/__tests__/createTablePaginationStore.spec.ts +134 -0
- package/src/modules/pagination/createTablePaginationStore.ts +32 -4
- package/src/modules/persist/PersistedStorage.types.ts +14 -0
- package/src/modules/persist/__tests__/useLocalStoragePersistedStorage.spec.ts +66 -0
- package/src/modules/persist/__tests__/usePersistedStorage.spec.ts +357 -0
- package/src/modules/persist/__tests__/useRoutePersistedStorage.spec.ts +145 -0
- package/src/modules/persist/usePersistedStorage.ts +93 -60
- package/src/modules/persist/useRoutePersistedStorage.ts +40 -18
- package/src/modules/table/createTableStore.store.ts +37 -0
- package/types/.tsbuildinfo +1 -1
- package/types/modules/filter-presets/stores/createFilterPresetsStore.d.ts +1 -0
- package/types/modules/filters/createTableFiltersStore.d.ts +2 -0
- package/types/modules/filters/modules/filterConfig/components/contact-group/contact-group-filter-value-field.vue.d.ts +4 -4
- package/types/modules/headers/createTableHeadersStore.d.ts +2 -0
- package/types/modules/pagination/createTablePaginationStore.d.ts +2 -0
- package/types/modules/permissions-page/stores/createPermissionsStore.d.ts +2 -0
- package/types/modules/persist/PersistedStorage.types.d.ts +13 -0
- package/types/modules/table/createTableStore.store.d.ts +2 -0
|
@@ -126,6 +126,7 @@ export declare const filterPresetsStoreBody: (namespace?: string) => {
|
|
|
126
126
|
initialize: ({ parentId: storeParentId, }?: {
|
|
127
127
|
parentId?: string | number;
|
|
128
128
|
}) => Promise<void>;
|
|
129
|
+
syncPersistence: () => Promise<void>;
|
|
129
130
|
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
130
131
|
appendToDataList: () => Promise<void>;
|
|
131
132
|
updateSelected: (value: EnginePresetQuery[]) => void;
|
|
@@ -58,6 +58,7 @@ export declare const tableFiltersStoreBody: (namespace: string, config?: {
|
|
|
58
58
|
}) => import(".").IFilter | undefined;
|
|
59
59
|
updateSearchMode: (newSearch: string) => void;
|
|
60
60
|
setupPersistence: () => Promise<[void, void]>;
|
|
61
|
+
syncPersistence: () => Promise<void>;
|
|
61
62
|
};
|
|
62
63
|
export declare const createTableFiltersStore: <Entity extends Identifiable>(namespace: string, config: useTableStoreConfig<Entity> & {
|
|
63
64
|
filtersManagerConfig?: FiltersManagerConfig;
|
|
@@ -116,4 +117,5 @@ export declare const createTableFiltersStore: <Entity extends Identifiable>(name
|
|
|
116
117
|
}) => import(".").IFilter | undefined;
|
|
117
118
|
updateSearchMode: (newSearch: string) => void;
|
|
118
119
|
setupPersistence: () => Promise<[void, void]>;
|
|
120
|
+
syncPersistence: () => Promise<void>;
|
|
119
121
|
}>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IContactGroupFilterConfig } from './index';
|
|
2
|
+
type ModelValue = {
|
|
3
|
+
list?: string[];
|
|
4
|
+
unassigned?: boolean | null;
|
|
5
|
+
};
|
|
2
6
|
type __VLS_Props = {
|
|
3
7
|
filterConfig: IContactGroupFilterConfig;
|
|
4
8
|
disableValidation?: boolean;
|
|
5
9
|
hideLabel?: boolean;
|
|
6
10
|
};
|
|
7
|
-
type ModelValue = {
|
|
8
|
-
list?: string[];
|
|
9
|
-
unassigned?: boolean | null;
|
|
10
|
-
};
|
|
11
11
|
type __VLS_ModelProps = {
|
|
12
12
|
modelValue?: ModelValue;
|
|
13
13
|
};
|
|
@@ -49,6 +49,7 @@ export declare const tableHeadersStoreBody: ({ rawHeaders, id, }: TableHeadersSt
|
|
|
49
49
|
}) => void;
|
|
50
50
|
columnReorder: (orderedFields: string[]) => void;
|
|
51
51
|
setupPersistence: () => Promise<[PromiseSettledResult<void>, PromiseSettledResult<void>, PromiseSettledResult<void>]>;
|
|
52
|
+
syncPersistence: () => Promise<void>;
|
|
52
53
|
$reset: () => void;
|
|
53
54
|
};
|
|
54
55
|
export declare const createTableHeadersStore: <Entity extends Identifiable>(namespace: string, config: useTableStoreConfig<Entity>, { headers: rawHeaders, }: {
|
|
@@ -97,6 +98,7 @@ export declare const createTableHeadersStore: <Entity extends Identifiable>(name
|
|
|
97
98
|
}) => void;
|
|
98
99
|
columnReorder: (orderedFields: string[]) => void;
|
|
99
100
|
setupPersistence: () => Promise<[PromiseSettledResult<void>, PromiseSettledResult<void>, PromiseSettledResult<void>]>;
|
|
101
|
+
syncPersistence: () => Promise<void>;
|
|
100
102
|
$reset: () => void;
|
|
101
103
|
}>;
|
|
102
104
|
export {};
|
|
@@ -7,6 +7,7 @@ export declare const tablePaginationStoreBody: () => {
|
|
|
7
7
|
updatePage: (newPage: number) => void;
|
|
8
8
|
updateSize: (newSize: number) => void;
|
|
9
9
|
setupPersistence: () => Promise<[PromiseSettledResult<void>, PromiseSettledResult<void>]>;
|
|
10
|
+
syncPersistence: () => Promise<void>;
|
|
10
11
|
$reset: () => void;
|
|
11
12
|
};
|
|
12
13
|
export declare const createTablePaginationStore: <Entity extends Identifiable>(namespace: string, config: useTableStoreConfig<Entity>) => import("../types/createDatalistStore.types").PatchableStoreFactory<{
|
|
@@ -16,5 +17,6 @@ export declare const createTablePaginationStore: <Entity extends Identifiable>(n
|
|
|
16
17
|
updatePage: (newPage: number) => void;
|
|
17
18
|
updateSize: (newSize: number) => void;
|
|
18
19
|
setupPersistence: () => Promise<[PromiseSettledResult<void>, PromiseSettledResult<void>]>;
|
|
20
|
+
syncPersistence: () => Promise<void>;
|
|
19
21
|
$reset: () => void;
|
|
20
22
|
}>;
|
|
@@ -132,6 +132,7 @@ export declare const permissionsStoreBody: (namespace: string, config: useTableS
|
|
|
132
132
|
}>;
|
|
133
133
|
isFiltersRestoring: import("vue").Ref<boolean, boolean>;
|
|
134
134
|
setupStore: () => Promise<void>;
|
|
135
|
+
syncPersistence: () => Promise<void>;
|
|
135
136
|
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
136
137
|
appendToDataList: () => Promise<void>;
|
|
137
138
|
updateSelected: (value: PermissionEntity[]) => void;
|
|
@@ -294,6 +295,7 @@ export declare const createPermissionsStore: (namespace: string, config: Omit<us
|
|
|
294
295
|
}>;
|
|
295
296
|
isFiltersRestoring: import("vue").Ref<boolean, boolean>;
|
|
296
297
|
setupStore: () => Promise<void>;
|
|
298
|
+
syncPersistence: () => Promise<void>;
|
|
297
299
|
loadDataList: ({ withLoading, }?: import("../../types/tableStore.types").LoadDataListOptions) => Promise<void>;
|
|
298
300
|
appendToDataList: () => Promise<void>;
|
|
299
301
|
updateSelected: (value: PermissionEntity[]) => void;
|
|
@@ -12,6 +12,9 @@ export interface StorageLike {
|
|
|
12
12
|
setItem(key: string, value: PersistableValue): Promise<void>;
|
|
13
13
|
removeItem(key: string): Promise<void>;
|
|
14
14
|
}
|
|
15
|
+
export interface PersistedStorageAdapter extends StorageLike {
|
|
16
|
+
type: PersistedStorageType;
|
|
17
|
+
}
|
|
15
18
|
export interface PersistedPropertyConfig {
|
|
16
19
|
name: string;
|
|
17
20
|
value: Ref<PersistableValue | null>;
|
|
@@ -32,5 +35,15 @@ export interface PersistedStorageController {
|
|
|
32
35
|
watch: () => void;
|
|
33
36
|
unwatch: () => void;
|
|
34
37
|
restore: () => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Publishes the current value to every storage that holds nothing for `name`.
|
|
40
|
+
* Storages that already hold a value are left untouched, so an explicit route
|
|
41
|
+
* query always wins over in-memory state.
|
|
42
|
+
*
|
|
43
|
+
* A no-op for state still equal to the defaults: `restore()` captures the
|
|
44
|
+
* snapshot a freshly created store serializes, and a controller that never
|
|
45
|
+
* restored can only tell empty values apart.
|
|
46
|
+
*/
|
|
47
|
+
sync: () => Promise<void>;
|
|
35
48
|
reset: () => Promise<void>;
|
|
36
49
|
}
|
|
@@ -125,6 +125,7 @@ export declare const tableStoreBody: <Entity extends Identifiable>(namespace: st
|
|
|
125
125
|
initialize: ({ parentId: storeParentId, }?: {
|
|
126
126
|
parentId?: string | number;
|
|
127
127
|
}) => Promise<void>;
|
|
128
|
+
syncPersistence: () => Promise<void>;
|
|
128
129
|
loadDataList: ({ withLoading, }?: LoadDataListOptions) => Promise<void>;
|
|
129
130
|
appendToDataList: () => Promise<void>;
|
|
130
131
|
updateSelected: (value: Entity[]) => void;
|
|
@@ -278,6 +279,7 @@ export declare const createTableStore: <Entity extends Identifiable>(namespace:
|
|
|
278
279
|
initialize: ({ parentId: storeParentId, }?: {
|
|
279
280
|
parentId?: string | number;
|
|
280
281
|
}) => Promise<void>;
|
|
282
|
+
syncPersistence: () => Promise<void>;
|
|
281
283
|
loadDataList: ({ withLoading, }?: LoadDataListOptions) => Promise<void>;
|
|
282
284
|
appendToDataList: () => Promise<void>;
|
|
283
285
|
updateSelected: (value: Entity[]) => void;
|