@kuzntsv/uikit 1.0.49 → 1.0.50
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
|
@@ -897,7 +897,7 @@ type SafeFilterState = Readonly<Record<string, FilterValue>>;
|
|
|
897
897
|
type CleanFilterValue = Exclude<FilterValue, null | undefined>;
|
|
898
898
|
type CleanFilterState = Readonly<Record<string, CleanFilterValue>>;
|
|
899
899
|
declare function cleanFilterParams(filters: SafeFilterState): CleanFilterState;
|
|
900
|
-
export declare class BaseSignalFilterClass
|
|
900
|
+
export declare class BaseSignalFilterClass<F extends SafeFilterState> {
|
|
901
901
|
/** Сервис индикатор загрузки. */
|
|
902
902
|
protected loaderService: LoaderService;
|
|
903
903
|
/** Сервис уведомлений. */
|
|
@@ -914,21 +914,13 @@ export declare class BaseSignalFilterClass implements OnDestroy {
|
|
|
914
914
|
* this.filters.update(prev => ({ ...prev, category: newCategory }));
|
|
915
915
|
* }
|
|
916
916
|
*/
|
|
917
|
-
|
|
917
|
+
filter: import("@angular/core").ModelSignal<F>;
|
|
918
918
|
/** Входной сигнал для сброса состояния формы. */
|
|
919
919
|
clearFilter: import("@angular/core").InputSignal<any>;
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
* Метод unsubscribe вызывается при уничтожении компонента.
|
|
925
|
-
*/
|
|
926
|
-
subscription: Subscription;
|
|
927
|
-
ngOnDestroy(): void;
|
|
928
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaseSignalFilterClass, never>;
|
|
929
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSignalFilterClass, never, never, {
|
|
930
|
-
"initialValues": {
|
|
931
|
-
"alias": "initialValues";
|
|
920
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseSignalFilterClass<any>, never>;
|
|
921
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSignalFilterClass<any>, never, never, {
|
|
922
|
+
"filter": {
|
|
923
|
+
"alias": "filter";
|
|
932
924
|
"required": false;
|
|
933
925
|
"isSignal": true;
|
|
934
926
|
};
|
|
@@ -938,16 +930,19 @@ export declare class BaseSignalFilterClass implements OnDestroy {
|
|
|
938
930
|
"isSignal": true;
|
|
939
931
|
};
|
|
940
932
|
}, {
|
|
941
|
-
"
|
|
933
|
+
"filter": "filterChange";
|
|
942
934
|
}, never, never, true, never>;
|
|
943
935
|
}
|
|
944
|
-
export declare abstract class BaseSignalPageClass<T extends BaseSchemaClass
|
|
936
|
+
export declare abstract class BaseSignalPageClass<T extends BaseSchemaClass, F extends SafeFilterState = Record<string, never>> implements OnDestroy {
|
|
945
937
|
protected dialog: MatDialog;
|
|
946
938
|
protected abstract readonly entityType: any;
|
|
947
939
|
protected abstract readonly entityService: any;
|
|
948
940
|
protected readonly entityEditComponent?: any;
|
|
949
941
|
protected extraData?: any;
|
|
950
942
|
protected abstract readonly schema: z.ZodType<T>;
|
|
943
|
+
protected readonly filterSchema?: z.ZodType<F>;
|
|
944
|
+
protected readonly defaultFilters?: F;
|
|
945
|
+
private get storagePrefix();
|
|
951
946
|
defaultPageIndex: number;
|
|
952
947
|
defaultPageSize: number;
|
|
953
948
|
dialogEditWidth: string;
|
|
@@ -985,10 +980,6 @@ export declare abstract class BaseSignalPageClass<T extends BaseSchemaClass> imp
|
|
|
985
980
|
executeRoles: string[];
|
|
986
981
|
/** Список ролей, для которых скрыть элемент. */
|
|
987
982
|
hideRoles: string[];
|
|
988
|
-
/** Загрузка данных. */
|
|
989
|
-
/** Загрузка количества записей. */
|
|
990
|
-
/** Очистка фильтра. (для очистки присвоить пустой объект '{}'). */
|
|
991
|
-
clearFilters: import("@angular/core").WritableSignal<any>;
|
|
992
983
|
/** Разрешен выбор нескольких строк. */
|
|
993
984
|
allowMultiSelect: boolean;
|
|
994
985
|
/** Выбранные строки в таблице. */
|
|
@@ -1021,15 +1012,21 @@ export declare abstract class BaseSignalPageClass<T extends BaseSchemaClass> imp
|
|
|
1021
1012
|
/** Объект для отписки (вызывается метод unsubscribe при уничтожении компонента). */
|
|
1022
1013
|
subscription: Subscription;
|
|
1023
1014
|
private getInitialFilters;
|
|
1015
|
+
protected initFilters(): void;
|
|
1016
|
+
private trackFilterChanges;
|
|
1017
|
+
clearEvent(): void;
|
|
1024
1018
|
private getInitialFilters2;
|
|
1025
|
-
filters: import("@angular/core").WritableSignal<
|
|
1026
|
-
|
|
1019
|
+
filters: import("@angular/core").WritableSignal<F>;
|
|
1020
|
+
/** Загрузка данных. */
|
|
1021
|
+
/** Загрузка количества записей. */
|
|
1022
|
+
/** Очистка фильтра. (для очистки присвоить пустой объект '{}'). */
|
|
1023
|
+
clearFilters: import("@angular/core").WritableSignal<any>;
|
|
1027
1024
|
/** Состояние сортировки, пагинации. */
|
|
1028
1025
|
tableState: import("@angular/core").WritableSignal<ITableState>;
|
|
1029
1026
|
constructor();
|
|
1030
1027
|
ngOnDestroy(): void;
|
|
1031
1028
|
subscribeToLoadData(fnGetData: fnGetDataResType<T>, fnGetCount: fnGetCountResType<T>, fnMapEntity?: fnMapEntityType<T>): void;
|
|
1032
|
-
setFilter(key:
|
|
1029
|
+
setFilter<K extends keyof F>(key: K, value: F[K]): void;
|
|
1033
1030
|
onPageChange(pageState: IPageState): void;
|
|
1034
1031
|
onSortChange(sortState: ISortState): void;
|
|
1035
1032
|
/** Событие изменение выбранных записей. */
|
|
@@ -1049,7 +1046,6 @@ export declare abstract class BaseSignalPageClass<T extends BaseSchemaClass> imp
|
|
|
1049
1046
|
/** Событие обновления данных. */
|
|
1050
1047
|
refreshEvent(): void;
|
|
1051
1048
|
/** Событие очистки фильтра. */
|
|
1052
|
-
clearEvent(): void;
|
|
1053
1049
|
/** Изменение сообщения об удалении. */
|
|
1054
1050
|
onRemovalMessageChange(message: string): void;
|
|
1055
1051
|
/** Изменение заголовка страницы. */
|
|
@@ -1059,8 +1055,8 @@ export declare abstract class BaseSignalPageClass<T extends BaseSchemaClass> imp
|
|
|
1059
1055
|
protected onMiddleButton(baseUrl: string, queryParamName?: string, queryParamValue?: string): ($event: MouseEvent, item: T | undefined, contextMenu: MatMenuTrigger) => void;
|
|
1060
1056
|
protected onActionMiddleButton(baseUrl: string, queryParamName?: string, queryParamValue?: string): ($event: MouseEvent, item: T | undefined) => void;
|
|
1061
1057
|
protected dateToString(date: string | number | Date): string | null;
|
|
1062
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<BaseSignalPageClass<any>, never>;
|
|
1063
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSignalPageClass<any>, never, never, {}, {}, never, never, true, never>;
|
|
1058
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseSignalPageClass<any, any>, never>;
|
|
1059
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseSignalPageClass<any, any>, never, never, {}, {}, never, never, true, never>;
|
|
1064
1060
|
}
|
|
1065
1061
|
export declare abstract class BaseSignalServiceClass<T extends BaseSchemaClass> {
|
|
1066
1062
|
abstract baseRoute: string;
|
|
@@ -1078,6 +1074,16 @@ export declare abstract class BaseSignalServiceClass<T extends BaseSchemaClass>
|
|
|
1078
1074
|
getObject(id: number | (() => number | null | undefined)): HttpResourceRef<T | null>;
|
|
1079
1075
|
getCount(): HttpResourceRef<number>;
|
|
1080
1076
|
getObjectsByPaging(pageIndex: number, pageSize: number, sortColumn: string, direction: string): HttpResourceRef<T[]>;
|
|
1077
|
+
/**
|
|
1078
|
+
* Универсальный метод получения пагинированных данных с фильтрацией.
|
|
1079
|
+
* Автоматически очищает фильтры от null/undefined/пустых значений с помощью cleanFilterParams.
|
|
1080
|
+
*/
|
|
1081
|
+
getObjectsByFilterPaging<F extends SafeFilterState>(pageIndex: number, pageSize: number, sortColumn: string, direction: string, filters: F): HttpResourceRef<T[]>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Универсальный метод получения КОЛИЧЕСТВА записей с фильтрацией.
|
|
1084
|
+
* Автоматически очищает фильтры перед отправкой.
|
|
1085
|
+
*/
|
|
1086
|
+
getObjectsCountByFilter<F extends SafeFilterState>(filters: F): HttpResourceRef<number>;
|
|
1081
1087
|
/**
|
|
1082
1088
|
* МЕТОД СОЗДАНИЯ (POST)
|
|
1083
1089
|
* Принимает данные БЕЗ id. Тип формируется автоматически через Zod.
|