mobx-react-form
Version:
Reactive MobX Form State Management
197 lines • 5.64 kB
TypeScript
import Base from "./Base";
import { OptionsModel } from "./models/OptionsModel";
import { FieldInterface, FieldConstructor } from "./models/FieldInterface";
interface ValidationAsyncDataInterface {
valid?: boolean;
message?: string;
}
export default class Field extends Base implements FieldInterface {
hasInitialNestedFields: boolean;
incremental: boolean;
id: any;
key: any;
name: any;
$observers: any;
$interceptors: any;
$converter: ($: any) => any;
$input: ($: any) => any;
$output: ($: any) => any;
_value: Function;
_label: Function;
_placeholder: Function;
_disabled: Function;
_rules: Function;
_related: Function;
_deleted: Function;
_validatedWith: Function;
_validators: Function;
_bindings: Function;
_extra: Function;
_options: Function;
_autoFocus: Function;
_inputMode: Function;
$options: OptionsModel | undefined;
$value: any;
$type: string | undefined;
$label: string | undefined;
$placeholder: string | undefined;
$default: any;
$initial: any;
$bindings: any;
$extra: any;
$related: string[] | undefined;
$validatedWith: string | undefined;
$validators: any[] | undefined;
$rules: string[] | undefined;
$disabled: boolean;
$focused: boolean;
$blurred: boolean;
$deleted: boolean;
$autoFocus: boolean;
$inputMode: string;
$ref: any;
$nullable: boolean;
$autoComplete: string | undefined;
showError: boolean;
errorSync: string | null;
errorAsync: string | null;
validationErrorStack: string[];
validationFunctionsData: any[];
validationAsyncData: ValidationAsyncDataInterface | undefined;
debouncedValidation: any;
disposeValidationOnBlur: any;
disposeValidationOnChange: any;
files: any;
constructor({ key, path, struct, data, props, update, state, }: FieldConstructor);
get checkValidationErrors(): boolean;
set value(newVal: any);
handleSetNumberValue(newVal: any): boolean;
get actionRunning(): boolean;
get checked(): boolean;
get value(): any;
get initial(): any;
get default(): any;
set initial(val: any);
set default(val: any);
get nullable(): boolean;
get autoComplete(): string | undefined;
get ref(): any;
get extra(): any;
get autoFocus(): any;
get inputMode(): any;
get type(): any;
get label(): any;
get placeholder(): any;
get options(): any;
get bindings(): any;
get related(): any;
get disabled(): any;
get rules(): any;
get validators(): any;
get validatedWith(): any;
get validatedValue(): any;
get error(): string;
get hasError(): boolean;
get isValid(): boolean;
get isDefault(): boolean;
get isDirty(): boolean;
get isPristine(): boolean;
get isEmpty(): boolean;
get focused(): boolean;
get blurred(): boolean;
get touched(): boolean;
get deleted(): boolean;
sync: (e: any, v?: any) => void;
onSync: (...args: any) => any;
onChange: (...args: any) => any;
onToggle: (...args: any) => any;
onBlur: (...args: any) => any;
onFocus: (...args: any) => any;
onDrop: (...args: any) => any;
onKeyDown: (...args: any) => any;
onKeyUp: (...args: any) => any;
setupField($key: string, $path: string, $struct: string, $data: any, $props: any, update: boolean): void;
getComputedProp(key: string): any;
initNestedFields(field: any, update: boolean): void;
invalidate(message: string, deep?: boolean, async?: boolean): void;
setValidationAsyncData(valid?: boolean, message?: string): void;
resetValidation(deep?: boolean): void;
clear(deep?: boolean, execHook?: boolean): void;
reset(deep?: boolean, execHook?: boolean): void;
focus(): void;
blur(): void;
trim(): void;
showErrors(show?: boolean, deep?: boolean): void;
observeValidationOnBlur(): void;
observeValidationOnChange(): void;
initMOBXEvent(type: string): void;
bind(props?: {}): {
ref: ($ref: any) => any;
key?: any;
id?: any;
path?: any;
name?: any;
fields?: any;
type?: any;
computed?: any;
value?: any;
initial?: any;
default?: any;
checked?: any;
label?: any;
placeholder?: any;
error?: any;
validatedWith?: any;
validators?: any;
rules?: any;
related?: any;
options?: any;
extra?: any;
bindings?: any;
hooks?: any;
handlers?: any;
converter?: any;
input?: any;
output?: any;
interceptors?: any;
observers?: any;
disabled?: any;
deleted?: any;
blurred?: any;
validating?: any;
submitting?: any;
clearing?: any;
resetting?: any;
changed?: any;
touched?: any;
focused?: any;
isEmpty?: any;
isDefault?: any;
isPristine?: any;
isDirty?: any;
isValid?: any;
hasError?: any;
onInit?: any;
onSync?: any;
onChange?: any;
onBlur?: any;
onFocus?: any;
onToggle?: any;
onDrop?: any;
onSubmit?: any;
onReset?: any;
onClear?: any;
onAdd?: any;
onDel?: any;
autoFocus?: any;
inputMode?: any;
onKeyDown?: any;
onKeyUp?: any;
class?: any;
nullable?: any;
autoComplete?: any;
};
update(fields: any): void;
}
export {};
//# sourceMappingURL=Field.d.ts.map