Interface ControlLike<FIELD, VALUE, CHILD_FIELD>

interface ControlLike<FIELD, VALUE, CHILD_FIELD> {
    moveControl: (<IDENTIFIER>(identifier: IDENTIFIER, index: number) => void);
    removeControl: (<IDENTIFIER>(identifier: IDENTIFIER) => void);
    updateState: (<T>(changes: T) => Promise<boolean>);
    get activeControls(): MFC<CHILD_FIELD>[];
    get activeExtensions(): ExtensionBase[];
    get afterChanges(): Observable<ControlChange>;
    get changes(): BehaviorSubject<ControlChange>;
    get childChanges(): Observable<ControlChange>;
    get config(): MargaritaFormConfig;
    get context(): ControlContext<MFC<FIELD>, never>;
    get controls(): MFC<CHILD_FIELD>[];
    get currentRef(): null | MargaritaFormBaseElement<MFC<MFGF<FieldParams>>, HTMLElement>;
    get expectArray(): boolean;
    get expectChildControls(): boolean;
    get expectFlat(): boolean;
    get expectGroup(): boolean;
    get extensions(): Extensions;
    get fieldChanges(): Observable<FIELD>;
    get fields(): CHILD_FIELD[];
    get grouping(): MargaritaFormGroupings;
    get hasActiveControls(): boolean;
    get hasControls(): boolean;
    get index(): number;
    get isDefaultValue(): boolean;
    get isInitialValue(): boolean;
    get isRoot(): boolean;
    get name(): FIELD["name"] extends string
        ? any[any]
        : string;
    get onSubmit(): Observable<MFC<FIELD>>;
    get ownChanges(): Observable<ControlChange>;
    get parent(): MFC<MFGF<FieldParams>>;
    get resolvers(): MargaritaFormResolvers;
    get root(): MFC<MFGF<FieldParams>>;
    get state(): MargaritaFormState;
    get stateChanges(): Observable<MargaritaFormState>;
    get validators(): MargaritaFormValidators;
    value: VALUE;
    get valueChanges(): Observable<VALUE>;
    get valueHash(): string;
    get visibleControls(): MFC<CHILD_FIELD>[];
    activate(): void;
    addControl<CHILD_FIELD>(field: CHILD_FIELD, replaceExisting?: boolean): MFC<CHILD_FIELD>;
    addValue(value: ControlValueItem<FIELD>, mustBeUnique?: boolean, setAsDirty?: boolean, emitEvent?: boolean): void;
    appendControl<CHILD_FIELD>(fieldTemplate?: string | CHILD_FIELD, overrides?: Partial<CHILD_FIELD>): null | MFC<CHILD_FIELD>;
    appendControls<CHILD_FIELD>(fieldTemplates: string[] | CHILD_FIELD[]): MFC<CHILD_FIELD>[];
    cleanup(): void;
    clear(resetChildren?: boolean): void;
    clearValue(setDirtyAs?: boolean, resetChildren?: boolean, origin?: boolean): void;
    deactivate(): void;
    disable(): void;
    dispatch(action: any, setAsDirty?: boolean, emitEvent?: boolean): Promise<void>;
    emitChange(name: ControlChangeName, change: unknown, origin?: MFC<any>): void;
    enable(): void;
    findControl<FIELD_TYPE, IDENTIFIER, _T>(identifier: IDENTIFIER): undefined | _T;
    get<VALUE>(key: OrString | (keyof MFC<MFGF<FieldParams>>)): VALUE;
    getActiveSiblings<SIBLING_FIELD>(): MFC<SIBLING_FIELD>[];
    getControl<FIELD_TYPE, IDENTIFIER, _T>(identifier: IDENTIFIER): ControlValue<FIELD> extends any[]
        ? undefined | _T
        : _T;
    getControls<FIELD>(states?: string | string[]): MFC<FIELD>[];
    getFieldValue<OUTPUT>(key: keyof FIELD, defaultValue?: OUTPUT): OUTPUT;
    getManager<MANAGER>(key: string): MANAGER;
    getOrAddControl<CHILD_FIELD>(field: CHILD_FIELD): MFC<CHILD_FIELD>;
    getPath(outcome?:
        | "controls"
        | "keys"
        | "default"
        | "uids"): ControlPath;
    getSibling<SIBLING_FIELD>(identifier: ControlIdentifier): MFC<SIBLING_FIELD>;
    getSiblings<SIBLING_FIELD>(): MFC<SIBLING_FIELD>[];
    getState<T>(key: T): MargaritaFormState[T];
    getStateChanges<T>(key: T): Observable<MargaritaFormState[T]>;
    hasControl(identifier: ControlIdentifier): boolean;
    moveToIndex(index: number): void;
    patchValue(value: undefined | null | Partial<VALUE>, setAsDirty?: boolean, emitEvent?: boolean): void;
    queryControls<RESULT_FIELD>(query: ((control: MFC<MFGF<FieldParams>>) => boolean), recursive?: boolean): MFC<RESULT_FIELD>[];
    registerResolver(key: string, resolver: MargaritaFormResolver): void;
    registerValidator(key: string, validator: MargaritaFormValidator): void;
    reInitialize(): void;
    remove(): void;
    removeValue(value: ControlValueItem<FIELD>, setAsDirty?: boolean, emitEvent?: boolean): void;
    reset(resetChildren?: boolean, origin?: boolean): void;
    resetState(respectField?: boolean, resetChildren?: boolean): void;
    resetValue(setDirtyAs?: boolean, resetChildren?: boolean, origin?: boolean): void;
    setField(field: FIELD, resetControl?: boolean): Promise<void>;
    setRef(ref: any): void;
    setValue(value: undefined | null | VALUE, setAsDirty?: boolean, emitEvent?: boolean): void;
    submit<OUTPUT, PARAMS>(params?: PARAMS): Promise<OUTPUT>;
    toggleActive(): void;
    toggleEnabled(): void;
    toggleValue(value: ControlValueItem<FIELD>, mustBeUnique?: boolean, setAsDirty?: boolean, emitEvent?: boolean): void;
    updateField(field: Partial<FIELD>, resetControl?: boolean): Promise<void>;
    updateKey(): void;
    updateStateValue<T>(key: T, value: MargaritaFormState[T]): Promise<boolean>;
    updateSyncId(): void;
    updateUid(): void;
    validate(setAsTouched?: boolean): Promise<boolean>;
}

Type Parameters

Implemented by

Properties

moveControl: (<IDENTIFIER>(identifier: IDENTIFIER, index: number) => void)
removeControl: (<IDENTIFIER>(identifier: IDENTIFIER) => void)
updateState: (<T>(changes: T) => Promise<boolean>)

Accessors

Methods

  • Parameters

    • OptionalsetDirtyAs: boolean
    • OptionalresetChildren: boolean
    • Optionalorigin: boolean

    Returns void

  • Parameters

    • action: any
    • OptionalsetAsDirty: boolean
    • OptionalemitEvent: boolean

    Returns Promise<void>

  • Parameters

    • value: undefined | null | Partial<VALUE>
    • OptionalsetAsDirty: boolean
    • OptionalemitEvent: boolean

    Returns void

  • Parameters

    • OptionalsetDirtyAs: boolean
    • OptionalresetChildren: boolean
    • Optionalorigin: boolean

    Returns void