@kuzntsv/uikit 1.0.42 → 1.0.44
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,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { AfterViewInit, ElementRef, EnvironmentProviders, InjectionToken, OnDestroy, OnInit, PipeTransform, WritableSignal } from "@angular/core";
|
|
3
3
|
import { NotificationService, RoleService } from "@kuzntsv/uikit";
|
|
4
|
+
import { HttpClient, HttpContext, HttpParams, HttpResourceRef } from "@angular/common/http";
|
|
4
5
|
import { Observable, Subject, Subscription } from "rxjs";
|
|
5
6
|
import { SelectionModel } from "@angular/cdk/collections";
|
|
6
7
|
import { MatMenuTrigger } from "@angular/material/menu";
|
|
@@ -12,7 +13,6 @@ import { FormControl, FormGroup } from "@angular/forms";
|
|
|
12
13
|
import { MatDialog, MatDialogRef } from "@angular/material/dialog";
|
|
13
14
|
import { SafeUrl } from "@angular/platform-browser";
|
|
14
15
|
import { CanActivateFn, Router } from "@angular/router";
|
|
15
|
-
import { HttpClient, HttpContext, HttpParams, HttpResourceRef } from "@angular/common/http";
|
|
16
16
|
import { FieldTree } from "@angular/forms/signals";
|
|
17
17
|
import { MatAutocompleteSelectedEvent } from "@angular/material/autocomplete";
|
|
18
18
|
import { NativeDateAdapter } from "@angular/material/core";
|
|
@@ -50,9 +50,13 @@ export type ObjectKeys<T extends string | number | symbol = string, K = any> = {
|
|
|
50
50
|
export type fnType<T> = ((data: T, extraData?: any) => void) | undefined;
|
|
51
51
|
export type fnCbType<T> = ((callback: () => void, data: T, extraData?: any) => void) | undefined;
|
|
52
52
|
export type SortDirection = 'asc' | 'desc' | '';
|
|
53
|
+
/** @deprecated */
|
|
53
54
|
export type fnGetDataType<T> = () => Observable<T[]>;
|
|
55
|
+
/** @deprecated */
|
|
54
56
|
export type fnGetCountType<T> = () => Observable<number>;
|
|
55
|
-
export type
|
|
57
|
+
export type fnGetDataResType<T> = () => HttpResourceRef<T[]>;
|
|
58
|
+
export type fnGetCountResType<T> = () => HttpResourceRef<number>;
|
|
59
|
+
export type fnMapEntityType<T> = () => (item: T) => T;
|
|
56
60
|
export interface ISortState {
|
|
57
61
|
sortActive: string;
|
|
58
62
|
sortDirection: SortDirection;
|
|
@@ -796,7 +800,6 @@ export declare class BasePageClass<T> implements OnDestroy {
|
|
|
796
800
|
subscribeToLoadData(fnGetData: fnGetDataType<T>, fnGetCount: fnGetCountType<T>, fnMapEntity?: fnMapEntityType<T>): void;
|
|
797
801
|
onPageChange(pageState: IPageState): void;
|
|
798
802
|
onSortChange(sortState: ISortState): void;
|
|
799
|
-
entityFactory(type: new () => T): T;
|
|
800
803
|
/** Событие изменение выбранных записей. */
|
|
801
804
|
onSelectionChange(selected: T[]): void;
|
|
802
805
|
/** Обновление доступности кнопки "Изменить" - вызывается при изменении выбранных записей. */
|
|
@@ -982,24 +985,24 @@ export declare class BaseSignalPageClass<T> implements OnDestroy {
|
|
|
982
985
|
/** Список ролей, для которых скрыть элемент. */
|
|
983
986
|
hideRoles: string[];
|
|
984
987
|
/** Загрузка данных. */
|
|
985
|
-
loadData$: Subject<null>;
|
|
986
988
|
/** Загрузка количества записей. */
|
|
987
|
-
loadLength$: Subject<null>;
|
|
988
989
|
/** Очистка фильтра. (для очистки присвоить пустой объект '{}'). */
|
|
989
990
|
clearFilters: import("@angular/core").WritableSignal<any>;
|
|
990
991
|
/** Разрешен выбор нескольких строк. */
|
|
991
992
|
allowMultiSelect: boolean;
|
|
992
993
|
/** Выбранные строки в таблице. */
|
|
993
994
|
selected: T[];
|
|
994
|
-
protected fnGetData: import("@angular/core").WritableSignal<
|
|
995
|
-
protected fnGetCount: import("@angular/core").WritableSignal<
|
|
995
|
+
protected fnGetData: import("@angular/core").WritableSignal<fnGetDataResType<T> | null>;
|
|
996
|
+
protected fnGetCount: import("@angular/core").WritableSignal<fnGetCountResType<T> | null>;
|
|
996
997
|
protected fnMapEntity: import("@angular/core").WritableSignal<fnMapEntityType<T> | undefined>;
|
|
997
|
-
protected dataResource: import("@angular/core").
|
|
998
|
-
protected countResource: import("@angular/core").
|
|
998
|
+
protected dataResource: import("@angular/core").Signal<import("@angular/common/http").HttpResourceRef<T[]> | null>;
|
|
999
|
+
protected countResource: import("@angular/core").Signal<import("@angular/common/http").HttpResourceRef<number> | null>;
|
|
999
1000
|
/** Данные для табличного компонента. */
|
|
1000
1001
|
data: import("@angular/core").Signal<T[]>;
|
|
1001
1002
|
/** Количество записей по фильтру. */
|
|
1002
1003
|
length: import("@angular/core").Signal<number>;
|
|
1004
|
+
/** Глобальный индикатор загрузки (для спиннера на странице) */
|
|
1005
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
1003
1006
|
/** Доступность кнопки "Изменить". */
|
|
1004
1007
|
editBtnDisabled: boolean;
|
|
1005
1008
|
/** Доступность кнопки "Удалить". */
|
|
@@ -1024,11 +1027,10 @@ export declare class BaseSignalPageClass<T> implements OnDestroy {
|
|
|
1024
1027
|
tableState: import("@angular/core").WritableSignal<ITableState>;
|
|
1025
1028
|
constructor();
|
|
1026
1029
|
ngOnDestroy(): void;
|
|
1027
|
-
subscribeToLoadData(fnGetData:
|
|
1030
|
+
subscribeToLoadData(fnGetData: fnGetDataResType<T>, fnGetCount: fnGetCountResType<T>, fnMapEntity?: fnMapEntityType<T>): void;
|
|
1028
1031
|
setFilter(key: string, value: any): void;
|
|
1029
1032
|
onPageChange(pageState: IPageState): void;
|
|
1030
1033
|
onSortChange(sortState: ISortState): void;
|
|
1031
|
-
entityFactory(type: new () => T): T;
|
|
1032
1034
|
/** Событие изменение выбранных записей. */
|
|
1033
1035
|
onSelectionChange(selected: T[]): void;
|
|
1034
1036
|
/** Обновление доступности кнопки "Изменить" - вызывается при изменении выбранных записей. */
|
|
@@ -1070,10 +1072,10 @@ export declare abstract class BaseSignalServiceClass<T extends BaseSchemaClass>
|
|
|
1070
1072
|
protected directionParam: string;
|
|
1071
1073
|
protected apiContextName: string;
|
|
1072
1074
|
protected http: HttpClient;
|
|
1073
|
-
|
|
1075
|
+
protected readonly _refreshTrigger: import("@angular/core").WritableSignal<number>;
|
|
1074
1076
|
refresh(): void;
|
|
1075
1077
|
getObjects(): HttpResourceRef<T[] | undefined>;
|
|
1076
|
-
getObject(id: number | (() => number)): HttpResourceRef<T | undefined>;
|
|
1078
|
+
getObject(id: number | (() => number | null | undefined)): HttpResourceRef<T | null | undefined>;
|
|
1077
1079
|
getCount(): HttpResourceRef<number | undefined>;
|
|
1078
1080
|
getObjectsByPaging(pageIndex: () => number, pageSize: () => number, sortColumn: () => string, direction: () => string): HttpResourceRef<T[] | undefined>;
|
|
1079
1081
|
/**
|
|
@@ -1085,13 +1087,11 @@ export declare abstract class BaseSignalServiceClass<T extends BaseSchemaClass>
|
|
|
1085
1087
|
* Метод для СОЗДАНИЯ объекта (POST)
|
|
1086
1088
|
* Тип аргумента генерируется автоматически: это ваш тип T, но БЕЗ поля id.
|
|
1087
1089
|
*/
|
|
1088
|
-
create(dto: Omit<T, 'id'>): HttpResourceRef<T | undefined>;
|
|
1089
1090
|
editObject(entity: T): any;
|
|
1090
1091
|
/**
|
|
1091
1092
|
* Метод для ОБНОВЛЕНИЯ объекта (PUT / PATCH)
|
|
1092
1093
|
* Принимает id и частичный объект (все свойства T становятся необязательными, кроме id)
|
|
1093
1094
|
*/
|
|
1094
|
-
update(id: number, dto: Partial<Omit<T, 'id'>>): HttpResourceRef<T | undefined>;
|
|
1095
1095
|
/**
|
|
1096
1096
|
* Метод DELETE (Переписанный под новую архитектуру)
|
|
1097
1097
|
* Возвращает Observable. При подписке делает DELETE запрос,
|