File

projects/ng-dynamic-forms/core/src/lib/model/dynamic-input-control.model.ts

Extends

DynamicFormValueControlModel

Index

Properties
Methods

Constructor

Protected constructor(config: DynamicInputControlModelConfig, layout?: DynamicFormControlLayout)
Parameters :
Name Type Optional
config DynamicInputControlModelConfig<T> No
layout DynamicFormControlLayout Yes

Properties

autoComplete
Type : string
Decorators :
@serializable()
autoFocus
Type : boolean
Decorators :
@serializable()
maxLength
Type : number | null
Decorators :
@serializable()
minLength
Type : number | null
Decorators :
@serializable()
placeholder
Type : string
Decorators :
@serializable()
prefix
Type : string | null
Decorators :
@serializable()
readOnly
Type : boolean
Decorators :
@serializable()
spellCheck
Type : boolean
Decorators :
@serializable()
suffix
Type : string | null
Decorators :
@serializable()
Private _value
Type : T | null
Decorators :
@serializable('value')
additional
Type : literal type | null
Decorators :
@serializable()
hint
Type : string | null
Decorators :
@serializable()
required
Type : boolean
Decorators :
@serializable()
tabIndex
Type : number | null
Decorators :
@serializable()
Private Readonly value$
Type : BehaviorSubject<T>
Readonly valueChanges
Type : Observable<T>
_disabled
Type : boolean
Decorators :
@serializable('disabled')
asyncValidators
Type : DynamicValidatorsConfig | null
Decorators :
@serializable()
controlTooltip
Type : string | null
Decorators :
@serializable()
Private Readonly disabled$
Type : BehaviorSubject<boolean>
Readonly disabledChanges
Type : Observable<boolean>
errorMessages
Type : DynamicValidatorsConfig | null
Decorators :
@serializable()
hidden
Type : boolean
Decorators :
@serializable()
id
Type : string
Decorators :
@serializable()
label
Type : string | null
Decorators :
@serializable()
labelTooltip
Type : string | null
Decorators :
@serializable()
layout
Type : DynamicFormControlLayout | null
Decorators :
@serializable()
name
Type : string
Decorators :
@serializable()
parent
Type : DynamicPathable | null
Default value : null
relations
Type : DynamicFormControlRelation[]
Decorators :
@serializable()
Abstract Readonly type
Type : string
updateOn
Type : DynamicFormHook | null
Decorators :
@serializable()
validators
Type : DynamicValidatorsConfig | null
Decorators :
@serializable()
_disabled
Type : boolean
Decorators :
@serializable('disabled')
Inherited from DynamicFormControlModel
asyncValidators
Type : DynamicValidatorsConfig | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel
controlTooltip
Type : string | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel
Private Readonly disabled$
Type : BehaviorSubject<boolean>
Inherited from DynamicFormControlModel
Readonly disabledChanges
Type : Observable<boolean>
Inherited from DynamicFormControlModel
errorMessages
Type : DynamicValidatorsConfig | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel
hidden
Type : boolean
Decorators :
@serializable()
Inherited from DynamicFormControlModel
id
Type : string
Decorators :
@serializable()
Inherited from DynamicFormControlModel
label
Type : string | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel
labelTooltip
Type : string | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel
layout
Type : DynamicFormControlLayout | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel
name
Type : string
Decorators :
@serializable()
Inherited from DynamicFormControlModel
parent
Type : DynamicPathable | null
Default value : null
Inherited from DynamicFormControlModel
relations
Type : DynamicFormControlRelation[]
Decorators :
@serializable()
Inherited from DynamicFormControlModel
Abstract Readonly type
Type : string
Inherited from DynamicFormControlModel
updateOn
Type : DynamicFormHook | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel
validators
Type : DynamicValidatorsConfig | null
Decorators :
@serializable()
Inherited from DynamicFormControlModel

Methods

getAdditional
getAdditional(key: string, defaultValue?: any | null)
Parameters :
Name Type Optional
key string No
defaultValue any | null Yes
Returns : any
toJSON
toJSON()
Returns : any
toJSON
toJSON()
Inherited from DynamicFormControlModel
Returns : any
import { DynamicFormValueControlModel, DynamicFormValueControlModelConfig } from "./dynamic-form-value-control.model";
import { DynamicFormControlLayout } from "./misc/dynamic-form-control-layout.model";
import { serializable } from "../decorator/serializable.decorator";
import { isBoolean, isNumber } from "../utils/core.utils";

export interface DynamicInputControlModelConfig<T> extends DynamicFormValueControlModelConfig<T> {

    autoComplete?: string;
    autoFocus?: boolean;
    maxLength?: number;
    minLength?: number;
    placeholder?: string;
    prefix?: string;
    readOnly?: boolean;
    spellCheck?: boolean;
    suffix?: string;
}

export abstract class DynamicInputControlModel<T> extends DynamicFormValueControlModel<T> {

    @serializable() autoComplete: string;
    @serializable() autoFocus: boolean;
    @serializable() maxLength: number | null;
    @serializable() minLength: number | null;
    @serializable() placeholder: string;
    @serializable() prefix: string | null;
    @serializable() readOnly: boolean;
    @serializable() spellCheck: boolean;
    @serializable() suffix: string | null;

    protected constructor(config: DynamicInputControlModelConfig<T>, layout?: DynamicFormControlLayout) {

        super(config, layout);

        this.autoComplete = config.autoComplete || "on";
        this.autoFocus = isBoolean(config.autoFocus) ? config.autoFocus : false;
        this.maxLength = isNumber(config.maxLength) ? config.maxLength : null;
        this.minLength = isNumber(config.minLength) ? config.minLength : null;
        this.placeholder = config.placeholder || "";
        this.prefix = config.prefix || null;
        this.readOnly = isBoolean(config.readOnly) ? config.readOnly : false;
        this.spellCheck = isBoolean(config.spellCheck) ? config.spellCheck : false;
        this.suffix = config.suffix || null;
    }
}

result-matching ""

    No results matching ""