UNPKG

@koalarx/ui

Version:

Koala UI is a Design System developed in Angular whose objective is to facilitate and make your development faster and simpler, making this framework your greatest ally.

43 lines (42 loc) 2.11 kB
import { KoalaDynamicFormFieldInterface } from "../../interfaces/koala.dynamic-form-field.interface"; import { DynamicFormTypeFieldEnum } from "../../enums/dynamic-form-type-field.enum"; import { FloatLabelType, MatFormFieldAppearance } from "@angular/material/form-field"; import { AsyncValidatorFn, UntypedFormBuilder, ValidatorFn } from "@angular/forms"; import { KoalaDynamicFormConfigInterface } from "../../interfaces/koala.dynamic-form-config.interface"; import { DeviceDetectorService } from "ngx-device-detector"; import { DynamicFormBuilder } from "../dynamic-form.builder"; export declare abstract class FieldBase { private formConfig; protected fb: UntypedFormBuilder; protected deviceService: DeviceDetectorService; protected readonly fieldConfig: KoalaDynamicFormFieldInterface; protected constructor(label: string, name: string, type: DynamicFormTypeFieldEnum, formConfig: KoalaDynamicFormConfigInterface, fb: UntypedFormBuilder, deviceService: DeviceDetectorService); hide(hide?: boolean): this; focus(): this; syncValidator(validators: ValidatorFn[]): this; asyncValidator(validators: AsyncValidatorFn | AsyncValidatorFn[]): this; disabled(disabled?: boolean): this; required(required?: boolean): this; textHint(hint: string): this; min(min: number): this; max(max: number): this; minLength(min: number): this; maxLength(max: number): this; multiple(multiple?: boolean): this; valueChanges<T>(fn: (value: T) => void): this; setValue(value: any): this; appearance(type?: MatFormFieldAppearance, floatLabel?: FloatLabelType): this; grid(size?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12, width?: number): this; setOptions(options: { value: any; name: string; }[]): this; addClass(className: string): this; addFieldClass(className: string): this; setCustomMasc(mask: string, config?: { thousandSeparator?: string; suffix?: string; prefix?: string; }): this; generate(): DynamicFormBuilder; }