@alauda-fe/common
Version:
Alauda frontend team common codes.
40 lines (39 loc) • 1.91 kB
TypeScript
import { DialogRef, MessageService } from '@alauda/ui';
import { OnDestroy, OnInit } from '@angular/core';
import { ValidatorFn } from '@angular/forms';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { StringMap } from '../../core/public-api';
import { TranslateService } from '../../translate/public-api';
import * as i0 from "@angular/core";
export interface UpdateKeyValueDialogData<R = unknown, Context = unknown, T = StringMap> {
title?: string;
keyValues?: T;
confirmButton?: string;
readonlyKeys?: Array<string | RegExp>;
onUpdate?: (keyValues: T) => Promise<R> | Observable<R>;
context?: Context;
updateSuccessMsg?: string;
updateFailMsg?: string;
validator?: {
key: ValidatorFn | ValidatorFn[];
value?: ValidatorFn | ValidatorFn[];
};
errorMapper?: Record<string, unknown>;
showMessage?: boolean;
}
export declare class UpdateKeyValueDialogComponent<R = unknown, Context = unknown, T = StringMap> implements OnInit, OnDestroy {
private readonly dialogRef;
private readonly message;
private readonly translate;
data: UpdateKeyValueDialogData<R, Context, T>;
readonly onUpdate$$: Subject<void>;
readonly submitting$$: BehaviorSubject<boolean>;
private readonly originalKeyValues;
keyValues: T;
private readonly destroy$$;
constructor(dialogRef: DialogRef<UpdateKeyValueDialogComponent<R, Context, T>, UpdateKeyValueDialogData<R, Context, T>>, message: MessageService, translate: TranslateService, data?: UpdateKeyValueDialogData<R, Context, T>);
ngOnInit(): void;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<UpdateKeyValueDialogComponent<any, any, any>, [null, null, null, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<UpdateKeyValueDialogComponent<any, any, any>, "ng-component", never, {}, {}, never, never, true, never>;
}