import { OnInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { SCCoreService } from '../core/sc-core.service'; import { ValueByPipe } from '../pipes/valueBy'; import { SCDropzoneComponent } from '../sc-dropzone'; import { SCPDFViewerAction, SCPDFViewerActionEvent } from '../sc-pdf-viewer'; import { SCDataUrlConfig, SCSelectDisplay } from '../sc-select'; import { SCCustomInputsDialogService } from './service/sc-custom-inputs-dialog.service'; import * as i0 from "@angular/core"; export interface SCCustomInputsDialogConfig { dialogCssClasses?: string; dialogDisableClose?: boolean; textConfig: SCCustomInputsDialogTextConfig; actions: SCCustomInputsDialogAction[]; fields?: SCCustomInputsDialogField[]; dataToPatch?: any; saveUrl?: string; saveMethod?: 'POST' | 'PATCH' | 'PUT'; dropZone?: SCCustomInputsDialogDropZone; showErrorOnSave?: boolean; catchError?: boolean; } export interface SCCustomInputsDialogSizeConfig { width?: string; height?: string; minWidth?: string; minHeight?: string; } export interface SCCustomInputsDialogTextConfig { headerText: string; bodyText?: string; bodyTextClasses?: string; lineBreak?: string; } export interface SCCustomInputsDialogDropZone { position: 'inline' | 'side'; infoText: string; pdfActions?: SCPDFViewerAction[]; multipleFiles?: Boolean; } export interface SCCustomInputsDialogField { index: string; type: 'text' | 'textarea' | 'number' | 'price' | 'percent' | 'date' | 'bool' | 'autocomplete' | 'select' | 'autocomplete-lazy' | 'select-lazy' | 'select-multiple' | 'select-lazy-multiple'; label: string; suffixText?: string; isRequired?: boolean; requiredMinValue?: number; maxValue?: number; isDisabled?: boolean; isHidden?: boolean; deletable?: boolean; cols?: number; cssClasses?: string; selectedValue?: any; defaultValue?: any | SCCustomInputsDefaultValue; urlConfig?: SCDataUrlConfig; urlConfigDependency?: SCCustomInputsUrlConfig; behaviorDependencies?: SCCustomInputsBehaviorDependency[]; data?: SCCustomInputsDialogFieldData; minDate?: Date; maxDate?: Date; disableSearch?: boolean; emitAfterCalculate?: boolean; calculations?: SCCustomInputsDialogFieldCalculation[]; } export interface SCCustomInputsDefaultValue { key: string; } export interface SCCustomInputsBehaviorDependency { behavior: 'disabled' | 'hidden' | 'required' | 'empty'; conditions: SCCustomInputsBehaviorDependencyCondition[]; combineConditions?: 'AND' | 'OR'; } export interface SCCustomInputsBehaviorDependencyCondition { dependencyIndex: string; compareIndex?: string; compareIndexValueBy?: string; valueBy: string; compare?: '==' | '<' | '>' | '<=' | '>=' | '!='; value?: any; currentState?: boolean; } export interface SCCustomInputsUrlConfig { unselectedState?: 'disabled' | 'hidden'; urlConfigPlaceholder?: SCCustomInputsUrlConfigPlaceholder; urlConfigParams?: SCCustomInputsUrlConfigParam[]; } export interface SCCustomInputsUrlConfigPlaceholder { dependencyIndex: string; defaultUrl?: string; dataUrlWithPlaceholderText?: string; placeholderText: string; valueBy: string; } export interface SCCustomInputsUrlConfigParam { dependencyIndex: string; key: string; valueBy: string; } export interface SCCustomInputsDialogFieldCalculation { key?: string; valueBy?: string; value?: any; operator?: '*' | '/' | '+' | '-'; operatorOptions?: any; calculations?: SCCustomInputsDialogFieldCalculation[]; } export interface SCCustomInputsDialogFieldData { dataToShow?: any[]; displayBy?: string; valueBy?: string; displayByArray?: SCSelectDisplay[]; compareBy?: string; searchForm?: FormControl; } export interface SCCustomInputsDialogAction { label: string; index: string; color?: string; type?: 'DEFAULT' | 'SAVE' | 'CLOSE' | 'SAVE_AND_NEW'; } export declare class SCCustomInputsDialogComponent implements OnInit { dialogRef: MatDialogRef; data: any; dialogService: MatDialog; private service; private _fb; coreService: SCCoreService; private valueByPipe; private translateService; config: SCCustomInputsDialogConfig; textConfig: SCCustomInputsDialogTextConfig; fields: SCCustomInputsDialogField[]; actions: SCCustomInputsDialogAction[]; private $actionClicked; private $pdfActionClicked; private $errorOnSave; form: FormGroup; errorMessage: string; processingSave: boolean; fileToShow: any; files: any[]; constructor(dialogRef: MatDialogRef, data: any, dialogService: MatDialog, service: SCCustomInputsDialogService, _fb: FormBuilder, coreService: SCCoreService, valueByPipe: ValueByPipe, translateService: TranslateService); dropZone: SCDropzoneComponent; ngOnInit(): void; addFieldToForm(field: SCCustomInputsDialogField): void; setControlForField(field: SCCustomInputsDialogField, validators: Validators[]): FormControl; getDefaultValue(field: SCCustomInputsDialogField, getFromConfig?: boolean): any; makeFieldCalculations(fieldChangedIndex: string): void; hasCalculationIndex(index: string, calculations: SCCustomInputsDialogFieldCalculation[]): boolean; getCalculationValue(calculation: SCCustomInputsDialogFieldCalculation): any; makeCalculations(calculations: SCCustomInputsDialogFieldCalculation[]): number; setBehavior(field: SCCustomInputsDialogField, dependency: SCCustomInputsBehaviorDependency, behaviorValue?: boolean): void; checkBehaviorDependency(changedField: SCCustomInputsDialogField): void; checkConditions(conditionsAreRight: boolean[], combineConditions?: 'AND' | 'OR'): boolean; compareValueWithCondition(value: any, condition: SCCustomInputsBehaviorDependencyCondition): boolean; checkDependentUrlConfigs(ChangedField: SCCustomInputsDialogField): void; setUnselectedState(field: SCCustomInputsDialogField, state: boolean): void; setDependentFieldsDefaultUrl(field: SCCustomInputsDialogField, hasValue: boolean): void; handleDependentUrlPlaceholder(changedField: SCCustomInputsDialogField, dependentField: SCCustomInputsDialogField, configPlaceholder: SCCustomInputsUrlConfigPlaceholder): void; handleDependentUrlParams(changedField: SCCustomInputsDialogField, dependentField: SCCustomInputsDialogField, configParam: SCCustomInputsUrlConfigParam): void; handleFilesDropped(event: any): void; openDropzone(): void; FileListItems(files: any): FileList; actionPdf(event: SCPDFViewerActionEvent): void; close(data?: any): void; handleActionClicked(event: MouseEvent, action: SCCustomInputsDialogAction): void; save(event: MouseEvent, action: SCCustomInputsDialogAction, doClear: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }