@kuzntsv/uikit 1.0.42 → 1.0.43
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;
|
|
@@ -982,24 +986,24 @@ export declare class BaseSignalPageClass<T> implements OnDestroy {
|
|
|
982
986
|
/** Список ролей, для которых скрыть элемент. */
|
|
983
987
|
hideRoles: string[];
|
|
984
988
|
/** Загрузка данных. */
|
|
985
|
-
loadData$: Subject<null>;
|
|
986
989
|
/** Загрузка количества записей. */
|
|
987
|
-
loadLength$: Subject<null>;
|
|
988
990
|
/** Очистка фильтра. (для очистки присвоить пустой объект '{}'). */
|
|
989
991
|
clearFilters: import("@angular/core").WritableSignal<any>;
|
|
990
992
|
/** Разрешен выбор нескольких строк. */
|
|
991
993
|
allowMultiSelect: boolean;
|
|
992
994
|
/** Выбранные строки в таблице. */
|
|
993
995
|
selected: T[];
|
|
994
|
-
protected fnGetData: import("@angular/core").WritableSignal<
|
|
995
|
-
protected fnGetCount: import("@angular/core").WritableSignal<
|
|
996
|
+
protected fnGetData: import("@angular/core").WritableSignal<fnGetDataResType<T> | null>;
|
|
997
|
+
protected fnGetCount: import("@angular/core").WritableSignal<fnGetCountResType<T> | null>;
|
|
996
998
|
protected fnMapEntity: import("@angular/core").WritableSignal<fnMapEntityType<T> | undefined>;
|
|
997
|
-
protected dataResource: import("@angular/core").
|
|
998
|
-
protected countResource: import("@angular/core").
|
|
999
|
+
protected dataResource: import("@angular/core").Signal<import("@angular/common/http").HttpResourceRef<T[]> | null>;
|
|
1000
|
+
protected countResource: import("@angular/core").Signal<import("@angular/common/http").HttpResourceRef<number> | null>;
|
|
999
1001
|
/** Данные для табличного компонента. */
|
|
1000
1002
|
data: import("@angular/core").Signal<T[]>;
|
|
1001
1003
|
/** Количество записей по фильтру. */
|
|
1002
1004
|
length: import("@angular/core").Signal<number>;
|
|
1005
|
+
/** Глобальный индикатор загрузки (для спиннера на странице) */
|
|
1006
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
1003
1007
|
/** Доступность кнопки "Изменить". */
|
|
1004
1008
|
editBtnDisabled: boolean;
|
|
1005
1009
|
/** Доступность кнопки "Удалить". */
|
|
@@ -1024,7 +1028,7 @@ export declare class BaseSignalPageClass<T> implements OnDestroy {
|
|
|
1024
1028
|
tableState: import("@angular/core").WritableSignal<ITableState>;
|
|
1025
1029
|
constructor();
|
|
1026
1030
|
ngOnDestroy(): void;
|
|
1027
|
-
subscribeToLoadData(fnGetData:
|
|
1031
|
+
subscribeToLoadData(fnGetData: fnGetDataResType<T>, fnGetCount: fnGetCountResType<T>, fnMapEntity?: fnMapEntityType<T>): void;
|
|
1028
1032
|
setFilter(key: string, value: any): void;
|
|
1029
1033
|
onPageChange(pageState: IPageState): void;
|
|
1030
1034
|
onSortChange(sortState: ISortState): void;
|
|
@@ -1070,7 +1074,7 @@ export declare abstract class BaseSignalServiceClass<T extends BaseSchemaClass>
|
|
|
1070
1074
|
protected directionParam: string;
|
|
1071
1075
|
protected apiContextName: string;
|
|
1072
1076
|
protected http: HttpClient;
|
|
1073
|
-
|
|
1077
|
+
protected readonly _refreshTrigger: import("@angular/core").WritableSignal<number>;
|
|
1074
1078
|
refresh(): void;
|
|
1075
1079
|
getObjects(): HttpResourceRef<T[] | undefined>;
|
|
1076
1080
|
getObject(id: number | (() => number)): HttpResourceRef<T | undefined>;
|