import { InterceptorType, MessagePosition, MessageSeverity } from './enums'; import { DestroyRef, QueryList, Type } from '@angular/core'; import { FormItem } from './shared/classes/formitem.class'; import { CfDragDirective, CfFormArray, CfFormControl, CfFormErrors, CfFormGroup, CfWebSocket, TranslationsService } from './shared'; import { Observable } from 'rxjs'; import { IsActiveMatchOptions } from '@angular/router'; import { CfDialogRef } from './shared/classes/dialogref.class'; import { AbstractControl, FormControl } from '@angular/forms'; export type DropdownQueryMode = 'contains' | 'startwith'; export interface MessageConfiguration { closeable: boolean; position: MessagePosition; lifetime: number | null; severity: MessageSeverity; keepOnHover: boolean; } export interface Message extends MessageConfiguration { title: string; message: string; } export interface MessagePartial extends Partial { title: string; message: string; } export interface LabelValue { label: string; value: T; } export interface LabelValueDisabled { label: string; value: T; disabled?: boolean; } export interface BreadcrumbMenuItem { label?: string; icon?: string; routerLink?: string; } export type TreeLike = T & { children: TreeLike[]; }; export interface TreeNode { data: T; children: TreeNode[]; selected: boolean; partialSelected: boolean; parent: TreeNode | null; opened: boolean; level: number; } export interface TreeNodeOrderParams { node: TreeNode; way: 'up' | 'down'; parent: TreeNode | null; siblingsValues: any[]; siblingsValuesAfter: any[]; oldPosition: number; newPosition: number; } export declare enum CfDragDropEventType { DRAG_START = 0, DRAG_END = 1, DROP_END = 2 } export interface CfDragDropEvent { type: CfDragDropEventType; tag: string | null; data: any; dragDropListGroup: string | null; dragDirective: CfDragDirective; } export declare enum MaskPartType { NUMERIC = "NUMERIC", ALPHABETICAL = "ALPHABETICAL", ALPHANUMERIC = "ALPHANUMERIC", SKIP = "SKIP" } export interface MaskPart { type: MaskPartType; displayChar: string; originalMaskPart: string; enteredChar: string | null; } export interface RadioServiceCheckEvent { group: string; value: any; } export declare enum LockAction { LOCK = "LOCK", KEEP = "KEEP", RELEASE = "RELEASE" } export interface Lock { action: LockAction; module: string; id: string; } export type LockHeaders = { [name: string]: string; }; export interface LockResponse { action: LockAction; module: string; id: string; fullname: string; userid: number; } export declare enum StoreServiceMode { LOCAL = "LOCAL", SESSION = "SESSION" } export declare enum AcceptValidationMode { PATTERN = "PATTERN", TEXT = "TEXT" } export type CfDialogConfigurationBeforeClose = null | (() => boolean | Observable | Promise) | Observable | Promise; export interface CfDialogConfiguration { showCloseIcon?: boolean; beforeClose?: CfDialogConfigurationBeforeClose; ignoreKeyUp?: boolean; data?: any; noPadding?: boolean; keepActiveElement?: boolean; containerClasses?: string[]; dialogClasses?: string[]; title?: string | null; contentElement?: Element | null; single?: boolean; width?: string | null; height?: string | null; } export interface CfDialogCloseParams { message?: MessagePartial; } export interface ConfirmConfiguration { title: string; text: string; acceptText: string; declineText: string; hideDeclineButton?: boolean; switchButtonColors?: boolean; acceptTimeout?: number; acceptValidationText?: string; acceptValidationMode?: AcceptValidationMode; acceptValidationLabel?: string; } export interface AlertConfiguration { title: string; text: string; showCloseIcon?: boolean; button?: Partial; } export interface LoadingConfiguration { title: string; text: string; loadingIcon?: string; iconSize?: number; } export interface AlertButtonConfiguration { label: string; severity: string; callback: (params: { dialogRef: CfDialogRef; }) => void; translateLabel: boolean; focus: boolean; } export interface ButtonConfiguration { label: string; severity: string; callback?: (params: { dialogRef: CfDialogRef; }) => void; routerLink?: any; focus?: boolean; permission?: string | string[]; translateLabel?: boolean; } export interface ModalWithButtonsConfiguration { title: string; text: string; showCloseIcon?: boolean; buttons: ButtonConfiguration[]; } export interface MenuItem { title: string; routerLink?: any[]; routerLinkActiveOptions?: { exact: boolean; } | IsActiveMatchOptions; callback?: () => any; permissions?: string[]; icon?: string; iconUrl?: string; children?: MenuItem[]; } export interface FormatNumberOptions { minDecimalCount: number; maxDecimalCount: number; enableThousandSeparator: boolean; decimalSign: string; thousandSeparator: string; } export interface CfWebSocketConfiguration { url: string | null; autoReconnectOnClose: boolean; onCloseCallback: ((params: { cfWebSocket: CfWebSocket; closeEvent: CloseEvent; }) => void) | null; } export interface CfContextMenuItem { title?: string; icon?: string | null; handler?: (() => void) | null; closeAfterHandlerClick?: boolean; hide?: boolean; separator?: boolean; children?: CfContextMenuItem[]; } export interface CfContextMenuItemFull { title: string; icon: string | null; handler: (() => void) | null; closeAfterHandlerClick: boolean; hide: boolean; separator: boolean; children: CfContextMenuItemFull[]; } export type EnterAsTabCallbackFunction = (params: EnterAsTabCallbackFunctionParams) => boolean; export interface EnterAsTabCallbackFunctionParams { actualIndex: number | null; nextTargetIndex: number; availableIndexes: number[]; lastAvailableIndex: number | null; firstAvailableIndex: number | null; items: QueryList; } export interface DragDropListSortEvent { oldPosition: number | null; newPosition: number | null; dragDirective: CfDragDirective; dragData: any; } export type TranslationType = { [key: string]: TranslationType | string; }; export type MultiLangData = { [key: string]: T; }; export interface FileSource { file?: File; dataUri?: string; fileUrl?: string; fileName?: string; } export type CfFormErrorsMap = Map; export type CfFormError = { label: string | null; tags: string[]; labelPath: string[]; value: any; errors: CfFormErrorItem[]; }; export interface CfFormErrorItem { key: string; value: any; } export declare enum Precheck { ERROR = "ERROR", WARNING = "WARNING" } export type PrecheckNullable = Precheck | null; export interface CfObservableSubscribeWithOptions { skipInterceptors?: InterceptorType[]; precheck?: Precheck; confirmAccept?: ConfirmConfiguration | string; confirmAcceptDialogConfiguration?: CfDialogConfiguration; messageAfterSuccess?: MessagePartial; showLoading?: LoadingConfiguration; showLoadingDialogConfiguration?: CfDialogConfiguration; destroyRef?: DestroyRef; } export type PredefinedDialogs = { [key: string]: (() => Promise>) | { component: () => Promise>; configuration: CfDialogConfiguration; }; }; export interface InputTextDialogConfiguration { title: string; inputLabel: string; description?: string; formControl?: FormControl; saveButtonLabel?: string; closeButtonLabel?: string; } export interface InputTextareaDialogConfiguration { title: string; inputLabel: string; textareaHeight?: string; description?: string; formControl?: FormControl; saveButtonLabel?: string; closeButtonLabel?: string; } export interface ErrorTranslateHandlerFunctionParams { key: string; value: any; translationsService: TranslationsService; localeId: string; } export type ErrorTranslateHandlerFunction = (params: ErrorTranslateHandlerFunctionParams) => string; export type ErrorTranslateHandlers = Map; export interface ShowFormErrorsModalParams { title: string; dialogConfiguration?: CfDialogConfiguration; cfFormErrors?: CfFormErrors; cfFormGroup?: CfFormGroup; cfFormControl?: CfFormControl; cfFormArray?: CfFormArray; } export interface ShowFormErrorsModalFormGroupParams extends ShowFormErrorsModalParams { labelPath?: string[]; } export interface MockResponses { pathname?: { [key: string]: any; }; url?: { [key: string]: any; }; }